Follower checks when using some items/moves in the field are now more specific, which should help following Pokémon scripts

This commit is contained in:
Maruno17
2021-12-09 23:30:52 +00:00
parent 79e04bff6c
commit c55f1f0a2a
4 changed files with 17 additions and 9 deletions

View File

@@ -36,6 +36,14 @@ class Game_Player < Game_Character
return $PokemonGlobal.followers.length > 0 return $PokemonGlobal.followers.length > 0
end end
def can_map_transfer_with_follower?
return $PokemonGlobal.followers.length == 0
end
def can_ride_vehicle_with_follower?
return $PokemonGlobal.followers.length == 0
end
def can_run? def can_run?
return false if $game_temp.in_menu || $game_temp.in_battle || return false if $game_temp.in_menu || $game_temp.in_battle ||
@move_route_forcing || $game_temp.message_window_showing || @move_route_forcing || $game_temp.message_window_showing ||

View File

@@ -257,7 +257,7 @@ HiddenMoveHandlers::CanUseMove.add(:DIG,proc { |move,pkmn,showmsg|
pbMessage(_INTL("Can't use that here.")) if showmsg pbMessage(_INTL("Can't use that here.")) if showmsg
next false next false
end end
if $game_player.has_follower? if $game_player.can_map_transfer_with_follower?
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
next false next false
end end
@@ -501,7 +501,7 @@ HiddenMoveHandlers::UseMove.add(:FLASH,proc { |move,pokemon|
def pbCanFly?(pkmn = nil, show_messages = false) def pbCanFly?(pkmn = nil, show_messages = false)
return false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLY, show_messages) return false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLY, show_messages)
return false if !$DEBUG && !pkmn && !$player.get_pokemon_with_move(:FLY) return false if !$DEBUG && !pkmn && !$player.get_pokemon_with_move(:FLY)
if $game_player.has_follower? if $game_player.can_map_transfer_with_follower?
pbMessage(_INTL("It can't be used when you have someone with you.")) if show_messages pbMessage(_INTL("It can't be used when you have someone with you.")) if show_messages
return false return false
end end
@@ -731,7 +731,7 @@ HiddenMoveHandlers::UseMove.add(:STRENGTH,proc { |move,pokemon|
#=============================================================================== #===============================================================================
def pbSurf def pbSurf
return false if $game_player.pbFacingEvent return false if $game_player.pbFacingEvent
return false if $game_player.has_follower? return false if $game_player.can_ride_vehicle_with_follower?
move = :SURF move = :SURF
movefinder = $player.get_pokemon_with_move(move) movefinder = $player.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF,false) || (!$DEBUG && !movefinder) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF,false) || (!$DEBUG && !movefinder)
@@ -808,7 +808,7 @@ HiddenMoveHandlers::CanUseMove.add(:SURF,proc { |move,pkmn,showmsg|
pbMessage(_INTL("You're already surfing.")) if showmsg pbMessage(_INTL("You're already surfing.")) if showmsg
next false next false
end end
if $game_player.has_follower? if $game_player.can_ride_vehicle_with_follower?
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
next false next false
end end
@@ -904,7 +904,7 @@ HiddenMoveHandlers::CanUseMove.add(:TELEPORT,proc { |move,pkmn,showmsg|
pbMessage(_INTL("Can't use that here.")) if showmsg pbMessage(_INTL("Can't use that here.")) if showmsg
next false next false
end end
if $game_player.has_follower? if $game_player.can_map_transfer_with_follower?
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
next false next false
end end

View File

@@ -454,7 +454,7 @@ def pbBikeCheck
pbMessage(_INTL("Can't use that here.")) pbMessage(_INTL("Can't use that here."))
return false return false
end end
if $game_player.has_follower? if $game_player.can_ride_vehicle_with_follower?
pbMessage(_INTL("It can't be used when you have someone with you.")) pbMessage(_INTL("It can't be used when you have someone with you."))
return false return false
end end

View File

@@ -21,7 +21,7 @@ ItemHandlers::UseFromBag.add(:HONEY,proc { |item|
}) })
ItemHandlers::UseFromBag.add(:ESCAPEROPE,proc { |item| ItemHandlers::UseFromBag.add(:ESCAPEROPE,proc { |item|
if $game_player.has_follower? if $game_player.can_map_transfer_with_follower?
pbMessage(_INTL("It can't be used when you have someone with you.")) pbMessage(_INTL("It can't be used when you have someone with you."))
next 0 next 0
end end
@@ -77,7 +77,7 @@ ItemHandlers::ConfirmUseInField.add(:ESCAPEROPE,proc { |item|
pbMessage(_INTL("Can't use that here.")) pbMessage(_INTL("Can't use that here."))
next false next false
end end
if $game_player.has_follower? if $game_player.can_map_transfer_with_follower?
pbMessage(_INTL("It can't be used when you have someone with you.")) pbMessage(_INTL("It can't be used when you have someone with you."))
next false next false
end end
@@ -168,7 +168,7 @@ ItemHandlers::UseInField.add(:ESCAPEROPE,proc { |item|
pbMessage(_INTL("Can't use that here.")) pbMessage(_INTL("Can't use that here."))
next false next false
end end
if $game_player.has_follower? if $game_player.can_map_transfer_with_follower?
pbMessage(_INTL("It can't be used when you have someone with you.")) pbMessage(_INTL("It can't be used when you have someone with you."))
next false next false
end end