mrbubble

Battle Position by Actor ID

Jul 6th, 2011
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.97 KB | None | 0 0
  1. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2. # Battle Position by Actor ID for Tankentai Sideview
  3. # v1.0
  4. # By Mr. Bubble
  5. # Requested by Aurelia
  6. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7. # Allows you to specify actor positions in battle by their actor_id.
  8. # Keep in mind that for Y-coordinates, lower values move positions UP
  9. # and higher values move positions DOWN.
  10. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11.  
  12. module N01
  13.   ACTOR_POSITION_BY_ID = {
  14.  
  15.   #  ID    [  x,  y],  <---- (remember the comma after each closing bracket)
  16.       1 => [415,120],
  17.       2 => [435,150],
  18.       3 => [455,180],
  19.       4 => [475,210],
  20.       5 => [495,240],
  21.       6 => [515,270],
  22.       # Add more actor_id => [x,y], below here
  23.      
  24.      
  25.   } # <-- Do not delete
  26.  
  27. end
  28.  
  29. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  30. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  31. # - -  Do not edit anything below here unless you know what you're doing. - - -  
  32. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  33. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  34.  
  35.  
  36. $imported = {} if $imported == nil
  37.  
  38. if $imported["TankentaiSideview"]
  39.  
  40. class Game_Actor < Game_Battler
  41.   alias base_position_by_actor_id base_position unless $@
  42.   def base_position
  43.     # check if id is defined
  44.     if N01::ACTOR_POSITION_BY_ID.key?(self.id)
  45.       # Use coordinates in hash
  46.       base = N01::ACTOR_POSITION_BY_ID[self.id]
  47.       @base_position_x = base[0]
  48.       @base_position_y = base[1]
  49.       # When in Back Attack, invert x-coordinate position
  50.       @base_position_x = Graphics.width - base[0] if $back_attack && N01::BACK_ATTACK
  51.     else
  52.       # else use original method
  53.       base_position_by_actor_id # alias
  54.     end
  55.   end
  56. end
  57.  
  58. end # if $imported["TankentaiSideview"]
Advertisement
Add Comment
Please, Sign In to add comment