Advertisement
Archeia

Event Touch Activate even when Through

Dec 15th, 2014
665
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.85 KB | None | 0 0
  1. class Game_Event < Game_Character
  2.  
  3.   def check_event_trigger_touch(x, y)
  4.     return if $game_map.interpreter.running?
  5.     follower_touch = false
  6.     #---
  7.     $game_player.followers.each do |follower|
  8.       if follower.pos?(x,y)
  9.         follower_touch = true
  10.         break
  11.       end
  12.     end
  13.     #---
  14.     if @trigger == 2 && ($game_player.pos?(x, y) || follower_touch)
  15.       start
  16.     end
  17.   end
  18.  
  19.   alias testtee_move_straight move_straight
  20.   def move_straight(d, turn_ok = true)
  21.     testtee_move_straight(d, turn_ok)
  22.     check_event_trigger_touch(@x, @y)
  23.   end
  24.  
  25. end
  26.  
  27. class Game_Player < Game_Character
  28.  
  29.   def start_map_event(x, y, triggers, normal)
  30.     return if $game_map.interpreter.running?
  31.     $game_map.events_xy(x, y).each do |event|
  32.       if event.trigger_in?(triggers)
  33.         event.start
  34.       end
  35.     end
  36.   end
  37.  
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement