Skip to content

ItemMedicalAsset — Medical Consumables

ItemMedicalAsset is an empty subclass of ItemConsumeableAsset. At 11 lines it defines nothing of its own — all behavior is inherited from the consumable base. The class serves solely as an EItemType.MEDICAL marker, enabling medical-specific behavior in the UseableConsumeable runtime through type-based branching.

Source code location: Unturned/Bundles/ItemMedicalAsset.cs

Inheritance Chain

ItemAsset
  → ItemWeaponAsset
    → ItemConsumeableAsset
      → ItemMedicalAsset  (empty)

Class Definition

csharp
public class ItemMedicalAsset : ItemConsumeableAsset
{

}

Inherited Systems Most Relevant to Medical Items

Since ItemMedicalAsset is empty, all behavior flows from ItemConsumeableAsset. The following inherited systems are the primary drivers of medical item behavior:

Bleeding Modifier

csharp
public enum Bleeding { None, Heal, Cut }
ValueDescriptionExample Items
NoneNo effect on bleedingVitamins, energy drinks
HealStops bleedingBandages, dressings, medkits
CutCauses bleedingPoisoned items, trap consumables

Parsed with backwards compatibility:

csharp
if (p.data.ContainsKey("Bleeding"))
    bleedingModifier = Bleeding.Heal;  // Legacy "Bleeding" flag
else
    bleedingModifier = p.data.ParseEnum<Bleeding>("Bleeding_Modifier");

Bones Modifier

csharp
public enum Bones { None, Heal, Break }
ValueDescriptionExample Items
NoneNo effect on bonesBandages, vitamins
HealRepairs broken bonesSplints
BreakBreaks bonesTrap items, experimental content

Parsed with similar backwards compatibility:

csharp
if (p.data.ContainsKey("Broken"))
    bonesModifier = Bones.Heal;  // Legacy "Broken" flag
else
    bonesModifier = p.data.ParseEnum<Bones>("Bones_Modifier");

Aid (Apply to Others)

Field.dat KeyDefaultDescription
_hasAidAid (flag)falseCan be applied to other players

When _hasAid is true, the UseableConsumeable enables targeting:

  1. The player's crosshair shows a targeting reticle.
  2. A raycast detects friendly players within range.
  3. The consumable applies its stats to the target player instead of self.
  4. If no valid target is found, the item is applied to self.

Aid is the primary mechanism for team healing. Bandages, dressings, and medkits typically have this flag.

Health Restoration

Field.dat KeyTypical ValuesEffect
_healthHealth10-100Direct HP restoration

Medical items are the primary source of health restoration. The _health value is applied in per-tick fractions during consumption and is capped at the player's maximum health.

Disinfection

Field.dat KeyTypical ValuesEffect
_disinfectantDisinfectant10-30Reduces virus/infection level

Disinfectant is applied as a positive value but subtracts from the player's virus stat. Antibiotics, vaccines, and purification tablets use this field.

Vanilla Medical Items

Vanilla medical items demonstrate the range of medical configurations:

ItemHealthDisinfectantBleedingBonesAidEnergy
Bandage250HealNoneYes0
Dressing300HealNoneYes0
Medkit1000HealNoneYes0
Splint00NoneHealYes0
Antibiotics1020NoneNoneNo0
Vaccines1030NoneNoneNo0
Vitamins00NoneNoneNo10
Adrenaline00NoneNoneNo25
Cough Syrup105NoneNoneNo0
Purification Tablets015NoneNoneNo0

Medical Item Archetypes

Trauma Care (bandage, dressing, medkit):

  • Restore health.
  • Stop bleeding.
  • Can be applied to others (Aid).
  • Do not affect bones.

Bone Repair (splint):

  • Repairs broken bones.
  • Restores no health.
  • Can be applied to others.
  • Does not stop bleeding.

Pharmaceutical (antibiotics, vaccines):

  • Reduce virus/infection.
  • Small health restore.
  • Cannot be applied to others.
  • No bleeding or bones effect.

Performance Enhancers (vitamins, adrenaline):

  • Restore energy/stamina.
  • No health or virus effect.
  • Cannot be applied to others.
  • May provide additional buffs (vision, experience).

Utility Medical (purification tablets, cough syrup):

  • Sometimes hybrid effects.
  • Purification tablets provide disinfection without health.
  • Cough syrup provides small health + disinfection.

The Medical Consumption Pipeline

When a medical item is consumed through UseableConsumeable:

Stat Application Order

Per tick (32 ticks/second):

  1. Food (typically 0 for medical items)
  2. Water
  3. Health — Applied per-tick to avoid instant full healing
  4. Virus — (typically 0 for medical)
  5. Disinfectant — Reduces virus level
  6. Energy, Vision, Oxygen, Warmth

Medical State Processing

After all stat ticks complete:

  1. Bleeding check:

    • Heal: Player's bleeding state is cleared.
    • Cut: Player begins bleeding (DamagePlayerParameters.Bleeding.Cut).
    • None: No change.
  2. Bones check:

    • Heal: Player's broken bones are repaired.
    • Break: Player's bones are broken (DamagePlayerParameters.Bones.Break).
    • None: No change.
  3. Experience: Applied once (0 for most medical items).

Interruption Handling

If the player is interrupted during medical consumption:

  • Partial stats are preserved (the player gets proportional benefit).
  • shouldDeleteAfterUse is checked: if true, the item is deleted even if interrupted.
  • Medical state changes (bleeding/bones) only apply on completion.

Medical and Quality

showQuality returns false for EItemType.MEDICAL. Medical items do not have the mold mechanic because they lack food and water values. The quality bar is hidden from the UI.

However, the base ItemConsumeableAsset.showQuality check is:

csharp
public override bool showQuality => type == EItemType.FOOD || type == EItemType.WATER;

If a medical item is misconfigured with EItemType.FOOD, it would show quality and be subject to the mold system. This is a configuration error, not a feature.

Medical and Explosives

Medical items can technically be configured as explosives via the Explosion key (inherited from ItemConsumeableAssetItemWeaponAsset). This allows:

  • Explosive vaccines: A booby-trapped medical supply.
  • Aid-based traps: Giving a medkit to another player that explodes.

However, when IsExplosive is true:

  • shouldFriendlySentryTargetUser returns true — sentries target the user.
  • The explosion occurs when consumed.
  • shouldDeleteAfterUse is effectively forced to true.

Medical and the Player Life System

The UseableConsumeable interacts with several player life subsystems:

Bleeding State Machine

Bleeding is a binary state (bleeding / not bleeding) with a damage rate:

  • While bleeding, the player takes damage per second.
  • Bleeding damage rate is configurable in game mode config.
  • Bleeding.Heal clears the state.
  • Bleeding.Cut sets the state and applies an initial damage tick.

Bone Break State Machine

Broken bones affect movement:

  • While broken, movement speed is reduced.
  • Jump height is reduced.
  • Fall damage is increased.
  • Bones.Heal clears the state.
  • Bones.Break sets the state with an audible cracking sound.

Virus and Immunity

The virus stat (0-100) drives the infection mechanic:

  • Virus > 0: The player is infected. HUD shows infection indicator.
  • Virus at 100: The player takes damage over time and may die.
  • _disinfectant reduces the virus level.
  • Immunity skill reduces incoming virus gain.
  • The cough syrup item (vanilla ID 401) provides small disinfection but is not a full cure.

Common Issues

  1. Empty class, type-dependent behavior — All medical behavior is keyed off EItemType.MEDICAL, not the C# class. Misconfiguring a medical item's type will silently change its behavior in crafting, inventory, and UI.
  2. Aid flag not exposed in description — The _hasAid flag affects gameplay but is not displayed in the item description tooltip. Players must know which items have aid from game experience.
  3. Bandage vs Dressing overlap — The bandage (health=25) and dressing (health=30) are nearly identical. The dressing provides slightly more health but uses a different crafting recipe. The inventory UI does not differentiate them beyond name and icon.
  4. Splint doesn't stop bleeding — A splint heals bones but not bleeding. Players with both conditions need to use two items. The UI does not communicate this requirement clearly.
  5. Medical items ignore moldshowQuality returns false for medical items, so quality is hidden. However, the base class quality system still tracks a quality value in the item instance. This hidden quality can affect the item's effective restoration if quality-based modifiers are active in the game mode config.
  6. Disinfectant vs Virus naming_disinfectant (byte) reduces _virus (byte). The terms are different in the .dat file (Disinfectant reduces Virus) which can confuse modders. A high Disinfectant value is good; a high Virus value is bad.