-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add regen serum * Check yesterday's calories consumption, not today's. Also check ingested calories, not eaten * fixes * more fixes * Apply suggestions from code review Co-authored-by: osuphobia <[email protected]> * move serum crash penalty to jmath, add flag to mend bodyparts without splint * fixes * make serum GENERIC * fixes fixes fixes * attempt to fix MEND_ALL flag (futile) * Spell check fixes * make mending actually work * too many " --------- Co-authored-by: osuphobia <[email protected]>
- Loading branch information
1 parent
00b781c
commit cef5d70
Showing
10 changed files
with
218 additions
and
3 deletions.
There are no files selected for viewing
101 changes: 101 additions & 0 deletions
101
data/json/effects_on_condition/medicine_eocs/regen_serum_eoc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
[ | ||
{ | ||
"type": "jmath_function", | ||
"id": "spent_to_ingested_ratio", | ||
"//": "return ratio between calories you spent yesterday and calories you ingested yesterday. if bigger than 1, you consumed more calories than you ingested", | ||
"num_args": 0, | ||
"return": "max( get_calories_daily('type':'spent', 'day':'1'), 1 ) / max( get_calories_daily('type':'ingested', 'day':'1'), 1 )" | ||
}, | ||
{ | ||
"type": "effect_on_condition", | ||
"id": "EOC_SERUM_REGEN", | ||
"effect": [ | ||
{ "u_consume_item": { "context_val": "id" } }, | ||
{ "math": [ "_serum_duration", "=", "rng(time('1 d'), time('2 d'))" ] }, | ||
{ "u_add_effect": "regen_serum_main", "duration": { "context_val": "serum_duration" } }, | ||
{ "u_add_effect": "regen_serum_crash_cardio", "duration": { "math": [ "_serum_duration * rng(1.5, 2.5)" ] } }, | ||
{ "queue_eocs": "EOC_APPLY_REGEN_SERUM_CRASH", "time_in_future": { "context_val": "serum_duration" } }, | ||
{ "queue_eocs": "EOC_REGEN_SERUM_PAIN_SPIKE", "time_in_future": [ "1 h", "6 h" ] }, | ||
{ "queue_eocs": "EOC_REGEN_SERUM_MUT_REJECTION", "time_in_future": [ "1 h", "6 h" ] } | ||
] | ||
}, | ||
{ | ||
"type": "effect_on_condition", | ||
"id": "EOC_APPLY_REGEN_SERUM_CRASH", | ||
"effect": [ { "u_add_effect": "regen_serum_crash_fatigue", "duration": [ "5 d", "10 d" ] } ] | ||
}, | ||
{ | ||
"type": "effect_on_condition", | ||
"id": "EOC_REGEN_SERUM_PAIN_SPIKE", | ||
"condition": { "u_has_any_effect": [ "regen_serum_main" ] }, | ||
"//": "todo: move message to snippet?", | ||
"effect": [ | ||
{ "u_message": "You feel an immense pain, when something within your bloodstream moves eerily.", "type": "bad" }, | ||
{ "math": [ "u_pain()", "+=", "rng(15, 55)" ] }, | ||
{ "queue_eocs": "EOC_REGEN_SERUM_PAIN_SPIKE", "time_in_future": [ "1 h", "6 h" ] } | ||
] | ||
}, | ||
{ | ||
"type": "effect_on_condition", | ||
"id": "EOC_REGEN_SERUM_MUT_REJECTION", | ||
"condition": { "one_in_chance": 5 }, | ||
"effect": [ | ||
{ | ||
"if": { "one_in_chance": 2 }, | ||
"then": { "u_mutate_category": "HUMAN", "use_vitamins": false }, | ||
"else": { "u_mutate": 1, "use_vitamins": false } | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "effect_type", | ||
"id": "regen_serum_main", | ||
"name": [ "Injected 48x-\"Locutus\"" ], | ||
"desc": [ | ||
"You just take a shot of some weird stuff. You feel sleepiness, nauseous, and overall weakened, but you wounds close up at unnatural pace." | ||
], | ||
"apply_message": "Without hesitation, you draw the liquid from the ampule, smack it a bit to release an air, and put right into your veins, in hope it won't kill you.", | ||
"remove_message": "You feel your rapid regeneration turn back to normal, but some negative effects are still presented.", | ||
"rating": "mixed", | ||
"flags": [ "MEND_ALL" ], | ||
"enchantments": [ | ||
{ | ||
"values": [ | ||
{ "value": "REGEN_HP", "multiply": 50 }, | ||
{ "value": "REGEN_HP_AWAKE", "multiply": 1 }, | ||
{ "value": "MENDING_MODIFIER", "add": 50 }, | ||
{ "value": "METABOLISM", "multiply": 2 }, | ||
{ "value": "HUNGER", "multiply": 2 }, | ||
{ "value": "SLEEPINESS", "multiply": 1 }, | ||
{ "value": "STAMINA_REGEN_MOD", "multiply": -0.5 }, | ||
{ "value": "VOMIT_MUL", "multiply": 1 } | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "effect_type", | ||
"id": "regen_serum_crash_cardio", | ||
"name": [ "" ], | ||
"desc": [ "" ], | ||
"apply_message": "", | ||
"remove_message": "", | ||
"enchantments": [ | ||
{ | ||
"values": [ | ||
{ "value": "CARDIO_MULTIPLIER", "multiply": { "math": [ "(-1 / clamp( spent_to_ingested_ratio(), 0, 0.6 )) / 5" ] } }, | ||
{ "value": "STRENGTH", "multiply": { "math": [ "(-1 / clamp( spent_to_ingested_ratio(), 0, 0.6 )) / 5" ] } } | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "effect_type", | ||
"id": "regen_serum_crash_fatigue", | ||
"name": [ "Injected Serum Crash" ], | ||
"desc": [ "Your body regeneration is not as fast as before, but you still feel some weakness." ], | ||
"apply_message": "", | ||
"remove_message": "", | ||
"enchantments": [ { "values": [ { "value": "STAMINA_REGEN_MOD", "multiply": -0.5 }, { "value": "SLEEPINESS", "multiply": 1 } ] } ] | ||
} | ||
] |
26 changes: 26 additions & 0 deletions
26
data/json/effects_on_condition/medicine_eocs/serum_eoc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[ | ||
{ | ||
"type": "effect_on_condition", | ||
"id": "EOC_HAS_SERUM", | ||
"condition": { "u_has_any_effect": [ "regen_serum_main", "regen_serum_crash_cardio", "regen_serum_crash_fatigue" ] } | ||
}, | ||
{ | ||
"type": "effect_on_condition", | ||
"id": "EOC_HAS_SYRINGE", | ||
"condition": { "or": [ { "u_has_item": "syringe" }, { "u_has_bionics": "bio_syringe" } ] } | ||
}, | ||
{ | ||
"type": "effect_on_condition", | ||
"id": "EOC_SERUM_GENERIFIED", | ||
"condition": { "test_eoc": "EOC_HAS_SYRINGE" }, | ||
"effect": [ { "run_eocs": "EOC_SERUM_GENERIFIED_2" } ], | ||
"false_effect": [ { "u_message": "You need a syringe to inject the liquid.", "type": "bad" } ] | ||
}, | ||
{ | ||
"type": "effect_on_condition", | ||
"id": "EOC_SERUM_GENERIFIED_2", | ||
"condition": { "not": { "test_eoc": "EOC_HAS_SERUM" } }, | ||
"effect": [ { "run_eocs": [ { "context_val": "eoc" } ] } ], | ||
"false_effect": [ { "u_message": "You would not dare to inject two of them at once.", "type": "bad" } ] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[ | ||
{ | ||
"id": "serum_regen", | ||
"type": "GENERIC", | ||
"category": "drugs", | ||
"name": { "str_sp": "48x-\"Locutus\"" }, | ||
"description": "Little, sealed ampule with some white, semi-transparent liquid of unknown origin. Label on it says \"48x-\"Locutus\"\", whatever that means.", | ||
"weight": "7 g", | ||
"volume": "10 ml", | ||
"material": [ "alien_liquid" ], | ||
"symbol": "[", | ||
"color": "white", | ||
"use_action": [ | ||
{ | ||
"type": "effect_on_conditions", | ||
"menu_text": "Inject", | ||
"description": "Inject the liquid.", | ||
"effect_on_conditions": [ | ||
{ | ||
"id": "EOC_RUN_SERUM_REGEN", | ||
"effect": { "run_eoc_with": "EOC_SERUM_GENERIFIED", "variables": { "eoc": "EOC_SERUM_REGEN" } } | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3409,6 +3409,7 @@ LMES | |
LMG | ||
LMGs | ||
LMOE | ||
Locutus | ||
loadout | ||
loadouts | ||
lobotomizer | ||
|