fixes water currents + recompile for trainer teams

This commit is contained in:
infinitefusion
2022-03-12 12:06:52 -05:00
parent ecb79c6336
commit 79f63485a3
34 changed files with 113 additions and 53 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -56,7 +56,7 @@ class Game_Player < Game_Character
self.move_speed = 4 # Sliding on ice
elsif !moving? && !@move_route_forcing && $PokemonGlobal
if $PokemonGlobal.bicycle
self.move_speed = 5 # Cycling
self.move_speed = $game_switches[RACE_BIKE] ? 5.5 : 5 # Cycling
elsif pbCanRun? || $PokemonGlobal.surfing
self.move_speed = 4 # Running, surfing
else

View File

@@ -16,6 +16,7 @@ module GameData
attr_reader :ledge
attr_reader :ice
attr_reader :bridge
attr_reader :waterCurrent
attr_reader :shows_reflections
attr_reader :must_walk
attr_reader :ignore_passability
@@ -55,6 +56,7 @@ module GameData
@battle_environment = hash[:battle_environment]
@ledge = hash[:ledge] || false
@ice = hash[:ice] || false
@waterCurrent = hash[:waterCurrent] || false
@bridge = hash[:bridge] || false
@shows_reflections = false #= hash[:shows_reflections] || false
@must_walk = hash[:must_walk] || false
@@ -114,6 +116,7 @@ GameData::TerrainTag.register({
:id_number => 6,
:can_surf => true,
:can_fish => true,
:waterCurrent => true,
:battle_environment => :MovingWater
})

View File

@@ -455,7 +455,8 @@ class PokeBattle_Battle
# Register captured Pokémon in the Pokédex, and store them
pbRecordAndStoreCaughtPokemon
isRematch = $game_switches[200]
isRematch = $game_switches[IS_REMATCH_SWITCH]
begin
if isRematch
if @opponent.is_a?(Array)
for trainer in @opponent
@@ -467,6 +468,9 @@ class PokeBattle_Battle
incrNbRematches(rematchId)
end
end
rescue
$game_switches[IS_REMATCH_SWITCH]=false
end
# Collect Pay Day money in a wild battle that ended in a capture

View File

@@ -159,6 +159,8 @@ Events.onStepTakenFieldMovement += proc { |_sender, e|
pbDescendWaterfall
elsif currentTag.ice && !$PokemonGlobal.sliding
pbSlideOnIce
elsif currentTag.waterCurrent && !$PokemonGlobal.sliding
pbSlideOnWater
end
end
end
@@ -569,6 +571,37 @@ def pbSlideOnIce
$PokemonGlobal.sliding = false
end
def pbSlideOnWater
return if !$game_player.pbTerrainTag.waterCurrent
$PokemonGlobal.sliding = true
direction = $game_player.direction
oldwalkanime = $game_player.walk_anime
$game_player.straighten
$game_player.walk_anime = false
loop do
break if !$game_player.can_move_in_direction?(direction)
break if !$game_player.pbTerrainTag.waterCurrent
if $game_map.passable?($game_player.x,$game_player.y,8)
$game_player.move_up
elsif $game_map.passable?($game_player.x,$game_player.y,4)
$game_player.move_left
elsif $game_map.passable?($game_player.x,$game_player.y,6)
$game_player.move_right
elsif $game_map.passable?($game_player.x,$game_player.y,2)
$game_player.move_down
end
while $game_player.moving?
pbUpdateSceneMap
Graphics.update
Input.update
end
end
$game_player.center($game_player.x, $game_player.y)
$game_player.straighten
$game_player.walk_anime = oldwalkanime
$PokemonGlobal.sliding = false
end
def pbTurnTowardEvent(event,otherEvent)
sx = 0
sy = 0

View File

@@ -5,7 +5,7 @@ ItemHandlers::UseText.add(:BICYCLE,proc { |item|
next ($PokemonGlobal.bicycle) ? _INTL("Walk") : _INTL("Use")
})
ItemHandlers::UseText.copy(:BICYCLE,:MACHBIKE,:ACROBIKE)
ItemHandlers::UseText.copy(:BICYCLE,:RACEBIKE)
#===============================================================================
# UseFromBag handlers

View File

@@ -41,4 +41,7 @@ TRUE = true
DIRECTION_LEFT = 4
DIRECTION_RIGHT = 6
DIRECTION_DOWN = 2
DIRECTION_UP = 8
DIRECTION_UP = 8
RACE_BIKE = 984
IS_REMATCH_SWITCH=200

View File

@@ -247,22 +247,24 @@ def generateSimpleTrainerParty(teamSpecies, level)
end
def isSinnohPokemon(species)
dexNum = getDexNumberForSpecies(species)
list =
[254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265,
266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 288, 294,
295, 296, 297, 298, 299, 305, 306, 307, 308, 315, 316, 317,
318, 319, 320, 321, 322, 323, 324, 326, 332, 343, 344, 345,
346, 347, 352, 353, 354, 358, 383, 384, 388, 389, 400, 402, 403]
return list.include?(species)
return list.include?(dexNum)
end
def isHoennPokemon(species)
dexNum = getDexNumberForSpecies(species)
list = [252, 253, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 289, 290, 291, 292, 293, 300, 301, 302, 303,
304, 309, 310, 311, 312, 313, 314, 333, 334, 335, 336, 340,
341, 342, 355, 356, 357, 378, 379, 380, 381, 382, 385, 386, 387, 390,
391, 392, 393, 394, 395, 396, 401, 404, 405]
return list.include?(species)
return list.include?(dexNum)
end
def pbBitmap(path)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.