예제 #1
0
 def __init__(self):
     self.name = "Squid Coast"
     self.description = """
                         A Village Under Attack – The village is under attack by the Arch-Illager's evil minions.
                         Someone needs to save the Villagers before it is too late!
                         """
     self.wintext = """
                        You were too late to rescue the Villagers, but don't fret.
                        They're still out there somewhere, waiting for a hero to find them.
                        """
     self.dsl = """
     |NO|NO|VT|NO|NO|
     |NO|NO|RG|NO|NO|
     |BS|EP|RC|EN|EN|
     |EP|EN|NO|TT|EN|
     |EN|NO|RC|NO|EN|
     |EN|FE|EN|NO|TT|
     |TT|NO|ST|FE|EN|
     |FE|NO|EN|NO|FE|
     """
     self.music = "Sounds\SquidCoast.mp3"
     self.objective = "Save the Villagers!"
     self.gear = {"Drop 1": "Fishing Rod",
                  "Drop 2": items.Cutlass(),
                  "Drop 3": items.Sword(),
                  "Drop 4": items.Daggers(),
                  "Drop 5": items.SoulKnife(),
                  "Drop 6": None}
def attack():
    attack_phrases = [
        " You attack with your sword and ",
        " You lunge forward, quickly stabbing your opponent and \
", " You pierce your opponents skin and "
    ]
    say = random.randint(0, 3)
    speak = attack_phrases[say]
    out(speak)
    if items.Reed_Trident() in character.inventory:
        Sword = items.Reed_Trident()
    else:
        Sword = items.Sword()
    enemy.hp -= Sword.damage
    out("deal {} damage to the {}. It has {} hp remaining.".format(
        Sword.damage, enemy.name, enemy.hp))
    if enemy.is_alive() == True:
        out("\nThe {} is still alive. It rushes forward to attack.\nDo you flee, attack, or try to dodge?"
            .format(enemy.name))
        txt.delete(1.0, END)
        attack_or_flee()
    else:
        global num
        out("You have killed the {}.".format(enemy.name))
        num += 1
예제 #3
0
 def __init__(self):
     super(Stallman, self).__init__()
     self.name = "Stallman"
     self.intro = "'HALT, Microsoft lackey!  Free software shall live on forever!'"
     self.dialog = "'Free software will carry on!  For a GNU dawn!'"
     self.returnedItem = items.Sword()
     self.gaveSword = False
예제 #4
0
 def update_inventory(self, Apple_amt, Bread_amt, Water_amt):
     self.inventory = [
         items.Apple(Apple_amt),
         items.Bread(Bread_amt),
         items.Water(Water_amt),
         items.Sword()
     ]
예제 #5
0
 def get_item(self):
     rand = random.randint(0, 14)
     if rand == 1:
         return items.Dagger(1)
     elif rand == 2:
         return items.Sword(1)
     elif rand == 3:
         return items.Bow(1)
     elif rand == 4:
         return items.Axe(1)
     elif rand == 5:
         return items.Leather_ChestPlate(1)
     elif rand == 6:
         return items.Wooden_Shield(1)
     elif rand == 7:
         return items.Leather_Cap(1)
     elif rand == 8:
         return items.Iron_Shield(1)
     elif rand == 9:
         return items.Chainmail_Cap(1)
     elif rand == 10:
         return items.Chainmail_ChestPlate(1)
     elif rand == 11:
         return items.Iron_Cap(1)
     elif rand == 12:
         return items.Iron_ChestPlate(1)
     elif rand == 13:
         return items.SmallPotion(1)
     else:
         return items.Dagger(1)
예제 #6
0
def seed():
    global _maze
    _maze.clear()
    _maze = {
        (0, 0):
        rooms.ItemRoom(0, 0, "Outside Cave Entrance",
                       "North of you, the cave mount beckons",
                       [items.Sword()]),
        (0, -1):
        rooms.Room(
            0, -1, "Foyer", """Dim light filters in from the south. Dusty
passages run north and east."""),
        (0, -2):
        rooms.Room(
            0, -2, "Grand Overlook",
            """A steep cliff appears before you, falling
into the darkness. Ahead to the north, a light flickers in
the distance, but there is no way across the chasm."""),
        (1, -1):
        rooms.Room(
            1, -1, "Narrow Passage", """The narrow passage bends here from west
to north. The smell of gold permeates the air."""),
        (1, -2):
        rooms.Room(
            1, -2, "Treasure Chamber", """You've found the long-lost treasure
chamber! Sadly, it has already been completely emptied by
earlier adventurers. The only exit is to the south."""),
    }
예제 #7
0
 def shop_list(self):
     return [
         items.Dagger(),
         items.Sword(),
         items.Broadsword(),
         items.Potion()
     ]
 def __init__(self):
     self.name = "Black Smith"
     self.emerald = 250
     self.inventory = [items.Sword(),
                       items.Daggers(),
                       items.SoulKnife(),
                       items.Cutlass(),
                       items.HealingPotion()]
예제 #9
0
 def pick_up_item(self, player):
     if not self.taken:
         if player.is_alive():
             sword = items.Sword()
             player.inventory.append(sword)
             self.taken = True
             self.item = False
             print('Sword taken!')
         else:
             print("You try to grab the sword, but your hand passes right through.")
예제 #10
0
 def reset_stats(self):
     self.inventory = [
         items.Apple(5),
         items.Bread(2),
         items.Water(3),
         items.Sword()
     ]
     self.hp = 100
     self.stamina = 50
     self.glory = 0
     self.glory_statement = "=======================\nYou failed. History will forget you"
예제 #11
0
 def __init__(self):
     self.inventory = [items.Gold(), items.Sword()]
     self.hp = creation.hp
     self.strength = creation.strength
     self.dex = creation.dex
     self.intelligence = creation.intelligence
     self.wis = creation.wis
     self.charisma = creation.charisma
     self.con = creation.con
     self.charclass = creation.charclass
     self.location_x, self.location_y = world.starting_position
     self.victory = False
 def __init__(self):
     self.inventory = [items.Sword(), items.Apple()]
     self.x = world.start_tile_location[0]
     self.y = world.start_tile_location[1]
     self.enchantment_points = 1
     self.player_level = 1
     self.maxhp = 100
     self.hp = self.maxhp
     self.emerald = 25
     self.victory = False
     self.bufferSize = 64 * 1024
     self.passwordtxt = ''.join((random.choice(
         'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!@#$%^&*()'
     ) for i in range(20)))
예제 #13
0
    def __init__(self):
        self.inventory = [
            items.Brick(),
            items.Knife(),
            items.Sword(),
            items.Medipack(),
            items.Herbs(),
        ]

        self.x = world.start_tile_location[0]
        self.y = world.start_tile_location[1]
        self.hp = 100
        self.gold = 5
        self.victory = False
예제 #14
0
 def find_loot(self, player):
     rand = random.randint(1, 1000)
     if 1 < rand < 10:
         Option.modify_player(Option, player, items.Sword(1))
         print(">A shiny sword is behind a desk, you take it.")
     elif rand == 1:
         Option.modify_player(Option, player, items.Axe(1))
         print(">You found a Axe hanging from the wall.")
     elif 10 < rand < 100:
         Option.modify_player(Option, player, items.Gold(5))
         print(">There are 5 golden Coins")
     elif 300 < rand < 400:
         Option.modify_player(Option, player, items.Gold(7))
         print(">A tiny bag of gold Coins")
     elif 500 < rand:
         print(">There is nothing here")
예제 #15
0
 def speak(self, player):
     print(self.name + ":")
     if self.new:
         print(self.intro)
         self.new = False
     elif not self.gaveSword:
         print("'Oh, you're not with Microsoft?'")
         print(
             "'Take this, you'll need it to defend yourself against the RIAA and MPAA.'"
         )
         sword = items.Sword()
         player.receiveItem(sword)
         print(self.name + " gave you a " + sword.name)
         self.gaveSword = True
     else:
         print(self.dialog)
예제 #16
0
 def __init__(self, name, difficulty):
     self.name = name
     print("Welcome to THE DUNGEON, " + name)
     if difficulty.lower() == "easy":
         self.hp = 100
         self.max_hp = 100
         self.skill_pts_per_lvl = 3
         self.start_skill_pts = 8
         self.gold = 50
         self.inventory = [
             items.MinorHealthPotion(),
             items.MinorHealthPotion()
         ]
         self.equipped_weapon = items.Sword()
         self.equipped_armour = items.LightArmour()
     elif difficulty.lower() == "medium":
         self.hp = 75
         self.max_hp = 75
         self.skill_pts_per_lvl = 2
         self.start_skill_pts = 5
         self.gold = 25
         self.inventory = [items.MinorHealthPotion()]
         self.equipped_weapon = items.Dagger()
         self.equipped_armour = items.LightArmour()
     else:
         self.hp = 50
         self.max_hp = 50
         self.skill_pts_per_lvl = 1
         self.start_skill_pts = 2
         self.gold = 15
         self.inventory = []
         self.equipped_weapon = items.Dagger()
         self.equipped_armour = items.Cloth()
     self.repair_skill = 0
     self.search_skill = 0
     self.initiative = 0
     self.skill_pts = 0
     self.location_x, self.location_y = world.starting_position
     self.prev_location_x = self.location_x
     self.prev_location_y = self.location_y
     self.victory = False
     self.quit = False
     self.xp = 0
     self.level = 0
     self.hp_per_lvl = 10
     self.level_up()
     self.skill_pts = 0
예제 #17
0
def createUnique(quality):
    """
    Chooses an unique item.
    Quality 0 armor have 8 stat points total.
    Quality 0 weapons have 12 stat points total.
    """
    unique_list = ((items.Sword("Demonforged Blade", [3, 3, 3, 3])),
                   (items.Mace("Bane of Darkness", [3, 1, 5, 3])),
                   (items.Dagger("Throatslitter", [3, 6, 1, 2])),
                   (items.Armor("Judgement Chestguard", "Chest",
                                [3, 1, 3, 1])),
                   (items.Armor("Sanctuary", "Helm", [0, 1, 4, 3])),
                   (items.Armor("Fiercegrip", "Gloves", [3, 2, 2, 1])),
                   (items.Armor("Veracious Leggings", "Leggings",
                                [2, 3, 3, 0])),
                   (items.Armor("Gravestompers", "Boots", [2, 2, 2, 2])))
    return random.choice(unique_list)
예제 #18
0
def createWeapon(quality, weapon_type=""):
    """Creates a weapon"""
    stats = []
    if weapon_type == "":
        w_type = random.choice(weapon_types)
    else:
        w_type = weapon_type
    prefix = weapon_prefixes[weighted_choice_sub(
                            [x[1] for x in weapon_prefixes])]
    name = prefix[0] + w_type[0]
    for i in range(4):
        stats.append((prefix[2][i] + w_type[2][i]) * (1 + quality))
    if w_type[0] == "Sword":
        return items.Sword(name, stats)
    if w_type[0] == "Mace":
        return items.Mace(name, stats)
    if w_type[0] == "Dagger":
        return items.Dagger(name, stats)
예제 #19
0
 def __init__(self, playername):
     Character.__init__(self)
     self.name = playername
     self.level = 1
     self.gold = 0
     self.exp = 0
     self.exp_needed = 1000
     self.stat_list = [10, 10, 10, 10]
     self.equipment_stat_list = [0, 0, 0, 0]
     self.inventory = []
     self.armor = {
         "Helm": None,
         "Coat": None,
         "Gloves": None,
         "Leggings": None,
         "Boots": None
     }
     self.weapons = {"Right Hand": items.Sword("Rusty Sword", [0, 0, 0, 0])}
     self.health = self.getMaxHealth()
 def _init_(self):
     self.inventory = [items.Silver_Eagle(15), items.Sword()]
     self.hp = 100
     self.location_x, self.location_y = world.starting_position
     self.victory = False
예제 #21
0
 def __init__(self, x, y):
     super().__init__(x, y, items.Sword())
예제 #22
0
            return
        if self.quest == 1 and self.nr_replies == 3:
            print("\nThank you for playing! :)")
            confirm()
            return


# instances by location
# village temple
location_temple = Location_Temple()

# village sherrif
location_sherrif = Location_Sherrif()
club1 = i.Spiked_club()
tunica1 = i.Leather_tunica()
sword1 = i.Sword()

# village marketplace
location_marketplace = Location_Marketplace()

# Dark Forest: Lower Road
location_lowerRoad = Location_LowerRoad()
banditLvl1_1 = c.Bandit(1)
axe1 = c.Lumberjack_axe()

# Dark Forest: Burning Tree
location_burningTree = Location_BurningTree()
cultistlvl1_1 = c.Cultist(1)
cultistlvl1_2 = c.Cultist(1)
club2 = i.Spiked_club()
rags2 = i.Woolen_rags()
예제 #23
0
    def enter(self, character):
        print("As you enter the general store, the sign says:")
        print("Daggers: 6 coins. Swords: 6 coins. Health potion: 3 coins.")
        print(
            "The dagger seems to be fast, but do less damage, where-as the sword is slow but does far greater damage."
        )
        print("The health potions looks like it'll heal you 30hp.")
        print("Would you like to buy anyting?\n1. Yes\n2. No")
        user_input = input('> ')

        if user_input == '1':
            print(
                "What would you like to buy?\n1. Sword\n2. Dagger\n3. Health Potion"
            )
            choice = input('> ')

            if choice == '1':
                #checks if the character has sufficient coins to purchase the item
                if character.coins > 5:
                    #if they do have enough, buy the item and remove coins. then add the sword to the characters inventory.
                    character.coins -= 5
                    print(
                        f"You purchase the sword. You have {character.coins} coins left."
                    )
                    character.inventory['sword'] = items.Sword()
                    print(
                        "You walk back to the sign to see if there's anything else you want."
                    )
                    return 'general_store'
                else:
                    print("Sorry, you can't afford that!")
                    return 'general_store'
            elif choice == '2':
                if character.coins > 5:
                    character.coins -= 5
                    print(
                        f"You purchase the dagger. You have {character.coins} coins left."
                    )
                    character.inventory['dagger'] = items.Dagger()
                    print(
                        "You walk back to the sign to see if there's anything else you want."
                    )
                    return 'general_store'
                else:
                    print("Sorry, you can't afford that!")
                    return 'general_store'
            elif choice == '3':
                if character.coins > 2:
                    character.coin -= 2
                    print(
                        f"You purchase the health potion. You have {character.coins} coins left."
                    )
                    character.inventory['health-potion'] = items.HealthPotion()
                    print(
                        "You walk back to the sign to see if there's anything else you want."
                    )
                    return 'general_store'
                else:
                    print("Sorry, you can't afford that!")
                    return 'general_store'
            else:
                print("Not a valid choice, you head back to try again.")
                return 'general_store'

        elif user_input == '2':
            print("You head back out into the town center.")
            return 'town_center'

        else:
            print(
                'The shop owner catches you loitering and kicks you out into the town center.'
            )
            return 'town_center'
예제 #24
0
 def __init__(self, x, y):
     super().__init__(x, y, items.Sword(), "It's a sword!")
예제 #25
0
 def __init__(self):
     self.name = 'the Trader'
     self.gold = 100
     self.inventory = [items.Bread(), items.Bread(),
                     items.HealthPotion(), items.HealthPotion(),
                      items.Sword(),]
예제 #26
0
                    return False
            else:
                pass  # }}}

    def Choose_target(self):  # {{{
        print()
        while True:
            for num, i in enumerate(foes):
                print('{}. {}'.format(num + 1, i.name))
            try:
                target = int(input("Which target? "))
                if target < len(foes) - 1 or target > len(foes):
                    print("\nInvalid target\n")
                else:
                    return target - 1
            except ValueError:
                print("\nInvalid input\n")  # }}}
                continue


town = locations.Town()
hero = characters.Hero(50)
hero.weapon = items.Sword()
foes = [characters.Goblin(10), characters.Goblin(10)]
hero.Add_effect(effects.Poison(2))
hero.add_item(items.Potion(), 5)
hero.add_item(items.Longsword(), 1)
fight = Battle()
fight.Battle_start()
fight.Battle_engine()
예제 #27
0
 def __init__(self):
     self.weapon = items.Sword()
     self.health = 20
     self.name = goblin