Guest Access
Administrator
Administrator
![Administrator Administrator](https://2img.net/u/3113/12/83/19/album/g101_p11.gif)
Administrator
profile
@Kimono ~ this one's for you ^,^
thanks again for sharing those ABS sprites!
![RMXP + XAS(3.91) = MOG VS HUD(edit) Vs_hud11](https://i.servimg.com/u/f23/14/43/85/81/vs_hud11.jpg)
demo: media fire
XAS 3.91 w/ MOG VS HUD (13.5mb)
the demo will continue to get smaller as this will not require an RTP.
*still this script could use a few more touches
-when enemy dies ~ their picture is still in the HUD and doesn't disappear.
G@MeF@Ce
![]() | ![]() | |
![]() | ||
![]() | ![]() |
![Administrator Administrator](https://2img.net/u/3113/12/83/19/album/g101_p11.gif)
profile
![](https://2img.net/u/3113/12/83/19/album/quote_13.png)
thanks again for sharing those ABS sprites!
MOG VS HUD 1.1
for XAS 3.91
for XAS 3.91
![RMXP + XAS(3.91) = MOG VS HUD(edit) Vs_hud11](https://i.servimg.com/u/f23/14/43/85/81/vs_hud11.jpg)
- Spoiler:
- Code:
#_______________________________________________________________________________
# MOG - VS HUD 1.1 = edited for XAS 3.91
#_______________________________________________________________________________
# 1.0 By Moghunter
# http://www.atelier-rgss.com
#
# 1.1 by G@MeF@Ce
# gameface101.com
#_______________________________________________________________________________
# - Apresenta uma HUD animada do personagem e do oponente,
# estilo jogos de luta.
#
# ARQUIVOS NECESSÁRIOS
#
# VS_EHP_NUMBER.png
# VS_Fire.png
# VS_HP_METER.png
# VS_HP_NUMBER.png
# VS_Layout.png
# VS_SP_METER.png
# VS_Time_Number.png
#
# Deixe as imagens na pasta Windowskins
#
#_______________________________________________________________________________
# FACES
#_______________________________________________________________________________
# - Deixe as imagens das faces na pasta Windowskins
#
# SELEÇÃO AUTOMATICA DE FACES
# - Sempre que você acertar o inimigo a face mudará
# automaticamente, desde que você tenha a imagem da face na
# pasta windowskin.
# - Nomeie as faces da seguinte forma.
#
# Nome do Battler + "_Face"
#
# Exemplo
#
# Slime_Face.png
# Hero_Face.png
#
# DEFININDO ATRAVÉS DO EVENTO.
#
# $game_temp.enemy_face = "Name"
# $game_temp.enemy_maxhp = value
# $game_temp.enemy_maxsp = value
# $game_temp.enemy_hp = value
# $game_temp.enemy_sp = value
#
#_______________________________________________________________________________
module MOG
#Posição geral da HUD
VS_HUD_X = 0
VS_HUD_Y = 0
#Posição do layout
VS_LAYOUT_X = 0
VS_LAYOUT_Y = 0
#Posição do medidor de HP do herói.
VS_HP_X = 81
VS_HP_Y = 16
#Posição do numero de HP do herói.
VS_HP_NUMBER_X = 70
VS_HP_NUMBER_Y = -10
#Posição do medidor de SP do herói.
VS_SP_X = 87
VS_SP_Y = 37
#Posição da Face do herói.
VS_FACE_ACTOR_X = 0
VS_FACE_ACTOR_Y = 0
#Posição do medidor de HP do inimigo.
VS_EHP_X = -23
VS_EHP_Y = 16
#Posição do numero de HP do inimigo.
VS_EHP_NUMBER_X = 510
VS_EHP_NUMBER_Y = -10
#Posição do medidor de SP do inimigo.
VS_ESP_X = 400
VS_ESP_Y = 37
#Posição da Face do inimigo.
VS_FACE_ENEMY_X = 515
VS_FACE_ENEMY_Y = 0
#Posição da imagem do fogo.
VS_FIRE_X = 290
VS_FIRE_Y = 0
#Posição do numero de tempo.
VS_TIME_NUMBER_X = 280
VS_TIME_NUMBER_Y = 0
#Desativar o sistema de contagem original.
VS_ORIGINAL_TIME_DISABLE = true
#Swith que desativa a HUD.
VS_DISABLE_SWITCH = 4
end
#==============================================================================
# Game_Temp
#==============================================================================
class Game_Temp
attr_accessor :enemy_hp
attr_accessor :enemy_maxhp
attr_accessor :enemy_oldhp
attr_accessor :enemy_sp
attr_accessor :enemy_maxsp
attr_accessor :enemy_oldsp
attr_accessor :enemy_name
attr_accessor :enemy_hud_x
attr_accessor :enemy_hud_y
attr_accessor :enemy_hud_opa
attr_accessor :enemy_hud_shake
attr_accessor :enemy_info_ref
attr_accessor :enemy_refresh_old
attr_accessor :enemy_number_refresh
attr_accessor :enemy_face
attr_accessor :actor_face
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------
alias vs_hud_initialize initialize
def initialize
vs_hud_initialize
@enemy_hp = 0
@enemy_maxhp = 1
@enemy_oldhp = 0
@enemy_sp = 0
@enemy_maxsp = 1
@enemy_oldsp = 0
@enemy_name = ""
@enemy_hud_x = 0
@enemy_hud_y = 0
@enemy_hud_opa = 0
@enemy_hud_shake = 0
@enemy_refresh_old = false
@enemy_number_refresh = false
@enemy_info_ref = 0
@enemy_face = ""
$xas_enemy_boss_wind_x = 190
$xas_enemy_boss_wind_y = 30
end
end
#==============================================================================
# XAS_ACTION
#==============================================================================
module XAS_ACTION
#--------------------------------------------------------------------------
# * Enough Sp Ct? = convert!
#--------------------------------------------------------------------------
#alias vs_enough_sp_ct? enough_sp_ct?
def vs_enough_sp_ct?(action_id,sp_cost)
# vs_enough_sp_ct?(action_id,sp_cost)
if self.battler.is_a?(Game_Enemy) and not
ENEMY_ELEMENT::ENEMY_OBJECT.include?(self.battler.id)
$game_temp.enemy_maxsp = self.battler.maxsp
return
end
end
#--------------------------------------------------------------------------
# * Shoot Bullet
#--------------------------------------------------------------------------
alias vs_shoot_bullet shoot_bullet
def shoot_bullet(action_id)
vs_shoot_bullet(action_id)
if self.battler.is_a?(Game_Enemy) and not
ENEMY_ELEMENT::ENEMY_OBJECT.include?(self.battler.id)
$game_temp.enemy_sp = self.battler.sp
end
end
end
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Skill Effect
#--------------------------------------------------------------------------
alias vs_skill_effect skill_effect
def skill_effect(user, skill)
vs_skill_effect(user, skill)
if self.is_a?(Game_Enemy) and not
ENEMY_ELEMENT::ENEMY_ITEM.include?(self.id)
$game_temp.enemy_sp = self.sp
$game_temp.enemy_maxsp = self.maxsp
$game_temp.enemy_hp = self.hp
$game_temp.enemy_maxhp = self.maxhp
$game_temp.enemy_face = self.name + "_face"
end
end
end
#==============================================================================
# Sprite_Timer
#==============================================================================
class Sprite_Timer < Sprite
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
alias vs_initialize initialize
def initialize
vs_initialize
if MOG::VS_ORIGINAL_TIME_DISABLE == true
self.visible = false
self.opacity = 0
end
end
end
#==============================================================================
# Active_Hud
#==============================================================================
class VS_Hud < Sprite
include MOG
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize(viewport)
super(viewport)
@actor = $game_party.actors[0]
return if @actor == nil
$game_switches[MOG::BOSS_INFO_SWITCH_ID] = true
@hp = @actor.hp
@sp = @actor.sp
@hp_old = @actor.hp
@hp_ref = @hp_old
@ehp = $game_temp.enemy_hp
@emaxhp = $game_temp.enemy_maxhp
@ehp_old = @ehp
@ehp_ref = @ehp_old
# Layout -------------------------------------------------------------------
@layout_image = RPG::Cache.windowskin("VS_Layout")
@layout_bitmap = Bitmap.new(@layout_image.width,@layout_image.height)
@layout_sprite = Sprite.new
@layout_sprite.bitmap = @layout_bitmap
@layout_src_rect_back = Rect.new(0, 0,@layout_image.width, @layout_image.height)
@layout_bitmap.blt(0,0, @layout_image, @layout_src_rect_back)
@layout_sprite.z = 5001
@layout_sprite.x = VS_HUD_X + VS_LAYOUT_X
@layout_sprite.y = VS_HUD_Y + VS_LAYOUT_Y
# Actor Face -------------------------------------------------------------------
@aface_name = @actor.name + "_Face"
@aface = Sprite.new
@aface.bitmap = Bitmap.new(130,80)
@aface.z = 5009
@aface.x = VS_HUD_X + VS_FACE_ACTOR_X
@aface.y = VS_HUD_Y + VS_FACE_ACTOR_Y
aface_update
# HP Meter Player --------------------------------------------------
@hp_flow = 0
@hp_damage_flow = 0
@hp_image = RPG::Cache.windowskin("VS_HP_Meter")
@hp_bitmap = Bitmap.new(@hp_image.width,@hp_image.height)
@hp_range = @hp_image.width / 3
@hp_width = @hp_range * @actor.hp / @actor.maxhp
@hp_height = @hp_image.height / 2
@hp_width_old = @hp_width
@hp_src_rect = Rect.new(@hp_range, 0, @hp_width, @hp_height)
@hp_bitmap.blt(0,0, @hp_image, @hp_src_rect)
@hp_sprite = Sprite.new
@hp_sprite.bitmap = @hp_bitmap
@hp_sprite.z = 5002
@hp_sprite.x = VS_HUD_X + VS_HP_X
@hp_sprite.y = VS_HUD_Y + VS_HP_Y
hp_flow_update
# HP ---------------------------------------------------------------------
@hp_number_image = RPG::Cache.windowskin("VS_HP_Number")
@hp_number_bitmap = Bitmap.new(@hp_number_image.width,@hp_number_image.height)
@hp_number_sprite = Sprite.new
@hp_number_sprite.bitmap = @hp_number_bitmap
@hp_number_sprite.z = 5004
@hp_number_sprite.x = VS_HUD_X + VS_HP_NUMBER_X
@hp_number_sprite.y = VS_HUD_Y + VS_HP_NUMBER_Y
@im_cw = @hp_number_image.width / 10
@im_ch = @hp_number_image.height
hp_number_refresh
# MP Meter ---------------------------------------------------------------------
@sp_flow = 0
@sp_damage_flow = 0
@sp_image = RPG::Cache.windowskin("VS_SP_Meter")
@sp_bitmap = Bitmap.new(@sp_image.width,@sp_image.height)
@sp_width = @sp_image.width * @actor.sp / @actor.maxsp
@sp_height = @sp_image.height / 3
@sp_range = @sp_height
@sp_width_old = @sp_width
@sp_src_rect = Rect.new(0, @sp_range, @sp_width, @sp_height)
@sp_bitmap.blt(0,0, @sp_image, @sp_src_rect)
@sp_sprite = Sprite.new
@sp_sprite.bitmap = @sp_bitmap
@sp_sprite.z = 5002
@sp_sprite.x = VS_HUD_X + VS_SP_X
@sp_sprite.y = VS_HUD_Y + VS_SP_Y
sp_flow_update
# Enemy Face -------------------------------------------------------------------
@eface = Sprite.new
@eface.bitmap = Bitmap.new(130,80)
@eface.z = 5009
@eface.x = VS_HUD_X + VS_FACE_ENEMY_X
@eface.y = VS_HUD_Y + VS_FACE_ENEMY_Y
eface_update
# HP Meter Player --------------------------------------------------
@ehp_flow = 0
@ehp_damage_flow = 0
@ehp_image = RPG::Cache.windowskin("VS_HP_Meter")
@ehp_bitmap = Bitmap.new(@ehp_image.width,@ehp_image.height)
@ehp_range = @ehp_image.width / 3
@ehp_width = @ehp_range * $game_temp.enemy_hp / $game_temp.enemy_maxhp
@ehp_height = @ehp_image.height / 2
@ehp_width_old = @ehp_width
@ehp_src_rect = Rect.new(@ehp_range, 0, @ehp_width, @ehp_height)
@ehp_bitmap.blt(0,0, @ehp_image, @ehp_src_rect)
@ehp_sprite = Sprite.new
@ehp_sprite.bitmap = @ehp_bitmap
@ehp_sprite.z = 5002
@ehp_sprite.mirror = true
@ehp_sprite.x = VS_HUD_X + VS_EHP_X
@ehp_sprite.y = VS_HUD_Y + VS_EHP_Y
ehp_flow_update
# HP ---------------------------------------------------------------------
@ehp_number_image = RPG::Cache.windowskin("VS_HP_Number")
@ehp_number_bitmap = Bitmap.new(@ehp_number_image.width,@ehp_number_image.height)
@ehp_number_sprite = Sprite.new
@ehp_number_sprite.bitmap = @ehp_number_bitmap
@ehp_number_sprite.z = 5004
@ehp_number_sprite.mirror = false
@ehp_number_sprite.x = VS_HUD_X + VS_EHP_NUMBER_X
@ehp_number_sprite.y = VS_HUD_Y + VS_EHP_NUMBER_Y
@eim_cw = @ehp_number_image.width / 10
@eim_ch = @ehp_number_image.height
ehp_number_refresh
# MP Meter ---------------------------------------------------------------------
@esp_flow = 0
@esp_damage_flow = 0
@esp_image = RPG::Cache.windowskin("VS_SP_Meter")
@esp_bitmap = Bitmap.new(@esp_image.width,@esp_image.height)
@esp_width = @esp_image.width * $game_temp.enemy_sp / $game_temp.enemy_maxsp
@esp_height = @esp_image.height / 3
@esp_range = @esp_height
@esp_width_old = @esp_width
@esp_src_rect = Rect.new(0, @esp_range, @esp_width, @esp_height)
@esp_bitmap.blt(0,0, @esp_image, @esp_src_rect)
@esp_sprite = Sprite.new
@esp_sprite.bitmap = @esp_bitmap
@esp_sprite.z = 5002
@esp_sprite.mirror = true
@esp_sprite.x = VS_HUD_X + VS_ESP_X
@esp_sprite.y = VS_HUD_Y + VS_ESP_Y
esp_flow_update
#Fire
@fire_flow = 0
@fire_flow_speed = 0
@fire_image = RPG::Cache.windowskin("VS_Fire")
@fire_bitmap = Bitmap.new(@fire_image.width,@fire_image.height)
@fire_width = @fire_image.width / 4
@fire_src_rect_back = Rect.new(0, 0,@fire_width, @fire_image.height)
@fire_bitmap.blt(0,0, @fire_image, @fire_src_rect_back)
@fire_sprite = Sprite.new
@fire_sprite.bitmap = @fire_bitmap
@fire_sprite.z = 5003
@fire_sprite.x = VS_HUD_X + VS_FIRE_X
@fire_sprite.y = VS_HUD_Y + VS_FIRE_Y
fire_update
# HP ---------------------------------------------------------------------
@time_number_image = RPG::Cache.windowskin("VS_Time_Number")
@time_number_bitmap = Bitmap.new(@time_number_image.width,@time_number_image.height * 2)
@time_number_sprite = Sprite.new
@time_number_sprite.bitmap = @time_number_bitmap
@time_number_sprite.z = 5004
@time_number_sprite.x = VS_HUD_X + VS_TIME_NUMBER_X
@time_number_sprite.y = VS_HUD_Y + VS_TIME_NUMBER_Y
@time_cw = @time_number_image.width / 10
@time_ch = @time_number_image.height
@time_src_rect = Rect.new(@time_cw,0, @time_cw, @time_ch)
time_refresh
visible_update
hp_number_refresh
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
return if @actor == nil
#Layout Dispose
@layout_sprite.bitmap.dispose
@layout_sprite.bitmap = nil
@layout_sprite.dispose
@layout_sprite = nil
@layout_bitmap.dispose
@layout_bitmap = nil
#actor Dispose
@aface.bitmap.dispose
@aface.bitmap = nil
@aface.dispose
@aface = nil
#HP Meter Dispose
@hp_sprite.bitmap.dispose
@hp_sprite.bitmap = nil
@hp_sprite.dispose
@hp_sprite = nil
@hp_bitmap.dispose
@hp_bitmap = nil
#Hp Number Dispose
@hp_number_sprite.bitmap.dispose
@hp_number_sprite.bitmap = nil
@hp_number_sprite.dispose
@hp_number_sprite = nil
@hp_number_bitmap.dispose
@hp_number_bitmap = nil
#SP Meter Dispose
@sp_sprite.bitmap.dispose
@sp_sprite.bitmap = nil
@sp_sprite.dispose
@sp_sprite = nil
@sp_bitmap.dispose
@sp_bitmap = nil
#Enemy Dispose
@eface.bitmap.dispose
@eface.bitmap = nil
@eface.dispose
@eface = nil
#Enemy HP Meter Dispose
@ehp_sprite.bitmap.dispose
@ehp_sprite.bitmap = nil
@ehp_sprite.dispose
@ehp_sprite = nil
@ehp_bitmap.dispose
@ehp_bitmap = nil
#Hp Number Dispose
@ehp_number_sprite.bitmap.dispose
@ehp_number_sprite.bitmap = nil
@ehp_number_sprite.dispose
@ehp_number_sprite = nil
@ehp_number_bitmap.dispose
@ehp_number_bitmap = nil
#Enemy SP Meter Dispose
@esp_sprite.bitmap.dispose
@esp_sprite.bitmap = nil
@esp_sprite.dispose
@esp_sprite = nil
@esp_bitmap.dispose
@esp_bitmap = nil
#Fire Dispose
@fire_sprite.bitmap.dispose
@fire_sprite.bitmap = nil
@fire_sprite.dispose
@fire_sprite = nil
@fire_bitmap.dispose
@fire_bitmap = nil
#Time Number Dispose
@time_number_sprite.bitmap.dispose
@time_number_sprite.bitmap = nil
@time_number_sprite.dispose
@time_number_sprite = nil
@time_number_bitmap.dispose
@time_number_bitmap = nil
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
return if @actor == nil
visible_update
hp_number_update if @hp_old != @actor.hp
hp_number_refresh if @hp_refresh == true or @actor.hp == 0
hp_flow_update
sp_flow_update
ehp_number_update if @ehp_old != $game_temp.enemy_hp
ehp_number_refresh if @ehp_refresh == true
ehp_flow_update
esp_flow_update
fire_update
aface_update if @aface_name = @actor.name + "_Face"
time_refresh if Graphics.frame_count / Graphics.frame_rate != @total_sec
eface_update if @eface_name != $game_temp.enemy_face
end
#--------------------------------------------------------------------------
# * Visible Update
#--------------------------------------------------------------------------
def visible_update
if $game_switches[MOG::VS_DISABLE_SWITCH] == true
@fire_sprite.visible = false
@time_number_sprite.visible = false
@esp_sprite.visible = false
@ehp_number_sprite.visible = false
@ehp_sprite.visible = false
@eface.visible = false
@sp_sprite.visible = false
@hp_number_sprite.visible = false
@hp_sprite.visible = false
@aface.visible = false
@layout_sprite.visible = false
else
@fire_sprite.visible = true
@time_number_sprite.visible = true
@esp_sprite.visible = true
@ehp_number_sprite.visible = true
@eface.visible = true
@ehp_sprite.visible = true
@sp_sprite.visible = true
@hp_number_sprite.visible = true
@hp_sprite.visible = true
@aface.visible = true
@layout_sprite.visible = true
end
end
#--------------------------------------------------------------------------
# * Aface Update
#--------------------------------------------------------------------------
def aface_update
@aface.bitmap.clear
@aface_name = @actor.name + "_Face"
image = RPG::Cache.windowskin(@aface_name)
cw = image.width
ch = image.height
@aface.bitmap.blt(0, 0, image, Rect.new(0, 0, cw, ch))
end
#--------------------------------------------------------------------------
# * Hp Flow Update
#--------------------------------------------------------------------------
def hp_flow_update
@hp_sprite.bitmap.clear
@hp_width = @hp_range * @actor.hp / @actor.maxhp
#HP Damage---------------------------------
valor = (@hp_width_old - @hp_width) * 3 / 100
valor = 0.5 if valor < 1
if @hp_width_old != @hp_width
@hp_width_old -= valor if @hp_width_old > @hp_width
if @hp_width_old < @hp_width
@hp_width_old = @hp_width
end
@hp_src_rect_old = Rect.new(@hp_flow, @hp_height,@hp_width_old, @hp_height)
@hp_bitmap.blt(0,0, @hp_image, @hp_src_rect_old)
end
#HP Real------------------------------------
@hp_src_rect = Rect.new(@hp_flow, 0,@hp_width, @hp_height)
@hp_bitmap.blt(0,0, @hp_image, @hp_src_rect)
@hp_flow += 10
if @hp_flow >= @hp_image.width - @hp_range
@hp_flow = 0
end
end
#--------------------------------------------------------------------------
# * hp_number_update
#--------------------------------------------------------------------------
def hp_number_update
@hp_refresh = true
if @hp_old < @actor.hp
@hp_ref = 5 * (@actor.hp - @hp_old) / 100
@hp_ref = 1 if @hp_ref < 1
@hp += @hp_ref
if @hp >= @actor.hp
@hp_old = @actor.hp
@hp = @actor.hp
@hp_ref = 0
end
elsif @hp_old > @actor.hp
@hp_refresh = true
@hp_ref = 5 * (@hp_old - @actor.hp) / 100
@hp_ref = 1 if @hp_ref < 1
@hp -= @hp_ref
if @hp <= @actor.hp
@hp_old = @actor.hp
@hp = @actor.hp
@hp_ref = 0
end
end
end
#--------------------------------------------------------------------------
# * hp_number_refresh
#--------------------------------------------------------------------------
def hp_number_refresh
@hp_number_sprite.bitmap.clear
@hp = 0 if @actor.hp == 0
@hp_number_text = @hp.abs.to_s.split(//)
for r in 0..@hp_number_text.size - 1
@hp_number_abs = @hp_number_text[r].to_i
@hp_src_rect = Rect.new(@im_cw * @hp_number_abs, 0, @im_cw, @im_ch)
@hp_number_bitmap.blt(((@im_cw - 25) * r), 0, @hp_number_image, @hp_src_rect)
end
@hp_refresh = false if @hp == @actor.hp
end
#--------------------------------------------------------------------------
# * Sp Flow Update
#--------------------------------------------------------------------------
def sp_flow_update
@sp_sprite.bitmap.clear
@sp_width = @sp_image.width * @actor.sp / @actor.maxsp
#SP Real
@sp_src_rect = Rect.new(0, @sp_flow,@sp_width, @sp_height)
@sp_bitmap.blt(0,0, @sp_image, @sp_src_rect)
@sp_flow += 1
if @sp_flow >= @sp_image.height - @sp_range
@sp_flow = 0
end
end
#--------------------------------------------------------------------------
# HP Old
#--------------------------------------------------------------------------
def ehp_old
@ehp_width_old = @ehp_range * $game_temp.enemy_oldhp / $game_temp.enemy_maxhp
$game_temp.enemy_refresh_old = false
end
#--------------------------------------------------------------------------
# HP Flow Update
#--------------------------------------------------------------------------
def ehp_flow_update
@ehp_sprite.bitmap.clear
@ehp_width = @ehp_range * $game_temp.enemy_hp / $game_temp.enemy_maxhp
ehp_old if $game_temp.enemy_refresh_old == true
#HP Damage---------------------------------
if @ehp_width_old != @ehp_width
valor = (@ehp_width_old - @ehp_width) * 3 / 100
valor = 0.5 if valor < 1
@ehp_width_old -= valor if @ehp_width_old > @ehp_width
if @ehp_width_old < @ehp_width
@ehp_width_old = @ehp_width
end
@ehp_src_rect_old = Rect.new(@ehp_flow, @ehp_height,@ehp_width_old, @ehp_height)
@ehp_bitmap.blt(0,0, @ehp_image, @ehp_src_rect_old)
end
#HP Real------------------------------------
@ehp_src_rect = Rect.new(@ehp_flow, 0,@ehp_width, @ehp_height)
@ehp_bitmap.blt(0,0, @ehp_image, @ehp_src_rect)
@ehp_flow += 5
if @ehp_flow >= @ehp_image.width - @ehp_range
@ehp_flow = 0
end
end
#--------------------------------------------------------------------------
# * enemy hp_number_update
#--------------------------------------------------------------------------
def ehp_number_update
@ehp_refresh = true
if @ehp_old < $game_temp.enemy_hp
@ehp_ref = 5 * ($game_temp.enemy_hp - @ehp_old) / 100
@ehp_ref = 1 if @ehp_ref < 1
@ehp += @ehp_ref
if @ehp >= $game_temp.enemy_hp
@ehp_old = $game_temp.enemy_hp
@ehp = $game_temp.enemy_hp
@ehp_ref = 0
end
elsif @ehp_old > $game_temp.enemy_hp
@ehp_refresh = true
@ehp_ref = 5 * (@ehp_old - $game_temp.enemy_hp) / 100
@ehp_ref = 1 if @ehp_ref < 1
@ehp -= @ehp_ref
if @ehp <= $game_temp.enemy_hp
@ehp_old = $game_temp.enemy_hp
@ehp = $game_temp.enemy_hp
@ehp_ref = 0
end
end
end
#--------------------------------------------------------------------------
# * enemy hp_number_refresh
#--------------------------------------------------------------------------
def ehp_number_refresh
@ehp_number_sprite.bitmap.clear
@ehp_number_sprite.mirror = false
@ehp_number_text = @ehp.abs.to_s.split(//)
@ehp_number_sprite.mirror = false
@space_max = 0
for r in 0..@ehp_number_text.size - 1
@ehp_number_abs = @ehp_number_text[r].to_i
@ehp_src_rect = Rect.new(@eim_cw * @ehp_number_abs, 0, @eim_cw, @eim_ch)
@ehp_number_bitmap.blt(((@eim_cw - 25) * r), 0, @ehp_number_image, @ehp_src_rect)
@ehp_number_sprite.x = (-30 * @space_max ) + VS_HUD_X + VS_EHP_NUMBER_X
@space_max += 1
end
@ehp_refresh = false if @ehp == $game_temp.enemy_hp
end
#--------------------------------------------------------------------------
# * Enemy Hp Flow Update
#--------------------------------------------------------------------------
def esp_flow_update
@esp_sprite.bitmap.clear
@esp_width = @esp_image.width * $game_temp.enemy_sp / $game_temp.enemy_maxsp
@esp_src_rect = Rect.new(0, @esp_flow,@esp_width, @esp_height)
@esp_bitmap.blt(0,0, @esp_image, @esp_src_rect)
@esp_flow += 1
if @esp_flow >= @esp_image.height - @esp_range
@esp_flow = 0
end
end
#--------------------------------------------------------------------------
# * Img Eface Exist?
#--------------------------------------------------------------------------
def img_eface_exist?
RPG::Cache.windowskin($game_temp.enemy_face) rescue return false
end
#--------------------------------------------------------------------------
# * Eface Update
#--------------------------------------------------------------------------
def eface_update
@eface.bitmap.clear
@eface_name = $game_temp.enemy_face
if img_eface_exist?
image = RPG::Cache.windowskin(@eface_name)
else
image = RPG::Cache.windowskin("")
end
cw = image.width
ch = image.height
@eface.bitmap.blt(0, 0, image, Rect.new(0, 0, cw, ch))
end
#--------------------------------------------------------------------------
# Fire Update
#--------------------------------------------------------------------------
def fire_update
@fire_sprite.bitmap.clear
@fire_flow_speed += 1
if @fire_flow_speed > 3
@fire_flow += 1
@fire_flow_speed = 0
end
@fire_flow = 0 if @fire_flow >= 4
@fire_src_rect_back = Rect.new(@fire_width * @fire_flow, 0,@fire_width, @fire_image.height)
@fire_bitmap.blt(0,0, @fire_image, @fire_src_rect_back)
end
#--------------------------------------------------------------------------
# Time Refresh
#--------------------------------------------------------------------------
def time_refresh
@time_number_sprite.bitmap.clear
@total_sec = $game_system.timer / Graphics.frame_rate
min = @total_sec / 60
sec = @total_sec % 60
@time_number_text = min.abs.to_s.split(//)
for r in 0..@time_number_text.size - 1
@time_number_abs = @time_number_text[r].to_i
if @time_number_text.size == 1
@time_src_rect = Rect.new(0, 0, @time_cw, @time_ch)
@time_number_bitmap.blt(((@time_cw - 15) * r), 0, @time_number_image, @time_src_rect)
@time_src_rect = Rect.new(@time_cw * @time_number_abs, 0, @time_cw, @time_ch)
@time_number_bitmap.blt(15 + ((@time_cw - 15) * r), 0, @time_number_image, @time_src_rect)
else
@time_src_rect = Rect.new(@time_cw * @time_number_abs, 0, @time_cw, @time_ch)
@time_number_bitmap.blt(((@time_cw - 15) * r), 0, @time_number_image, @time_src_rect)
end
end
@time_number_text = sec.abs.to_s.split(//)
for r in 0..@time_number_text.size - 1
@time_number_abs = @time_number_text[r].to_i
if @time_number_text.size == 1
@time_src_rect = Rect.new(0, 0, @time_cw, @time_ch)
@time_number_bitmap.blt(30 + ((@time_cw - 15) * r), 30, @time_number_image, @time_src_rect)
@time_src_rect = Rect.new(@time_cw * @time_number_abs, 0, @time_cw, @time_ch)
@time_number_bitmap.blt( 45 + ((@time_cw - 15) * r ), 30, @time_number_image, @time_src_rect)
else
@time_src_rect = Rect.new(@time_cw * @time_number_abs, 0, @time_cw, @time_ch)
@time_number_bitmap.blt( 30 + ((@time_cw - 15) * r), 30, @time_number_image, @time_src_rect)
end
end
end
end
#===============================================================================
# Scene_Map
#===============================================================================
class Scene_Map
alias vshud_main main
#--------------------------------------------------------------------------
# Main
#--------------------------------------------------------------------------
def main
@vs_viewport = Viewport.new(0, 0, 640, 480)
@vs_viewport.z = 9999
@vshud = VS_Hud.new(@vs_viewport)
vshud_main
@vshud.dispose
@vshud = nil
@vs_viewport.dispose
@vs_viewport = nil
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
alias vshud_update update
def update
vshud_update
@vshud.update
end
end
#===============================================================================
# module MOG
#===============================================================================
module MOG
BOSS_INFO_SWITCH_ID = 11
end
$mog_rgss_xas_enemy_hp = true
$mog_rgss_vs_hud = true
demo: media fire
XAS 3.91 w/ MOG VS HUD (13.5mb)
the demo will continue to get smaller as this will not require an RTP.
*still this script could use a few more touches
-when enemy dies ~ their picture is still in the HUD and doesn't disappear.
Administrator
Show Signature
Active Member
||||||||||
||||||||||
||||||||||
profile
i didnt check it, but maybe it mix with the official xas 3.9
did mog vs hud before wasnt compatible with xas 3.9? or is this something new? i was thinking of using this but got hooked by hero mini hud
in the pict theres boss hp in the upper middle..so theres 2 hp bar for the enemy? but 1 has 8hp and the other 19 hp
supercow
![]() | ![]() | |
![]() | ||
![]() | ![]() |
profile
![](https://2img.net/u/3113/12/83/19/album/quote_13.png)
![Cool](https://2img.net/i/fa/i/smiles/icon_cool.gif)
did mog vs hud before wasnt compatible with xas 3.9? or is this something new? i was thinking of using this but got hooked by hero mini hud
![Razz](https://2img.net/i/fa/i/smiles/icon_razz.gif)
in the pict theres boss hp in the upper middle..so theres 2 hp bar for the enemy? but 1 has 8hp and the other 19 hp
![Neutral](https://2img.net/i/fa/i/smiles/icon_neutral.gif)
||||||||||
Show Signature
||||||||||
Administrator
Administrator
![Administrator Administrator](https://2img.net/u/3113/12/83/19/album/g101_p11.gif)
Administrator
profile
@DRAgo - I just threw it out there for kimono (who makes great sprites!) and for others to use since it was in demand. The demo is now 13.5mb ![Razz](https://2img.net/i/fa/i/smiles/icon_razz.gif)
(no RTP! it will continue to grow smaller as I plan to use the same project for converting other scripts to XAS 3.91
@supercow - some definitions and CONSTANTS have been changed in the code from 3.82 - 3.91
(I plan on using multiple HUDS for many purposes)
the VS HUD has "valor" animation so I can see why the screen shot would throw you off ~ the top right bar wasn't done draining.
*new demo ~ 13.5mb no RTP ^original post
G@MeF@Ce
![]() | ![]() | |
![]() | ||
![]() | ![]() |
![Administrator Administrator](https://2img.net/u/3113/12/83/19/album/g101_p11.gif)
profile
![](https://2img.net/u/3113/12/83/19/album/quote_13.png)
![Razz](https://2img.net/i/fa/i/smiles/icon_razz.gif)
(no RTP! it will continue to grow smaller as I plan to use the same project for converting other scripts to XAS 3.91
@supercow - some definitions and CONSTANTS have been changed in the code from 3.82 - 3.91
(I plan on using multiple HUDS for many purposes)
the VS HUD has "valor" animation so I can see why the screen shot would throw you off ~ the top right bar wasn't done draining.
*new demo ~ 13.5mb no RTP ^original post
Administrator
Show Signature
GAMEFACE101 » MEDIA » PLAY with CODE! » PLAY with CODE (scripts and software) » RGSS (RMXP SCRIPTS) »RMXP + XAS(3.91) = MOG VS HUD(edit)
Similar topics