Advertisement
LiTTleDRAgo

[RGSS] Blizz ABS Caterpillar Move Command

Jul 30th, 2012
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.05 KB | None | 0 0
  1. #==============================================================================
  2. # ** Game_System
  3. #------------------------------------------------------------------------------
  4. #  This class handles data surrounding the system.
  5. #  Refer to "$game_system" for the instance of this class.
  6. #==============================================================================
  7. class Game_System
  8.   #--------------------------------------------------------------------------
  9.   # * Public Instance Variables
  10.   #--------------------------------------------------------------------------
  11.   KEY_COMMAND = 'U'
  12.   attr_accessor :forbid_follow
  13.   #--------------------------------------------------------------------------
  14.   # * Alias Listing
  15.   #--------------------------------------------------------------------------
  16.   alias drg_152_upd update unless method_defined?(:drg_152_upd)
  17.   #--------------------------------------------------------------------------
  18.   # * Frame Update
  19.   #--------------------------------------------------------------------------
  20.   def update
  21.     trg = BlizzABS::Cache::Keys.find_all{|i|Input.trigger?(Input::Key["#{i}"])}
  22.     if Input.press?(Input::Key[KEY_COMMAND]) && trg.size > 0 &&
  23.                          !$game_party.actors[trg[0]].nil?
  24.       @forbid_follow = [] if @forbid_follow.nil?
  25.       if @forbid_follow[trg[0]]
  26.         @forbid_follow[trg[0]] = false
  27.         text = 'Follow Me '+ $game_party.actors[trg[0]].name+' !!'
  28.         $BlizzABS.util.request_damage_sprite($game_player,text)
  29.       else
  30.         @forbid_follow[trg[0]] = true
  31.         text = 'Stay Here '+ $game_party.actors[trg[0]].name+' !!'
  32.         $BlizzABS.util.request_damage_sprite($game_player,text)
  33.       end
  34.     end
  35.     drg_152_upd
  36.   end
  37. end  
  38. #==============================================================================
  39. # ** Map_Actor
  40. #------------------------------------------------------------------------------
  41. #  This class serves as character class for any actor on the map.
  42. #  Controller controls that instance of this class which has the first party
  43. #  member as battler.
  44. #==============================================================================
  45. class Map_Actor < Map_Battler
  46.   #--------------------------------------------------------------------------
  47.   # * Alias Listing
  48.   #--------------------------------------------------------------------------
  49.   alias drg_152_updin update_in_caterpillar if !method_defined?(:drg_152_updin)
  50.   #----------------------------------------------------------------------------
  51.   # update_in_caterpillar
  52.   #----------------------------------------------------------------------------
  53.   def update_in_caterpillar() drg_152_updin unless no_follow?  end
  54.   #----------------------------------------------------------------------------
  55.   # no_follow?
  56.   #----------------------------------------------------------------------------
  57.   def no_follow?
  58.     return false if !$scene.is_a?(Scene_Map)
  59.     return false if $game_system.forbid_follow.nil? || @cindex == nil
  60.     return true if $game_system.forbid_follow[@cindex]
  61.   end
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement