Project1
标题: 新手求个VA显血脚本 [打印本页]
作者: a86533024 时间: 2013-8-20 02:57
标题: 新手求个VA显血脚本
本帖最后由 a86533024 于 2013-8-20 03:01 编辑
搜索了几个显血脚本 都不能用,
#==============================================================================
# F08 - 战斗敌人显示血条 - By芙蕾娅
#------------------------------------------------------------------------------
# ★ - 新增 ☆ - 修改 ■ - 删除 ● - 无变更
#==============================================================================
module Freya
# 隐藏HP的文本
HideGaugeText = "Hide_Gauge"
# 血条颜色
EnemyHPGaugeColor1 = Color.new(64,128,96)
EnemyHPGaugeColor2 = Color.new(96,192,160)
Gauge_Type = 3#0
end
#==============================================================================
# ■ Sprite_Battler_HP
#------------------------------------------------------------------------------
# 显示战斗者的生命在战斗者的精灵下面。
#==============================================================================
class Sprite_Battler_HP < Sprite
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(viewport,battler)
super(viewport)
[url=home.php?mod=space&uid=133701]@battler[/url] = battler
@last_hp = 0
create_bitmap
update
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
self.bitmap.dispose
super
end
#--------------------------------------------------------------------------
# ● 生成位图
#--------------------------------------------------------------------------
def create_bitmap
@last_hp = @battler.hp
bw = 96
bh = 6
self.bitmap = Bitmap.new(bw, bh + 16)
self.bitmap.fill_rect(0, 16, bw, bh, Color.new(32,32,64))
if Freya::Gauge_Type.nil? or Freya::Gauge_Type == 0
hp = ((bw) * @battler.hp_rate).to_i
self.bitmap.gradient_fill_rect(0, 16, hp, bh, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
elsif Freya::Gauge_Type == 1
hp = ((width - 2) * @battler.hp_rate).to_i
self.bitmap.gradient_fill_rect(1, 17, hp, bh - 2, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
elsif Freya::Gauge_Type == 2
hp = ((width) * @battler.hp_rate).to_i
self.bitmap.gradient_fill_rect(0, 16, hp / 2, bh, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
self.bitmap.gradient_fill_rect(hp / 2, 16, hp / 2, bh, Freya::EnemyHPGaugeColor2, Freya::EnemyHPGaugeColor1)
elsif Freya::Gauge_Type == 3
hp = ((width - 2) * @battler.hp_rate).to_i
self.bitmap.gradient_fill_rect(1, 17, hp / 2, bh - 2, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
self.bitmap.gradient_fill_rect((hp / 2) + 1, 17, hp / 2, bh - 2, Freya::EnemyHPGaugeColor2, Freya::EnemyHPGaugeColor1)
end
end
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
def update
super
unless self.bitmap.nil?
self.x = @battler.screen_x - self.width / 2
self.y = @battler.screen_y - 16
create_bitmap if @last_hp != @battler.hp
hide = $data_enemies[@battler.enemy_id].note.include?(Freya::HideGaugeText)
if @battler.hp == 0 or hide
self.opacity = 0
elsif @battler.hp > 0 && !hide
self.opacity = 255
end
self.bitmap.font.size = 16
self.bitmap.draw_text(0, 0, 96, 24,"#{@battler.hp}/#{@battler.mhp}", 2)
end
end
end
#==============================================================================
# ■ Sprite_Battler
#------------------------------------------------------------------------------
# 显示战斗者的精灵。根据 Game_Battler 类的实例自动变化。
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# ☆ 初始化对象
#--------------------------------------------------------------------------
alias initialize_freya_enemy_hp initialize
def initialize(viewport, battler = nil)
initialize_freya_enemy_hp(viewport, battler)
if @battler.is_a?(Game_Enemy)
@hp_gauge = Sprite_Battler_HP.new(viewport, battler)
end
end
#--------------------------------------------------------------------------
# ☆ 释放
#--------------------------------------------------------------------------
alias dispose_freya_enemy_hp dispose
def dispose
dispose_freya_enemy_hp
unless @hp_gauge.nil?
@hp_gauge.dispose
end
end
#--------------------------------------------------------------------------
# ☆ 更新画面
#--------------------------------------------------------------------------
alias update_freya_enemy_hp update
def update
update_freya_enemy_hp
@hp_gauge.update unless @hp_gauge.nil?
end
#--------------------------------------------------------------------------
# ☆ 更新位置
#--------------------------------------------------------------------------
alias update_position_freya_enemy_hp update_position
def update_position
update_position_freya_enemy_hp
self.y = @battler.screen_y - 16
end
end
#==============================================================================
# F08 - 战斗敌人显示血条 - By芙蕾娅
#------------------------------------------------------------------------------
# ★ - 新增 ☆ - 修改 ■ - 删除 ● - 无变更
#==============================================================================
module Freya
# 隐藏HP的文本
HideGaugeText = "Hide_Gauge"
# 血条颜色
EnemyHPGaugeColor1 = Color.new(64,128,96)
EnemyHPGaugeColor2 = Color.new(96,192,160)
Gauge_Type = 3#0
end
#==============================================================================
# ■ Sprite_Battler_HP
#------------------------------------------------------------------------------
# 显示战斗者的生命在战斗者的精灵下面。
#==============================================================================
class Sprite_Battler_HP < Sprite
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(viewport,battler)
super(viewport)
[url=home.php?mod=space&uid=133701]@battler[/url] = battler
@last_hp = 0
create_bitmap
update
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
self.bitmap.dispose
super
end
#--------------------------------------------------------------------------
# ● 生成位图
#--------------------------------------------------------------------------
def create_bitmap
@last_hp = @battler.hp
bw = 96
bh = 6
self.bitmap = Bitmap.new(bw, bh + 16)
self.bitmap.fill_rect(0, 16, bw, bh, Color.new(32,32,64))
if Freya::Gauge_Type.nil? or Freya::Gauge_Type == 0
hp = ((bw) * @battler.hp_rate).to_i
self.bitmap.gradient_fill_rect(0, 16, hp, bh, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
elsif Freya::Gauge_Type == 1
hp = ((width - 2) * @battler.hp_rate).to_i
self.bitmap.gradient_fill_rect(1, 17, hp, bh - 2, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
elsif Freya::Gauge_Type == 2
hp = ((width) * @battler.hp_rate).to_i
self.bitmap.gradient_fill_rect(0, 16, hp / 2, bh, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
self.bitmap.gradient_fill_rect(hp / 2, 16, hp / 2, bh, Freya::EnemyHPGaugeColor2, Freya::EnemyHPGaugeColor1)
elsif Freya::Gauge_Type == 3
hp = ((width - 2) * @battler.hp_rate).to_i
self.bitmap.gradient_fill_rect(1, 17, hp / 2, bh - 2, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
self.bitmap.gradient_fill_rect((hp / 2) + 1, 17, hp / 2, bh - 2, Freya::EnemyHPGaugeColor2, Freya::EnemyHPGaugeColor1)
end
end
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
def update
super
unless self.bitmap.nil?
self.x = @battler.screen_x - self.width / 2
self.y = @battler.screen_y - 16
create_bitmap if @last_hp != @battler.hp
hide = $data_enemies[@battler.enemy_id].note.include?(Freya::HideGaugeText)
if @battler.hp == 0 or hide
self.opacity = 0
elsif @battler.hp > 0 && !hide
self.opacity = 255
end
self.bitmap.font.size = 16
self.bitmap.draw_text(0, 0, 96, 24,"#{@battler.hp}/#{@battler.mhp}", 2)
end
end
end
#==============================================================================
# ■ Sprite_Battler
#------------------------------------------------------------------------------
# 显示战斗者的精灵。根据 Game_Battler 类的实例自动变化。
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# ☆ 初始化对象
#--------------------------------------------------------------------------
alias initialize_freya_enemy_hp initialize
def initialize(viewport, battler = nil)
initialize_freya_enemy_hp(viewport, battler)
if @battler.is_a?(Game_Enemy)
@hp_gauge = Sprite_Battler_HP.new(viewport, battler)
end
end
#--------------------------------------------------------------------------
# ☆ 释放
#--------------------------------------------------------------------------
alias dispose_freya_enemy_hp dispose
def dispose
dispose_freya_enemy_hp
unless @hp_gauge.nil?
@hp_gauge.dispose
end
end
#--------------------------------------------------------------------------
# ☆ 更新画面
#--------------------------------------------------------------------------
alias update_freya_enemy_hp update
def update
update_freya_enemy_hp
@hp_gauge.update unless @hp_gauge.nil?
end
#--------------------------------------------------------------------------
# ☆ 更新位置
#--------------------------------------------------------------------------
alias update_position_freya_enemy_hp update_position
def update_position
update_position_freya_enemy_hp
self.y = @battler.screen_y - 16
end
end
这个脚本用了 人物和武器会变成呢样
作者: a86533024 时间: 2013-8-20 03:06
#==============================================================================
# 功能:战斗中显示敌人血和蓝于敌人脚下
# 适用:RMVX Ace
# 作者:殇殃 2012.3.10
# 使用方法:复制整个脚本插入到Main之前
# 注意:由于血条是显示在敌人脚下,所以敌群的位置不能太靠底部,不然会被挡住。
# 可以自行更改坐标修改显示位置、血条的颜色等。
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 描绘敌人HP
#--------------------------------------------------------------------------
def draw_enemy_hp(enemy, x, y, width = 80)
draw_gauge(x, y, width, enemy.hp_rate, hp_gauge_color1, hp_gauge_color2)
self.contents.font.size = 20
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, line_height, Vocab::hp_a)
self.contents.font.color = hp_color(enemy)
self.contents.draw_text(x + width - 64, y, 64, line_height, enemy.hp, 2)
#一个数字占16像素
end
def draw_enemy_name(enemy, x, y)
self.contents.font.size = 15
self.contents.font.color = normal_color
self.contents.draw_text(x, y,104, line_height, enemy.name)
end
#--------------------------------------------------------------------------
# ● 绘制敌人MP
#--------------------------------------------------------------------------
def draw_enemy_mp(enemy, x, y, width = 80)
self.contents.font.size = 20
draw_gauge(x, y, width, enemy.mp_rate, mp_gauge_color1, mp_gauge_color2)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, line_height, Vocab::mp_a)
self.contents.font.color = mp_color(enemy)
self.contents.draw_text(x + width - 64, y, 64, line_height, enemy.mp, 2)
end
end
#==============================================================================
# ■ Sprite_Battler
#------------------------------------------------------------------------------
# 战斗显示用活动块。Game_Battler 类的实例监视、
# 活动块的状态的监视、活动块状态自动变化。
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# ● 初始化对象
# viewport : 视区
# battler : 战斗者 (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
[url=home.php?mod=space&uid=133701]@battler[/url] = battler
@battler_visible = false
@effect_type = nil
@effect_duration = 0
if @battler.is_a?(Game_Enemy)
width = 24 + 80#边距12*2+血条的长度(在draw_enemy_hp中定义)
height = 24 + 24*3 #边距12*2+line_height*2
x = @battler.screen_x - width/2 #screen_x是怪物图片水平方向上的中点位置
y = @battler.screen_y - 12 #边距12,显示HP/MP的窗口无边框
@enemy_hpmp_window = Window_Base.new(x, y, width, height)
@enemy_hpmp_window.opacity = 0
@enemy_hpmp_window.contents = Bitmap.new(width - 24, height - 24)#位图比窗口小24像素取消边框
@enemy_hpmp_window.draw_enemy_hp(@battler, 0, 0)
@old_hp = -1
@enemy_hpmp_window.draw_enemy_mp(@battler, 0, 24)
@old_mp = -1
@enemy_hpmp_window.draw_enemy_name(@battler, 0, 48)
@old_name = nil
end
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
@enemy_hpmp_window.dispose
end
super
end
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
def update
super
if @battler == nil
self.bitmap = nil
else
@use_sprite = @battler.use_sprite?
if @use_sprite
update_bitmap
update_origin
update_position
end
setup_new_effect
setup_new_animation
update_effect
if @enemy_hpmp_window != nil and (@old_hp != @battler.hp or @old_mp != @battler.mp)
if @battler.hp == 0
@enemy_hpmp_window.hide
else
@enemy_hpmp_window.contents.clear
@enemy_hpmp_window.draw_enemy_hp(@battler, 0, 0)
@old_hp = @battler.hp
@enemy_hpmp_window.draw_enemy_mp(@battler, 0, 24)
@old_mp = @battler.mp
@enemy_hpmp_window.draw_enemy_name(@battler, 0, 48)
@old_mp = @battler.name
@enemy_hpmp_window.show #怪物死后再被复活
end #if battler.hp == 0
end
end #if @battler == nil
end
end
#==============================================================================
# 功能:战斗中显示敌人血和蓝于敌人脚下
# 适用:RMVX Ace
# 作者:殇殃 2012.3.10
# 使用方法:复制整个脚本插入到Main之前
# 注意:由于血条是显示在敌人脚下,所以敌群的位置不能太靠底部,不然会被挡住。
# 可以自行更改坐标修改显示位置、血条的颜色等。
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 描绘敌人HP
#--------------------------------------------------------------------------
def draw_enemy_hp(enemy, x, y, width = 80)
draw_gauge(x, y, width, enemy.hp_rate, hp_gauge_color1, hp_gauge_color2)
self.contents.font.size = 20
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, line_height, Vocab::hp_a)
self.contents.font.color = hp_color(enemy)
self.contents.draw_text(x + width - 64, y, 64, line_height, enemy.hp, 2)
#一个数字占16像素
end
def draw_enemy_name(enemy, x, y)
self.contents.font.size = 15
self.contents.font.color = normal_color
self.contents.draw_text(x, y,104, line_height, enemy.name)
end
#--------------------------------------------------------------------------
# ● 绘制敌人MP
#--------------------------------------------------------------------------
def draw_enemy_mp(enemy, x, y, width = 80)
self.contents.font.size = 20
draw_gauge(x, y, width, enemy.mp_rate, mp_gauge_color1, mp_gauge_color2)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, line_height, Vocab::mp_a)
self.contents.font.color = mp_color(enemy)
self.contents.draw_text(x + width - 64, y, 64, line_height, enemy.mp, 2)
end
end
#==============================================================================
# ■ Sprite_Battler
#------------------------------------------------------------------------------
# 战斗显示用活动块。Game_Battler 类的实例监视、
# 活动块的状态的监视、活动块状态自动变化。
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# ● 初始化对象
# viewport : 视区
# battler : 战斗者 (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
[url=home.php?mod=space&uid=133701]@battler[/url] = battler
@battler_visible = false
@effect_type = nil
@effect_duration = 0
if @battler.is_a?(Game_Enemy)
width = 24 + 80#边距12*2+血条的长度(在draw_enemy_hp中定义)
height = 24 + 24*3 #边距12*2+line_height*2
x = @battler.screen_x - width/2 #screen_x是怪物图片水平方向上的中点位置
y = @battler.screen_y - 12 #边距12,显示HP/MP的窗口无边框
@enemy_hpmp_window = Window_Base.new(x, y, width, height)
@enemy_hpmp_window.opacity = 0
@enemy_hpmp_window.contents = Bitmap.new(width - 24, height - 24)#位图比窗口小24像素取消边框
@enemy_hpmp_window.draw_enemy_hp(@battler, 0, 0)
@old_hp = -1
@enemy_hpmp_window.draw_enemy_mp(@battler, 0, 24)
@old_mp = -1
@enemy_hpmp_window.draw_enemy_name(@battler, 0, 48)
@old_name = nil
end
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
@enemy_hpmp_window.dispose
end
super
end
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
def update
super
if @battler == nil
self.bitmap = nil
else
@use_sprite = @battler.use_sprite?
if @use_sprite
update_bitmap
update_origin
update_position
end
setup_new_effect
setup_new_animation
update_effect
if @enemy_hpmp_window != nil and (@old_hp != @battler.hp or @old_mp != @battler.mp)
if @battler.hp == 0
@enemy_hpmp_window.hide
else
@enemy_hpmp_window.contents.clear
@enemy_hpmp_window.draw_enemy_hp(@battler, 0, 0)
@old_hp = @battler.hp
@enemy_hpmp_window.draw_enemy_mp(@battler, 0, 24)
@old_mp = @battler.mp
@enemy_hpmp_window.draw_enemy_name(@battler, 0, 48)
@old_mp = @battler.name
@enemy_hpmp_window.show #怪物死后再被复活
end #if battler.hp == 0
end
end #if @battler == nil
end
end
这个用了人物会消失,而且战斗画面会卡住没反映
求大神给个能用的显血脚本
作者: a86533024 时间: 2013-8-20 03:19
我用的 sideview100 的汉化版,.还有几个MOG的脚本.
作者: 熊喵酱 时间: 2013-8-20 06:47
首先三連帖不好....
還有其實MOG的血條腳本就可以用的说~
腳本:- #==============================================================================
- # +++ MOG - Enemy HP Meter (v1.0) +++
- #==============================================================================
- # By Moghunter
- # http://www.atelier-rgss.com/
- #==============================================================================
- # Apresenta um medidor animado com o HP do inimigo.
- #==============================================================================
- # Para ocultar o HP do inimigo use a TAG abaixo na caixa de notas.
- #
- # <Hide HP>
- #
- #==============================================================================
- # Serão necessários as imagens.
- #
- # Battle_Enemy_HP_Layout.png
- # Battle_Enemy_HP_Meter.png
- #
- #==============================================================================
- module MOG_ENEMY_HP
- #Posição geral do medidor em relação ao battler.
- POSITION_CORRECTION = [0,0]
- #Posição do medidor de HP.
- HP_METER_POSITION = [0,0]
- #Prioridade do medidor na tela.
- PRIORITY_Z = 101
- end
- #==============================================================================
- # ■ Game Enemy
- #==============================================================================
- class Game_Enemy < Game_Battler
- attr_accessor :hp_meter_active
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- alias mog_enemy_hp_initialize initialize
- def initialize(index, enemy_id)
- mog_enemy_hp_initialize(index, enemy_id)
- hide = enemy.note =~ /<Hide HP>/i ? true : false
- @hp_meter_active = [false,hide]
- end
- end
- #==============================================================================
- # ■ Game_Battler
- #==============================================================================
- class Game_Battler < Game_BattlerBase
-
- #--------------------------------------------------------------------------
- # ● Item Apply
- #--------------------------------------------------------------------------
- alias mog_enemy_hp_item_apply item_apply
- def item_apply(user, item)
- mog_enemy_hp_item_apply(user, item)
- if self.is_a?(Game_Enemy)
- self.hp_meter_active[0] = true if @result.hp_damage != 0
- end
- end
- #--------------------------------------------------------------------------
- # ● Regenerate HP
- #--------------------------------------------------------------------------
- alias mog_enemy_hp_regenerate_hp regenerate_hp
- def regenerate_hp
- mog_enemy_hp_regenerate_hp
- if self.is_a?(Game_Enemy)
- self.hp_meter_active[0] = true if @result.hp_damage != 0
- end
- end
-
- end
-
- #==============================================================================
- # ■ Battle_Hud
- #==============================================================================
- class Enemy_HP
- include MOG_ENEMY_HP
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- def initialize(viewport = nil,enemy,image)
- @enemy = enemy
- @image = image
- @fade_time = -1
- create_layout
- create_hp_meter
- b_pos = [enemy.screen_x - (@layout.width / 2) + POSITION_CORRECTION[0], enemy.screen_y + POSITION_CORRECTION[1] - (@layout.height / 2)]
- @layout.opacity = 0
- @org_pos1 = [b_pos[0],b_pos[1]]
- @layout.x = @org_pos1[0]
- @layout.y = @org_pos1[1]
- @layout.visible = false
- @hp_meter.opacity = 0
- @hp_meter.visible = false
- @org_pos2 = [b_pos[0] + HP_METER_POSITION[0], b_pos[1] + HP_METER_POSITION[1]]
- @hp_meter.x = @org_pos2[0]
- @hp_meter.y = @org_pos2[1]
- @hp_meter.viewport = viewport
- @hp_meter.z = PRIORITY_Z
- @layout.viewport = viewport
- @layout.z = PRIORITY_Z
- @enemy.hp_meter_active[0] = false
- [url=home.php?mod=space&uid=94902]@Hide[/url] = @enemy.hp_meter_active[1]
- end
-
- #--------------------------------------------------------------------------
- # ● Create HP Meter
- #--------------------------------------------------------------------------
- def create_layout
- @layout = Sprite.new
- @layout.bitmap = @image[0]
- end
-
- #--------------------------------------------------------------------------
- # ● Create HP Meter
- #--------------------------------------------------------------------------
- def create_hp_meter
- @meter_cw = @image[1].width
- @meter_ch = @image[1].height / 2
- @hp_meter = Sprite.new
- @hp_meter.bitmap = Bitmap.new(@meter_cw,@meter_ch)
- @hp_width_old = @meter_cw * @enemy.hp / @enemy.mhp
- end
-
- #--------------------------------------------------------------------------
- # ● Hp Flow Update
- #--------------------------------------------------------------------------
- def update_hp_flow
- return if [email protected]
- hp_width = @meter_cw * @enemy.hp / @enemy.mhp
- @hp_meter.bitmap.clear
- execute_damage_flow(hp_width)
- hp_src_rect = Rect.new(0, 0,hp_width, @meter_ch)
- @hp_meter.bitmap.blt(0,0, @image[1], hp_src_rect)
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Damage Flow
- #--------------------------------------------------------------------------
- def execute_damage_flow(hp_width)
- n = (@hp_width_old - hp_width).abs * 3 / 100
- damage_flow = [[n, 2].min,0.5].max
- @hp_width_old -= damage_flow
- if @hp_width_old <= hp_width
- @hp_width_old = hp_width
- end
- src_rect_old = Rect.new(0,@meter_ch,@hp_width_old, @meter_ch)
- @hp_meter.bitmap.blt(0,0, @image[1], src_rect_old)
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose
- #--------------------------------------------------------------------------
- def dispose
- @layout.bitmap.dispose
- @layout.dispose
- @hp_meter.bitmap.dispose
- @hp_meter.dispose
- end
-
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- def update
- return if @hide
- update_fade
- update_visible
- update_hp_flow
- refresh if @enemy.hp_meter_active[0]
- end
-
- #--------------------------------------------------------------------------
- # ● Update Fade
- #--------------------------------------------------------------------------
- def update_fade
- @fade_time -= 1 if @fade_time > 0
- return if @fade_time != 0
- @layout.opacity -= 10
- @hp_meter.opacity -= 10
- @layout.x += 1
- @hp_meter.x += 1
- @fade_time = -1 if @layout.opacity == 0
- end
-
- #--------------------------------------------------------------------------
- # ● Update Visible
- #--------------------------------------------------------------------------
- def update_visible
- return if [email protected]
- vis = can_visible?
- @layout.visible = vis
- @hp_meter.visible = vis
- end
-
- #--------------------------------------------------------------------------
- # ● Refresh
- #--------------------------------------------------------------------------
- def refresh
- @enemy.hp_meter_active[0] = false
- @layout.opacity = 255
- @hp_meter.opacity = 255
- @layout.visible = true
- @hp_meter.visible = true
- @fade_time = 60
- @layout.x = @org_pos1[0]
- @layout.y = @org_pos1[1]
- @hp_meter.x = @org_pos2[0]
- @hp_meter.y = @org_pos2[1]
- hp_width = @meter_cw * @enemy.hp / @enemy.mhp
- @hp_width_old = hp_width if @hp_width_old < hp_width
- update_hp_flow
- end
-
- #--------------------------------------------------------------------------
- # ● Can Visible?
- #--------------------------------------------------------------------------
- def can_visible?
- return false if @layout.opacity == 0
- return true
- end
-
- end
- #==============================================================================
- # ■ Spriteset Battle
- #==============================================================================
- class Spriteset_Battle
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- alias mog_enemy_hp_initialize initialize
- def initialize
- mog_enemy_hp_initialize
- create_enemy_hp
- end
-
- #--------------------------------------------------------------------------
- # ● Create Battle Hud
- #--------------------------------------------------------------------------
- def create_enemy_hp
- ie1 = Cache.system("Battle_Enemy_HP_Layout")
- ie2 = Cache.system("Battle_Enemy_HP_Meter")
- @enemy_hp_images = [ie1,ie2]
- @enemy_hp = []
- for i in $game_troop.members
- @enemy_hp.push(Enemy_HP.new(@viewport1,i,@enemy_hp_images))
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose
- #--------------------------------------------------------------------------
- alias mog_enemy_hp_dispose dispose
- def dispose
- mog_enemy_hp_dispose
- dispose_enemy_hp
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose Enemy HP
- #--------------------------------------------------------------------------
- def dispose_enemy_hp
- return if @enemy_hp_images == nil
- @enemy_hp_images.each {|sprite| sprite.dispose }
- @enemy_hp_images.clear
- @enemy_hp.each {|sprite| sprite.dispose }
- @enemy_hp.clear
- end
-
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- alias mog_enemy_hp_update update
- def update
- mog_enemy_hp_update
- update_enemy_hp
- end
-
- #--------------------------------------------------------------------------
- # ● Update Enemy HP
- #--------------------------------------------------------------------------
- def update_enemy_hp
- return if @enemy_hp_images == nil
- @enemy_hp.each {|sprite| sprite.update }
- end
- end
- $mog_rgss3_enemy_hp_meter = true
复制代码 素材的話在介:
-
-
System.zip
7.48 KB, 下载次数: 95
作者: a86533024 时间: 2013-8-20 13:29
76213585 发表于 2013-8-20 06:47
首先三連帖不好....
還有其實MOG的血條腳本就可以用的说~
MOG的显血我有,只想找个持续显血的,
作者: Vortur 时间: 2015-9-9 11:52
本帖最后由 Vortur 于 2015-9-16 23:30 编辑
熊喵酱 发表于 2013-8-20 06:47
首先三連帖不好....
還有其實MOG的血條腳本就可以用的说~
求问:
第109行:
@Hide = @enemy.hp_meter_active[1]
从“/url”字样开始出现错误,后面相当长的一段文字为紫红色,直到下一个“/”。
如图:
怎么解决呢?为什么?
十分感谢VIPArcher 君!!
以下抄自https://rpg.blue/thread-341966-1-1.html第三条:
[url=home.php?mod=space&uid=32466]@Index[/url] = 1
@index = 1
[url=home.php?mod=space&uid=32466]@Index[/url] = 1
@index = 1
上述两行代码是完全一样。只不过当你用代码框框起来发帖之后,排在最前那句就被错误解析为“艾特Index”用户,导致使用时报错。出错后打开脚本编辑器会自动定位到那一行,把论坛加上去的方括号以及里面的内容删掉(@xxx前后各有一段),然后首字母改成小写就行(首字母肯定要小写)。顺便 Ctrl + F 搜索“[/url]”看看还有没有别的错处。各位在上传脚本的时候,发现被错误解析的@变量,修改一下,后面不要加空格就好(@index += 1 写成 @index+= 1,可在脚本编辑器内 Ctrl + H 快速替换)。当然还有其它错误解析的情况,不过都比较罕见,这里不介绍了,各位自求多福吧。
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |