ah i'm silly

This commit is contained in:
Hexugory 2023-04-01 03:26:30 -05:00
parent c667e6cc1b
commit 61a08a831a

View File

@ -233,13 +233,15 @@ export class Battle {
if (effect.damage) {
let damage = effect.damage;
//multiply by damageChange sum
damage *= self.potencyEffects
damage *= Math.max(0,
self.potencyEffects
.filter(status => {return status.type === 'damage'})
.reduce((a, b) => a + (b.potency/100), 1);
.reduce((a, b) => a + (b.potency/100), 1));
//multiply by resistanceChange sum
damage *= self.potencyEffects
damage *= Math.max(0,
self.potencyEffects
.filter(status => {return status.type === 'resistance'})
.reduce((a, b) => a - (b.potency/100), 1);
.reduce((a, b) => a - (b.potency/100), 1));
damage = Math.round(damage)
this.appendLog(`(${target.team}) ${target.character.nameShort} took ${damage} damage!`);
@ -451,9 +453,10 @@ export class Battle {
reverseHierarchy: (self: BattleUnit, target: BattleUnit, battle: Battle) => {
let damage = 10+Math.floor(target.defaultHealth/10)*3;
//multiply by damageChange sum
damage *= self.potencyEffects
damage *= Math.max(0,
self.potencyEffects
.filter(status => {return status.type === 'damage'})
.reduce((a, b) => a + (b.potency/100), 1);
.reduce((a, b) => a + (b.potency/100), 1));
//multiply by resistanceChange sum
damage *= Math.max(0,
self.potencyEffects
@ -467,13 +470,15 @@ export class Battle {
issunBoushi: (self: BattleUnit, target: BattleUnit, battle: Battle) => {
let damage = Math.floor(target.defaultHealth/10)*5;
//multiply by damageChange sum
damage *= self.potencyEffects
damage *= Math.max(0,
self.potencyEffects
.filter(status => {return status.type === 'damage'})
.reduce((a, b) => a + (b.potency/100), 1);
.reduce((a, b) => a + (b.potency/100), 1));
//multiply by resistanceChange sum
damage *= self.potencyEffects
damage *= Math.max(0,
self.potencyEffects
.filter(status => {return status.type === 'resistance'})
.reduce((a, b) => a - (b.potency/100), 1);
.reduce((a, b) => a - (b.potency/100), 1));
damage = Math.round(damage)
this.appendLog(`(${target.team}) ${target.character.nameShort} took ${damage} damage!`);