LiTTleDRAgo

[RGSS] Drago - Event Pixel Movement

Aug 12th, 2014
449
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. __END__
  2. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  3. # [XP] DRG - Event Pixel Movement
  4. # Version: 1.00
  5. # Author : LiTTleDRAgo
  6. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  7. ($imported ||= {})[:drg_ev_pixel_movement] = 1.00
  8. #==============================================================================
  9. # THIS SCRIPT IS NO LONGER NEEDED
  10. #==============================================================================
  11. #==============================================================================
  12. #
  13. # Introduction :
  14. #
  15. #   This script is an addon for Drago - Pixel Movement.
  16. #
  17. #==============================================================================
  18.  
  19. pixel = "This script needs Drago Pixel Movement v1.02 or later"
  20. ($imported[:drg_pixel_movement]||0) >= 1.02 || raise(pixel)
  21. #==============================================================================
  22. # ** Game_Event
  23. #------------------------------------------------------------------------------
  24. #  This class deals with events. It handles functions including event page
  25. #  switching via condition determinants, and running parallel process events.
  26. #  It's used within the Game_Map class.
  27. #==============================================================================
  28.  
  29. class Game_Event
  30.   #--------------------------------------------------------------------------
  31.   # * Constant
  32.   #--------------------------------------------------------------------------
  33.   ALIASING_PIXEL.call(1)
  34.   #--------------------------------------------------------------------------
  35.   # * Alias Method
  36.   #--------------------------------------------------------------------------
  37.   unless method_defined?(:pixel_check_touch)
  38.     alias_method :pixel_initialize,   :initialize
  39.   end
  40.   #--------------------------------------------------------------------------
  41.   # * Pixel Movement
  42.   #--------------------------------------------------------------------------
  43.   def initialize(*args)
  44.     pixel_initialize(*args)
  45.     @pixel_movement = true
  46.   end
  47. end
  48. #==============================================================================
  49. # ** Game_Character
  50. #------------------------------------------------------------------------------
  51. #  This class deals with characters. It's used as a superclass for the
  52. #  Game_Player and Game_Event classes.
  53. #==============================================================================
  54.  
  55. class Game_Character
  56.   #--------------------------------------------------------------------------
  57.   # * Overwriten method: passable?
  58.   #--------------------------------------------------------------------------
  59.   def passable?(x, y, d)
  60.     new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
  61.     new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
  62.     return false unless $game_map.valid?(new_x, new_y)
  63.     return true if @through
  64.     return false unless $game_map.passable?(x, y, d, self)
  65.     return false unless $game_map.passable?(new_x, new_y, 10 - d)
  66.     for event in $game_map.events.values
  67.       #----------------------------------------------------------
  68.       if (event.x - new_x).abs < 1 and (event.y - new_y).abs < 1
  69.         unless event.through || (self == event)
  70.       #----------------------------------------------------------
  71.           return false if self != $game_player
  72.           return false if event.character_name != ""
  73.         end
  74.       end
  75.     end
  76.     #----------------------------------------------------------
  77.     if self != (a = $game_player) && (a.x-new_x).abs < 1 && (a.y-new_y).abs < 1
  78.     #----------------------------------------------------------
  79.       return false if @character_name != "" && !$game_player.through
  80.     end
  81.     return true
  82.   end
  83. end
RAW Paste Data