Mosquitomermsalve
Based on game build 714014 | Last updated: 2026-03-06
Overview
mosquitomermsalve is a consumable inventory item that functions as a healing salve specifically for merms and Wurt. It is implemented as a prefab with the healer component attached, which defines who can be healed (CanHeal) and what happens when healing occurs (OnHeal). The item supports stacking and integrates with the skilltreeupdater component to grant bonus effects to Wurt under certain conditions.
Usage example
local inst = SpawnPrefab("mosquitomermsalve")
inst.components.stackable:SetQuantity(3)
inst.components.healer:SetHealthAmount(0) -- Required for healer component initialization
-- When used on a valid target (e.g., a merm or Wurt), the OnHeal function will execute
Dependencies & tags
Components used: inspectable, inventoryitem, stackable, healer, skilltreeupdater, health, debuff
Tags: Checks for merm, mermdisguise, player; adds merm_healthregenbuff debuff on successful heal if skill condition met.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
inst.components.healer.health | number | 0 | Health amount restored per use; set via SetHealthAmount (not used for direct healing, but required for component setup). |
inst.components.stackable.maxsize | number | TUNING.STACK_SIZE_SMALLITEM | Maximum stack size for the item. |
Main functions
CanHeal(inst, target, doer)
- Description: Validates whether the target entity can be healed by this item. Used by the
healercomponent to determine eligibility. - Parameters:
target(Entity) — The entity attempting to receive healing.doer(Entity, optional) — The entity applying the item (often the player).
- Returns:
trueif target is a merm withoutmermdisguisetag or is Wurt (playertag), orfalse, "NOT_MERM"otherwise. - Error states: Always returns a boolean as first value; error message only returned on failure.
OnHeal(inst, target, doer)
- Description: Executes the healing logic for a valid target. Calculates heal amount based on whether the target is a player, applies it via
health:DoDelta, and optionally grants themerm_healthregenbuffdebuff if thewurt_mosquito_craft_3skill is active. - Parameters:
target(Entity) — The entity being healed.doer(Entity, optional) — The entity that used the item.
- Returns: Nothing.
- Error states: Returns early if
target.components.healthisnil. Only applies heal iftarget.components.health.canhealistrue.
Events & listeners
- Pushes:
healthdelta— emitted bytarget.components.health:DoDeltawhen heal is applied. - Debuff applied:
merm_healthregenbuff— added viatarget:AddDebuff("merm_healthregenbuff", "merm_healthregenbuff")ifwurt_mosquito_craft_3skill is activated anddoeris provided.