#==============================================================================
# ■ 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)
@team_tag_sprite = Sprite.new(args[0])
@tags_sprites = []
@tags_sprites << @team_tag_sprite
@team_tag_sprite.bitmap = RPG::Cache.picture(TeamTagFileName)
@team_flag_sprite = Sprite.new(args[0])
@team_flag_sprite.bitmap = RPG::Cache.picture("队标1")
# @team_flag_sprite.bitmap = RPG::Cache.icon(Figter_data::CHARACTER_NAME)
# if args == [2]RPG::Cache.icon(Figter_data::CHARACTER_NAME[@selected_units[@index][i]])
# @team_flag_sprite.bitmap = RPG::Cache.Icons("E_HeavyInfantry")
# end
@tags_sprites << @team_flag_sprite
@count = 0
@wait_count = 0
hzhj_old_init_make_tag(*args)
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
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
# @character.id= Figter_data::data_id
# 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
# 精灵.x = @性格。屏幕_x
sprite.x = @character.screen_x
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