From f7655cad25f1c183c4845d5cdbce05ca90bd87fd Mon Sep 17 00:00:00 2001 From: Fermi Date: Sat, 11 May 2019 15:40:06 +0100 Subject: [PATCH] All compiling errors fixed, except for a few weird ones that I need help --- code/__DEFINES/movespeed_modification.dm | 4 +- code/__DEFINES/traits.dm | 5 ++ code/datums/brain_damage/phobia.dm | 8 ++- code/datums/components/mood.dm | 57 +++++++++++++++++++ code/datums/mood_events/drug_events.dm | 4 +- .../mood_events/generic_negative_events.dm | 24 ++++++++ .../mood_events/generic_positive_events.dm | 14 +++++ code/datums/traits/negative.dm | 9 +++ code/game/objects/items/storage/firstaid.dm | 16 ++++++ code/modules/mob/living/carbon/carbon.dm | 4 +- code/modules/mob/living/carbon/life.dm | 14 +++++ .../chemistry/reagents/drink_reagents.dm | 2 + .../chemistry/reagents/medicine_reagents.dm | 3 + .../reagents/reagent_containers/pill.dm | 15 ++++- code/modules/surgery/organs/lungs.dm | 4 +- code/modules/surgery/organs/vocal_cords.dm | 5 +- code/modules/vending/medical.dm | 6 +- .../chemistry/reagents/fermi_reagents.dm | 8 ++- 18 files changed, 186 insertions(+), 16 deletions(-) diff --git a/code/__DEFINES/movespeed_modification.dm b/code/__DEFINES/movespeed_modification.dm index 9f8d310193..c0aac36415 100644 --- a/code/__DEFINES/movespeed_modification.dm +++ b/code/__DEFINES/movespeed_modification.dm @@ -28,4 +28,6 @@ #define MOVESPEED_ID_SIMPLEMOB_VARSPEED "SIMPLEMOB_VARSPEED_MODIFIER" #define MOVESPEED_ID_ADMIN_VAREDIT "ADMIN_VAREDIT_MODIFIER" -#define MOVESPEED_ID_PAI_SPACEWALK_SPEEDMOD "PAI_SPACEWALK_MODIFIER" \ No newline at end of file +#define MOVESPEED_ID_PAI_SPACEWALK_SPEEDMOD "PAI_SPACEWALK_MODIFIER" + +#define MOVESPEED_ID_SANITY "MOOD_SANITY" diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 99f1813f3c..bf78fde5ae 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -1,3 +1,6 @@ +//We're really behind tg on traits huh? +#define HAS_TRAIT(target, trait) (target.status_traits ? (target.status_traits[trait] ? TRUE : FALSE) : FALSE) + //mob traits #define TRAIT_BLIND "blind" #define TRAIT_MUTE "mute" @@ -50,6 +53,8 @@ #define TRAIT_NOHARDCRIT "nohardcrit" #define TRAIT_NOSOFTCRIT "nosoftcrit" #define TRAIT_MINDSHIELD "mindshield" +#define TRAIT_FEARLESS "fearless" +#define TRAIT_UNSTABLE "unstable" #define TRAIT_ALCOHOL_TOLERANCE "alcohol_tolerance" diff --git a/code/datums/brain_damage/phobia.dm b/code/datums/brain_damage/phobia.dm index c6ccbee38c..8cd8d95603 100644 --- a/code/datums/brain_damage/phobia.dm +++ b/code/datums/brain_damage/phobia.dm @@ -31,6 +31,8 @@ /datum/brain_trauma/mild/phobia/on_life() ..() + if(owner.has_trait(TRAIT_FEARLESS)) + return if(is_blind(owner)) return if(world.time > next_check && world.time > next_scare) @@ -70,6 +72,8 @@ /datum/brain_trauma/mild/phobia/on_hear(message, speaker, message_language, raw_message, radio_freq) if(!owner.can_hear() || world.time < next_scare) //words can't trigger you if you can't hear them *taps head* return message + if(owner.has_trait(TRAIT_FEARLESS)) + return message for(var/word in trigger_words) var/reg = regex("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i") @@ -79,9 +83,11 @@ return message /datum/brain_trauma/mild/phobia/on_say(message) + if(owner.has_trait(TRAIT_FEARLESS)) + return message for(var/word in trigger_words) var/reg = regex("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i") - + if(findtext(message, reg)) to_chat(owner, "You can't bring yourself to say the word \"[word]\"!") return "" diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index 01162889fd..56b3e8bcd2 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -6,6 +6,7 @@ var/sanity = 100 //Current sanity var/shown_mood //Shown happiness, this is what others can see when they try to examine you, prevents antag checking by noticing traitors are always very happy. var/mood_level = 5 //To track what stage of moodies they're on + var/sanity_level = 5 //To track what stage of sanity they're on var/mood_modifier = 1 //Modifier to allow certain mobs to be less affected by moodlets var/datum/mood_event/list/mood_events = list() var/insanity_effect = 0 //is the owner being punished for low mood? If so, how much? @@ -165,6 +166,59 @@ HandleNutrition(owner) +/datum/component/mood/proc/setSanity(amount, minimum=SANITY_INSANE, maximum=SANITY_NEUTRAL)//I'm sure bunging this in here will have no negative repercussions. + var/mob/living/owner = parent + + if(amount == sanity) + return + // If we're out of the acceptable minimum-maximum range move back towards it in steps of 0.5 + // If the new amount would move towards the acceptable range faster then use it instead + if(sanity < minimum && amount < sanity + 0.5) + amount = sanity + 0.5 + else if(sanity > maximum && amount > sanity - 0.5) + amount = sanity - 0.5 + + // Disturbed stops you from getting any more sane + if(owner.has_trait(TRAIT_UNSTABLE)) + sanity = min(amount,sanity) + else + sanity = amount + + var/mob/living/master = parent + switch(sanity) + if(SANITY_INSANE to SANITY_CRAZY) + setInsanityEffect(MAJOR_INSANITY_PEN) + master.add_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE, 100, override=TRUE, multiplicative_slowdown=1.5, movetypes=(~FLYING)) + sanity_level = 6 + if(SANITY_CRAZY to SANITY_UNSTABLE) + setInsanityEffect(MINOR_INSANITY_PEN) + master.add_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE, 100, override=TRUE, multiplicative_slowdown=1, movetypes=(~FLYING)) + sanity_level = 5 + if(SANITY_UNSTABLE to SANITY_DISTURBED) + setInsanityEffect(0) + master.add_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE, 100, override=TRUE, multiplicative_slowdown=0.5, movetypes=(~FLYING)) + sanity_level = 4 + if(SANITY_DISTURBED to SANITY_NEUTRAL) + setInsanityEffect(0) + master.remove_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE) + sanity_level = 3 + if(SANITY_NEUTRAL+1 to SANITY_GREAT+1) //shitty hack but +1 to prevent it from responding to super small differences + setInsanityEffect(0) + master.remove_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE) + sanity_level = 2 + if(SANITY_GREAT+1 to INFINITY) + setInsanityEffect(0) + master.remove_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE) + sanity_level = 1 + update_mood_icon() + +/datum/component/mood/proc/setInsanityEffect(newval)//More code so that the previous proc works + if(newval == insanity_effect) + return + var/mob/living/master = parent + master.crit_threshold = (master.crit_threshold - insanity_effect) + newval + insanity_effect = newval + /datum/component/mood/proc/DecreaseSanity(amount, minimum = SANITY_INSANE) if(sanity < minimum) //This might make KevinZ stop fucking pinging me. IncreaseSanity(0.5) @@ -177,6 +231,9 @@ insanity_effect = (MINOR_INSANITY_PEN) /datum/component/mood/proc/IncreaseSanity(amount, maximum = SANITY_NEUTRAL) + // Disturbed stops you from getting any more sane - I'm just gonna bung this in here + if(owner.has_trait(TRAIT_UNSTABLE)) + return if(sanity > maximum) DecreaseSanity(0.5) //Removes some sanity to go back to our current limit. else diff --git a/code/datums/mood_events/drug_events.dm b/code/datums/mood_events/drug_events.dm index 6ed33b0f00..82e5a5718b 100644 --- a/code/datums/mood_events/drug_events.dm +++ b/code/datums/mood_events/drug_events.dm @@ -46,10 +46,10 @@ description = "YES! YES!! YES!!!\n" mood_change = 100 timeout = 300 - special_screen_obj = "mood_happiness_good" + //special_screen_obj = "mood_happiness_good" uncomment when added from tg /datum/mood_event/happiness_drug_bad_od description = "NO! NO!! NO!!!\n" mood_change = -100 timeout = 300 - special_screen_obj = "mood_happiness_bad" + //special_screen_obj = "mood_happiness_bad" uncomment when added from tg diff --git a/code/datums/mood_events/generic_negative_events.dm b/code/datums/mood_events/generic_negative_events.dm index 4021d11128..c9a5b80060 100644 --- a/code/datums/mood_events/generic_negative_events.dm +++ b/code/datums/mood_events/generic_negative_events.dm @@ -117,6 +117,30 @@ description = "I'm missing my family heirloom...\n" mood_change = -4 +/datum/mood_event/healsbadman + description = "I feel a lot better, but wow that was disgusting.\n" //when you read the latest felinid removal PR and realize you're really not that much of a degenerate + mood_change = -4 + timeout = 1200 + +/datum/mood_event/jittery + description = "I'm nervous and on edge and I can't stand still!!\n" + mood_change = -2 + +/datum/mood_event/vomit + description = "I just threw up. Gross.\n" + mood_change = -2 + timeout = 1200 + +/datum/mood_event/vomitself + description = "I just threw up all over myself. This is disgusting.\n" + mood_change = -4 + timeout = 1800 + +/datum/mood_event/painful_medicine + description = "Medicine may be good for me but right now it stings like hell.\n" + mood_change = -5 + timeout = 600 + //These are unused so far but I want to remember them to use them later /datum/mood_event/cloned_corpse description = "I recently saw my own corpse...\n" diff --git a/code/datums/mood_events/generic_positive_events.dm b/code/datums/mood_events/generic_positive_events.dm index 2422c5ea56..03ebd5a390 100644 --- a/code/datums/mood_events/generic_positive_events.dm +++ b/code/datums/mood_events/generic_positive_events.dm @@ -70,3 +70,17 @@ description = "There is something soothing about this music.\n" mood_change = 3 timeout = 600 + +/datum/mood_event/chemical_euphoria + description = "Heh...hehehe...hehe...\n" + mood_change = 4 + + /datum/mood_event/chemical_laughter + description = "Laughter really is the best medicine! Or is it?\n" + mood_change = 4 + timeout = 1800 + + /datum/mood_event/chemical_superlaughter + description = "*WHEEZE*\n" + mood_change = 12 + timeout = 1800 diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index 614cc65cbb..79afe0049c 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -315,3 +315,12 @@ if(quirk_holder.mind && LAZYLEN(quirk_holder.mind.antag_datums)) to_chat(quirk_holder, "Your antagonistic nature has caused your voice to be heard.") qdel(src) + +/datum/quirk/unstable + name = "Unstable" + desc = "Due to past troubles, you are unable to recover your sanity if you lose it. Be very careful managing your mood!" + value = -2 + mob_trait = TRAIT_UNSTABLE + gain_text = "There's a lot on your mind right now." + lose_text = "Your mind finally feels calm." + medical_record_text = "Patient's mind is in a vulnerable state, and cannot recover from traumatic events." diff --git a/code/game/objects/items/storage/firstaid.dm b/code/game/objects/items/storage/firstaid.dm index e6c370b097..2841590abf 100644 --- a/code/game/objects/items/storage/firstaid.dm +++ b/code/game/objects/items/storage/firstaid.dm @@ -297,6 +297,22 @@ for(var/i in 1 to 5) new /obj/item/reagent_containers/pill/aranesp(src) +/obj/item/storage/pill_bottle/psicodine + name = "bottle of psicodine pills" + desc = "Contains pills used to treat mental distress and traumas." + + /obj/item/storage/pill_bottle/psicodine/PopulateContents() + for(var/i in 1 to 7) + new /obj/item/reagent_containers/pill/psicodine(src) + + /obj/item/storage/pill_bottle/happiness + name = "happiness pill bottle" + desc = "The label is long gone, in its place an 'H' written with a marker." + + /obj/item/storage/pill_bottle/happiness/PopulateContents() + for(var/i in 1 to 5) + new /obj/item/reagent_containers/pill/happiness(src) + /obj/item/storage/pill_bottle/antirad_plus name = "anti radiation deluxe pill bottle" desc = "The label says 'Med-Co branded pills'." diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index ea13255dfe..6ea876feac 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -477,11 +477,13 @@ if(message) visible_message("[src] throws up all over [p_them()]self!", \ "You throw up all over yourself!") + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "vomit", /datum/mood_event/vomitself) distance = 0 else if(message) visible_message("[src] throws up!", "You throw up!") - + if(!isflyperson(src)) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "vomit", /datum/mood_event/vomit) if(stun) Stun(80) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index e757e6dcf4..64ecf35e4b 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -49,6 +49,12 @@ /mob/living/carbon/handle_breathing(times_fired) if((times_fired % 4) == 2 || failed_last_breath) breathe() //Breathe per 4 ticks, unless suffocating + /* Hey maintainer reading this right now, should we handle suffocation this way? + if(failed_last_breath) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "suffocation", /datum/mood_event/suffocation) + else + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "suffocation") + */ else if(istype(loc, /obj/)) var/obj/location_as_object = loc @@ -229,6 +235,9 @@ else if(SA_partialpressure > 0.01) if(prob(20)) emote(pick("giggle","laugh")) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "chemical_euphoria", /datum/mood_event/chemical_euphoria) + else + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "chemical_euphoria") //BZ (Facepunch port of their Agent B) if(breath_gases[/datum/gas/bz]) @@ -527,6 +536,9 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put if(jitteriness) do_jitter_animation(jitteriness) jitteriness = max(jitteriness - restingpwr, 0) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "jittery", /datum/mood_event/jittery) + else + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "jittery") if(stuttering) stuttering = max(stuttering-1, 0) @@ -612,6 +624,8 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put if(drunkenness >= 101) adjustToxLoss(4) //Let's be honest you shouldn't be alive by now + else + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "drunk") //used in human and monkey handle_environment() /mob/living/carbon/proc/natural_bodytemperature_stabilization() diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm index 6ec37f3ec4..2bd3307d9b 100644 --- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm @@ -168,6 +168,7 @@ /datum/reagent/consumable/laughter/on_mob_life(mob/living/carbon/M) M.emote("laugh") + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "chemical_laughter", /datum/mood_event/chemical_laughter) ..() /datum/reagent/consumable/superlaughter @@ -182,6 +183,7 @@ if(prob(30)) M.visible_message("[M] bursts out into a fit of uncontrollable laughter!", "You burst out in a fit of uncontrollable laughter!") M.Stun(5) + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "chemical_laughter", /datum/mood_event/chemical_superlaughter) ..() /datum/reagent/consumable/potato_juice diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 94db5dba61..b20880d239 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -238,6 +238,7 @@ if(show_message) to_chat(M, "You feel your burns healing! It stings like hell!") M.emote("scream") + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine) ..() /datum/reagent/medicine/silver_sulfadiazine/on_mob_life(mob/living/carbon/M) @@ -286,6 +287,7 @@ if(show_message) to_chat(M, "You feel your bruises healing! It stings like hell!") M.emote("scream") + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine) ..() @@ -391,6 +393,7 @@ M.adjustFireLoss(-1.25 * reac_volume) if(show_message) to_chat(M, "You feel your burns and bruises healing! It stings like hell!") + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine) ..() /datum/reagent/medicine/charcoal diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index a3633e2f00..c99b24dd65 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -166,6 +166,13 @@ list_reagents = list("insulin" = 50) roundstart = 1 +/obj/item/reagent_containers/pill/psicodine + name = "psicodine pill" + desc = "Used to treat mental instability and traumas." + list_reagents = list("psicodine" = 10) + icon_state = "pill22" + roundstart = 1 + /obj/item/reagent_containers/pill/antirad name = "potassium iodide pill" desc = "Used to treat radition used to counter radiation poisoning." @@ -216,6 +223,12 @@ name = "speedy pill" list_reagents = list("aranesp" = 10) +/obj/item/reagent_containers/pill/happiness + name = "happiness pill" + desc = "It has a creepy smiling face on it." + icon_state = "pill_happy" + list_reagents = list("happiness" = 10) + /obj/item/reagent_containers/pill/floorpill name = "floorpill" desc = "A strange pill found in the depths of maintenance" @@ -240,4 +253,4 @@ /obj/item/reagent_containers/pill/breast_enlargement name = "breast enlargement pill" - list_reagents = list("BEenlager" = 10) \ No newline at end of file + list_reagents = list("BEenlager" = 10) diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 1e22796b1b..412b97d503 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -246,6 +246,9 @@ else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning if(prob(20)) H.emote(pick("giggle", "laugh")) + SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "chemical_euphoria", /datum/mood_event/chemical_euphoria) + else + SEND_SIGNAL(owner, COMSIG_CLEAR_MOOD_EVENT, "chemical_euphoria") // BZ @@ -443,4 +446,3 @@ heat_level_1_threshold = 400 // better adapted for heat, obv. Lavaland standard is 300 heat_level_2_threshold = 600 // up 200 from level 1, 1000 is silly but w/e for level 3 - diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index 6700acc201..85107dd986 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -1101,11 +1101,8 @@ objective = replacetext(lowertext(objective), "harm", "snuggle") objective = replacetext(lowertext(objective), "decapitate", "headpat") objective = replacetext(lowertext(objective), "strangle", "meow at") - H.objective += objective to_chat(H, "Your master whispers you a new objective.") - if(!H.objectives) - to_chat(H, "[LAZYLEN(H.objectives)]. [H.objectives.explanation_text]") - to_chat(H, "[LAZYLEN(H.objectives)]. [H.objectives.explanation_text]") + brainwash(H, objective) E.mental_capacity -= 150 //else if (E.mental_capacity >= 150) else diff --git a/code/modules/vending/medical.dm b/code/modules/vending/medical.dm index 5ff07cc842..e1039a00ca 100644 --- a/code/modules/vending/medical.dm +++ b/code/modules/vending/medical.dm @@ -27,7 +27,9 @@ contraband = list(/obj/item/reagent_containers/pill/tox = 3, /obj/item/reagent_containers/pill/morphine = 4, /obj/item/reagent_containers/pill/charcoal = 6) - premium = list(/obj/item/storage/box/hug/medical = 1, + premium = list(/obj/item/reagent_containers/medspray/synthflesh = 2, + /obj/item/storage/box/hug/medical = 1, + /obj/item/storage/pill_bottle/psicodine = 2, /obj/item/reagent_containers/hypospray/medipen = 3, /obj/item/storage/belt/medical = 3, /obj/item/wrench/medical = 1) @@ -41,4 +43,4 @@ /obj/machinery/vending/medical/syndicate_access name = "\improper SyndiMed Plus" - req_access = list(ACCESS_SYNDICATE) \ No newline at end of file + req_access = list(ACCESS_SYNDICATE) diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm index fbd2be02a9..02847a9388 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm @@ -308,11 +308,13 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING //Give the new clone an idea of their character //SHOULD print last 5 messages said by the original to the clones chatbox var/list/say_log = M.logging[LOG_SAY] + var/recent_speech if(LAZYLEN(say_log) > 5) - var/recent_speech = say_log.Copy(say_log.len+5,0) //0 so len-LING_ARS+1 to end of list + recent_speech = say_log.Copy(say_log.len+5,0) //0 so len-LING_ARS+1 to end of list else - for(var/spoken_memory in recent_speech) - to_chat(SM, spoken_memory) + recent_speech = say_log + for(var/spoken_memory in recent_speech) + to_chat(SM, spoken_memory) return