Advertisement
anhdnguyen

[XP] Lazy Ladder

Jun 20th, 2017
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.19 KB | None | 0 0
  1. #==============================================================================
  2. # [XP] LAZY LADDER
  3. # by: Anh Nguyen
  4. #==============================================================================
  5. # When you go up and down ladders, your character will always be facing up.
  6.  
  7. module Ladder
  8.   #Terrain tags using as ladder tags
  9.   LADDER_TERRAINS = [1]
  10.   #Maps using ladder tags
  11.   LADDER_MAPS = [1]
  12. end
  13.  
  14. #==============================================================================
  15. # Game_System
  16. #==============================================================================
  17.  
  18. class Game_System
  19.  
  20.   attr_accessor :ladder
  21.  
  22.   alias ladder_init initialize
  23.   def initialize
  24.     ladder_init
  25.     @ladder = true
  26.   end
  27.  
  28. end
  29.  
  30. #==============================================================================
  31. # Game_Player
  32. #==============================================================================
  33.  
  34. class Game_Player
  35.  
  36.   alias upd_lad update
  37.   def update
  38.     upd_lad
  39.     if $game_system.ladder && Ladder::LADDER_MAPS.include?($game_map.map_id)
  40.       flag = Ladder::LADDER_TERRAINS.include?(terrain_tag)
  41.       @direction = 8 if flag
  42.       @direction_fix = flag
  43.     end
  44.   end
  45.  
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement