Browse Source

修复移动端战斗中更换装备打不死BUG

v1.0
许孟阳 1 week ago
parent
commit
6f8d63f675
  1. 6
      src/config/beings.ts
  2. 3
      src/tool/caller/attribute.ts

6
src/config/beings.ts

@ -52,6 +52,12 @@ export class Attribute {
}); });
} }
} }
copy(attr: Attribute) {
Object.keys(attr).forEach((key) => {
this[key] = attr[key];
});
}
} }
export class Player { export class Player {

3
src/tool/caller/attribute.ts

@ -48,7 +48,8 @@ export const callPlayerAttribute = (player: Player, base: any) => {
attribute.dps = Math.ceil((1 - crit + crit * critdmg) * atk * (1 + dmgPercent)); attribute.dps = Math.ceil((1 - crit + crit * critdmg) * atk * (1 + dmgPercent));
//计算减伤比例 //计算减伤比例
attribute.reducPercent = callReducPercent(attribute.def, player.lv); attribute.reducPercent = callReducPercent(attribute.def, player.lv);
player.attribute = attribute;
player.attribute.copy(attribute);
}; };
/** /**

Loading…
Cancel
Save