Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # DEFINA O ID DA SWITCH, QUE, QUANDO LIGADA, IRÁ
- # FAZER O PLAYER IMPOSSÍVEL DE SE MOVER, ENQUANTO ESTIVER ROLANDO
- # UMA MENSAGEM
- Vorum::SMF_MES = 1
- class Game_Player < Game_Character
- def update
- # Memorizar, se estiver movendo ou não, nas variáveis locais
- last_moving = moving?
- # Se estiver movendo, um evento ocorrendo, uma rota pré-determinada, ou
- # se estiver exibindo uma mensagem
- # Mostrar tudo como se não estivessem ocorrendo
- if ($game_temp.message_window_showing == true)
- windowShowing = ($game_switches[Vorum::SMF_MES])
- else
- windowShowing = false
- end
- #$game_system.map_interpreter.running?
- #
- unless moving? or
- @move_route_forcing or windowShowing
- # Mover o Jogador na direção que o direcional for pressionado
- case Input.dir4
- when 2
- move_down
- when 4
- move_left
- when 6
- move_right
- when 8
- move_up
- end
- end
- # Memorizar as coordenadas nas variáveis locais
- last_real_x = @real_x
- last_real_y = @real_y
- super
- # Se o Herói for movido para baixo e tenha ficado abaixo do centro da tela
- if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
- # Rolar o mapa para baixo
- $game_map.scroll_down(@real_y - last_real_y)
- end
- # Se o Herói for movido para a esquerda e tenha ficado a esquerda do centro
- # da tela
- if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
- # Rolar o mapa para a esquerda
- $game_map.scroll_left(last_real_x - @real_x)
- end
- # Se o Herói for movido para a direita e tenha ficado a direita do centro da
- # tela
- if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
- # Rolar o mapa para a direita
- $game_map.scroll_right(@real_x - last_real_x)
- end
- # Se o Herói for movido para cima e tenha ficado acima do centro da tela
- if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
- # rolar o mapa para cima
- $game_map.scroll_up(last_real_y - @real_y)
- end
- # Se não estiver movendo
- unless moving?
- # Se o jogador estava se movendo
- if last_moving
- # Se a determinante de incialização for por toque ou mesma posição
- result = check_event_trigger_here([1,2])
- # Se o Evento que foi iniciado não existir
- if result == false
- # Desconsiderar se o Modo de Depuração estiver ON e a tecla Ctrl
- # pressionada
- unless $DEBUG and Input.press?(Input::CTRL)
- # Diminuir 1 do contador de encontros
- if @encounter_count > 0
- @encounter_count -= 1
- end
- end
- end
- end
- # Se o botão C for pressionado
- if Input.trigger?(Input::C)
- # Determinantes de mesma posição e na frente do Evento
- check_event_trigger_here([0])
- check_event_trigger_there([0,1,2])
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment