Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- # [XP/VX/VX-A] Critical HP Warning
- # Version: 1.20
- # Author : LiTTleDRAgo
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- VX = defined?(Window_BattleMessage)
- VXA = defined?(Window_KeyItem)
- module LiTTleDRAgo
- LOWHP = 25 #% # Persentase HP Untuk mengaktifkan Warning
- SE = "057-Wrong01" # Sound Effect pas warning
- FLASH = true # Nyalain flash apa ngga pas warning
- LOOP = 35 # Loop tiap warningnya
- end
- #==============================================================================
- # ** Game_Player
- #------------------------------------------------------------------------------
- # This class handles maps. It includes event starting determinants and map
- # scrolling functions. The instance of this class is referenced by $game_map.
- #==============================================================================
- class Game_Player < Game_Character
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- alias_method :drago_hp_warn_update, :update
- def update
- @warn = @warn.nil? || @warn > LiTTleDRAgo::LOOP ? 0 : @warn + 1
- game_party = VX || VXA ? $game_party.members : $game_party.actors
- screen = VX || VXA ? $game_map.screen : $game_screen
- (0...game_party.size).each {|i| actor = game_party[i]
- cond = actor.hp * 100 / (VXA ? actor.mhp : actor.maxhp)
- if cond <= LiTTleDRAgo::LOWHP && @warn == 1
- Audio.se_play("Audio/SE/#{LiTTleDRAgo::SE}" ,100,100) rescue nil
- screen.start_flash(Color.new(255,50,0,128), 10) if LiTTleDRAgo::FLASH
- end }
- drago_hp_warn_update
- end
- end
- #==============================================================================
- # ** Scene_Battle
- #------------------------------------------------------------------------------
- # This class performs battle screen processing.
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- alias_method :drago_hp_warn_update, :update
- def update
- @warn = @warn.nil? || @warn > LiTTleDRAgo::LOOP ? 0 : @warn + 1
- game_party = VX || VXA ? $game_party.members : $game_party.actors
- screen = VX || VXA ? $game_troop.screen : $game_screen
- (0...game_party.size).each {|i| actor = game_party[i]
- cond = actor.hp * 100 / (VXA ? actor.mhp : actor.maxhp)
- if cond <= LiTTleDRAgo::LOWHP && @warn == 1 && actor.hp > 0
- Audio.se_play("Audio/SE/#{LiTTleDRAgo::SE}" ,100,100) rescue nil
- screen.start_flash(Color.new(255,50,0,128), 10) if LiTTleDRAgo::FLASH
- end }
- drago_hp_warn_update
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement