马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
好兄弟们,我遇到问题了T T。
我抄了一个任务系统,但是每次call 任务 ,相关screen任务描述里 未完成的任务 就会重复出现 或者说 添加一次,该怎么解决呢?万分感谢
[RenPy] 纯文本查看 复制代码 init python:
class Event:
def __init__(self, name, description, available = False, completed = False, goal = 1):
self.name = name
self.description = description
self.available = available
self.completed = completed
self.goal = goal
self._Count = 0
@property
def Count(self):
return self._progressCount
def Count(self, a):
self._Count = a
if self._Count >= self.goal:
self.completed = True
def addCount(self):
self.Count = self._Count + 1
def shouldShow(self):
if self.available and not(self.completed):
return True
return False
class EventList (store.object):
def __init__(self):
self.event_list = []
def addEvent(self, event):
self.event_list.append(quest)
def removeEvent(self, event):
self.event_list.remove(quest)
default my_events = EventList()
default main_event_1 = Event("主线1", "主线1的说明",available = True, completed = False, goal = 1)
[RenPy] 纯文本查看 复制代码 screen 任务描述:
vbox:
for event in my_events.event_list:
if not(event.completed) and event.available:
text "[event.name]: [event.description]" pos (500, 285)
label 任务:
$ my_events.addEvent(main_event_1)
return
|