Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # LM² - Persistent XY Variables - Variáveis XY Persistentes
- # 26/02/18 - by LeonM²
- # En:
- # Set Player X and Y to chosen variables
- # Just change the variables index on the module bellow
- # Two extra variables to put real X and Y (*32)
- # Pt-Br:
- # Coloca a posição X e Y do jogador nas variáveis selecionadas
- # Apenas mude as o índice das variáveis no módulo abaixo
- # Há duas variáveis extras com o valor real X e Y
- module LMM
- # X Variable index || Índice da variável X
- XV = 1
- # Y Variable index || Índice da variável Y
- YV = 2
- # Toggle Real X and Y || Ativar valor real X e Y
- RXY = true
- # Real X Variable index || Índice da variável real X
- RXV = 3
- # Real Y Variable index || Índice da variável real Y
- RYV = 4
- # Real X and Y Multiplier || Multiplicador do X e Y Real
- # (X and Y * value bellow) || (X e Y * valor abaixo)
- RM = 32
- end
- class Game_Player < Game_Character
- alias lmm_update_gp update
- def update
- lmm_update_gp
- $game_variables[LMM::XV] = @x if $game_variables[LMM::XV] != @x
- $game_variables[LMM::YV] = @y if $game_variables[LMM::YV] != @y
- if LMM::RXY
- mx = @x * LMM::RM
- $game_variables[LMM::RXV] = mx if $game_variables[LMM::RXV] != mx
- my = @y * LMM::RM
- $game_variables[LMM::RYV] = my if $game_variables[LMM::RYV] != my
- end
- end
- alias lmm_moveto_gp moveto
- def moveto(x, y)
- lmm_moveto_gp(x, y)
- $game_variables[LMM::XV] = x
- $game_variables[LMM::YV] = y
- if LMM::RXY
- mx = x * LMM::RM
- $game_variables[LMM::RXV] = mx
- my = y * LMM::RM
- $game_variables[LMM::RYV] = my
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement