dd 单独制作 卡牌特效

This commit is contained in:
2025-06-19 17:28:55 +08:00
parent 3582521e4e
commit ff402f14ca
2 changed files with 29 additions and 8 deletions

View File

@@ -26,7 +26,7 @@ export class FightConComp extends Component {
temp_friend_debuff = this.getInitTempDebuff();
temp_enemy_debuff = this.getInitTempDebuff();
atk_type:number=0;
//装备特殊属性
friend_alive_cd:number=FightSet.FRIEND_LIVE_CD
atk_add_friend_atk:number=0
atk_add_friend_hp:number=0
@@ -34,6 +34,10 @@ export class FightConComp extends Component {
atk_add_master_atk:number=0
atk_add_master_hp:number=0
//卡牌特效
card_atk_add:number=0 //卡牌特效 攻击提高攻击力效果 额外添加值
card_hp_add:number=0 //卡牌特效 攻击提高生命值效果 额外添加值
onLoad(){
// console.log("fight con start")
oops.message.on(GameEvent.EquipChange,this.equip_change,this)
@@ -48,11 +52,11 @@ export class FightConComp extends Component {
}
change_equip_special_attr(e:GameEvent,data:any){
console.log("[FightConComp]:change_equip_special_attr",data)
this.atk_add_friend_atk=data.atk_add_friend_atk
this.atk_add_friend_hp=data.atk_add_friend_hp
this.atk_add_friend_atk=data.atk_add_friend_atk+(this.card_atk_add > 0 ? this.card_atk_add:0) //装备特殊属性 英雄/伙伴 攻击力增加
this.atk_add_friend_hp=data.atk_add_friend_hp+(this.card_hp_add > 0 ? this.card_hp_add:0) //装备特殊属性 英雄/伙伴 生命值增加
this.atk_add_glod=data.atk_add_glod
this.atk_add_master_atk=data.atk_add_master_atk
this.atk_add_master_hp=data.atk_add_master_hp
this.atk_add_master_atk=data.atk_add_master_atk+(this.card_atk_add > 0 ? this.card_atk_add:0) //装备特殊属性 英雄/伙伴 攻击力增加
this.atk_add_master_hp=data.atk_add_master_hp+(this.card_hp_add > 0 ? this.card_hp_add:0) //装备特殊属性 英雄/伙伴 生命值增加
this.friend_alive_cd=FightSet.FRIEND_LIVE_CD-data.friend_live_cd_less
}
@@ -117,7 +121,16 @@ export class FightConComp extends Component {
console.log("[FightConComp]:use_special_card:",SuperCards[data.uuid])
switch(SuperCards[data.uuid].type){
case SuperCardsType.SPECIAL:
switch(data.uuid){
case 3001:
console.log("[FightConComp]:use_special_card:附魔宝典")
this.card_atk_add+=SuperCards[data.uuid].value1
break
case 3002:
console.log("[FightConComp]:use_special_card:附魔宝典")
this.card_hp_add+=SuperCards[data.uuid].value1
break
}
break
case SuperCardsType.AOE:
@@ -147,6 +160,14 @@ export class FightConComp extends Component {
this.temp_hero_debuff = this.getInitTempDebuff()
this.temp_friend_debuff = this.getInitTempDebuff()
this.temp_enemy_debuff = this.getInitTempDebuff()
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.card_atk_add=0
this.card_hp_add=0
}
update(deltaTime: number) {