From f00553c1ebc0d85787dc76443211191b0b8f5605 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Mon, 15 Nov 2021 08:38:39 +0000 Subject: [PATCH] Bug fixes from previous commits --- .../004_Game classes/007_Game_Character.rb | 26 +++++++++---------- .../004_Game classes/009_Game_Player.rb | 6 ++--- .../012_Game_FollowerFactory.rb | 2 +- Data/Scripts/014_Pokemon/001_Pokemon.rb | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Data/Scripts/004_Game classes/007_Game_Character.rb b/Data/Scripts/004_Game classes/007_Game_Character.rb index b585a8604..b4cd9e3bf 100644 --- a/Data/Scripts/004_Game classes/007_Game_Character.rb +++ b/Data/Scripts/004_Game classes/007_Game_Character.rb @@ -199,20 +199,20 @@ class Game_Character def calculate_bush_depth if @tile_id > 0 || @always_on_top || jumping? @bush_depth = 0 + return + end + deep_bush = regular_bush = false + xbehind = @x + (@direction == 4 ? 1 : @direction == 6 ? -1 : 0) + ybehind = @y + (@direction == 8 ? 1 : @direction == 2 ? -1 : 0) + this_map = (self.map.valid?(@x, @y)) ? [self.map, @x, @y] : $map_factory&.getNewMap(@x, @y) + behind_map = (self.map.valid?(xbehind, ybehind)) ? [self.map, xbehind, ybehind] : $map_factory&.getNewMap(xbehind, ybehind) + if this_map && this_map[0].deepBush?(this_map[1], this_map[2]) && + (!behind_map || behind_map[0].deepBush?(behind_map[1], behind_map[2])) + @bush_depth = Game_Map::TILE_HEIGHT + elsif this_map && this_map[0].bush?(this_map[1], this_map[2]) && !moving? + @bush_depth = 12 else - deep_bush = regular_bush = false - xbehind = @x + (@direction == 4 ? 1 : @direction == 6 ? -1 : 0) - ybehind = @y + (@direction == 8 ? 1 : @direction == 2 ? -1 : 0) - this_map = (self.map.valid?(@x, @y)) ? [self.map, @x, @y] : $map_factory.getNewMap(@x, @y) - behind_map = (self.map.valid?(xbehind, ybehind)) ? [self.map, xbehind, ybehind] : $map_factory&.getNewMap(xbehind, ybehind) - if this_map[0].deepBush?(this_map[1], this_map[2]) && - (!behind_map || behind_map[0].deepBush?(behind_map[1], behind_map[2])) - @bush_depth = Game_Map::TILE_HEIGHT - elsif !moving? && this_map[0].bush?(this_map[1], this_map[2]) - @bush_depth = 12 - else - @bush_depth = 0 - end + @bush_depth = 0 end end diff --git a/Data/Scripts/004_Game classes/009_Game_Player.rb b/Data/Scripts/004_Game classes/009_Game_Player.rb index 2284eab31..60e6de29d 100644 --- a/Data/Scripts/004_Game classes/009_Game_Player.rb +++ b/Data/Scripts/004_Game classes/009_Game_Player.rb @@ -156,11 +156,11 @@ class Game_Player < Game_Character @jump_distance_left = 1 # Just needs to be non-zero if real_distance > 0 # Jumping to somewhere else if $PokemonGlobal&.diving || $PokemonGlobal&.surfing - $stats.distance_surfed += x_plus.abs + y_pos.abs + $stats.distance_surfed += x_plus.abs + y_plus.abs elsif $PokemonGlobal&.bicycle - $stats.distance_cycled += x_plus.abs + y_pos.abs + $stats.distance_cycled += x_plus.abs + y_plus.abs else - $stats.distance_walked += x_plus.abs + y_pos.abs + $stats.distance_walked += x_plus.abs + y_plus.abs end @jump_count = 0 else # Jumping on the spot diff --git a/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb b/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb index 1ac0d687f..58b663d76 100644 --- a/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb +++ b/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb @@ -331,7 +331,7 @@ end #=============================================================================== def pbAddDependency2(event_id, name, common_event_id) Deprecation.warn_method('pbAddDependency2', 'v21', 'Followers.add(event_id, name, common_event_id)') - Followers.add_event(event) + Followers.add(event_id, name, common_event_id) end def pbAddDependency(event) diff --git a/Data/Scripts/014_Pokemon/001_Pokemon.rb b/Data/Scripts/014_Pokemon/001_Pokemon.rb index 4224e317a..349a931c7 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon.rb @@ -78,7 +78,7 @@ class Pokemon # Used by Galarian Yamask to remember that it took sufficient damage from a # battle and can evolve. attr_accessor :ready_to_evolve - # Whether this Pokémon can be deposited in storage + # Whether this Pokémon can be deposited in storage/Day Care attr_accessor :cannot_store # Whether this Pokémon can be released attr_accessor :cannot_release