Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement basic saline infusion to help with blood loss #70566

Merged
merged 8 commits into from
Jan 5, 2024
28 changes: 28 additions & 0 deletions data/json/effects_on_condition/medicine_eocs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"type": "effect_on_condition",
"id": "SALINE_INFUSION",
"//": "4 ml of saline per 1 ml of blood, rate 2L/hour. 1 ml of blood = 10 units of vitamin",
"effect": [
{ "math": [ "u_amount_of_saline_infused", "=", "_volume_of_saline" ] },
{ "u_assign_activity": "ACT_SALINE_INFUSE", "duration": { "math": [ "_volume_of_saline / 0.55555556" ] } },
{ "u_consume_item": { "context_val": "bag_id" } },
{
"set_string_var": "<context_val:bag_id>_empty",
"target_var": { "context_val": "bag_to_drop" },
"parse_tags": true
},
{ "u_spawn_item": { "context_val": "bag_to_drop" }, "suppress_message": true },
{
"u_message": "You prepare the tubing, insert the needle into a vein, and patiently wait for the saline solution to flow into your bloodstream.",
"type": "good"
}
]
},
{
"type": "effect_on_condition",
"id": "SALINE_INFUSION_eff",
"//": "4 ml of saline per 1 ml of blood, rate 2L/hour. 1 ml of blood = 10 units of vitamin",
"effect": [ { "math": [ "u_vitamin('blood')", "+=", "u_amount_of_saline_infused * ( 10 / 4 )" ] } ]
}
]
11 changes: 11 additions & 0 deletions data/json/itemgroups/Drugs_Tobacco_Alcohol/drugs.json
Original file line number Diff line number Diff line change
Expand Up @@ -599,5 +599,16 @@
"subtype": "collection",
"container-item": "bottle_plastic",
"entries": [ { "item": "protein_powder", "container-item": "null", "count": 10 } ]
},
{
"type": "item_group",
"id": "saline_bottle_random",
"subtype": "distribution",
"entries": [
{ "item": "saline_bag_250", "prob": 50 },
{ "item": "saline_bag_500", "prob": 100 },
{ "item": "saline_bag_1000", "prob": 25 },
{ "item": "saline_bag_2000", "prob": 10 }
]
}
]
22 changes: 9 additions & 13 deletions data/json/itemgroups/Locations_MapExtras/locations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2697,14 +2697,14 @@
"type": "item_group",
"subtype": "distribution",
"entries": [
{ "item": "blanket", "prob": 50 },
{ "item": "cotton_patchwork", "prob": 100, "custom-flags": [ "FILTHY" ] },
{ "item": "left_leg_prosthetic", "prob": 20 },
{ "item": "right_leg_prosthetic", "prob": 20 },
{ "item": "left_arm_prosthetic", "prob": 20 },
{ "item": "right_arm_prosthetic", "prob": 20 },
{ "item": "left_arm_neuroprosthetic", "prob": 10 },
{ "item": "right_arm_neuroprosthetic", "prob": 10 }
{ "item": "blanket", "prob": 200 },
{ "item": "cotton_patchwork", "prob": 400, "custom-flags": [ "FILTHY" ] },
{ "item": "left_leg_prosthetic", "prob": 2 },
{ "item": "right_leg_prosthetic", "prob": 2 },
{ "item": "left_arm_prosthetic", "prob": 2 },
{ "item": "right_arm_prosthetic", "prob": 2 },
{ "item": "left_arm_neuroprosthetic", "prob": 1 },
{ "item": "right_arm_neuroprosthetic", "prob": 1 }
]
},
{
Expand Down Expand Up @@ -2746,11 +2746,7 @@
"id": "mil_base_iv",
"type": "item_group",
"subtype": "distribution",
"entries": [
{ "item": "blood", "prob": 100 },
{ "item": "saline", "prob": 80, "container-item": "bag_iv" },
{ "item": "bag_iv", "prob": 50 }
]
"entries": [ { "item": "blood", "prob": 100 }, { "group": "saline_bottle_random", "prob": 80 }, { "item": "bag_iv", "prob": 50 } ]
},
{
"id": "mil_base_mess_hall",
Expand Down
2 changes: 1 addition & 1 deletion data/json/itemgroups/science_and_tech.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
"id": "surgery",
"items": [
[ "blood", 20 ],
{ "item": "saline", "prob": 20, "container-item": "bag_iv" },
{ "group": "saline_bottle_random", "prob": 20 },
{ "prob": 5, "group": "iodine_bottle_plastic_pill_supplement_1_10" },
{ "prob": 5, "group": "prussian_blue_bottle_plastic_pill_supplement_1_10" },
[ "autoclave", 5 ],
Expand Down
16 changes: 8 additions & 8 deletions data/json/items/armor/arm_prosthetics.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"color": "brown",
"warmth": 15,
"material_thickness": 1,
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "RIGHT_PROSTHETIC_ARM" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "arm_stub_r", "arm_prosthetic_r", "hand_prosthetic_r" ] } ]
},
Expand All @@ -35,7 +35,7 @@
"color": "brown",
"warmth": 15,
"material_thickness": 1,
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "LEFT_PROSTHETIC_ARM" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "arm_stub_l", "arm_prosthetic_l", "hand_prosthetic_l" ] } ]
},
Expand All @@ -55,7 +55,7 @@
"color": "brown",
"warmth": 15,
"material_thickness": 1,
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "RIGHT_NEUROPROSTHETIC_ARM" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "arm_stub_r", "arm_neuroprosthetic_r", "hand_neuroprosthetic_r" ] } ]
},
Expand All @@ -75,7 +75,7 @@
"color": "brown",
"warmth": 15,
"material_thickness": 1,
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "LEFT_NEUROPROSTHETIC_ARM" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "arm_stub_l", "arm_neuroprosthetic_l", "hand_neuroprosthetic_l" ] } ]
},
Expand All @@ -95,7 +95,7 @@
"color": "brown",
"warmth": 15,
"material_thickness": 1,
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "RIGHT_COSMETIC_PROSTHETIC_ARM" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "arm_stub_r", "arm_prosthetic_cosmetic_r", "hand_prosthetic_r" ] } ]
},
Expand All @@ -115,7 +115,7 @@
"color": "brown",
"warmth": 15,
"material_thickness": 1,
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "LEFT_COSMETIC_PROSTHETIC_ARM" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "arm_stub_l", "arm_prosthetic_cosmetic_l", "hand_prosthetic_l" ] } ]
},
Expand All @@ -135,7 +135,7 @@
"color": "brown",
"warmth": 15,
"material_thickness": 1,
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "RIGHT_PROSTHETIC_ARM" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "arm_stub_r", "arm_prosthetic_r", "hand_prosthetic_r" ] } ]
},
Expand All @@ -155,7 +155,7 @@
"color": "brown",
"warmth": 15,
"material_thickness": 1,
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"flags": [ "ARM_PROSTHETIC", "ONLY_ONE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "LEFT_PROSTHETIC_ARM" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "arm_stub_l", "arm_prosthetic_l", "hand_prosthetic_l" ] } ]
}
Expand Down
12 changes: 6 additions & 6 deletions data/json/items/armor/legs_prosthetics.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"color": "brown",
"warmth": 15,
"material_thickness": 1,
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "RIGHT_PROSTHETIC_LEG" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_r", "leg_prosthetic_r", "foot_prosthetic_r" ] } ]
},
Expand All @@ -35,7 +35,7 @@
"color": "brown",
"warmth": 15,
"material_thickness": 1,
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "LEFT_PROSTHETIC_LEG" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_l", "leg_prosthetic_l", "foot_prosthetic_l" ] } ]
},
Expand All @@ -55,7 +55,7 @@
"color": "brown",
"warmth": 15,
"material_thickness": 1,
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "FRAGILE", "PADDED" ],
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "FRAGILE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "RIGHT_PEG_LEG" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_r", "leg_peg_r" ] } ]
},
Expand All @@ -75,7 +75,7 @@
"color": "brown",
"warmth": 15,
"material_thickness": 1,
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "FRAGILE", "PADDED" ],
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "FRAGILE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "LEFT_PEG_LEG" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_l", "leg_peg_l" ] } ]
},
Expand All @@ -95,7 +95,7 @@
"color": "light_gray",
"warmth": 15,
"material_thickness": 2,
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "RIGHT_PROSTHETIC_LEG" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_r", "leg_prosthetic_r", "foot_prosthetic_r" ] } ]
},
Expand All @@ -115,7 +115,7 @@
"color": "light_gray",
"warmth": 15,
"material_thickness": 2,
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "PADDED", "MUNDANE" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "LEFT_PROSTHETIC_LEG" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_l", "leg_prosthetic_l", "foot_prosthetic_l" ] } ]
}
Expand Down
89 changes: 89 additions & 0 deletions data/json/items/containers/generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,94 @@
"material": [ "plastic" ],
"symbol": ")",
"color": "light_gray"
},
{
"id": "saline_bag_250_empty",
"type": "GENERIC",
"category": "container",
"name": { "str": "small liquid bag" },
"description": "Small bag, similar to an IV bag, that previously stored a sterilized saline solution. Whatever it stores now, it is not safe to put in your veins.",
"looks_like": "bag_iv",
"weight": "5 g",
"volume": "35 ml",
"price": 50,
"price_postapoc": 1,
"material": [ "plastic" ],
"symbol": ")",
"color": "light_gray",
"pocket_data": [
{
"pocket_type": "CONTAINER",
"watertight": true,
"max_contains_volume": "250 ml",
"max_item_volume": "17 ml",
"max_contains_weight": "700 g",
"moves": 1000
}
],
"flags": [ "COLLAPSE_CONTENTS" ]
},
{
"id": "saline_bag_500_empty",
"type": "GENERIC",
"name": { "str": "medium liquid bag" },
"description": "Bag, similar to an IV bag, that previously stored a sterilized saline solution. Whatever it stores now, it is not safe to put in your veins.",
"copy-from": "saline_bag_250_empty",
"weight": "10 g",
"volume": "70 ml",
"symbol": ")",
"color": "light_gray",
"pocket_data": [
{
"pocket_type": "CONTAINER",
"watertight": true,
"max_contains_volume": "500 ml",
"max_item_volume": "17 ml",
"max_contains_weight": "1400 g",
"moves": 1000
}
]
},
{
"id": "saline_bag_1000_empty",
"type": "GENERIC",
"name": { "str": "large liquid bag" },
"description": "Large bag, similar to an IV bag, that previously stored a sterilized saline solution. Whatever it stores now, it is not safe to put in your veins.",
"copy-from": "saline_bag_250_empty",
"weight": "20 g",
"volume": "140 ml",
"symbol": ")",
"color": "light_gray",
"pocket_data": [
{
"pocket_type": "CONTAINER",
"watertight": true,
"max_contains_volume": "1000 ml",
"max_item_volume": "17 ml",
"max_contains_weight": "2800 g",
"moves": 1000
}
]
},
{
"id": "saline_bag_2000_empty",
"type": "GENERIC",
"name": { "str": "huge liquid bag" },
"description": "Huge bag, similar to an IV bag, that previously stored a sterilized saline solution. Whatever it stores now, it is not safe to put in your veins.",
"copy-from": "saline_bag_250_empty",
"weight": "40 g",
"volume": "280 ml",
"symbol": ")",
"color": "light_gray",
"pocket_data": [
{
"pocket_type": "CONTAINER",
"watertight": true,
"max_contains_volume": "2000 ml",
"max_item_volume": "17 ml",
"max_contains_weight": "5600 g",
"moves": 1000
}
]
}
]
Loading
Loading