Skip to content

Commit

Permalink
JSON-ify hallucinations (#69919)
Browse files Browse the repository at this point in the history
* WIP part 1

* WIP part 2

* WIP part 3

* Delete old C++

* Oops

* Bugfix 1

* Bugfix 2

* Bugfix 3

* Update src/player_hardcoded_effects.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Bugfix 4

* Un-inline the EOCs, separate

* Fix bleed EOCs and symbol messup

* Update hallucination_eocs.json

* Update hallucination_eocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
MNG-cataclysm and github-actions[bot] authored Dec 5, 2023
1 parent b2bbf19 commit 95930d9
Show file tree
Hide file tree
Showing 6 changed files with 8,777 additions and 317 deletions.
200 changes: 200 additions & 0 deletions data/json/effects_on_condition/npc_eocs/hallucination_eocs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
[
{
"type": "effect_on_condition",
"id": "hallucinate_effect",
"global": false,
"recurrence": [ "2 hours", "6 hours" ],
"condition": {
"and": [
{ "not": { "u_has_effect": "sleep" } },
{ "not": { "u_has_effect": "took_thorazine" } },
{ "or": [ { "u_has_trait": "SCHIZOPHRENIC" }, { "u_has_effect": "hallu" } ] }
]
},
"effect": [
{
"weighted_list_eocs": [
[ "minor_hallucinations", { "const": 10 } ],
[ "intermediate_hallucinations", { "const": 6 } ],
[ "bad_hallucinations", { "const": 4 } ]
]
}
]
},
{
"type": "effect_on_condition",
"id": "minor_hallucinations",
"effect": [
{
"weighted_list_eocs": [
[ "paranoid", { "const": 75 } ],
[ "grandiose", { "const": 25 } ],
[ "self_talk", { "const": 14 } ],
[ "weapon_talk_hallucination", { "const": 14 } ],
[ "false_npc_talk", { "const": 12 } ]
]
}
]
},
{
"type": "effect_on_condition",
"id": "intermediate_hallucinations",
"effect": [
{
"weighted_list_eocs": [
[ "self_shout", { "const": 30 } ],
[ "hear_false_sound", { "const": 20 } ],
[ "formication", { "const": 20 } ],
[ "numbness", { "const": 15 } ],
[ "shaking", { "const": 10 } ]
]
}
]
},
{
"type": "effect_on_condition",
"id": "bad_hallucinations",
"effect": [ { "weighted_list_eocs": [ [ "creature_hallucinations", { "const": 20 } ], [ "visuals", { "const": 10 } ] ] } ]
},
{
"type": "effect_on_condition",
"id": "paranoid",
"effect": [
{ "u_message": "schizo_delusion_paranoid", "snippet": true },
{
"u_add_morale": "morale_feeling_bad",
"bonus": -20,
"max_bonus": -100,
"duration": "30 minutes",
"decay_start": "30 minutes"
}
]
},
{
"type": "effect_on_condition",
"id": "self_talk",
"effect": { "u_make_sound": "schizo_self_talk", "volume": 5, "snippet": true, "type": "speech" }
},
{
"type": "effect_on_condition",
"id": "grandiose",
"effect": [
{ "u_message": "schizo_delusion_grandiose", "snippet": true },
{
"u_add_morale": "morale_feeling_good",
"bonus": 20,
"max_bonus": 100,
"duration": "30 minutes",
"decay_start": "30 minutes"
}
]
},
{
"type": "effect_on_condition",
"id": "weapon_talk_hallucination",
"//": "Goes in this order: Weapon will fear for its life if injured, then be concerned for yours if you're injured, then alert you to monsters nearby. Otherwise, random chit-chat.",
"condition": {
"and": [
{ "not": { "u_has_effect": "sleep" } },
{ "not": { "u_has_effect": "took_thorazine" } },
{ "or": [ { "u_has_trait": "SCHIZOPHRENIC" }, { "u_has_effect": "hallu" } ] }
]
},
"effect": [
{
"u_run_inv_eocs": "random",
"search_data": [ { "wielded_only": true } ],
"true_eocs": [
{
"id": "injured_talk",
"condition": { "math": [ "n_hp('ALL')", "<", "n_hp_max('bp_null')" ] },
"effect": { "u_message": "Your weapon says \"<schizo_weapon_talk_damaged>\"" },
"false_effect": {
"run_eocs": {
"id": "you_injured_talk",
"//": "Weapon will be concerned for you if you're significantly injured.",
"condition": { "math": [ "(u_hp('ALL') * 1.4)", "<", "u_hp_max('bp_null')" ] },
"effect": { "u_message": "Your weapon says \"<schizo_weapon_talk_bleeding>\"" },
"false_effect": {
"run_eocs": {
"id": "monsters_nearby_talk",
"condition": { "and": [ "u_can_see", { "math": [ "u_monsters_nearby('radius': 10)", ">=", "1" ] } ] },
"effect": { "u_message": "Your weapon says \"<schizo_weapon_talk_monster>\"" },
"false_effect": { "run_eocs": { "id": "normal_talk", "effect": { "u_message": "Your weapon says \"<schizo_weapon_talk_misc>\"" } } }
}
}
}
}
}
]
},
{
"run_eocs": {
"id": "determine_if_coversation",
"//": "85% chance for your weapon to make a conversation. If not, try again some time later.",
"condition": { "x_in_y_chance": { "x": 85, "y": 100 } },
"effect": { "queue_eocs": "weapon_talk_hallucination", "time_in_future": [ "10 seconds", "15 seconds" ] },
"false_effect": { "queue_eocs": "weapon_talk_hallucination", "time_in_future": [ "4 hours", "6 hours" ] }
}
}
],
"false_effect": { "run_eocs": "minor_hallucinations" }
},
{
"type": "effect_on_condition",
"id": "false_npc_talk",
"effect": { "u_message": "<random_anysex_first_name> <random_last_name> says \"<lets_talk>\"", "type": "info" }
},
{
"type": "effect_on_condition",
"id": "self_shout",
"effect": { "u_make_sound": "schizo_self_shout", "volume": 20, "snippet": true, "type": "speech" }
},
{
"type": "effect_on_condition",
"id": "hear_false_sound",
"effect": [ { "u_message": "schizo_hear_sound", "snippet": true, "type": "warning" } ]
},
{
"type": "effect_on_condition",
"id": "formication",
"effect": [
{ "u_message": "schizo_formication", "snippet": true, "type": "bad" },
{ "u_add_effect": "formication", "duration": "45 minutes", "target_part": "RANDOM" }
]
},
{
"type": "effect_on_condition",
"id": "numbness",
"effect": [
{ "u_message": "You suddenly feel so numb…", "type": "mixed" },
{ "u_add_effect": "pkill1", "duration": "15 minutes" }
]
},
{
"type": "effect_on_condition",
"id": "shaking",
"condition": { "not": { "u_has_effect": "valium" } },
"effect": [
{ "u_message": "You begin to shake uncontrollably.", "type": "mixed" },
{ "u_add_effect": "shakes", "duration": [ "2 minutes", "5 minutes" ] }
],
"false_effect": { "run_eocs": "intermediate_hallucinations" }
},
{
"type": "effect_on_condition",
"id": "creature_hallucinations",
"effect": [
{ "u_message": "You can't trust everything you see…", "type": "bad" },
{ "u_add_effect": "hallu", "duration": [ "1 hour", "3 hours" ] }
]
},
{
"type": "effect_on_condition",
"id": "visuals",
"effect": [
{ "u_message": "Your vision becomes very distorted…", "type": "bad" },
{ "u_add_effect": "visuals", "duration": [ 15, 60 ] }
]
}
]
Loading

0 comments on commit 95930d9

Please sign in to comment.