Mental Medication Additions (#4648)

The less controversial tweaks
Tweaked the metabolism rate of mental medication to reflect their intended values. Reduced the dosage threshold to suppress traumas to reflect their intended values.

Syringe (drugs) now contains truth serum.

Cardox is now slightly poisonous, and can directly remove phoron from blood when consumed. Cardox can now remove phoron in the air when applied to turfs.

A secure box of loyalty implants, hextrasenil pills, and cardox grenades are now located in the vault.

The vault now contains some misc emergency gear that a head of staff can access in case of a dire situation. Current gear are loyalty implants, expensive cardox grenades, and Hextrasenil pills.
This commit is contained in:
BurgerLUA
2018-05-13 07:39:56 -07:00
committed by Erki
parent e388235cef
commit aad698be53
55 changed files with 1277 additions and 473 deletions
@@ -27,7 +27,7 @@
//the second is the message in question.
var/last_taste_time = 0
var/last_taste_text = ""
var/last_smell_time = 0
var/last_smell_text = ""
@@ -649,7 +649,7 @@
message = "buzzes."
playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
m_type = 1
if("vomit")
if (!check_has_mouth(src))
src << "<span class='warning'>You are unable to vomit.</span>"
@@ -29,7 +29,7 @@
log_debug("Organ [DEBUG_REF(src)] was not properly removed from its parent!")
internal_organs -= I
continue
I.process()
handle_stance()
@@ -173,3 +173,7 @@
var/list/all_bits = internal_organs|organs
for(var/obj/item/organ/O in all_bits)
O.set_dna(dna)
/mob/living/carbon/human/proc/get_blood_alcohol()
return round(intoxication/max(vessel.get_reagent_amount("blood"),1),0.01)
@@ -1,25 +1,9 @@
#define AE_DIZZY 5
#define AE_BUZZED_MIN 6
#define AE_SLURRING 15
#define AE_CONFUSION 18
#define AE_CLUMSY 22
#define AE_BUZZED_MAX 24
#define AE_BLURRING 25
#define AE_VOMIT 40
#define AE_DROWSY 55
#define AE_OVERDOSE 70
#define AE_BLACKOUT 80
#define BASE_DIZZY 100
#define ALCOHOL_FILTRATION_RATE 0.015//The base rate at which intoxication decreases per proc. this is actually multiplied by 3 most of the time if the liver is healthy
#define BASE_VOMIT_CHANCE 2
#define VOMIT_CHANCE_SCALE 0.2//An extra 1% for every 5 units over the vomiting threshold
var/mob/living/carbon/human/alcohol_clumsy = 0
//This proc handles the effects of being intoxicated. Removal of intoxication is done elswhere: By the liver, in organ_internal.dm
/mob/living/carbon/human/proc/handle_intoxication()
var/SR = species.ethanol_resistance
if (SR == -1)
//This species can't get drunk, how did we even get here?
@@ -37,58 +21,72 @@ var/mob/living/carbon/human/alcohol_clumsy = 0
sleeping = 0
//Many of these parameters normally tick down in life code, but some parts of that code don't run in godmode, so this prevents a BST being stuck with blurred vision
if(intoxication > AE_DIZZY*SR) // Early warning
var/bac = get_blood_alcohol()
if(bac > INTOX_BUZZED*SR && bac < INTOX_MUSCLEIMP*SR && !(locate(/datum/modifier/buzzed) in modifiers))
to_chat(src,"<span class='notice'>You feel buzzed.</span>")
add_modifier(/datum/modifier/buzzed, MODIFIER_CUSTOM)
if(bac > INTOX_JUDGEIMP*SR)
if (dizziness == 0)
src << "<span class='notice'>The room starts spinning!</span>"
var/target_dizziness = min(1000,(BASE_DIZZY + ((intoxication - AE_DIZZY*SR)*10)/SR))
make_dizzy(target_dizziness - dizziness) // We will repeatedly set our target dizziness to a desired value based on intoxication level
to_chat(src,"<span class='notice'>You feel a little tipsy.</span>")
var/target_dizziness = BASE_DIZZY + ((bac - INTOX_JUDGEIMP*SR)*DIZZY_ADD_SCALE*100)
make_dizzy(target_dizziness - dizziness)
if(intoxication > AE_SLURRING*SR) // Slurring
slurring = max(slurring, 30)
if(bac > INTOX_MUSCLEIMP*SR)
slurring = max(slurring, 25)
if (!(locate(/datum/modifier/drunk) in modifiers))
to_chat(src,"<span class='notice'>You feel drunk!</span>")
add_modifier(/datum/modifier/drunk, MODIFIER_CUSTOM)
if(intoxication > AE_CONFUSION*SR) // Confusion - walking in random directions
if(bac > INTOX_REACTION*SR)
if (confused == 0)
src << "<span class='notice'>You feel unsteady on your feet!</span>"
confused = max(confused, 20)
//Make the drinker temporarily clumsy if intoxication is high enough
//We use a var to track if alcohol caused it, we won't add nor remove it if the drinker was already clumsy from some other source
if(intoxication > AE_CLUMSY*SR)
to_chat(src,"<span class='warning'>You feel uncoordinated and unsteady on your feet!</span>")
confused = max(confused, 10)
slurring = max(slurring, 50)
if (!alcohol_clumsy && !(CLUMSY in mutations))
src << "<span class='notice'>You feel a bit clumsy and uncoordinated.</span>"
mutations.Add(CLUMSY)
alcohol_clumsy = 1
else //Remove it if intoxication drops too low. We'll also have another check to remove it in life.dm
if (alcohol_clumsy)
src << "<span class='notice'>You feel more sober and steady</span>"
mutations.Remove(CLUMSY)
alcohol_clumsy = 0
else if (alcohol_clumsy)
to_chat(src,"<span class='notice'>You feel more sober and steady.</span>")
mutations.Remove(CLUMSY)
alcohol_clumsy = 0
if(intoxication > AE_BLURRING*SR) // Blurry vision
if (prob(10))//blurry vision effect is annoying, so nerfing it
eye_blurry = max(eye_blurry, 2)
adjustBrainLoss(1, 15)
if(intoxication > AE_DROWSY*SR) // Drowsyness - periodically falling asleep
drowsyness = max(drowsyness, 20)
if(intoxication > AE_VOMIT*SR)//Vomiting, the body's natural defense mechanism against poisoning.
if (life_tick % 4 == 1)//Only process vomit chance periodically
var/chance = BASE_VOMIT_CHANCE + ((intoxication - AE_VOMIT)*VOMIT_CHANCE_SCALE)
if(bac > INTOX_VOMIT*SR)
slurring = max(slurring, 75)
if (life_tick % 4 == 1)
var/chance = BASE_VOMIT_CHANCE + ((bac - INTOX_VOMIT*SR)*VOMIT_CHANCE_SCALE*100)
if (prob(chance))
delayed_vomit()
add_chemical_effect(CE_ALCOHOL_TOXIC, 1)
if(intoxication > AE_OVERDOSE*SR) // Toxic dose
add_chemical_effect(CE_ALCOHOL_TOXIC, 1)
adjustBrainLoss(0.4, 55)
if(bac > INTOX_BALANCE*SR)
slurring = max(slurring, 100)
if (life_tick % 4 == 1 && !lying && !buckled && prob(10))
src.visible_message("<span class='warning'>[src] loses balance and falls to the ground!</span>","<span class='warning'>You lose balance and fall to the ground!</span>")
Paralyse(3 SECONDS)
if(bac > INTOX_CONSCIOUS*SR)
slurring = max(slurring, 90)
src.visible_message("<span class='danger'>[src] loses consciousness!</span>","<span class='danger'>You lose consciousness!</span>")
paralysis = max(paralysis, 60 SECONDS)
sleeping = max(sleeping, 60 SECONDS)
adjustBrainLoss(5,30)
else if(bac > INTOX_BLACKOUT*SR)
slurring = max(slurring, 80)
src.visible_message("<span class='danger'>[src] blackouts!</span>","<span class='danger'>You blackout!</span>")
paralysis = max(paralysis, 20 SECONDS)
sleeping = max(sleeping, 20 SECONDS)
adjustBrainLoss(3,10)
else if(prob(10))
slurring = max(slurring, 70)
to_chat(src,"<span class='warning'>You decide that you like the ground and spend a few seconds to rest.</span>")
sleeping = max(sleeping, 6 SECONDS)
adjustBrainLoss(1,5)
if(intoxication > AE_BLACKOUT*SR) // Pass out
paralysis = max(paralysis, 20)
sleeping = max(sleeping, 30)
adjustBrainLoss(0.4, 55)
if( intoxication >= AE_BUZZED_MIN && intoxication <= AE_BUZZED_MAX && !(locate(/datum/modifier/buzzed) in modifiers))
add_modifier(/datum/modifier/buzzed, MODIFIER_CUSTOM)
if (bac > INTOX_DEATH*SR && !src.reagents.has_reagent("ethylredoxrazine")) //Death usually occurs here
add_chemical_effect(CE_ALCOHOL_TOXIC, 10)
adjustOxyLoss(3,100)
adjustBrainLoss(1,50)
//Pleasant feeling from being slightly drunk
@@ -98,36 +96,50 @@ var/mob/living/carbon/human/alcohol_clumsy = 0
/datum/modifier/buzzed/activate()
..()
if (ishuman(target))
var/mob/living/carbon/human/H = target
var/mob/living/carbon/human/H = target
if(istype(H))
H.move_delay_mod += -0.75
H.sprint_cost_factor += -0.1
/datum/modifier/buzzed/deactivate()
..()
if (ishuman(target))
var/mob/living/carbon/human/H = target
var/mob/living/carbon/human/H = target
if(istype(H))
H.move_delay_mod -= -0.75
H.sprint_cost_factor -= -0.1
/datum/modifier/buzzed/custom_validity()
if (ishuman(target))
var/mob/living/carbon/human/H = target
if (H.intoxication >= AE_BUZZED_MIN && H.intoxication <= AE_BUZZED_MAX)
var/mob/living/carbon/human/H = target
if(!istype(H))
return 0
var/bac = H.get_blood_alcohol()
if(bac >= INTOX_BUZZED*H.species.ethanol_resistance && bac <= INTOX_MUSCLEIMP*H.species.ethanol_resistance)
return 1
return 0
/datum/modifier/drunk
/datum/modifier/drunk/activate()
..()
var/mob/living/carbon/human/H = target
if(istype(H))
H.move_delay_mod += 2
H.sprint_cost_factor += 0.2
/datum/modifier/drunk/deactivate()
..()
var/mob/living/carbon/human/H = target
if(istype(H))
H.move_delay_mod -= 2
H.sprint_cost_factor -= -0.2
/datum/modifier/drunk/custom_validity()
var/mob/living/carbon/human/H = target
if(istype(H))
return 0
if(H.get_blood_alcohol() >= INTOX_MUSCLEIMP*H.species.ethanol_resistance)
return 1
return 1
return 0
#undef AE_DIZZY
#undef AE_BUZZED_MIN
#undef AE_SLURRING
#undef AE_CONFUSION
#undef AE_CLUMSY
#undef AE_BUZZED_MAX
#undef AE_BLURRING
#undef AE_VOMIT
#undef AE_DROWSY
#undef AE_OVERDOSE
#undef AE_BLACKOUT
+3 -3
View File
@@ -97,7 +97,7 @@ proc/get_radio_key_from_channel(var/channel)
verb = pick("yells","roars","hollers")
speech_problem_flag = 1
if(slurring)
message = slur(message)
message = slur(message,slurring)
verb = pick("slobbers","slurs")
speech_problem_flag = 1
if(stuttering)
@@ -105,11 +105,11 @@ proc/get_radio_key_from_channel(var/channel)
verb = pick("stammers","stutters")
speech_problem_flag = 1
if(tarded)
message = slur(message)
message = slur(message,100)
verb = pick("gibbers","gabbers")
speech_problem_flag = 1
if(brokejaw)
message = slur(message)
message = slur(message,100)
verb = pick("slobbers","slurs")
speech_problem_flag = 1
if(prob(50))
+12 -14
View File
@@ -288,7 +288,7 @@ var/list/global/organ_rel_size = list(
p++
return t
proc/slur(phrase)
proc/slur(phrase, strength = 100)
phrase = html_decode(phrase)
var/leng=lentext(phrase)
var/counter=lentext(phrase)
@@ -296,18 +296,16 @@ proc/slur(phrase)
var/newletter=""
while(counter>=1)
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
if(rand(1,3)==3)
if(lowertext(newletter)=="o") newletter="u"
if(lowertext(newletter)=="s") newletter="ch"
if(lowertext(newletter)=="a") newletter="ah"
if(lowertext(newletter)=="c") newletter="k"
switch(rand(1,15))
if(1,3,5,8) newletter="[lowertext(newletter)]"
if(2,4,6,15) newletter="[uppertext(newletter)]"
if(7) newletter+="'"
//if(9,10) newletter="<b>[newletter]</b>"
//if(11,12) newletter="<big>[newletter]</big>"
//if(13) newletter="<small>[newletter]</small>"
if(prob(strength))
if(rand(1,3)==3)
if(lowertext(newletter)=="o") newletter="u"
if(lowertext(newletter)=="s") newletter="ch"
if(lowertext(newletter)=="a") newletter="ah"
if(lowertext(newletter)=="c") newletter="k"
switch(rand(1,15))
if(1,3,5,8) newletter="[lowertext(newletter)]"
if(2,4,6,15) newletter="[uppertext(newletter)]"
if(7) newletter+="'"
newphrase+="[newletter]";counter-=1
return newphrase
@@ -710,7 +708,7 @@ proc/is_blind(A)
nutrition -= 60
if (intoxication)//The pain and system shock of vomiting, sobers you up a little
intoxication *= 0.8
intoxication *= 0.9
if (istype(src, /mob/living/carbon/human))
ingested.trans_to_turf(location,30)//Vomiting empties the stomach, transferring 30u reagents to the floor where you vomited