Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Shanghai Simple Script - On-Map Party Shift
- # Last Date Updated: 2010.05.11
- # Level: Normal
- #
- # Press the L or R buttons (Q and W respectively for keyboard) to switch out
- # who is the lead member. Switches with the next member.
- #===============================================================================
- # Instructions
- # -----------------------------------------------------------------------------
- # To install this script, open up your script editor and copy/paste this script
- # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
- #
- # If you want to prevent actor shifting, make a script call event and insert:
- # $game_system.prevent_actor_shift = true
- # $game_system.prevent_actor_shift = false
- # How true and false works is self explanatory.
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["On-MapPartyShift"] = true
- #==============================================================================
- # ** Game_System
- #==============================================================================
- class Game_System
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :prevent_actor_shift
- end
- #==============================================================================
- # ** Game_Party
- #==============================================================================
- class Game_Party < Game_Unit
- #--------------------------------------------------------------------------
- # * Swap Actor
- #--------------------------------------------------------------------------
- def swap_actor(reverse = false)
- if reverse
- swap_actor = @actors.pop
- @actors.insert(0, swap_actor)
- else
- swap_actor = @actors.shift
- @actors.push(swap_actor)
- end
- end
- end
- #==============================================================================
- # ** Scene_Map
- #==============================================================================
- class Scene_Map < Scene_Base
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- alias update_sss_on_map_party_shift update unless $@
- def update
- update_sss_on_map_party_shift
- unless $game_map.interpreter.running? or $game_message.visible
- update_on_map_party_shift
- end
- end
- #--------------------------------------------------------------------------
- # * Update On-Map Party Shift
- #--------------------------------------------------------------------------
- def update_on_map_party_shift
- return if $game_party.members.size < 2
- return if $game_system.prevent_actor_shift
- if Input.trigger?(Input::L)
- $game_party.swap_actor(true)
- $game_player.refresh
- elsif Input.trigger?(Input::R)
- $game_party.swap_actor(false)
- $game_player.refresh
- end
- end
- end
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement