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

Context Dependent Nightmares #72309

Closed
wants to merge 81 commits into from
Closed
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
97c423d
fixes merge errors.
DoctorBoomstick Jul 2, 2023
ad9a35b
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jul 3, 2023
f243460
Merge branch 'master' of https://github.com/DoctorBoomstick/Cataclysm…
DoctorBoomstick Jul 4, 2023
c85a281
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jul 9, 2023
9d40bd7
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jul 21, 2023
e3eb338
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jul 29, 2023
e03c3a4
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Aug 3, 2023
d006c4e
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Aug 6, 2023
df5f709
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Aug 13, 2023
6002b70
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Aug 17, 2023
eabc64e
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Aug 20, 2023
4b38a26
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Aug 31, 2023
3202fd6
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Sep 29, 2023
407f8eb
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Oct 6, 2023
55c0b70
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Oct 14, 2023
de0154c
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Nov 7, 2023
4984eeb
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Nov 20, 2023
a0e7e2c
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Dec 7, 2023
f80539e
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Dec 11, 2023
397de31
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Dec 14, 2023
4cbf7e7
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Dec 22, 2023
fae5975
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jan 15, 2024
328362f
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Feb 4, 2024
31dd3ad
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Feb 8, 2024
1da0174
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Feb 11, 2024
bdf7be4
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Feb 16, 2024
78102e7
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Feb 20, 2024
c5cc8e5
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Feb 22, 2024
2bbc216
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Feb 25, 2024
4bbe44f
adds the trubbled sleaper trait, the starting work on the nightmares …
DoctorBoomstick Mar 6, 2024
61f89dc
Hooks in the capability to prevent nightmares from triggering if the …
DoctorBoomstick Mar 7, 2024
70d376d
hooks in flavour text for when the player falls a sleep.
DoctorBoomstick Mar 7, 2024
6d2dc56
adds the framework for flavour messages when the player enters the ti…
DoctorBoomstick Mar 8, 2024
ab07bbf
Adds the category for soldier nightmares, the related eoc, and one, w…
DoctorBoomstick Mar 10, 2024
4643449
I lied last time. This is the final commit before draft. General form…
DoctorBoomstick Mar 10, 2024
992f3ab
Thought I was finished lying after the last commit? Hah hah. Axes som…
DoctorBoomstick Mar 10, 2024
891dc7b
Update data/json/effects_on_condition/dream_eocs.json
DoctorBoomstick Mar 10, 2024
5d4ee81
Update data/json/effects_on_condition/dream_eocs.json
DoctorBoomstick Mar 10, 2024
aaf214b
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Mar 11, 2024
c30d2d5
Merge branch 'master' into nightmare
DoctorBoomstick Mar 11, 2024
f67eace
Adds 2 snippets for refugee centre nightmares, and the related EOC.
DoctorBoomstick Mar 11, 2024
0e8f4ee
Update data/json/effects_on_condition/dream_eocs.json
DoctorBoomstick Mar 11, 2024
cf84d96
new soldier snippet.
DoctorBoomstick Mar 11, 2024
d3a793a
one new general and soldier snippet, changes id of bad_dreams to be i…
DoctorBoomstick Mar 13, 2024
bed78c2
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Mar 14, 2024
6b2da32
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Mar 16, 2024
63b6899
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Mar 20, 2024
df17916
Merge branch 'master' into nightmare
DoctorBoomstick Mar 20, 2024
2c97cf6
remakes the soldier nightmare snippets.
DoctorBoomstick Mar 21, 2024
d8569d4
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Mar 23, 2024
bdc13e0
Merge branch 'master' into nightmare
DoctorBoomstick Mar 23, 2024
77880db
cupple new soldier snippets.
DoctorBoomstick Mar 24, 2024
f192031
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Mar 24, 2024
00c4cf9
Merge branch 'master' into nightmare
DoctorBoomstick Mar 24, 2024
8f28ad0
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Mar 27, 2024
7d3be33
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Mar 31, 2024
3a24916
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Apr 5, 2024
7a930f8
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Apr 12, 2024
3b9a7d4
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Apr 15, 2024
0aebc26
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Apr 30, 2024
14b25a2
Merge branch 'master' into nightmare
DoctorBoomstick May 1, 2024
8376a2c
well, look who recalled that this PR still exists. adds 7 new soldier…
DoctorBoomstick May 1, 2024
33807af
Refugee centre nightmares.
DoctorBoomstick May 2, 2024
fd9f847
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick May 10, 2024
7dd586b
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick May 25, 2024
a3447bc
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick May 27, 2024
444ca50
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jun 2, 2024
df9c48d
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jun 4, 2024
b87d2a2
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jun 7, 2024
b6200d5
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jun 10, 2024
0e5e1af
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jun 12, 2024
d3cbb40
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jun 17, 2024
5a46b62
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jun 20, 2024
26fadf5
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jun 21, 2024
c44c6e4
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jun 23, 2024
9a8ba69
Merge branch 'master' into nightmare
DoctorBoomstick Jun 23, 2024
a7af557
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jun 25, 2024
ce4d879
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jul 9, 2024
51db66e
Merge branch 'master' into nightmare
DoctorBoomstick Jul 25, 2024
76c2e2d
Merge remote-tracking branch 'upstream/master'
DoctorBoomstick Jul 25, 2024
a4dee51
Merge branch 'master' into nightmare
DoctorBoomstick Jul 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions data/json/effects_on_condition/dream_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,103 @@
"//": "used to prevent multiple dreams at the same sleep",
"effect": [ { "math": [ "dream_counter", "=", "0" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_TROUBLED_SLEEP_FATIGUE_MESSAGES",
"//": "Prints a flavour text message to the log about being afraid of sleep if the character has entered the tired status, has the trubbled sleeper trait, and has not taken preventative medication. The EOC’s set to recur every 8 to 20 minutes.",
"global": true,
"recurrence": [ "8 minutes", "20 minutes" ],
"condition": {
"and": [
{ "math": [ "u_val('fatigue')", ">", "191" ] },
{ "u_has_trait": "bad_dreams" },
{ "not": { "u_has_effect": "took_prozac" } }
]
},
"effect": [ { "u_message": "troubled_sleep_fatigue_messages", "snippet": true, "type": "bad" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_TROUBLED_SLEEP_MESSAGE",
"//": "prints a message to the log upon the character falling asleep with the troubled sleeper trait. The text changes based on whether the player has taken preventative medication or not. Primarily intended for immersion and to let the player know if their medication, should they have taken it, is going to work to repress nightmares.",
"eoc_type": "EVENT",
"required_event": "character_falls_asleep",
"condition": { "u_has_trait": "bad_dreams" },
"effect": [
{
"if": { "u_has_effect": "took_prozac" },
"then": {
"u_message": "Surrendering yourself to the arms of sleep, you hope your medication will let you have a good night’s rest.",
"type": "good"
},
"else": {
"u_message": "As your eyes close, unease brews in your mind, anxiety swirling in your gut. You know the nightmares won't leave you at peace.",
"type": "bad"
}
}
]
}
{
"type": "effect_on_condition",
"id": "EOC_TROUBLED_SLEEP_SOLDIER_NIGHTMARES",
"//": "Generates a military-specific nightmare for players with the troubled sleeper trait and a soldier profession upon the character waking up, presents a pop-up with the nightmare, and provides a mood debuff. The EOC’s set to not fire if the player has taken preventative medication.",
"eoc_type": "EVENT",
"required_event": "character_wakes_up",
"condition": {
"and": [
{ "math": [ "dream_counter", "==", "0" ] },
{ "u_has_trait": "bad_dreams" },
{ "not": { "u_has_effect": "took_prozac" } },
{
"or": {
"u_profession": "recruit",
"u_profession": "rifleman",
"u_profession": "specops",
"u_profession": "mil_marksman",
"u_profession": "mil_auto_rifleman",
"u_profession": "mil_grenadier",
"u_profession": "mil_breacher",
"u_profession": "mil_sniper",
"u_profession": "mil_hacker",
"u_profession": "mil_undercover",
"u_profession": "hazmat_unit",
"u_profession": "nco",
"u_profession": "combat-mechanic",
"u_profession": "combat-engineer"
Comment on lines +107 to +120
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know much about EOC / JSON stuff, but I wonder, wouldn't be possible to use some invisible traits as "profession tags" instead? This way mods could make use of this same stuff, for example, some of military-ish MoM professions. That also allow combination of nightmares, like a Military Parametric having both military related and EMT related ones.

OTOH this may cause a "trait-explosion" so ¯_(ツ)_/¯

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is possible to add invisible traits by setting "player_display": false, then you can use EOCs to check for those instead of individual ids.

The real downside of doing that isn't the explosion itself (the mutation.json file is close to 10k lines now, however most of those are mutation-related traits iirc), but manually adding each tag to any and all professions that qualify.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GuardianDll, to be honest, chief, you and Renech’s help in getting this PR off its feet on the EOC side of things has been very appreciated. Thanks for the further pointers and optimisations here.
@andrewhr, to be honest, I think I’d rather just make the EOC a player-wide thing rather than making an invizable trait for each and every profession use case. When it comes to mods, I believe they could add their own EOC that basically copies what I’ve made but applies it to their own professions. On the subject, however, of keeping this feature dependent on a trait or not, I’m not sure which way I lean for the time being.

The three options I’m seeing are

  • Keep it as a trait, as it is currently.

  • Keep it as a trait, but make it come by default in certain scenarios where it would make sense. For example, somebody starting in an overrun military base has probably seen their fair share of shit over the cataclysm, while somebody who’s starting in a safe island cabin might have been relatively free of encountering such events. Down the line, certain events could add the trait to these characters, but we’re now walking into fantasy land ideas.

  • Make it so every player gets the fun nightmares and laugh at the complainers when they come huffing about how every sleep makes their character depressed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is correct, it would be better to keep it as a straight list of profs - bloating profs with unnecessary traits is bad approach, especially when it is used only in one place - here, in this EoC

mods would have no problem to add stuff into the EoC by copying and adding profs they want into the list; if it is a consern for you, please don't think about it; if you have a legit use case, you can move the trait checks to separate EoCs and then use test_eoc

}
}
]
},
"//2": "Despite being soldiers, the Marine, Navy SEAL, Naval Sailor, Military Pilot, and Major General professions have been excluded from this list, as they should have their own nightmare categories.",
"//3": "This does not pull from the snippets used when a player gets nightmares as a result of a portal storm.",
"effect": [
{ "u_message": "nightmares_cataclysm_soldier", "snippet": true, "popup": true, "type": "bad" },
{ "u_add_morale": "morale_nightmare", "bonus": [ -15, -30 ], "max_bonus": -30 },
{ "math": [ "dream_counter", "=", "1" ] },
{ "queue_eocs": "EOC_RESET_DREAM_COUNTER", "time_in_future": 1 }
]
},
{
"type": "effect_on_condition",
"id": "EOC_TROUBLED_SLEEP_NIGHTMARES",
"//": "Generates a generic, post-cataclysm nightmare for players with the troubled sleeper trait upon the character waking up, presents a pop-up with the nightmare, and provides a mood debuff. The EOC’s set to not fire if the player has taken preventative medication.",
"eoc_type": "EVENT",
"required_event": "character_wakes_up",
"condition": {
"and": [
{ "math": [ "dream_counter", "==", "0" ] },
{ "u_has_trait": "bad_dreams" },
{ "not": { "u_has_effect": "took_prozac" } }
]
},
"//2": "This does not pull from the snippets used when a player gets nightmares as a result of a portal storm.",
"effect": [
{ "u_message": "nightmares_cataclysm_general", "snippet": true, "popup": true, "type": "bad" },
{ "u_add_morale": "morale_nightmare", "bonus": [ -15, -30 ], "max_bonus": -30 },
{ "math": [ "dream_counter", "=", "1" ] },
{ "queue_eocs": "EOC_RESET_DREAM_COUNTER", "time_in_future": 1 }
]
},
{
"type": "effect_on_condition",
"id": "EOC_GIVE_NIGHTMARES",
Expand Down
9 changes: 9 additions & 0 deletions data/json/mutations/mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -9743,5 +9743,14 @@
"starting_trait": true,
"valid": false,
"no_cbm_on_bp": [ "torso", "head", "eyes", "mouth", "arm_l", "arm_r", "hand_l", "hand_r", "leg_l", "leg_r", "foot_l", "foot_r" ]
},
{
"type": "mutation",
"id": "bad_dreams",
"name": { "str": "Troubled Sleeper" },
"points": -2,
"description": "Disturbing events tend to stick to your psyche, and the cataclysm has left you with more than your fair share of psychological trauma. Now, not even slumber can rest you from your fears; nightmares will plague your sleep if you don’t keep them at bay with anti-depressants.",
"starting_trait": true,
"valid": false
}
]
Loading
Loading