refactor(skill): 统一并更正deV字段命名
- 将DbuffConf接口中的字段名称dev修正为deV - 修复HeroViewComp中所有对dev字段的引用为deV - 调整BattleMoveSystem中速度计算逻辑,使用正确的buff叠加值 - 统一代码注释中减少值的字段名称为deV - 保持功能逻辑不变,提升代码一致性和可读性
This commit is contained in:
@@ -40,7 +40,7 @@ const { ccclass, property } = _decorator;
|
||||
* const dbuffConf: DbuffConf = {
|
||||
* debuff: DBuff.STUN, // 眩晕
|
||||
* BType: BType.VALUE, // 数值型
|
||||
* dev: 20, // 减少值
|
||||
* deV: 20, // 减少值
|
||||
* deC: 3, // 持续3秒
|
||||
* deR: 100 // 触发概率(100%)
|
||||
* };
|
||||
@@ -279,7 +279,7 @@ export class HeroViewComp extends CCComp {
|
||||
if (dbuffConf.deC === 0) {
|
||||
// 持久型 - 如果已存在,累加数值
|
||||
if (this.V_DBUFF[debuffKey]) {
|
||||
this.V_DBUFF[debuffKey].dev += dbuffConf.dev;
|
||||
this.V_DBUFF[debuffKey].deV += dbuffConf.deV;
|
||||
} else {
|
||||
this.V_DBUFF[debuffKey] = {
|
||||
...dbuffConf,
|
||||
@@ -289,7 +289,7 @@ export class HeroViewComp extends CCComp {
|
||||
} else {
|
||||
// 临时型 - 如果已存在,累加数值并重置时间
|
||||
if (this.V_DBUFFS[debuffKey]) {
|
||||
this.V_DBUFFS[debuffKey].dev += dbuffConf.dev;
|
||||
this.V_DBUFFS[debuffKey].deV += dbuffConf.deV;
|
||||
this.V_DBUFFS[debuffKey].remainTime = Math.max(this.V_DBUFFS[debuffKey].remainTime, dbuffConf.deC);
|
||||
} else {
|
||||
this.V_DBUFFS[debuffKey] = {
|
||||
@@ -304,7 +304,7 @@ export class HeroViewComp extends CCComp {
|
||||
if (dbuffConf.deC === 0) {
|
||||
// 持久型 - 如果已存在,累加百分比
|
||||
if (this.R_DBUFF[debuffKey]) {
|
||||
this.R_DBUFF[debuffKey].dev += dbuffConf.dev;
|
||||
this.R_DBUFF[debuffKey].deV += dbuffConf.deV;
|
||||
} else {
|
||||
this.R_DBUFF[debuffKey] = {
|
||||
...dbuffConf,
|
||||
@@ -314,7 +314,7 @@ export class HeroViewComp extends CCComp {
|
||||
} else {
|
||||
// 临时型 - 如果已存在,累加百分比并重置时间
|
||||
if (this.R_DBUFFS[debuffKey]) {
|
||||
this.R_DBUFFS[debuffKey].dev += dbuffConf.dev;
|
||||
this.R_DBUFFS[debuffKey].deV += dbuffConf.deV;
|
||||
this.R_DBUFFS[debuffKey].remainTime = Math.max(this.R_DBUFFS[debuffKey].remainTime, dbuffConf.deC);
|
||||
} else {
|
||||
this.R_DBUFFS[debuffKey] = {
|
||||
@@ -431,7 +431,7 @@ export class HeroViewComp extends CCComp {
|
||||
const debuff = this.V_DBUFF[debuffKey];
|
||||
// 跳过状态类 debuff(attrField === -1)
|
||||
if (debuff.attrField !== undefined && debuff.attrField >= 0) {
|
||||
this.Attrs[debuff.attrField] -= debuff.dev;
|
||||
this.Attrs[debuff.attrField] -= debuff.deV;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,7 +440,7 @@ export class HeroViewComp extends CCComp {
|
||||
const debuff = this.V_DBUFFS[debuffKey];
|
||||
// 跳过状态类 debuff(attrField === -1)
|
||||
if (debuff.attrField !== undefined && debuff.attrField >= 0) {
|
||||
this.Attrs[debuff.attrField] -= debuff.dev;
|
||||
this.Attrs[debuff.attrField] -= debuff.deV;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -464,7 +464,7 @@ export class HeroViewComp extends CCComp {
|
||||
// 跳过状态类 debuff(attrField === -1)
|
||||
if (debuff.attrField !== undefined && debuff.attrField >= 0) {
|
||||
const baseVal = baseValues[debuff.attrField] || this.Attrs[debuff.attrField];
|
||||
this.Attrs[debuff.attrField] -= Math.floor(baseVal * (debuff.dev / 100));
|
||||
this.Attrs[debuff.attrField] -= Math.floor(baseVal * (debuff.deV / 100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -474,7 +474,7 @@ export class HeroViewComp extends CCComp {
|
||||
// 跳过状态类 debuff(attrField === -1)
|
||||
if (debuff.attrField !== undefined && debuff.attrField >= 0) {
|
||||
const baseVal = baseValues[debuff.attrField] || this.Attrs[debuff.attrField];
|
||||
this.Attrs[debuff.attrField] -= Math.floor(baseVal * (debuff.dev / 100));
|
||||
this.Attrs[debuff.attrField] -= Math.floor(baseVal * (debuff.deV / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user