neonblack

Confused Walk Snippet

Aug 17th, 2012
144
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data