def register_blessed_shield_item():
    item_types = [
        ItemType.BLESSED_SHIELD_1, ItemType.BLESSED_SHIELD_2,
        ItemType.BLESSED_SHIELD_3
    ]
    healing_amounts = [2, 3, 4]
    armor_boost = 2
    ui_icon_sprite = UiIconSprite.ITEM_BLESSED_SHIELD
    sprite = Sprite.ITEM_BLESSED_SHIELD
    register_ui_icon_sprite_path(ui_icon_sprite,
                                 "resources/graphics/item_blessed_shield.png")
    register_entity_sprite_initializer(
        sprite,
        SpriteInitializer("resources/graphics/item_blessed_shield.png",
                          ITEM_ENTITY_SIZE))
    for i in range(3):
        item_type = item_types[i]

        healing_amount = healing_amounts[i]
        stat_modifiers = {
            HeroStat.ARMOR: armor_boost,
            HeroStat.BLOCK_AMOUNT: 6
        }
        effect = ItemEffect(healing_amount, item_type, stat_modifiers)
        register_item_effect(item_type, effect)
        name = "Blessed Shield (" + str(i + 1) + ")"
        description = effect.get_description() + [
            "On block: gain " + str(healing_amount) + " health"
        ]
        item_data = ItemData(ui_icon_sprite, sprite, name, description,
                             ItemEquipmentCategory.OFF_HAND)
        register_item_data(item_type, item_data)
def register_amulet_of_mana_item():
    item_types = [
        ItemType.AMULET_OF_MANA_1, ItemType.AMULET_OF_MANA_2,
        ItemType.AMULET_OF_MANA_3
    ]
    mana_regen_boosts = [0.5, 0.75, 1]
    ui_icon_sprite = UiIconSprite.ITEM_AMULET_OF_MANA
    sprite = Sprite.ITEM_AMULET_OF_MANA
    register_ui_icon_sprite_path(ui_icon_sprite,
                                 "resources/graphics/item_amulet.png")
    register_entity_sprite_initializer(
        sprite,
        SpriteInitializer("resources/graphics/item_amulet.png",
                          ITEM_ENTITY_SIZE))
    for i in range(3):
        item_type = item_types[i]
        mana_regen_boost = mana_regen_boosts[i]
        effect = StatModifyingItemEffect(
            item_type, {HeroStat.MANA_REGEN: mana_regen_boost})
        register_item_effect(item_type, effect)
        name = "Amulet of Mana (" + str(i + 1) + ")"
        description = effect.get_description()
        item_data = ItemData(ui_icon_sprite, sprite, name, description,
                             ItemEquipmentCategory.NECK)
        register_item_data(item_type, item_data)
def register_passive_item(item_type: ItemType, ui_icon_sprite: UiIconSprite,
                          sprite: Sprite, image_file_path: str, name: str,
                          description_lines: List[str]):
    item_effect = EmptyItemEffect(item_type)
    item_data = ItemData(ui_icon_sprite, sprite, name, description_lines)
    register_item_effect(item_type, item_effect)
    register_ui_icon_sprite_path(ui_icon_sprite, image_file_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_file_path, ITEM_ENTITY_SIZE))
    register_item_data(item_type, item_data)
def register_custom_effect_item(
        item_type: ItemType,
        ui_icon_sprite: UiIconSprite,
        sprite: Sprite,
        image_file_path: str,
        item_equipment_category: ItemEquipmentCategory,
        name: str,
        item_effect: AbstractItemEffect):
    item_data = ItemData(ui_icon_sprite, sprite, name, item_effect.get_description(), item_equipment_category)
    register_item_effect(item_type, item_effect)
    register_ui_icon_sprite_path(ui_icon_sprite, image_file_path)
    register_entity_sprite_initializer(sprite, SpriteInitializer(image_file_path, ITEM_ENTITY_SIZE))
    register_item_data(item_type, item_data)
def register_stat_modifying_item(
        item_type: ItemType, ui_icon_sprite: UiIconSprite, sprite: Sprite,
        image_file_path: str, item_equipment_category: ItemEquipmentCategory,
        name: str, stat_modifiers: Dict[HeroStat, Union[int, float]]):
    item_effect = StatModifyingItemEffect(item_type, stat_modifiers)
    item_data = ItemData(ui_icon_sprite, sprite, name,
                         item_effect.get_description(),
                         item_equipment_category)
    register_item_effect(item_type, item_effect)
    register_ui_icon_sprite_path(ui_icon_sprite, image_file_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_file_path, ITEM_ENTITY_SIZE))
    register_item_data(item_type, item_data)
Пример #6
0
def register_freezing_gauntlet_item():
    ui_icon_sprite = UiIconSprite.ITEM_FREEZING_GAUNTLET
    sprite = Sprite.ITEM_FREEZING_GAUNTLET
    image_file_path = "resources/graphics/item_freezing_gauntlet.png"
    register_ui_icon_sprite_path(ui_icon_sprite, image_file_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_file_path, ITEM_ENTITY_SIZE))
    register_item_effect(ITEM_TYPE, ItemEffect(ITEM_TYPE))
    name = "Freezing Gauntlet"
    description = ["Slows your targets by " + str(int(SLOW_AMOUNT * 100)) + "% for " \
                   + "{:.1f}".format(SLOW_DURATION / 1000) + "s"]
    item_data = ItemData(ui_icon_sprite, sprite, name, description,
                         ItemEquipmentCategory.MAIN_HAND)
    register_item_data(ITEM_TYPE, item_data)
    register_buff_effect(BUFF_TYPE, DebuffedByFreezingGauntlet)
Пример #7
0
def register_blood_amulet():
    ui_icon_sprite = UiIconSprite.ITEM_BLOOD_AMULET
    sprite = Sprite.ITEM_BLOOD_AMULET
    image_file_path = "resources/graphics/item_blood_amulet.png"
    register_ui_icon_sprite_path(ui_icon_sprite, image_file_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_file_path, ITEM_ENTITY_SIZE))
    register_item_effect(ITEM_TYPE, ItemEffect(ITEM_TYPE))
    name = "Blood Amulet"
    description = [
        str(int(PROC_CHANCE * 100)) + "% on kill: gain " +
        str(HEALTH_ON_KILL_AMOUNT) + " health"
    ]
    item_data = ItemData(ui_icon_sprite, sprite, name, description,
                         ItemEquipmentCategory.NECK)
    register_item_data(ITEM_TYPE, item_data)
def register_orb_of_the_magi_item():
    item_types = [ItemType.ORB_OF_THE_MAGI_1, ItemType.ORB_OF_THE_MAGI_2, ItemType.ORB_OF_THE_MAGI_3]
    multiplier_bonuses = [0.1, 0.15, 0.2]
    ui_icon_sprite = UiIconSprite.ITEM_ORB_OF_THE_MAGI
    sprite = Sprite.ITEM_ORB_OF_THE_MAGI
    image_file_path = "resources/graphics/item_orb_of_the_magi.png"
    register_ui_icon_sprite_path(ui_icon_sprite, image_file_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_file_path, ITEM_ENTITY_SIZE))
    for i in range(3):
        item_type = item_types[i]
        bonus = multiplier_bonuses[i]
        effect = StatModifyingItemEffect(item_type, {HeroStat.MAGIC_DAMAGE: bonus})
        register_item_effect(item_type, effect)
        name = "Orb of the Magi (" + str(i + 1) + ")"
        description = effect.get_description()
        item_data = ItemData(ui_icon_sprite, sprite, name, description, ItemEquipmentCategory.OFF_HAND)
        register_item_data(item_type, item_data)
Пример #9
0
def register_goats_ring():
    ui_icon_sprite = UiIconSprite.ITEM_GOATS_RING
    sprite = Sprite.ITEM_GOATS_RING
    image_file_path = "resources/graphics/item_goats_ring.png"
    register_ui_icon_sprite_path(ui_icon_sprite, image_file_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_file_path, ITEM_ENTITY_SIZE))
    register_item_effect(ITEM_TYPE, ItemEffect(ITEM_TYPE))
    name = "The Goat's Curse"
    description = [
        "Whenever you damage an enemy, there is a  " +
        str(int(PROC_CHANCE * 100)) +
        "% chance that it will be cursed and take additional magic damage over time"
    ]
    item_data = ItemData(ui_icon_sprite, sprite, name, description,
                         ItemEquipmentCategory.RING)
    register_item_data(ITEM_TYPE, item_data)
    register_buff_effect(BUFF_TYPE, DebuffedByGoatsRing)
def register_healing_wand_item():
    item_type = ItemType.HEALING_WAND
    ui_icon_sprite = UiIconSprite.ITEM_HEALING_WAND
    sprite = Sprite.ITEM_HEALING_WAND
    image_file_path = "resources/graphics/item_healing_wand.png"
    register_ui_icon_sprite_path(ui_icon_sprite, image_file_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_file_path, ITEM_ENTITY_SIZE))
    register_item_effect(item_type, ItemEffect(item_type))
    name = "Healing wand"
    description = [
        "When you damage an enemy, gain +" + str(HEALTH_REGEN_BONUS) +
        " health regen for " + "{:.0f}".format(BUFF_DURATION / 1000) + "s"
    ]
    item_data = ItemData(ui_icon_sprite, sprite, name, description,
                         ItemEquipmentCategory.MAIN_HAND)
    register_item_data(item_type, item_data)
    register_buff_effect(BUFF_TYPE, BuffedByHealingWand)
    register_buff_text(BUFF_TYPE, "Healing wand")
Пример #11
0
def register_blue_robe_item():
    item_types = [ItemType.BLUE_ROBE_1, ItemType.BLUE_ROBE_2, ItemType.BLUE_ROBE_3]
    mana_amounts = [10, 15, 20]
    mana_regen_boost = 0.3
    ui_icon_sprite = UiIconSprite.ITEM_BLUE_ROBE
    sprite = Sprite.ITEM_BLUE_ROBE
    register_ui_icon_sprite_path(ui_icon_sprite, "resources/graphics/item_blue_robe.png")
    register_entity_sprite_initializer(
        sprite, SpriteInitializer("resources/graphics/item_blue_robe.png", ITEM_ENTITY_SIZE))
    for i in range(3):
        item_type = item_types[i]
        mana_amount = mana_amounts[i]
        effect = StatModifyingItemEffect(item_type, {
            HeroStat.MANA_REGEN: mana_regen_boost,
            HeroStat.MAX_MANA: mana_amount
        })
        register_item_effect(item_type, effect)
        name = "Blue Robe (" + str(i + 1) + ")"
        description = effect.get_description()
        item_data = ItemData(ui_icon_sprite, sprite, name, description, ItemEquipmentCategory.CHEST)
        register_item_data(item_type, item_data)
def register_orb_of_life_item():
    item_types = [
        ItemType.ORB_OF_LIFE_1, ItemType.ORB_OF_LIFE_2, ItemType.ORB_OF_LIFE_3
    ]
    bonuses = [0.04, 0.06, 0.08]
    ui_icon_sprite = UiIconSprite.ITEM_ORB_OF_LIFE
    sprite = Sprite.ITEM_ORB_OF_LIFE
    image_file_path = "resources/graphics/item_orb_of_life.png"
    register_ui_icon_sprite_path(ui_icon_sprite, image_file_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_file_path, ITEM_ENTITY_SIZE))
    for i in range(3):
        item_type = item_types[i]
        bonus = bonuses[i]
        effect = StatModifyingItemEffect(item_type,
                                         {HeroStat.LIFE_STEAL: bonus})
        register_item_effect(item_type, effect)
        name = "Orb of Life (" + str(i + 1) + ")"
        description = effect.get_description()
        item_data = ItemData(ui_icon_sprite, sprite, name, description,
                             ItemEquipmentCategory.OFF_HAND)
        register_item_data(item_type, item_data)
def register_noble_defender():
    item_type = ItemType.NOBLE_DEFENDER
    armor_boost = 4
    ui_icon_sprite = UiIconSprite.ITEM_NOBLE_DEFENDER
    sprite = Sprite.ITEM_NOBLE_DEFENDER
    image_file_path = "resources/graphics/item_noble_defender.png"
    register_ui_icon_sprite_path(ui_icon_sprite, image_file_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_file_path, ITEM_ENTITY_SIZE))
    effect = ItemEffect(item_type, {
        HeroStat.ARMOR: armor_boost,
        HeroStat.BLOCK_AMOUNT: 10
    })
    register_item_effect(item_type, effect)
    name = "Noble defender"
    description = effect.get_description() + \
                  ["When you are attacked, your movement speed is slowed by {:.0f}".format(SLOW_AMOUNT * 100) +
                   "% for " + "{:.1f}".format(SLOW_DURATION / 1000) + "s"]

    item_data = ItemData(ui_icon_sprite, sprite, name, description,
                         ItemEquipmentCategory.OFF_HAND)
    register_item_data(item_type, item_data)
    register_buff_effect(BUFF_TYPE_SLOWED, SlowedFromNobleDefender)
def register_orb_of_wisdom_item():
    item_types = [
        ItemType.ORB_OF_WISDOM_1, ItemType.ORB_OF_WISDOM_2,
        ItemType.ORB_OF_WISDOM_3
    ]
    bonuses = [0.5, 0.75, 1]
    ui_icon_sprite = UiIconSprite.ITEM_ORB_OF_WISDOM
    sprite = Sprite.ITEM_ORB_OF_WISDOM
    image_file_path = "resources/graphics/item_orb_of_wisdom.png"
    register_ui_icon_sprite_path(ui_icon_sprite, image_file_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_file_path, ITEM_ENTITY_SIZE))
    for i in range(3):
        item_type = item_types[i]
        bonus = bonuses[i]
        effect = StatModifyingItemEffect(item_type,
                                         {HeroStat.MANA_REGEN: bonus})
        register_item_effect(item_type, effect)
        name = "Orb of Wisdom (" + str(i + 1) + ")"
        description = effect.get_description()
        item_data = ItemData(ui_icon_sprite, sprite, name, description,
                             ItemEquipmentCategory.OFF_HAND)
        register_item_data(item_type, item_data)