mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Bug fixes: Shadow Pokémon still knowing some original moves when they shouldn't, Interpreter not resetting if saved in the middle of an event and then starting a new game, priority 1 tiles appearing below the player at larger screen sizes, ability inheritance when breeding
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user