diff --git a/assets/script/game/common/EnhancedButtonTouchLong.ts.meta b/assets/script/game/common/EnhancedButtonTouchLong.ts.meta deleted file mode 100644 index 468a5a96..00000000 --- a/assets/script/game/common/EnhancedButtonTouchLong.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "caba3955-8e72-4e90-8666-0d0ee57797d9", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 9f7fcd52..97e66026 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -109,7 +109,7 @@ export enum BuffAttr { WFUNY = 2, // 风怒 ATK_CD = 3, // 攻击速度 HP = 4, // 生命值比例 - DEF = 5, // 免伤 + DEF = 5, // 防御 SKILL_DMG = 6, // 技能效果 SKILL_CD = 7, // 技能冷却缩减 CARD_EFFECT = 8, // 卡牌效果 @@ -136,6 +136,8 @@ export enum BuffAttr { HP_MAX = 28, //最大生命值数值 POWER_UP = 29, //能量增加 LIFESTEAL = 30, //吸血 + DMG_RED = 31, //免伤 + INVINCIBLE = 32, //无敌 } export const geDebuffNum=()=>{ @@ -189,6 +191,8 @@ export const getBuffNum=()=>{ HP_MAX:0,//最大生命值数值 POWER_UP:0,//能量增加 LIFESTEAL:0,//吸血 + DMG_RED:0,//免伤 + INVINCIBLE:0,//无敌 } } diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 0291f663..3692d6d4 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -24,51 +24,15 @@ const { ccclass, property } = _decorator; @ecs.register('HeroView', false) // 定义为 ECS 组件 export class HeroViewComp extends CCComp { BUFFCOMP:BuffComp=null! - atk_heart:boolean=false; as: HeroSpine = null! status:String = "idle" hero_uuid:number = 1001; hero_name : string = "hero"; - fight_pos:number=0; lv:number =1; - exp:number = 0; - next_exp:number = 100; scale: number = 1; /** 角色阵营 1:hero -1 :mon */ type: number = 0; /**角色类型 0近战-需要贴身 1远程-保持距离 2辅助 */ fac:number=0; //阵营 0:hero 1:monster - skill_cd:number=0; - skill_cd_max:number=1.3; - - /** - * 获取当前血量 - 根据阵营选择正确的变量 - */ - get currentHp(): number { - return this.hp; - } - - /** - * 设置当前血量 - 根据阵营选择正确的变量 - */ - set currentHp(value: number) { - this.hp = value; - } - - /** - * 获取最大血量 - 根据阵营选择正确的变量 - */ - get currentHpMax(): number { - return this.hp_max; - } - - /** - * 设置最大血量 - 根据阵营选择正确的变量 - */ - set currentHpMax(value: number) { - this.hp_max = value; - } - box_group:number = BoxSet.HERO; - is_dead:boolean = false; //是否摧毁 is_count_dead:boolean = false; //是否计数死亡 is_stop:boolean = false; @@ -85,7 +49,6 @@ export class HeroViewComp extends CCComp { hp_buff:number=0; hp_base:number=0; - pwt:Timer = new Timer(1); //计时器 ap: number = 10; /**攻击力 */ ap_buff:number=0; ap_base:number=0; @@ -97,10 +60,9 @@ export class HeroViewComp extends CCComp { skills:any[]=[] puncture:number=0; //穿刺敌人伤害后方敌人个数 puncture_damage:number=0; //后伤害加成 - def: number = 0; //免伤 - vun: number = 0; //易伤 - burn_count:number=0; //易伤次数 - burn_value:number=0; //易伤值 + def: number = 0; //防御 + dmg_red:number=0//免伤 + burn: number = 0; //易伤 伤害加成 stun_time:number=0; //眩晕加成 stun_ratto:number=0; //攻击眩晕概率加成 stun_no:boolean=false; //眩晕免疫 @@ -120,18 +82,14 @@ export class HeroViewComp extends CCComp { ospeed: number = 100; /** 角色初始速度 */ reflect:number=0; //反射伤害比率 lifesteal:number=0; //吸血比率 + skill_dmg:number=0 atk_count: number = 0; - atked_count: number = 0; - atk_add_count:number=0; + atked_count: number = 0; + stop_cd: number = 0; /*停止倒计时*/ speek_time:number = 0; - is_stop_temp:boolean = false - double_atked:boolean=false - atk_add_master_atk:number=0 - atk_add_master_hp:number=0 - buff_debuff_down:number=0 - skill_dmg:number=0 + debuff_down_ratto:number=0 BUFF_DEFS: Array<{value: number, duration: number}> = [] //防御提升 BUFF_ATKS: Array<{value: number, duration: number}> = [] //攻击提升 @@ -216,8 +174,8 @@ export class HeroViewComp extends CCComp { } hp_show(){ // if(this.node.getComponent(HeroViewComp).fac == 0) return - let hp=this.currentHp; - let hp_max=this.currentHpMax; + let hp=this.hp; + let hp_max=this.hp_max; let hp_progress= hp/hp_max; this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar).progress = hp_progress; // this.node.getChildByName("top").getChildByName("hp").active = (hp == hp_max) ? false : true; @@ -340,9 +298,9 @@ export class HeroViewComp extends CCComp { this.cd=this.check_atrr(BuffAttr.ATK_CD) break case BuffAttr.HP: - let diff=this.check_atrr(BuffAttr.HP)-this.currentHpMax - this.currentHpMax=this.check_atrr(BuffAttr.HP) - this.currentHp+=diff + let diff=this.check_atrr(BuffAttr.HP)-this.hp_max + this.hp_max=this.check_atrr(BuffAttr.HP) + this.hp+=diff this.hp_show() break } @@ -380,8 +338,8 @@ export class HeroViewComp extends CCComp { add_hp(hp: number = 0,is_num:boolean=true) { this.BUFFCOMP.heathed(); let real_hp=0 - let hp_max=Math.floor(this.currentHpMax*(100+this.hp_buff)/100) - let lost_hp=hp_max-this.currentHp + let hp_max=Math.floor(this.hp_max*(100+this.hp_buff)/100) + let lost_hp=hp_max-this.hp if(is_num){ if(lost_hp > hp){ real_hp=Math.floor(hp); @@ -396,7 +354,7 @@ export class HeroViewComp extends CCComp { } } if(real_hp > 0){ - this.currentHp+=real_hp; + this.hp+=real_hp; this.BUFFCOMP.tooltip(TooltipTypes.health,real_hp.toFixed(0)); } this.hp_show() @@ -454,7 +412,7 @@ export class HeroViewComp extends CCComp { DEBUFF_DOWN+=this.BUFF_DEDOWN[i].value // 不再在这里减少duration,改为在update中按时间减少 } - let n_deR=deR-DEBUFF_DOWN-this.buff_debuff_down // 触发概率 + let n_deR=deR-DEBUFF_DOWN-this.debuff_down_ratto // 触发概率 let r=RandomManager.instance.getRandomInt(0,100) // 随机数 //console.log("[HeroViewComp]:类型,值,次数,技能概率,实际概率,随机数",type,deV,deC,deR,n_deR,r) if(r < n_deR) { @@ -484,8 +442,8 @@ export class HeroViewComp extends CCComp { // this.is_stop=true break case DebuffAttr.DEHP: - this.currentHpMax-=deV/100*this.currentHpMax - if(this.currentHp-this.currentHpMax>0) this.currentHp=this.currentHpMax + this.hp_max-=deV/100*this.hp_max + if(this.hp-this.hp_max>0) this.hp=this.hp_max break case DebuffAttr.DEATK: //99为具体数字 并且局内永久生效,其他为百分比 if(deC == 99){ @@ -607,13 +565,10 @@ export class HeroViewComp extends CCComp { let damage = this.count_damage(remainingDamage) if(is_crit) { damage = Math.floor(damage * (1 + (FightSet.CRIT_DAMAGE+crit_d)/100)) - if(this.fac==FacSet.MON) smc.vmdata.hero.power+=smc.vmdata.hero.POWER_UP+FightSet.CRIT_TO_POWER //暴击涨能量 怪物被暴击,因为只有一个英雄 直接处理 } - this.currentHp -= damage; - if(this.fac==FacSet.HERO) smc.vmdata.hero.power+=smc.vmdata.hero.POWER_UP+FightSet.ATKED_TO_POWER //被攻击涨能量 - if(this.fac==FacSet.MON) smc.vmdata.hero.power+=smc.vmdata.hero.POWER_UP+FightSet.ATK_TO_POWER //攻击命中涨能量 因为是只有1个英雄 直接处理 + this.hp -= damage; - if(this.currentHp <= 0) { + if(this.hp <= 0) { if(this == null) return; this.is_dead=true if(this.BUFFCOMP){ @@ -651,31 +606,12 @@ export class HeroViewComp extends CCComp { } //伤害计算 debuff 易伤 count_damage(remainingDamage:number){ - let damage = 0; - let Burn = 0; - let def = 0; - for(let i=0;i0){ this.shield -= 1 @@ -702,7 +638,6 @@ export class HeroViewComp extends CCComp { } check_crit(crit:number=0){ - if(this.crit_no) return false if(crit > 0){ let random = Math.random()*100 @@ -719,20 +654,12 @@ export class HeroViewComp extends CCComp { // this.to_drop() // } - do_dead_trigger(){ //双倍死亡设定 + do_dead_trigger(){ //死亡特殊处理 if(this.is_dead||this.fac==FacSet.MON) return - let count = 1 - for(let i=0;i