本帖最后由 老司机飞飞飞 于 2019-11-4 23:26 编辑
没有具体的代码我也不知道你错哪里
[RenPy] 纯文本查看 复制代码 init python:
class a():
def __init__(self,name,xg,hgd):
self.name = name
self.xg = xg
self.hgd = hgd
xs1 = a("1","冷漠",-10)
xs2 = a("2","冷漠",0)
xs3 = a("3","冷漠",22)
xs4 = a("4","开朗",-10)
xs5 = a("5","开朗",0)
xs6 = a("6","开朗",22)
xs7 = a("7","冷静",15)
students = [xs1,xs2,xs3,xs4,xs5,xs6,xs7]
listA = []
for i in students:
if i.xg != "冷漠" and i.hgd > 0:
listA.append(i)
def bzsj():
if len(listA) == 0:#没人可以触发这个事件,无事发生
renpy.say ("","没有人帮助你自己奋斗吧")
else:
someone = renpy.random.choice(listA) #随便选一个人触发
renpy.say (someone.name,"嘿,你这次考试没有及格,我来帮帮你吧")
# return someone
screen a:
frame:
vbox:
for i in listA:
text "姓名:[i.name] 性格:[i.xg] 好感度:[i.hgd]"
label start:
show screen a
# $ someone = bzsj()
$ bzsj()
# someone.name "嘿,你这次考试没有及格,我来帮帮你吧"
"aaaa"
|