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_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, UpgradeFireballManaCost())
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")
def _register_ability(): register_ability_effect(ABILITY_TYPE, _apply_ability) ability_data = AbilityData(ITEM_NAME, UiIconSprite.ITEM_WINGED_HELMET, 5, Millis(30_000), ABILITY_DESCRIPTION, sound_id=None, is_item_ability=True) register_ability_data(ABILITY_TYPE, ability_data)
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")
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())
def _register_ability(): register_ability_effect(ABILITY_TYPE, _apply_ability) # TODO: sound effect ability_data = AbilityData("Zul's aegis", UiIconSprite.ITEM_ZULS_AEGIS, 5, Millis(10_000), ABILITY_DESCRIPTION, sound_id=None, is_item_ability=True) register_ability_data(ABILITY_TYPE, ability_data)
def _register_ability(): register_ability_effect(ABILITY_TYPE, _apply_ability) # TODO sound effect ability_data = AbilityData(ITEM_NAME, UiIconSprite.ITEM_WHIP, 0, Millis(8_000), ABILITY_DESCRIPTION, sound_id=None, is_item_ability=True) register_ability_data(ABILITY_TYPE, ability_data)
def _register_ability(): register_ability_effect(ABILITY_TYPE, _apply_ability) ability_data = AbilityData(ITEM_NAME, UiIconSprite.ITEM_ROD_OF_LIGHTNING, 15, Millis(10_000), ABILITY_DESCRIPTION, sound_id=None, is_item_ability=True) register_ability_data(ABILITY_TYPE, ability_data)
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())
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")
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)
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)
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)
def register_stomp_ability(): ability_type = AbilityType.STOMP ui_icon_sprite = UiIconSprite.ABILITY_STOMP register_ability_effect(ability_type, _apply_ability) description = "Deal " + str(MIN_DMG) + "-" + str(MAX_DMG) + " physical damage to all enemies around you and stun " + \ "them for " + "{:.1f}".format(STUN_DURATION / 1000) + "s." 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)
def register_frost_nova_ability(): ability_type = AbilityType.FROST_NOVA register_ability_effect(ability_type, _apply_ability) ui_icon_sprite = UiIconSprite.ABILITY_FROST_NOVA register_ability_data( ability_type, AbilityData("Frost nova", ui_icon_sprite, 17, Millis(8000), "Damages and slows all nearby enemies", None)) register_ui_icon_sprite_path(ui_icon_sprite, "resources/graphics/ui_icon_ability_frost_nova.png") sprite_sheet = SpriteSheet("resources/graphics/effect_frost_explosion.png") original_sprite_size = (128, 130) indices_by_dir = { Direction.LEFT: [(x, 0) for x in range(6)] } register_entity_sprite_map(Sprite.EFFECT_ABILITY_FROST_NOVA, sprite_sheet, original_sprite_size, EFFECT_SPRITE_SIZE, indices_by_dir, (0, 0)) register_buff_effect(BuffType.REDUCED_MOVEMENT_SPEED, ReducedMovementSpeed)
def register_bloodlust_ability(): ability_type = AbilityType.BLOOD_LUST register_ability_effect(ability_type, _apply_ability) ui_icon_sprite = UiIconSprite.ABILITY_BLOODLUST description = "Gain Bloodlust for " + "{:.0f}".format(BUFF_DURATION / 1000) + "s " + \ "(+" + str(int(LIFE_STEAL_BONUS_RATIO * 100)) + "% lifesteal, " + \ "reduced Slash cooldown, " + \ "+" + str(int(SPEED_BONUS * 100)) + "% movement speed). " + \ "Duration is increased by " + "{:.0f}".format(BLOODLUST_INCREASED_DURATION_FROM_KILL / 1000) + \ "s for each enemy killed." register_ability_data( ability_type, AbilityData("Bloodlust", ui_icon_sprite, 25, COOLDOWN, description, SoundId.ABILITY_BLOODLUST)) register_ui_icon_sprite_path(ui_icon_sprite, "resources/graphics/icon_bloodlust.png") register_buff_effect(BUFF_TYPE, BloodLust) register_buff_text(BUFF_TYPE, "Bloodlust") register_hero_upgrade_effect(HeroUpgradeId.ABILITY_BLOODLUST_DURATION, UpgradeBloodlust())
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, UpgradeEntanglingRootsCooldown())
def register_arcane_fire_ability(): register_ability_effect(AbilityType.ARCANE_FIRE, _apply_channel_attack) description = "Channel for " + "{:.1f}".format(CHANNEL_DURATION / 1000) + \ "s, firing piercing missiles in front of you dealing up to " + str(MAX_TOTAL_DAMAGE) + \ " magic damage to enemies." ability_data = AbilityData("Arcane Fire", UiIconSprite.ABILITY_ARCANE_FIRE, ARCANE_FIRE_MANA_COST, ARCANE_FIRE_COOLDOWN, description, SoundId.ABILITY_ARCANE_FIRE) register_ability_data(AbilityType.ARCANE_FIRE, ability_data) register_ui_icon_sprite_path(UiIconSprite.ABILITY_ARCANE_FIRE, "resources/graphics/magic_missile.png") register_buff_effect(BuffType.CHANNELING_ARCANE_FIRE, Channeling) register_entity_sprite_initializer( Sprite.PROJECTILE_PLAYER_ARCANE_FIRE, SpriteInitializer("resources/graphics/magic_missile.png", PROJECTILE_SIZE)) register_projectile_controller(ProjectileType.PLAYER_ARCANE_FIRE, ProjectileController) register_buff_as_channeling(BuffType.CHANNELING_ARCANE_FIRE) register_hero_upgrade_effect(HeroUpgradeId.ABILITY_ARCANE_FIRE_COOLDOWN, UpgradeArcaneFireCooldownAndManaCost())