예제 #1
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)
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)
예제 #3
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)
예제 #4
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)
예제 #5
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)
예제 #6
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)
예제 #7
0
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)
예제 #8
0
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_elixir_of_magic_resist():
    ui_icon_sprite = UiIconSprite.ELIXIR_MAGIC_RESIST
    sprite = Sprite.ELIXIR_MAGIC_RESIST
    consumable_type = ConsumableType.MAGIC_RESIST
    register_consumable_level(consumable_type, 5)
    register_consumable_effect(consumable_type, _apply)
    register_buff_effect(BUFF_TYPE, Buffed)
    name = "Elixir of Spirits"
    register_buff_text(BUFF_TYPE, name)
    image_path = "resources/graphics/item_elixir_of_spirits.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(RESIST_MODIFIER_INCREASE * 100) + "% magic resistance 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)
예제 #10
0
def register_summon_scroll():
    consumable_type = ConsumableType.SCROLL_SUMMON_DRAGON
    sprite = Sprite.CONSUMABLE_SCROLL_SUMMON_DRAGON
    ui_icon_sprite = UiIconSprite.CONSUMABLE_SCROLL_SUMMON_DRAGON

    register_consumable_effect(consumable_type, _apply_scroll)
    image_path = "resources/graphics/icon_scroll_ability_summon.png"
    register_entity_sprite_initializer(sprite, SpriteInitializer(image_path, POTION_ENTITY_SIZE))
    register_ui_icon_sprite_path(ui_icon_sprite, image_path)
    description = "Summon a dragonling to fight for you (" + str(int(DURATION_SUMMON / 1000)) + "s)"
    data = ConsumableData(ui_icon_sprite, sprite, "Dragon's scroll", description, ConsumableCategory.OTHER,
                          SoundId.CONSUMABLE_POTION)
    register_consumable_data(consumable_type, data)

    summoned_npc_type = NpcType.PLAYER_SUMMON_DRAGON
    summon_sprite = Sprite.PLAYER_SUMMON_DRAGON

    health_regen = 0.6
    move_speed = 0.14
    health = 28
    npc_data = NpcData.player_summon(summon_sprite, (32, 32), health, health_regen, move_speed)
    register_npc_data(summoned_npc_type, npc_data)
    register_npc_behavior(summoned_npc_type, NpcMind)

    summon_sprite_sheet = SpriteSheet("resources/graphics/monsters_spritesheet.png")
    summon_original_size = (32, 32)
    summon_scaled_sprite_size = (52, 52)
    summon_indices_by_dir = {
        Direction.DOWN: [(x, 0) for x in range(9, 12)],
        Direction.LEFT: [(x, 1) for x in range(9, 12)],
        Direction.RIGHT: [(x, 2) for x in range(9, 12)],
        Direction.UP: [(x, 3) for x in range(9, 12)]
    }
    register_entity_sprite_map(summon_sprite, summon_sprite_sheet, summon_original_size,
                               summon_scaled_sprite_size, summon_indices_by_dir, (-10, -20))
    register_buff_effect(BuffType.SUMMON_DIE_AFTER_DURATION, DieAfterDuration)