Fixes smoker stacking unremovable negative moodlets (#58170)

This commit is contained in:
Time-Green
2021-04-06 14:36:01 +02:00
committed by GitHub
parent 8f08b55ff2
commit 6a3d8f19ee
3 changed files with 14 additions and 5 deletions
@@ -59,6 +59,7 @@
var/smoke_message = pick("You feel relaxed.", "You feel calmed.","You feel alert.","You feel rugged.")
to_chat(M, "<span class='notice'>[smoke_message]</span>")
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "smoked", /datum/mood_event/smoked, name)
M.Jitter(0) //calms down any withdrawal jitters
M.AdjustStun(-50 * REM * delta_time)
M.AdjustKnockdown(-50 * REM * delta_time)
M.AdjustUnconscious(-50 * REM * delta_time)
+10 -3
View File
@@ -14,6 +14,12 @@
var/high_sanity_addiction_loss = 2
///Amount of drugs you need in your system to be satisfied
var/addiction_relief_treshold = MIN_ADDICTION_REAGENT_AMOUNT
///moodlet for light withdrawal
var/light_withdrawal_moodlet = /datum/mood_event/withdrawal_light
///moodlet for medium withdrawal
var/medium_withdrawal_moodlet = /datum/mood_event/withdrawal_medium
///moodlet for severe withdrawal
var/severe_withdrawal_moodlet = /datum/mood_event/withdrawal_severe
///Called when you gain addiction points somehow. Takes a mind as argument and sees if you gained the addiction
/datum/addiction/proc/on_gain_addiction_points(datum/mind/victim_mind)
@@ -98,18 +104,19 @@
/// Called when addiction enters stage 1
/datum/addiction/proc/withdrawal_enters_stage_1(mob/living/carbon/affected_carbon)
SEND_SIGNAL(affected_carbon, COMSIG_ADD_MOOD_EVENT, "[type]_addiction", /datum/mood_event/withdrawal_light, name)
SEND_SIGNAL(affected_carbon, COMSIG_ADD_MOOD_EVENT, "[type]_addiction", light_withdrawal_moodlet, name)
/// Called when addiction enters stage 2
/datum/addiction/proc/withdrawal_enters_stage_2(mob/living/carbon/affected_carbon)
SEND_SIGNAL(affected_carbon, COMSIG_ADD_MOOD_EVENT, "[type]_addiction", /datum/mood_event/withdrawal_medium, name)
SEND_SIGNAL(affected_carbon, COMSIG_ADD_MOOD_EVENT, "[type]_addiction", medium_withdrawal_moodlet, name)
/// Called when addiction enters stage 3
/datum/addiction/proc/withdrawal_enters_stage_3(mob/living/carbon/affected_carbon)
SEND_SIGNAL(affected_carbon, COMSIG_ADD_MOOD_EVENT, "[type]_addiction", /datum/mood_event/withdrawal_severe, name)
SEND_SIGNAL(affected_carbon, COMSIG_ADD_MOOD_EVENT, "[type]_addiction", severe_withdrawal_moodlet, name)
/datum/addiction/proc/end_withdrawal(mob/living/carbon/affected_carbon)
LAZYSET(affected_carbon.mind.active_addictions, type, 1) //Keeps withdrawal at first cycle.
SEND_SIGNAL(affected_carbon, COMSIG_CLEAR_MOOD_EVENT, "[type]_addiction")
/// Called when addiction is in stage 1 every process
/datum/addiction/proc/withdrawal_stage_1_process(mob/living/carbon/affected_carbon, delta_time)
@@ -231,6 +231,9 @@
addiction_relief_treshold = MIN_NICOTINE_ADDICTION_REAGENT_AMOUNT //much less because your intake is probably from ciggies
withdrawal_stage_messages = list("Feel like having a smoke...", "Getting antsy. Really need a smoke now.", "I can't take it! Need a smoke NOW!")
medium_withdrawal_moodlet = /datum/mood_event/nicotine_withdrawal_moderate
severe_withdrawal_moodlet = /datum/mood_event/nicotine_withdrawal_severe
/datum/addiction/nicotine/withdrawal_enters_stage_1(mob/living/carbon/affected_carbon, delta_time)
. = ..()
affected_carbon.Jitter(5 * delta_time)
@@ -238,13 +241,11 @@
/datum/addiction/nicotine/withdrawal_stage_2_process(mob/living/carbon/affected_carbon, delta_time)
. = ..()
affected_carbon.Jitter(10 * delta_time)
SEND_SIGNAL(affected_carbon, COMSIG_ADD_MOOD_EVENT, "nicotine_withdrawal_moderate", /datum/mood_event/nicotine_withdrawal_moderate)
if(DT_PROB(10, delta_time))
affected_carbon.emote("cough")
/datum/addiction/nicotine/withdrawal_stage_3_process(mob/living/carbon/affected_carbon, delta_time)
. = ..()
affected_carbon.Jitter(15 * delta_time)
SEND_SIGNAL(affected_carbon, COMSIG_ADD_MOOD_EVENT, "nicotine_withdrawal_severe", /datum/mood_event/nicotine_withdrawal_severe)
if(DT_PROB(15, delta_time))
affected_carbon.emote("cough")