Altered Substitute/Shed Tail success condition to account for rounding up

This commit is contained in:
EscaShark 2025-01-30 21:29:11 +01:00 committed by Sirz Benjie
parent 009237e623
commit d36c279166
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -1903,7 +1903,7 @@ export class AddSubstituteAttr extends MoveEffectAttr {
}
getCondition(): MoveConditionFunc {
return (user, target, move) => !user.getTag(SubstituteTag) && user.hp > Math.floor(user.getMaxHp() * this.hpCost) && user.getMaxHp() > 1;
return (user, target, move) => !user.getTag(SubstituteTag) && user.hp > (this.roundUp ? Math.ceil(user.getMaxHp() * this.hpCost) : Math.floor(user.getMaxHp() * this.hpCost)) && user.getMaxHp() > 1;
}
/**