Coded some Gen 9 ability/item/move effects

This commit is contained in:
Maruno17
2024-06-15 15:58:31 +01:00
parent 454d5a216a
commit 22b33ca6c2
35 changed files with 596 additions and 234 deletions

View File

@@ -342,19 +342,16 @@ class Battle::Move::StartPsychicTerrain < Battle::Move
end
#===============================================================================
# Removes the current terrain. Fails if there is no terrain in effect.
# (Steel Roller)
# Removes the current terrain. (Ice Spinner)
#===============================================================================
class Battle::Move::RemoveTerrain < Battle::Move
def pbMoveFailed?(user, targets)
if @battle.field.terrain == :None
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return false
end
# NOTE: Bulbapedia claims that Ice Spinner shouldn't remove terrain if the
# user faints because of its Life Orb or is switched out by Red Card.
# I can't find any evidence of this. Also, those items trigger at the
# very end of a move's use, way after move effects usually happen. I'm
# treating Bulbapedia's claim as a mistake and ignoring it.
def pbEffectGeneral(user)
return if user.fainted?
case @battle.field.terrain
when :Electric
@battle.pbDisplay(_INTL("The electricity disappeared from the battlefield."))
@@ -369,6 +366,20 @@ class Battle::Move::RemoveTerrain < Battle::Move
end
end
#===============================================================================
# Removes the current terrain. Fails if there is no terrain in effect.
# (Steel Roller)
#===============================================================================
class Battle::Move::RemoveTerrainFailsIfNoTerrain < Battle::Move::RemoveTerrain
def pbMoveFailed?(user, targets)
if @battle.field.terrain == :None
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return false
end
end
#===============================================================================
# Entry hazard. Lays spikes on the opposing side (max. 3 layers). (Spikes)
#===============================================================================