| 赞 | 1 |
| VIP | |
| 好人卡 | |
| 积分 | 7 |
| 经验 | |
| 最后登录 | 2026-4-21 |
| 在线时间 | 663 小时 |
- 梦石
- 0
- 星屑
- 710
- 在线时间
- 663 小时
- 注册时间
- 2012-10-21
- 回帖
- 251
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 VIPArcher 于 2014-8-11 20:40 编辑
中了某个状态,HP/MP数值显示变成???,血/魔槽变空呢?
我把我的人物HP\MP显示代码发过来,因为用的是ace battle engine,不是默认的那个。
谢谢各位大神啦!~\(≧▽≦)/~
我的BattleStatus[pre lang="ruby" line="1"]#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Selectable
#--------------------------------------------------------------------------
# overwrite method: initialize
#--------------------------------------------------------------------------
def initialize
super(0, 0, window_width , window_height+48)#(0, 20, window_width + 96, window_height+48+24 )
self.openness = 0
self.opacity = 0 ###
@party = $game_party.battle_members.clone
end
#--------------------------------------------------------------------------
# overwrite method: col_max
#--------------------------------------------------------------------------
def col_max; return $game_party.max_battle_members; end
#--------------------------------------------------------------------------
# new method: battle_members
#--------------------------------------------------------------------------
def battle_members; return $game_party.battle_members; end
#--------------------------------------------------------------------------
# new method: actor
#--------------------------------------------------------------------------
def actor; return battle_members[@index]; end
#--------------------------------------------------------------------------
# overwrite method: update
#--------------------------------------------------------------------------
def update
super
return if @party == $game_party.battle_members
@party = $game_party.battle_members.clone
refresh
end
def refresh
contents.clear
draw_all_items
end
#--------------------------------------------------------------------------
# ☆ 生成角色头像
#--------------------------------------------------------------------------
def draw_actor_face(actor, x, y, enabled = true)
bitmap = Cache.face("bf"+actor.id.to_s+".png")
rect = Rect.new(0,0,bitmap.width, bitmap.height)
contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
end
#--------------------------------------------------------------------------
# overwrite method: draw_item
#--------------------------------------------------------------------------
def draw_item(index)
return if index.nil?
clear_item(index)
actor = battle_members[index]
rect = item_rect(index)
item_x = rect.x + 6
return if actor.nil?
draw_actor_face(actor, item_x - 8, rect.y - 1, actor.alive?)
#draw_actor_name(actor, item_x, rect.y, rect.width-8)
draw_actor_action(actor, item_x + 80, rect.y - 2)
draw_actor_icons(actor, rect.x, line_height*3, rect.width+48 )
#draw_actor_icons(actor, item_x + 12, rect.y + 134, rect.width)
gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
yadj = 10
contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
draw_actor_hp(actor, item_x - 7, line_height*2+gx, rect.width-4-17)
draw_actor_mp(actor, item_x - 2, line_height*3+gx-yadj+1, rect.width-4-17)
draw_actor_tp(actor, rect.x+22, line_height*2+4+22, rect.width-4-17)
#draw_actor_tp(actor, item_x + 3, line_height*3+gx-yadj+16, rect.width-4-17)
#end
end
#--------------------------------------------------------------------------
# overwrite method: item_rect
#--------------------------------------------------------------------------
def item_rect(index)
rect = Rect.new
rect.width = contents.width / $game_party.max_battle_members - 4
rect.height = contents.height - 12 - 24
rect.x = index * rect.width
if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
rect.x += (contents.width - $game_party.members.size * rect.width) / 2
end
rect.y = 0
return rect
end
#--------------------------------------------------------------------------
# overwrite method: draw_face
#--------------------------------------------------------------------------
def draw_face(face_name, face_index, dx, dy, enabled = true)
bitmap = Cache.face(face_name)
fx = [(96 - item_rect(0).width + 1) / 2, 0].max
fy = face_index / 4 * 96 + 2
fw = [item_rect(0).width - 4, 92].min
rect = Rect.new(fx, fy, fw, 92)
rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
end
#--------------------------------------------------------------------------
# overwrite method: draw_actor_name
#--------------------------------------------------------------------------
def draw_actor_name(actor, dx, dy, dw = 112)
reset_font_settings
contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
change_color(hp_color(actor))
draw_text(dx+24, dy, dw-24, line_height, actor.name)
end
#--------------------------------------------------------------------------
# new method: draw_actor_action
#--------------------------------------------------------------------------
def draw_actor_action(actor, dx, dy)
draw_icon(action_icon(actor), dx, dy)
end
#--------------------------------------------------------------------------
# new method: action_icon
#--------------------------------------------------------------------------
def action_icon(actor)
return Icon.no_action if actor.current_action.nil?
return Icon.no_action if actor.current_action.item.nil?
return actor.current_action.item.icon_index
end
#--------------------------------------------------------------------------
# new method: draw_tp?
#--------------------------------------------------------------------------
def draw_tp?(actor)
return actor.draw_tp?
end
#--------------------------------------------------------------------------
# new method: draw_mp?
#--------------------------------------------------------------------------
def draw_mp?(actor)
return actor.draw_mp?
end
#--------------------------------------------------------------------------
# overwrite method: draw_current_and_max_values
#--------------------------------------------------------------------------
def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
change_color(color1)
draw_text(dx, dy, dw, line_height, current.group, 2)
end
#--------------------------------------------------------------------------
# overwrite method: draw_actor_hp
#--------------------------------------------------------------------------
def draw_actor_hp(actor, dx, dy, width = 20)
draw_gauge(dx+8, dy+18, width-20, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
change_color(system_color)
cy = (Font.default_size - contents.font.size) / 2 + 18
draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
draw_current_and_max_values(dx-16, dy+cy, width, actor.hp, actor.mhp,
hp_color(actor), normal_color)
end
#--------------------------------------------------------------------------
# overwrite method: draw_actor_mp
#--------------------------------------------------------------------------
def draw_actor_mp(actor, dx, dy, width = 20)
draw_gauge(dx+12, dy+19, width-20, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
change_color(system_color)
cy = (Font.default_size - contents.font.size) / 2 + 18
draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
draw_current_and_max_values(dx-16, dy+cy, width, actor.mp, actor.mmp,
mp_color(actor), normal_color)
end
#--------------------------------------------------------------------------
# overwrite method: draw_actor_tp
#--------------------------------------------------------------------------
def draw_actor_tp(actor, dx, dy, width = 120)
cy = (Font.default_size - contents.font.size) / 2 + 6
san = text_size("0000%").width
change_color(Color.new(128,128,128))
agg_tot = 0
contents.font.bold = true
change_color(Color.new(128,128,128))
atp = actor.tp.to_i
str = ""
str = "0" if atp < 100
str = "00" if atp < 10
draw_text(dx+12+san, dy+cy, 42, line_height, str)
change_color(tp_color(actor, actor.tp.to_i))
draw_text(dx+12+san+text_size(str).width, dy+cy, 42, line_height, atp.to_s + "%")
contents.font.bold = false
change_color(system_color)
contents.font.size = 15
draw_text(dx+8, dy+cy, 60, line_height, " 战意")
end
def tp_color(actor, hard = 100)
return Color.new(255,215-(125-hard),200-(125-hard),255) if hard < 100
return Color.new(255,235,55,255) # REVERSE
end
end # Window_BattleStatus[/pre]
|
|