Beispiel #1
0
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")
Beispiel #2
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)
Beispiel #3
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)
Beispiel #4
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())
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())
Beispiel #6
0
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)
Beispiel #7
0
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)
Beispiel #8
0
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)
Beispiel #9
0
def register_generic_talents():
    register_hero_upgrade_effect(HeroUpgradeId.DAMAGE,
                                 ModifyHeroStat(HeroStat.DAMAGE, 0.1))
    register_hero_upgrade_effect(HeroUpgradeId.ARMOR,
                                 ModifyHeroStat(HeroStat.ARMOR, 1))
    register_hero_upgrade_effect(HeroUpgradeId.MAX_HEALTH,
                                 ModifyHeroStat(HeroStat.MAX_HEALTH, 10))
    register_hero_upgrade_effect(HeroUpgradeId.MAX_MANA,
                                 ModifyHeroStat(HeroStat.MAX_MANA, 10))
    register_hero_upgrade_effect(HeroUpgradeId.HEALTH_REGEN,
                                 ModifyHeroStat(HeroStat.HEALTH_REGEN, 0.5))
    register_hero_upgrade_effect(HeroUpgradeId.MANA_REGEN,
                                 ModifyHeroStat(HeroStat.MANA_REGEN, 0.5))
    register_ui_icon_sprite_path(UiIconSprite.TALENT_MOVE_SPEED,
                                 "resources/graphics/boots_of_haste.png")
    register_hero_upgrade_effect(HeroUpgradeId.MOVE_SPEED,
                                 ModifyHeroStat(HeroStat.MOVEMENT_SPEED, 0.1))
    register_hero_upgrade_effect(
        HeroUpgradeId.MAGIC_RESIST,
        ModifyHeroStat(HeroStat.MAGIC_RESIST_CHANCE, 0.05))
Beispiel #10
0
def register_generic_talents():
    register_hero_upgrade_effect(HeroUpgradeId.DAMAGE, _upgrade_damage)
    register_hero_upgrade_effect(HeroUpgradeId.ARMOR, _upgrade_armor)
    register_hero_upgrade_effect(HeroUpgradeId.MAX_HEALTH, _upgrade_max_health)
    register_hero_upgrade_effect(HeroUpgradeId.MAX_MANA, _upgrade_max_mana)
    register_hero_upgrade_effect(HeroUpgradeId.HEALTH_REGEN,
                                 _upgrade_health_regen)
    register_hero_upgrade_effect(HeroUpgradeId.MANA_REGEN, _upgrade_mana_regen)