From af60c4df6619b594272d92f699f31180b76fc772 Mon Sep 17 00:00:00 2001 From: Keyacom <70766223+Keyacom@users.noreply.github.com> Date: Sat, 29 Jan 2022 19:24:42 +0100 Subject: [PATCH] Use the .max function in Substitute's code (#167) --- Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb b/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb index 828b251ae..32ef6761c 100644 --- a/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb +++ b/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb @@ -528,8 +528,7 @@ class Battle::Move::UserMakeSubstitute < Battle::Move @battle.pbDisplay(_INTL("{1} already has a substitute!", user.pbThis)) return true end - @subLife = user.totalhp / 4 - @subLife = 1 if @subLife < 1 + @subLife = [user.totalhp / 4, 1].max if user.hp <= @subLife @battle.pbDisplay(_INTL("But it does not have enough HP left to make a substitute!")) return true