Skip to content

Commit

Permalink
Jsonify addictions: convert harcoded effects to EOCs
Browse files Browse the repository at this point in the history
  • Loading branch information
dseguin committed Apr 13, 2022
1 parent c876f4c commit e752c2a
Show file tree
Hide file tree
Showing 7 changed files with 355 additions and 153 deletions.
39 changes: 26 additions & 13 deletions data/json/addictions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,101 +5,114 @@
"name": "Caffeine Withdrawal",
"type_name": "caffeine",
"description": "Strength - 1; Slight sluggishness; Occasional cravings",
"craving_morale": "morale_craving_caffeine"
"craving_morale": "morale_craving_caffeine",
"effect_on_condition": "EOC_CAFFEINE_ADDICTION"
},
{
"type": "addiction_type",
"id": "nicotine",
"name": "Nicotine Withdrawal",
"type_name": "nicotine",
"description": "Intelligence - 1; Occasional cravings",
"craving_morale": "morale_craving_nicotine"
"craving_morale": "morale_craving_nicotine",
"builtin": "nicotine_effect"
},
{
"type": "addiction_type",
"id": "alcohol",
"name": "Alcohol Withdrawal",
"type_name": "alcohol",
"description": "Perception - 1; Intelligence - 1; Occasional Cravings;\nRisk of delirium tremens",
"craving_morale": "morale_craving_alcohol"
"craving_morale": "morale_craving_alcohol",
"builtin": "alcohol_effect"
},
{
"type": "addiction_type",
"id": "sleeping pill",
"name": "Sleeping Pill Dependence",
"type_name": "sleeping pills",
"description": "You may find it difficult to sleep without medication."
"description": "You may find it difficult to sleep without medication.",
"effect_on_condition": "EOC_SLEEP_ADDICTION"
},
{
"type": "addiction_type",
"id": "opiate",
"name": "Opiate Withdrawal",
"type_name": "opiates",
"description": "Strength - 1; Perception - 1; Dexterity - 1;\nDepression and physical pain to some degree. Frequent cravings. Vomiting.",
"craving_morale": "morale_craving_opiate"
"craving_morale": "morale_craving_opiate",
"builtin": "opiate_effect"
},
{
"type": "addiction_type",
"id": "amphetamine",
"name": "Amphetamine Withdrawal",
"type_name": "amphetamine",
"description": "Strength - 1; Intelligence - 1;\nMovement rate reduction. Depression. Weak immune system. Frequent cravings.",
"craving_morale": "morale_craving_speed"
"craving_morale": "morale_craving_speed",
"builtin": "amphetamine_effect"
},
{
"type": "addiction_type",
"id": "cocaine",
"name": "Cocaine Withdrawal",
"type_name": "cocaine",
"description": "Perception - 1; Intelligence - 1; Frequent cravings.",
"craving_morale": "morale_craving_cocaine"
"craving_morale": "morale_craving_cocaine",
"builtin": "cocaine_effect"
},
{
"type": "addiction_type",
"id": "crack",
"name": "Crack Cocaine Withdrawal",
"type_name": "crack cocaine",
"description": "Perception - 2; Intelligence - 2; Frequent cravings.",
"craving_morale": "morale_craving_crack"
"craving_morale": "morale_craving_crack",
"builtin": "crack_effect"
},
{
"type": "addiction_type",
"id": "mutagen",
"name": "Mutation Withdrawal",
"type_name": "mutation",
"description": "You've gotten a taste for mutating and the chemicals that cause it. But you can stop, yeah, any time you want.",
"craving_morale": "morale_craving_mutagen"
"craving_morale": "morale_craving_mutagen",
"effect_on_condition": "EOC_MUTAGEN_ADDICTION"
},
{
"type": "addiction_type",
"id": "diazepam",
"name": "Diazepam Withdrawal",
"type_name": "diazepam",
"description": "Perception - 1; Intelligence - 1;\nAnxiety, nausea, hallucinations, and general malaise.",
"craving_morale": "morale_craving_diazepam"
"craving_morale": "morale_craving_diazepam",
"builtin": "diazepam_effect"
},
{
"type": "addiction_type",
"id": "marloss_r",
"name": "Marloss Longing",
"type_name": "Marloss berries",
"description": "You should try some of those pink berries.",
"craving_morale": "morale_craving_marloss"
"craving_morale": "morale_craving_marloss",
"effect_on_condition": "EOC_MARLOSS_R_ADDICTION"
},
{
"type": "addiction_type",
"id": "marloss_b",
"name": "Marloss Desire",
"type_name": "Marloss seeds",
"description": "You should try some of those cyan seeds.",
"craving_morale": "morale_craving_marloss"
"craving_morale": "morale_craving_marloss",
"effect_on_condition": "EOC_MARLOSS_B_ADDICTION"
},
{
"type": "addiction_type",
"id": "marloss_y",
"name": "Marloss Cravings",
"type_name": "Marloss gel",
"description": "You should try some of that golden gel.",
"craving_morale": "morale_craving_marloss"
"craving_morale": "morale_craving_marloss",
"effect_on_condition": "EOC_MARLOSS_Y_ADDICTION"
}
]
175 changes: 175 additions & 0 deletions data/json/addictions_eocs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
[
{
"type": "effect_on_condition",
"id": "EOC_CAFFEINE_ADDICTION",
"condition": { "compare_int": [ { "rand": 2000 }, "<", { "u_val": "addiction_intensity", "addiction": "caffeine", "mod": 20 } ] },
"effect": [
{ "u_message": "You want some caffeine.", "type": "warning" },
{ "u_add_morale": "morale_craving_caffeine", "bonus": -5, "max_bonus": -30 },
{
"run_eocs": [
{
"id": "EOC_CAFFEINE_ADDICTION_MODSTIM",
"condition": {
"and": [
{ "compare_int": [ { "u_val": "stim" }, ">", { "u_val": "addiction_intensity", "addiction": "caffeine", "mod": -10 } ] },
{
"compare_int": [ { "rand": 10 }, "<", { "u_val": "addiction_intensity", "addiction": "caffeine" } ]
}
]
},
"effect": { "arithmetic": [ { "u_val": "stim" }, "-=", { "const": 1 } ] }
},
{
"id": "EOC_CAFFEINE_ADDICTION_SHAKES",
"condition": {
"and": [
{ "compare_int": [ { "const": 8 }, ">=", { "u_val": "addiction_intensity", "addiction": "caffeine" } ] },
{
"compare_int": [ { "rand": 392 }, "<", { "u_val": "addiction_intensity", "addiction": "caffeine" } ]
}
]
},
"effect": [
{ "u_message": "Your hands start shaking… you need it bad!", "type": "bad" },
{ "u_add_effect": "shakes", "duration": "2 minutes" }
]
}
]
}
]
},
{
"type": "effect_on_condition",
"id": "EOC_SLEEP_ADDICTION",
"//": "Actual effects processed in player::can_sleep(). Here, only prolong this addiction longer than usual.",
"condition": {
"and": [
{ "compare_int": [ { "rand": 2 }, "==", { "const": 1 } ] },
{ "compare_int": [ { "u_val": "addiction_turns", "addiction": "sleeping pill" }, "<", { "const": 0 } ] }
]
},
"effect": { "arithmetic": [ { "u_val": "addiction_turns", "addiction": "sleeping pill" }, "+=", { "const": 1 } ] }
},
{
"type": "effect_on_condition",
"id": "EOC_MARLOSS_R_ADDICTION",
"condition": { "compare_int": [ { "rand": 800 }, "<", { "u_val": "addiction_intensity", "addiction": "marloss_r", "mod": 20 } ] },
"effect": [
{ "u_add_morale": "morale_craving_marloss", "bonus": -5, "max_bonus": -30 },
{ "u_message": "You daydream about luscious pink berries as big as your fist.", "type": "info" },
{
"run_eocs": [
{
"id": "EOC_MARLOSS_R_ADDICTION_MODFOCUS",
"condition": { "compare_int": [ { "u_val": "focus" }, ">", { "const": 40 } ] },
"effect": { "arithmetic": [ { "u_val": "focus" }, "-=", { "const": 1 } ] }
}
]
}
]
},
{
"type": "effect_on_condition",
"id": "EOC_MARLOSS_B_ADDICTION",
"condition": { "compare_int": [ { "rand": 800 }, "<", { "u_val": "addiction_intensity", "addiction": "marloss_b", "mod": 20 } ] },
"effect": [
{ "u_add_morale": "morale_craving_marloss", "bonus": -5, "max_bonus": -30 },
{ "u_message": "You daydream about nutty cyan seeds as big as your hand.", "type": "info" },
{
"run_eocs": [
{
"id": "EOC_MARLOSS_B_ADDICTION_MODFOCUS",
"condition": { "compare_int": [ { "u_val": "focus" }, ">", { "const": 40 } ] },
"effect": { "arithmetic": [ { "u_val": "focus" }, "-=", { "const": 1 } ] }
}
]
}
]
},
{
"type": "effect_on_condition",
"id": "EOC_MARLOSS_Y_ADDICTION",
"condition": { "compare_int": [ { "rand": 800 }, "<", { "u_val": "addiction_intensity", "addiction": "marloss_y", "mod": 20 } ] },
"effect": [
{ "u_add_morale": "morale_craving_marloss", "bonus": -5, "max_bonus": -30 },
{ "u_message": "You daydream about succulent, pale golden gel, sweet but light.", "type": "info" },
{
"run_eocs": [
{
"id": "EOC_MARLOSS_Y_ADDICTION_MODFOCUS",
"condition": { "compare_int": [ { "u_val": "focus" }, ">", { "const": 40 } ] },
"effect": { "arithmetic": [ { "u_val": "focus" }, "-=", { "const": 1 } ] }
}
]
}
]
},
{
"type": "effect_on_condition",
"id": "EOC_MUTAGEN_ADDICTION",
"condition": { "u_has_trait": "MUT_JUNKIE" },
"effect": [
{
"run_eocs": [
{
"id": "EOC_MUTAGEN_ADDICTION_JUNKIE_MORALE",
"condition": { "compare_int": [ { "rand": 600 }, "<", { "u_val": "addiction_intensity", "addiction": "mutagen", "mod": 50 } ] },
"effect": [
{
"run_eocs": [
{
"id": "EOC_MUTAGEN_ADDICTION_JUNKIE_MORALE_MSG",
"condition": { "compare_int": [ { "rand": 6 }, "<", { "u_val": "addiction_intensity", "addiction": "mutagen" } ] },
"effect": { "u_message": "You so miss the exquisite rainbow of post-humanity.", "type": "warning" },
"false_effect": { "u_message": "Your body is SOO booorrrring. Just a little sip to liven things up?", "type": "warning" }
}
]
},
{ "u_add_morale": "morale_craving_mutagen", "bonus": -20, "max_bonus": -200 }
]
},
{
"id": "EOC_MUTAGEN_ADDICTION_JUNKIE_FOCUS",
"condition": {
"and": [
{ "compare_int": [ { "u_val": "focus" }, ">", { "const": 40 } ] },
{
"compare_int": [ { "rand": 800 }, "<", { "u_val": "addiction_intensity", "addiction": "mutagen", "mod": 20 } ]
}
]
},
"effect": [
{ "arithmetic": [ { "u_val": "focus" }, "-=", { "u_val": "addiction_intensity", "addiction": "mutagen" } ] },
{
"u_message": "You daydream what it'd be like if you were *different*. Different is good.",
"type": "warning"
}
]
}
]
}
],
"false_effect": {
"run_eocs": [
{
"id": "EOC_MUTAGEN_ADDICTION_NOJUNKIE",
"condition": { "compare_int": [ { "rand": 500 }, "<", { "u_val": "addiction_intensity", "addiction": "mutagen", "mod": 15 } ] },
"effect": [
{
"run_eocs": [
{
"id": "EOC_MUTAGEN_ADDICTION_NOJUNKIE_MSG",
"condition": { "compare_int": [ { "rand": 6 }, "<", { "u_val": "addiction_intensity", "addiction": "mutagen" } ] },
"effect": { "u_message": "You haven't had any mutagen lately.", "type": "warning" },
"false_effect": { "u_message": "You could use some new parts…", "type": "warning" }
}
]
},
{ "u_add_morale": "morale_craving_mutagen", "bonus": -5, "max_bonus": -50 }
]
}
]
}
}
]
Loading

0 comments on commit e752c2a

Please sign in to comment.