diff --git a/assets/script/game/common/config/Equips.ts b/assets/script/game/common/config/Equips.ts index eae69263..aa6fd764 100644 --- a/assets/script/game/common/config/Equips.ts +++ b/assets/script/game/common/config/Equips.ts @@ -453,7 +453,7 @@ export const EquipInfo: { [key: number]: EquipData } = { { type: BuffAttr.ATK, value: 300, target: EquipAttrTarget.HERO }, { type: BuffAttr.ATK_CD, value: 0, target: EquipAttrTarget.HERO }, // CD修正0% { type: BuffAttr.WFUNY, value: 60, target: EquipAttrTarget.HERO }, // 风怒概率60% - { type: BuffAttr.STUN_RATTO, value: 12.5, target: EquipAttrTarget.HERO }, // 击晕概率12.5% + { type: BuffAttr.STUN_RATIO, value: 12.5, target: EquipAttrTarget.HERO }, // 击晕概率12.5% ], }, @@ -507,7 +507,7 @@ export const EquipInfo: { [key: number]: EquipData } = { { type: BuffAttr.ATK_CD, value: -6.7, target: EquipAttrTarget.HERO }, // CD修正+6.7% { type: BuffAttr.CRITICAL, value: 30, target: EquipAttrTarget.HERO }, // 暴击率30% { type: BuffAttr.CRITICAL_DMG, value: 70, target: EquipAttrTarget.HERO }, // 暴击伤害+70% - { type: BuffAttr.STUN_RATTO, value: 15, target: EquipAttrTarget.HERO }, // 击晕概率+15% + { type: BuffAttr.STUN_RATIO, value: 15, target: EquipAttrTarget.HERO }, // 击晕概率+15% ], }, 5104: { @@ -523,7 +523,7 @@ export const EquipInfo: { [key: number]: EquipData } = { { type: BuffAttr.ATK, value: 360, target: EquipAttrTarget.HERO }, { type: BuffAttr.ATK_CD, value: -6.7, target: EquipAttrTarget.HERO }, // CD修正+6.7% { type: BuffAttr.CRITICAL, value: 30, target: EquipAttrTarget.HERO }, // 暴击率30% - { type: BuffAttr.STUN_RATTO, value: 30, target: EquipAttrTarget.HERO }, // 击晕概率30% + { type: BuffAttr.STUN_RATIO, value: 30, target: EquipAttrTarget.HERO }, // 击晕概率30% ], }, diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 97e66026..c395f025 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -113,13 +113,12 @@ export enum BuffAttr { SKILL_DMG = 6, // 技能效果 SKILL_CD = 7, // 技能冷却缩减 CARD_EFFECT = 8, // 卡牌效果 - CARD_COUNT = 8, // 卡牌起效次数,每3次多起效一次 CRITICAL = 9, //暴击率 CRITICAL_DMG = 10, //暴击伤害 CRITICAL_NO = 11, //暴击免疫 DODGE = 12, //闪避 DODGE_NO = 13, //闪避免疫 - DEBUFF_COUNT = 14, //debuff次数 + DEBUFF_COUNT = 14, //debuff持续时间提升 DEBUFF_VALUE = 15, //debuff效果 DEBUFF_UP = 16, //debuff概率提升 DEBUFF_DOWN = 17, //被debuff概率降低 @@ -131,15 +130,55 @@ export enum BuffAttr { BURN_COUNT = 23, //易伤额外次数 BURN_VALUE = 24,//易伤效果 STUN_TIME = 25, //击晕额外时间 - STUN_RATTO = 26, //击晕概率 + STUN_RATIO = 26, //击晕概率 FROST_TIME = 27, //冰冻时间 HP_MAX = 28, //最大生命值数值 POWER_UP = 29, //能量增加 LIFESTEAL = 30, //吸血 DMG_RED = 31, //免伤 INVINCIBLE = 32, //无敌 + DIS = 33, //距离 + SPEED = 34, //速度 +} +export const getBuffNum=()=>{ + return { + [BuffAttr.AP]:0, //攻击力 数值 + [BuffAttr.ATK]:0, // 攻击力 + [BuffAttr.WFUNY]:0, // 风怒概率 + [BuffAttr.ATK_CD]:0, // 攻击速度 + [BuffAttr.HP]:0, // 生命值 比例 + [BuffAttr.DEF]:0, // 免伤 + [BuffAttr.SKILL_DMG]:0, // 技能效果 + [BuffAttr.SKILL_CD]:0, // 技能冷却缩减 + [BuffAttr.CARD_EFFECT]:0, // 卡牌效果 + [BuffAttr.CRITICAL]:0, //暴击 + [BuffAttr.CRITICAL_DMG]:0, //暴击伤害 + [BuffAttr.CRITICAL_NO]:0, //暴击免疫 + [BuffAttr.DODGE]:0, //闪避 + [BuffAttr.DODGE_NO]:0, //闪避免疫 + [BuffAttr.DEBUFF_COUNT]:0, //debuff次数 + [BuffAttr.DEBUFF_VALUE]:0, //debuff效果 + [BuffAttr.DEBUFF_UP]:0, //debuff概率提升 + [BuffAttr.DEBUFF_DOWN]:0, //被debuff概率降低 + [BuffAttr.PUNCTURE]:0, //穿刺敌人伤害后方敌人 + [BuffAttr.PUNCTURE_DMG]:0, //穿刺敌人伤害后方敌人伤害加成 + [BuffAttr.FROST_RATIO]:0, //冰冻比率 + [BuffAttr.REFLECT]:0, //反伤比率 + [BuffAttr.KNOCKBACK]:0, //击退概率 + [BuffAttr.BURN_COUNT]:0, //易伤额外次数 + [BuffAttr.BURN_VALUE]:0, + [BuffAttr.STUN_TIME]:0, + [BuffAttr.STUN_RATIO]:0, + [BuffAttr.FROST_TIME]:0, + [BuffAttr.HP_MAX]:0,//最大生命值数值 + [BuffAttr.POWER_UP]:0,//能量增加 + [BuffAttr.LIFESTEAL]:0,//吸血 + [BuffAttr.DMG_RED]:0,//免伤 + [BuffAttr.INVINCIBLE]:0,//无敌 + [BuffAttr.DIS]:0,//距离 + [BuffAttr.SPEED]:0,//速度 + } } - export const geDebuffNum=()=>{ return { STUN:0, //眩晕 @@ -157,44 +196,7 @@ export const geDebuffNum=()=>{ } -export const getBuffNum=()=>{ - return { - AP:0, //攻击力 数值 - ATK:0, // 攻击力 - WFUNY:0, // 风怒概率 - ATK_CD:0, // 攻击速度 - HP:0, // 生命值 比例 - DEF:0, // 免伤 - SKILL_DMG:0, // 技能效果 - SKILL_CD:0, // 技能冷却缩减 - CARD_EFFECT:0, // 卡牌效果 - CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次 - CRITICAL:0, //暴击 - CRITICAL_DMG:0, //暴击伤害 - CRITICAL_NO:0, //暴击免疫 - DODGE:0, //闪避 - DODGE_NO:0, //闪避免疫 - DEBUFF_COUNT:0, //debuff次数 - DEBUFF_VALUE:0, //debuff效果 - DEBUFF_UP:0, //debuff概率提升 - DEBUFF_DOWN:0, //被debuff概率降低 - PUNCTURE:0, //穿刺敌人伤害后方敌人 - PUNCTURE_DMG:0, //穿刺敌人伤害后方敌人伤害加成 - FROST_RATIO:0, //冰冻比率 - REFLECT:0, //反伤比率 - KNOCKBACK:0, //击退概率 - BURN_COUNT:0, //易伤额外次数 - BURN_VALUE:0, - STUN_TIME:0, - STUN_RATTO:0, - FROST_TIME:0, - HP_MAX:0,//最大生命值数值 - POWER_UP:0,//能量增加 - LIFESTEAL:0,//吸血 - DMG_RED:0,//免伤 - INVINCIBLE:0,//无敌 - } -} + export enum Quality{ WHITE=1, diff --git a/assets/script/game/common/config/TalentSet.ts b/assets/script/game/common/config/TalentSet.ts index 986ea9c7..bffb0f39 100644 --- a/assets/script/game/common/config/TalentSet.ts +++ b/assets/script/game/common/config/TalentSet.ts @@ -35,7 +35,7 @@ export interface TalentConfig { * | 10 | 技能加速 | +40% | BuffAttr.SKILL_CD | 技能冷却缩减 | * | 11 | 冰冻强化 | +10% | BuffAttr.FROST_RATIO| 冰冻概率加成 | * | 12 | 击退强化 | +10% | BuffAttr.KNOCKBACK | 击退概率加成 | - * | 13 | 击晕强化 | +10% | BuffAttr.STUN_RATTO | 击晕概率加成 | + * | 13 | 击晕强化 | +10% | BuffAttr.STUN_RATIO | 击晕概率加成 | * | 14 | 反伤强化 | +20% | BuffAttr.REFLECT | 反伤百分比加成 | * | 15 | 吸血强化 | +20% | BuffAttr.LIFESTEAL | 吸血百分比加成 | */ @@ -65,7 +65,7 @@ export const TalentList: { [key: number]: TalentConfig } = { 1010: {uuid:1010,name:"技能加速",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.SKILL_CD,value:24,info:"技能冷却缩减+24%"}, 1011: {uuid:1011,name:"冰冻强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.FROST_RATIO,value:6,info:"冰冻概率+6%"}, 1012: {uuid:1012,name:"击退强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.KNOCKBACK,value:6,info:"击退概率+6%"}, - 1013: {uuid:1013,name:"击晕强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.STUN_RATTO,value:6,info:"击晕概率+6%"}, + 1013: {uuid:1013,name:"击晕强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.STUN_RATIO,value:6,info:"击晕概率+6%"}, 1014: {uuid:1015,name:"吸血强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.LIFESTEAL,value:12,info:"吸血+12%"}, // ==================== 紫色品质天赋 ==================== @@ -81,7 +81,7 @@ export const TalentList: { [key: number]: TalentConfig } = { 2010: {uuid:2010,name:"技能加速大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.SKILL_CD,value:40,info:"技能冷却缩减+40%"}, 2011: {uuid:2011,name:"冰冻大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.FROST_RATIO,value:10,info:"冰冻概率+10%"}, 2012: {uuid:2012,name:"击退大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.KNOCKBACK,value:10,info:"击退概率+10%"}, - 2013: {uuid:2013,name:"击晕大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.STUN_RATTO,value:10,info:"击晕概率+10%"}, + 2013: {uuid:2013,name:"击晕大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.STUN_RATIO,value:10,info:"击晕概率+10%"}, 2014: {uuid:2015,name:"吸血大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.LIFESTEAL,value:20,info:"吸血+20%"}, }; diff --git a/assets/script/game/common/ecs/position/BattleMoveSystem.ts b/assets/script/game/common/ecs/position/BattleMoveSystem.ts index e21d4d09..b6a84450 100644 --- a/assets/script/game/common/ecs/position/BattleMoveSystem.ts +++ b/assets/script/game/common/ecs/position/BattleMoveSystem.ts @@ -74,7 +74,6 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU view.status_change("idle"); } } - this.checkEnemiesInBase(e); return; } @@ -116,7 +115,6 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU move.direction = 1; view.node.setScale(1, 1, 1); // 面向右侧 } - this.checkEnemiesInBase(e); return; } @@ -139,7 +137,6 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU view.status_change("idle"); // 因为敌人在面前而暂时停止,不设置moving为false,保持检查状态 } - this.checkEnemiesInBase(e) // console.log(`[${view.hero_name}] 类型:${view.type} 是否停止:${shouldStop} 方向:${move.direction} 位置:${view.node.position.x.toFixed(1)}`); } @@ -192,20 +189,7 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU const view = entity.get(HeroViewComp); return view.node.position.x === -1000 || view.node.position.x === 1000; } - /**检测敌人是否进入我方基地 */ - private checkEnemiesInBase(entity: ecs.Entity) { - const view = entity.get(HeroViewComp); - if(view.fac==FacSet.MON){ - if(view.atk_heart) return - if(view.node.position.x <= FightSet.HEARTPOS){ - oops.message.dispatchEvent(GameEvent.LifeChange,-1) - view.atk_heart=true - view.is_dead=true - view.BUFFCOMP.dead() - view.do_dead() - } - } - } + /** 检测攻击范围内敌人 */ private checkEnemiesInRange(entity: ecs.Entity, range: number): boolean { const currentPos = entity.get(HeroViewComp).node.position; diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index ecaf2379..1fbb1e32 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -10,7 +10,7 @@ import { BattleMoveComp } from "../common/ecs/position/BattleMoveComp"; import { FriendModelComp } from "./FriendModel"; import { MasterModelComp } from "./MasterModel"; import { GameEvent } from "../common/config/GameEvent"; -import { BuffAttr, SkillSet } from "../common/config/SkillSet"; +import { BuffAttr, getBuffNum, SkillSet } from "../common/config/SkillSet"; import { FightSet } from "../common/config/Mission"; import { Skill } from "../skills/Skill"; /** 角色实体 */ @@ -80,62 +80,15 @@ export class Hero extends ecs.Entity { hv.box_group = BoxSet.HERO; hv.hero_uuid= uuid; hv.hero_name= hero.name; - hv.speed =hv.ospeed = hero.speed; - hv.dis = hero.dis; - hv.cd = hv.cd_base = hero.cd - hv.hp = hv.hp_max = hv.hp_base=hero.hp+info.hp - hv.ap = hv.ap_base=hero.ap+info.ap; + hv.Attrs=getBuffNum() + hv.Attrs[BuffAttr.SPEED]=hv.speed = hero.speed; + hv.Attrs[BuffAttr.DIS]=hv.dis=hero.dis; + hv.Attrs[BuffAttr.ATK_CD]=hv.cd=hero.cd + hv.Attrs[BuffAttr.HP_MAX]=hv.hp=hv.hp_max=hero.hp+info.hp + hv.Attrs[BuffAttr.AP]=hv.ap=hero.ap+info.ap; + hv.Attrs[BuffAttr.DEF]=hv.def=hero.def+info.def; hero.buff.forEach((buff:any)=>{ - switch(buff.buff_type){ - case BuffAttr.CRITICAL: - hv.crit=buff.value - break - case BuffAttr.CRITICAL_DMG: - hv.crit_d=buff.value - break - case BuffAttr.DODGE: - hv.dod=buff.value - break - case BuffAttr.DODGE_NO: - hv.dod_no=buff.value - break - case BuffAttr.CRITICAL_NO: - hv.crit_no=buff.value - break - case BuffAttr.PUNCTURE: - hv.puncture=buff.value - break - case BuffAttr.PUNCTURE_DMG: - hv.puncture_damage=buff.value - break - case BuffAttr.WFUNY: - hv.wfuny=buff.value - break - case BuffAttr.ATK_CD: - hv.cd=hv.cd*(100-buff.value)/100 - break - case BuffAttr.HP: - hv.hp_max=hv.hp_max*(100+buff.value)/100 - break - case BuffAttr.DEF: - hv.def=buff.value - break - case BuffAttr.ATK: - hv.ap=hv.ap*(100+buff.value)/100 - break - case BuffAttr.STUN_RATTO: - hv.stun_ratto=buff.value - break - case BuffAttr.FROST_RATIO: - hv.frost_ratto=buff.value - break - case BuffAttr.KNOCKBACK: - hv.knockback=buff.value - break - case BuffAttr.POWER_UP: - smc.vmdata.hero.POWER_UP+=buff.value - break - } + hv.apply_buff(buff.type,buff.value) }) for(let i=0;i = [] //防御提升 - BUFF_ATKS: Array<{value: number, duration: number}> = [] //攻击提升 - BUFF_CDS: Array<{value: number, duration: number}> = [] //攻击加速 - BUFF_DEDOWN:Array<{value: number, duration: number}> = [] //debuff 概率降低 - + BUFFS:Array<{value: number, duration: number,type:number}> = [] //buff + DEBUFF_BURNS: Array<{value: number, duration: number}> = [] //易伤 DEBUFF_DEATKS: Array<{value: number, duration: number}> = [] //减攻击 DEBUFF_DECDS: Array<{value: number, duration: number}> = [] //减攻击速度 @@ -138,7 +136,6 @@ export class HeroViewComp extends CCComp { start () { this.as.idle() this.BUFFCOMP=this.node.getComponent(BuffComp); - /** 方向 */ this.node.setScale(this.scale,1); this.node.getChildByName("top").setScale(this.scale,1); @@ -209,136 +206,12 @@ export class HeroViewComp extends CCComp { if(this.shield>6) this.shield=6 if(this.shield>0) this.BUFFCOMP.show_shield(true) } - change_wfuny(wfuny: number){ - this.wfuny+=wfuny - if(this.wfuny<0) this.wfuny=0 - - } - change_puncture(puncture: number){ - this.puncture+=puncture - if(this.puncture<1) this.puncture=1 - - } - change_puncture_damage(puncture_damage: number){ - this.puncture_damage+=puncture_damage - if(this.puncture_damage<0) this.puncture_damage=0 - if(this.puncture_damage>80) this.puncture_damage=80 - - } - change_dodge(dodge: number){ - this.dod+=dodge - if(this.dod<0) this.dod=0 - if(this.dod>90) this.dod=90 - - } - change_frost_ratto(frost_ratto: number){ - this.frost_ratto+=frost_ratto - if(this.frost_ratto<0) this.frost_ratto=0 - if(this.frost_ratto>90) this.frost_ratto=90 - - } - - change_knockback(knockback: number){ - this.knockback+=knockback - if(this.knockback<0) this.knockback=0 - - } - - change_stun_ratto(stun_ratto: number){ - this.stun_ratto+=stun_ratto - if(this.stun_ratto<0) this.stun_ratto=0 - - } - - change_def(def: number){ - this.def+=def - if(this.def>90) this.def=90 - if(this.def<0) this.def=0 - - // this.BUFFCOMP.tooltip(TooltipTypes.defup,def.toFixed(0)); - } - change_crit(crit: number){ - this.crit+=crit - if(this.crit<0) this.crit=0 - - } - change_crit_d(crit_d: number){ - this.crit_d+=crit_d - if(this.crit_d<0) this.crit_d=0 - - } - change_reflect(reflect: number){ - this.reflect+=reflect - if(this.reflect<0) this.reflect=0 - - } - change_lifesteal(lifesteal: number){ - this.lifesteal+=lifesteal - if(this.lifesteal<0) this.lifesteal=0 - - } - - check_atrr(buff:BuffAttr){ - switch(buff){ - case BuffAttr.ATK: - return Math.floor(this.ap_base*(100+this.ap_buff)/100) - case BuffAttr.ATK_CD: - return this.cd_base/((this.cd_buff)/100+1) - case BuffAttr.HP: - return Math.floor(this.hp_base*(100+this.hp_buff)/100) - } - } - - count_atrr(buff:BuffAttr){ - switch(buff){ - case BuffAttr.ATK: - this.ap=this.check_atrr(BuffAttr.ATK) - break - case BuffAttr.ATK_CD: - this.cd=this.check_atrr(BuffAttr.ATK_CD) - break - case BuffAttr.HP: - 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 - } - } - - add_speed(cd: number){ - this.cd_buff+=cd - this.count_atrr(BuffAttr.ATK_CD) - // this.BUFFCOMP.tooltip(TooltipTypes.speedup,speed.toFixed(0)); - } - - - change_ap(ap: number,is_num:boolean=true){ - // console.log("[HeroViewComp]:add_ap add:",ap,this.ap) - if(is_num){ - this.ap_base += Math.floor(ap); - }else{ - this.ap_buff += Math.floor(ap/100*this.ap_base); - } - - this.count_atrr(BuffAttr.ATK) - } - - change_hp_max(hp: number=0,is_num:boolean=false){ - // console.log("[HeroViewComp]:add_hp_max add:",hp,this.currentHpMax) - if(is_num){ - this.hp_base += Math.floor(hp) ; - }else{ - this.hp_buff+=hp - } - this.count_atrr(BuffAttr.HP) - // this.update_vm - } + add_hp(hp: number = 0,is_num:boolean=true) { this.BUFFCOMP.heathed(); let real_hp=0 - let hp_max=Math.floor(this.hp_max*(100+this.hp_buff)/100) + let hp_max=this.hp_max let lost_hp=hp_max-this.hp if(is_num){ if(lost_hp > hp){ @@ -402,17 +275,8 @@ export class HeroViewComp extends CCComp { } - get_debuff(){ - - } add_debuff(type:number,deV:number,deC:number,deR:number){ - let DEBUFF_DOWN=0 - - for(let i=0;i= 0; i--) { - this.BUFF_DEFS[i].duration -= dt; - if(this.BUFF_DEFS[i].duration <= 0) { - this.BUFF_DEFS.splice(i, 1); - } - } - - // 更新BUFF_ATKS - for(let i = this.BUFF_ATKS.length - 1; i >= 0; i--) { - this.BUFF_ATKS[i].duration -= dt; - if(this.BUFF_ATKS[i].duration <= 0) { - this.BUFF_ATKS.splice(i, 1); - } - } - - // 更新BUFF_CDS - for(let i = this.BUFF_CDS.length - 1; i >= 0; i--) { - this.BUFF_CDS[i].duration -= dt; - if(this.BUFF_CDS[i].duration <= 0) { - this.BUFF_CDS.splice(i, 1); - } - } - - // 更新BUFF_DEDOWN - for(let i = this.BUFF_DEDOWN.length - 1; i >= 0; i--) { - this.BUFF_DEDOWN[i].duration -= dt; - if(this.BUFF_DEDOWN[i].duration <= 0) { - this.BUFF_DEDOWN.splice(i, 1); + // 更新BUFFS + for(let i = this.BUFFS.length - 1; i >= 0; i--) { + this.BUFFS[i].duration -= dt; + if(this.BUFFS[i].duration <= 0) { + this.apply_buff(this.BUFFS[i].type,-this.BUFFS[i].value) + this.BUFFS.splice(i, 1); } } @@ -527,27 +368,40 @@ export class HeroViewComp extends CCComp { } add_buff(buff:number,duration:number,type:number){ - switch(type){ - case BuffAttr.DEF: - this.BUFF_DEFS.push({value:buff,duration:duration}) + if(this.BUFFS.find(b=>b.type==type)) { + if(this.BUFFS.find(b=>b.type==type).valueb.type==type).value + this.BUFFS.find(b=>b.type==type).value=buff + this.BUFFS.find(b=>b.type==type).duration=duration + this.apply_buff(type,dis_buff_value) + } + }else{ + this.BUFFS.push({value:buff,duration:duration,type:type}) + this.apply_buff(type,buff) + } + } + // 应用buff,有基础值的需要特殊处理,其他的直接加减 + apply_buff(buff_type:number,buff_value:number){ + switch(buff_type){ + case BuffAttr.ATK: //攻击百分比 + this.Attrs[BuffAttr.AP]+=Math.floor(buff_value/100*this.ap) break - case BuffAttr.ATK: - this.BUFF_ATKS.push({value:buff,duration:duration}) + case BuffAttr.ATK_CD: //攻击速度百分比 + this.Attrs[BuffAttr.ATK_CD]+=buff_value/100*this.cd break - case BuffAttr.ATK_CD: - this.BUFF_CDS.push({value:buff,duration:duration}) + case BuffAttr.HP: //血量百分比 + this.Attrs[BuffAttr.HP_MAX]+=Math.floor(buff_value/100*this.hp_max) break - case BuffAttr.DEBUFF_DOWN: - this.BUFF_DEDOWN.push({value:buff,duration:duration}) + default: + this.Attrs[buff_type]+=buff_value break } } - do_atked(remainingDamage:number, crit:number=0,crit_d:number=0, burn_count:number=0,burn_value:number=0, - stun_time:number=0,stun_ratto:number=0, - frost_time:number=0,frost_ratto:number=0, + stun_time:number=0,stun_ratio:number=0, + frost_time:number=0,frost_ratio:number=0, atked_anm:string="atked" ){ this.do_atked_trigger() @@ -555,7 +409,7 @@ export class HeroViewComp extends CCComp { this.add_debuff(DebuffAttr.BURN,burn_value,burn_count,100) } if(stun_time>0){ - this.add_debuff(DebuffAttr.STUN,stun_time,1,stun_ratto) + this.add_debuff(DebuffAttr.STUN,stun_time,1,stun_ratio) } if(this.check_shield()) return if(this.check_dodge()) return @@ -730,8 +584,8 @@ export class HeroViewComp extends CCComp { if(this.fac==FacSet.MON) return console.log("[HeroViewComp]:升级",this.BUFFCOMP) if(this.hero_uuid!=data.uuid) return - this.change_ap(HeroInfo[data.uuid].ap,true) - this.change_hp_max(HeroInfo[data.uuid].hp,true) + this.apply_buff(BuffAttr.HP_MAX,data.hp) + this.apply_buff(BuffAttr.AP,data.ap) this.BUFFCOMP.lv_up() // this.BUFFCOMP.tooltip(TooltipTypes.lvup) } diff --git a/assets/script/game/hero/Mon.ts b/assets/script/game/hero/Mon.ts index e8de2a2f..1887c326 100644 --- a/assets/script/game/hero/Mon.ts +++ b/assets/script/game/hero/Mon.ts @@ -75,7 +75,7 @@ export class Monster extends ecs.Entity { hv.box_group = box_group; hv.hero_uuid= uuid; hv.hero_name= hero.name; - hv.speed =hv.ospeed = hero.speed; + hv.speed =hv.speed_base = hero.speed; hv.dis = hero.dis; // 肉鸽模式使用固定数值,否则使用等级计算 @@ -174,7 +174,7 @@ export class Monster extends ecs.Entity { hv.ap=hv.ap*(100+buff.value)/100 break case BuffAttr.FROST_RATIO: - hv.frost_ratto+=buff.value + hv.frost_ratio+=buff.value break } } diff --git a/assets/script/game/hero/SkillConComp.ts b/assets/script/game/hero/SkillConComp.ts index f5aa3482..4552d6c6 100644 --- a/assets/script/game/hero/SkillConComp.ts +++ b/assets/script/game/hero/SkillConComp.ts @@ -1,6 +1,6 @@ import { _decorator, Component, Node, v3, Vec3 } from 'cc'; import { HeroViewComp } from './HeroViewComp'; -import { DTType, SkillSet, SType, TGroup, TType } from '../common/config/SkillSet'; +import { BuffAttr, DTType, SkillSet, SType, TGroup, TType } from '../common/config/SkillSet'; import { Skill } from '../skills/Skill'; import { ecs } from 'db://oops-framework/libs/ecs/ECS'; import { oops } from 'db://oops-framework/core/Oops'; @@ -50,7 +50,7 @@ export class SkillConComp extends CCComp { if(this.HeroView.DEBUFF_STUN <= 0&&this.HeroView.DEBUFF_FROST <= 0) { for(let i=0;i (i==0?this.count_cd(this.HeroView.skills[i].cd_max,this.HeroView):this.HeroView.skills[i].cd_max)){ + if(this.HeroView.skills[i].cd > (i==0?this.HeroView.Attrs[BuffAttr.ATK_CD]:this.HeroView.skills[i].cd_max)){ let sc=SkillSet[this.HeroView.skills[i].uuid] if(!sc) return if(sc.SType==SType.damage&&!this.HeroView.is_atking) return @@ -90,21 +90,7 @@ export class SkillConComp extends CCComp { } } - count_cd(cd:number,view:HeroViewComp){ - // 汇总DEBUFF_DECD,不再按次数减少,改为按时间减少 - let decd = 0; - for (let i = view.DEBUFF_DECDS.length - 1; i >= 0; i--) { - decd += view.DEBUFF_DECDS[i].value; - // 不再在这里减少duration,改为在update中按时间减少 - } - let bcd=0 - for (let i = view.BUFF_CDS.length - 1; i >= 0; i--) { - bcd += view.BUFF_CDS[i].value; - // 不再在这里减少duration,改为在update中按时间减少 - } - return cd/((bcd+decd)/100+1) - } /** 施放技能 */ castSkill(config: typeof SkillSet[keyof typeof SkillSet]) { // //console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid); @@ -171,7 +157,7 @@ export class SkillConComp extends CCComp { check_wfuny(){ let random = Math.random()*100 - if(random < this.HeroView.wfuny){ + if(random < this.HeroView.Attrs[BuffAttr.WFUNY]){ return true } return false diff --git a/assets/script/game/map/RogueConfig.ts b/assets/script/game/map/RogueConfig.ts index 38134956..cb357e32 100644 --- a/assets/script/game/map/RogueConfig.ts +++ b/assets/script/game/map/RogueConfig.ts @@ -663,7 +663,7 @@ export class RogueConfig { break; case BuffAttr.FROST_RATIO: // 冰冻概率提升3倍效果 - modifiedStats.frost_ratto = (modifiedStats.frost_ratto || 0) + enhancedValue; + modifiedStats.frost_ratio = (modifiedStats.frost_ratio || 0) + enhancedValue; break; } diff --git a/assets/script/game/skills/Skill.ts b/assets/script/game/skills/Skill.ts index 86776cf4..015ddcbf 100644 --- a/assets/script/game/skills/Skill.ts +++ b/assets/script/game/skills/Skill.ts @@ -2,7 +2,7 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { BoxSet, FacSet } from "../common/config/BoxSet"; import { HType } from "../common/config/heroSet"; -import { SkillSet } from "../common/config/SkillSet"; +import { BuffAttr, SkillSet } from "../common/config/SkillSet"; import { smc } from "../common/SingletonModuleComp"; import { HeroViewComp } from "../hero/HeroViewComp"; import { SkillCom } from "./SkillCom"; @@ -86,79 +86,34 @@ export class Skill extends ecs.Entity { return; } - // 获取计算后的属性数据 - let ap_data = this.get_ap(caster,dmg,uuid) - + // 只设置必要的运行时属性,配置信息通过 SkillSet[uuid] 访问 Object.assign(SComp, { // 核心标识 s_uuid: uuid, - // 位置和施法者信息 startPos: startPos, targetPos: targetPos, caster: caster, group: caster.box_group, fac: caster.fac, - - // 计算后的战斗数据 - ap: ap_data.ap, - caster_crit: ap_data.crit, - caster_crit_d: ap_data.crit_d, - puncture: ap_data.puncture, - puncture_damage: ap_data.puncture_damage, - burn_count: ap_data.burn_count, - burn_value: ap_data.burn_value, - stun_time: ap_data.stun_time, - stun_ratto: ap_data.stun_ratto, - frost_time: ap_data.frost_time, - frost_ratto: ap_data.frost_ratto, + // 技能数值 + ap: caster.Attrs[BuffAttr.AP], + caster_crit: caster.Attrs[BuffAttr.CRITICAL], + caster_crit_d: caster.Attrs[BuffAttr.CRITICAL_DMG], + puncture: caster.Attrs[BuffAttr.PUNCTURE], + puncture_damage: caster.Attrs[BuffAttr.PUNCTURE_DMG], + burn_count: caster.Attrs[BuffAttr.BURN_COUNT], + burn_value: caster.Attrs[BuffAttr.BURN_VALUE], + stun_time: caster.Attrs[BuffAttr.STUN_TIME], + stun_ratio: caster.Attrs[BuffAttr.STUN_RATIO], + frost_time: caster.Attrs[BuffAttr.FROST_TIME], + frost_ratio: caster.Attrs[BuffAttr.FROST_RATIO], + debuff_up: caster.Attrs[BuffAttr.DEBUFF_UP], + debuff_value: caster.Attrs[BuffAttr.DEBUFF_VALUE], + debuff_count: caster.Attrs[BuffAttr.DEBUFF_COUNT], }); this.add(SComp); } - - get_ap(view:HeroViewComp,dmg:number=0,uuid:number=0){ - let ap=0 - let crit=0 - let crit_d=0 - let buffap=1 - let puncture=0 - let puncture_damage=0 - let burn_count=0 - let burn_value=0 - let stun_time=0 - let stun_ratto=0 - let frost_time=0 - let frost_ratto=0 - // 汇总DEBUFF_DECD并处理count值 - let BUFF_ATK = 0 - let DEBUFF_DEATK = 0 - if(view.BUFF_ATKS.length>0){ - for (let i = view.BUFF_ATKS.length - 1; i >= 0; i--) { - BUFF_ATK += view.BUFF_ATKS[i].value; - // 不再在这里减少duration,改为在update中按时间减少 - } - } - if(view.DEBUFF_DEATKS.length>0) { - for (let i = view.DEBUFF_DEATKS.length - 1; i >= 0; i--) { - DEBUFF_DEATK += view.DEBUFF_DEATKS[i].value; - // 不再在这里减少duration,改为在update中按时间减少 - } - } - - let BUFF_AP=(100-DEBUFF_DEATK+BUFF_ATK+dmg)/100 //buff区 总加成 - puncture =view.puncture - puncture_damage=view.puncture_damage - ap=view.ap*buffap*BUFF_AP*SkillSet[uuid].ap/100 - crit=view.crit - crit_d=view.crit_d - burn_count=view.burn_count - burn_value=view.burn_value - stun_time=view.stun_time - stun_ratto=view.stun_ratto - frost_time=view.frost_time - frost_ratto=view.frost_ratto - return {ap,crit,crit_d,puncture,puncture_damage,burn_count,burn_value,stun_time,stun_ratto,frost_time,frost_ratto} - } } diff --git a/assets/script/game/skills/SkillCom.ts b/assets/script/game/skills/SkillCom.ts index d2b7ff4d..c4071104 100644 --- a/assets/script/game/skills/SkillCom.ts +++ b/assets/script/game/skills/SkillCom.ts @@ -36,8 +36,8 @@ export class SkillCom extends CCComp { burn_count:number=0; burn_value:number=0; stun_time:number=0; - stun_ratto:number=0; - frost_ratto:number=0; + stun_ratio:number=0; + frost_ratio:number=0; frost_time:number=0; run_time:number=0; hited_time:number=0; @@ -46,7 +46,9 @@ export class SkillCom extends CCComp { caster_crit_d:number=0; puncture:number=0; puncture_damage:number=0; - + debuff_up:number=0; + debuff_value:number=0; + debuff_count:number=0; // 组件引用 spine:sp.Skeleton=null; anim:Animation=null; @@ -159,23 +161,10 @@ export class SkillCom extends CCComp { onAnimationFinished(){ // console.log("[SkillCom]:onAnimationFinished",this.s_uuid) if (!this.skillConfig) return; - if(this.skillConfig.EType==EType.timeEnd) return - if(this.skillConfig.SType!=SType.damage){ - this.to_do_buff() - } - this.is_destroy=true } - to_do_buff(){ - if (!this.skillConfig) return; - - switch(this.skillConfig.SType){ - case SType.shield: - this.caster.add_shield(this.skillConfig.buV) - break; - } - } + //单体伤害 single_damage(target:HeroViewComp,is_range:boolean=false){ // //console.log("[SkillCom]:onBeginContact hit_count:",this.hit_count,SkillSet[this.s_uuid].hit) @@ -188,17 +177,17 @@ export class SkillCom extends CCComp { } target.do_atked(ap,this.caster_crit,this.caster_crit_d, this.burn_count,this.burn_value, - this.stun_time,this.stun_ratto, - this.frost_time,this.frost_ratto, + this.stun_time,this.stun_ratio, + this.frost_time,this.frost_ratio, this.skillConfig.AtkedType ) // ap 及暴击 属性已经在skill.ts 处理 // console.log("[SkillCom]:single_damage t:tp:rtp",this.node.position,this.targetPos,target.node.position) if(this.skillConfig.debuff>0){ let debuff=this.skillConfig - let dev=debuff.deV*(100+this.caster.DEBUFF_VALUE)/100 - let deR=debuff.deR+this.caster.DEBUFF_UP + let dev=debuff.deV*(100+this.debuff_value)/100 + let deR=debuff.deR+this.debuff_up dev=Math.round(dev*100)/100 - let deC=debuff.deC+this.caster.DEBUFF_COUNT //dec只作为次数叠加 + let deC=debuff.deC+this.debuff_count //dec只作为次数叠加 // //console.log("[SkillCom]:debuff",this.skillConfig.name,debuff.debuff,deUP.deV,deUP.deC) target.add_debuff(debuff.debuff,dev,deC,deR) } diff --git a/assets/script/wp.md b/assets/script/wp.md index 79e8e322..46b705a5 100644 --- a/assets/script/wp.md +++ b/assets/script/wp.md @@ -97,7 +97,7 @@ interface TalentConfig { | 技能冷却 | SKILL_CD | +24% | +40% | 技能冷却缩减 | | 冰冻概率 | FROST_RATIO | +6% | +10% | 冰冻效果概率 | | 击退概率 | KNOCKBACK | +6% | +10% | 击退效果概率 | -| 击晕概率 | STUN_RATTO | +6% | +10% | 击晕效果概率 | +| 击晕概率 | STUN_RATIO | +6% | +10% | 击晕效果概率 | | 反伤 | REFLECT | +12% | +20% | 反伤比例 | | 吸血 | POWER_UP | +12% | +20% | 吸血比例 |