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

How i lost my sanity painfully changing 159 files one by one -- Reworks observation code to be better for any amount of answers #2637

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
47 changes: 25 additions & 22 deletions code/modules/mob/living/simple_animal/abnormality/_abnormality.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,19 @@
/// Offset for secret skins in the Y axis
var/secret_vertical_offset = 0

/// Final Observation details
var/observation_in_progress = FALSE
/// Final Observation stuffs
/// The prompt we get alongside our choices for observing it
var/observation_prompt = "The abnormality is watching you. What will you do?"
var/list/observation_choices = list("Approach", "Leave")
var/list/correct_choices = list("Approach", "Leave")
var/observation_success_message = "Final Observation Success!"
var/observation_fail_message = "Final Observation Failed!"
/**
* observation_choices is made in the format of:
* "Choice" = list(TRUE or FALSE [depending on if the answer is correct], "Response"),
*/
var/list/observation_choices = list(
"Approach" = list(TRUE, "You approach the abnormality... and obtain a gift from it."),
"Leave" = list(TRUE, "You leave the abnormality... and before you notice a gift is in your hands."),
)
/// Is there a currently on-going observation?
var/observation_in_progress = FALSE

/mob/living/simple_animal/hostile/abnormality/Initialize(mapload)
SHOULD_CALL_PARENT(TRUE)
Expand Down Expand Up @@ -339,13 +345,6 @@
/mob/living/simple_animal/hostile/abnormality/proc/PostSpawn()
SHOULD_CALL_PARENT(TRUE)
HandleStructures()
var/condition = FALSE //Final observation debug
for(var/answer in observation_choices)
if(answer in correct_choices)
condition = TRUE
if(!condition)
CRASH("Abnormality has no correct choice for final observation!")
return

// Moves structures already in its datum; Overrides can spawn structures here.
/mob/living/simple_animal/hostile/abnormality/proc/HandleStructures()
Expand Down Expand Up @@ -552,25 +551,29 @@
return
to_chat(user, span_warning("You already have a gift in the [gift_type.slot] slot, dissolve it first!"))
return
var/condition = FALSE

if(observation_in_progress)
to_chat(user, span_notice("Someone is already observing [src]!"))
return
observation_in_progress = TRUE
var/answer = final_observation_alert(user, "[observation_prompt]", "Final Observation of [src]", observation_choices, timeout = 60 SECONDS)
if(answer in correct_choices)
condition = TRUE
ObservationResult(user, condition, answer) //We pass along the answer just in case
var/answer = final_observation_alert(user, "[observation_prompt]", "Final Observation of [src]", shuffle(observation_choices), timeout = 60 SECONDS)
if(answer == "timed out")
ObservationResult(user, reply = answer)
else
var/list/answer_vars = observation_choices[answer]
ObservationResult(user, answer_vars[1], answer_vars[2])

observation_in_progress = FALSE

/mob/living/simple_animal/hostile/abnormality/proc/ObservationResult(mob/living/carbon/human/user, condition, answer)
if(condition) //Successful, could override for longer observations as well.
final_observation_alert(user,"[observation_success_message]", "OBSERVATION SUCCESS",list("Ok"), timeout=20 SECONDS) //Some of these take a long time to read
/mob/living/simple_animal/hostile/abnormality/proc/ObservationResult(mob/living/carbon/human/user, success = FALSE, reply = "")
if(success) //Successful, could override for longer observations as well.
final_observation_alert(user, "[reply]", "OBSERVATION SUCCESS", list("Ok"), timeout = 20 SECONDS) //Some of these take a long time to read
if(gift_type)
user.Apply_Gift(new gift_type)
playsound(get_turf(user), 'sound/machines/synth_yes.ogg', 30 , FALSE)
else
final_observation_alert(user,"[observation_fail_message]", "OBSERVATION FAIL",list("Ok"), timeout=20 SECONDS)
if(reply != "timed out")
final_observation_alert(user, "[reply]", "OBSERVATION FAIL", list("Ok"), timeout = 20 SECONDS)
playsound(get_turf(user), 'sound/machines/synth_no.ogg', 30 , FALSE)
datum_reference.observation_ready = FALSE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ GLOBAL_LIST_EMPTY(army)

observation_prompt = "\"We're here to help sir, to keep the hearts of humans a clean pink, we're willing to dirty our own. We won't overlook a single speck of black.\" <br>\
The soldier in pink makes a salute. <br>You..."
observation_choices = list("Don't salute", "Salute him back")
correct_choices = list("Don't salute")
observation_success_message = "The soldier frowns. <br>\"As expected. <br>You're only human, a clean heart is only ever temporary for you. <br>Yours is rife with sin. <br>Ours are...\" <br>\
The soldier falls silent, as if in deep thought."
observation_fail_message = "The soldier in pink smiles. <br>\"Glad to have you on board Sir, with our help, there will be no more black hearts.\""
observation_choices = list(
"Don't salute" = list(TRUE, "The soldier frowns. <br>\"As expected. <br>You're only human, a clean heart is only ever temporary for you. <br>\
Yours is rife with sin. <br>Ours are...\" <br>The soldier falls silent, as if in deep thought."),
"Salute him back" = list(FALSE, "The soldier in pink smiles. <br>\"Glad to have you on board Sir, with our help, there will be no more black hearts.\""),
)

//Unique variables
var/death_counter = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
StageChange()

/mob/living/simple_animal/hostile/abnormality/black_sun/proc/StageChange()
stage+=1
stage++
//Add 10 stats to everyone.
if(stage == 1)
affected_players = list() //Clear the list, then fill it up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
observation_prompt = "A group of employees worship this abnormality, despite the fact nothing can be sacred in this place. <br>\
You recall how you pulled away one employee away from it in the past, even as she screamed and wailed that you were keeping her chained to this world. <br>You thought you were saving her. <br>\
You can hear a distant howl emanating from the centre of the blue-coloured heart. <br>It's the sound of stars. <br>They're welcoming you, asking you to join them as a star."
observation_choices = list("Be pulled in", "Hold yourself tight")
correct_choices = list("Be pulled in")
observation_success_message = "You don't hesitate as you approach the centre of the void. <br>Sensation in your hands and legs are the first things to go, creeping up your body until you couldn't feel anything physical at all. <br>\
Despite how scary it should have been, you feel at peace, <br>this isn't an end it's a new beginning - You're a martyr. <br>\
Let's meet everyone again, as stars."
observation_fail_message = "You wrapped your arms around yourself and shut your eyes, turning your senses inward until the temptation passes and the sounds become distant howls again. <br>\
You opened your eyes and looked again at the heart. <br>It remains in the air, floating towards a new beginning."
observation_choices = list(
"Be pulled in" = list(TRUE, "You don't hesitate as you approach the centre of the void. <br>Sensation in your hands and legs are the first things to go, creeping up your body until you couldn't feel anything physical at all. <br>\
Despite how scary it should have been, you feel at peace, <br>this isn't an end it's a new beginning - You're a martyr. <br>\
Let's meet everyone again, as stars."),
"Hold yourself tight" = list(FALSE, "You wrapped your arms around yourself and shut your eyes, turning your senses inward until the temptation passes and the sounds become distant howls again. <br>\
You opened your eyes and looked again at the heart. <br>It remains in the air, floating towards a new beginning."),
)

var/pulse_cooldown
var/pulse_cooldown_time = 12 SECONDS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
abnormality_origin = ABNORMALITY_ORIGIN_LOBOTOMY

observation_prompt = "This is the containment unit of \[CENSORED\]. <br>Many managers went mad, before they implemented the cognition filter, from the sight of it."
observation_choices = list("Enter the containment unit", "Don't enter")
correct_choices = list("Enter the containment unit")
observation_success_message = "You enter the containment unit of \[CENSORED\], the smell of \[REDACTED\] and the sound of \[ANULLED\] filled the air. <br>\
After steeling yourself, you finally saw \[CENSORED\]. <br>You manage to face the fear."
observation_fail_message = "A wave of nausea rises up within at the thought of entering the containment unit, and you turn on your heels to leave. <br>\
You're not ready to build the future."
observation_choices = list(
"Enter the containment unit" = list(TRUE, "You enter the containment unit of \[CENSORED\], the smell of \[REDACTED\] and the sound of \[ANULLED\] filled the air. <br>\
After steeling yourself, you finally saw \[CENSORED\]. <br>You manage to face the fear."),
"Don't enter" = list(FALSE, "A wave of nausea rises up within at the thought of entering the containment unit, and you turn on your heels to leave. <br>\
You're not ready to build the future."),
)

var/can_act = TRUE
var/ability_damage = 150
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@
But the largest creature of all surrounds me entirely. <br>Every direction is covered in a undulating mass of flesh, blood, fur, and feathers. <br>\
I am always butchering monsters like these. <br>I tear them limb from limb.<br>\
Bringing death in brutal fashion. <br>Am I not a fitting piece of the scenery before me?"
observation_choices = list("I am a monster", "I am not a monster")
correct_choices = list("I am not a monster")
observation_success_message = "It is hard to live in the city. <br>\
To pretend to be a civilized human when living in this manner. <br>\
It is easy to give into the temptation of giving up all pretenses of humanity. <br>\
But I do it because it is hard. <br>\
... <br>\
I am not a monster. <br>\
I will never become a monster."
observation_fail_message = "\"Do you wish to be so?\" <br>\
\"Then it can be as you wish.\" <br>\
... <br>\
Her voice is like sunshine. <br>\
... <br>\
I am a monster. <br>"
observation_choices = list(
"I am not a monster" = list(TRUE, "It is hard to live in the city. <br>\
To pretend to be a civilized human when living in this manner. <br>\
It is easy to give into the temptation of giving up all pretenses of humanity. <br>\
But I do it because it is hard. <br>\
... <br>\
I am not a monster. <br>\
I will never become a monster."),
"I am a monster" = list(FALSE, "\"Do you wish to be so?\" <br>\
\"Then it can be as you wish.\" <br>\
... <br>\
Her voice is like sunshine. <br>\
... <br>\
I am a monster. <br>"),
)

//Work vars
var/transform_timer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ GLOBAL_LIST_EMPTY(meat_list)
\"You won't survive out there. <br>Every single day in this facility is a constant, unending battle.\" <br>\
\"The only way you'll survive is if you join me. <br>To serve L-Corp til your last breath.\" <br>\
A tendril of rotten meat is held out to you, beckoning for you to join it."
observation_choices = list("EMBRACE IT", "REJECT IT")
correct_choices = list("EMBRACE IT")
observation_success_message = "You grab onto the tendril. You can feel your flesh tingling. <br>\
\"Good choice.\" <br>\
\"Don't worry. <br>You won't regret this, you know? <br>This is the only path you had.\" <br>\
\"You're dead meat out there. <br>Might as well accept who you are.\""
observation_fail_message = "You slap the tendril away. <br>\
\"Feh. <br>So be it. <br>You won't survive out there, you know?\" <br>\
\"When there's nothing left of the staff but blood and gore, I'll remain. <br>Do you understand?\" <br>\
You can't help but to shudder in disgust as you exit the cell. <br>Was it right? You'll never know."
observation_choices = list(
"EMBRACE IT" = list(TRUE, "You grab onto the tendril. You can feel your flesh tingling. <br>\
\"Good choice.\" <br>\
\"Don't worry. <br>You won't regret this, you know? <br>This is the only path you had.\" <br>\
\"You're dead meat out there. <br>Might as well accept who you are.\""),
"REJECT IT" = list(FALSE, "You slap the tendril away. <br>\
\"Feh. <br>So be it. <br>You won't survive out there, you know?\" <br>\
\"When there's nothing left of the staff but blood and gore, I'll remain. <br>Do you understand?\" <br>\
You can't help but to shudder in disgust as you exit the cell. <br>Was it right? You'll never know."),
)

var/list/gremlins = list() //For the meatballs
var/list/meat = list() //For the floors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
observation_prompt = "The slime craves affection, it covers the cell's floor, walls and celing. <br>\
It clings to your clothes, your mask and your skin as you enter. <br>At the centre of the cell, where the deluge conglomerates most, is the facismile of a girl. <br>\
She waves at you shyly. <br>You..."
observation_choices = list("Retreat from the slime", "Reach out to her")
correct_choices = list("Retreat from the slime")
observation_success_message = "You retreat from the cell in a hurry, the slime clinging to you turns acidic. If she won't find affection from you, she'll find it another way..."
observation_fail_message = "You reach out your hand and she does the same, your fingers entwine with the slimy appendage and she giggles. <br>\"Let's be together forever.\" <br>\
You pull your hand away, but it comes out with the slime. <br>You try to retreat, but you are already caught in her trap. <br>\"Don't betray me, okay?\" <br>Those are the last words you ever hear..."
observation_choices = list(
"Retreat from the slime" = list(TRUE, "You retreat from the cell in a hurry, the slime clinging to you turns acidic. If she won't find affection from you, she'll find it another way..."),
"Reach out to her" = list(FALSE, "You reach out your hand and she does the same, your fingers entwine with the slimy appendage and she giggles. <br>\"Let's be together forever.\" <br>\
You pull your hand away, but it comes out with the slime. <br>You try to retreat, but you are already caught in her trap. <br>\"Don't betray me, okay?\" <br>Those are the last words you ever hear..."),
)

var/mob/living/carbon/human/gifted_human = null
/// Amount of BLACK damage done to all enemies around main target on melee attack. Also includes original target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
observation_prompt = "It smells like death itself in its containment unit, the mound of rotted, half-purtefied flesh stares at you with its many faces. <br>\
Arms and legs bent at odd angles, entrails draped like lazy christmas decorations, innumerable limbs twisted and distorted into a sphere - all blanketed black with necrotic skin. <br>\
Yet the faces remain intact, pale from a lack of blood, but still as recognizable as they've always been. <br>They're smiling at you."
observation_choices = list("I recognize those faces", "I don't recognize them")
correct_choices = list("I recognize those faces")
observation_success_message = "From the mountain of bodies; the dead give their life to be something greater. <br>Why shouldn't they be smiling? <br>You should be smiling too."
observation_fail_message = "They're holding all the laughter of those who cannot be seen here. <br>The mounds begins to shamble, upon borrowed hands and feet, it has your scent now and it will never be satisfied."
observation_choices = list(
"I recognize those faces" = list(TRUE, "From the mountain of bodies; the dead give their life to be something greater. <br>Why shouldn't they be smiling? <br>You should be smiling too."),
"I don't recognize them" = list(FALSE, "They're holding all the laughter of those who cannot be seen here. <br>The mounds begins to shamble, upon borrowed hands and feet, it has your scent now and it will never be satisfied."),
)

/// Is user performing work hurt at the beginning?
var/agent_hurt = FALSE
Expand Down
10 changes: 6 additions & 4 deletions code/modules/mob/living/simple_animal/abnormality/aleph/nihil.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@

observation_prompt = "I have no plans or destination. I'm too tired to fly. <br>With no one to guide me, and no path open to me. <br>It is my fate to play the fool. <br>\
Before I do, I turn to face the 4 Magical Girls. <br>Are they just like me, or am I just like them?"
observation_choices = list("They've become me", "I came to resemble them")
correct_choices = list("They've become me", "I came to resemble them")
observation_success_message = "It doesn't matter. <br>My choices do not matter. <br>\
Nothing matters. <br>We will repeat this song and dance until the end of time.<br> I can only laugh at this pointless endeavor."
observation_choices = list(
"They've become me" = list(TRUE, "It doesn't matter. <br>My choices do not matter. <br>\
Nothing matters. <br>We will repeat this song and dance until the end of time.<br> I can only laugh at this pointless endeavor."),
"I came to resemble them" = list(TRUE, "It doesn't matter. <br>My choices do not matter. <br>\
Nothing matters. <br>We will repeat this song and dance until the end of time.<br> I can only laugh at this pointless endeavor."),
)

var/can_act = TRUE
//Teleports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
observation_prompt = "No matter where you walk to in the cell, the mirror is always facing you. <br>You trace a path around it but all you ever see is your own reflection. <br>\
\"It's not fair, why do you get to be you and not me?\" <br>Your reflection mutters, parroting your voice. <br>\"Why are you, you and not I? I could be you so much better than you can, just let me try.\" <br>\
Your reflection is holding out its hand, waiting for a handshake."
observation_choices = list("Shake their hand", "Turn away and leave")
correct_choices = list("Turn away and leave")
observation_success_message = "You make to exit the cell. \"Don't just leave me! I'm somebody, I'm real! I'm..! What's my name?! Just give me your name!\" <br>\
You don't give your name to the imitation, the closer it starts to mirrors another, the more its mimicry becomes mockery."
observation_fail_message = "The you in the mirror smiles. <br>\"Just you wait, I'll show you what we can do.\""
observation_choices = list(
"Turn away and leave" = list(TRUE, "You make to exit the cell. \"Don't just leave me! I'm somebody, I'm real! I'm..! What's my name?! Just give me your name!\" <br>\
You don't give your name to the imitation, the closer it starts to mirrors another, the more its mimicry becomes mockery."),
"Shake their hand" = list(FALSE, "The you in the mirror smiles. <br>\"Just you wait, I'll show you what we can do.\""),
)

//Contained Variables
var/reflect_timer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@
observation_prompt = "*Teeth grinding* <br>Incomprehensible sounds can be heard. <br>\
Its body was already broken long time ago. <br>\
The twisted mouth opens, the crushed down tongue undulates. <br>\"M-ma......man-ag......r.......\" <br>It's calling for the manager."
observation_choices = list("Approach it", "Ignore it")
correct_choices = list("Ignore it")
observation_success_message = "A chunk of flesh dropped from the mouth to the ground, depriving the abnormality an ability to talk. <br>\
It's talking inside the body of an employee. <br>But it is not the employee who speaks. <br>\
The sound of calling me. <br>Is nothing but an empty shell mimicking a dead person. <br>\
How many employees would have suffered to this sound? <br>It keeps getting closer to human. <br>\
It keeps trying. <br>However, as always, at the end, Nothing there."
observation_fail_message = "I think of people who were friends with this employee. <br>\
Those eyes, shoulders, and every bit of muscle belong to someone else. <br>\
It smiles. <br>No, it pretends to smile. <br>Who could be it?"
observation_choices = list(
"Ignore it" = list(TRUE, "A chunk of flesh dropped from the mouth to the ground, depriving the abnormality an ability to talk. <br>\
It's talking inside the body of an employee. <br>But it is not the employee who speaks. <br>\
The sound of calling me. <br>Is nothing but an empty shell mimicking a dead person. <br>\
How many employees would have suffered to this sound? <br>It keeps getting closer to human. <br>\
It keeps trying. <br>However, as always, at the end, Nothing there."),
"Approach it" = list(FALSE, "I think of people who were friends with this employee. <br>\
Those eyes, shoulders, and every bit of muscle belong to someone else. <br>\
It smiles. <br>No, it pretends to smile. <br>Who could be it?"),
)

var/mob/living/disguise = null
var/saved_appearance
Expand Down
Loading
Loading