Diegou18
Forever Chandelure lover.
- 75
- Posts
- 7
- Years
- Seen Aug 16, 2021
Time ago I asked about this, and after many tries (with a few of free time in many days xd) I made it. I want to say that this is my first script, so it could be shorter or may have an error that I didn't saw before (the last thing would be rare, since I tested it in every case that it affects, obviously, based on Gen 8 mechanics, and on Gen 7 ones in the case of Primordial Sea, Desolate Land and Delta Stream, but I won't say that it doesn't have any error, because as I said, it's my first script).
Hope it'll be useful to someone. If I have time, I'll try coding the other weather: the Thunder Storm, that mixes rain with Electric Terrain effects. But it's another thing. Here I go (by the way, I use v17.2).
Description: With this, you'll add the new weather of Gen 8. Foggy weather sets Misty Terrain's effects during all the battle, except if you change the terrain with another one (by a move like Electric Terrain, or an ability like Psychic Surge, if we follow the logic that we can analize here). When the effect of a modified terrain disappears, Misty Terrain's effect comes back.
It doesn't depend of the "real weather" in battle (with "real weather" I mean sun, rain, hail and the weathers of Groudon, Kyogre and Rayquaza, if we follow the last logic here too).
So, you can have Misty Terrain with rain, hail, sun and any original Pokémon Game's weather, but you can't have 2 Terrains at the same time. That's why I separate them as "terrain weather" and "real weather".
Installation:
1) In PBEffects, search "# These effects apply to the battle (i.e. both sides)" and add new effects:
Note: Replace them with the last numbers that you haven't used. In my case, they're 16 and 17.
2) Then, go to PBWeather, and create a new one:
Note: Same as before, use the last number that you haven't used (mine is 9) EXCEPT the 8. It's Shadow Sky, so don't use it.
3) In PokeBattle_ActiveSideField, add at the end of the second list of effects the new ones:
Note: You may or not have some effects that I have. Focus in your last one.
4) Go to PokeBattle_Battler, and look for "# Weather" and add the red lines:
-After that, in the same script section, search "# Electric Surge" and add the red lines:
5) Then, the next script section is PokeBattle_BattlerEffects. Add the red lines in every status change, even Confusion (if you don't have it, add the blue lines too, since it works in that way since Gen 7):
6) Now, it's time to go to PokeBattle_MoveEffects, and add the red lines in the next move codes:
Note: I've added and deleted some effects in Defog. I did it because my game is based on Gen 6, 7 and 8 mechanics. If you have their scripts, you can copy them too, but if you don't, only copy and past the red lines.
7) The next one is PokeBattle_Battle. This part will be a little bit... LAAAAAAAAARGE xd. (Here is where I think that the code could be shorter. If anyone knows a way to do that, please write it. Thanks in advance).
8) Go to the PField_Weather script:
9) Go to PField_Battles and in "def pbPrepareBattle(battle)" add the red lines:
10) In Pokemon_Evolution add this new weather in the "LevelRain" case:
Note: The number of the weather must be the same that you used in PField_Weather.
And done! You only need to write "Weather:Foggy,100" (or whatever probability you like) in metadata.txt in the map that you want (or set it with the Debug Mode in game).
NOTE: A thing that I didn't do, because I've not figured it out yet, it's how to show fog in the overworld when a map has this weather. Anyways, a fast and different way to do it, is creating an Event that sets fog's graphics. I use the one posted here: https://www.pokecommunity.com/threads/428411
Of course, credits to Richard PT for posting it and to zerokid, since Richard PT says that in his post.
(I didn't created another script than the one posted here related with the title. Credits to everyone that have made other script that appears in this installation guide).
Hope it'll be useful to someone. If I have time, I'll try coding the other weather: the Thunder Storm, that mixes rain with Electric Terrain effects. But it's another thing. Here I go (by the way, I use v17.2).
Description: With this, you'll add the new weather of Gen 8. Foggy weather sets Misty Terrain's effects during all the battle, except if you change the terrain with another one (by a move like Electric Terrain, or an ability like Psychic Surge, if we follow the logic that we can analize here). When the effect of a modified terrain disappears, Misty Terrain's effect comes back.
It doesn't depend of the "real weather" in battle (with "real weather" I mean sun, rain, hail and the weathers of Groudon, Kyogre and Rayquaza, if we follow the last logic here too).
So, you can have Misty Terrain with rain, hail, sun and any original Pokémon Game's weather, but you can't have 2 Terrains at the same time. That's why I separate them as "terrain weather" and "real weather".
Installation:
1) In PBEffects, search "# These effects apply to the battle (i.e. both sides)" and add new effects:
Code:
PlasmaFists = 15
Foggy = 16
Mist = 17
2) Then, go to PBWeather, and create a new one:
Code:
STRONGWINDS = 7
FOGGY = 9
# Shadow Sky is weather 8
end
3) In PokeBattle_ActiveSideField, add at the end of the second list of effects the new ones:
Spoiler:
Code:
@effects[PBEffects::PsychicTerrain] = 0
@effects[PBEffects::NeutralizingGas] = false
@effects[PBEffects::Foggy] = 0
@effects[PBEffects::Mist] = false
end
end
rescue Exception
4) Go to PokeBattle_Battler, and look for "# Weather" and add the red lines:
Spoiler:
Code:
# Weather
if onactive
if self.hasWorkingAbility(:PRIMORDIALSEA) && @battle.weather!=PBWeather::HEAVYRAIN
@battle.weather=PBWeather::HEAVYRAIN
@battle.weatherduration=-1
@battle.pbCommonAnimation("HeavyRain",nil,nil)
@battle.pbDisplay(_INTL("{1}'s {2} made a heavy rain begin to fall!",pbThis,PBAbilities.getName(self.ability)))
[COLOR="Red"]if @battle.field.effects[PBEffects::Foggy]==1
@battle.field.effects[PBEffects::Foggy]=1
end[/COLOR]
PBDebug.log("[Ability triggered] #{pbThis}'s Primordial Sea made it rain heavily")
end
if self.hasWorkingAbility(:DESOLATELAND) && @battle.weather!=PBWeather::HARSHSUN
@battle.weather=PBWeather::HARSHSUN
@battle.weatherduration=-1
@battle.pbCommonAnimation("HarshSun",nil,nil)
@battle.pbDisplay(_INTL("{1}'s {2} turned the sunlight extremely harsh!",pbThis,PBAbilities.getName(self.ability)))
[COLOR="Red"]if @battle.field.effects[PBEffects::Foggy]==1
@battle.field.effects[PBEffects::Foggy]=1
end[/COLOR]
PBDebug.log("[Ability triggered] #{pbThis}'s Desolate Land made the sun shine harshly")
end
if self.hasWorkingAbility(:DELTASTREAM) && @battle.weather!=PBWeather::STRONGWINDS
@battle.weather=PBWeather::STRONGWINDS
@battle.weatherduration=-1
@battle.pbCommonAnimation("StrongWinds",nil,nil)
@battle.pbDisplay(_INTL("{1}'s {2} caused a mysterious air current that protects Flying-type Pokémon!",pbThis,PBAbilities.getName(self.ability)))
[COLOR="Red"]if @battle.field.effects[PBEffects::Foggy]==1
@battle.field.effects[PBEffects::Foggy]=1
end[/COLOR]
PBDebug.log("[Ability triggered] #{pbThis}'s Delta Stream made an air current blow")
end
# Neutralizing Gas
if self.hasWorkingAbility(:NEUTRALIZINGGAS) && [email protected][PBEffects::NeutralizingGas] # Not hasWorkingAbility (We need to be workable even if other abilities supressed)
@battle.field.effects[PBEffects::NeutralizingGas]=true
@battle.pbDisplay(_INTL("¡Un gas reactivo se propaga por toda la zona!"))
PBDebug.log("[Ability triggered] #{pbThis}'s Neutralizing Gas started")
end
if @battle.weather!=PBWeather::HEAVYRAIN &&
@battle.weather!=PBWeather::HARSHSUN &&
@battle.weather!=PBWeather::STRONGWINDS
if self.hasWorkingAbility(:DRIZZLE) && (@battle.weather!=PBWeather::RAINDANCE || @battle.weatherduration!=-1)
@battle.weather=PBWeather::RAINDANCE
if USENEWBATTLEMECHANICS
@battle.weatherduration=5
@battle.weatherduration=8 if hasWorkingItem(:DAMPROCK)
else
@battle.weatherduration=-1
end
@battle.pbCommonAnimation("Rain",nil,nil)
@battle.pbDisplay(_INTL("{1}'s {2} made it rain!",pbThis,PBAbilities.getName(self.ability)))
[COLOR="Red"]if @battle.field.effects[PBEffects::Foggy]==1
@battle.field.effects[PBEffects::Foggy]==1
end[/COLOR]
PBDebug.log("[Ability triggered] #{pbThis}'s Drizzle made it rain")
end
if self.hasWorkingAbility(:DROUGHT) && (@battle.weather!=PBWeather::SUNNYDAY || @battle.weatherduration!=-1)
@battle.weather=PBWeather::SUNNYDAY
if USENEWBATTLEMECHANICS
@battle.weatherduration=5
@battle.weatherduration=8 if hasWorkingItem(:HEATROCK)
else
@battle.weatherduration=-1
end
@battle.pbCommonAnimation("Sunny",nil,nil)
@battle.pbDisplay(_INTL("{1}'s {2} intensified the sun's rays!",pbThis,PBAbilities.getName(self.ability)))
[COLOR="Red"]if @battle.field.effects[PBEffects::Foggy]==1
@battle.field.effects[PBEffects::Foggy]==1
end[/COLOR]
PBDebug.log("[Ability triggered] #{pbThis}'s Drought made it sunny")
end
if self.hasWorkingAbility(:SANDSTREAM) && (@battle.weather!=PBWeather::SANDSTORM || @battle.weatherduration!=-1)
@battle.weather=PBWeather::SANDSTORM
if USENEWBATTLEMECHANICS
@battle.weatherduration=5
@battle.weatherduration=8 if hasWorkingItem(:SMOOTHROCK)
else
@battle.weatherduration=-1
end
@battle.pbCommonAnimation("Sandstorm",nil,nil)
@battle.pbDisplay(_INTL("{1}'s {2} whipped up a sandstorm!",pbThis,PBAbilities.getName(self.ability)))
[COLOR="Red"]if @battle.field.effects[PBEffects::Foggy]==1
@battle.field.effects[PBEffects::Foggy]==1
end[/COLOR]
PBDebug.log("[Ability triggered] #{pbThis}'s Sand Stream made it sandstorm")
end
if self.hasWorkingAbility(:SNOWWARNING) && (@battle.weather!=PBWeather::HAIL || @battle.weatherduration!=-1)
@battle.weather=PBWeather::HAIL
if USENEWBATTLEMECHANICS
@battle.weatherduration=5
@battle.weatherduration=8 if hasWorkingItem(:ICYROCK)
else
@battle.weatherduration=-1
end
@battle.pbCommonAnimation("Hail",nil,nil)
@battle.pbDisplay(_INTL("{1}'s {2} made it hail!",pbThis,PBAbilities.getName(self.ability)))
[COLOR="Red"]if @battle.field.effects[PBEffects::Foggy]==1
@battle.field.effects[PBEffects::Foggy]==1
end[/COLOR]
PBDebug.log("[Ability triggered] #{pbThis}'s Snow Warning made it hail")
end
end
if self.hasWorkingAbility(:AIRLOCK) ||
-After that, in the same script section, search "# Electric Surge" and add the red lines:
Spoiler:
Code:
# Electric Surge
if self.hasWorkingAbility(:ELECTRICSURGE) && onactive
if @battle.field.effects[PBEffects::ElectricTerrain]<1
@battle.pbCommonAnimation("ELECTRICTERRAIN",self,nil)
@battle.field.effects[PBEffects::MistyTerrain]=0
@battle.field.effects[PBEffects::GrassyTerrain]=0
@battle.field.effects[PBEffects::PsychicTerrain]=0
[COLOR="Red"]@battle.field.effects[PBEffects::Foggy]=0[/COLOR]
@battle.field.effects[PBEffects::ElectricTerrain]=5
@battle.pbDisplay(_INTL("¡El campo de batalla ha sido electrizado!"))
if self.hasWorkingItem(:ELECTRICSEED)
if pbIncreaseStatWithCause(PBStats::DEFENSE,1,self,PBItems.getName(item))
end
end
if self.hasWorkingItem(:TERRAINEXTENDER)
@battle.field.effects[PBEffects::ElectricTerrain]=8
end
end
end
# Misty Surge
if self.hasWorkingAbility(:MISTYSURGE) && onactive
if @battle.field.effects[PBEffects::MistyTerrain]<1 [COLOR="Red"]&& [email protected][PBEffects::Foggy]==1[/COLOR]
@battle.pbCommonAnimation("MISTYTERRAIN",self,nil)
@battle.field.effects[PBEffects::ElectricTerrain]=0
@battle.field.effects[PBEffects::GrassyTerrain]=0
@battle.field.effects[PBEffects::PsychicTerrain]=0
@battle.field.effects[PBEffects::MistyTerrain]=5
@battle.pbDisplay(_INTL("¡Una niebla misteriosa envuelve el campo de batalla!"))
if self.hasWorkingItem(:MISTYSEED)
if pbIncreaseStatWithCause(PBStats::SPDEF,1,self,PBItems.getName(item))
end
end
if self.hasWorkingItem(:TERRAINEXTENDER)
@battle.field.effects[PBEffects::MistyTerrain]=8
end
end
end
# Grassy Surge
if self.hasWorkingAbility(:GRASSYSURGE) && onactive
if @battle.field.effects[PBEffects::GrassyTerrain]<1
@battle.pbCommonAnimation("GRASSYTERRAIN",self,nil)
@battle.field.effects[PBEffects::ElectricTerrain]=0
@battle.field.effects[PBEffects::MistyTerrain]=0
@battle.field.effects[PBEffects::PsychicTerrain]=0
[COLOR="Red"]@battle.field.effects[PBEffects::Foggy]=0[/COLOR]
@battle.field.effects[PBEffects::GrassyTerrain]=5
@battle.pbDisplay(_INTL("¡El campo de batalla se ha llenado de hierba!"))
if self.hasWorkingItem(:GRASSYSEED)
if pbIncreaseStatWithCause(PBStats::DEFENSE,1,self,PBItems.getName(item))
end
end
if self.hasWorkingItem(:TERRAINEXTENDER)
@battle.field.effects[PBEffects::GrassyTerrain]=8
end
end
end
# Psychic Surge
if self.hasWorkingAbility(:PSYCHICSURGE) && onactive
if @battle.field.effects[PBEffects::PsychicTerrain]<1
@battle.pbCommonAnimation("PSYCHICTERRAIN",self,nil)
@battle.field.effects[PBEffects::ElectricTerrain]=0
@battle.field.effects[PBEffects::MistyTerrain]=0
@battle.field.effects[PBEffects::GrassyTerrain]=0
[COLOR="Red"]@battle.field.effects[PBEffects::Foggy]=0[/COLOR]
@battle.field.effects[PBEffects::PsychicTerrain]=5
@battle.pbDisplay(_INTL("¡Extrañas sensaciones se perciben en el campo de batalla!"))
if self.hasWorkingItem(:PSYCHICSEED)
if pbIncreaseStatWithCause(PBStats::SPDEF,1,self,PBItems.getName(item))
end
end
if self.hasWorkingItem(:TERRAINEXTENDER)
@battle.field.effects[PBEffects::PsychicTerrain]=8
end
end
end
# Power of Alchemist & Receiver
5) Then, the next script section is PokeBattle_BattlerEffects. Add the red lines in every status change, even Confusion (if you don't have it, add the blue lines too, since it works in that way since Gen 7):
Spoiler:
-Sleep
-Poison
-Burn
-Paralyze
-Freeze
-Confuse
Code:
if !self.isAirborne?(attacker && attacker.hasMoldBreaker)
if @battle.field.effects[PBEffects::ElectricTerrain]>0
@battle.pbDisplay(_INTL("The Electric Terrain prevented {1} from falling asleep!",pbThis(true))) if showMessages
return false
elsif @battle.field.effects[PBEffects::MistyTerrain]>0 [COLOR="Red"]|| @battle.field.effects[PBEffects::Foggy]==1[/COLOR]
@battle.pbDisplay(_INTL("The Misty Terrain prevented {1} from falling asleep!",pbThis(true))) if showMessages
return false
end
end
Code:
if !self.isAirborne?
return false if @battle.field.effects[PBEffects::ElectricTerrain]>0
return false if @battle.field.effects[PBEffects::MistyTerrain]>0
[COLOR="Red"]return false if @battle.field.effects[PBEffects::Foggy]==1[/COLOR]
end
Code:
if @battle.field.effects[PBEffects::MistyTerrain]>0 [COLOR="Red"]|| @battle.field.effects[PBEffects::Foggy]==1[/COLOR] &&
!self.isAirborne?(attacker && attacker.hasMoldBreaker)
@battle.pbDisplay(_INTL("The Misty Terrain prevented {1} from being poisoned!",pbThis(true))) if showMessages
return false
end
Code:
if @battle.field.effects[PBEffects::MistyTerrain]>0 [COLOR="Red"]|| @battle.field.effects[PBEffects::Foggy]==1[/COLOR] &&
!self.isAirborne?(attacker && attacker.hasMoldBreaker)
@battle.pbDisplay(_INTL("The Misty Terrain prevented {1} from being burned!",pbThis(true))) if showMessages
return false
end
Code:
if @battle.field.effects[PBEffects::MistyTerrain]>0 [COLOR="Red"]|| @battle.field.effects[PBEffects::Foggy]==1[/COLOR] &&
!self.isAirborne?(attacker && attacker.hasMoldBreaker)
@battle.pbDisplay(_INTL("The Misty Terrain prevented {1} from being paralyzed!",pbThis(true))) if showMessages
return false
end
Code:
if @battle.field.effects[PBEffects::MistyTerrain]>0 [COLOR="Red"]|| @battle.field.effects[PBEffects::Foggy]==1[/COLOR] &&
!self.isAirborne?(attacker && attacker.hasMoldBreaker)
@battle.pbDisplay(_INTL("The Misty Terrain prevented {1} from being frozen!",pbThis(true))) if showMessages
return false
end
Code:
[COLOR="Blue"] if @battle.field.effects[PBEffects::MistyTerrain]>0[/COLOR] [COLOR="Red"]|| @battle.field.effects[PBEffects::Foggy]==1[/COLOR] [COLOR="Blue"]&&
!self.isAirborne?(attacker && attacker.hasMoldBreaker)
@battle.pbDisplay(_INTL("The Misty Terrain prevented {1} from being confused!",pbThis(true))) if showMessages
return false
end[/COLOR]
6) Now, it's time to go to PokeBattle_MoveEffects, and add the red lines in the next move codes:
Spoiler:
-In Sunny Day:
-In Rain Dance:
-In Sandstorm:
-In Hail:
-In Electric Terrain:
-In Grassy Terrain:
-In Misty Terrain:
-In Psychic Terrain:
-In Defog:
Code:
@battle.weatherduration=8 if attacker.hasWorkingItem(:HEATROCK)
@battle.pbCommonAnimation("Sunny",nil,nil)
@battle.pbDisplay(_INTL("¡El sol está brillando!"))
[COLOR="Red"]if @battle.field.effects[PBEffects::Foggy]==1
@battle.field.effects[PBEffects::Foggy]=1
end[/COLOR]
return 0
Code:
@battle.weatherduration=8 if attacker.hasWorkingItem(:DAMPROCK)
@battle.pbCommonAnimation("Rain",nil,nil)
@battle.pbDisplay(_INTL("¡Ha empezado a llover!"))
[COLOR="Red"]if @battle.field.effects[PBEffects::Foggy]==1
@battle.field.effects[PBEffects::Foggy]=1
end[/COLOR]
return 0
Code:
@battle.weatherduration=8 if attacker.hasWorkingItem(:SMOOTHROCK)
@battle.pbCommonAnimation("Sandstorm",nil,nil)
@battle.pbDisplay(_INTL("¡Se acerca una tormenta de arena!"))
[COLOR="Red"]if @battle.field.effects[PBEffects::Foggy]==1
@battle.field.effects[PBEffects::Foggy]=1
end[/COLOR]
return 0
Code:
@battle.weatherduration=8 if attacker.hasWorkingItem(:ICYROCK)
@battle.pbCommonAnimation("Hail",nil,nil)
@battle.pbDisplay(_INTL("¡Ha empezado a granizar!"))
[COLOR="Red"]if @battle.field.effects[PBEffects::Foggy]==1
@battle.field.effects[PBEffects::Foggy]=1
end[/COLOR]
return 0
Code:
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
@battle.field.effects[PBEffects::GrassyTerrain]=0
@battle.field.effects[PBEffects::MistyTerrain]=0
@battle.field.effects[PBEffects::PsychicTerrain]=0
[COLOR="Red"]@battle.field.effects[PBEffects::Foggy]=0[/COLOR]
if attacker.hasWorkingItem(:TERRAINEXTENDER)
Code:
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
@battle.field.effects[PBEffects::ElectricTerrain]=0
@battle.field.effects[PBEffects::MistyTerrain]=0
@battle.field.effects[PBEffects::PsychicTerrain]=0
[COLOR="Red"]@battle.field.effects[PBEffects::Foggy]=0[/COLOR]
if attacker.hasWorkingItem(:TERRAINEXTENDER)
Code:
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if @battle.field.effects[PBEffects::MistyTerrain]>0 [COLOR="Red"]|| @battle.field.effects[PBEffects::Foggy]==1[/COLOR]
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
Code:
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
@battle.field.effects[PBEffects::ElectricTerrain]=0
@battle.field.effects[PBEffects::MistyTerrain]=0
@battle.field.effects[PBEffects::GrassyTerrain]=0
[COLOR="Red"]@battle.field.effects[PBEffects::Foggy]=0[/COLOR]
if attacker.hasWorkingItem(:TERRAINEXTENDER)
Code:
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.pbReduceStat(PBStats::EVASION,1,attacker,false,self)
opponent.pbOwnSide.effects[PBEffects::Reflect] = 0
opponent.pbOwnSide.effects[PBEffects::LightScreen] = 0
opponent.pbOwnSide.effects[PBEffects::Mist] = 0
opponent.pbOwnSide.effects[PBEffects::Safeguard] = 0
opponent.pbOwnSide.effects[PBEffects::Spikes] = 0
opponent.pbOwnSide.effects[PBEffects::StealthRock] = false
opponent.pbOwnSide.effects[PBEffects::StickyWeb] = false
opponent.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0
opponent.pbOwnSide.effects[PBEffects::AuroraVeil] = 0
@battle.field.effects[PBEffects::ElectricTerrain] = 0
@battle.field.effects[PBEffects::GrassyTerrain] = 0
@battle.field.effects[PBEffects::MistyTerrain] = 0
@battle.field.effects[PBEffects::PsychicTerrain] = 0
[COLOR="Red"]@battle.field.effects[PBEffects::Foggy] = 0
@battle.field.effects[PBEffects::Mist] = false[/COLOR]
if USENEWBATTLEMECHANICS
opponent.pbOpposingSide.effects[PBEffects::Spikes] = 0
opponent.pbOpposingSide.effects[PBEffects::StealthRock] = false
opponent.pbOpposingSide.effects[PBEffects::StickyWeb] = false
opponent.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0
end
return 0
end
def pbAdditionalEffect(attacker,opponent)
if !opponent.damagestate.substitute
if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
opponent.pbReduceStat(PBStats::EVASION,1,attacker,false,self)
end
end
opponent.pbOwnSide.effects[PBEffects::Reflect] = 0
opponent.pbOwnSide.effects[PBEffects::LightScreen] = 0
opponent.pbOwnSide.effects[PBEffects::Mist] = 0
opponent.pbOwnSide.effects[PBEffects::Safeguard] = 0
opponent.pbOwnSide.effects[PBEffects::Spikes] = 0
opponent.pbOwnSide.effects[PBEffects::StealthRock] = false
opponent.pbOwnSide.effects[PBEffects::StickyWeb] = false
opponent.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0
opponent.pbOwnSide.effects[PBEffects::AuroraVeil] = 0
@battle.field.effects[PBEffects::ElectricTerrain] = 0
@battle.field.effects[PBEffects::GrassyTerrain] = 0
@battle.field.effects[PBEffects::MistyTerrain] = 0
@battle.field.effects[PBEffects::PsychicTerrain] = 0
[COLOR="Red"]@battle.field.effects[PBEffects::Foggy] = 0
@battle.field.effects[PBEffects::Mist] = false[/COLOR]
if USENEWBATTLEMECHANICS
opponent.pbOpposingSide.effects[PBEffects::Spikes] = 0
opponent.pbOpposingSide.effects[PBEffects::StealthRock] = false
opponent.pbOpposingSide.effects[PBEffects::StickyWeb] = false
opponent.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0
end
end
7) The next one is PokeBattle_Battle. This part will be a little bit... LAAAAAAAAARGE xd. (Here is where I think that the code could be shorter. If anyone knows a way to do that, please write it. Thanks in advance).
Spoiler:
-Search "# Initialize battle" and add the red lines there:
Note: Notice that I have the text in spanish and the common animation's name of MY game, so change the language and/or the name of the animation according yours.
-Now the largest part. Search "# Weather" in this script section and add every red line you see:
-Finally, find "# Electric Terrain" in the same script section and add the red lines:
Spoiler:
Code:
if @weather==PBWeather::SUNNYDAY
pbCommonAnimation("Sunny",nil,nil)
pbDisplay(_INTL("Hace mucho sol..."))
elsif @weather==PBWeather::RAINDANCE
pbCommonAnimation("Rain",nil,nil)
pbDisplay(_INTL("Está lloviendo..."))
elsif @weather==PBWeather::SANDSTORM
pbCommonAnimation("Sandstorm",nil,nil)
pbDisplay(_INTL("Se está desatando una tormenta de arena..."))
elsif @weather==PBWeather::HAIL
pbCommonAnimation("Hail",nil,nil)
pbDisplay(_INTL("Está granizando..."))
[COLOR="Red"]elsif @weather==PBWeather::FOGGY
pbCommonAnimation("MistyTerrain",nil,nil)
@field.effects[PBEffects::Foggy]=1
pbDisplay(_INTL("¡¡Una misteriosa niebla cubre el campo de batalla!!"))[/COLOR]
elsif @weather==PBWeather::HEAVYRAIN
pbCommonAnimation("HeavyRain",nil,nil)
pbDisplay(_INTL("¡Ha empezado a diluviar!"))
elsif @weather==PBWeather::HARSHSUN
pbCommonAnimation("HarshSun",nil,nil)
pbDisplay(_INTL("¡El sol que hace ahora es realmente abrasador!"))
elsif @weather==PBWeather::STRONGWINDS
pbCommonAnimation("StrongWinds",nil,nil)
pbDisplay(_INTL("¡Unas misteriosas turbulencias protegen a los Pokémon de tipo Volador!"))
end
-Now the largest part. Search "# Weather" in this script section and add every red line you see:
Spoiler:
Code:
# Weather
case @weather
when PBWeather::SUNNYDAY
@weatherduration=@weatherduration-1 if @weatherduration>0
[COLOR="Red"]if @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
end[/COLOR]
if @weatherduration==0
pbDisplay(_INTL("The sunlight faded."))
@weather=0
PBDebug.log("[End of effect] Sunlight weather ended")
else
pbCommonAnimation("Sunny",nil,nil)
[COLOR="Red"]if @field.effects[PBEffects::Mist]==true
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end[/COLOR]
# pbDisplay(_INTL("The sunlight is strong."))
if pbWeather==PBWeather::SUNNYDAY
for i in priority
if i.hasWorkingAbility(:SOLARPOWER)
PBDebug.log("[Ability triggered] #{i.pbThis}'s Solar Power")
@scene.pbDamageAnimation(i,0)
i.pbReduceHP((i.totalhp/8).floor)
pbDisplay(_INTL("{1} was hurt by the sunlight!",i.pbThis))
if i.fainted?
return if !i.pbFaint
end
end
end
end
end
when PBWeather::RAINDANCE
@weatherduration=@weatherduration-1 if @weatherduration>0
[COLOR="Red"]if @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
end[/COLOR]
if @weatherduration==0
pbDisplay(_INTL("The rain stopped."))
@weather=0
PBDebug.log("[End of effect] Rain weather ended")
else
pbCommonAnimation("Rain",nil,nil)
[COLOR="Red"]if @field.effects[PBEffects::Mist]==true
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end[/COLOR]
# pbDisplay(_INTL("Rain continues to fall."))
end
when PBWeather::SANDSTORM
@weatherduration=@weatherduration-1 if @weatherduration>0
[COLOR="Red"]if @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
end[/COLOR]
if @weatherduration==0
pbDisplay(_INTL("The sandstorm subsided."))
@weather=0
PBDebug.log("[End of effect] Sandstorm weather ended")
else
pbCommonAnimation("Sandstorm",nil,nil)
[COLOR="Red"]if @field.effects[PBEffects::Mist]==true
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end[/COLOR]
# pbDisplay(_INTL("The sandstorm rages."))
if pbWeather==PBWeather::SANDSTORM
PBDebug.log("[Lingering effect triggered] Sandstorm weather damage")
for i in priority
next if i.fainted?
if !i.pbHasType?(:GROUND) && !i.pbHasType?(:ROCK) && !i.pbHasType?(:STEEL) &&
!i.hasWorkingAbility(:SANDVEIL) &&
!i.hasWorkingAbility(:SANDRUSH) &&
!i.hasWorkingAbility(:SANDFORCE) &&
!i.hasWorkingAbility(:MAGICGUARD) &&
!i.hasWorkingAbility(:OVERCOAT) &&
!i.hasWorkingItem(:SAFETYGOGGLES) &&
![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 sandstorm!",i.pbThis))
if i.fainted?
return if !i.pbFaint
end
end
end
end
end
when PBWeather::HAIL
@weatherduration=@weatherduration-1 if @weatherduration>0
[COLOR="Red"]if @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
end[/COLOR]
if @weatherduration==0
pbDisplay(_INTL("The hail stopped."))
@weather=0
PBDebug.log("[End of effect] Hail weather ended")
else
pbCommonAnimation("Hail",nil,nil)
[COLOR="Red"]if @field.effects[PBEffects::Mist]==true
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end[/COLOR]
# pbDisplay(_INTL("Hail continues to fall."))
if pbWeather==PBWeather::HAIL
PBDebug.log("[Lingering effect triggered] Hail weather damage")
for i in priority
next if i.fainted?
if !i.pbHasType?(:ICE) &&
!i.hasWorkingAbility(:ICEBODY) &&
!i.hasWorkingAbility(:SNOWCLOAK) &&
!i.hasWorkingAbility(:MAGICGUARD) &&
!i.hasWorkingAbility(:OVERCOAT) &&
!i.hasWorkingAbility(:SLUSHRUSH) &&
!i.hasWorkingItem(:SAFETYGOGGLES) &&
![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 hail!",i.pbThis))
if i.fainted?
return if !i.pbFaint
end
end
end
end
end
[COLOR="Red"]when PBWeather::FOGGY
if @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
end[/COLOR]
when PBWeather::HEAVYRAIN
hasabil=false
for i in 0...4
if isConst?(@battlers[i].ability,PBAbilities,:PRIMORDIALSEA) && !@battlers[i].fainted?
hasabil=true; break
end
end
[COLOR="Red"]if @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
end[/COLOR]
@weatherduration=0 if !hasabil
if @weatherduration==0
pbDisplay(_INTL("The heavy rain stopped."))
@weather=0
PBDebug.log("[End of effect] Primordial Sea's rain weather ended")
else
pbCommonAnimation("HeavyRain",nil,nil)
[COLOR="Red"]if @field.effects[PBEffects::Mist]==true
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end[/COLOR]
# pbDisplay(_INTL("It is raining heavily."))
end
when PBWeather::HARSHSUN
hasabil=false
for i in 0...4
if isConst?(@battlers[i].ability,PBAbilities,:DESOLATELAND) && !@battlers[i].fainted?
hasabil=true; break
end
end
[COLOR="Red"]if @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
end[/COLOR]
@weatherduration=0 if !hasabil
if @weatherduration==0
pbDisplay(_INTL("The harsh sunlight faded."))
@weather=0
PBDebug.log("[End of effect] Desolate Land's sunlight weather ended")
else
pbCommonAnimation("HarshSun",nil,nil)
[COLOR="Red"]if @field.effects[PBEffects::Mist]==true
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end[/COLOR]
# pbDisplay(_INTL("The sunlight is extremely harsh."))
if pbWeather==PBWeather::HARSHSUN
for i in priority
if i.hasWorkingAbility(:SOLARPOWER)
PBDebug.log("[Ability triggered] #{i.pbThis}'s Solar Power")
@scene.pbDamageAnimation(i,0)
i.pbReduceHP((i.totalhp/8).floor)
pbDisplay(_INTL("{1} was hurt by the sunlight!",i.pbThis))
if i.fainted?
return if !i.pbFaint
end
end
end
end
end
when PBWeather::STRONGWINDS
hasabil=false
for i in 0...4
if isConst?(@battlers[i].ability,PBAbilities,:DELTASTREAM) && !@battlers[i].fainted?
hasabil=true; break
end
end
[COLOR="Red"]if @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::Foggy]==1 && @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
end[/COLOR]
@weatherduration=0 if !hasabil
if @weatherduration==0
pbDisplay(_INTL("The air current subsided."))
@weather=0
PBDebug.log("[End of effect] Delta Stream's wind weather ended")
else
pbCommonAnimation("StrongWinds",nil,nil)
[COLOR="Red"]if @field.effects[PBEffects::Mist]==true
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end[/COLOR]
# pbDisplay(_INTL("The wind is strong."))
end
end
[COLOR="Red"]if @weather==0 #None
if @field.effects[PBEffects::Mist]==true #Foggy
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end
end
if @weather==1 #Sunny
if @field.effects[PBEffects::Mist]==true #Foggy
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end
end
if @weather==2 #Rain
if @field.effects[PBEffects::Mist]==true #Foggy
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end
end
if @weather==3 #Sandstorm
if @field.effects[PBEffects::Mist]==true #Foggy
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end
end
if @weather==4 #Hail
if @field.effects[PBEffects::Mist]==true #Foggy
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end
end
if @weather==5 #Harsh Sun
if @field.effects[PBEffects::Mist]==true #Foggy
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end
end
if @weather==6 #Heavy Rain
if @field.effects[PBEffects::Mist]==true #Foggy
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end
end
if @weather==7 #Strong Winds
if @field.effects[PBEffects::Mist]==true #Foggy
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::Foggy]=0
elsif @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::Foggy]=0
end
end
end[/COLOR]
# Shadow Sky weather
-Finally, find "# Electric Terrain" in the same script section and add the red lines:
Spoiler:
Code:
# Electric Terrain
if @field.effects[PBEffects::ElectricTerrain]>0
@field.effects[PBEffects::ElectricTerrain]-=1
if @field.effects[PBEffects::ElectricTerrain]==0
pbDisplay(_INTL("Las corrientes eléctricas han desaparecido."))
PBDebug.log("[End of effect] Electric Terrain ended")
[COLOR="Red"]if @field.effects[PBEffects::Mist]==true
@field.effects[PBEffects::Foggy]=1
pbDisplay(_INTL("¡Una niebla misteriosa envuelve el campo de batalla!"))
end[/COLOR]
end
end
# Grassy Terrain (counting down)
if @field.effects[PBEffects::GrassyTerrain]>0
@field.effects[PBEffects::GrassyTerrain]-=1
if @field.effects[PBEffects::GrassyTerrain]==0
pbDisplay(_INTL("La hierba se ha ido."))
PBDebug.log("[End of effect] Grassy Terrain ended")
[COLOR="Red"]if @field.effects[PBEffects::Mist]==true
@field.effects[PBEffects::Foggy]=1
pbDisplay(_INTL("¡Una niebla misteriosa envuelve el campo de batalla!"))
end[/COLOR]
end
end
# Misty Terrain
if @field.effects[PBEffects::MistyTerrain]>0
@field.effects[PBEffects::MistyTerrain]-=1
if @field.effects[PBEffects::MistyTerrain]==0
[COLOR="Red"]if @field.effects[PBEffects::Mist]==true
@field.effects[PBEffects::Foggy]=1
else
pbDisplay(_INTL("La niebla ha desaparecido."))
PBDebug.log("[End of effect] Misty Terrain ended")
end[/COLOR]
end
end
# Psychic Terrain
if @field.effects[PBEffects::PsychicTerrain]>0
@field.effects[PBEffects::PsychicTerrain]-=1
if @field.effects[PBEffects::PsychicTerrain]==0
pbDisplay(_INTL("Las extrañas sensaciones se han ido."))
PBDebug.log("[End of effect] Psychic Terrain ended")
[COLOR="Red"]if @field.effects[PBEffects::Mist]==true
@field.effects[PBEffects::Foggy]=1
pbDisplay(_INTL("¡Una niebla misteriosa envuelve el campo de batalla!"))
end[/COLOR]
end
end
8) Go to the PField_Weather script:
Spoiler:
-Add a new PBFieldWeather:
Note: Use the last number that you haven't used and write it in the blue one too.
-Add the red lines in this place:
-Add the red lines you see again:
-Finally, add the red line:
Code:
HeavyRain = 6
Sun = Sunny = 7
Foggy = 8
def PBFieldWeather.maxValue; [COLOR="Blue"]8[/COLOR]; end
end
-Add the red lines in this place:
Code:
@weatherTypes[PBFieldWeather::Sandstorm] = [[],-12,4,-2]
@weatherTypes[PBFieldWeather::Sun] = nil
[COLOR="Red"]@weatherTypes[PBFieldWeather::Foggy] = nil[/COLOR]
@sprites = []
end
def ensureSprites
return if @sprites.length>=40
-Add the red lines you see again:
Spoiler:
Code:
if @type==PBFieldWeather::None
for sprite in @sprites
sprite.dispose
end
@sprites.clear
return
end
[COLOR="Red"]if @type==PBFieldWeather::Foggy
for sprite in @sprites
sprite.dispose
end
@sprites.clear
return
end[/COLOR]
weatherbitmaps = (@type==PBFieldWeather::None || @type==PBFieldWeather::Sun [COLOR="Red"]|| @type==PBFieldWeather::Foggy[/COLOR]) ? nil : @weatherTypes[@type][0]
ensureSprites
for i in 1..40
sprite = @sprites[i]
if sprite!=nil
if @type==PBFieldWeather::Blizzard || @type==PBFieldWeather::Sandstorm
sprite.mirror = (rand(2)==0)
else
sprite.mirror = false
end
sprite.visible = (i<=@max)
sprite.bitmap = (@type==PBFieldWeather::None || @type==PBFieldWeather::Sun [COLOR="Red"]|| @type==PBFieldWeather::Foggy[/COLOR]) ? nil : weatherbitmaps[i%weatherbitmaps.length]
end
end
end
Code:
@viewport.update
return if @type==PBFieldWeather::None || @type==PBFieldWeather::Sun [COLOR="Red"]|| @type==PBFieldWeather::Foggy[/COLOR]
ensureSprites
for i in 1..@max
sprite = @sprites[i]
break if sprite==nil
sprite.x += @weatherTypes[@type][1]
9) Go to PField_Battles and in "def pbPrepareBattle(battle)" add the red lines:
Spoiler:
Code:
def pbPrepareBattle(battle)
case $game_screen.weather_type
when PBFieldWeather::Rain, PBFieldWeather::HeavyRain, PBFieldWeather::Storm
battle.weather = PBWeather::RAINDANCE
battle.weatherduration = -1
when PBFieldWeather::Snow, PBFieldWeather::Blizzard
battle.weather = PBWeather::HAIL
battle.weatherduration = -1
when PBFieldWeather::Sandstorm
battle.weather = PBWeather::SANDSTORM
battle.weatherduration = -1
when PBFieldWeather::Sun
battle.weather = PBWeather::SUNNYDAY
battle.weatherduration = -1
[COLOR="Red"]when PBFieldWeather::Foggy
battle.weather = PBWeather::FOGGY
battle.weatherduration = -1
end[/COLOR]
battle.shiftStyle = ($PokemonSystem.battlestyle==0)
battle.battlescene = ($PokemonSystem.battlescene==0)
battle.environment = pbGetEnvironment
end
10) In Pokemon_Evolution add this new weather in the "LevelRain" case:
Spoiler:
Code:
when PBEvolution::Location
return poke if $game_map.map_id==level
when PBEvolution::LevelRain
return poke if pokemon.level>=level && $game_screen.weather_type==1
when PBEvolution::LevelRain
return poke if pokemon.level>=level && $game_screen.weather_type==2
when PBEvolution::LevelRain
return poke if pokemon.level>=level && $game_screen.weather_type==6
[COLOR="Red"]when PBEvolution::LevelRain
return poke if pokemon.level>=level && $game_screen.weather_type==8[/COLOR]
when PBEvolution::Beauty # Feebas
return poke if pokemon.beauty>=level
when PBEvolution::Trade, PBEvolution::TradeItem, PBEvolution::TradeSpecies
Note: The number of the weather must be the same that you used in PField_Weather.
And done! You only need to write "Weather:Foggy,100" (or whatever probability you like) in metadata.txt in the map that you want (or set it with the Debug Mode in game).
NOTE: A thing that I didn't do, because I've not figured it out yet, it's how to show fog in the overworld when a map has this weather. Anyways, a fast and different way to do it, is creating an Event that sets fog's graphics. I use the one posted here: https://www.pokecommunity.com/threads/428411
Of course, credits to Richard PT for posting it and to zerokid, since Richard PT says that in his post.
(I didn't created another script than the one posted here related with the title. Credits to everyone that have made other script that appears in this installation guide).
Last edited: