Beispiel #1
0
 def __init__(self):
     self.mana = 1
     self.myworldcards = []
     self.enemyworldcards = []
     hero_list = [('warlock', '古尔丹', '我会夺取你的灵魂!', '这次是你赢了!'),
                  ('warrior', '加尔鲁什·地狱咆哮', '不胜利,毋宁死!', '我选择死亡!'),
                  ('hunter', '雷克萨', '狩猎开始了!', '打得好,我认输!'),
                  ('pastor', '安度因·乌瑞恩', '圣光会赐予我胜利!', '你击败了我!'),
                  ('mage', '吉安娜·普鲁德摩尔', '这可是你自找的!', '你赢了!'),
                  ('roguer', '瓦莉拉·萨古纳尔', '当心你的背后!', '我输了!'),
                  ('shaman', '萨尔', '为了毁灭之锤!', '这局你赢了朋友!'),
                  ('knight', '乌瑟尔·光明骑士', '荣耀将赐予我力量!', '胜利属于你!'),
                  ('druid', '玛法里奥·怒风', '我是大自然的守护者!', '我承认,你赢了!')]
     for i in range(len(hero_list)):
         print("{0}-{1} ".format(i + 1, hero_list[i][1]), end='')
     print('')
     choose_num = choose_object_num(hero_list)
     self.myhero = Hero(hero_list[choose_num - 1])
     enemyhero_num = randint(0, len(hero_list)) - 1
     self.enemyhero = Hero(hero_list[enemyhero_num])
     self.myhero.cardcount = INIT_HAND_COUNT
     print("**************我的卡牌**************")
     self.mycards = generate_cards(CARD_NUM)
     show_cards(self.mycards)
     self.myhandcards = self.mycards[:self.myhero.cardcount]
     print("**************敌方卡牌**************")
     self.enemycards = generate_cards(CARD_NUM)
     show_cards(self.enemycards)
     self.enemyhero.cardcount = INIT_HAND_COUNT
     self.enemyhandcards = self.enemycards[:self.enemyhero.cardcount]
     self.round = 1
     self.myturn = True
Beispiel #2
0
 def __init__(self):
     self.mana = 1
     self.myworldcards = []
     self.enemyworldcards = []
     self.init_hand_count = INIT_HAND_COUNT
     print("**************我的卡牌**************")
     self.mycards = generate_cards(CARD_NUM)
     self.show_cards(self.mycards)
     self.myhandcards = self.mycards[:INIT_HAND_COUNT]
     print("**************敌方卡牌**************")
     self.enemycards = generate_cards(CARD_NUM)
     self.show_cards(self.enemycards)
     self.enemyhandcards = self.enemycards[:INIT_HAND_COUNT]
     self.round = 1
Beispiel #3
0
 def __init__(self):
     self.mana = 1
     self.myworldcards = []
     self.enemyworldcards = []
     self.myherohealth = HERO_HEALTH
     self.enemyherohealth = HERO_HEALTH
     self.init_hand_count = INIT_HAND_COUNT
     print("**************我的卡牌**************")
     self.mycards = generate_cards(CARD_NUM)
     self.show_cards(self.mycards)
     self.myhandcards = self.mycards[:INIT_HAND_COUNT]
     print("**************敌方卡牌**************")
     self.enemycards = generate_cards(CARD_NUM)
     self.show_cards(self.enemycards)
     self.enemyhandcards = self.enemycards[:INIT_HAND_COUNT]
     self.round = 1
     self.myturn = True
     self.tired = 0
Beispiel #4
0
def main():
    print("**************我的卡牌**************")
    mycards = generate_cards(CARD_NUM)
    print("**************敌方卡牌**************")
    enemycards = generate_cards(CARD_NUM)

    print()
    print("$$$$$$$$$$$$开始游戏$$$$$$$$$$$$")
    if randint(0, 1) == 1:
        one_on_one(mycards, enemycards, 1)
    else:
        one_on_one(enemycards, mycards, 1)
    print("$$$$$$$$$$$$游戏结束$$$$$$$$$$$$")
    print()

    if mycards[-1].alive:
        print("您赢得了游戏!!!")
    elif enemycards[-1].alive:
        print("您输了游戏,继续加油!!!")
    else:
        print("平分秋色!!!")
Beispiel #5
0
def main():
    print("**************我的卡牌**************")
    mycards = generate_cards(CARD_NUM)
    print("**************敌方卡牌**************")
    enemycards = generate_cards(CARD_NUM)

    print()
    print("$$$$$$$$$$$$开始游戏$$$$$$$$$$$$")
    if randint(0, 1) == 1:
        battle(mycards, enemycards, 1)
    else:
        battle(enemycards, mycards, 1)

    print("$$$$$$$$$$$$游戏结束$$$$$$$$$$$$")
    print()

    if anybody_alive(mycards):
        print("您赢得了游戏!!!")
    elif anybody_alive(enemycards):
        print("您输了游戏,继续加油!!!")
    else:
        print("平分秋色!!!")