本文整理汇总了Python中Actions.victory方法的典型用法代码示例。如果您正苦于以下问题:Python Actions.victory方法的具体用法?Python Actions.victory怎么用?Python Actions.victory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actions
的用法示例。
在下文中一共展示了Actions.victory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: gameloop
# 需要导入模块: import Actions [as 别名]
# 或者: from Actions import victory [as 别名]
def gameloop(player, travel):
choice = ""
while choice != "quit":
choice = input(">>> ")
# using commands
if choice == "help":
Actions.get_help(player)
elif choice == "look":
Travel.look(travel)
elif choice == "move":
Travel.move(travel)
in_city = False
for city in Cities:
if travel.x == city[1] and travel.y == city[2]:
print("You are now in " + city[0])
in_city = True
else:
pass
if in_city == False:
name, hp, attack, toughness = random.choice(Enemies)
mob = Enemy(name, hp, attack, toughness)
Actions.combat_mode(player, mob)
elif choice == "location":
Travel.get_location(travel)
elif choice == "map":
Travel.map(travel, player)
elif choice == "stats":
Actions.stats(player)
elif choice == "read note":
Actions.read_note(player)
elif choice == "inventory":
Actions.check_inventory(player)
elif choice == "potions":
Actions.check_potions(player)
elif choice.partition(" ")[0] == "check":
try:
Actions.check_item(player, choice.partition(" ")[2])
except IndexError:
print("You need an item to check")
elif choice == "boss":
in_city = False
for city in Cities:
if travel.x == city[1] and travel.y == city[2]:
in_city = True
if city_completion[city[0]] == True:
print("You have already killed this cities boss")
else:
for boss in Bosses:
if city[0] in boss:
name, hp, attack, toughness = boss[1], boss[2], boss[3], boss[4]
boss_mob = Enemy(name, hp, attack, toughness)
Actions.boss_combat_mode(player, boss_mob)
Actions.get_item(player, boss[5])
city_completion[city[0]] = True
else:
pass
if in_city == False:
print("Bosses are in each city")
elif choice == "wallet":
Actions.coins(player)
elif choice == "shop":
in_city = False
for city in Cities:
if travel.x == city[1] and travel.y == city[2]:
in_city = True
Actions.shop(player)
else:
pass
if in_city == False:
print("There is a shop in each city")
elif choice == "attack":
print("You slash the air")
elif choice == "victory":
Actions.victory(player)
elif choice == "save":
SaveLoad.save(player, travel)
elif choice =="load":
SaveLoad.load(player, travel)
elif choice == "quit":
sys.exit()
else:
print("invalid choice - type 'help' for commands")