#==============================================================================
# ■ RMXP
#--------------------------------------------------------------------------
# 作者:刺夜之枪
#==============================================================================
#==============================================================================
# ■ Sprite_Character
#==============================================================================
class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# ● 参数设置 正太君改
#--------------------------------------------------------------------------
# 设置图片文件名.不想要底图就让底图完全透明或设置为 ""
# 图片放在 Graphics/Pictures/ 文件夹下
TeamTagFileName = "大脚"#wodeshib
# 设置显示友军标记的开关号
TeamTagBar = 10
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
#别名hzhj旧初始化使标记初始化
alias hzhj_old_init_make_tag initialize
#定义初始化参数
def initialize(*args)
#团队标记精灵=精灵。新(参数[0])
@team_tag_sprite = Sprite.new(args[0])
#@标签_精灵=[]
@tags_sprites = []
#标签_精灵<<团队标签_精灵
@tags_sprites << @team_tag_sprite
#团队标签精灵.位图=RPG::缓存。图片(TeamTagFileName)TeamTagFileName = "大脚"
@team_tag_sprite.bitmap = RPG::Cache.picture(TeamTagFileName)
#@队旗精灵=精灵.新(参数[0])
@team_flag_sprite = Sprite.new(args[0])
#@队旗精灵.位图 = RPG::Cache.picture("队标")
@team_flag_sprite.bitmap = RPG::Cache.picture("队标")
#@标签_精灵 << @队旗精灵.位图
@tags_sprites << @team_flag_sprite
#@计数 =0
@count = 0
#@等待计数=0
@wait_count = 0
#hzhj旧初始化组成标记(*参数)
hzhj_old_init_make_tag(*args)
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
#别名hzhj旧的处理使标记处理除非$@
alias hzhj_old_dispose_make_tag dispose unless $@
#定义处理
def dispose
@tags_sprites.each{|sprite|sprite.dispose}
hzhj_old_dispose_make_tag
end
#--------------------------------------------------------------------------
# ● 获取事件 HP # 正太君改
#--------------------------------------------------------------------------
def event_hp
return 0 if @character.nil?
return 0 if @character.is_a?(Game_Player)
return @character.hp
end
=begin
#--------------------------------------------------------------------------
# ● 判断是否显示队友标记
#--------------------------------------------------------------------------
def show_team_tag?
#under construct
return false if @character.is_a?(Game_Player)
return false if $scene.group_lisenter == nil
selected = $scene.group_lisenter.include?(@character.group)
return $game_switches[TeamTagBar]
else
return false
end
end
=end
#--------------------------------------------------------------------------
# ● 判断是否显示队长旗子
#--------------------------------------------------------------------------
def show_team_flag?
return false if @character.is_a?(Game_Player)
return false if @character.is_a?(EFS_Hero)
return false if $scene.group_lisenter == nil
selected = $scene.group_lisenter.include?(@character.group)
cp = $scene.team_groups[@character.group-1].captain
if cp == @character
return $game_switches[TeamTagBar]
else
return false
end
cp = $scene.team_groups[@character.group-1].captain
if cp == @character
bitmap = nil
case @character.id
# 队长 id 为 2 显示 E_HeavyInfantry
when 2 then bitmap = RPG::Cache.Icons("E_HeavyInfantry")
end
@team_flag_sprite.bitmap = bitmap if bitmap
end
end
#--------------------------------------------------------------------------
# ● 判断是否显示队友标记
#--------------------------------------------------------------------------
def show_team_tag?
#under construct
return false if @character.is_a?(Game_Player)
return false if $scene.group_lisenter == nil
@selected = $scene.group_lisenter.include?(@character.group)
if event_hp > 0 and @character.team == 1 and !@character.removed # and selected
return $game_switches[TeamTagBar]
else
return false
end
end
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
alias hzhj_old_update_make_tag update
def update
hzhj_old_update_make_tag
if !@character.is_a?(EFS_Battler) and !@character.is_a?(Game_Player)
@tags_sprites.each{|sprite|sprite.visible = false}
else
if show_team_flag?
@team_flag_sprite.visible = true
else
@team_flag_sprite.visible = false
end
# 刷新 标记 可见状态
if show_team_tag?
@team_tag_sprite.visible = true
if @selected
@tags_sprites.each do |sprite|
sprite.ox = sprite.bitmap.width / 2
sprite.oy = sprite.bitmap.height
sprite.z = z
sprite.x = @character.screen_x
#blink_on
shif = @character.is_cal
if @character.ammo>0
sprite.y = shif ? @character.screen_y-92 : @character.screen_y-60
else
sprite.y = shif ? @character.screen_y-82 : @character.screen_y-50
end
sprite.opacity = 255
end#loop
else
# 刷新坐标
@tags_sprites.each do |sprite|
#sprite.zoom_y = 1
sprite.ox = sprite.bitmap.width / 2
sprite.oy = sprite.bitmap.height
sprite.z = z
sprite.x = @character.screen_x
#blink_on
shif = @character.is_cal
if @character.ammo>0
sprite.y = shif ? @character.screen_y-92 : @character.screen_y-60
else
sprite.y = shif ? @character.screen_y-82 : @character.screen_y-50
end
sprite.opacity = 125
end#loop
end #if include
else
@tags_sprites.each{|sprite|sprite.visible = false}
end
end
end
end