Advertisement
neonblack

Confused Walk Snippet

Aug 17th, 2012
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.52 KB | None | 0 0
  1. module CP
  2. module CHAOS
  3.  
  4. STATES =[5]
  5.  
  6. end
  7. end
  8.  
  9. class Game_Player
  10.   def move_by_input
  11.     return if !movable? || $game_map.interpreter.running?
  12.     return unless Input.dir4 > 0
  13.     i = chaos_state? ? (rand(4) + 1) * 2 : Input.dir4
  14.     move_straight(i)
  15.   end
  16.  
  17.   def chaos_state?
  18.     return false if $game_party.members.empty?
  19.     return true if $game_party.members[0].has_chaos?
  20.     return false
  21.   end
  22. end
  23.  
  24. class Game_BattlerBase
  25.   def has_chaos?
  26.     @states.any? {|i| CP::CHAOS::STATES.include?(i)}
  27.   end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement