Advertisement
LeonMMS

Untitled

Apr 16th, 2021
1,435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.68 KB | None | 0 0
  1.   def handle_player_buff(buffer)
  2.     param_id = buffer.read_byte
  3.     buff_level = buffer.read_short
  4.     if buff_level == 1
  5.       $game_actors[1].add_buff(param_id, 0)
  6.     elsif buff_level == -1
  7.       $game_actors[1].add_debuff(param_id, 0)
  8.     else
  9.       $game_actors[1].remove_buff(param_id)
  10.     end
  11.     if $windows.has_key?(:states)
  12.       $windows[:states].visible = $game_actors[1].result.status_affected?
  13.       $windows[:states].refresh if $windows[:states].visible
  14.     end
  15.     # Se alterou o HP ou o MP máximo
  16.     $windows[:hud].refresh if param_id < 2 && $windows.has_key?(:hud)
  17.     $windows[:status].refresh if $windows.has_key?(:status) && $windows[:status].visible
  18.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement