mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Use the .max function in Substitute's code (#167)
This commit is contained in:
@@ -528,8 +528,7 @@ class Battle::Move::UserMakeSubstitute < Battle::Move
|
|||||||
@battle.pbDisplay(_INTL("{1} already has a substitute!", user.pbThis))
|
@battle.pbDisplay(_INTL("{1} already has a substitute!", user.pbThis))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@subLife = user.totalhp / 4
|
@subLife = [user.totalhp / 4, 1].max
|
||||||
@subLife = 1 if @subLife < 1
|
|
||||||
if user.hp <= @subLife
|
if user.hp <= @subLife
|
||||||
@battle.pbDisplay(_INTL("But it does not have enough HP left to make a substitute!"))
|
@battle.pbDisplay(_INTL("But it does not have enough HP left to make a substitute!"))
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user