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)
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)
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_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")
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_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_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)
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_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_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, _apply_upgrade)
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)
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, _apply_upgrade)
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, _upgrade_arcane_fire_cooldown_and_mana_cost)
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_stealth_ability(): ui_icon_sprite = UiIconSprite.ABILITY_STEALTH register_ability_effect(ABILITY_TYPE, _apply_ability) description = "Become invisible to enemies. After effect ends, gain +" + \ "{:.0f}".format(DODGE_CHANCE_BONUS * 100) + "% dodge chance for " + \ "{:.1f}".format(DURATION_POST_STEALTH / 1000) + "s" 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_buff_effect(BUFF_POST_STEALTH, AfterStealthing) register_buff_text(BUFF_POST_STEALTH, "Element of surprise") register_hero_upgrade_effect(HeroUpgradeId.ABILITY_STEALTH_MANA_COST, _upgrade_mana_cost)