Jump to content

Addiction Explained


SocialSystem

Recommended Posts

 

Hey folks. Addiction has been added to the server code for those that didn't know and I have seen some queries on how to deal with it. I will explain the code and provide snippets to assist. For those also playing as CMO's and medical doctors, this is not the virologists problem to fix.

 

Below is the how the 'disease' is recorded.

 

 

/datum/disease/addiction

name = "Chemical Addiction"

max_stages = 5

spread = "None"

spread_type = SPECIAL

cure = "Unknown"

cure_id = list("fixer", "water")

cure_chance = 3

affected_species = list("Human", "Monkey", "Skrell", "Unathi", "Tajaran", "Kidan", "Grey")

var/datum/reagent/addicted_to

var/addiction

var/addiction_countdown = 1800 // Three minutes

 

 

Some things to note here. There are a maximum of 5 stages to this disease, it cannot spread and it cannot mutate. At the moment the cure 'Fixer' is not a reagent that exists but the cure 'Water' is and it is easily available. Addiction effects all species apart from the Vox and Machine People.

 

Below is what occurs after taking the reagent you are addicted to.

 

 

/datum/disease/addiction/proc/has_addict_reagent()

var/result = 0

if(affected_mob.reagents.has_reagent(addicted_to))

result = 1

return result

 

/datum/disease/addiction/process()

if(!holder) return

var/addict_reagent_present = has_addict_reagent()

var/tickcount = 0

 

if(affected_mob)

for(var/datum/disease/D in affected_mob.viruses)

if(D != src)

if(istype(src, D.type))

if(istype(src.addicted_to, D:addicted_to)) // Allow for multiple addictions as long as each addiction is for a different reagent

del(src) // if there are somehow two viruses of the same kind in the system, delete the other one

 

if(holder == affected_mob)

if(affected_mob.stat < 2) //he's alive

if(addict_reagent_present) //he's taken the reagent to which he's addicted

stage = 1

tickcount++

if(prob(20))

affected_mob << "\blue You feel a wave of euphoria as [addiction] surges through your bloodstream..."

if(tickcount >= 900)

stage_act()

tickcount = 0

else //he's ignored his addiction or hasn't taken the reagent

stage_act()

else //he's dead.

if(spread_type!=SPECIAL)

spread_type = CONTACT_GENERAL

affected_mob = null

if(!affected_mob) //the virus is in inanimate obj

if(prob(70))

if(--longevity<=0)

cure(0)

return

 

 

What is important here is that when you take your addiction and you are alive, your stage is reset to '1' which is important as this is the stage at which you can be cured at. You also should receive a message "You feel a wave of euphoria as [addiction] surges through your bloodstream..."

 

Below is the step by step possibilities at each stage.

 

 

/datum/disease/addiction/stage_act()

var/cure_present = has_cure()

var/addict_reagent_present = has_addict_reagent()

 

if(carrier&&!cure_present)

return

 

spread = (cure_present?"Remissive":initial(spread))

 

if(stage > max_stages)

stage = max_stages

if(stage_prob != 0 && prob(stage_prob) && stage != max_stages && !cure_present && !addict_reagent_present) //now the disease shouldn't get back up to stage 4 in no time

stage++

if(stage != 1 && (prob(1) || (cure_present && prob(cure_chance))))

stage--

else if(stage <= 1 && ((prob(1) && curable) || (cure_present && prob(cure_chance))))

cure()

return

 

switch(stage)

if(2)

if(prob(5))

affected_mob << "\red You can't stop thinking about [addiction]!"

if(affected_mob.sleeping && prob(1))

affected_mob << "\blue You feel better."

stage--

if(prob(1))

if(prob(1))

stage--

if(3)

if(prob(5))

affected_mob << "\red You gotta have some [addiction]!"

if(affected_mob.sleeping && prob(1))

affected_mob << "\blue You feel better."

stage--

if(prob(1))

if(prob(1))

stage--

if(4)

if(prob(7))

affected_mob << "\red Gotta have some [addiction]!"

if(prob(10))

affected_mob.take_organ_damage(1)

if(prob(2))

affected_mob << "\red Your stomach hurts."

if(prob(5))

affected_mob.emote("blink")

if(prob(10))

affected_mob.toxloss += 1

affected_mob.updatehealth()

if(affected_mob.sleeping && prob(1))

affected_mob << "\blue You feel better."

stage--

if(prob(1))

if(prob(1))

stage--

if(5)

if(prob(5))

affected_mob << "\red \bold You can't stand not having [addiction]!"

if(prob(20))

affected_mob.toxloss += 2

affected_mob.updatehealth()

if(prob(2))

affected_mob << "\red \bold [addiction] calls out to your mind!"

for(var/mob/O in viewers(affected_mob, null))

O.show_message(text("\red [] rakes at their eyes!", affected_mob), 1)

affected_mob.eye_blind = 2

affected_mob.eye_blurry = 3

if(prob(1))

affected_mob.emote("twitch")

if(affected_mob.sleeping && prob(1))

affected_mob << "\blue You feel better."

stage--

if(prob(1))

if(prob(1))

stage--

 

 

From the code above, in this area here:

 

 

	if(stage_prob != 0 && prob(stage_prob) && stage != max_stages && !cure_present && !addict_reagent_present) //now the disease shouldn't get back up to stage 4 in no time

stage++

if(stage != 1 && (prob(1) || (cure_present && prob(cure_chance))))

stage--

else if(stage <= 1 && ((prob(1) && curable) || (cure_present && prob(cure_chance))))

cure()

return

 

 

This dictates what happens at all stages. There is a chance that you will increase your stage by one step when you are not at stage 5, no cure is present, and no addiction reagent is present. When the cure is present at stages 2-5 and you successfully roll against the check for the cure change, you will drop a stage. Once you drop to a stage less than one and you successfully roll against the cure chance you are 'cured'.

 

For Stage 2 and Stage 3:

 

 

	switch(stage)

if(2)

if(prob(5))

affected_mob << "\red You can't stop thinking about [addiction]!"

if(affected_mob.sleeping && prob(1))

affected_mob << "\blue You feel better."

stage--

if(prob(1))

if(prob(1))

stage--

if(3)

if(prob(5))

affected_mob << "\red You gotta have some [addiction]!"

if(affected_mob.sleeping && prob(1))

affected_mob << "\blue You feel better."

stage--

if(prob(1))

if(prob(1))

stage--

 

 

From this you have at each of the two stages; a 5/7 chance to get a message about your addiction, a 1/7 chance to feel better and reduce a stage if you are sleeping and a 1/7 chance of just dropping a stage normally.

 

For stage 4:

 

 

		if(4)

if(prob(7))

affected_mob << "\red Gotta have some [addiction]!"

if(prob(10))

affected_mob.take_organ_damage(1)

if(prob(2))

affected_mob << "\red Your stomach hurts."

if(prob(5))

affected_mob.emote("blink")

if(prob(10))

affected_mob.toxloss += 1

affected_mob.updatehealth()

if(affected_mob.sleeping && prob(1))

affected_mob << "\blue You feel better."

stage--

if(prob(1))

if(prob(1))

stage--

 

 

From this stage you have a 7/11 chance that you will get a message about an addiction and then a 10/17 chance you will take a point of organ damage as well. You have a 2/11 chance that your stomach will hurt, 5/17 chance to blink and a 10/17 chance to take toxin damage. Finally you have a 1/11 chance to drop a stage if you are sleeping and a 1/11 chance to drop a stage anyway.

 

For the final stage, stage 5:

 

 

		if(5)

if(prob(5))

affected_mob << "\red \bold You can't stand not having [addiction]!"

if(prob(20))

affected_mob.toxloss += 2

affected_mob.updatehealth()

if(prob(2))

affected_mob << "\red \bold [addiction] calls out to your mind!"

for(var/mob/O in viewers(affected_mob, null))

O.show_message(text("\red [] rakes at their eyes!", affected_mob), 1)

affected_mob.eye_blind = 2

affected_mob.eye_blurry = 3

if(prob(1))

affected_mob.emote("twitch")

if(affected_mob.sleeping && prob(1))

affected_mob << "\blue You feel better."

stage--

if(prob(1))

if(prob(1))

stage--

 

 

Similar to stage 4 but with more damage, there is a 5/10 chance that you will get a message about your addiction and then a 20/25 chance you will take 2 points of toxin damage. There is a 2/10 chance you will get a message about your addiction, rake your eyes which will blind you and make you blurry somewhat. There is a 1/10 chance you will twitch, a 1/10 chance you will drop a stage while sleeping and a 1/10 chance you will drop a stage anyway.

 

In response to this, when you are attempting to cure someone make sure they go to sleep. This will increase the chances they will drop a stage compared to remaining awake. The next thing to do it obtain the reagent that they are addicted to as well as a reasonable amount of water. Force feed or inject the reagent they are addicted to as well as the water. This will reset the stage to 1, stop it from increasing further up a stage whilst they are in the patients system. As you are keeping the stage at 1, you will be rolling against getting the stage to decrease with the cure in the patients system. Once it drops to below 0 they will be cured!

 

If the person you are assisting won't stop waking up to see if they are cured, keep administering chloral hydrate or grab some sleeping gas to keep them under. Check up on the patient from time to time to ensure the stages are not increasing and they stay asleep.

 

If I have missed anything, you have questions, or my understanding of the code is flawed, please make a post and I will correct/update this! I hope this has helped and have fun!

 

Link to comment
Share on other sites

  • 11 months later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use