本文整理汇总了Python中fight.Fight.create方法的典型用法代码示例。如果您正苦于以下问题:Python Fight.create方法的具体用法?Python Fight.create怎么用?Python Fight.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fight.Fight
的用法示例。
在下文中一共展示了Fight.create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: duel_accept
# 需要导入模块: from fight import Fight [as 别名]
# 或者: from fight.Fight import create [as 别名]
def duel_accept(self, other):
if other["duel_invite"] == None or len([x for x in other["duel_invite"] if x[0] == self.id]) == 0:
raise MyException(u"Игрок отменил свой вызов")
if other["zone"] != self["zone"]:
raise MyException(u"Игрок находится в другой локации")
if other["loc"] != "default":
raise MyException(u"Игрок пока не может начать дуэль")
other["duel_invite"] = [di for di in other["duel_invite"] if di[0] != self.id]
Fight.create([other], [self], _type="training")
示例2: encounter_start
# 需要导入模块: from fight import Fight [as 别名]
# 或者: from fight.Fight import create [as 别名]
def encounter_start(self):
" В бой с мобцами! "
try:
limit = self["encounter_limit"]
mobs = [mob.get(m) for m in self["encounter"]]
team = [self] + self.get_encounter_helpers()
for noob in team:
noob.go_noupdate("default")
del self["encounter"]
del self["encounter_limit"]
del self["encounter_help"]
Fight.create(team, mobs, start_time=limit)
except:
del self["encounter"]
del self["encounter_limit"]
del self["encounter_help"]
log_exception()
self.go("default")
示例3: fight
# 需要导入模块: from fight import Fight [as 别名]
# 或者: from fight.Fight import create [as 别名]
def fight(self):
Fight.create([self.user], [mob.get('Thief')])
self.text = u'Вы расправились с грабителем.'