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
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
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
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
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
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
def set_melee_weapon_component(item): item.set_child(EquipmentType(equipment.EquipmentTypes.MELEE_WEAPON)) item.set_child(ItemType(ItemType.WEAPON)) item.set_child(DamageType(DamageTypes.PHYSICAL)) item.set_child(AddSpoofChildEquipEffect2(WeaponMeleeAttacker(item))) item.set_child(ReEquipAction())
def before_attack_effect(self, source_entity, target_entity): self.parent.add_spoof_child(DamageType(DamageTypes.IGNORE_ARMOR))