Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This is a private script that emulates Rm2k3 Horizontal and Vertical movement.
- class Game_Event < Game_Character
- def note
- begin
- data = []
- @page.list.each do |item|
- next unless item && (item.code == 108 || item.code == 408)
- data.push(item.parameters[0])
- end
- return data
- rescue
- return []
- end
- end
- def patrol_hor?; note.include?("<patrol hor>"); end
- def patrol_ver?; note.include?("<patrol ver>"); end
- alias yami_patrol_event_update_self_movement update_self_movement
- def update_self_movement
- yami_patrol_event_update_self_movement
- if @stop_count > stop_count_threshold
- if patrol_hor?
- set_direction([6,4].sample) unless [6,4].include?(@direction)
- set_direction(4) if @direction == 6 && !passable?(@x, @y, 6)
- set_direction(6) if @direction == 4 && !passable?(@x, @y, 4)
- move_forward
- return
- end
- #---
- if patrol_ver?
- set_direction([8,2].sample) unless [8,2].include?(@direction)
- set_direction(2) if @direction == 8 && !passable?(@x, @y, 8)
- set_direction(8) if @direction == 2 && !passable?(@x, @y, 2)
- move_forward
- return
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement