#=============================================================================== # # Yanfly Engine RD - On Screen Status # Last Date Updated: 2009.05.24 # Level: Easy # # This is more or less my own version of KGC's OnScreenStatus script. This is a # much more thin version of it and is actually built quite differently since # KGC's OnScreenStatus actually doesn't refresh all actors at once. This script # is only one line thick, displays only the actors' sprites, HP, and MP. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.05.24 - Started script. #=============================================================================== # Instructions #=============================================================================== # # For the most part, this script is plug and play. # #=============================================================================== # # Compatibility # - Incompatible: KGC OnScreenStatus (duh) # - Works With: Yanfly Custom Skill Effects, Animation Fix. # - Alias: Scene_Battle: start, terminate, update_basic, process_action, # - Alias: Scene_Battle: turn_end, execute_action_skill, display_hp/mp_damage # #=============================================================================== $imported = {} if $imported == nil $imported["OnScreenStatus"] = true module YE module BATTLE module DISPLAY # This adjusts where the window appears. Value indicates y position # on the game screen. 0 for top. 232 for right above the battle message. OSS_LOCATION = 0 # This adjusts the sprite's y offset for the on screen status window. # The higher the value, the lower the sprite. OSS_SPRITE_OFFSET = 32 # This adjusts the font size used to display HP and MP. OSS_FONT_SIZE = 14 end end end #=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #=============================================================================== #=============================================================================== # Window_OnScreenBattleStatus #=============================================================================== class Window_OnScreenBattleStatus < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize y = YE::BATTLE::DISPLAY::OSS_LOCATION super(0, y, 544, 56) self.openness = 0 refresh end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.size = YE::BATTLE::DISPLAY::OSS_FONT_SIZE sw = self.width - 32 ix = 124 dx = (sw - ($game_party.members.size * (ix))) / 2 for actor in $game_party.members draw_actor_info(actor, dx) dx += ix end dx = (sw - ($game_party.members.size * (ix))) / 2 for actor in $game_party.members draw_actor_graphic(actor, dx + 12, YE::BATTLE::DISPLAY::OSS_SPRITE_OFFSET) dx += ix end end #-------------------------------------------------------------------------- # draw_actor #-------------------------------------------------------------------------- def draw_actor_info(actor, dx) draw_actor_hp_gauge(actor, dx+26, -12, 90) draw_actor_mp_gauge(actor, dx+26, 1, 90) self.contents.font.color = system_color self.contents.draw_text(dx+26, -6, 40, 24, Vocab::hp_a, 0) self.contents.draw_text(dx+26, 6, 40, 24, Vocab::mp_a, 0) self.contents.font.color = hp_color(actor) self.contents.draw_text(dx+66, -6, 50, 24, actor.hp, 2) self.contents.font.color = mp_color(actor) self.contents.draw_text(dx+66, 6, 50, 24, actor.mp, 2) end end # Window_OnScreenBattleStatus #============================================================================== # Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # alias start #-------------------------------------------------------------------------- alias start_oss start unless $@ def start @onscreen_status_window = Window_OnScreenBattleStatus.new @onscreen_status_refresh_request = false start_oss end #-------------------------------------------------------------------------- # alias terminate #-------------------------------------------------------------------------- alias terminate_oss terminate unless $@ def terminate @onscreen_status_window.dispose terminate_oss end #-------------------------------------------------------------------------- # alias update_basic #-------------------------------------------------------------------------- alias update_basic_oss update_basic unless $@ def update_basic(main = false) update_basic_oss(main) if $game_troop.interpreter.running? @onscreen_status_window.close @onscreen_status_refresh_request = true end @onscreen_status_window.update end #-------------------------------------------------------------------------- # alias start_main #-------------------------------------------------------------------------- alias start_main_oss start_main unless $@ def start_main @onscreen_status_window.refresh start_main_oss end #-------------------------------------------------------------------------- # alias process action #-------------------------------------------------------------------------- alias process_action_oss process_action unless $@ def process_action if @onscreen_status_refresh_request @onscreen_status_window.refresh @onscreen_status_refresh_request = false end @onscreen_status_window.open process_action_oss end #-------------------------------------------------------------------------- # alias turn end #-------------------------------------------------------------------------- alias turn_end_oss turn_end unless $@ def turn_end @onscreen_status_window.close turn_end_oss end #-------------------------------------------------------------------------- # alias execute action skill #-------------------------------------------------------------------------- alias execute_action_skill_oss execute_action_skill unless $@ def execute_action_skill last_mp = @active_battler.mp skill = @active_battler.action.skill @active_battler.mp -= @active_battler.calc_mp_cost(skill) update_onscreen_status(@active_battler) @active_battler.mp = last_mp execute_action_skill_oss end #-------------------------------------------------------------------------- # update oncscreen status #-------------------------------------------------------------------------- def update_onscreen_status(target) if target.is_a?(Game_Actor) @onscreen_status_window.refresh end end #-------------------------------------------------------------------------- # alias display_hp_damage #-------------------------------------------------------------------------- alias display_hp_damage_oss display_hp_damage unless $@ def display_hp_damage(target, obj = nil) update_onscreen_status(target) if target.absorbed update_onscreen_status(@active_battler) end display_hp_damage_oss(target, obj) end #-------------------------------------------------------------------------- # alias display mp damage #-------------------------------------------------------------------------- alias display_mp_damage_oss display_mp_damage unless $@ def display_mp_damage(target, obj = nil) update_onscreen_status(target) if target.absorbed update_onscreen_status(@active_battler) end display_mp_damage_oss(target, obj) end end #=============================================================================== # # END OF FILE # #===============================================================================