RMXP

대쉬 스크립트 mp 다떨어지면 못쓰게하는법

by 놀다가 posted Jul 09, 2011
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄
Extra Form

Con_sp = 1
module DASH 
  DASH_BUTTON = Input::C 
  NORMAL_SPEED = 4 
  DASH_SPEED = 5 
  HIGH_SPEED = 5.5 
  HIGH_DASH = true 
  HIGH_TIME = 30 
  NOT_SWITCH = 1 
  HIGH_NOT_SWITCH = 2
end
class Game_Player < Game_Character 
  def update
    @dash = 0        if @dash == nil 
    last_moving = moving? 
    unless moving? or $game_system.map_interpreter.running? or
          @move_route_forcing or $game_temp.message_window_showing
      if $game_switches[DASH::NOT_SWITCH] == false
        if Input.press?(DASH::DASH_BUTTON)
          $game_party.actors[0].sp -= Con_sp
          if @move_speed != DASH::DASH_SPEED
            @move_speed = DASH::DASH_SPEED
          end
          if $game_switches[DASH::HIGH_NOT_SWITCH] == false
            @dash += 1
            if @dash >= DASH::HIGH_TIME
              if @move_speed != DASH::HIGH_SPEED
                @move_speed = DASH::HIGH_SPEED
              end
            end
          end
        else
          if @move_speed != DASH::NORMAL_SPEED
            @move_speed = DASH::NORMAL_SPEED
          end
          @dash = 0
        end
      else
        if @move_speed != DASH::NORMAL_SPEED
          @move_speed = DASH::NORMAL_SPEED
        end
      end 
      case Input.dir4
      when 2
        move_down
      when 4
        move_left
      when 6
        move_right
      when 8
        move_up
      end
    end 
    last_real_x = @real_x
    last_real_y = @real_y
    super 
     if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y  
      $game_map.scroll_down(@real_y - last_real_y)
    end 
      if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X 
      $game_map.scroll_left(last_real_x - @real_x)
    end 

    if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X 
      $game_map.scroll_right(@real_x - last_real_x)
    end 
     if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y 

      $game_map.scroll_up(last_real_y - @real_y)
    end 
    unless moving?  
      if last_moving 

        result = check_event_trigger_here([1,2]) 
        if result == false 
          unless $DEBUG and Input.press?(Input::CTRL) 
            if @encounter_count > 0
              @encounter_count -= 1
            end
          end
        end
      end 
      if Input.trigger?(Input::C) 
        check_event_trigger_here([0])
        check_event_trigger_there([0,1,2])
      end
    end
  end
end
if

-------------------------------------------------------------------------------------

 

이 스크립튼데 mp 다는거 까진햇는데 mp 다깍이고 비활성화/ 활성화 하는방법좀 ..