Rewrote and refactored follower code, fixed follower glitchiness actoss connected maps, fixed follower glitchiness around bridges

This commit is contained in:
Maruno17
2021-10-02 22:57:54 +01:00
parent 0b656edffc
commit f35a51f975
15 changed files with 625 additions and 588 deletions

View File

@@ -548,20 +548,24 @@ end
def pbSlideOnIce
return if !$game_player.pbTerrainTag.ice
$PokemonTemp.followers.update
$PokemonGlobal.sliding = true
direction = $game_player.direction
oldwalkanime = $game_player.walk_anime
$game_player.straighten
$game_player.walk_anime = false
first_loop = true
loop do
break if !$game_player.can_move_in_direction?(direction)
break if !$game_player.pbTerrainTag.ice
$game_player.move_forward
$PokemonTemp.followers.move_followers if first_loop
while $game_player.moving?
pbUpdateSceneMap
Graphics.update
Input.update
end
first_loop = false
end
$game_player.center($game_player.x, $game_player.y)
$game_player.straighten

View File

@@ -255,7 +255,7 @@ HiddenMoveHandlers::CanUseMove.add(:DIG,proc { |move,pkmn,showmsg|
pbMessage(_INTL("Can't use that here.")) if showmsg
next false
end
if $game_player.pbHasDependentEvents?
if $game_player.has_follower?
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
next false
end
@@ -494,7 +494,7 @@ HiddenMoveHandlers::UseMove.add(:FLASH,proc { |move,pokemon|
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:FLY,proc { |move,pkmn,showmsg|
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLY,showmsg)
if $game_player.pbHasDependentEvents?
if $game_player.has_follower?
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
next false
end
@@ -696,7 +696,7 @@ HiddenMoveHandlers::UseMove.add(:STRENGTH,proc { |move,pokemon|
#===============================================================================
def pbSurf
return false if $game_player.pbFacingEvent
return false if $game_player.pbHasDependentEvents?
return false if $game_player.has_follower?
move = :SURF
movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF,false) || (!$DEBUG && !movefinder)
@@ -770,7 +770,7 @@ HiddenMoveHandlers::CanUseMove.add(:SURF,proc { |move,pkmn,showmsg|
pbMessage(_INTL("You're already surfing.")) if showmsg
next false
end
if $game_player.pbHasDependentEvents?
if $game_player.has_follower?
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
next false
end
@@ -865,7 +865,7 @@ HiddenMoveHandlers::CanUseMove.add(:TELEPORT,proc { |move,pkmn,showmsg|
pbMessage(_INTL("Can't use that here.")) if showmsg
next false
end
if $game_player.pbHasDependentEvents?
if $game_player.has_follower?
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
next false
end