Project1
标题:
如何把这段代码改成能显示4人状态的脚本?
[打印本页]
作者:
277297575
时间:
2010-10-29 14:18
标题:
如何把这段代码改成能显示4人状态的脚本?
本帖最后由 277297575 于 2010-10-29 15:18 编辑
这东西只能显示一个人的状态,请问如何可以把他改成4人的呢?
class Scene_Map < Scene_Base
alias hpmpwindow_start start
def start
hpmpwindow_start
@hpmpwindow = Window_Base.new(0, 336, 152, 80)
end
alias hpmpwindow_update update
def update
actor = $game_party.members[0]
if @temp_hp != actor.hp or @temp_mp != actor.mp
@hpmpwindow.contents.clear
@hpmpwindow.draw_actor_hp(actor, 0, 0)
@hpmpwindow.draw_actor_mp(actor, 0, 24)
@temp_hp = actor.hp
@temp_mp = actor.mp
end
@hpmpwindow.update
hpmpwindow_update
end
alias hpmpwindow_terminate terminate
def terminate
@hpmpwindow.dispose
hpmpwindow_terminate
end
end
复制代码
作者:
烁灵
时间:
2010-10-29 14:53
总感觉这脚本很眼熟=.=
class Scene_Map < Scene_Base
alias hpmpwindow_start start
def start
hpmpwindow_start
@hpmpwindow = Window_Base.new(0, 316, 544, 100) #变大点……
end
alias hpmpwindow_update update
def update
t_flag=0
for i in 0..($game_party.members.size <= 4 ? $game_party.members.size-1: 3)
actor = $game_party.members[i]
if @temp_hp != actor.hp or @temp_mp != actor.mp
t_flag = t_flag + 1
end
end
if t_flag >0 #某人hp增减了
@hpmpwindow.contents.clear #清空循环重画所有人的血条
for i in 0..($game_party.members.size <= 4 ? $game_party.members.size-1: 3)
actor = $game_party.members[i]
@hpmpwindow.draw_actor_hp(actor, i*136, 17, width = 100)
@hpmpwindow.draw_actor_mp(actor, i*136, 39, width = 100)
@hpmpwindow.draw_actor_name(actor, i*136+20, 0)
end
t_flag = 0
end
@hpmpwindow.update
hpmpwindow_update
end
alias hpmpwindow_terminate terminate
def terminate
@hpmpwindow.dispose
hpmpwindow_terminate
end
end
复制代码
作者:
277297575
时间:
2010-10-29 15:02
嗯,十分感谢。
这东西也在本站搜到就这样子了,也不知道作者是谁。。。。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1