Overworld Weather moves

Overworld Weather moves

Pokémon Essentials Version
v18.1 ✅
rain.gif
You know what's cool? Overworld moves. So let's make some more!

This is a script that allows the player to use Sandstorm, Hail, Rain Dance, and Sunny Day to summon their respective weathers in the overworld.

Please note that, in order for this script to work right, all of your maps must have their weather defined. (That includes indoor maps, unfortunately. I know, it sucks.) Probability does not matter, so your map can still have an established weather, or you can set it to 0 to have no weather at all. If a map doesn't have its weather defined, the weather will be carried over to it.

Now for the scripts! Just paste this down at the bottom of PField_FieldMoves!

Ruby:
#===============================================================================
# Rain Dance
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:RAINDANCE,proc { |move,pkmn,showmsg|
  if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
    pbMessage(_INTL("Can't use that indoors.")) if showmsg
    next false
  end
  if $game_screen.weather_type==1 ||
     $game_screen.weather_type==2
    pbMessage(_INTL("It's already raining.")) if showmsg
   next false
end
  for i in 0...pkmn.moves.length
    move = pkmn.moves[i]
    if isConst?(pkmn.moves[i].id,PBMoves,:RAINDANCE)
        if pkmn.moves[i].pp<=1
          pbMessage(_INTL("Not enough PP...")) if showmsg
        end
      end
    end
  next true
})

HiddenMoveHandlers::UseMove.add(:RAINDANCE,proc { |move,pokemon|
  if !pbHiddenMoveAnimation(pokemon)
    pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
  end
  $game_screen.weather(PBFieldWeather::Rain,9.0,20)
  for i in 0...pokemon.moves.length
    move = pokemon.moves[i]
    if isConst?(pokemon.moves[i].id,PBMoves,:RAINDANCE)
        pokemon.moves[i].pp -= 1
      end
    end
    Graphics.update
    Input.update
    pbUpdateSceneMap
  next true
})

#===============================================================================
# Sandstorm
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:SANDSTORM,proc { |move,pkmn,showmsg|
  if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
    pbMessage(_INTL("Can't use that indoors.")) if showmsg
    next false
  end
  if $game_screen.weather_type==5
    pbMessage(_INTL("There is already a sandstorm.")) if showmsg
   next false
end
  for i in 0...pkmn.moves.length
    move = pkmn.moves[i]
    if isConst?(pkmn.moves[i].id,PBMoves,:SANDSTORM)
        if pkmn.moves[i].pp<=1
          pbMessage(_INTL("Not enough PP...")) if showmsg
        end
      end
    end
  next true
})

HiddenMoveHandlers::UseMove.add(:SANDSTORM,proc { |move,pokemon|
  if !pbHiddenMoveAnimation(pokemon)
    pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
  end
  $game_screen.weather(PBFieldWeather::Sandstorm,9.0,20)
  for i in 0...pokemon.moves.length
    move = pokemon.moves[i]
    if isConst?(pokemon.moves[i].id,PBMoves,:SANDSTORM)
        pokemon.moves[i].pp -= 1
      end
    end
    Graphics.update
    Input.update
    pbUpdateSceneMap
  next true
})

#===============================================================================
# Hail
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:HAIL,proc { |move,pkmn,showmsg|
  if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
    pbMessage(_INTL("Can't use that indoors.")) if showmsg
    next false
  end
  if $game_screen.weather_type==3 ||
     $game_screen.weather_type==4
    pbMessage(_INTL("It's already snowing.")) if showmsg
   next false
end
  for i in 0...pkmn.moves.length
    move = pkmn.moves[i]
    if isConst?(pkmn.moves[i].id,PBMoves,:HAIL)
        if pkmn.moves[i].pp<=1
          pbMessage(_INTL("Not enough PP...")) if showmsg
        end
      end
    end
  next true
})

HiddenMoveHandlers::UseMove.add(:HAIL,proc { |move,pokemon|
  if !pbHiddenMoveAnimation(pokemon)
    pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
  end
  $game_screen.weather(PBFieldWeather::Snow,9.0,20)
  for i in 0...pokemon.moves.length
    move = pokemon.moves[i]
    if isConst?(pokemon.moves[i].id,PBMoves,:HAIL)
        pokemon.moves[i].pp -= 1
      end
    end
    Graphics.update
    Input.update
    pbUpdateSceneMap
  next true
})

#===============================================================================
# Sunny Day
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:SUNNYDAY,proc { |move,pkmn,showmsg|
  if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
    pbMessage(_INTL("Can't use that indoors.")) if showmsg
    next false
  end
  if $game_screen.weather_type==7
    pbMessage(_INTL("It's already sunny.")) if showmsg
   next false
end
  if PBDayNight.isNight?
    pbMessage(_INTL("Can't use that at night.")) if showmsg
   next false
end
  for i in 0...pkmn.moves.length
    move = pkmn.moves[i]
    if isConst?(pkmn.moves[i].id,PBMoves,:SUNNYDAY)
        if pkmn.moves[i].pp<=1
          pbMessage(_INTL("Not enough PP...")) if showmsg
        end
      end
    end
  next true
})

HiddenMoveHandlers::UseMove.add(:SUNNYDAY,proc { |move,pokemon|
  if !pbHiddenMoveAnimation(pokemon)
    pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
  end
  $game_screen.weather(PBFieldWeather::Sun,9.0,20)
  for i in 0...pokemon.moves.length
    move = pokemon.moves[i]
    if isConst?(pokemon.moves[i].id,PBMoves,:SUNNYDAY)
        pokemon.moves[i].pp -= 1
      end
    end
    Graphics.update
    Input.update
    pbUpdateSceneMap
  next true
})



(I actually wrote two versions of code for this- I had originally written it as a command in PScreen_Party. That version doesn't work quite as well, as it doesn't show the Hidden Move animation, and you have to exit the menu before the weather appears, but if you're interested, here it is:
In PScreen_Party, find this:
Ruby:
        if !pkmn.egg? && (isConst?(move.id,PBMoves,:MILKDRINK) ||
                          isConst?(move.id,PBMoves,:SOFTBOILED) ||
                          HiddenMoveHandlers.hasHandler(move.id))

Change it to this:
Ruby:
        if !pkmn.egg? && (isConst?(move.id,PBMoves,:MILKDRINK) ||
                          isConst?(move.id,PBMoves,:SOFTBOILED) ||
                          isConst?(move.id,PBMoves,:SUNNYDAY) ||
                          isConst?(move.id,PBMoves,:RAINDANCE) ||
                          isConst?(move.id,PBMoves,:HAIL) ||
                          isConst?(move.id,PBMoves,:SANDSTORM) ||
                          HiddenMoveHandlers.hasHandler(move.id))

Below that, find
Code:
              break if pkmn.hp<=amt
            end
            @scene.pbSelect(oldpkmnid)
            pbRefresh
            break
Right after that last break, put in:
Ruby:
          elsif isConst?(pkmn.moves[i].id,PBMoves,:SANDSTORM)
            if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
                pbDisplay(_INTL("Can't use that indoors."))
                @scene.pbSelect(pkmnid)
                break
              end
           if $game_screen.weather_type==5
              movename = PBMoves.getName(pkmn.moves[i].id)
                pbDisplay(_INTL("There is already a sandstorm."))
                @scene.pbSelect(pkmnid)
                break
              end
            if pkmn.moves[i].pp<=1
              pbDisplay(_INTL("Not enough PP..."))
              break
            end
            $game_screen.weather(PBFieldWeather::Sandstorm,9.0,20)
            @scene.pbDisplay(_INTL("{1} caused a sandstorm!",pkmn.name))
            pkmn.moves[i].pp -= 1
            pbRefresh
            @scene.pbSelect(pkmnid)
            pbRefresh
            break
          elsif isConst?(pkmn.moves[i].id,PBMoves,:RAINDANCE)
            if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
                pbDisplay(_INTL("Can't use that indoors."))
                @scene.pbSelect(pkmnid)
                break
              end
           if $game_screen.weather_type==1 ||
              $game_screen.weather_type==2
              movename = PBMoves.getName(pkmn.moves[i].id)
                pbDisplay(_INTL("It's already raining."))
                @scene.pbSelect(pkmnid)
                break
              end
            if pkmn.moves[i].pp<=1
              pbDisplay(_INTL("Not enough PP..."))
              break
            end
            $game_screen.weather(PBFieldWeather::Rain,9.0,20)
            @scene.pbDisplay(_INTL("{1} made it rain!",pkmn.name))
            pkmn.moves[i].pp -= 1
            pbRefresh
            @scene.pbSelect(pkmnid)
            pbRefresh
            break
          elsif isConst?(pkmn.moves[i].id,PBMoves,:HAIL)
            if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
                pbDisplay(_INTL("Can't use that indoors."))
                @scene.pbSelect(pkmnid)
                break
              end
           if $game_screen.weather_type==3 ||
              $game_screen.weather_type==4
              movename = PBMoves.getName(pkmn.moves[i].id)
                pbDisplay(_INTL("It's already snowing."))
                @scene.pbSelect(pkmnid)
                break
              end
            if pkmn.moves[i].pp<=1
              pbDisplay(_INTL("Not enough PP..."))
              break
            end
            $game_screen.weather(PBFieldWeather::Snow,9.0,20)
            @scene.pbDisplay(_INTL("{1} made it snow!",pkmn.name))
            pkmn.moves[i].pp -= 1
            pbRefresh
            @scene.pbSelect(pkmnid)
            pbRefresh
            break
          elsif isConst?(pkmn.moves[i].id,PBMoves,:SUNNYDAY)
            if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
                pbDisplay(_INTL("Can't use that indoors."))
                @scene.pbSelect(pkmnid)
                break
              end
            if PBDayNight.isNight?
                pbDisplay(_INTL("Can't use that at night."))
                @scene.pbSelect(pkmnid)
                break
              end
           if $game_screen.weather_type==7
              movename = PBMoves.getName(pkmn.moves[i].id)
                pbDisplay(_INTL("It's already sunny."))
                @scene.pbSelect(pkmnid)
                break
              end
            if pkmn.moves[i].pp<=1
              pbDisplay(_INTL("Not enough PP..."))
              break
            end
            $game_screen.weather(PBFieldWeather::Sun,9.0,20)
            @scene.pbDisplay(_INTL("{1} made it sunny!",pkmn.name))
            pkmn.moves[i].pp -= 1
            pbRefresh
            @scene.pbSelect(pkmnid)
            pbRefresh
            break
  • Using these moves depletes 1 PP from the move.
  • None of these moves can be used indoors.
  • Sunny Day can't be used at night.
You can make events respond to the change in weather! Make a conditional where it checks if $game_screen.weather_type==#, with # being the number of your weather type!

Why bother with this?
Well, it's fun! But if you're looking for some ideas...
  • Weather-based evolutions... but the player has to set the weather to be able to evolve them!
  • Sidequests! Maybe you need to bring rain to someone's berry farm, or sunlight to power a solar panel!
  • Remember BW's season system? Let the player form those seasonal paths on their own! Hail could bring snowdrifts, rain could expand rivers, etc!
  • Special encounters! Maybe you can only find some Pokemon when they come out to sunbathe, or when the weather's cooler!
  • Bizarre regi-style puzzles! Maybe you even need to get the sun to hit the strange rock to read something!
Related- this tutorial can help you make a global variable for weather, which can help make eventing a little easier!
Credits
Credit to TechSkylander1518, please!
Author
TechSkylander1518
Views
390
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from TechSkylander1518

Top