mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 22:24:58 +00:00
Added class GameData::BattleWeather
This commit is contained in:
@@ -46,7 +46,7 @@ class PokeBattle_Move
|
||||
PBTypes.ineffective?(moveType,defType)
|
||||
end
|
||||
# Delta Stream's weather
|
||||
if @battle.pbWeather==PBWeather::StrongWinds
|
||||
if @battle.pbWeather == :StrongWinds
|
||||
ret = PBTypeEffectiveness::NORMAL_EFFECTIVE_ONE if defType == :FLYING &&
|
||||
PBTypes.superEffective?(moveType,defType)
|
||||
end
|
||||
@@ -373,19 +373,19 @@ class PokeBattle_Move
|
||||
end
|
||||
# Weather
|
||||
case @battle.pbWeather
|
||||
when PBWeather::Sun, PBWeather::HarshSun
|
||||
when :Sun, :HarshSun
|
||||
if type == :FIRE
|
||||
multipliers[:final_damage_multiplier] *= 1.5
|
||||
elsif type == :WATER
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
when PBWeather::Rain, PBWeather::HeavyRain
|
||||
when :Rain, :HeavyRain
|
||||
if type == :FIRE
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
elsif type == :WATER
|
||||
multipliers[:final_damage_multiplier] *= 1.5
|
||||
end
|
||||
when PBWeather::Sandstorm
|
||||
when :Sandstorm
|
||||
if target.pbHasType?(:ROCK) && specialMove? && @function != "122" # Psyshock
|
||||
multipliers[:defense_multiplier] *= 1.5
|
||||
end
|
||||
|
||||
@@ -596,17 +596,18 @@ end
|
||||
class PokeBattle_WeatherMove < PokeBattle_Move
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@weatherType = PBWeather::None
|
||||
@weatherType = :None
|
||||
end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
case @battle.field.weather
|
||||
when PBWeather::HarshSun
|
||||
when :HarshSun
|
||||
@battle.pbDisplay(_INTL("The extremely harsh sunlight was not lessened at all!"))
|
||||
return true
|
||||
when PBWeather::HeavyRain
|
||||
when :HeavyRain
|
||||
@battle.pbDisplay(_INTL("There is no relief from this heavy rain!"))
|
||||
return true
|
||||
when PBWeather::StrongWinds
|
||||
when :StrongWinds
|
||||
@battle.pbDisplay(_INTL("The mysterious air current blows on regardless!"))
|
||||
return true
|
||||
when @weatherType
|
||||
|
||||
@@ -131,9 +131,9 @@ class PokeBattle_Move_008 < PokeBattle_ParalysisMove
|
||||
|
||||
def pbBaseAccuracy(user,target)
|
||||
case @battle.pbWeather
|
||||
when PBWeather::Sun, PBWeather::HarshSun
|
||||
when :Sun, :HarshSun
|
||||
return 50
|
||||
when PBWeather::Rain, PBWeather::HeavyRain
|
||||
when :Rain, :HeavyRain
|
||||
return 0
|
||||
end
|
||||
return super
|
||||
@@ -201,7 +201,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_00D < PokeBattle_FreezeMove
|
||||
def pbBaseAccuracy(user,target)
|
||||
return 0 if @battle.pbWeather==PBWeather::Hail
|
||||
return 0 if @battle.pbWeather == :Hail
|
||||
return super
|
||||
end
|
||||
end
|
||||
@@ -308,9 +308,9 @@ class PokeBattle_Move_015 < PokeBattle_ConfuseMove
|
||||
|
||||
def pbBaseAccuracy(user,target)
|
||||
case @battle.pbWeather
|
||||
when PBWeather::Sun, PBWeather::HarshSun
|
||||
when :Sun, :HarshSun
|
||||
return 50
|
||||
when PBWeather::Rain, PBWeather::HeavyRain
|
||||
when :Rain, :HeavyRain
|
||||
return 0
|
||||
end
|
||||
return super
|
||||
@@ -731,10 +731,7 @@ class PokeBattle_Move_028 < PokeBattle_MultiStatUpMove
|
||||
|
||||
def pbOnStartUse(user,targets)
|
||||
increment = 1
|
||||
if @battle.pbWeather==PBWeather::Sun ||
|
||||
@battle.pbWeather==PBWeather::HarshSun
|
||||
increment = 2
|
||||
end
|
||||
increment = 2 if [:Sun, :HarshSun].include?(@battle.pbWeather)
|
||||
@statUp[1] = @statUp[3] = increment
|
||||
end
|
||||
end
|
||||
|
||||
@@ -105,20 +105,20 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_087 < PokeBattle_Move
|
||||
def pbBaseDamage(baseDmg,user,target)
|
||||
baseDmg *= 2 if @battle.pbWeather!=PBWeather::None
|
||||
baseDmg *= 2 if @battle.pbWeather != :None
|
||||
return baseDmg
|
||||
end
|
||||
|
||||
def pbBaseType(user)
|
||||
ret = :NORMAL
|
||||
case @battle.pbWeather
|
||||
when PBWeather::Sun, PBWeather::HarshSun
|
||||
when :Sun, :HarshSun
|
||||
ret = :FIRE if GameData::Type.exists?(:FIRE)
|
||||
when PBWeather::Rain, PBWeather::HeavyRain
|
||||
when :Rain, :HeavyRain
|
||||
ret = :WATER if GameData::Type.exists?(:WATER)
|
||||
when PBWeather::Sandstorm
|
||||
when :Sandstorm
|
||||
ret = :ROCK if GameData::Type.exists?(:ROCK)
|
||||
when PBWeather::Hail
|
||||
when :Hail
|
||||
ret = :ICE if GameData::Type.exists?(:ICE)
|
||||
end
|
||||
return ret
|
||||
@@ -2035,8 +2035,7 @@ class PokeBattle_Move_0C4 < PokeBattle_TwoTurnMove
|
||||
def pbIsChargingTurn?(user)
|
||||
ret = super
|
||||
if !user.effects[PBEffects::TwoTurnAttack]
|
||||
w = @battle.pbWeather
|
||||
if w==PBWeather::Sun || w==PBWeather::HarshSun
|
||||
if [:Sun, :HarshSun].include?(@battle.pbWeather)
|
||||
@powerHerb = false
|
||||
@chargingTurn = true
|
||||
@damagingTurn = true
|
||||
@@ -2051,8 +2050,7 @@ class PokeBattle_Move_0C4 < PokeBattle_TwoTurnMove
|
||||
end
|
||||
|
||||
def pbBaseDamageMultiplier(damageMult,user,target)
|
||||
w = @battle.pbWeather
|
||||
damageMult /= 2 if w>0 && w!=PBWeather::Sun && w!=PBWeather::HarshSun
|
||||
damageMult /= 2 if ![:None, :Sun, :HarshSun].include?(@battle.pbWeather)
|
||||
return damageMult
|
||||
end
|
||||
end
|
||||
@@ -2533,9 +2531,9 @@ end
|
||||
class PokeBattle_Move_0D8 < PokeBattle_HealingMove
|
||||
def pbOnStartUse(user,targets)
|
||||
case @battle.pbWeather
|
||||
when PBWeather::Sun, PBWeather::HarshSun
|
||||
when :Sun, :HarshSun
|
||||
@healAmount = (user.totalhp*2/3.0).round
|
||||
when PBWeather::None, PBWeather::StrongWinds
|
||||
when :None, :StrongWinds
|
||||
@healAmount = (user.totalhp/2.0).round
|
||||
else
|
||||
@healAmount = (user.totalhp/4.0).round
|
||||
@@ -3717,6 +3715,6 @@ end
|
||||
class PokeBattle_Move_0FF < PokeBattle_WeatherMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@weatherType = PBWeather::Sun
|
||||
@weatherType = :Sun
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
class PokeBattle_Move_100 < PokeBattle_WeatherMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@weatherType = PBWeather::Rain
|
||||
@weatherType = :Rain
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ end
|
||||
class PokeBattle_Move_101 < PokeBattle_WeatherMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@weatherType = PBWeather::Sandstorm
|
||||
@weatherType = :Sandstorm
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,7 +28,7 @@ end
|
||||
class PokeBattle_Move_102 < PokeBattle_WeatherMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@weatherType = PBWeather::Hail
|
||||
@weatherType = :Hail
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2210,7 +2210,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_167 < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if @battle.pbWeather!=PBWeather::Hail
|
||||
if @battle.pbWeather != :Hail
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -2382,7 +2382,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_16D < PokeBattle_HealingMove
|
||||
def pbHealAmount(user)
|
||||
return (user.totalhp*2/3.0).round if @battle.pbWeather==PBWeather::Sandstorm
|
||||
return (user.totalhp*2/3.0).round if @battle.pbWeather == :Sandstorm
|
||||
return (user.totalhp/2.0).round
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user