Advertisement
estriole

EST - DECOR MOVEMENT [BUILD DECOR SERIES]

May 29th, 2013
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.96 KB | None | 0 0
  1. =begin
  2. haven't got time to write the documentation. read the EST - DECOR AND BUILD
  3. script on how to use this
  4. =end
  5. module ESTRIOLE
  6.   SELF_SWITCH_DECOR = 'A'
  7. end
  8. class Game_Interpreter
  9.   def decor_move(self_switch_end = true,restric_region = nil)
  10.     $game_switches[YEA::UTILITY::STOP_PLAYER_MOVEMENT_SWITCH] = true
  11.     wait(1)
  12.     $game_system.menu_disabled = true
  13.     decor_move_down if Input.press?(:DOWN)
  14.     decor_move_left if Input.press?(:LEFT)
  15.     decor_move_right if Input.press?(:RIGHT)
  16.     decor_move_up if Input.press?(:UP)
  17.     decor_move_end(self_switch_end) if Input.press?(:C) && $game_map.events[@event_id].decor_move
  18.   end
  19.   def decor_move_down
  20.     Sound.play_cursor
  21.     $game_map.events[@event_id].move_straight(2)
  22.     $game_map.events[@event_id].decor_move = true
  23.   end
  24.   def decor_move_left
  25.     Sound.play_cursor
  26.     $game_map.events[@event_id].move_straight(4)
  27.     $game_map.events[@event_id].decor_move = true
  28.   end
  29.   def decor_move_right
  30.     Sound.play_cursor
  31.     $game_map.events[@event_id].move_straight(6)
  32.     $game_map.events[@event_id].decor_move = true
  33.   end
  34.   def decor_move_up
  35.     Sound.play_cursor
  36.     $game_map.events[@event_id].move_straight(8)
  37.     $game_map.events[@event_id].decor_move = true
  38.   end
  39.   def decor_move_end(self_switch_end)
  40.     wx = $game_map.events[@event_id].x
  41.     wy = $game_map.events[@event_id].y
  42.     px = $game_player.x
  43.     py = $game_player.y
  44.     return Sound.play_buzzer if px > wx-1 && px < wx+1 && py > wy-1 && py < wy+1
  45.     return Sound.play_buzzer if wx==px && wy==py
  46.     Sound.play_ok
  47.     $game_self_switches[[@map_id, @event_id, ESTRIOLE::SELF_SWITCH_DECOR]] = self_switch_end
  48.     $game_map.events[@event_id].decor_move = false
  49.     $game_switches[YEA::UTILITY::STOP_PLAYER_MOVEMENT_SWITCH] = false
  50.     $game_system.menu_disabled = $game_party.saving_status rescue false
  51.     $game_map.events[@event_id].refresh
  52.   end
  53. end
  54.  
  55. class Game_Event < Game_Character
  56.   attr_accessor :decor_move
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement