12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- import ViewObject from "../../../main/ViewObject";
- import GoodItem from "../../common/GoodItem";
- import FFCalAttr from "../../data/FFCalAttr";
- import { EquipAttr } from "../../data/udata/Player";
- const {ccclass, property} = cc._decorator;
- /**
- * 自动穿装备
- */
- @ccclass
- export default class FFAutoEquip extends ViewObject {
- @property(GoodItem)
- mGoodItem: GoodItem = null;
- @property(cc.Label)
- mAtk: cc.Label = null;
- @property(cc.Label)
- mDef: cc.Label = null;
- @property(cc.Label)
- mHp: cc.Label = null;
- @property(cc.Label)
- mMj: cc.Label = null;
- @property(cc.Label)
- mAutoTime: cc.Label = null;
- /**
- * 设置装备
- * @param equipData
- */
- public setEquip(equipData:EquipAttr):boolean{
- this.mGoodItem.initEquip(this.main,equipData)
- let dataAttr = FFCalAttr.getEquipAttr(this.main,equipData,this.mGoodItem.equipData)
- if(dataAttr.atk > 0){
- this.mAtk.node.active = true
- }else{
- this.mAtk.node.active = false
- }
- if(dataAttr.def > 0){
- this.mDef.node.active = true
- }else{
- this.mDef.node.active = false
- }
- if(dataAttr.hp > 0){
- this.mHp.node.active = true
- }else{
- this.mHp.node.active = false
- }
- if(dataAttr.sp > 0){
- this.mMj.node.active = true
- }else{
- this.mMj.node.active = false
- }
- //如果是武器
- if(this.mGoodItem.equipData.type == 1){//武器
- if(this.mGoodItem.equipData.occ == 1){//弓手
-
- }else if(this.mGoodItem.equipData.occ == 2){//法师
- }else if(this.mGoodItem.equipData.occ == 3){//战士
- }
- }else if(this.mGoodItem.equipData.type == 2){//帽子
- }else if(this.mGoodItem.equipData.type == 3){//衣服
- }else if(this.mGoodItem.equipData.type == 4){//戒指
- }else if(this.mGoodItem.equipData.type == 5){//服装
- }
- return false
- }
- public onclick(){
- }
- }
|