#===============================================================================
# Sacrifices 1/4 of HP to increase Attack.
#===============================================================================
class Battle::Move::RaiseUserAttackLoseQuarterOfTotalHP < Battle::Move
attr_reader :statUp
def canSnatch?; return true; end
def initialize(battle, move)
super
@statUp = [:ATTACK, 1]
end
def pbMoveFailed?(user, targets)
hpLoss = [user.totalhp / 4, 1].max
if user.hp <= hpLoss
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return true if !user.pbCanRaiseStatStage?(@statUp[0], user, self, true)
return false
end
def pbEffectGeneral(user)
hpLoss = [user.totalhp / 4, 1].max
user.pbReduceHP(hpLoss, false, false)
if user.hasActiveAbility?(:CONTRARY)
user.statsLoweredThisRound = true
user.statsDropped = true
@battle.pbCommonAnimation("StatDown", user)
@battle.pbDisplay(_INTL("{1} cut its own HP and lowered its {2}!",
user.pbThis, GameData::Stat.get(@statUp[0]).name))
else
user.statsRaisedThisRound = true
@battle.pbCommonAnimation("StatUp", user)
@battle.pbDisplay(_INTL("{1} cut its own HP and raised its {2}!",
user.pbThis, GameData::Stat.get(@statUp[0]).name))
end
user.pbItemHPHealCheck
end
end