Project1
标题:
如何突破多种战斗状态同时存在时的显示数量?
[打印本页]
作者:
夏天的枫
时间:
2010-7-28 00:13
标题:
如何突破多种战斗状态同时存在时的显示数量?
我发现当敌人被附加多种状态时,包括分隔符只能显示4个字,敌人被附加2个2个字的状态时比如麻痹、睡眠就只能显示其中一个,而被附加麻痹、毒时就能同时显示2个状态,主角的状态显示也是相同的问题,请教各位大虾该如何突破这个限制呢?让敌人或主角在同时被附加3-4种状态时也能同时显示出来?
作者:
薄荷冰水
时间:
2010-7-28 00:38
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 多重状态 Ver. 1.1 by Claimh
#------------------------------------------------------------------------------
# http://www.k3.dion.ne.jp/~claimh/
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# 生成状态文字
#--------------------------------------------------------------------------
def make_battler_state_text_over3(battler, width, need_normal)
brackets_width = self.contents.text_size("[]").width
text = ""
text0 = ""
ret_text = ["",""]
for i in battler.states
if $data_states[i].rating >= 1
if text == ""
text = $data_states[i].name
else
new_text = text + "/" + $data_states[i].name
text_width = self.contents.text_size(new_text).width
if text_width > width - brackets_width
text0 = new_text
text = ""
new_text = ""
text_width = 0
else
text = new_text
end
end
end
end
if text == "" and text0 == ""
ret_text = ["[正常]", ""]
elsif text0 == ""
ret_text[0] = "[" + text + "]"
ret_text[1] = ""
else
ret_text[0] = "[" + text0 + "]"
if text != ""
ret_text[1] = "[" + text + "]"
else
ret_text[1] = ""
end
end
return ret_text
end
#--------------------------------------------------------------------------
# 描绘角色状态
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 120)
text = make_battler_state_text_over3(actor, width, true)
self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
if text[1] == ""
self.contents.draw_text(x-5, y, width+5, 32, text[0])
else
self.contents.font.size = 20
self.contents.draw_text(x-5, y - 15 , width+5, 32, text[0])
self.contents.draw_text(x-5, y + 8, width+5, 32, text[1])
end
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1