import { _decorator, Component, Node } from 'cc'; import { oops } from 'db://oops-framework/core/Oops'; import { GameEvent } from '../common/config/GameEvent'; const { ccclass, property } = _decorator; @ccclass('FightConComp') export class FightConComp extends Component { hero:{ ATK:0, // 攻击力 ATK_COUNT:0, // 攻击个数 ATK_CD:0, // 攻击速度 HP:0, // 生命值 DEF:0, // 免伤 SKILL_DMG:0, // 技能效果 SKILL_CD:0, // 技能冷却缩减 CARD_EFFECT:0, // 卡牌效果 CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次 } ally:{ ATK:0, // 攻击力 ATK_COUNT:0, // 攻击个数 ATK_CD:0, // 攻击速度 HP:0, // 生命值 DEF:0, // 免伤 SKILL_DMG:0, // 技能效果 SKILL_CD:0, // 技能冷却缩减 CARD_EFFECT:0, // 卡牌效果 CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次 } enemy:{ ATK:0, // 攻击力 ATK_COUNT:0, // 攻击个数 ATK_CD:0, // 攻击速度 HP:0, // 生命值 DEF:0, // 免伤 SKILL_DMG:0, // 技能效果 SKILL_CD:0, // 技能冷却缩减 CARD_EFFECT:0, // 卡牌效果 CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次 } friend:{ ATK:0, // 攻击力 ATK_COUNT:0, // 攻击个数 ATK_CD:0, // 攻击速度 HP:0, // 生命值 DEF:0, // 免伤 SKILL_DMG:0, // 技能效果 SKILL_CD:0, // 技能冷却缩减 CARD_EFFECT:0, // 卡牌效果 CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次 } onLoad(){ // console.log("fight con start") oops.message.on(GameEvent.EquipChange,this.equip_change,this) oops.message.on(GameEvent.FightReady,this.fight_ready,this) } equip_change(e:GameEvent,equip:any){ this.hero=equip.hero this.ally=equip.ally this.enemy=equip.enemy this.friend=equip.friend } fight_ready(e:GameEvent){ this.hero=this.ally=this.enemy=this.friend={ ATK:0, // 攻击力 ATK_COUNT:0, // 攻击个数 ATK_CD:0, // 攻击速度 HP:0, // 生命值 DEF:0, // 免伤 SKILL_DMG:0, // 技能效果 SKILL_CD:0, // 技能冷却缩减 CARD_EFFECT:0, // 卡牌效果 CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次 } } update(deltaTime: number) { } }