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

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