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_level(consumable_type, 2) 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)
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_speed_potion(): ui_icon_sprite = UiIconSprite.POTION_SPEED sprite = Sprite.POTION_SPEED consumable_type = ConsumableType.SPEED register_consumable_effect(consumable_type, _apply_speed) register_consumable_level(consumable_type, 5) 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(consumable_type, data)
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)
def register_brew_potion(): consumable_type = ConsumableType.BREW sprite = Sprite.POTION_BREW ui_icon_sprite = UiIconSprite.POTION_BREW register_consumable_level(consumable_type, 2) 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")