取消掉副英雄
This commit is contained in:
@@ -17,24 +17,18 @@ const { ccclass, property } = _decorator;
|
||||
export class FightConComp extends Component {
|
||||
//装备 及 光环效果 物品存在生效 enemy_buff 是针对 怪物的debuff 偶尔也有buff 需要注意
|
||||
hero_buff=getBuffNum()
|
||||
friend_buff=getBuffNum()
|
||||
enemy_buff=getBuffNum()
|
||||
|
||||
|
||||
//注意临时buff和debuff 每种buff的值 必须都一样 多种值 战斗处理复杂 暂时放弃
|
||||
atk_type:number=0;
|
||||
//装备特殊属性 触发后 局内永久生效
|
||||
friend_alive_cd:number=FightSet.FRIEND_LIVE_CD
|
||||
atk_add_friend_atk:number=0
|
||||
atk_add_friend_hp:number=0
|
||||
atk_add_glod:number=0
|
||||
atk_add_master_atk:number=0
|
||||
atk_add_master_hp:number=0
|
||||
double_dead:number=0
|
||||
double_atked:number=0
|
||||
friend_atked_add_skill_stone:number=0
|
||||
atked_add_skill_stone:number=0
|
||||
atk_add_value:number=0
|
||||
friend_get_master_equip:number=0
|
||||
|
||||
//卡牌特效
|
||||
card_atk_add:number=0 //卡牌特效 攻击提高攻击力效果 额外添加值
|
||||
@@ -56,50 +50,34 @@ export class FightConComp extends Component {
|
||||
|
||||
}
|
||||
protected start(): void {
|
||||
this.friend_alive_cd=FightSet.FRIEND_LIVE_CD
|
||||
|
||||
}
|
||||
change_equip_special_attr(e:GameEvent,data:any){
|
||||
console.log("[FightConComp]:change_equip_special_attr",data)
|
||||
this.atk_add_value=data[EquipSpecialAttr.ATK_ADD_VALUE]
|
||||
this.atk_add_friend_atk=data[EquipSpecialAttr.ATK_ADD_FRIEND_ATK]+this.atk_add_value+(this.card_atk_add > 0 ? this.card_atk_add:0) //装备特殊属性 英雄/伙伴 攻击力增加
|
||||
this.atk_add_friend_hp=data[EquipSpecialAttr.ATK_ADD_FRIEND_HP]+this.atk_add_value+(this.card_hp_add > 0 ? this.card_hp_add:0) //装备特殊属性 英雄/伙伴 生命值增加
|
||||
this.atk_add_glod=data[EquipSpecialAttr.ATK_ADD_GLOD]
|
||||
this.atk_add_master_atk=data[EquipSpecialAttr.ATK_ADD_MASTER_ATK]+this.atk_add_value+(this.card_atk_add > 0 ? this.card_atk_add:0) //装备特殊属性 英雄/伙伴 攻击力增加
|
||||
this.atk_add_master_hp=data[EquipSpecialAttr.ATK_ADD_MASTER_HP]+this.atk_add_value+(this.card_hp_add > 0 ? this.card_hp_add:0) //装备特殊属性 英雄/伙伴 生命值增加
|
||||
this.friend_alive_cd=FightSet.FRIEND_LIVE_CD-data[EquipSpecialAttr.FRIEND_LIVE_CD]
|
||||
this.double_dead=data[EquipSpecialAttr.DOUBLE_DEAD]
|
||||
this.double_atked=data[EquipSpecialAttr.DOUBLE_ATKED]
|
||||
this.friend_atked_add_skill_stone=data[EquipSpecialAttr.FRIEND_ATKED_ADD_SKILL_STONE]
|
||||
this.friend_get_master_equip=data[EquipSpecialAttr.FRIEND_GET_MASTER_EQUIP]
|
||||
this.atked_add_skill_stone=data[EquipSpecialAttr.ATKED_ADD_SKILL_STONE]
|
||||
}
|
||||
|
||||
|
||||
|
||||
private equip_change(e:GameEvent,equip:any){
|
||||
let old_hero_hp=JSON.parse(JSON.stringify(this.hero_buff.HP))
|
||||
let old_friend_hp=JSON.parse(JSON.stringify(this.friend_buff.HP))
|
||||
|
||||
let new_hero_hp=JSON.parse(JSON.stringify(equip.hero_buff.HP))
|
||||
let new_friend_hp=JSON.parse(JSON.stringify(equip.friend_buff.HP))
|
||||
|
||||
this.hero_buff=equip.hero_buff
|
||||
this.friend_buff=equip.friend_buff
|
||||
this.enemy_buff=equip.enemy_buff
|
||||
|
||||
|
||||
let hero_hp_add=new_hero_hp-old_hero_hp
|
||||
let friend_hp_add=new_friend_hp-old_friend_hp
|
||||
console.log("[FightConComp]:old_hero_hp:"+old_hero_hp+" new_hero_hp:"+new_hero_hp+" hero_hp_add:"+hero_hp_add)
|
||||
if(hero_hp_add!==0){
|
||||
|
||||
oops.message.dispatchEvent(GameEvent.UpdateHP,{hp:hero_hp_add,is_master:true})
|
||||
}
|
||||
|
||||
if(friend_hp_add!==0){
|
||||
oops.message.dispatchEvent(GameEvent.UpdateHP,{hp:friend_hp_add,is_master:false})
|
||||
}
|
||||
|
||||
|
||||
this.scheduleOnce(()=>{
|
||||
oops.message.dispatchEvent(GameEvent.UpdateVMData)
|
||||
},0.1)
|
||||
@@ -148,21 +126,13 @@ export class FightConComp extends Component {
|
||||
|
||||
private clearAlls() {
|
||||
this.hero_buff=getBuffNum()
|
||||
this.friend_buff=getBuffNum()
|
||||
this.enemy_buff=getBuffNum()
|
||||
|
||||
|
||||
this.friend_alive_cd=FightSet.FRIEND_LIVE_CD
|
||||
this.atk_add_friend_atk=0
|
||||
this.atk_add_friend_hp=0
|
||||
this.atk_add_glod=0
|
||||
this.atk_add_master_atk=0
|
||||
this.atk_add_master_hp=0
|
||||
this.double_dead=0
|
||||
this.double_atked=0
|
||||
this.friend_atked_add_skill_stone=0
|
||||
this.atked_add_skill_stone=0
|
||||
this.atk_add_value=0
|
||||
this.friend_get_master_equip=0
|
||||
this.card_atk_add=0
|
||||
this.card_hp_add=0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user