All compiling errors fixed, except for a few weird ones that I need help
This commit is contained in:
@@ -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, "<span class='warning'>You can't bring yourself to say the word \"[word]\"!</span>")
|
||||
return ""
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
description = "<span class='nicegreen'>YES! YES!! YES!!!</span>\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 = "<span class='boldwarning'>NO! NO!! NO!!!</span>\n"
|
||||
mood_change = -100
|
||||
timeout = 300
|
||||
special_screen_obj = "mood_happiness_bad"
|
||||
//special_screen_obj = "mood_happiness_bad" uncomment when added from tg
|
||||
|
||||
@@ -117,6 +117,30 @@
|
||||
description = "<span class='warning'>I'm missing my family heirloom...</span>\n"
|
||||
mood_change = -4
|
||||
|
||||
/datum/mood_event/healsbadman
|
||||
description = "<span class='warning'>I feel a lot better, but wow that was disgusting.</span>\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 = "<span class='warning'>I'm nervous and on edge and I can't stand still!!</span>\n"
|
||||
mood_change = -2
|
||||
|
||||
/datum/mood_event/vomit
|
||||
description = "<span class='warning'>I just threw up. Gross.</span>\n"
|
||||
mood_change = -2
|
||||
timeout = 1200
|
||||
|
||||
/datum/mood_event/vomitself
|
||||
description = "<span class='warning'>I just threw up all over myself. This is disgusting.</span>\n"
|
||||
mood_change = -4
|
||||
timeout = 1800
|
||||
|
||||
/datum/mood_event/painful_medicine
|
||||
description = "<span class='warning'>Medicine may be good for me but right now it stings like hell.</span>\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 = "<span class='boldwarning'>I recently saw my own corpse...</span>\n"
|
||||
|
||||
@@ -70,3 +70,17 @@
|
||||
description = "<span class='nicegreen'>There is something soothing about this music.</span>\n"
|
||||
mood_change = 3
|
||||
timeout = 600
|
||||
|
||||
/datum/mood_event/chemical_euphoria
|
||||
description = "<span class='nicegreen'>Heh...hehehe...hehe...</span>\n"
|
||||
mood_change = 4
|
||||
|
||||
/datum/mood_event/chemical_laughter
|
||||
description = "<span class='nicegreen'>Laughter really is the best medicine! Or is it?</span>\n"
|
||||
mood_change = 4
|
||||
timeout = 1800
|
||||
|
||||
/datum/mood_event/chemical_superlaughter
|
||||
description = "<span class='nicegreen'>*WHEEZE*</span>\n"
|
||||
mood_change = 12
|
||||
timeout = 1800
|
||||
|
||||
@@ -315,3 +315,12 @@
|
||||
if(quirk_holder.mind && LAZYLEN(quirk_holder.mind.antag_datums))
|
||||
to_chat(quirk_holder, "<span class='boldannounce'>Your antagonistic nature has caused your voice to be heard.</span>")
|
||||
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 = "<span class='danger'>There's a lot on your mind right now.</span>"
|
||||
lose_text = "<span class='notice'>Your mind finally feels calm.</span>"
|
||||
medical_record_text = "Patient's mind is in a vulnerable state, and cannot recover from traumatic events."
|
||||
|
||||
Reference in New Issue
Block a user