Exemplo n.º 1
0
def register_custom_effect_item(
        item_type: ItemType,
        ui_icon_sprite: UiIconSprite,
        sprite: Sprite,
        image_file_path: str,
        item_equipment_category: ItemEquipmentCategory,
        name: str,
        custom_effect: AbstractItemEffect,
        custom_description: List[str],
        stat_modifier_intervals: List[StatModifierInterval],
        item_level: Optional[int] = None,
        is_unique: bool = False):
    if item_level is not None:
        register_item_level(item_type, item_level)
    item_data = ItemData(ui_icon_sprite,
                         sprite,
                         name,
                         custom_description,
                         stat_modifier_intervals,
                         is_unique=is_unique,
                         item_equipment_category=item_equipment_category)
    register_custom_item_effect(item_type, custom_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)
Exemplo n.º 2
0
def register_fireball_ability():
    register_ability_effect(AbilityType.FIREBALL, _apply_ability)
    description = "Shoot a fireball, dealing " + str(MIN_DMG) + "-" + str(MAX_DMG) + \
                  " magic damage to the first enemy that it hits."
    ability_data = AbilityData("Fireball", UiIconSprite.ABILITY_FIREBALL,
                               FIREBALL_MANA_COST, Millis(500), description,
                               SoundId.ABILITY_FIREBALL)
    register_ability_data(AbilityType.FIREBALL, ability_data)
    register_ui_icon_sprite_path(UiIconSprite.ABILITY_FIREBALL,
                                 "resources/graphics/icon_fireball.png")
    register_projectile_controller(ProjectileType.PLAYER_FIREBALL,
                                   ProjectileController)

    sprite_sheet = SpriteSheet(
        "resources/graphics/projectile_player_fireball.png")
    original_sprite_size = (64, 64)
    indices_by_dir = {
        Direction.LEFT: [(x, 0) for x in range(8)],
        Direction.UP: [(x, 2) for x in range(8)],
        Direction.RIGHT: [(x, 4) for x in range(8)],
        Direction.DOWN: [(x, 6) for x in range(8)]
    }
    scaled_sprite_size = (48, 48)
    register_entity_sprite_map(Sprite.PROJECTILE_PLAYER_FIREBALL, sprite_sheet,
                               original_sprite_size, scaled_sprite_size,
                               indices_by_dir, (-9, -9))
    register_buff_effect(BUFF_TYPE, BurntByFireball)
    register_hero_upgrade_effect(HeroUpgradeId.ABILITY_FIREBALL_MANA_COST,
                                 _upgrade_fireball_mana_cost)
Exemplo n.º 3
0
def register_entangling_roots_ability():
    register_ability_effect(ABILITY_TYPE, _apply_ability)
    description = "Stun an enemy and deal " + str(DEBUFF_TOTAL_DAMAGE) + " magic damage over " + \
                  "{:.0f}".format(DEBUFF_DURATION / 1000) + "s."
    mana_cost = 22
    ability_data = AbilityData("Entangling roots", ICON_SPRITE, mana_cost,
                               ENTANGLING_ROOTS_COOLDOWN, description,
                               SoundId.ABILITY_ENTANGLING_ROOTS)
    register_ability_data(ABILITY_TYPE, ability_data)
    register_ui_icon_sprite_path(
        ICON_SPRITE, "resources/graphics/ability_icon_entangling_roots.png")
    register_projectile_controller(PROJECTILE_TYPE, ProjectileController)

    sprite_sheet = SpriteSheet(
        "resources/graphics/projectile_entangling_roots.png")
    original_sprite_size = (165, 214)
    indices_by_dir = {Direction.LEFT: [(x, 0) for x in range(9)]}
    register_entity_sprite_map(PROJECTILE_SPRITE, sprite_sheet,
                               original_sprite_size, PROJECTILE_SIZE,
                               indices_by_dir, (0, 0))
    register_buff_effect(BUFF_TYPE, Rooted)
    _register_engangling_roots_effect_decoration()
    register_hero_upgrade_effect(
        HeroUpgradeId.ABILITY_ENTANGLING_ROOTS_COOLDOWN,
        _upgrade_entangling_roots_cooldown)
Exemplo n.º 4
0
def register_whirlwind_ability():
    ability_type = AbilityType.WHIRLWIND
    ui_icon_sprite = UiIconSprite.ABILITY_WHIRLWIND
    mana_cost = 13
    cooldown = Millis(750)

    register_ability_effect(ability_type, _apply_ability)
    description = "Summon a whirlwind that deals up to " + str(PROJECTILE_MAX_TOTAL_DAMAGE) + \
                  " magic damage to enemies in its path."
    ability_data = AbilityData("Whirlwind", ui_icon_sprite, mana_cost,
                               cooldown, description,
                               SoundId.ABILITY_WHIRLWIND)
    register_ability_data(ability_type, ability_data)
    register_ui_icon_sprite_path(ui_icon_sprite,
                                 "resources/graphics/whirlwind.png")
    sprite_sheet = SpriteSheet(
        "resources/graphics/ability_whirlwind_transparent_spritemap.png")
    original_sprite_size = (94, 111)
    scaled_sprite_size = (140, 140)
    indices_by_dir = {Direction.DOWN: [(0, 0), (1, 0), (2, 0), (1, 0)]}
    register_entity_sprite_map(PROJECTILE_SPRITE, sprite_sheet,
                               original_sprite_size, scaled_sprite_size,
                               indices_by_dir, (-8, -50))
    register_projectile_controller(PROJECTILE_TYPE, ProjectileController)
    register_buff_effect(BUFF_TYPE, Stunned)
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)
Exemplo n.º 6
0
def register_hero_mage():
    sprite = Sprite.HERO_MAGE
    portrait_icon_sprite = PortraitIconSprite.HERO_MAGE
    player_sprite_sheet = SpriteSheet("resources/graphics/player.gif")
    original_sprite_size = (32, 48)
    scaled_sprite_size = (60, 60)
    indices_by_dir = {
        Direction.DOWN: [(0, 0), (1, 0), (2, 0), (3, 0)],
        Direction.LEFT: [(0, 1), (1, 1), (2, 1), (3, 1)],
        Direction.RIGHT: [(0, 2), (1, 2), (2, 2), (3, 2)],
        Direction.UP: [(0, 3), (1, 3), (2, 3), (3, 3)]
    }
    sprite_position_relative_to_entity = (-15, -30)
    register_entity_sprite_map(sprite, player_sprite_sheet,
                               original_sprite_size, scaled_sprite_size,
                               indices_by_dir,
                               sprite_position_relative_to_entity)
    register_portrait_icon_sprite_path(
        portrait_icon_sprite, 'resources/graphics/player_portrait.gif')
    entity_speed = 0.105
    description = "A ranged spellcaster that is explosive but fragile, the mage can take down " \
                  "large groups of enemies effectively, as long as she can keep her distance..."
    hero_data = HeroData(sprite, portrait_icon_sprite,
                         _get_initial_player_state_mage(), entity_speed,
                         PLAYER_ENTITY_SIZE, description)
    register_hero_data(HERO_ID, hero_data)
    register_ui_icon_sprite_path(UiIconSprite.TALENT_LIGHT_FOOTED,
                                 "resources/graphics/boots_of_haste.png")
Exemplo n.º 7
0
def register_randomized_stat_modifying_item(
        item_type: ItemType,
        ui_icon_sprite: UiIconSprite,
        sprite: Sprite,
        image_file_path: str,
        item_equipment_category: ItemEquipmentCategory,
        name: str,
        stat_modifier_intervals: Union[List[StatModifierInterval],
                                       Dict[HeroStat, List[Union[int,
                                                                 float]]]],
        item_level: Optional[int] = None,
        is_unique: bool = False):
    if item_level is not None:
        register_item_level(item_type, item_level)
    register_ui_icon_sprite_path(ui_icon_sprite, image_file_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_file_path, ITEM_ENTITY_SIZE))

    # This is legacy. TODO: only allow list arg
    if isinstance(stat_modifier_intervals, dict):
        stat_modifier_intervals = [
            StatModifierInterval(hero_stat, stat_modifier_intervals[hero_stat])
            for hero_stat in stat_modifier_intervals
        ]

    item_data = ItemData(ui_icon_sprite,
                         sprite,
                         name, [],
                         stat_modifier_intervals,
                         is_unique=is_unique,
                         item_equipment_category=item_equipment_category)
    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)
Exemplo n.º 9
0
def register_teleport_ability():
    register_ability_effect(AbilityType.TELEPORT, _apply_teleport)
    register_ability_data(
        AbilityType.TELEPORT,
        AbilityData("Teleport", UiIconSprite.ABILITY_TELEPORT, 2, Millis(500),
                    "Teleport a short distance", SoundId.ABILITY_TELEPORT))
    register_ui_icon_sprite_path(UiIconSprite.ABILITY_TELEPORT,
                                 "resources/graphics/teleport_icon.png")
Exemplo n.º 10
0
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)
Exemplo n.º 11
0
def register_sword_slash_ability():
    ui_icon_sprite = UiIconSprite.ABILITY_SWORD_SLASH

    register_ability_effect(ABILITY_TYPE, _apply_ability)
    description = "Deal " + str(MIN_DMG) + "-" + str(MAX_DMG) + " physical damage to enemies in front of you."
    register_ability_data(
        ABILITY_TYPE,
        AbilityData("Slash", ui_icon_sprite, 1, ABILITY_SLASH_COOLDOWN, description, SoundId.ABILITY_SLASH))
    register_ui_icon_sprite_path(ui_icon_sprite, "resources/graphics/icon_slash.png")
    register_hero_upgrade_effect(HeroUpgradeId.ABILITY_SLASH_CD, UpgradeSwordSlashCooldown())
Exemplo n.º 12
0
def register_shiv_ability():
    ability_type = AbilityType.SHIV
    ui_icon_sprite = UiIconSprite.ABILITY_SHIV

    register_ability_effect(ability_type, _apply_ability)
    description = "Deal " + str(MIN_DMG) + "-" + str(MAX_DMG) + " physical damage to one enemy in front of you. " + \
                  "[from stealth: 350% damage]"
    ability_data = AbilityData("Shiv", ui_icon_sprite, 1, Millis(400), description, None)
    register_ability_data(ability_type, ability_data)
    register_ui_icon_sprite_path(ui_icon_sprite, "resources/graphics/double_edged_dagger.png")
Exemplo n.º 13
0
def register_heal_ability():
    register_ability_effect(AbilityType.HEAL, _apply_heal)
    register_ability_data(
        AbilityType.HEAL,
        AbilityData("Heal", UiIconSprite.ABILITY_HEAL, 10, Millis(15000),
                    "TODO", None))
    register_ui_icon_sprite_path(UiIconSprite.ABILITY_HEAL,
                                 "resources/graphics/heal_ability.png")
    register_buff_effect(BuffType.HEALING_OVER_TIME, HealingOverTime)
    register_buff_text(BuffType.HEALING_OVER_TIME, "Healing")
Exemplo n.º 14
0
def register_quest_item(
        item_type: ItemType,
        ui_icon_sprite: UiIconSprite,
        sprite: Sprite,
        image_file_path: str,
        name: str,
        description_lines: List[str]):
    item_data = ItemData(ui_icon_sprite, sprite, name, description_lines, [],
                         is_unique=False, item_equipment_category=ItemEquipmentCategory.QUEST)
    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)
Exemplo n.º 15
0
def register_stealth_ability():
    ui_icon_sprite = UiIconSprite.ABILITY_STEALTH

    register_ability_effect(ABILITY_TYPE, _apply_ability)
    description = "Become invisible to enemies, and add effects to your other abilities."
    ability_data = AbilityData("Stealth", ui_icon_sprite, STEALTH_MANA_COST, STEALTH_COOLDOWN, description,
                               SoundId.ABILITY_STEALTH)
    register_ability_data(ABILITY_TYPE, ability_data)
    register_ui_icon_sprite_path(ui_icon_sprite, "resources/graphics/sneak_icon.png")
    register_buff_effect(BUFF_STEALTH, Stealthing)
    register_buff_text(BUFF_STEALTH, "Stealthed")
    register_hero_upgrade_effect(HeroUpgradeId.ABILITY_STEALTH_MANA_COST, UpgradeStealthManaCost())
Exemplo n.º 16
0
def register_infuse_dagger_ability():
    ui_icon_sprite = UiIconSprite.ABILITY_INFUSE_DAGGER

    register_ability_effect(ABILITY_TYPE, _apply_ability)
    description = "Poison an enemy, dealing " + str(TOTAL_DOT_DAMAGE) + " physical damage over " + \
                  "{:.0f}".format(DEBUFF_DURATION / 1000) + "s. [from stealth: stun for full duration]"
    mana_cost = 18
    ability_data = AbilityData(
        "Infuse Dagger", ui_icon_sprite, mana_cost, Millis(10000), description, SoundId.ABILITY_INFUSE_DAGGER)
    register_ability_data(ABILITY_TYPE, ability_data)
    register_ui_icon_sprite_path(ui_icon_sprite, "resources/graphics/ability_infuse_dagger.png")

    register_buff_effect(DEBUFF, DamagedByInfusedDagger)
Exemplo n.º 17
0
def register_health_potion():
    consumable_type = ConsumableType.HEALTH
    sprite = Sprite.POTION_HEALTH
    ui_icon_sprite = UiIconSprite.POTION_HEALTH
    register_consumable_level(consumable_type, 4)
    register_consumable_effect(consumable_type, _apply_health)
    image_path = "resources/graphics/icon_potion_health.png"
    register_entity_sprite_initializer(sprite, SpriteInitializer(image_path, POTION_ENTITY_SIZE))
    register_ui_icon_sprite_path(ui_icon_sprite, image_path)
    description = "Restores " + str(HEALING_AMOUNT) + " health"
    data = ConsumableData(ui_icon_sprite, sprite, "Health potion", description, ConsumableCategory.HEALTH,
                          SoundId.CONSUMABLE_POTION)
    register_consumable_data(consumable_type, data)
Exemplo n.º 18
0
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)
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)
Exemplo n.º 20
0
def register_dash_ability():
    ui_icon_sprite = UiIconSprite.ABILITY_DASH
    register_ability_effect(ABILITY_TYPE, _apply_ability)
    description = "Dash over an enemy, dealing " + str(DAMAGE) + " magic damage. Then, gain +" + \
                  "{:.0f}".format(DODGE_CHANCE_BOOST * 100) + "% dodge chance and +" + \
                  str(HEALTH_REGEN_BOOST) + " health regen"
    mana_cost = 12
    ability_data = AbilityData("Dash", ui_icon_sprite, mana_cost, Millis(4000), description, SoundId.ABILITY_DASH)
    register_ability_data(ABILITY_TYPE, ability_data)
    register_ui_icon_sprite_path(ui_icon_sprite, "resources/graphics/icon_ability_dash.png")
    register_buff_effect(BUFF_AFTER_ENEMY_JUMP, AfterEnemyJump)
    register_buff_text(BUFF_AFTER_ENEMY_JUMP, "Protected")
    register_buff_effect(BUFF_SPEED, IncreasedSpeedAfterDash)
Exemplo n.º 21
0
def register_charge_ability():
    ability_type = AbilityType.CHARGE
    register_ability_effect(ability_type, _apply_ability)
    ui_icon_sprite = UiIconSprite.ABILITY_CHARGE
    description = "Charge forward, dealing " + str(MIN_DMG) + "-" + str(
        MAX_DMG) + " physical damage on impact if an enemy is hit. (Higher damage on long range)"
    register_ability_data(
        ability_type,
        AbilityData("Charge", ui_icon_sprite, 12, Millis(5000), description, SoundId.ABILITY_CHARGE))
    register_ui_icon_sprite_path(ui_icon_sprite, "resources/graphics/icon_charge.png")
    register_buff_effect(BUFF_TYPE_CHARGING, Charging)
    register_buff_as_channeling(BUFF_TYPE_CHARGING)
    register_buff_effect(BUFF_TYPE_STUNNED, StunnedFromCharge)
Exemplo n.º 22
0
def _register_kill_everything_ability():
    ability_type = AbilityType.KILL_EVERYTHING
    ui_icon_sprite = UiIconSprite.ABILITY_KILL_EVERYTHING
    mana_cost = 1
    cooldown = Millis(500)

    register_ability_effect(ability_type, _apply_ability)
    description = "Kill all nearby enemies"
    ability_data = AbilityData("Kill everything", ui_icon_sprite, mana_cost,
                               cooldown, description, None)
    register_ability_data(ability_type, ability_data)
    register_ui_icon_sprite_path(ui_icon_sprite,
                                 "resources/graphics/whirlwind.png")
Exemplo n.º 23
0
def register_warpstone_consumable():
    consumable_type = ConsumableType.WARP_STONE
    sprite = Sprite.CONSUMABLE_WARPSTONE
    ui_icon_sprite = UiIconSprite.CONSUMABLE_WARPSTONE

    register_consumable_effect(consumable_type, _apply)
    image_path = "resources/graphics/consumable_warpstone.png"
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_path, POTION_ENTITY_SIZE))
    register_ui_icon_sprite_path(ui_icon_sprite, image_path)
    description = "Warps you back to safety"
    data = ConsumableData(ui_icon_sprite, sprite, "Warpstone", description,
                          ConsumableCategory.OTHER, SoundId.WARP)
    register_consumable_data(consumable_type, data)
def register_lesser_mana_potion():
    consumable_type = ConsumableType.MANA_LESSER
    sprite = Sprite.POTION_MANA_LESSER
    ui_icon_sprite = UiIconSprite.POTION_MANA_LESSER

    register_consumable_effect(consumable_type, _apply_mana)
    image_path = "resources/graphics/icon_potion_lesser_mana.png"
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_path, POTION_ENTITY_SIZE))
    register_ui_icon_sprite_path(ui_icon_sprite, image_path)
    data = ConsumableData(ui_icon_sprite, sprite, "Lesser mana potion",
                          "Restores " + str(MANA_AMOUNT) + " mana",
                          ConsumableCategory.MANA, SoundId.CONSUMABLE_POTION)
    register_consumable_data(consumable_type, data)
Exemplo n.º 25
0
def register_invis_potion():
    ui_icon_sprite = UiIconSprite.POTION_INVISIBILITY
    sprite = Sprite.POTION_INVIS
    register_consumable_effect(POTION_TYPE, _apply_invis)
    register_buff_effect(BUFF_TYPE, Invisibility)
    register_buff_text(BUFF_TYPE, "Invisibility")
    image_path = "resources/graphics/invis_potion.png"
    register_ui_icon_sprite_path(ui_icon_sprite, image_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_path, POTION_ENTITY_SIZE))
    data = ConsumableData(ui_icon_sprite, sprite, "Invisibility potion",
                          "Grants temporary invisibility",
                          ConsumableCategory.OTHER, SoundId.CONSUMABLE_BUFF)
    register_consumable_data(POTION_TYPE, data)
Exemplo n.º 26
0
def register_dash_ability():
    ui_icon_sprite = UiIconSprite.ABILITY_DASH
    register_ability_effect(ABILITY_TYPE, _apply_ability)
    description = "Dash over an enemy, dealing " + str(DAMAGE) + " magic damage. [from stealth: gain +" + \
                  "{:.0f}".format(DODGE_CHANCE_BOOST * 100) + "% dodge chance and +" + \
                  "{:.0f}".format(LIFE_STEAL_BOOST * 100) + "% life steal for " + \
                  "{:.0f}".format(BUFF_FROM_STEALTH_DURATION / 1000) + "s]"
    mana_cost = 12
    ability_data = AbilityData("Dash", ui_icon_sprite, mana_cost, Millis(4000), description, SoundId.ABILITY_DASH)
    register_ability_data(ABILITY_TYPE, ability_data)
    register_ui_icon_sprite_path(ui_icon_sprite, "resources/graphics/icon_ability_dash.png")
    register_buff_effect(BUFF_FROM_STEALTH, FromStealth)
    register_buff_text(BUFF_FROM_STEALTH, "Element of surprise")
    register_buff_effect(BUFF_SPEED, IncreasedSpeedAfterDash)
Exemplo n.º 27
0
def register_speed_potion():
    ui_icon_sprite = UiIconSprite.POTION_SPEED
    sprite = Sprite.POTION_SPEED
    register_consumable_effect(ConsumableType.SPEED, _apply_speed)
    register_buff_effect(BUFF_TYPE, IncreasedMoveSpeed)
    register_buff_text(BUFF_TYPE, "Speed potion")
    image_path = "resources/graphics/item_speed_potion.png"
    register_ui_icon_sprite_path(ui_icon_sprite, image_path)
    register_entity_sprite_initializer(
        sprite, SpriteInitializer(image_path, POTION_ENTITY_SIZE))
    description = "Gain +" + "{:.0f}".format(SPEED_INCREASE * 100) + "% movement speed for " + \
                  "{:.0f}".format(DURATION / 1000) + "s."
    data = ConsumableData(ui_icon_sprite, sprite, "Speed potion", description,
                          ConsumableCategory.OTHER, SoundId.CONSUMABLE_BUFF)
    register_consumable_data(ConsumableType.SPEED, data)
Exemplo n.º 28
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)
Exemplo n.º 29
0
def register_stomp_ability():
    ability_type = AbilityType.STOMP
    ui_icon_sprite = UiIconSprite.ABILITY_STOMP

    register_ability_effect(ability_type, _apply_ability)
    description = "Stun and deal " + str(MIN_DMG) + "-" + str(
        MAX_DMG) + " physical damage to all enemies around you."
    register_ability_data(
        ability_type,
        AbilityData("War Stomp", ui_icon_sprite, 13, Millis(10000),
                    description, SoundId.ABILITY_STOMP))
    register_ui_icon_sprite_path(ui_icon_sprite,
                                 "resources/graphics/warstomp_icon.png")
    register_buff_effect(CHANNELING_STOMP, ChannelingStomp)
    register_buff_as_channeling(CHANNELING_STOMP)
    register_buff_effect(STUNNED_BY_STOMP, StunnedFromStomp)
Exemplo n.º 30
0
def register_elixir_of_power():
    ui_icon_sprite = UiIconSprite.ELIXIR_POWER
    sprite = Sprite.ELIXIR_POWER
    consumable_type = ConsumableType.POWER
    register_consumable_level(consumable_type, 6)
    register_consumable_effect(consumable_type, _apply)
    register_buff_effect(BUFF_TYPE, BuffedFromElixirOfPower)
    name = "Elixir of Power"
    register_buff_text(BUFF_TYPE, name)
    image_path = "resources/graphics/item_elixir_of_power.png"
    register_ui_icon_sprite_path(ui_icon_sprite, image_path)
    register_entity_sprite_initializer(sprite, SpriteInitializer(image_path, POTION_ENTITY_SIZE))
    description = "Gain +" + "{:.0f}".format(DAMAGE_MODIFIER_INCREASE * 100) + " attack power for " + \
                  "{:.0f}".format(DURATION / 1000) + "s."
    data = ConsumableData(ui_icon_sprite, sprite, name, description, ConsumableCategory.OTHER, SoundId.CONSUMABLE_BUFF)
    register_consumable_data(consumable_type, data)