diff --git a/Data/Scripts/003_Game processing/001_StartGame.rb b/Data/Scripts/003_Game processing/001_StartGame.rb index 9143bc376..10d86b247 100644 --- a/Data/Scripts/003_Game processing/001_StartGame.rb +++ b/Data/Scripts/003_Game processing/001_StartGame.rb @@ -42,6 +42,8 @@ module Game end $game_temp.common_event_id = 0 if $game_temp $game_temp.begun_new_game = true + pbMapInterpreter&.clear + pbMapInterpreter&.setup(nil, 0, 0) $scene = Scene_Map.new SaveData.load_new_game_values $stats.play_sessions += 1 diff --git a/Data/Scripts/006_Map renderer/001_TilemapRenderer.rb b/Data/Scripts/006_Map renderer/001_TilemapRenderer.rb index 4f5e653bd..a2a8bb5c1 100644 --- a/Data/Scripts/006_Map renderer/001_TilemapRenderer.rb +++ b/Data/Scripts/006_Map renderer/001_TilemapRenderer.rb @@ -428,7 +428,7 @@ class TilemapRenderer tile.z = 0 else priority = tile.priority - tile.z = (priority == 0) ? 0 : (y * SOURCE_TILE_HEIGHT) + (priority * SOURCE_TILE_HEIGHT) + SOURCE_TILE_HEIGHT + tile.z = (priority == 0) ? 0 : (y * SOURCE_TILE_HEIGHT) + (priority * SOURCE_TILE_HEIGHT) + SOURCE_TILE_HEIGHT + 1 end end diff --git a/Data/Scripts/010_Data/002_PBS data/014_Trainer.rb b/Data/Scripts/010_Data/002_PBS data/014_Trainer.rb index d583dc733..82cce006a 100644 --- a/Data/Scripts/010_Data/002_PBS data/014_Trainer.rb +++ b/Data/Scripts/010_Data/002_PBS data/014_Trainer.rb @@ -156,7 +156,6 @@ module GameData pkmn.name = pkmn_data[:name] if pkmn_data[:name] && !pkmn_data[:name].empty? if pkmn_data[:shadowness] pkmn.makeShadow - pkmn.update_shadow_moves(true) pkmn.shiny = false end pkmn.poke_ball = pkmn_data[:poke_ball] if pkmn_data[:poke_ball] diff --git a/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb b/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb index 88a15c209..b7e3d5965 100644 --- a/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb +++ b/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb @@ -150,9 +150,8 @@ class DayCare egg.nature = new_natures.sample end - # If a Pokémon is bred with a Ditto, that Pokémon can pass down its Hidden - # Ability (60% chance). If neither Pokémon are Ditto, then the mother can - # pass down its ability (60% chance if Hidden, 80% chance if not). + # The female parent (or the non-Ditto parent) can pass down its Hidden + # Ability (60% chance) or its regular ability (80% chance). # NOTE: This is how ability inheritance works in Gen 6+. Gen 5 is more # restrictive, and even works differently between BW and B2W2, and I # don't think that is worth adding in. Gen 4 and lower don't have @@ -164,12 +163,10 @@ class DayCare parent = (mother[1]) ? father[0] : mother[0] # The female or non-Ditto parent if parent.hasHiddenAbility? egg.ability_index = parent.ability_index if rand(100) < 60 - elsif !mother[1] && !father[1] # If neither parent is a Ditto - if rand(100) < 80 - egg.ability_index = mother[0].ability_index - else - egg.ability_index = (mother[0].ability_index + 1) % 2 - end + elsif rand(100) < 80 + egg.ability_index = parent.ability_index + else + egg.ability_index = (parent.ability_index + 1) % 2 end end diff --git a/Data/Scripts/014_Pokemon/003_Pokemon_ShadowPokemon.rb b/Data/Scripts/014_Pokemon/003_Pokemon_ShadowPokemon.rb index be9c2e263..fa3c7c4f8 100644 --- a/Data/Scripts/014_Pokemon/003_Pokemon_ShadowPokemon.rb +++ b/Data/Scripts/014_Pokemon/003_Pokemon_ShadowPokemon.rb @@ -141,7 +141,7 @@ class Pokemon end end - def update_shadow_moves(relearn_all_moves = false) + def update_shadow_moves return if !@shadow_moves || @shadow_moves.empty? # Not a Shadow Pokémon (any more); relearn all its original moves if !shadowPokemon? @@ -159,7 +159,7 @@ class Pokemon @shadow_moves.each_with_index { |m, i| new_moves.push(m) if m && i < MAX_MOVES } num_shadow_moves = new_moves.length # Add some original moves (skipping ones in the same slot as a Shadow Move) - num_original_moves = (relearn_all_moves) ? 3 : [3, 3, 2, 1, 1, 0][self.heartStage] + num_original_moves = [3, 3, 2, 1, 1, 0][self.heartStage] if num_original_moves > 0 relearned_count = 0 @shadow_moves.each_with_index do |m, i| @@ -174,17 +174,16 @@ class Pokemon end def replace_moves(new_moves) + # Forget any known moves that aren't in new_moves + @moves.each_with_index do |m, i| + @moves[i] = nil if !new_moves.include?(m.id) + end + @moves.compact! + # Learn any moves in new_moves that aren't known new_moves.each do |move| next if !move || !GameData::Move.exists?(move) || hasMove?(move) - if numMoves < Pokemon::MAX_MOVES # Has an empty slot; just learn move - learn_move(move) - next - end - @moves.each do |m| - next if new_moves.include?(m.id) - m.id = GameData::Move.get(move).id - break - end + break if numMoves >= Pokemon::MAX_MOVES + learn_move(move) end end