def iron_helmet(x, y):
    equippable_component = Equippable(EquipmentSlots.Head, armour_bonus=1)
    return Entity(x,
                  y,
                  '^',
                  libtcod.light_grey,
                  'Iron Helmet',
                  'An iron helmet designed to help minimise head wounds.',
                  equippable=equippable_component)
def iron_buckler(x, y):
    equippable_component = Equippable(EquipmentSlots.Off_Hand, armour_bonus=1)
    return Entity(
        x,
        y,
        ']',
        libtcod.light_grey,
        'Iron Buckler',
        'A small buckler that can be attached to the arm and used to deflect attacks.',
        equippable=equippable_component)
def steel_platelegs(x, y):
    equippable_component = Equippable(EquipmentSlots.Legs, armour_bonus=2)
    return Entity(
        x,
        y,
        '}',
        libtcod.white,
        'Steel Platelegs',
        'All the components of a solid, medieval-style set of plated leg armour stand before you; tassets, '
        'cuisses and greaves all made from dented, but reasonable quality steel.',
        equippable=equippable_component)
def leather_armour(x, y):
    equippable_component = Equippable(EquipmentSlots.Torso, armour_bonus=1)
    return Entity(
        x,
        y,
        ']',
        libtcod.dark_orange,
        'Leather Armour',
        'Basic leather armour covering the torso, providing modest protection. This was the best you could '
        'find...',
        equippable=equippable_component)
def iron_dagger(x, y):
    equippable_component = Equippable(EquipmentSlots.Main_Hand,
                                      damage_dice=1,
                                      damage_sides=3)
    return Entity(x,
                  y,
                  '-',
                  libtcod.light_grey,
                  'Iron Dagger',
                  'A short blade ideal for swift stabbing attacks.',
                  equippable=equippable_component)
def steel_cuirass(x, y):
    equippable_component = Equippable(EquipmentSlots.Torso, armour_bonus=3)
    return Entity(
        x,
        y,
        ']',
        libtcod.white,
        'Steel Cuirass',
        'A medieval steel chestplate, frayed with rust and various unusual discolourations. Despite the'
        'moderate lack of structural integrity, this will still provide ample protection against most'
        'conventional weaponry.',
        equippable=equippable_component)
def steel_bascinet(x, y):
    equippable_component = Equippable(EquipmentSlots.Head, armour_bonus=2)
    return Entity(
        x,
        y,
        '^',
        libtcod.lighter_grey,
        'Steel Bascinet',
        'A crescent-moon shaped slot is cut into the front of this helmet made of interlocking plate. The '
        'front of the faceguard protrudes confidently in the assurance that all but the most mortal of wounds'
        'will simply glance off harmlessly.',
        equippable=equippable_component)
def steel_greatshield(x, y):
    equippable_component = Equippable(EquipmentSlots.Off_Hand, armour_bonus=2)
    return Entity(
        x,
        y,
        ')',
        libtcod.lighter_grey,
        'Steel Heraldic Greatshield',
        'A steel greatshield once emblazoned with the heraldry of an ancient house. Although the image is'
        'mostly concealed by time, you are still able to make out what appears to be a crowned, upright'
        'bear dancing on a blood-stained field of wheat.',
        equippable=equippable_component)
def steel_dagger(x, y):
    equippable_component = Equippable(EquipmentSlots.Main_Hand,
                                      damage_dice=1,
                                      damage_sides=3,
                                      dexterity_bonus=1)
    return Entity(
        x,
        y,
        '-',
        libtcod.lighter_grey,
        'Steel Dagger',
        'A wicked, slightly curved steel dagger with an ivory hilt embezzled with eastern filigree. Although'
        'not as dangerous as a longsword, you feel more able to avoid attacks when wielding this weapon.',
        equippable=equippable_component)
def trickster_gloves(x, y):
    equippable_component = Equippable(EquipmentSlots.Hands,
                                      armour_bonus=1,
                                      dexterity_bonus=2)
    return Entity(
        x,
        y,
        ')',
        libtcod.darker_orange,
        'Trickster\'s Gloves',
        'These dark, leather gloves which extend to the elbow not only provide safety against any intruding '
        'fangs, but cause you to question whether the nagging sense of kleptomania you are experiencing '
        'has always been an inherent aspect of your personality.',
        equippable=equippable_component)
def steel_mace(x, y):
    equippable_component = Equippable(EquipmentSlots.Main_Hand,
                                      damage_dice=2,
                                      damage_sides=3,
                                      strength_bonus=2)
    return Entity(
        x,
        y,
        '*',
        libtcod.lighter_grey,
        'Steel Mace',
        'A heavy, flanged steel mace half as long as you are tall. Designed for use against heavily armoured'
        'opponents, a square hit from this behemoth is enough to dent chestpieces, ribcages and all '
        'manner of mutated chitin',
        equippable=equippable_component)
def steel_longsword(x, y):
    equippable_component = Equippable(EquipmentSlots.Main_Hand,
                                      damage_dice=1,
                                      damage_sides=6,
                                      strength_bonus=1)
    return Entity(
        x,
        y,
        '/',
        libtcod.lighter_grey,
        'Steel Longsword',
        'A highly polished, sharp steel longsword with an engraved hilt made of bone. Judging by the chirped '
        'chevrons processing up the blade\'s body, this is undoubtedly a weapon belonging to the Cleansing '
        'Hand, discarded either as a result of a hasty slaughter or the gentle caress of insanity.',
        equippable=equippable_component)
def iron_longsword(x, y):
    equippable_component = Equippable(EquipmentSlots.Main_Hand,
                                      damage_dice=1,
                                      damage_sides=4,
                                      strength_bonus=1)
    return Entity(
        x,
        y,
        '/',
        libtcod.light_grey,
        'Iron Longsword',
        'A medieval-style iron longsword which appears to have seen much use. You ponder '
        'whether this weapon is the remnant of some ancient expedition, or if some unusual '
        'intelligence gripped the SludgeWork\'s inhabitants to forge weapons of war.',
        equippable=equippable_component)
def wax_coated_ring(x, y):
    equippable_component = Equippable(EquipmentSlots.Left_Hand,
                                      dexterity_bonus=2,
                                      vitality_bonus=2)
    return Entity(
        x,
        y,
        '.',
        libtcod.dark_yellow,
        'Wax-Coated Ring',
        'A ring completely covered in a darkened yellow wax which is impossible to remove. You surmise that '
        'this material exists not to prevent damage to the ring, but to impart permanence to the inherent '
        'power within this object and protect it from the natural corruption of the SludgeWorks. Just by '
        'holding the ring, the impending doom of your certain demise feels slightly lifted.',
        equippable=equippable_component)
def influenced_hatchet(x, y):
    equippable_component = Equippable(EquipmentSlots.Main_Hand,
                                      damage_dice=3,
                                      damage_sides=3,
                                      strength_bonus=3,
                                      dexterity_bonus=3)
    return Entity(
        x,
        y,
        '|',
        libtcod.light_lime,
        'Influenced Hatchet',
        'Undeniably tainted by the SludgeWorks, what used to be a woodsman\'s tool for chopping wood (or,'
        'perhaps, the local writhing vegetation) has began to turn into a part of the scenery in its own'
        'right. Vines trail from a bundled counterweight at the hilt of the weapon, and the axe\'s edge'
        'remains impossibly sharp, despite years of use. Your instincts feel unnervingly and unnaturally '
        'heightened when holding this weapon.',
        equippable=equippable_component)
Exemple #16
0
def get_game_variables(constants):
    fighter = Fighter(current_hp=20,
                      max_hp=20,
                      damage_dice=1,
                      damage_sides=2,
                      strength=12,
                      dexterity=12,
                      vitality=12,
                      intellect=12,
                      perception=12,
                      level=1,
                      armour=0,
                      dodges=True)
    inventory = Inventory(26)
    level = Level()
    slot = ()
    equipment = Equipment(slot)
    player = Entity(0,
                    0,
                    ord('@'.encode('cp437')),
                    libtcod.white,
                    'Player',
                    'This is you.',
                    blocks=True,
                    render_order=RenderOrder.ACTOR,
                    fighter=fighter,
                    inventory=inventory,
                    level=level,
                    equipment=equipment)
    entities = [player]

    equippable = Equippable(EquipmentSlots.Main_Hand,
                            damage_dice=1,
                            damage_sides=3)
    dagger = Entity(0,
                    0,
                    '-',
                    libtcod.light_grey,
                    'Iron Dagger',
                    'A short blade ideal for swift stabbing attacks.',
                    equippable=equippable)
    equippable = Equippable(EquipmentSlots.Torso, armour_bonus=1)
    leather_armour = Entity(
        0,
        0,
        '-',
        libtcod.light_grey,
        'Leather Armour',
        'Basic leather armour covering the torso, providing modest protection. '
        'This was the best you could find...',
        equippable=equippable)
    player.inventory.spawn_with(player, dagger)
    player.inventory.spawn_with(player, leather_armour)

    # Create the first floor map
    game_map = GameMap('near_surface', constants['map_width'],
                       constants['map_height'])
    game_map.make_map(player, entities)
    game_map.place_entities(constants['map_width'], constants['map_height'],
                            entities)

    message_log = MessageLog(constants['comments_x'],
                             constants['comments_width'],
                             constants['comments_height'])
    game_state = GameStates.PLAYERS_TURN
    return player, entities, game_map, message_log, game_state