diff --git a/Data/Scripts/004_Game classes/001_Switches and Variables/001_Game_Temp.rb b/Data/Scripts/004_Game classes/001_Switches and Variables/001_Game_Temp.rb index 981a54638..c195ca67a 100644 --- a/Data/Scripts/004_Game classes/001_Switches and Variables/001_Game_Temp.rb +++ b/Data/Scripts/004_Game classes/001_Switches and Variables/001_Game_Temp.rb @@ -8,6 +8,7 @@ class Game_Temp attr_accessor :message_window_showing # message window showing attr_accessor :common_event_id # common event ID attr_accessor :in_battle # in-battle flag + attr_accessor :in_storage # in-Pokémon storage flag attr_accessor :battle_abort # battle flag: interrupt attr_accessor :battleback_name # battleback file name attr_accessor :in_menu # menu is open @@ -32,6 +33,7 @@ class Game_Temp @message_window_showing = false @common_event_id = 0 @in_battle = false + @in_storage = false @battle_abort = false @battleback_name = '' @in_menu = false diff --git a/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb b/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb index 905426c3e..82f5c8936 100644 --- a/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb +++ b/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb @@ -50,9 +50,11 @@ end def pbDayCareDeposit(index) for i in 0...2 next if $PokemonGlobal.daycare[i][0] - $PokemonGlobal.daycare[i][0] = $Trainer.party[index] - $PokemonGlobal.daycare[i][1] = $Trainer.party[index].level - $PokemonGlobal.daycare[i][0].heal + pkmn = $Trainer.party[index] + pkmn.heal + pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN) + $PokemonGlobal.daycare[i][0] = pkmn + $PokemonGlobal.daycare[i][1] = pkmn.level $Trainer.party.delete_at(index) $PokemonGlobal.daycareEgg = 0 $PokemonGlobal.daycareEggSteps = 0 diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb index 3988ddf37..c63f492d6 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb @@ -190,8 +190,6 @@ class PokemonStorage else # Copying into box pkmn = self[boxSrc,indexSrc] raise "Trying to copy nil to storage" if !pkmn - pkmn.time_form_set = nil - pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN) pkmn.heal if Settings::HEAL_STORED_POKEMON self[boxDst,indexDst] = pkmn end @@ -212,11 +210,7 @@ class PokemonStorage def pbMoveCaughtToBox(pkmn,box) for i in 0...maxPokemon(box) if self[box,i]==nil - if box>=0 - pkmn.time_form_set = nil if pkmn.time_form_set - pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN) - pkmn.heal if Settings::HEAL_STORED_POKEMON - end + pkmn.heal if box >= 0 && Settings::HEAL_STORED_POKEMON self[box,i] = pkmn return true end @@ -225,11 +219,7 @@ class PokemonStorage end def pbStoreCaught(pkmn) - if @currentBox>=0 - pkmn.time_form_set = nil - pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN) - pkmn.heal if Settings::HEAL_STORED_POKEMON - end + pkmn.heal if Settings::HEAL_STORED_POKEMON if @currentBox >= 0 for i in 0...maxPokemon(@currentBox) if self[@currentBox,i]==nil self[@currentBox,i] = pkmn diff --git a/Data/Scripts/014_Pokemon/001_Pokemon.rb b/Data/Scripts/014_Pokemon/001_Pokemon.rb index 8f3d78784..a161e7588 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon.rb @@ -137,7 +137,7 @@ class Pokemon def form return @forced_form if !@forced_form.nil? - return @form if $game_temp.in_battle + return @form if $game_temp.in_battle || $game_temp.in_storage calc_form = MultipleForms.call("getForm", self) self.form = calc_form if calc_form != nil && calc_form != @form return @form diff --git a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb index dfa21d42a..1b80ee5eb 100644 --- a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb +++ b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb @@ -539,6 +539,7 @@ class PokemonBoxPartySprite < SpriteWrapper yvalues.push(2 + 16 * (i % 2) + 64 * (i / 2)) end @pokemonsprites.delete_if { |sprite| sprite && sprite.disposed? } + @pokemonsprites.each { |sprite| sprite.refresh if sprite } for j in 0...Settings::MAX_PARTY_SIZE sprite = @pokemonsprites[j] if sprite && !sprite.disposed? @@ -1478,6 +1479,7 @@ class PokemonStorageScreen end def pbStartScreen(command) + $game_temp.in_storage = true @heldpkmn = nil if command==0 # Organise @scene.pbStartBox(self,command) @@ -1636,6 +1638,7 @@ class PokemonStorageScreen @scene.pbStartBox(self,command) @scene.pbCloseBox end + $game_temp.in_storage = false end def pbUpdate # For debug @@ -1724,8 +1727,6 @@ class PokemonStorageScreen end if heldpoke || selected[0]==-1 p = (heldpoke) ? heldpoke : @storage[-1,index] - p.time_form_set = nil - p.form = 0 if p.isSpecies?(:SHAYMIN) p.heal if Settings::HEAL_STORED_POKEMON end @scene.pbStore(selected,heldpoke,destbox,firstfree) @@ -1770,11 +1771,7 @@ class PokemonStorageScreen pbDisplay("Please remove the mail.") return end - if box>=0 - @heldpkmn.time_form_set = nil - @heldpkmn.form = 0 if @heldpkmn.isSpecies?(:SHAYMIN) - @heldpkmn.heal if Settings::HEAL_STORED_POKEMON - end + @heldpkmn.heal if Settings::HEAL_STORED_POKEMON if box >= 0 @scene.pbPlace(selected,@heldpkmn) @storage[box,index] = @heldpkmn if box==-1 @@ -1799,11 +1796,7 @@ class PokemonStorageScreen pbDisplay("Please remove the mail.") return false end - if box>=0 - @heldpkmn.time_form_set = nil - @heldpkmn.form = 0 if @heldpkmn.isSpecies?(:SHAYMIN) - @heldpkmn.heal if Settings::HEAL_STORED_POKEMON - end + @heldpkmn.heal if Settings::HEAL_STORED_POKEMON if box >= 0 @scene.pbSwap(selected,@heldpkmn) tmp = @storage[box,index] @storage[box,index] = @heldpkmn @@ -1934,6 +1927,7 @@ class PokemonStorageScreen end def pbChoosePokemon(_party=nil) + $game_temp.in_storage = true @heldpkmn = nil @scene.pbStartBox(self,1) retval = nil @@ -1987,6 +1981,7 @@ class PokemonStorageScreen end end @scene.pbCloseBox + $game_temp.in_storage = false return retval end end diff --git a/Data/Scripts/Gen 8 notes.txt b/Data/Scripts/Gen 8 notes.txt index d1dadc320..4e463e889 100644 --- a/Data/Scripts/Gen 8 notes.txt +++ b/Data/Scripts/Gen 8 notes.txt @@ -24,9 +24,6 @@ Some abilities have changed effects: but in earlier Gens they are. Other notes: -- In Gen 7+, Shaymin/Hoopa revert their form when withdrawn from storage rather - than when deposited. It still also reverts under other conditions. Shaymin - reverts its form when deposited in the Day Care (all Gens). - If a battle ends because of Rocky Helmet damage, the side that the Rocky Helmet holder is on should lose (Gen 7+) or win (Gen 6-). @@ -164,4 +161,8 @@ What happens to the PP of Iron Head when turned into/from Behemoth Blade/Bash for Zacian/Zamazenta? It gets decreased to the total PP if it is higher than the total PP of the new move, but cannot increase. This is already what happens. +In Gen 7+, Shaymin/Hoopa revert their form when withdrawn from storage rather +than when deposited. It still also reverts under other conditions. Shaymin +reverts its form when deposited in the Day Care (all Gens). + =end