• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Future Sight as a Field Move

v20.1 Future Sight as a Field Move 2022-11-25

This resource pertains to version 20.1 of Pokémon Essentials.
Pokémon Essentials Version
v20.1 ➖
futurefield.gif

Lets players use Future Sight to see the future of their Pokémon!

Code​

Unfortunately, this isn't really suited for a plug-and-play script. Luckily, it's not too much hassle to add.

These changes are in UI_Party. If you’re using a script that modifies the party UI, such as Deep_Blue’s BW UI, you’ll need to edit that script instead.

Find:
Ruby:
Expand Collapse Copy
          next if !HiddenMoveHandlers.hasHandler(move.id) &&
                  ![:MILKDRINK, :SOFTBOILED].include?(move.id)
Add :FUTURESIGHT to the list of moves, like so-
Ruby:
Expand Collapse Copy
          next if !HiddenMoveHandlers.hasHandler(move.id) &&
                  ![:MILKDRINK, :SOFTBOILED,:FUTURESIGHT].include?(move.id)
Below that, find the line:-

Ruby:
Expand Collapse Copy
        elsif pbCanUseHiddenMove?(pkmn, move.id)

Right above that line, paste this:
Ruby:
Expand Collapse Copy
        elsif move.id == :FUTURESIGHT
          if move.pp <= 0
            pbDisplay(_INTL("Not enough PP..."))
            next
          end
          @scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
          old_party_idx = party_idx
          loop do
            @scene.pbPreSelect(old_party_idx)
            party_idx = @scene.pbChoosePokemon(true, party_idx)
            break if party_idx < 0
            newpkmn = @party[party_idx]
            movename = move.name
            if newpkmn.egg?
              #used to prevent HP bar from appearing
              annotations = [nil,nil,nil,nil,nil,nil]
              annotations[party_idx] = " "
              @scene.pbAnnotate(annotations)
              steps = newpkmn.steps_to_hatch
              newpkmn.name           = newpkmn.speciesName
              newpkmn.steps_to_hatch = 0
              newpkmn.hatched_map = 0
              newpkmn.timeEggHatched = pbGetTimeNow
              move.pp -= 1 if @scene.pbSummary(party_idx)
              newpkmn.steps_to_hatch = steps
              newpkmn.hatched_map = nil
              newpkmn.timeEggHatched = nil
              newpkmn.name           = "Egg"
              pbRefresh
            else
              selpkmn = (pkmn == newpkmn) ? "its own" : "#{newpkmn.name}'s"
              pbDisplay(_INTL("{1} caught a glimpse of {2} future...", pkmn.name, selpkmn))
              evos = newpkmn.species_data.get_evolutions
              evos.each_with_index do |evo, i|
                evos[i] = nil if evo[1] == :None
                evos[i] = nil if [:LevelMale, :HappinessMale, :HoldItemMale, :ItemMale, :TradeMale].include?(evo[1]) && !newpkmn.male?
                evos[i] = nil if [:LevelFemale, :HappinessFemale, :HoldItemFemale, :ItemFemale, :TradeFemale].include?(evo[1]) && !newpkmn.female?
              end
              evos.compact!
              evo_msg = pbGetEvolutionText(evos.sample)
              if evo_msg
                move.pp -= 1 if pbDisplay(_INTL("{1} {2}", newpkmn.name, evo_msg))
              elsif newpkmn.level < GameData::GrowthRate.max_level
                next_move = nil
                moveList = newpkmn.getMoveList
                moveList.each do |m|
                  next if newpkmn.level > m[0]
                  next if newpkmn.hasMove?(m[1])
                  next_move = m
                  break
                end
                if next_move
                  next_move_name = GameData::Move.get(next_move[1]).name
                  move.pp -= 1 if pbDisplay(_INTL("{1} may learn {2} at level {3}.", newpkmn.name, next_move_name, next_move[0]))
                else
                  pbDisplay(_INTL("{1}'s future is too vast to read.", newpkmn.name))
                end
              else
                pbDisplay(_INTL("{1}'s future is too vast to read.", newpkmn.name))
              end
            end
          end
          @scene.pbSelect(old_party_idx)
          pbRefresh
Finally, you will also need to add this utility script somewhere - I personally think it's fine just in its own script section.
Ruby:
Expand Collapse Copy
def pbGetEvolutionText(evo)
  return if !evo || evo.empty?
  method, param = evo[1], evo[2]
  if param && param.is_a?(Symbol)
    case method
    when :HasMove, :HappinessMove         then name = GameData::Move.get(param).name
    when :HasMoveType, :HappinessMoveType then name = GameData::Type.get(param).name
    when :HasInParty, :TradeSpecies       then name = GameData::Species.get(param).name
    else                                       name = GameData::Item.get(param).name
    end
    article = (param == :LEFTOVERS) ? "some" : (name.starts_with_vowel?) ? "an" : "a"
  end
  evo_data = GameData::Evolution.get(method)
  if evo_data.event_proc
    text = "may evolve when something special happens"
  elsif evo_data.after_battle_proc
    text = "may evolve after concluding a battle"
  elsif evo_data.on_trade_proc
    text = "may evolve upon being traded"
  elsif evo_data.use_item_proc
    text = "may evolve when exposed to #{article} #{name}"
  elsif evo_data.level_up_proc
    if evo_data.minimum_level == 1
      text = "may evolve upon leveling up"
    else
      text = "may evolve upon reaching level #{param} or higher"
    end
  else return
  end
  case method
  when :LevelDay, :ItemDay, :TradeDay         then text += " during the day."
  when :LevelNight, :ItemNight, :TradeNight   then text += " at nighttime."
  when :LevelMorning                          then text += " in the morning."
  when :LevelAfternoon                        then text += " in the afternoon."
  when :LevelEvening                          then text += " during the evening."
  when :LevelNoWeather                        then text += " while the weather is clear."
  when :LevelSun                              then text += " while the sunlight is harsh."
  when :LevelRain                             then text += " while its raining."
  when :LevelSnow                             then text += " during a hailstorm."
  when :LevelSandstorm                        then text += " during a sandstorm."
  when :LevelCycling                          then text += " while traveling by bicycle."
  when :LevelSurfing                          then text += " while traveling over water."
  when :LevelDiving                           then text += " while traveling underwater."
  when :LevelDarkness                         then text += " while traveling in darkness."
  when :Location, :LocationFlag               then text += " while in a certain location."
  when :Region                                then text += " while in the #{pbGetMessage(MessageTypes::RegionNames, param)} region."
  when :LevelDarkInParty                      then text += " while there's a Dark-type influence in the party."
  when :HasMove                               then text += " while it knows the move #{name}."
  when :HasMoveType                           then text += " while it knows #{article} #{name}-type move."
  when :HasInParty                            then text += " while #{article} #{name} is in the party."
  when :TradeSpecies                          then text += " for #{article} #{name}."
  when :DayHoldItem                           then text += " while holding #{article} #{name} during the day."
  when :NightHoldItem                         then text += " while holding #{article} #{name} at night."
  when :MaxHappiness                          then text += " while having total trust in its trainer."
  when :HappinessDay                          then text += " while feeling happy during daytime hours."
  when :HappinessNight                        then text += " while feeling happy during nighttime hours."
  when :HappinessMove                         then text += " while feeling happy and it knows the move #{name}."
  when :HappinessMoveType                     then text += " while feeling happy and it knows #{article} #{name}-type move."
  when :HappinessHoldItem, :HoldItemHappiness then text += " while feeling happy and holding #{article} #{name}."
  when :Beauty                                then text += " while it's feeling beautiful."
  when :BattleDealCriticalHit                 then text += " where it landed at least #{param} critical hits."
  when :EventAfterDamageTaken                 then text += " after it took a certain amount of damage in battle."
  when :HoldItem, :TradeItem,
       :HoldItemMale, :HoldItemFemale         then text += " while holding #{article} #{name}."
  when :Happiness, :ItemHappiness,
       :HappinessMale, :HappinessFemale       then text += " while having great affection for its trainer."
  else text += "."
  end
  return text
end

  • When used on Eggs, shows the Pokémon that will hatch.
  • When used on a Pokémon that can evolve, describes the way to evolve it. Branched evolutions will pick a random possible method.
  • When used on a Pokémon that can't evolve further, lists the next level-up move and when it learns it. (If the Pokémon already knows the next move, it will go onto the move after that)
Requires 1PP to use, depletes 1PP per successful use. (A Pokémon with a future "too vast to read" won't deplete PP for trying)

These lines might be of interest to developers -
Ruby:
Expand Collapse Copy
              newpkmn.hatched_map = 0
              newpkmn.timeEggHatched = pbGetTimeNow
These are what set the location and time for the egg hatching when you view the summary. As you can see in the GIF, it's set to display "Faraway Place" (since there's no map with the ID number 0), and the current time. Feel free to tweak it to seem more ambiguous/future-y.

If you've added new evolution methods to your game, you'll need to add them to the utility def pbGetEvolutionText.

Looking for more field moves?​

You may also be interested in Lucidious89's Improved Field Skills.
Credits
Credit to TechSkylander1518 and Lucidious89!
  • Like
Reactions: -FL-
Author
TechSkylander1518
Views
1,686
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from TechSkylander1518

Latest updates

  1. Update courtesy of Lucidious89

    Lucidious89 put together some great ideas for use on regular Pokémon! When used on a Pokémon...
Back
Top