PokeBattle_Battler (with the R), lines 1008-1019 are used to trigger Snow Warning. Adding in the red stuff will add the Snow Globe.
Code:
if [COLOR="red"]([/COLOR]self.hasWorkingAbility(:SNOWWARNING)[COLOR="Red"] || self.hasWorkingItem(:SNOWGLOBE))[/COLOR] && (@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)
[COLOR="red"]if self.hasWorkingAbility(:SNOWWARNING)[/COLOR]
@battle.pbDisplay(_INTL("{1}'s {2} made it hail!",pbThis,PBAbilities.getName(self.ability)))
PBDebug.log("[Ability triggered] #{pbThis}'s Snow Warning made it hail")[COLOR="red"]
else
@battle.pbDisplay(_INTL("{1}'s {2} made it hail!",pbThis,PBItems.getName(self.item)))
PBDebug.log("[Item triggered] #{pbThis}'s Snow Globe made it hail")
end[/COLOR]
end
Note that:
- if a Pokemon has both Snow Warning (ability) and a Snow Globe (item), the ability will trigger and the item will not.
- the Snow Globe does not make the holder immune to the damaging effects of hail.
- the Snow Globe would be treated like a permanent item, not a consumable like the berries, gems, or terrain seeds in the main series. If you want to make it consumable, add the line
before the two ends at the bottom of the code.