Merge branch 'master' into wound-port

This commit is contained in:
Timothy Teakettle
2020-07-21 01:10:51 +01:00
committed by GitHub
105 changed files with 695 additions and 263 deletions
+2 -1
View File
@@ -51,7 +51,8 @@ Behavior that's still missing from this component that original food items had t
var/atom/owner = parent
owner.create_reagents(volume, INJECTABLE)
if(!owner.reagents) //we don't want to override what's in the item if it possibly contains reagents already
owner.create_reagents(volume, INJECTABLE)
if(initial_reagents)
for(var/rid in initial_reagents)
+107
View File
@@ -0,0 +1,107 @@
/*!
This component essentially encapsulates frying and utilizes the edible component
This means fried items can work like regular ones, and generally the code is far less messy
*/
/datum/component/fried
var/fry_power //how powerfully was this item fried
var/atom/owner //the atom it is owned by
var/stored_name //name of the owner when the component was first added
var/frying_examine_text = "the coders messed frying code up, report this!"
/datum/component/fried/Initialize(frying_power)
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/examine)
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/restore) //basically, unfry people who are being cleaned (badmemes fried someone)
fry_power = frying_power
owner = parent
stored_name = owner.name
setup_fried_item()
//some stuff to do with the contents of fried junk
GLOBAL_VAR_INIT(frying_hardmode, TRUE)
GLOBAL_VAR_INIT(frying_bad_chem_add_volume, TRUE)
GLOBAL_LIST_INIT(frying_bad_chems, list(
/datum/reagent/toxin/bad_food = 1,
/datum/reagent/toxin = 1,
/datum/reagent/lithium = 1,
/datum/reagent/mercury = 1,
))
/datum/component/fried/proc/examine(datum/source, mob/user, list/examine_list)
examine_list += "[parent] has been [frying_examine_text]"
/datum/component/fried/proc/setup_fried_item() //sets the name, colour and examine text and edibility up
//first we do some checks depending on the type of item being fried
var/list/fried_tastes = list("crispy")
var/fried_foodtypes = FRIED
var/fried_junk = FALSE
if(!isfood(owner) && GLOB.frying_hardmode && GLOB.frying_bad_chems.len && !owner.reagents) //you fried some junk, it's not gonna taste great
fried_junk = TRUE
fried_foodtypes |= TOXIC // junk tastes toxic too
else
if(isfood(owner))
var/obj/item/reagent_containers/food/snacks/food_item = owner
fried_tastes += food_item.tastes
fried_foodtypes |= food_item.foodtype
var/fried_eat_time = 0
if(isturf(owner))
fried_eat_time = 30 //we want turfs to be eaten slowly
var/colour_priority = FIXED_COLOUR_PRIORITY
if(ismob(owner))
colour_priority = WASHABLE_COLOUR_PRIORITY //badmins fried someone and we want to let them wash the fry colour off
//lets heavily hint at how to undo their frying
to_chat(owner, "<span class='warning'>You've been coated in hot cooking oil! You should probably go wash it off at the showers.</span>")
else
owner.AddComponent(/datum/component/edible, foodtypes = fried_tastes, tastes = fried_tastes, eat_time = fried_eat_time) //we don't want mobs to get the edible component
switch(fry_power)
if(0 to 15)
owner.name = "lightly fried [owner.name]"
owner.add_atom_colour(rgb(166,103,54), colour_priority)
frying_examine_text = "lightly fried"
if(16 to 49)
owner.name = "fried [owner.name]"
owner.add_atom_colour(rgb(103,63,24), colour_priority)
frying_examine_text = "moderately fried"
if(50 to 59)
owner.name = "deep fried [owner.name]"
owner.add_atom_colour(rgb(63,23,4), colour_priority)
frying_examine_text = "deeply fried"
else
owner.name = "the physical manifestation of fried foods"
owner.add_atom_colour(rgb(33,19,9), colour_priority)
frying_examine_text = "incomprehensibly fried to a crisp"
//adding the edible component gives it reagents meaning we can now add the bad frying reagents if it's junk
if(fried_junk && owner.reagents) //check again just incase
var/R = rand(1, GLOB.frying_bad_chems.len)
var/bad_chem = GLOB.frying_bad_chems[R]
var/bad_chem_amount = max(4,GLOB.frying_bad_chems[bad_chem] * (fry_power/12.5)) //4u of bad chem reached when deeply fried
owner.reagents.add_reagent(bad_chem, bad_chem_amount)
/datum/component/fried/proc/restore_name() //restore somethings name
//we do string manipulation and not restoring their name to real_name because some things hide your real_name and we want to maintain that
if(copytext(owner.name,1,14) == "lightly fried ")
owner.name = copytext(owner.name,15)
else
if(copytext(owner.name,1,6) == "fried ")
owner.name = copytext(owner.name,7)
else
if(copytext(owner.name,1,11) == "deep fried ")
owner.name = copytext(owner.name, 12)
else
if(owner.name == "the physical manifestation of fried foods") //if the name is still this, their name hasn't changed, so we can safely restore their stored name
owner.name = stored_name
/datum/component/fried/proc/restore() //restore a fried mob to being not-fried
if(ismob(owner))
//restore the name, the colour should wash off itself, and then remove the component
restore_name()
RemoveComponent()
+18
View File
@@ -452,3 +452,21 @@ GLOBAL_LIST_EMPTY(family_heirlooms)
mob_trait = TRAIT_COLDBLOODED
gain_text = "<span class='notice'>You feel cold-blooded.</span>"
lose_text = "<span class='notice'>You feel more warm-blooded.</span>"
/datum/quirk/monophobia
name = "Monophobia"
desc = "You will become increasingly stressed when not in company of others, triggering panic reactions ranging from sickness to heart attacks."
value = -3 // Might change it to 4.
gain_text = "<span class='danger'>You feel really lonely...</span>"
lose_text = "<span class='notice'>You feel like you could be safe on your own.</span>"
medical_record_text = "Patient feels sick and distressed when not around other people, leading to potentially lethal levels of stress."
/datum/quirk/monophobia/post_add()
. = ..()
var/mob/living/carbon/human/H = quirk_holder
H.gain_trauma(/datum/brain_trauma/severe/monophobia, TRAUMA_RESILIENCE_ABSOLUTE)
/datum/quirk/monophobia/remove()
. = ..()
var/mob/living/carbon/human/H = quirk_holder
H?.cure_trauma_type(/datum/brain_trauma/severe/monophobia, TRAUMA_RESILIENCE_ABSOLUTE)