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_zuls_aegis(): _register_ability() register_buff_effect(BUFF_TYPE_STUNNED, StunnedFromAegis) item_type = ItemType.ZULS_AEGIS effect = ItemEffect() register_custom_effect_item( item_type=item_type, item_level=7, ui_icon_sprite=UiIconSprite.ITEM_ZULS_AEGIS, sprite=Sprite.ITEM_ZULS_AEGIS, image_file_path="resources/graphics/item_zuls_aegis.png", item_equipment_category=ItemEquipmentCategory.OFF_HAND, name="Zul's Aegis", custom_effect=effect, stat_modifier_intervals=[ StatModifierInterval(HeroStat.ARMOR, [3]), StatModifierInterval(HeroStat.BLOCK_AMOUNT, [6]), StatModifierInterval(HeroStat.DAMAGE, [0.12]), StatModifierInterval(HeroStat.MANA_ON_KILL, [1]) ], custom_description=[ "On block: stun attacker for " + "{:.1f}".format(STUN_DURATION / 1000) + "s", "Active: " + ABILITY_DESCRIPTION ], is_unique=True, active_ability_type=ABILITY_TYPE)
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_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_dark_reaper_enemy(): size = ( 50, 50 ) # Must not align perfectly with grid cell size (pathfinding issues) sprite = Sprite.ENEMY_DARK_REAPER npc_type = NpcType.DARK_REAPER movement_speed = 0.04 health = 80 loot = LootTableId.LEVEL_1 register_npc_data( npc_type, NpcData.enemy(sprite, size, health, 0, movement_speed, 40, loot)) register_npc_behavior(npc_type, NpcMind) sprite_sheet = SpriteSheet("resources/graphics/enemy_sprite_sheet.png") original_sprite_size = (32, 32) scaled_sprite_size = (50, 50) indices_by_dir = { Direction.DOWN: [(9, 0), (10, 0), (11, 0)], Direction.LEFT: [(9, 1), (10, 1), (11, 1)], Direction.RIGHT: [(9, 2), (10, 2), (11, 2)], Direction.UP: [(9, 3), (10, 3), (11, 3)] } register_entity_sprite_map(sprite, sprite_sheet, original_sprite_size, scaled_sprite_size, indices_by_dir, (0, 0)) register_buff_effect(BUFF_TYPE_INVULN, Invuln)
def register_ice_witch_enemy(): size = ( 32, 32 ) # Must not align perfectly with grid cell size (pathfinding issues) sprite = Sprite.ENEMY_ICE_WITCH npc_type = NpcType.ICE_WITCH movement_speed = 0.07 health = 50 exp_reward = 40 npc_data = NpcData.enemy(sprite, size, health, 0, movement_speed, exp_reward, LootTableId.LEVEL_6, SoundId.DEATH_ICE_WITCH) register_npc_data(npc_type, npc_data) register_npc_behavior(npc_type, NpcMind) sprite_sheet = SpriteSheet("resources/graphics/enemy_ice_witch.png") original_sprite_size = (32, 32) scaled_sprite_size = (48, 48) sheet_x = 0 indices_by_dir = { Direction.DOWN: [(sheet_x, 0), (sheet_x + 1, 0), (sheet_x + 2, 0), (sheet_x + 1, 0)], Direction.LEFT: [(sheet_x, 1), (sheet_x + 1, 1), (sheet_x + 2, 1), (sheet_x + 1, 1)], Direction.RIGHT: [(sheet_x, 2), (sheet_x + 1, 2), (sheet_x + 2, 2), (sheet_x + 1, 2)], Direction.UP: [(sheet_x, 3), (sheet_x + 1, 3), (sheet_x + 2, 3), (sheet_x + 1, 3)] } register_entity_sprite_map(sprite, sprite_sheet, original_sprite_size, scaled_sprite_size, indices_by_dir, (-8, -16)) register_buff_effect(SLOW_BUFF_TYPE, SlowedByIceWitch) register_buff_text(SLOW_BUFF_TYPE, "Frozen")
def register_skeleton_boss_enemy(): x = 6 y = 0 indices_by_dir = { Direction.DOWN: [(x + i, y + 0) for i in range(3)], Direction.LEFT: [(x + i, y + 1) for i in range(3)], Direction.RIGHT: [(x + i, y + 2) for i in range(3)], Direction.UP: [(x + i, y + 3) for i in range(3)] } register_basic_enemy( npc_type=NpcType.SKELETON_BOSS, npc_data=NpcData.enemy( sprite=Sprite.ENEMY_SKELETON_BOSS, size=(32, 32), max_health=120, health_regen=3, speed=0.07, exp_reward=60, enemy_loot_table=LootTableId.BOSS_SKELETON, death_sound_id=SoundId.DEATH_BOSS, is_boss=True), mind_constructor=NpcMind, spritesheet_path="resources/graphics/enemy_sprite_sheet.png", original_sprite_size=(32, 32), scaled_sprite_size=(52, 56), spritesheet_indices=indices_by_dir, sprite_position_relative_to_entity=(-10, -24) ) register_projectile_controller(PROJECTILE_TYPE, ProjectileController) register_buff_effect(BUFF_STUNNED, StunnedFromFiring)
def register_hero_warrior(): sprite = Sprite.HERO_WARRIOR portrait_icon_sprite = PortraitIconSprite.HERO_WARRIOR player_sprite_sheet = SpriteSheet( "resources/graphics/enemy_sprite_sheet_3.png") original_sprite_size = (32, 32) scaled_sprite_size = (48, 48) x = 6 indices_by_dir = { Direction.DOWN: [(x + i, 4) for i in range(3)], Direction.LEFT: [(x + i, 5) for i in range(3)], Direction.RIGHT: [(x + i, 6) for i in range(3)], Direction.UP: [(x + i, 7) for i in range(3)] } sprite_position_relative_to_entity = (-8, -16) 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/portrait_warrior_hero.png') entity_speed = 0.105 description = "A sturdy melee fighter, the warrior can stand his ground against any foe, and thrives when there " \ "are enemies all around." hero_data = HeroData(sprite, portrait_icon_sprite, _get_initial_player_state_warrior(), entity_speed, PLAYER_ENTITY_SIZE, description) register_hero_data(HERO_ID, hero_data) register_hero_upgrade_effect(HeroUpgradeId.WARRIOR_RETRIBUTION, _apply_retribution_talent) register_buff_effect(BUFF_RETRIBUTION, BuffedFromRetribution) register_buff_text(BUFF_RETRIBUTION, "Retribution")
def register_necklace_of_suffering_item(): register_custom_effect_item( item_type=ITEM_TYPE, ui_icon_sprite=UiIconSprite.ITEM_NECKLACE_OF_SUFFERING, sprite=Sprite.ITEM_NECKLACE_OF_SUFFERING, image_file_path="resources/graphics/item_necklace_of_suffering.png", item_equipment_category=ItemEquipmentCategory.NECK, name="Necklace of Suffering", item_effect=ItemEffect()) register_buff_effect(BUFF_TYPE, BuffEffect)
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_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_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_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_portal(): original_sprite_size = (28, 62) scaled_sprite_size = (46, 100) indices_by_dir = {Direction.DOWN: [(0, 0)]} sprite_position_relative_to_entity = (-4, -54) register_entity_sprite_map(Sprite.PORTAL_DISABLED, SpriteSheet("resources/graphics/statue.png"), original_sprite_size, scaled_sprite_size, indices_by_dir, sprite_position_relative_to_entity) register_entity_sprite_map( Sprite.PORTAL_BLUE, SpriteSheet("resources/graphics/statue_blue.png"), original_sprite_size, scaled_sprite_size, indices_by_dir, sprite_position_relative_to_entity) register_entity_sprite_map( Sprite.PORTAL_RED, SpriteSheet("resources/graphics/statue_red.png"), original_sprite_size, scaled_sprite_size, indices_by_dir, sprite_position_relative_to_entity) register_entity_sprite_map( Sprite.PORTAL_DARK, SpriteSheet("resources/graphics/statue_dark.png"), original_sprite_size, scaled_sprite_size, indices_by_dir, sprite_position_relative_to_entity) register_entity_sprite_map( Sprite.PORTAL_GREEN, SpriteSheet("resources/graphics/statue_green.png"), original_sprite_size, scaled_sprite_size, indices_by_dir, sprite_position_relative_to_entity) register_portal_data( PortalId.A_BASE, _data(False, PortalId.A_REMOTE, Sprite.PORTAL_DISABLED)) register_portal_data(PortalId.A_REMOTE, _data(True, PortalId.A_BASE, Sprite.PORTAL_BLUE)) register_portal_data( PortalId.B_BASE, _data(False, PortalId.B_REMOTE, Sprite.PORTAL_DISABLED)) register_portal_data(PortalId.B_REMOTE, _data(True, PortalId.B_BASE, Sprite.PORTAL_RED)) register_portal_data( PortalId.C_BASE, _data(False, PortalId.C_REMOTE, Sprite.PORTAL_DISABLED)) register_portal_data(PortalId.C_REMOTE, _data(True, PortalId.C_BASE, Sprite.PORTAL_DARK)) register_portal_data( PortalId.D_BASE, _data(False, PortalId.D_REMOTE, Sprite.PORTAL_DISABLED)) register_portal_data(PortalId.D_REMOTE, _data(True, PortalId.D_BASE, Sprite.PORTAL_GREEN)) register_buff_effect(BUFF_TYPE, BeingTeleported)
def register_warp_point(): original_sprite_size = (640, 640) scaled_sprite_size = (40, 40) indices_by_dir = {Direction.DOWN: [(x, 0) for x in range(6)]} sprite_position_relative_to_entity = ( (PLAYER_ENTITY_SIZE[0] - scaled_sprite_size[0]) / 2, (PLAYER_ENTITY_SIZE[1] - scaled_sprite_size[1]) / 2) register_entity_sprite_map( Sprite.WARP_POINT, SpriteSheet("resources/graphics/animated_warppoint.png"), original_sprite_size, scaled_sprite_size, indices_by_dir, sprite_position_relative_to_entity) register_buff_effect(WARP_STONE_BUFF, TeleportingWithWarpStone) register_buff_effect(WARP_POINT_BUFF, TeleportingWithWarpPoint)
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_stone_amulet_item(): register_buff_effect(BUFF_TYPE, ProtectedByStoneAmulet) register_buff_text(BUFF_TYPE, "Protected") item_type = ItemType.STONE_AMULET register_custom_effect_item( item_type=item_type, ui_icon_sprite=UiIconSprite.ITEM_STONE_AMULET, sprite=Sprite.ITEM_STONE_AMULET, image_file_path="resources/graphics/item_stone_amulet.png", item_equipment_category=ItemEquipmentCategory.NECK, name="Stone Amulet", item_effect=ItemEffect(item_type) )
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)
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)
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)
def register_freezing_gauntlet_item(): register_custom_effect_item( item_type=ITEM_TYPE, item_level=6, ui_icon_sprite=UiIconSprite.ITEM_FREEZING_GAUNTLET, sprite=Sprite.ITEM_FREEZING_GAUNTLET, image_file_path="resources/graphics/item_freezing_gauntlet.png", item_equipment_category=ItemEquipmentCategory.OFF_HAND, name="Freezing gauntlet", custom_description=["Slows your targets by " + str(int(SLOW_AMOUNT * 100)) + "% for " \ + "{:.1f}".format(SLOW_DURATION / 1000) + "s"], stat_modifier_intervals=[], custom_effect=ItemEffect() ) register_buff_effect(BUFF_TYPE, DebuffedByFreezingGauntlet)
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)
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_necklace_of_suffering_item(): register_custom_effect_item( item_type=ITEM_TYPE, item_level=6, ui_icon_sprite=UiIconSprite.ITEM_NECKLACE_OF_SUFFERING, sprite=Sprite.ITEM_NECKLACE_OF_SUFFERING, image_file_path="resources/graphics/item_necklace_of_suffering.png", item_equipment_category=ItemEquipmentCategory.NECK, name="Necklace of Domination", custom_description=[ "Any time you lose health, gain +" + str(int(BUFF_DAMAGE * 100)) + "% damage for " + "{:.0f}".format(BUFF_DURATION / 1000) + "s" ], custom_effect=ItemEffect(), stat_modifier_intervals=[StatModifierInterval(HeroStat.DAMAGE, [0.1])], is_unique=True) register_buff_effect(BUFF_TYPE, BuffEffect)
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_acid_bomb_consumable(): consumable_type = ConsumableType.ACID_BOMB sprite = Sprite.CONSUMABLE_ACID_BOMB ui_icon_sprite = UiIconSprite.CONSUMABLE_ACID_BOMB register_consumable_effect(consumable_type, _apply) image_path = "resources/graphics/consumable_acid_bomb.png" register_entity_sprite_initializer( sprite, SpriteInitializer(image_path, POTION_ENTITY_SIZE)) register_ui_icon_sprite_path(ui_icon_sprite, image_path) description = "Poisons nearby enemies, dealing " + str(DEBUFF_TOTAL_DAMAGE) + " magic damage over " + \ "{:.0f}".format(DEBUFF_DURATION / 1000) + "s." data = ConsumableData(ui_icon_sprite, sprite, "Acid bomb", description, ConsumableCategory.OTHER, SoundId.CONSUMABLE_ACID_BOMB) register_consumable_data(consumable_type, data) register_buff_effect(BUFF_TYPE, BuffEffect)
def register_brew_potion(): consumable_type = ConsumableType.BREW sprite = Sprite.POTION_BREW ui_icon_sprite = UiIconSprite.POTION_BREW register_consumable_effect(consumable_type, _apply) image_path = "resources/graphics/icon_potion_brew.png" register_entity_sprite_initializer(sprite, SpriteInitializer(image_path, POTION_ENTITY_SIZE)) register_ui_icon_sprite_path(ui_icon_sprite, image_path) description = "Slowly restores health and mana over " + "{:.0f}".format(BUFF_DURATION / 1000) + \ "s. Only works outside of combat." data = ConsumableData(ui_icon_sprite, sprite, "Brew", description, ConsumableCategory.HEALTH, SoundId.CONSUMABLE_POTION) register_consumable_data(consumable_type, data) register_buff_effect(BUFF_TYPE, RestoringHealthFromBrew) register_buff_text(BUFF_TYPE, "Recovering")
def register_cleaver_item(): register_custom_effect_item( item_type=ITEM_TYPE, item_level=7, ui_icon_sprite=UiIconSprite.ITEM_CLEAVER, sprite=Sprite.ITEM_CLEAVER, image_file_path="resources/graphics/item_cleaver.png", item_equipment_category=ItemEquipmentCategory.MAIN_HAND, name="The Cleaver", custom_effect=ItemEffect(), custom_description=[str( int(PROC_CHANCE * 100)) + "% on hit: cause enemy to bleed, taking " + str(TOTAL_DAMAGE) + \ " physical damage over " + "{:.0f}".format(BUFF_DURATION / 1000) + "s"], stat_modifier_intervals=[StatModifierInterval(HeroStat.PHYSICAL_DAMAGE, [0.41])], is_unique=True ) register_buff_effect(BUFF_TYPE, BuffEffect)