Project1
标题:
脚本高手进来
[打印本页]
作者:
geziyang007
时间:
2009-5-23 05:12
标题:
脚本高手进来
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
#......................................................................
actor_x = i * 133 + 100
@sta_output[i + 1].bitmap.clear
hp_width = $game_party.actors
.hp * @hp_bitmap.width/$game_party.actors
.maxhp
hp_rect = Rect.new(0, 0, hp_width, 3)
mp_width = $game_party.actors
.sp * @mp_bitmap.width/$game_party.actors
.maxsp
mp_rect = Rect.new(0, 0, mp_width, 3)
@sta_output[i + 1].bitmap.blt(66, 44, @hp_bitmap, hp_rect)
@sta_output[i + 1].bitmap.blt(68, 69, @mp_bitmap, mp_rect)
@sta_output[i + 1].bitmap.font.color.set(255, 0, 0)
@sta_output[i + 1].bitmap.draw_text(80, 31, 77, 11,$game_party.actors
.hp.to_s + "/" + $game_party.actors
.maxhp.to_s)
@sta_output[i + 1].bitmap.font.color.set(0, 0, 255)
@sta_output[i + 1].bitmap.draw_text(80, 51, 77, 11,$game_party.actors
.sp.to_s + "/" + $game_party.actors
.maxsp.to_s)
#......................................................................
if @level_up_flags
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
end
这个脚本时血条的 但是一旦在战斗中有角色中途加入第八行就会出错 高手帮改下 [LINE]1,#dddddd[/LINE]
此贴于 2009-6-6 10:31:25 被版主木葬枫提醒,请楼主看到后对本贴做出回应。
作者:
hitlerson
时间:
2009-5-23 21:20
一定是@sta_output[i + 1]==nil了
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1