Weather affects more than just Pokemon's stats. There's Weather Ball and (I think) Nature Power that change based on the weather. Weather Ball merely changes types, though, so that one's not much of an issue.
1.) In PBWeather, where all the other weathers are defined, add the following code:
Code:
METEORSHOWER = 9
FOG = 10
I made the numbers 9 and 10 because I didn't know if you have the Gen VI Pack, and having black numbers here isn't a problem.
2.) In PokeBattle_Battler (with the R), if you want to have abilities that trigger these weathers, add the following lines of code below line 1107 (which depending if you have the Gen VI pack should read either "if onactive" or "if !(@battle.isPrimordialWeather?)":
Code:
if self.hasWorkingAbility(:FOGGYAURA) && battle.weather!=PBWeather::FOG && @battle.weatherduration!=-1
@battle.weather=PBWeather::FOG
if self.hasWorkingItem(:SMOKEBOMB)
@battle.weatherduration=8
else
@battle.weatherduration=5
end
@battle.pbDisplayEffect(self,false)
@battle.pbCommonAnimation("Fog",nil,nil)
@battle.pbHideEffect(self)
if EFFECTMESSAGES
@battle.pbDisplay(_INTL("A dense fog creeped up!"))
else
@battle.pbDisplay(_INTL("{1}'s Foggy Aura made it foggy!",pbThis))
end
PBDebug.log("[#{pbThis}: Foggy Aura made it foggy]")
end
if self.hasWorkingAbility(:ASTEROIDMAGNET) && battle.weather!=PBWeather::METEORSHOWER && @battle.weatherduration!=-1
@battle.weather=PBWeather::METEORSHOWER
if self.hasWorkingItem(:METEOR)
@battle.weatherduration=8
else
@battle.weatherduration=5
end
@battle.pbDisplayEffect(self,false)
@battle.pbCommonAnimation("Meteor",nil,nil)
@battle.pbHideEffect(self)
if EFFECTMESSAGES
@battle.pbDisplay(_INTL("It started to rain meteors!"))
else
@battle.pbDisplay(_INTL("{1}'s Asteroid Magnet made it rain meteors!",pbThis))
end
PBDebug.log("[#{pbThis}: Asteroid Magnet made it rain meteors]")
end
3.) in PokeBattle_Move, around line 817 with all the other accuracy modifiers, add the following code:
Code:
if @battle.pbWeather==PBWeather::FOG && !attacker.hasType?(:GHOST)
accuracy/=1.2 # <- change the 1.2 to something else if you want the accuracy to decrease by a different factor.
end
4.) In PokeBattle_MoveEffects, around line 3614 where all of Weather Ball's types are defined, add the following code:
Code:
type=(getConst(PBTypes,:DARK) || type) if weather==PBWeather::METEORSHOWER
type=(getConst(PBTypes,:GHOST) || type) if weather==PBWeather::FOG
5.) If you want there to be the possibility for overworld fog/meteor showers that carry over into battle, add the following code in PokeBattle_Battle (without the R) around line 2960:
Code:
elsif @weather==PBWeather::METEORSHOWER
pbCommonAnimation("Meteor",nil,nil)
pbDisplay(_INTL("It is raining meteors."))
elsif @weather==PBWeather::Fog
pbCommonAnimation("Fog",nil,nil)
pbDisplay(_INTL("The fog is thick."))
6.) In PokeBattle_Battle, around line 3422 where all the end-of-turn weather effects happen, add the following code:
Code:
when PBWeather::METEOR
@weatherduration=@weatherduration-1 if @weatherduration>0
if @weatherduration==0
pbDisplay(_INTL("The meteor shower stopped."))
@weather=0
PBDebug.log("[Meteor shower weather ended]")
else
pbCommonAnimation("Meteor",nil,nil)
# pbDisplay(_INTL("Meteor shower continues to fall."))
if pbWeather==PBWeather::METEORSHOWER
PBDebug.log("[Meteor shower weather inflicted damage]")
for i in priority
next if i.isFainted?
if !i.pbHasType?(:DARK) &&
!i.hasWorkingAbility(:ASTEROIDMAGNET) &&
![0xCA,0xCB].include?(PBMoveData.new(i.effects[PBEffects::TwoTurnAttack]).function) # Dig, Dive
@scene.pbDamageAnimation(i,0)
i.pbReduceHP((i.totalhp/16).floor)
pbDisplay(_INTL("{1} is buffeted by the the meteor shower!",i.pbThis))
if i.isFainted?
return if !i.pbFaint
end
end
end
end
end
when PBWeather::FOG
@weatherduration=@weatherduration-1 if @weatherduration>0
if @weatherduration==0
pbDisplay(_INTL("The fog lifted."))
@weather=0
PBDebug.log("[Fog weather ended]")
else
pbCommonAnimation("Fog",nil,nil)
# pbDisplay(_INTL("The fog will not let up!."));
end