class Interpreter
def 随机对话
return false if $game_temp.message_text != nil
n=0; @index+=1; show_text = ""
while @index<@list.size and @list[@index].code==101
# 读取一条完整的文字
text = @list[@index].parameters[0]+"\n"
@index+=1
while @index<@list.size and @list[@index].code==401
text += @list[@index].parameters[0]+"\n"
@index+=1
end
# 判断是否取
n+=1
show_text = text if rand() < 1.0/n
end
$game_temp.message_text = show_text
# 设置信息结束后待机和返回调用标志
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# 不继续
return false
end
end
class Interpreter
def 随机对话
return false if $game_temp.message_text != nil
n=0; @index+=1; show_text = ""
while @index<@list.size and @list[@index].code==101
# 读取一条完整的文字
text = @list[@index].parameters[0]+"\n"
@index+=1
while @index<@list.size and @list[@index].code==401
text += @list[@index].parameters[0]+"\n"
@index+=1
end
# 判断是否取
n+=1
show_text = text if rand() < 1.0/n
end
$game_temp.message_text = show_text
# 设置信息结束后待机和返回调用标志
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# 不继续
return false
end
end