mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Added classes GameData::Environment and GameData::BattleTerrain
This commit is contained in:
@@ -60,13 +60,13 @@ class PokeBattle_Battler
|
||||
# Terrains immunity
|
||||
if affectedByTerrain?
|
||||
case @battle.field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
when :Electric
|
||||
if newStatus == :SLEEP
|
||||
@battle.pbDisplay(_INTL("{1} surrounds itself with electrified terrain!",
|
||||
pbThis(true))) if showMessages
|
||||
return false
|
||||
end
|
||||
when PBBattleTerrains::Misty
|
||||
when :Misty
|
||||
@battle.pbDisplay(_INTL("{1} surrounds itself with misty terrain!",pbThis(true))) if showMessages
|
||||
return false
|
||||
end
|
||||
@@ -175,7 +175,7 @@ class PokeBattle_Battler
|
||||
# Trying to replace a status problem with another one
|
||||
return false if self.status != :NONE
|
||||
# Terrain immunity
|
||||
return false if @battle.field.terrain==PBBattleTerrains::Misty && affectedByTerrain?
|
||||
return false if @battle.field.terrain == :Misty && affectedByTerrain?
|
||||
# Type immunities
|
||||
hasImmuneType = false
|
||||
case newStatus
|
||||
@@ -282,8 +282,7 @@ class PokeBattle_Battler
|
||||
def pbCanSleepYawn?
|
||||
return false if self.status != :NONE
|
||||
if affectedByTerrain?
|
||||
return false if @battle.field.terrain==PBBattleTerrains::Electric
|
||||
return false if @battle.field.terrain==PBBattleTerrains::Misty
|
||||
return false if [:Electric, :Misty].include?(@battle.field.terrain)
|
||||
end
|
||||
if !hasActiveAbility?(:SOUNDPROOF)
|
||||
@battle.eachBattler do |b|
|
||||
@@ -453,7 +452,7 @@ class PokeBattle_Battler
|
||||
return false
|
||||
end
|
||||
# Terrains immunity
|
||||
if affectedByTerrain? && @battle.field.terrain==PBBattleTerrains::Misty
|
||||
if affectedByTerrain? && @battle.field.terrain == :Misty
|
||||
@battle.pbDisplay(_INTL("{1} surrounds itself with misty terrain!",pbThis(true))) if showMessages
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -295,8 +295,7 @@ class PokeBattle_Battler
|
||||
# Move-specific failures
|
||||
return false if move.pbFailsAgainstTarget?(user,target)
|
||||
# Immunity to priority moves because of Psychic Terrain
|
||||
if @battle.field.terrain==PBBattleTerrains::Psychic && target.affectedByTerrain? &&
|
||||
target.opposes?(user) &&
|
||||
if @battle.field.terrain == :Psychic && target.affectedByTerrain? && target.opposes?(user) &&
|
||||
@battle.choices[user.index][4]>0 # Move priority saved from pbCalculatePriority
|
||||
@battle.pbDisplay(_INTL("{1} surrounds itself with psychic terrain!",target.pbThis))
|
||||
return false
|
||||
|
||||
@@ -340,19 +340,15 @@ class PokeBattle_Move
|
||||
end
|
||||
end
|
||||
# Terrain moves
|
||||
if user.affectedByTerrain?
|
||||
case @battle.field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :ELECTRIC
|
||||
when PBBattleTerrains::Grassy
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :GRASS
|
||||
when PBBattleTerrains::Psychic
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :PSYCHIC
|
||||
end
|
||||
end
|
||||
if @battle.field.terrain==PBBattleTerrains::Misty && target.affectedByTerrain? &&
|
||||
type == :DRAGON
|
||||
multipliers[:base_damage_multiplier] /= 2
|
||||
case @battle.field.terrain
|
||||
when :Electric
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :ELECTRIC && user.affectedByTerrain?
|
||||
when :Grassy
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :GRASS && user.affectedByTerrain?
|
||||
when :Psychic
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :PSYCHIC && user.affectedByTerrain?
|
||||
when :Misty
|
||||
multipliers[:base_damage_multiplier] /= 2 if type == :DRAGON && target.affectedByTerrain?
|
||||
end
|
||||
# Badge multipliers
|
||||
if @battle.internalBattle
|
||||
|
||||
@@ -1201,7 +1201,7 @@ class PokeBattle_Move_044 < PokeBattle_TargetStatDownMove
|
||||
end
|
||||
|
||||
def pbBaseDamage(baseDmg,user,target)
|
||||
if @id == :BULLDOZE && @battle.field.terrain==PBBattleTerrains::Grassy
|
||||
if @id == :BULLDOZE && @battle.field.terrain == :Grassy
|
||||
baseDmg = (baseDmg/2.0).round
|
||||
end
|
||||
return baseDmg
|
||||
@@ -1287,8 +1287,7 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove
|
||||
targetOpposingSide.effects[PBEffects::Spikes]>0 ||
|
||||
targetOpposingSide.effects[PBEffects::ToxicSpikes]>0 ||
|
||||
targetOpposingSide.effects[PBEffects::StickyWeb])
|
||||
return false if Settings::MECHANICS_GENERATION >= 8 &&
|
||||
@battle.field.terrain != PBBattleTerrains::None
|
||||
return false if Settings::MECHANICS_GENERATION >= 8 && @battle.field.terrain != :None
|
||||
return super
|
||||
end
|
||||
|
||||
@@ -1344,18 +1343,18 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove
|
||||
target.pbOpposingSide.effects[PBEffects::StickyWeb] = false if Settings::MECHANICS_GENERATION >= 6
|
||||
@battle.pbDisplay(_INTL("{1} blew away sticky webs!",user.pbThis))
|
||||
end
|
||||
if Settings::MECHANICS_GENERATION >= 8 && @battle.field.terrain != PBBattleTerrains::None
|
||||
if Settings::MECHANICS_GENERATION >= 8 && @battle.field.terrain != :None
|
||||
case @battle.field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
when :Electric
|
||||
@battle.pbDisplay(_INTL("The electricity disappeared from the battlefield."))
|
||||
when PBBattleTerrains::Grassy
|
||||
when :Grassy
|
||||
@battle.pbDisplay(_INTL("The grass disappeared from the battlefield."))
|
||||
when PBBattleTerrains::Misty
|
||||
when :Misty
|
||||
@battle.pbDisplay(_INTL("The mist disappeared from the battlefield."))
|
||||
when PBBattleTerrains::Psychic
|
||||
when :Psychic
|
||||
@battle.pbDisplay(_INTL("The weirdness disappeared from the battlefield."))
|
||||
end
|
||||
@battle.field.terrain = PBBattleTerrains::None
|
||||
@battle.field.terrain = :None
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1872,22 +1871,22 @@ class PokeBattle_Move_060 < PokeBattle_Move
|
||||
@newType = :NORMAL
|
||||
checkedTerrain = false
|
||||
case @battle.field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
when :Electric
|
||||
if GameData::Type.exists?(:ELECTRIC)
|
||||
@newType = :ELECTRIC
|
||||
checkedTerrain = true
|
||||
end
|
||||
when PBBattleTerrains::Grassy
|
||||
when :Grassy
|
||||
if GameData::Type.exists?(:GRASS)
|
||||
@newType = :GRASS
|
||||
checkedTerrain = true
|
||||
end
|
||||
when PBBattleTerrains::Misty
|
||||
when :Misty
|
||||
if GameData::Type.exists?(:FAIRY)
|
||||
@newType = :FAIRY
|
||||
checkedTerrain = true
|
||||
end
|
||||
when PBBattleTerrains::Psychic
|
||||
when :Psychic
|
||||
if GameData::Type.exists?(:PSYCHIC)
|
||||
@newType = :PSYCHIC
|
||||
checkedTerrain = true
|
||||
@@ -1895,28 +1894,27 @@ class PokeBattle_Move_060 < PokeBattle_Move
|
||||
end
|
||||
if !checkedTerrain
|
||||
case @battle.environment
|
||||
when PBEnvironment::Grass, PBEnvironment::TallGrass
|
||||
when :Grass, :TallGrass
|
||||
@newType = :GRASS
|
||||
when PBEnvironment::MovingWater, PBEnvironment::StillWater,
|
||||
PBEnvironment::Puddle, PBEnvironment::Underwater
|
||||
when :MovingWater, :StillWater, :Puddle, :Underwater
|
||||
@newType = :WATER
|
||||
when PBEnvironment::Cave
|
||||
when :Cave
|
||||
@newType = :ROCK
|
||||
when PBEnvironment::Rock, PBEnvironment::Sand
|
||||
when :Rock, :Sand
|
||||
@newType = :GROUND
|
||||
when PBEnvironment::Forest, PBEnvironment::ForestGrass
|
||||
when :Forest, :ForestGrass
|
||||
@newType = :BUG
|
||||
when PBEnvironment::Snow, PBEnvironment::Ice
|
||||
when :Snow, :Ice
|
||||
@newType = :ICE
|
||||
when PBEnvironment::Volcano
|
||||
when :Volcano
|
||||
@newType = :FIRE
|
||||
when PBEnvironment::Graveyard
|
||||
when :Graveyard
|
||||
@newType = :GHOST
|
||||
when PBEnvironment::Sky
|
||||
when :Sky
|
||||
@newType = :FLYING
|
||||
when PBEnvironment::Space
|
||||
when :Space
|
||||
@newType = :DRAGON
|
||||
when PBEnvironment::UltraSpace
|
||||
when :UltraSpace
|
||||
@newType = :PSYCHIC
|
||||
end
|
||||
end
|
||||
@@ -2539,7 +2537,7 @@ class PokeBattle_Move_076 < PokeBattle_Move
|
||||
|
||||
def pbModifyDamage(damageMult,user,target)
|
||||
damageMult *= 2 if target.inTwoTurnAttack?("0CA") # Dig
|
||||
damageMult /= 2 if @battle.field.terrain==PBBattleTerrains::Grassy
|
||||
damageMult /= 2 if @battle.field.terrain == :Grassy
|
||||
return damageMult
|
||||
end
|
||||
end
|
||||
|
||||
@@ -419,7 +419,7 @@ class PokeBattle_Move_095 < PokeBattle_Move
|
||||
|
||||
def pbModifyDamage(damageMult,user,target)
|
||||
damageMult *= 2 if target.inTwoTurnAttack?("0CA") # Dig
|
||||
damageMult /= 2 if @battle.field.terrain==PBBattleTerrains::Grassy
|
||||
damageMult /= 2 if @battle.field.terrain == :Grassy
|
||||
return damageMult
|
||||
end
|
||||
end
|
||||
@@ -870,39 +870,37 @@ class PokeBattle_Move_0A4 < PokeBattle_Move
|
||||
# NOTE: This is Gen 7's list plus some of Gen 6 plus a bit of my own.
|
||||
@secretPower = 0 # Body Slam, paralysis
|
||||
case @battle.field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
when :Electric
|
||||
@secretPower = 1 # Thunder Shock, paralysis
|
||||
when PBBattleTerrains::Grassy
|
||||
when :Grassy
|
||||
@secretPower = 2 # Vine Whip, sleep
|
||||
when PBBattleTerrains::Misty
|
||||
when :Misty
|
||||
@secretPower = 3 # Fairy Wind, lower Sp. Atk by 1
|
||||
when PBBattleTerrains::Psychic
|
||||
when :Psychic
|
||||
@secretPower = 4 # Confusion, lower Speed by 1
|
||||
else
|
||||
case @battle.environment
|
||||
when PBEnvironment::Grass, PBEnvironment::TallGrass,
|
||||
PBEnvironment::Forest, PBEnvironment::ForestGrass
|
||||
when :Grass, :TallGrass, :Forest, :ForestGrass
|
||||
@secretPower = 2 # (Same as Grassy Terrain)
|
||||
when PBEnvironment::MovingWater, PBEnvironment::StillWater,
|
||||
PBEnvironment::Underwater
|
||||
when :MovingWater, :StillWater, :Underwater
|
||||
@secretPower = 5 # Water Pulse, lower Attack by 1
|
||||
when PBEnvironment::Puddle
|
||||
when :Puddle
|
||||
@secretPower = 6 # Mud Shot, lower Speed by 1
|
||||
when PBEnvironment::Cave
|
||||
when :Cave
|
||||
@secretPower = 7 # Rock Throw, flinch
|
||||
when PBEnvironment::Rock, PBEnvironment::Sand
|
||||
when :Rock, :Sand
|
||||
@secretPower = 8 # Mud-Slap, lower Acc by 1
|
||||
when PBEnvironment::Snow, PBEnvironment::Ice
|
||||
when :Snow, :Ice
|
||||
@secretPower = 9 # Ice Shard, freeze
|
||||
when PBEnvironment::Volcano
|
||||
when :Volcano
|
||||
@secretPower = 10 # Incinerate, burn
|
||||
when PBEnvironment::Graveyard
|
||||
when :Graveyard
|
||||
@secretPower = 11 # Shadow Sneak, flinch
|
||||
when PBEnvironment::Sky
|
||||
when :Sky
|
||||
@secretPower = 12 # Gust, lower Speed by 1
|
||||
when PBEnvironment::Space
|
||||
when :Space
|
||||
@secretPower = 13 # Swift, flinch
|
||||
when PBEnvironment::UltraSpace
|
||||
when :UltraSpace
|
||||
@secretPower = 14 # Psywave, lower Defense by 1
|
||||
end
|
||||
end
|
||||
@@ -1313,62 +1311,61 @@ class PokeBattle_Move_0B3 < PokeBattle_Move
|
||||
# Attack in it?
|
||||
@npMove = :TRIATTACK
|
||||
case @battle.field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
when :Electric
|
||||
@npMove = :THUNDERBOLT if GameData::Move.exists?(:THUNDERBOLT)
|
||||
when PBBattleTerrains::Grassy
|
||||
when :Grassy
|
||||
@npMove = :ENERGYBALL if GameData::Move.exists?(:ENERGYBALL)
|
||||
when PBBattleTerrains::Misty
|
||||
when :Misty
|
||||
@npMove = :MOONBLAST if GameData::Move.exists?(:MOONBLAST)
|
||||
when PBBattleTerrains::Psychic
|
||||
when :Psychic
|
||||
@npMove = :PSYCHIC if GameData::Move.exists?(:PSYCHIC)
|
||||
else
|
||||
case @battle.environment
|
||||
when PBEnvironment::Grass, PBEnvironment::TallGrass,
|
||||
PBEnvironment::Forest, PBEnvironment::ForestGrass
|
||||
when :Grass, :TallGrass, :Forest, :ForestGrass
|
||||
if Settings::MECHANICS_GENERATION >= 6
|
||||
@npMove = :ENERGYBALL if GameData::Move.exists?(:ENERGYBALL)
|
||||
else
|
||||
@npMove = :SEEDBOMB if GameData::Move.exists?(:SEEDBOMB)
|
||||
end
|
||||
when PBEnvironment::MovingWater, PBEnvironment::StillWater, PBEnvironment::Underwater
|
||||
when :MovingWater, :StillWater, :Underwater
|
||||
@npMove = :HYDROPUMP if GameData::Move.exists?(:HYDROPUMP)
|
||||
when PBEnvironment::Puddle
|
||||
when :Puddle
|
||||
@npMove = :MUDBOMB if GameData::Move.exists?(:MUDBOMB)
|
||||
when PBEnvironment::Cave
|
||||
when :Cave
|
||||
if Settings::MECHANICS_GENERATION >= 6
|
||||
@npMove = :POWERGEM if GameData::Move.exists?(:POWERGEM)
|
||||
else
|
||||
@npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE)
|
||||
end
|
||||
when PBEnvironment::Rock
|
||||
when :Rock
|
||||
if Settings::MECHANICS_GENERATION >= 6
|
||||
@npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER)
|
||||
else
|
||||
@npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE)
|
||||
end
|
||||
when PBEnvironment::Sand
|
||||
when :Sand
|
||||
if Settings::MECHANICS_GENERATION >= 6
|
||||
@npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER)
|
||||
else
|
||||
@npMove = :EARTHQUAKE if GameData::Move.exists?(:EARTHQUAKE)
|
||||
end
|
||||
when PBEnvironment::Snow
|
||||
when :Snow
|
||||
if Settings::MECHANICS_GENERATION >= 6
|
||||
@npMove = :FROSTBREATH if GameData::Move.exists?(:FROSTBREATH)
|
||||
else
|
||||
@npMove = :BLIZZARD if GameData::Move.exists?(:BLIZZARD)
|
||||
end
|
||||
when PBEnvironment::Ice
|
||||
when :Ice
|
||||
@npMove = :ICEBEAM if GameData::Move.exists?(:ICEBEAM)
|
||||
when PBEnvironment::Volcano
|
||||
when :Volcano
|
||||
@npMove = :LAVAPLUME if GameData::Move.exists?(:LAVAPLUME)
|
||||
when PBEnvironment::Graveyard
|
||||
when :Graveyard
|
||||
@npMove = :SHADOWBALL if GameData::Move.exists?(:SHADOWBALL)
|
||||
when PBEnvironment::Sky
|
||||
when :Sky
|
||||
@npMove = :AIRSLASH if GameData::Move.exists?(:AIRSLASH)
|
||||
when PBEnvironment::Space
|
||||
when :Space
|
||||
@npMove = :DRACOMETEOR if GameData::Move.exists?(:DRACOMETEOR)
|
||||
when PBEnvironment::UltraSpace
|
||||
when :UltraSpace
|
||||
@npMove = :PSYSHOCK if GameData::Move.exists?(:PSYSHOCK)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1774,7 +1774,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_154 < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if @battle.field.terrain==PBBattleTerrains::Electric
|
||||
if @battle.field.terrain == :Electric
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -1782,7 +1782,7 @@ class PokeBattle_Move_154 < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
@battle.pbStartTerrain(user,PBBattleTerrains::Electric)
|
||||
@battle.pbStartTerrain(user, :Electric)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1795,7 +1795,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_155 < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if @battle.field.terrain==PBBattleTerrains::Grassy
|
||||
if @battle.field.terrain == :Grassy
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -1803,7 +1803,7 @@ class PokeBattle_Move_155 < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
@battle.pbStartTerrain(user,PBBattleTerrains::Grassy)
|
||||
@battle.pbStartTerrain(user, :Grassy)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1816,7 +1816,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_156 < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if @battle.field.terrain==PBBattleTerrains::Misty
|
||||
if @battle.field.terrain == :Misty
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -1824,7 +1824,7 @@ class PokeBattle_Move_156 < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
@battle.pbStartTerrain(user,PBBattleTerrains::Misty)
|
||||
@battle.pbStartTerrain(user, :Misty)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2409,7 +2409,7 @@ class PokeBattle_Move_16E < PokeBattle_Move
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
hpGain = (target.totalhp/2.0).round
|
||||
hpGain = (target.totalhp*2/3.0).round if @battle.field.terrain==PBBattleTerrains::Grassy
|
||||
hpGain = (target.totalhp*2/3.0).round if @battle.field.terrain == :Grassy
|
||||
target.pbRecoverHP(hpGain)
|
||||
@battle.pbDisplay(_INTL("{1}'s HP was restored.",target.pbThis))
|
||||
end
|
||||
@@ -2556,7 +2556,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_173 < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if @battle.field.terrain==PBBattleTerrains::Psychic
|
||||
if @battle.field.terrain == :Psychic
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -2564,7 +2564,7 @@ class PokeBattle_Move_173 < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
@battle.pbStartTerrain(user,PBBattleTerrains::Psychic)
|
||||
@battle.pbStartTerrain(user, :Psychic)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ class PokeBattle_Battle
|
||||
@backdrop = ""
|
||||
@backdropBase = nil
|
||||
@time = 0
|
||||
@environment = PBEnvironment::None # e.g. Tall grass, cave, still water
|
||||
@environment = :None # e.g. Tall grass, cave, still water
|
||||
@turnCount = 0
|
||||
@decision = 0
|
||||
@caughtPokemon = []
|
||||
@@ -716,16 +716,17 @@ class PokeBattle_Battle
|
||||
newTerrain,duration,user,self)
|
||||
end
|
||||
@field.terrainDuration = duration
|
||||
pbCommonAnimation(PBBattleTerrains.animationName(@field.terrain))
|
||||
terrain_data = GameData::BattleTerrain.try_get(@field.terrain)
|
||||
pbCommonAnimation(terrain_data.animation) if terrain_data
|
||||
pbHideAbilitySplash(user) if user
|
||||
case @field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
when :Electric
|
||||
pbDisplay(_INTL("An electric current runs across the battlefield!"))
|
||||
when PBBattleTerrains::Grassy
|
||||
when :Grassy
|
||||
pbDisplay(_INTL("Grass grew to cover the battlefield!"))
|
||||
when PBBattleTerrains::Misty
|
||||
when :Misty
|
||||
pbDisplay(_INTL("Mist swirled about the battlefield!"))
|
||||
when PBBattleTerrains::Psychic
|
||||
when :Psychic
|
||||
pbDisplay(_INTL("The battlefield got weird!"))
|
||||
end
|
||||
# Check for terrain seeds that boost stats in a terrain
|
||||
|
||||
@@ -283,15 +283,16 @@ class PokeBattle_Battle
|
||||
when PBWeather::ShadowSky then pbDisplay(_INTL("The sky is shadowy."))
|
||||
end
|
||||
# Terrain announcement
|
||||
pbCommonAnimation(PBBattleTerrains.animationName(@field.terrain))
|
||||
terrain_data = GameData::BattleTerrain.try_get(@field.terrain)
|
||||
pbCommonAnimation(terrain_data.animation) if terrain_data
|
||||
case @field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
when :Electric
|
||||
pbDisplay(_INTL("An electric current runs across the battlefield!"))
|
||||
when PBBattleTerrains::Grassy
|
||||
when :Grassy
|
||||
pbDisplay(_INTL("Grass is covering the battlefield!"))
|
||||
when PBBattleTerrains::Misty
|
||||
when :Misty
|
||||
pbDisplay(_INTL("Mist swirls about the battlefield!"))
|
||||
when PBBattleTerrains::Psychic
|
||||
when :Psychic
|
||||
pbDisplay(_INTL("The battlefield is weird!"))
|
||||
end
|
||||
# Abilities upon entering battle
|
||||
|
||||
@@ -113,29 +113,30 @@ class PokeBattle_Battle
|
||||
# Count down terrain duration
|
||||
@field.terrainDuration -= 1 if @field.terrainDuration>0
|
||||
# Terrain wears off
|
||||
if @field.terrain!=PBBattleTerrains::None && @field.terrainDuration==0
|
||||
if @field.terrain != :None && @field.terrainDuration == 0
|
||||
case @field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
when :Electric
|
||||
pbDisplay(_INTL("The electric current disappeared from the battlefield!"))
|
||||
when PBBattleTerrains::Grassy
|
||||
when :Grassy
|
||||
pbDisplay(_INTL("The grass disappeared from the battlefield!"))
|
||||
when PBBattleTerrains::Misty
|
||||
when :Misty
|
||||
pbDisplay(_INTL("The mist disappeared from the battlefield!"))
|
||||
when PBBattleTerrains::Psychic
|
||||
when :Psychic
|
||||
pbDisplay(_INTL("The weirdness disappeared from the battlefield!"))
|
||||
end
|
||||
@field.terrain = PBBattleTerrains::None
|
||||
@field.terrain = :None
|
||||
# Start up the default terrain
|
||||
pbStartTerrain(nil,@field.defaultTerrain,false) if @field.defaultTerrain!=PBBattleTerrains::None
|
||||
return if @field.terrain==PBBattleTerrains::None
|
||||
pbStartTerrain(nil, @field.defaultTerrain, false) if @field.defaultTerrain != :None
|
||||
return if @field.terrain == :None
|
||||
end
|
||||
# Terrain continues
|
||||
pbCommonAnimation(PBBattleTerrains.animationName(@field.terrain))
|
||||
terrain_data = GameData::BattleTerrain.try_get(@field.terrain)
|
||||
pbCommonAnimation(terrain_data.animation) if terrain_data
|
||||
case @field.terrain
|
||||
when PBBattleTerrains::Electric then pbDisplay(_INTL("An electric current is running across the battlefield."))
|
||||
when PBBattleTerrains::Grassy then pbDisplay(_INTL("Grass is covering the battlefield."))
|
||||
when PBBattleTerrains::Misty then pbDisplay(_INTL("Mist is swirling about the battlefield."))
|
||||
when PBBattleTerrains::Psychic then pbDisplay(_INTL("The battlefield is weird."))
|
||||
when :Electric then pbDisplay(_INTL("An electric current is running across the battlefield."))
|
||||
when :Grassy then pbDisplay(_INTL("Grass is covering the battlefield."))
|
||||
when :Misty then pbDisplay(_INTL("Mist is swirling about the battlefield."))
|
||||
when :Psychic then pbDisplay(_INTL("The battlefield is weird."))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -282,7 +283,7 @@ class PokeBattle_Battle
|
||||
priority.each do |b|
|
||||
next if b.fainted?
|
||||
# Grassy Terrain (healing)
|
||||
if @field.terrain==PBBattleTerrains::Grassy && b.affectedByTerrain? && b.canHeal?
|
||||
if @field.terrain == :Grassy && b.affectedByTerrain? && b.canHeal?
|
||||
PBDebug.log("[Lingering effect] Grassy Terrain heals #{b.pbThis(true)}")
|
||||
b.pbRecoverHP(b.totalhp/16)
|
||||
pbDisplay(_INTL("{1}'s HP was restored.",b.pbThis))
|
||||
|
||||
@@ -2982,7 +2982,7 @@ class PokeBattle_AI
|
||||
score += 50
|
||||
score -= user.hp*100/user.totalhp
|
||||
if skill>=PBTrainerAI.mediumSkill
|
||||
score += 30 if @battle.field.terrain==PBBattleTerrains::Grassy
|
||||
score += 30 if @battle.field.terrain == :Grassy
|
||||
end
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
@@ -122,7 +122,7 @@ class PokeBattle_AI
|
||||
!move.ignoresSubstitute?(user) && user.index!=target.index
|
||||
return true if Settings::MECHANICS_GENERATION >= 7 && user.hasActiveAbility?(:PRANKSTER) &&
|
||||
target.pbHasType?(:DARK) && target.opposes?(user)
|
||||
return true if move.priority>0 && @battle.field.terrain==PBBattleTerrains::Psychic &&
|
||||
return true if move.priority>0 && @battle.field.terrain == :Psychic &&
|
||||
target.affectedByTerrain? && target.opposes?(user)
|
||||
end
|
||||
return false
|
||||
@@ -397,19 +397,16 @@ class PokeBattle_AI
|
||||
end
|
||||
end
|
||||
# Terrain moves
|
||||
if user.affectedByTerrain? && skill>=PBTrainerAI.mediumSkill
|
||||
if skill>=PBTrainerAI.mediumSkill
|
||||
case @battle.field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :ELECTRIC
|
||||
when PBBattleTerrains::Grassy
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :GRASS
|
||||
when PBBattleTerrains::Psychic
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :PSYCHIC
|
||||
end
|
||||
end
|
||||
if target.affectedByTerrain? && skill>=PBTrainerAI.mediumSkill
|
||||
if @battle.field.terrain==PBBattleTerrains::Misty && type == :DRAGON
|
||||
multipliers[:base_damage_multiplier] /= 2
|
||||
when :Electric
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :ELECTRIC && user.affectedByTerrain?
|
||||
when :Grassy
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :GRASS && user.affectedByTerrain?
|
||||
when :Psychic
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :PSYCHIC && user.affectedByTerrain?
|
||||
when :Misty
|
||||
multipliers[:base_damage_multiplier] /= 2 if type == :DRAGON && target.affectedByTerrain?
|
||||
end
|
||||
end
|
||||
# Badge multipliers
|
||||
|
||||
@@ -321,7 +321,7 @@ class PokeBattle_SafariZone
|
||||
@backdrop = ""
|
||||
@backdropBase = nil
|
||||
@time = 0
|
||||
@environment = PBEnvironment::None # e.g. Tall grass, cave, still water
|
||||
@environment = :None # e.g. Tall grass, cave, still water
|
||||
@weather = PBWeather::None
|
||||
@decision = 0
|
||||
@caughtPokemon = []
|
||||
|
||||
@@ -37,7 +37,7 @@ BattleHandlers::SpeedCalcAbility.add(:SLUSHRUSH,
|
||||
|
||||
BattleHandlers::SpeedCalcAbility.add(:SURGESURFER,
|
||||
proc { |ability,battler,mult|
|
||||
next mult*2 if battler.battle.field.terrain==PBBattleTerrains::Electric
|
||||
next mult*2 if battler.battle.field.terrain == :Electric
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1183,7 +1183,7 @@ BattleHandlers::DamageCalcTargetAbility.add(:FURCOAT,
|
||||
|
||||
BattleHandlers::DamageCalcTargetAbility.add(:GRASSPELT,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.battle.field.terrain == PBBattleTerrains::Grassy
|
||||
if user.battle.field.terrain == :Grassy
|
||||
mults[:defense_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
@@ -2173,9 +2173,9 @@ BattleHandlers::AbilityOnSwitchIn.add(:DROUGHT,
|
||||
|
||||
BattleHandlers::AbilityOnSwitchIn.add(:ELECTRICSURGE,
|
||||
proc { |ability,battler,battle|
|
||||
next if battle.field.terrain==PBBattleTerrains::Electric
|
||||
next if battle.field.terrain == :Electric
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbStartTerrain(battler,PBBattleTerrains::Electric)
|
||||
battle.pbStartTerrain(battler, :Electric)
|
||||
# NOTE: The ability splash is hidden again in def pbStartTerrain.
|
||||
}
|
||||
)
|
||||
@@ -2253,9 +2253,9 @@ BattleHandlers::AbilityOnSwitchIn.add(:FRISK,
|
||||
|
||||
BattleHandlers::AbilityOnSwitchIn.add(:GRASSYSURGE,
|
||||
proc { |ability,battler,battle|
|
||||
next if battle.field.terrain==PBBattleTerrains::Grassy
|
||||
next if battle.field.terrain == :Grassy
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbStartTerrain(battler,PBBattleTerrains::Grassy)
|
||||
battle.pbStartTerrain(battler, :Grassy)
|
||||
# NOTE: The ability splash is hidden again in def pbStartTerrain.
|
||||
}
|
||||
)
|
||||
@@ -2292,9 +2292,9 @@ BattleHandlers::AbilityOnSwitchIn.add(:INTIMIDATE,
|
||||
|
||||
BattleHandlers::AbilityOnSwitchIn.add(:MISTYSURGE,
|
||||
proc { |ability,battler,battle|
|
||||
next if battle.field.terrain==PBBattleTerrains::Misty
|
||||
next if battle.field.terrain == :Misty
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbStartTerrain(battler,PBBattleTerrains::Misty)
|
||||
battle.pbStartTerrain(battler, :Misty)
|
||||
# NOTE: The ability splash is hidden again in def pbStartTerrain.
|
||||
}
|
||||
)
|
||||
@@ -2323,9 +2323,9 @@ BattleHandlers::AbilityOnSwitchIn.add(:PRIMORDIALSEA,
|
||||
|
||||
BattleHandlers::AbilityOnSwitchIn.add(:PSYCHICSURGE,
|
||||
proc { |ability,battler,battle|
|
||||
next if battle.field.terrain==PBBattleTerrains::Psychic
|
||||
next if battle.field.terrain == :Psychic
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbStartTerrain(battler,PBBattleTerrains::Psychic)
|
||||
battle.pbStartTerrain(battler, :Psychic)
|
||||
# NOTE: The ability splash is hidden again in def pbStartTerrain.
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1432,7 +1432,7 @@ BattleHandlers::TerrainExtenderItem.add(:TERRAINEXTENDER,
|
||||
|
||||
BattleHandlers::TerrainStatBoostItem.add(:ELECTRICSEED,
|
||||
proc { |item,battler,battle|
|
||||
next false if battle.field.terrain!=PBBattleTerrains::Electric
|
||||
next false if battle.field.terrain != :Electric
|
||||
next false if !battler.pbCanRaiseStatStage?(PBStats::DEFENSE,battler)
|
||||
itemName = GameData::Item.get(item).name
|
||||
battle.pbCommonAnimation("UseItem",battler)
|
||||
@@ -1442,7 +1442,7 @@ BattleHandlers::TerrainStatBoostItem.add(:ELECTRICSEED,
|
||||
|
||||
BattleHandlers::TerrainStatBoostItem.add(:GRASSYSEED,
|
||||
proc { |item,battler,battle|
|
||||
next false if battle.field.terrain!=PBBattleTerrains::Grassy
|
||||
next false if battle.field.terrain != :Grassy
|
||||
next false if !battler.pbCanRaiseStatStage?(PBStats::DEFENSE,battler)
|
||||
itemName = GameData::Item.get(item).name
|
||||
battle.pbCommonAnimation("UseItem",battler)
|
||||
@@ -1452,7 +1452,7 @@ BattleHandlers::TerrainStatBoostItem.add(:GRASSYSEED,
|
||||
|
||||
BattleHandlers::TerrainStatBoostItem.add(:MISTYSEED,
|
||||
proc { |item,battler,battle|
|
||||
next false if battle.field.terrain!=PBBattleTerrains::Misty
|
||||
next false if battle.field.terrain != :Misty
|
||||
next false if !battler.pbCanRaiseStatStage?(PBStats::SPDEF,battler)
|
||||
itemName = GameData::Item.get(item).name
|
||||
battle.pbCommonAnimation("UseItem",battler)
|
||||
@@ -1462,7 +1462,7 @@ BattleHandlers::TerrainStatBoostItem.add(:MISTYSEED,
|
||||
|
||||
BattleHandlers::TerrainStatBoostItem.add(:PSYCHICSEED,
|
||||
proc { |item,battler,battle|
|
||||
next false if battle.field.terrain!=PBBattleTerrains::Psychic
|
||||
next false if battle.field.terrain != :Psychic
|
||||
next false if !battler.pbCanRaiseStatStage?(PBStats::SPDEF,battler)
|
||||
itemName = GameData::Item.get(item).name
|
||||
battle.pbCommonAnimation("UseItem",battler)
|
||||
|
||||
@@ -107,7 +107,7 @@ BallHandlers::ModifyCatchRate.add(:NETBALL,proc { |ball,catchRate,battle,battler
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:DIVEBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
catchRate *= 3.5 if battle.environment==PBEnvironment::Underwater
|
||||
catchRate *= 3.5 if battle.environment == :Underwater
|
||||
next catchRate
|
||||
})
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ begin
|
||||
@defaultWeather = PBWeather::None
|
||||
@weather = PBWeather::None
|
||||
@weatherDuration = 0
|
||||
@defaultTerrain = PBBattleTerrains::None
|
||||
@terrain = PBBattleTerrains::None
|
||||
@defaultTerrain = :None
|
||||
@terrain = :None
|
||||
@terrainDuration = 0
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user