Advertisement
LiTTleDRAgo

[RGSS] MMW Blizz ABS Compatibility Patch

Feb 11th, 2012
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.45 KB | None | 0 0
  1. #============================================================================
  2. # BlizzABS::Controller
  3. #----------------------------------------------------------------------------
  4. #  This class is a special controller that controls the party leader.  Some
  5. #  input is processed instantly, while some is converted into commands to be
  6. #  given to the player character.
  7. #============================================================================
  8. # PLACE BELOW BLIZZ ABS
  9. if $BlizzABS
  10.   class BlizzABS::Controller
  11.      
  12.     include BlizzABS
  13.     #--------------------------------------------------------------------------
  14.     # update_control
  15.     #--------------------------------------------------------------------------
  16.     def update_control
  17.       pix = $BlizzABS.pixel
  18.       player.move_speed = player.normal_speed
  19.       player.character_name = player.character_name_org
  20.       unless $game_system.map_interpreter.running? ||
  21.           player.move_route_forcing || $game_temp.message_window_showing
  22.         if $game_system.running_button && Input.press?(Input::Run)
  23.           player.move_speed = Config::RUN_SPEED
  24.         elsif $game_system.sneaking_button && Input.press?(Input::Sneak) ||
  25.             Config::SNEAK_SPEED > 0 && Config::SNEAK_ON_CHARGE && player.charging?
  26.           player.move_speed = Config::SNEAK_SPEED
  27.         end
  28.       end
  29.       if player.battler != nil && ($game_system.select_button &&
  30.           Input.trigger?(Input::Select) || player.battler.dead?)
  31.         switch_leader
  32.       end
  33.       player.sprite_animation_setup
  34.       player.update_action
  35.       #--------------------------------------------------------------------
  36.       if $game_system.blizzabs_can_move?        # Drago edit
  37.       #--------------------------------------------------------------------
  38.         input = (player.restriction == 3 ? 10 - Input.dir4 : Input.dir4)
  39.         case input
  40.         when 2 then player.turn_down
  41.         when 4 then player.turn_left
  42.         when 6 then player.turn_right
  43.         when 8 then player.turn_up
  44.         end
  45.         player.update_attacked
  46.         return nil
  47.       end
  48.       player.update_attacked
  49.       if player.in_action > 0
  50.         player.in_action -= 1 if player.in_action > 0
  51.         return [player.moving?, player.real_x, player.real_y]
  52.       end
  53.       #--------------------------------------------------------------------
  54.       unless $game_system.blizzabs_can_move?(1)  # Drago edit
  55.       #--------------------------------------------------------------------
  56.         if $game_system.jumping_button && Input.trigger?(Input::Jump) &&
  57.             !player.jumping? && player.restriction < 4
  58.           @memory_jump = true
  59.         end
  60.         unless player.moving?
  61.           range = Config::JUMPING
  62.           if range > 0 && !player.jumping? && @memory_jump
  63.             if Config::RUN_SPEED > 0 || Config::SNEAK_SPEED > 0
  64.               dplus = player.move_speed - player.normal_speed
  65.             else
  66.               dplus = 0
  67.             end
  68.             direction = $game_system._8_way ? Input.dir8 : Input.dir4
  69.             x, y = Cache::DirOffsets[direction]
  70.             player.jump(x*range + x*dplus, y*range + y*dplus, direction)
  71.           elsif !player.jumping?
  72.             move($game_system._8_way ? Input.dir8 : Input.dir4)
  73.             player.idle_allowed = !player.moving?
  74.           end
  75.           @memory_jump = false
  76.         end
  77.       end
  78.       return [player.moving?, player.real_x, player.real_y]
  79.     end
  80.   end
  81. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement