mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 06:34:59 +00:00
Some more code for Gen 9 abilities
This commit is contained in:
@@ -638,6 +638,29 @@ class Battle::Battler
|
||||
return false
|
||||
end
|
||||
|
||||
# Returns whether this battler can be made to switch out because of another
|
||||
# battler's move.
|
||||
def canBeForcedOutOfBattle?(show_message = true)
|
||||
if hasActiveAbility?(:SUCTIONCUPS) && !beingMoldBroken?
|
||||
if show_message
|
||||
@battle.pbShowAbilitySplash(self)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("{1} anchors itself!", pbThis))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} anchors itself with {2}!", pbThis, abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
end
|
||||
return false
|
||||
end
|
||||
return false if hasActiveAbility?(:GUARDDOG) && !beingMoldBroken?
|
||||
if @effects[PBEffects::Ingrain]
|
||||
@battle.pbDisplay(_INTL("{1} anchored itself with its roots!", pbThis)) if show_message
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
def movedThisRound?
|
||||
return @lastRoundMoved && @lastRoundMoved == @battle.turnCount
|
||||
end
|
||||
|
||||
@@ -332,7 +332,14 @@ class Battle::Battler
|
||||
return false
|
||||
end
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
return pbLowerStatStageByAbility(:ATTACK, 1, user, false)
|
||||
if hasActiveAbility?(:GUARDDOG)
|
||||
@battle.pbShowAbilitySplash(self)
|
||||
ret = pbRaiseStatStageByAbility(:ATTACK, 1, user, false)
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
return ret
|
||||
else
|
||||
return pbLowerStatStageByAbility(:ATTACK, 1, user, false)
|
||||
end
|
||||
end
|
||||
# NOTE: These checks exist to ensure appropriate messages are shown if
|
||||
# Intimidate is blocked somehow (i.e. the messages should mention the
|
||||
@@ -365,6 +372,10 @@ class Battle::Battler
|
||||
return false
|
||||
end
|
||||
end
|
||||
if hasActiveAbility?(:GUARDDOG)
|
||||
return false if !pbCanRaiseStatStage?(:ATTACK, user)
|
||||
return pbRaiseStatStageByCause(:ATTACK, 1, user, user.abilityName)
|
||||
end
|
||||
return false if !pbCanLowerStatStage?(:ATTACK, user)
|
||||
return pbLowerStatStageByCause(:ATTACK, 1, user, user.abilityName)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user