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 }| Value | Description | Example Items |
|---|---|---|
None | No effect on bleeding | Vitamins, energy drinks |
Heal | Stops bleeding | Bandages, dressings, medkits |
Cut | Causes bleeding | Poisoned 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 }| Value | Description | Example Items |
|---|---|---|
None | No effect on bones | Bandages, vitamins |
Heal | Repairs broken bones | Splints |
Break | Breaks bones | Trap 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 Key | Default | Description |
|---|---|---|---|
_hasAid | Aid (flag) | false | Can be applied to other players |
When _hasAid is true, the UseableConsumeable enables targeting:
- The player's crosshair shows a targeting reticle.
- A raycast detects friendly players within range.
- The consumable applies its stats to the target player instead of self.
- 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 Key | Typical Values | Effect |
|---|---|---|---|
_health | Health | 10-100 | Direct 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 Key | Typical Values | Effect |
|---|---|---|---|
_disinfectant | Disinfectant | 10-30 | Reduces 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:
| Item | Health | Disinfectant | Bleeding | Bones | Aid | Energy |
|---|---|---|---|---|---|---|
| Bandage | 25 | 0 | Heal | None | Yes | 0 |
| Dressing | 30 | 0 | Heal | None | Yes | 0 |
| Medkit | 100 | 0 | Heal | None | Yes | 0 |
| Splint | 0 | 0 | None | Heal | Yes | 0 |
| Antibiotics | 10 | 20 | None | None | No | 0 |
| Vaccines | 10 | 30 | None | None | No | 0 |
| Vitamins | 0 | 0 | None | None | No | 10 |
| Adrenaline | 0 | 0 | None | None | No | 25 |
| Cough Syrup | 10 | 5 | None | None | No | 0 |
| Purification Tablets | 0 | 15 | None | None | No | 0 |
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):
- Food (typically 0 for medical items)
- Water
- Health — Applied per-tick to avoid instant full healing
- Virus — (typically 0 for medical)
- Disinfectant — Reduces virus level
- Energy, Vision, Oxygen, Warmth
Medical State Processing
After all stat ticks complete:
Bleeding check:
Heal: Player's bleeding state is cleared.Cut: Player begins bleeding (DamagePlayerParameters.Bleeding.Cut).None: No change.
Bones check:
Heal: Player's broken bones are repaired.Break: Player's bones are broken (DamagePlayerParameters.Bones.Break).None: No change.
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).
shouldDeleteAfterUseis 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 ItemConsumeableAsset → ItemWeaponAsset). 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:
shouldFriendlySentryTargetUserreturnstrue— sentries target the user.- The explosion occurs when consumed.
shouldDeleteAfterUseis 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.Healclears the state.Bleeding.Cutsets 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.Healclears the state.Bones.Breaksets 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.
_disinfectantreduces the virus level.Immunityskill reduces incoming virus gain.- The cough syrup item (vanilla ID 401) provides small disinfection but is not a full cure.
Common Issues
- 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. - Aid flag not exposed in description — The
_hasAidflag affects gameplay but is not displayed in the item description tooltip. Players must know which items have aid from game experience. - 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.
- 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.
- Medical items ignore mold —
showQualityreturns 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. - Disinfectant vs Virus naming —
_disinfectant(byte) reduces_virus(byte). The terms are different in the.datfile (DisinfectantreducesVirus) which can confuse modders. A high Disinfectant value is good; a high Virus value is bad.
