Advertisement
mikb89

[Ace] Independent Player Actor v1.4

Sep 19th, 2012
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.11 KB | None | 0 0
  1. # Independent Player Actor v. 1.4
  2. # VX Ace version
  3. # by mikb89
  4.  
  5. # Details:
  6. #  This script lets you have the Player as an Actor which isn't really in party.
  7.  
  8. # Configurations:
  9. module INDIEPLA
  10.   PLAYER_ACTOR_ID_VARIABLE = 1
  11.     # A Variable will contain the ID of the Actor which represent the leader.
  12.     # Setting this variable as <1, will deactivate the script. This way you can
  13.     #  multiply the value by -1 to activate/deactivate without losing the
  14.     #  selected Actor ID!
  15.     # NOTE! Once you change this variable value, you must execute a call script
  16.     #  with:
  17.     # $game_player.refresh
  18.     #  to let the graphic be renewed. Using the Debug screen, will automatically
  19.     #  do this, so that you can easily test in debug mode.
  20. end
  21.  
  22. # Others:
  23. #  Ispired by SowS script Exclude Player in party, requested from Emi in
  24. #   rpgmkr.net forum.
  25.  
  26. #Codename: indiepla
  27.  
  28. ($imported ||= {})[:mikb89_indiepla] = true
  29.  
  30. # License:
  31. # - You can ask me to include support for other scripts as long as these scripts
  32. #   use the $imported[script] = true;
  33. # - You can modify and even repost my scripts, after having received a response
  34. #   by me. For reposting it, anyway, you must have done heavy edit or porting,
  35. #   you can't do a post with the script as is;
  36. # - You can use my scripts for whatever you want, from free to open to
  37. #   commercial games. I'd appreciate by the way if you let me know about what
  38. #   you're doing;
  39. # - You must credit me, if you use this script or part of it.
  40.  
  41.  
  42. class Game_Player < Game_Character
  43.   alias_method(:actor_b4_indiepla, :actor) unless method_defined?(:actor_b4_indiepla)
  44. #class Game_Player#def actor() <- aliased
  45.   def actor
  46.     if $game_variables[INDIEPLA::PLAYER_ACTOR_ID_VARIABLE] < 1
  47.       actor_b4_indiepla
  48.     else
  49.       $game_actors[$game_variables[INDIEPLA::PLAYER_ACTOR_ID_VARIABLE]]
  50.     end
  51.   end
  52. end
  53.  
  54. class Game_Follower < Game_Character
  55.   alias_method(:actor_b4_indiepla, :actor) unless method_defined?(:actor_b4_indiepla)
  56. #class Game_Follower#def actor() <- aliased
  57.   def actor
  58.     if $game_variables[INDIEPLA::PLAYER_ACTOR_ID_VARIABLE] < 1
  59.       actor_b4_indiepla
  60.     else
  61.       $game_party.battle_members[@member_index - 1]
  62.     end
  63.   end
  64. end
  65.  
  66. class Game_Party < Game_Unit
  67.   alias_method(:max_bm_b4_indiepla, :max_battle_members) unless method_defined?(:max_bm_b4_indiepla)
  68. #class Game_Party#def max_battle_members() <- aliased
  69.   def max_battle_members
  70.     return max_bm_b4_indiepla + (($game_variables[INDIEPLA::PLAYER_ACTOR_ID_VARIABLE] < 1) ? 0 : 1)
  71.   end
  72.   alias_method(:leader_b4_indiepla, :leader) unless method_defined?(:leader_b4_indiepla)
  73. #class Game_Party#def leader() <- aliased
  74.   def leader
  75.     if $game_variables[INDIEPLA::PLAYER_ACTOR_ID_VARIABLE] < 1
  76.       leader_b4_indiepla
  77.     else
  78.       $game_actors[$game_variables[INDIEPLA::PLAYER_ACTOR_ID_VARIABLE]]
  79.     end
  80.   end
  81. end
  82.  
  83. class Scene_Debug < Scene_MenuBase
  84.   alias_method(:terminate_b4_indiepla, :terminate) unless method_defined?(:terminate_b4_indiepla)
  85. #class Scene_Debug#def terminate() <- aliased
  86.   def terminate
  87.     $game_player.refresh
  88.     terminate_b4_indiepla
  89.   end
  90. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement