Ejemplo n.º 1
0
def armor_event(player_team):
    """
    Runs the armor event. Generates a piece of low-level armor.
    """
    print(
        "You see a piece of armor lying on the ground. You pick it up and put it in your backpack."
    )
    r = random.randint(0, 3)
    if r == 0:
        item = Item.Armor("Leather Helmet",
                          "A leather helmet to prevent light injuries.",
                          "Leather", "helmet", player_team)
    elif r == 1:
        item = Item.Armor("Leather Chest Piece",
                          "Leather armor to prevent light injuries.",
                          "Leather", "torso", player_team)
    elif r == 2:
        item = Item.Armor("Leather Pants", "Essentially leggings.", "Leather",
                          "leggings", player_team)
    elif r == 3:
        item = Item.Armor("Leather Boots",
                          "Stylish leather boots. Just do it.", "Leather",
                          "boots", player_team)

    player_team[0].backpack.append(item)
    return
Ejemplo n.º 2
0
def chest(player_team):
    """
    Generates a chest.
    """
    c = random.randint(1, 2)
    #c = 1 # FIXME: delete when armor and weapons implemented
    if c == 0:
        print("Not here yet.")
    # armor
    elif c == 1:  # FIXME: names are weird
        a_types = ["Chain", "Plate"]
        a_names = ["helmet", "torso", "leggings", "boots"]

        t = random.choice(a_types)
        p = random.choice(a_names)

        item = Item.Armor("{} {}".format(t, p.capitalize()),
                          "A sturdy piece of armor.", t, p, player_team)
    # potion
    elif c == 2:
        potions = ["Minor", "Normal", "Major"]
        t = random.choice(potions)
        item = Item.Healing_Potion("{} Healing Potion".format(t),
                                   "Heals a character.", t)

    g = random.randint(100, 200)
    print("You found {} gold!".format(g))
    player_team[0].gold += g
    print("You found {}!".format(item.name))
    player_team[0].backpack.append(item)
    return
Ejemplo n.º 3
0
 def start(self):
     KWSword = Item.Weapon("K.W. Sword", 40, 200)
     self.stock.append(KWSword)
     Sword2 = Item.Weapon("Bilgewater Cutlass", 50, 400)
     self.stock.append(Sword2)
     Sword3 = Item.Weapon("Infinity Edge", 80, 500)
     self.stock.append(Sword3)
     Sword4 = Item.Weapon("Hexdrinker", 100, 700)
     self.stock.append(Sword4)
     Hammer = Item.Weapon("Warhammer", 100, 600)
     self.stock.append(Hammer)
     Hammer2 = Item.Weapon("Frozem Mallet", 110, 700)
     self.stock.append(Hammer2)
     armor1 = Item.Armor("Chain Vest", 40, 100)
     self.stock.append(armor1)
     armor2 = Item.Armor("Randuin's Omen", 80, 300)
     self.stock.append(armor2)
     Hero.Magni.print_eq()
SWEP.Catagory = 'Simple'
SWEP.Handedness = 'One-Handed'
SWEP.Cost = 0
SWEP.Damage[0] = 1
SWEP.Damage[1] = 6
SWEP.Size = 'Medium'
SWEP.Critical = [20,2]
SWEP.Range = 10
SWEP.Weight = 3
SWEP.Type = ['B']
SWEP.Special = []
SWEP.Source = 'PRG:CRB'
SWEP.Text = 'This weapon is usually just a shaped piece of wood, sometimes with a few nails or studs embedded in it.'
SWEP.Enchantments = None

SARM = Item.Armor()
SARM.Name = 'Fullplate'
SARM.IsArmor = True
SARM.Price = 1500
SARM.ACBonus = 9
SARM.MaxDex = 1
SARM.ArmorPenalty = -6
SARM.SpellFailure = 35
SARM.Speed = [20,15]
SARM.Weight = 50
SARM.text = 'This metal suit includes gauntlets, heavy leather boots, a visored helmet, and a thick layer of padding that is worn underneath the armor. Each suit of full plate must be individually fitted to its owner by a master armorsmith, although a captured suit can be resized to fit a new owner at a cost of 200 to 800 (2d4 × 100) gold pieces.'
SARM.Source = 'PRG:CRB'

Test = Character()
Test.cls[0] = ClassEx
Test.stats['str'] = 15
Ejemplo n.º 5
0
    def print_armor(self):
        if not self.armory:
            print("No armor")
        else:
            for x in self.armory:
                print(x.name)

    def check(self, other):
        return self.lhand_weapon[0].name == other.name


global Magni
Magni = Hero("Magni", 1000, 50, 10)
miecz = Item.Weapon("K.W. Miecz", 50, 300)
zbroja = Item.Armor("Zbroja", 100, 300)


class GameScrean(Screen):
    def __init__(self, **kwargs):
        super(GameScrean, self).__init__(**kwargs)

        self.rig = self.ids['right_box']
        self.lbl = self.ids['left_box']
        self.print_eq()
        self.print_stats()
        self.lbl.text = Magni.name
        Clock.schedule_interval(self.update, 1 / 1.0)

    def save_game(self):
        #Magni.save_game()