Пример #1
0
def new_morning_star(game_state):
    """
    A composite component representing a Sword item.
    """
    mace = Composite()
    set_item_components(mace, game_state)
    set_melee_weapon_component(mace)
    mace.set_child(
        Description(
            "Morning Star",
            "This old club has an lump of iron with rusty spikes at one end."))
    mace.set_child(GraphicChar(None, colors.GRAY, icon.MORNING_STAR))
    mace.set_child(DataPoint(DataTypes.WEIGHT, 8))

    mace.set_child(accuracy_item_stat(8))
    mace.set_child(damage_item_stat(1, 6))

    mace.set_child(CritChanceBonusEffect(0.1))
    mace.set_child(crit_multiplier_item_stat(2))

    mace.set_child(StunAttackEffect(0.2))
    mace.set_child(IgnoreArmorAttackEffect(0.2))
    mace.set_child(BleedAttackEffect(0.1))

    return mace
Пример #2
0
def new_chain_and_ball(game_state):
    """
    A composite component representing a Sword item.
    """
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description(
            "Chain and Spike Ball",
            "A huge metal ball on a chain, hard to use but can deal massive damage."
        ))
    c.set_child(GraphicChar(None, colors.GRAY, icon.BALL_AND_CHAIN))
    c.set_child(DataPoint(DataTypes.WEIGHT, 8))

    c.set_child(damage_item_stat(2, 9))
    c.set_child(accuracy_item_stat(5))

    c.set_child(CritChanceBonusEffect(0.10))
    c.set_child(crit_multiplier_item_stat(2))

    c.set_child(KnockBackAttackEffect(0.20))
    c.set_child(DefenciveAttackEffect(0.60))
    c.set_child(IgnoreArmorAttackEffect(0.10))
    return c
Пример #3
0
def new_trident(game_state):
    """
    A composite component representing a Sword item.
    """
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description(
            "Trident",
            "A long stick with a with three sharp points at one end."
            "It's a useful weapon when you want to keep danger at bay."))
    c.set_child(GraphicChar(None, colors.ORANGE_D, icon.TRIDENT))
    c.set_child(DataPoint(DataTypes.WEIGHT, 8))

    c.set_child(accuracy_item_stat(10))
    c.set_child(damage_item_stat(1, 5))

    c.set_child(CritChanceBonusEffect(0.15))
    c.set_child(crit_multiplier_item_stat(2.5))

    c.set_child(DefenciveAttackEffect(0.75))
    c.set_child(BleedAttackEffect(0.20))

    return c
Пример #4
0
def new_kris(game_state):
    """
    A composite component representing a Knife item.
    """
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description(
            "Kris",
            "A dagger with a wavy blade, its sharp end can cause major damage."
        ))
    c.set_child(GraphicChar(None, colors.GRAY_D, icon.KRIS))
    c.set_child(DataPoint(DataTypes.WEIGHT, 5))
    c.set_child(DamageType(DamageTypes.CUTTING))

    c.set_child(damage_item_stat(1, 3))
    c.set_child(accuracy_item_stat(15))

    c.set_child(CritChanceBonusEffect(0.20))
    c.set_child(crit_multiplier_item_stat(3.5))

    c.set_child(ExtraSwingAttackEffect(0.2))
    c.set_child(BleedAttackEffect(0.2))

    return c
Пример #5
0
def new_dagger(game_state):
    """
    A composite component representing a Knife item.
    """
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description(
            "Dagger",
            "A trusty dagger, small and precise but will only inflict small wounds."
        ))
    c.set_child(GraphicChar(None, colors.GRAY, icon.DAGGER))
    c.set_child(DataPoint(DataTypes.WEIGHT, 5))
    c.set_child(DamageType(DamageTypes.CUTTING))

    c.set_child(damage_item_stat(1, 3))
    c.set_child(accuracy_item_stat(15))

    c.set_child(CritChanceBonusEffect(0.2))
    c.set_child(crit_multiplier_item_stat(3.5))

    c.set_child(ExtraSwingAttackEffect(0.20))
    c.set_child(BleedAttackEffect(0.10))

    return c
Пример #6
0
 def test_weapon_with_defencive_attack_effect_gives_wielder_counter_attack_bonus(
         self):
     test_weapon = get_dummy_weapon()
     test_weapon.set_child(CritChanceBonusEffect(TEST_VALUE))
     actor = get_dummy_actor()
     actor.set_child(WeaponMeleeAttacker(test_weapon))
     self.weapon_with_player_stat_bonus_should_give_player_stat_bonus(
         DataTypes.CRIT_CHANCE, TEST_VALUE, test_weapon, actor)
     self.assertEqual(actor.melee_attacker.crit_chance, TEST_VALUE)
Пример #7
0
def new_hammer(game_state):
    """
    A composite component representing a Sword item.
    """
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description("Hammer", "A heavy hammer, it may knock away enemies."))
    c.set_child(GraphicChar(None, colors.GRAY, icon.HAMMER))
    c.set_child(DataPoint(DataTypes.WEIGHT, 8))

    c.set_child(damage_item_stat(1, 7))
    c.set_child(accuracy_item_stat(8))

    c.set_child(CritChanceBonusEffect(0.15))
    c.set_child(crit_multiplier_item_stat(2))

    c.set_child(KnockBackAttackEffect(0.35))
    return c
Пример #8
0
def new_club(game_state):
    """
    A composite component representing a Sword item.
    """
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description("Club",
                    "A thick wooden stick, It may be used as a weapon."))
    c.set_child(GraphicChar(None, colors.ORANGE_D, icon.CLUB))
    c.set_child(DataPoint(DataTypes.WEIGHT, 8))

    c.set_child(damage_item_stat(1, 6))
    c.set_child(accuracy_item_stat(8))

    c.set_child(CritChanceBonusEffect(0.1))
    c.set_child(crit_multiplier_item_stat(1.5))

    c.set_child(StunAttackEffect(0.3))
    return c
Пример #9
0
def new_bolas(game_state):
    sling = Composite()
    set_item_components(sling, game_state)
    set_ranged_weapon_components(sling)
    sling.set_child(RangeWeaponType(RangeWeaponType.SLING))
    sling.set_child(
        Description(
            "Bolas",
            "Two weights strung together by a string, when thrown they may trip the victim."
        ))
    sling.set_child(GraphicChar(None, colors.CHAMPAGNE, icon.HEART + 18))
    sling.set_child(DataPoint(DataTypes.WEAPON_RANGE, 4))
    sling.set_child(DataPoint(DataTypes.WEIGHT, 3))
    sling.set_child(accuracy_item_stat(3))
    sling.set_child(damage_item_stat(1, 2))

    sling.set_child(CritChanceBonusEffect(0.2))
    sling.set_child(crit_multiplier_item_stat(2.0))

    sling.set_child(TripAttackEffect(0.4))
    return sling
Пример #10
0
def new_sling(game_state):
    sling = Composite()
    set_item_components(sling, game_state)
    set_ranged_weapon_components(sling)
    sling.set_child(RangeWeaponType(RangeWeaponType.SLING))
    sling.set_child(
        Description(
            "Sling",
            "This weapon propels rocks more effectively than throwing them would."
        ))
    sling.set_child(GraphicChar(None, colors.ORANGE, icon.SLING))
    sling.set_child(DataPoint(DataTypes.WEAPON_RANGE, 4))
    sling.set_child(DataPoint(DataTypes.WEIGHT, 3))
    sling.set_child(accuracy_item_stat(5))
    sling.set_child(damage_item_stat(1, 3))

    sling.set_child(CritChanceBonusEffect(0.2))
    sling.set_child(crit_multiplier_item_stat(2.0))

    sling.set_child(StunAttackEffect(1))

    return sling
Пример #11
0
def new_gun(game_state):
    gun = Composite()
    set_item_components(gun, game_state)
    set_ranged_weapon_components(gun)
    gun.set_child(RangeWeaponType(RangeWeaponType.GUN))
    gun.set_child(
        Description(
            "Gun", "This was once a fine weapon, \
                               but age has torn it real bad.\n\
                               The wooden handle is dry and gray, \
                               you see rust eating into the iron pipe."))
    gun.set_child(GraphicChar(None, colors.WHITE, icon.GUN))
    gun.set_child(DataPoint(DataTypes.WEAPON_RANGE, 15))
    gun.set_child(accuracy_item_stat(13))
    gun.set_child(damage_item_stat(5, 25))
    gun.set_child(BleedAttackEffect(1))

    gun.set_child(CritChanceBonusEffect(0.3))
    gun.set_child(crit_multiplier_item_stat(2.0))

    gun.set_child(DataPoint(DataTypes.WEIGHT, 5))
    return gun
Пример #12
0
def new_claw(game_state):
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description("Claws",
                    "A pair of gloves with sharp blades attached to them,"))
    c.set_child(GraphicChar(None, colors.CHAMPAGNE, icon.CLAWS))
    c.set_child(DataPoint(DataTypes.WEIGHT, 5))
    c.set_child(DamageType(DamageTypes.BLUNT))

    c.set_child(damage_item_stat(1, 3))
    c.set_child(accuracy_item_stat(17))

    c.set_child(CritChanceBonusEffect(0.10))
    c.set_child(crit_multiplier_item_stat(2))

    c.set_child(ExtraSwingAttackEffect(0.15))
    c.set_child(CounterAttackEffect(0.20))
    c.set_child(BleedAttackEffect(0.30))

    return c
Пример #13
0
def new_whip(game_state):
    """
    A composite component representing a Sword item.
    """
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description("Whip", "An unusual weapon, most often used for torture."))
    c.set_child(GraphicChar(None, colors.ORANGE_D, icon.WHIP))
    c.set_child(DataPoint(DataTypes.WEIGHT, 8))

    c.set_child(accuracy_item_stat(10))
    c.set_child(damage_item_stat(1, 4))

    c.set_child(CritChanceBonusEffect(0.15))
    c.set_child(crit_multiplier_item_stat(2.5))

    c.set_child(TripAttackEffect(0.50))
    c.set_child(DefenciveAttackEffect(0.30))
    c.set_child(StunAttackEffect(0.10))

    return c
Пример #14
0
def new_cestus(game_state):
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description(
            "Cestus",
            "A pair of leather battle gloves, they improve your punches."))
    c.set_child(GraphicChar(None, colors.ORANGE_D, icon.GLOVE))
    c.set_child(DataPoint(DataTypes.WEIGHT, 5))
    c.set_child(DamageType(DamageTypes.BLUNT))

    c.set_child(damage_item_stat(1, 3))
    c.set_child(accuracy_item_stat(17))

    c.set_child(CritChanceBonusEffect(0.10))
    c.set_child(crit_multiplier_item_stat(2))

    c.set_child(ExtraSwingAttackEffect(0.3))
    c.set_child(CounterAttackEffect(0.2))
    c.set_child(StunAttackEffect(0.2))

    return c
Пример #15
0
def new_rapier(game_state):
    """
    A composite component representing a Sword item.
    """
    sword = Composite()
    set_item_components(sword, game_state)
    set_melee_weapon_component(sword)
    sword.set_child(
        Description("Rapier",
                    "A sword with a thin sharp blade, swift but deadly."))
    sword.set_child(GraphicChar(None, colors.CHAMPAGNE, icon.RAPIER))
    sword.set_child(DataPoint(DataTypes.WEIGHT, 8))

    sword.set_child(damage_item_stat(2, 5))
    sword.set_child(accuracy_item_stat(10))

    sword.set_child(CritChanceBonusEffect(0.2))
    sword.set_child(crit_multiplier_item_stat(2.5))

    sword.set_child(ExtraSwingAttackEffect(0.1))
    sword.set_child(CounterAttackEffect(0.1))
    sword.set_child(OffenciveAttackEffect(0.1))
    return sword
Пример #16
0
def new_scimitar(game_state):
    """
    A composite component representing a Sword item.
    """
    sword = Composite()
    set_item_components(sword, game_state)
    set_melee_weapon_component(sword)
    sword.set_child(
        Description("Scimitar",
                    "A curved sword, an ancient design from the east."))
    sword.set_child(GraphicChar(None, colors.WHITE, icon.SCIMITAR))
    sword.set_child(DataPoint(DataTypes.WEIGHT, 8))

    sword.set_child(damage_item_stat(2, 5))
    sword.set_child(accuracy_item_stat(12))

    sword.set_child(CritChanceBonusEffect(0.2))
    sword.set_child(crit_multiplier_item_stat(2.5))

    sword.set_child(ExtraSwingAttackEffect(0.1))
    sword.set_child(DefenciveAttackEffect(0.1))
    sword.set_child(OffenciveAttackEffect(0.1))
    return sword
Пример #17
0
def new_katar(game_state):
    """
    A composite component representing a Knife item.
    """
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description("Katar",
                    "A blade with an unusual handle, it looks ancient."))
    c.set_child(GraphicChar(None, colors.CHAMPAGNE, icon.KATAR))
    c.set_child(DataPoint(DataTypes.WEIGHT, 5))
    c.set_child(DamageType(DamageTypes.CUTTING))

    c.set_child(damage_item_stat(1, 3))
    c.set_child(accuracy_item_stat(17))

    c.set_child(CritChanceBonusEffect(0.10))
    c.set_child(crit_multiplier_item_stat(3))

    c.set_child(ExtraSwingAttackEffect(0.2))
    c.set_child(CounterAttackEffect(0.2))

    return c
Пример #18
0
def new_iron_hand(game_state):
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description(
            "Iron Hand",
            "A pair of iron battle gloves, they put some weight behind your punches."
        ))
    c.set_child(GraphicChar(None, colors.GRAY, icon.GLOVE))
    c.set_child(DataPoint(DataTypes.WEIGHT, 5))
    c.set_child(DamageType(DamageTypes.BLUNT))

    c.set_child(damage_item_stat(1, 3))
    c.set_child(accuracy_item_stat(14))

    c.set_child(CritChanceBonusEffect(0.10))
    c.set_child(crit_multiplier_item_stat(2))

    c.set_child(ExtraSwingAttackEffect(0.20))
    c.set_child(CounterAttackEffect(0.2))
    c.set_child(StunAttackEffect(0.35))

    return c
Пример #19
0
def new_axe(game_state):
    """
    A composite component representing a Sword item.
    """
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description(
            "Axe",
            "This old axe has seen many battles, but age hasn't dulled the blade."
        ))
    c.set_child(GraphicChar(None, colors.GRAY, icon.AXE))
    c.set_child(DataPoint(DataTypes.WEIGHT, 10))

    c.set_child(damage_item_stat(3, 5))
    c.set_child(accuracy_item_stat(8))

    c.set_child(CritChanceBonusEffect(0.1))
    c.set_child(crit_multiplier_item_stat(2))

    c.set_child(OffenciveAttackEffect(0.75))
    c.set_child(BleedAttackEffect(0.1))
    return c
Пример #20
0
def new_halberd(game_state):
    """
    A composite component representing a Sword item.
    """
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description(
            "Halberd", "A long stick with a with an axe-head at one end."
            "It's a useful weapon when you want to keep danger at bay."))
    c.set_child(GraphicChar(None, colors.GRAY, icon.HALBERD))
    c.set_child(DataPoint(DataTypes.WEIGHT, 8))

    c.set_child(accuracy_item_stat(10))
    c.set_child(damage_item_stat(1, 5))

    c.set_child(CritChanceBonusEffect(0.1))
    c.set_child(crit_multiplier_item_stat(2))

    c.set_child(DefenciveAttackEffect(0.75))
    c.set_child(OffenciveAttackEffect(0.20))

    return c
Пример #21
0
def new_spear(game_state):
    """
    A composite component representing a Sword item.
    """
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description(
            "Spear", "A stick with a sharp piece of metal at one end."
            "It's a useful weapon when you want to keep danger at bay."))
    c.set_child(GraphicChar(None, colors.GRAY, icon.SPEAR))
    c.set_child(DataPoint(DataTypes.WEIGHT, 8))

    c.set_child(accuracy_item_stat(10))
    c.set_child(damage_item_stat(1, 5))

    c.set_child(CritChanceBonusEffect(0.1))
    c.set_child(crit_multiplier_item_stat(2))

    c.set_child(DefenciveAttackEffect(0.75))
    c.set_child(CounterAttackEffect(0.1))

    return c
Пример #22
0
def new_sword(game_state):
    """
    A composite component representing a Sword item.
    """
    sword = Composite()
    set_item_components(sword, game_state)
    set_melee_weapon_component(sword)
    sword.set_child(
        Description(
            "Iron Sword",
            "This old blade has seen some better days, it's as sharp as ever tough."
        ))
    sword.set_child(GraphicChar(None, colors.GRAY, icon.SWORD))
    sword.set_child(DataPoint(DataTypes.WEIGHT, 10))

    sword.set_child(damage_item_stat(2, 5))
    sword.set_child(accuracy_item_stat(10))

    sword.set_child(CritChanceBonusEffect(0.1))
    sword.set_child(crit_multiplier_item_stat(2))

    sword.set_child(ExtraSwingAttackEffect(0.1))
    sword.set_child(BleedAttackEffect(0.1))
    return sword
Пример #23
0
def new_flail(game_state):
    """
    A composite component representing a Sword item.
    """
    c = Composite()
    set_item_components(c, game_state)
    set_melee_weapon_component(c)
    c.set_child(
        Description(
            "Flail",
            "A wooden handle with a chain and metal ball attached to it."))
    c.set_child(GraphicChar(None, colors.GRAY, icon.FLAIL))
    c.set_child(DataPoint(DataTypes.WEIGHT, 8))

    c.set_child(damage_item_stat(1, 7))
    c.set_child(accuracy_item_stat(7))

    c.set_child(CritChanceBonusEffect(0.15))
    c.set_child(crit_multiplier_item_stat(2))

    c.set_child(IgnoreArmorAttackEffect(0.3))
    c.set_child(KnockBackAttackEffect(0.2))
    c.set_child(OffenciveAttackEffect(0.1))
    return c