fix(战斗系统): 调整伤害计算公式并简化属性卡牌配置
- 在伤害计算中,将防御属性从百分比减免改为固定值减免,确保至少造成1点伤害 - 移除天赋免伤对防御属性的影响,使防御计算更清晰 - 简化一阶属性卡牌配置,移除不常用的特殊属性卡牌
This commit is contained in:
@@ -11,20 +11,12 @@ import { Attrs } from "./HeroAttrs";
|
|||||||
}
|
}
|
||||||
export const AttrCards: Record<number, AttrInfo> = {
|
export const AttrCards: Record<number, AttrInfo> = {
|
||||||
//*一阶 */
|
//*一阶 */
|
||||||
2001:{uuid:2001, icon:"1020", attr: Attrs.AP, value: 20, desc: "攻击力 +20%", isSpecial: false,name: "强化攻击" },
|
2001:{uuid:2001, icon:"1020", attr: Attrs.AP, value: 20, desc: "攻击力 +20%", isSpecial: false,name: "攻击" },
|
||||||
2002:{uuid:2002, icon:"1020", attr: Attrs.HP_MAX, value: 20, desc: "生命上限 +20%", isSpecial: false,name: "强化生命" },
|
2002:{uuid:2002, icon:"1020", attr: Attrs.HP_MAX, value: 20, desc: "生命上限 +20%", isSpecial: false,name: "生命" },
|
||||||
2003:{uuid:2003, icon:"1020", attr: Attrs.DEF, value: 20, desc: "防御力 +20%", isSpecial: false,name: "强化防御" },
|
2003:{uuid:2003, icon:"1020", attr: Attrs.DEF, value: 20, desc: "防御力 +20%", isSpecial: false,name: "防御" },
|
||||||
2004:{uuid:2004, icon:"1020", attr: Attrs.AS, value: 5, desc: "攻击速度 +5%", isSpecial: false,name: "强化攻速" },
|
2004:{uuid:2004, icon:"1020", attr: Attrs.AS, value: 5, desc: "攻击速度 +5%", isSpecial: false,name: "攻速" },
|
||||||
2005:{uuid:2005, icon:"1020", attr: Attrs.LIFESTEAL, value: 10, desc: "吸血比例 +2%", isSpecial: true,name: "强化吸血" },
|
2005:{uuid:2007, icon:"1020", attr: Attrs.CRITICAL_DMG, value: 10, desc: "暴击伤害 +10%", isSpecial: true,name: "爆伤" },
|
||||||
2006:{uuid:2006, icon:"1020", attr: Attrs.CRITICAL, value: 5, desc: "暴击率 +2%", isSpecial: true,name: "强化暴击" },
|
2006:{uuid:2013, icon:"1020", attr: Attrs.DODGE, value: 5, desc: "闪避率 +5%", isSpecial: true,name: "闪避" },
|
||||||
2007:{uuid:2007, icon:"1020", attr: Attrs.CRITICAL_DMG, value: 10, desc: "暴击伤害 +10%", isSpecial: true,name: "强化爆伤" },
|
|
||||||
2008:{uuid:2008, icon:"1020", attr: Attrs.STUN_CHANCE, value: 5, desc: "眩晕概率 +2%", isSpecial: true,name: "强化眩晕" },
|
|
||||||
2009:{uuid:2009, icon:"1020", attr: Attrs.FREEZE_CHANCE, value: 5, desc: "冰冻概率 +2%", isSpecial: true,name: "强化冰冻" },
|
|
||||||
2010:{uuid:2010, icon:"1020", attr: Attrs.BURN_CHANCE, value: 5, desc: "燃烧概率 +2%", isSpecial: true,name: "强化燃烧" },
|
|
||||||
2011:{uuid:2011, icon:"1020", attr: Attrs.BACK_CHANCE, value: 5, desc: "击退概率 +2%", isSpecial: true,name: "强化击退" },
|
|
||||||
2012:{uuid:2012, icon:"1020", attr: Attrs.SLOW_CHANCE, value: 5, desc: "减速概率 +2%", isSpecial: true,name: "强化减速" },
|
|
||||||
2013:{uuid:2013, icon:"1020", attr: Attrs.DODGE, value: 5, desc: "闪避率 +5%", isSpecial: true,name: "强化闪避" },
|
|
||||||
2014:{uuid:2014, icon:"1020", attr: Attrs.HP_REGEN, value: 20, desc: "回血 +20%", isSpecial: true,name: "强化回血" },
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +47,7 @@ export const PotionCards: Record<number, PotionInfo> = {
|
|||||||
|
|
||||||
export const CanSelectAttrs: Record<number, number[]> = {
|
export const CanSelectAttrs: Record<number, number[]> = {
|
||||||
// 1阶属性
|
// 1阶属性
|
||||||
1: [2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014],
|
1: [2001, 2002, 2003, 2004, 2005, 2006],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CanSelectPotions: Record<number, number[]> = {
|
export const CanSelectPotions: Record<number, number[]> = {
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
|
|||||||
const isCrit = this.checkChance(damageEvent.Attrs[Attrs.CRITICAL]-TAttrsComp.Attrs[Attrs.CRITICAL_RES]);
|
const isCrit = this.checkChance(damageEvent.Attrs[Attrs.CRITICAL]-TAttrsComp.Attrs[Attrs.CRITICAL_RES]);
|
||||||
// 计算基础伤害
|
// 计算基础伤害
|
||||||
let damage = this.dmgCount(damageEvent,TAttrsComp);
|
let damage = this.dmgCount(damageEvent,TAttrsComp);
|
||||||
|
|
||||||
mLogger.log(this.debugMode, 'HeroAtkSystem', " dmgCount",damage)
|
mLogger.log(this.debugMode, 'HeroAtkSystem', " dmgCount",damage)
|
||||||
if (isCrit) {
|
if (isCrit) {
|
||||||
// 暴击伤害计算
|
// 暴击伤害计算
|
||||||
@@ -331,7 +332,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
|
|||||||
// 易伤
|
// 易伤
|
||||||
let DMG_INVUL = TAttrs[Attrs.DMG_INVUL]||0
|
let DMG_INVUL = TAttrs[Attrs.DMG_INVUL]||0
|
||||||
// 免伤 属性免伤+天赋免伤
|
// 免伤 属性免伤+天赋免伤
|
||||||
let DMG_RED = (TAttrs[Attrs.DEF]||0) + TAttrsComp.useCountValTal(Attrs.DEF);
|
let DMG_RED = TAttrsComp.useCountValTal(Attrs.DEF);
|
||||||
// 4. 确保伤害值非负
|
// 4. 确保伤害值非负
|
||||||
let total = Math.max(0, apBase);
|
let total = Math.max(0, apBase);
|
||||||
|
|
||||||
@@ -341,7 +342,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
|
|||||||
let damageRatio = 1 + (DMG_INVUL - DMG_RED) / 100;
|
let damageRatio = 1 + (DMG_INVUL - DMG_RED) / 100;
|
||||||
damageRatio = Math.max(0, damageRatio); // 确保伤害系数不为负(即最多减免至0伤害)
|
damageRatio = Math.max(0, damageRatio); // 确保伤害系数不为负(即最多减免至0伤害)
|
||||||
|
|
||||||
total = Math.floor(total * damageRatio);
|
total = Math.max(1,Math.floor(total * damageRatio-TAttrs[Attrs.DEF]));
|
||||||
|
|
||||||
if (this.debugMode) mLogger.log(this.debugMode, 'HeroAtkSystem', ` 最终伤害: ${total} (Base: ${apBase}, Def: ${DMG_RED}%, Invul: ${DMG_INVUL}%, Ratio: ${damageRatio})`);
|
if (this.debugMode) mLogger.log(this.debugMode, 'HeroAtkSystem', ` 最终伤害: ${total} (Base: ${apBase}, Def: ${DMG_RED}%, Invul: ${DMG_INVUL}%, Ratio: ${damageRatio})`);
|
||||||
return total;
|
return total;
|
||||||
|
|||||||
Reference in New Issue
Block a user