[READY]New Quirk: Extreme Medicine Allergy (#51870)

* e

* meds e

* e

* e

* e

* E

* E

* Update code/datums/traits/negative.dm

Co-authored-by: ラッピ from PSO2 <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com>

* c

* c2

* more blacklistings

* dogtag

* Update code/modules/reagents/chemistry/reagents.dm

Co-authored-by: ラッピ from PSO2 <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com>

* E

* E

* Update code/modules/clothing/under/accessories.dm

Co-authored-by: ラッピ from PSO2 <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com>

* E

Co-authored-by: ラッピ from PSO2 <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com>
This commit is contained in:
EdgeLordExe
2020-07-05 18:42:22 -04:00
committed by GitHub
co-authored by ラッピ from PSO2
parent eaf80e80e8
commit d1669cea72
8 changed files with 93 additions and 1 deletions
+2
View File
@@ -36,3 +36,5 @@
//used by chem masters and pill presses
#define PILL_STYLE_COUNT 22 //Update this if you add more pill icons or you die
#define RANDOM_PILL_STYLE 22 //Dont change this one though
#define ALLERGIC_REMOVAL_SKIP "Allergy"
+58
View File
@@ -614,6 +614,64 @@
medical_record_text = "Patient's mind is in a vulnerable state, and cannot recover from traumatic events."
hardcore_value = 9
/datum/quirk/allergic
name = "Extreme Medicine Allergy"
desc = "Ever since you were a kid, you've been allergic to certain chemicals..."
value = -2
gain_text = "<span class='danger'>You feel your immune system shift.</span>"
lose_text = "<span class='notice'>You feel your immune system phase back into perfect shape.</span>"
medical_record_text = "Patient's immune system responds violently to certain chemicals."
hardcore_value = 3
var/list/allergies = list()
var/list/blacklist = list(/datum/reagent/medicine/c2,/datum/reagent/medicine/epinephrine,/datum/reagent/medicine/adminordrazine,/datum/reagent/medicine/omnizine/godblood,/datum/reagent/medicine/cordiolis_hepatico,/datum/reagent/medicine/synaphydramine,/datum/reagent/medicine/diphenhydramine)
/datum/quirk/allergic/on_spawn()
var/list/chem_list = subtypesof(/datum/reagent/medicine) - blacklist
for(var/i in 0 to 5)
var/chem = pick(chem_list)
chem_list -= chem
allergies += chem
/datum/quirk/allergic/post_add()
var/display = ""
for(var/C in allergies)
var/datum/reagent/chemical = C
display += initial(chemical.name) + ", "
name = "Extreme " + display +"Allergies"
medical_record_text = "Patient's immune system responds violently to [display]"
quirk_holder?.mind.store_memory("You are allergic to [display]")
to_chat(quirk_holder, "<span class='boldnotice'>You are allergic to [display]make sure not to consume any of it!</span>")
if(!ishuman(quirk_holder))
return
var/mob/living/carbon/human/human_holder = quirk_holder
var/obj/item/clothing/accessory/allergy_dogtag/dogtag = new(get_turf(human_holder))
var/list/slots = list (
"backpack" = ITEM_SLOT_BACKPACK,
"hands" = ITEM_SLOT_HANDS
)
dogtag.display = display
human_holder.equip_in_one_of_slots(dogtag, slots , qdel_on_fail = TRUE)
/datum/quirk/allergic/on_process()
. = ..()
if(!iscarbon(quirk_holder))
return
var/mob/living/carbon/carbon_quirk_holder = quirk_holder
for(var/M in allergies)
var/datum/reagent/instantiated_med = carbon_quirk_holder.reagents.has_reagent(M)
if(!instantiated_med)
continue
//Just halts the progression, I'd suggest you run to medbay asap to get it fixed
if(carbon_quirk_holder.reagents.has_reagent(/datum/reagent/medicine/epinephrine))
instantiated_med.reagent_removal_skip_list |= ALLERGIC_REMOVAL_SKIP
return //intentionally stops the entire proc so we avoid the organ damage after the loop
instantiated_med.reagent_removal_skip_list -= ALLERGIC_REMOVAL_SKIP
carbon_quirk_holder.adjustToxLoss(3)
carbon_quirk_holder.reagents.add_reagent(/datum/reagent/toxin/histamine,3)
if(prob(10))
carbon_quirk_holder.vomit()
carbon_quirk_holder.adjustOrganLoss(pick(ORGAN_SLOT_BRAIN,ORGAN_SLOT_APPENDIX,ORGAN_SLOT_LUNGS,ORGAN_SLOT_HEART,ORGAN_SLOT_LIVER,ORGAN_SLOT_STOMACH),10)
#undef LOCATION_LPOCKET
#undef LOCATION_RPOCKET
#undef LOCATION_BACKPACK
@@ -382,3 +382,28 @@
armor = list("melee" = 5, "bullet" = 5, "laser" = 5, "energy" = 5, "bomb" = 20, "bio" = 20, "rad" = 5, "fire" = 0, "acid" = 25)
attachment_slot = GROIN
/obj/item/clothing/accessory/allergy_dogtag
name = "Allergy dogtag"
desc = "Dogtag with a list of your allergies"
icon_state = "allergy"
above_suit = FALSE
minimize_when_attached = TRUE
attachment_slot = CHEST
///Display message
var/display
/obj/item/clothing/accessory/allergy_dogtag/examine(mob/user)
. = ..()
. += "The dogtag has a listing of allergies : [display]"
/obj/item/clothing/accessory/allergy_dogtag/on_uniform_equip(obj/item/clothing/under/U, user)
. = ..()
RegisterSignal(U,COMSIG_PARENT_EXAMINE,.proc/on_examine)
/obj/item/clothing/accessory/allergy_dogtag/on_uniform_dropped(obj/item/clothing/under/U, user)
. = ..()
UnregisterSignal(U,COMSIG_PARENT_EXAMINE)
///What happens when we examine the uniform
/obj/item/clothing/accessory/allergy_dogtag/proc/on_examine(datum/source, mob/user, list/examine_list)
examine_list += "The dogtag has a listing of allergies : [display]"
+4 -1
View File
@@ -70,6 +70,8 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
var/harmful = FALSE
/// Are we from a material? We might wanna know that for special stuff. Like metalgen. Is replaced with a ref of the material on New()
var/datum/material/material
///A list of causes why this chem should skip being removed, if the length is 0 it will be removed from holder naturally, if this is >0 it will not be removed from the holder.
var/list/reagent_removal_skip_list = list()
/datum/reagent/New()
. = ..()
@@ -108,8 +110,9 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
/// Called from [/datum/reagents/proc/metabolize]
/datum/reagent/proc/on_mob_life(mob/living/carbon/M)
current_cycle++
if(!length(reagent_removal_skip_list))
return
holder.remove_reagent(type, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears.
return
///Called after a reagent is transfered
/datum/reagent/proc/on_transfer(atom/A, method=TOUCH, trans_volume)
@@ -20,6 +20,8 @@
var/mob/living/carbon/human/H = M
if(!HAS_TRAIT(H, TRAIT_NOHUNGER))
H.adjust_nutrition(nutriment_factor)
if(!length(reagent_removal_skip_list))
return
holder.remove_reagent(type, metabolization_rate)
/datum/reagent/consumable/expose_mob(mob/living/M, method=TOUCH, reac_volume)
@@ -12,6 +12,8 @@
/datum/reagent/medicine/on_mob_life(mob/living/carbon/M)
current_cycle++
if(!length(reagent_removal_skip_list))
return
holder.remove_reagent(type, metabolization_rate / M.metabolism_efficiency) //medicine reagents stay longer if you have a better metabolism
/datum/reagent/medicine/leporazine
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB