Added class GameData::BattleWeather

This commit is contained in:
Maruno17
2021-02-21 19:04:36 +00:00
parent 63e640c79b
commit 611d0a74eb
22 changed files with 229 additions and 208 deletions

View File

@@ -323,8 +323,7 @@ class PokeBattle_Battler
@battle.pbCommonAnimation("Powder",user)
@battle.pbDisplay(_INTL("When the flame touched the powder on the Pokémon, it exploded!"))
user.lastMoveFailed = true
w = @battle.pbWeather
if w!=PBWeather::Rain && w!=PBWeather::HeavyRain && user.takesIndirectDamage?
if ![:Rain, :HeavyRain].include?(@battle.pbWeather) && user.takesIndirectDamage?
oldHP = user.hp
user.pbReduceHP((user.totalhp/4.0).round,false)
user.pbFaint if user.fainted?
@@ -341,7 +340,7 @@ class PokeBattle_Battler
# Primordial Sea, Desolate Land
if move.damagingMove?
case @battle.pbWeather
when PBWeather::HeavyRain
when :HeavyRain
if move.calcType == :FIRE
@battle.pbDisplay(_INTL("The Fire-type attack fizzled out in the heavy rain!"))
user.lastMoveFailed = true
@@ -349,7 +348,7 @@ class PokeBattle_Battler
pbEndTurn(choice)
return
end
when PBWeather::HarshSun
when :HarshSun
if move.calcType == :WATER
@battle.pbDisplay(_INTL("The Water-type attack evaporated in the harsh sunlight!"))
user.lastMoveFailed = true