Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vomitting now empties your stomach #6527

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/__DEFINES/chemistry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/// Amount of random icon variations for pills in total
#define PILL_ICON_CHOICES 21
/* Pill icon classes to generate mappings for */
#define PILL_ICON_CLASSES list("bica", "kelo", "dex", "para", "tram", "atox", "tox", "inap", "peri", "spac", "drug", "stim", "alky", "imi", "qc", "tric", "psych", "oxy")
#define PILL_ICON_CLASSES list("bica", "kelo", "dex", "para", "tram", "atox", "tox", "inap", "peri", "spac", "drug", "stim", "alky", "imi", "qc", "tric", "psych", "oxy", "ipi")

/*
reagents defines
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/vending/vendor_types/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@
list("Pill Bottle (Kelotane)", floor(scale * 4), /obj/item/storage/pill_bottle/kelotane, VENDOR_ITEM_REGULAR),
list("Pill Bottle (Peridaxon)", floor(scale * 3), /obj/item/storage/pill_bottle/peridaxon, VENDOR_ITEM_REGULAR),
list("Pill Bottle (Tramadol)", floor(scale * 4), /obj/item/storage/pill_bottle/tramadol, VENDOR_ITEM_REGULAR),
list("Pill Packet (Ipicac)", floor(scale * 4), /obj/item/storage/pill_bottle/packet/ipicac, VENDOR_ITEM_REGULAR),

list("MEDICAL UTILITIES", -1, null, null),
list("Emergency Defibrillator", floor(scale * 3), /obj/item/device/defibrillator, VENDOR_ITEM_REGULAR),
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/items/reagent_containers/pill.dm
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,8 @@
/obj/item/reagent_container/pill/stimulant
pill_initial_reagents = list("antag_stimulant" = 10)
pill_icon_class = "stim"

/obj/item/reagent_container/pill/ipicac
pill_desc = "An Ipicac pill. Used to induce vomiting to eject toxic substances."
pill_initial_reagents = list("ipicac" = 10)
pill_icon_class = "ipi"
6 changes: 6 additions & 0 deletions code/game/objects/items/storage/firstaid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -789,3 +789,9 @@
icon_state = "oxycodone_packet"
desc = "This packet contains oxycodone pills. A highly effective painkiller. Once you take them out, they don't go back in. Don't take more than 1 pill in a short period."
pill_type_to_fill = /obj/item/reagent_container/pill/oxycodone

/obj/item/storage/pill_bottle/packet/ipicac
name = "ipicac pill packet"
icon_state = "ipicac_packet"
desc = "This packet contains ipicac pills. A fast acting emetic. Once you take them out, they don't go back in."
pill_type_to_fill = /obj/item/reagent_container/pill/ipicac
19 changes: 12 additions & 7 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,8 @@
if(!lastpuke)
lastpuke = 1
to_chat(src, SPAN_WARNING("You feel nauseous..."))
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(to_chat), src, "You feel like you are about to throw up!"), 15 SECONDS)
addtimer(CALLBACK(src, PROC_REF(do_vomit)), 25 SECONDS)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(to_chat), src, "You feel like you are about to throw up!"), 10 SECONDS)
addtimer(CALLBACK(src, PROC_REF(do_vomit)), 15 SECONDS)

/mob/living/carbon/human/proc/do_vomit()
apply_effect(5, STUN)
Expand All @@ -894,9 +894,14 @@
if(istype(location, /turf))
location.add_vomit_floor(src, 1)

if(reagents.reagent_list.len)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

length(), not .len

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if(reagents.reagent_list.length())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, if(length(reagents.reagent_list))

My javascript background comes back to haunt me.

var/purge_percent = 0.7 //30%
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the point of making this a local var if you're using it nowhere else but line 900

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I was just exposing vars for ease of seeing what value was being used (I thought I needed three, but over time managed to whittle it down to one) I'll just set line 900 to * 0.7

for(var/datum/reagent/ingested_chem in reagents.reagent_list)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as anything

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

	for(var/datum/reagent/ingested_chem as anything in reagents.reagent_list)

ingested_chem.volume = (ingested_chem.volume * purge_percent)

nutrition -= 40
apply_damage(-3, TOX)
addtimer(VARSET_CALLBACK(src, lastpuke, FALSE), 35 SECONDS)
addtimer(VARSET_CALLBACK(src, lastpuke, FALSE), 15 SECONDS)

/mob/living/carbon/human/proc/get_visible_gender()
if(wear_suit && wear_suit.flags_inv_hide & HIDEJUMPSUIT && ((head && head.flags_inv_hide & HIDEMASK) || wear_mask))
Expand Down Expand Up @@ -1707,15 +1712,15 @@

/mob/living/carbon/human/on_knockedout_trait_gain(datum/source)
. = ..()

update_execute_hud()

return .

/mob/living/carbon/human/on_knockedout_trait_loss(datum/source)
. = ..()

update_execute_hud()

return .

2 changes: 1 addition & 1 deletion code/modules/reagents/chemistry_properties/prop_neutral.dm
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@
category = PROPERTY_TYPE_IRRITANT

/datum/chem_property/neutral/emetic/process(mob/living/M, potency = 1, delta_time)
if(prob(0.5 * holder.volume * potency * delta_time) && ishuman(M))
if(prob(2.5 * holder.volume * potency * delta_time) && ishuman(M))
var/mob/living/carbon/human/H = M
H.vomit() //vomit() already has a timer on in

Expand Down
9 changes: 9 additions & 0 deletions code/modules/reagents/chemistry_reagents/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,12 @@
custom_metabolism = AMOUNT_PER_TIME(1, 200 SECONDS)
data = 0
properties = list(PROPERTY_CURING = 2)

/datum/reagent/medical/ipicac
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it Ipecac

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...........yes

name = "Ipicac"
id = "ipicac"
description = "A rapid acting emetic made from the ipecacuanha plant."
reagent_state = LIQUID
color = "#DEAD00"
data = 0
properties = list(PROPERTY_EMETIC = 1)
Binary file modified icons/obj/items/chemistry.dmi
Binary file not shown.
Loading