Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 12 additions & 10 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
/turf/AllowDrop()
return TRUE

/turf/proc/add_vomit_floor(mob/living/M, toxvomit = NONE)
/turf/proc/add_vomit_floor(mob/living/M, toxvomit = NONE, purge_ratio = 0.1)

var/obj/effect/decal/cleanable/vomit/V = new /obj/effect/decal/cleanable/vomit(src, M.get_static_viruses())

Expand All @@ -525,19 +525,21 @@ GLOBAL_LIST_EMPTY(station_turfs)
V = locate() in src
if(!V)
return
// Make toxins and blazaam vomit look different
// Apply the proper icon set based on vomit type
if(toxvomit == VOMIT_PURPLE)
V.icon_state = "vomitpurp_[pick(1,4)]"
else if (toxvomit == VOMIT_TOXIC)
V.icon_state = "vomittox_[pick(1,4)]"
if (iscarbon(M))
var/mob/living/carbon/C = M
if(C.reagents)
clear_reagents_to_vomit_pool(C,V)

/proc/clear_reagents_to_vomit_pool(mob/living/carbon/M, obj/effect/decal/cleanable/vomit/V)
M.reagents.trans_to(V, M.reagents.total_volume / 10, transfered_by = M)
for(var/datum/reagent/R in M.reagents.reagent_list) //clears the stomach of anything that might be digested as food
if (purge_ratio && iscarbon(M))
clear_reagents_to_vomit_pool(M, V, purge_ratio)

/proc/clear_reagents_to_vomit_pool(mob/living/carbon/M, obj/effect/decal/cleanable/vomit/V, purge_ratio = 0.1)
var/chemicals_lost = M.reagents.total_volume * purge_ratio
if(V.reagents.total_volume + chemicals_lost > V.reagents.maximum_volume)
V.reagents.total_volume -= chemicals_lost
M.reagents.trans_to(V, chemicals_lost, transfered_by = M)
//clear the stomach of anything even not food
for(var/datum/reagent/R in M.reagents.reagent_list)
if(istype(R, /datum/reagent/consumable))
var/datum/reagent/consumable/nutri_check = R
if(nutri_check.nutriment_factor >0)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/antagonists/changeling/powers/panacea.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
H.leave_victim()
if(iscarbon(user))
var/mob/living/carbon/C = user
C.vomit(0, toxic = TRUE)
C.vomit(0)
to_chat(user, span_notice("A parasite exits our form."))
..()
var/list/bad_organs = list(
Expand All @@ -30,7 +30,7 @@
O.Remove(user)
if(iscarbon(user))
var/mob/living/carbon/C = user
C.vomit(0, toxic = TRUE)
C.vomit(0)
O.forceMove(get_turf(user))

user.reagents.add_reagent(/datum/reagent/medicine/mutadone, 10)
Expand Down
9 changes: 3 additions & 6 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@
return 0
return ..()

/mob/living/carbon/proc/vomit(lost_nutrition = 10, blood = FALSE, stun = TRUE, distance = 1, message = TRUE, toxic = FALSE)
if(HAS_TRAIT(src, TRAIT_NOHUNGER))
/mob/living/carbon/proc/vomit(lost_nutrition = 10, blood = FALSE, stun = TRUE, distance = 1, message = TRUE, vomit_type = VOMIT_TOXIC, harm = TRUE, force = FALSE, purge_ratio = 0.1)
if((HAS_TRAIT(src, TRAIT_NOHUNGER) || HAS_TRAIT(src, TRAIT_TOXINLOVER)) && !force)
return TRUE

if(istype(src.loc, /obj/effect/dummy)) //cannot vomit while phasing/vomitcrawling
Expand Down Expand Up @@ -538,12 +538,9 @@
add_splatter_floor(T)
if(stun)
adjustBruteLoss(3)
else if(src.reagents.has_reagent(/datum/reagent/consumable/ethanol/blazaam, needs_metabolizing = TRUE))
if(T)
T.add_vomit_floor(src, VOMIT_PURPLE)
else
if(T)
T.add_vomit_floor(src, VOMIT_TOXIC)//toxic barf looks different
T.add_vomit_floor(src, vomit_type, purge_ratio) //toxic barf looks different || call purge when doing detoxicfication to pump more chems out of the stomach.
T = get_step(T, dir)
if (is_blocked_turf(T))
break
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,8 @@
override = dna.species.override_float
..()

/mob/living/carbon/human/vomit(lost_nutrition = 10, blood = 0, stun = 1, distance = 0, message = 1, toxic = 0)
if(blood && (NOBLOOD in dna.species.species_traits))
/mob/living/carbon/human/vomit(lost_nutrition = 10, blood = FALSE, stun = TRUE, distance = 1, message = TRUE, vomit_type = VOMIT_TOXIC, harm = TRUE, force = FALSE, purge_ratio = 0.1)
if(blood && (NOBLOOD in dna.species.species_traits) && !HAS_TRAIT(src, TRAIT_TOXINLOVER))
if(message)
visible_message(span_warning("[src] dry heaves!"), \
span_userdanger("You try to throw up, but there's nothing in your stomach!"))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
if(getToxLoss() >= 45 && nutrition > 20)
lastpuke += prob(50)
if(lastpuke >= 50) // about 25 second delay I guess
vomit(20, toxic = TRUE)
vomit(20)
lastpuke = 0


Expand Down
53 changes: 53 additions & 0 deletions code/modules/surgery/stomachpump.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/datum/surgery/stomach_pump
name = "Stomach Pump"
steps = list(
/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
/datum/surgery_step/incise,
/datum/surgery_step/clamp_bleeders,
/datum/surgery_step/stomach_pump,
/datum/surgery_step/close)

target_mobtypes = list(/mob/living/carbon/human)
possible_locs = list(BODY_ZONE_CHEST)
requires_bodypart_type = TRUE
ignore_clothes = FALSE

/datum/surgery/stomach_pump/can_start(mob/user, mob/living/carbon/target)
var/obj/item/organ/stomach/target_stomach = target.getorganslot(ORGAN_SLOT_STOMACH)
if(HAS_TRAIT(target, TRAIT_HUSK))
return FALSE
if(!target_stomach)
return FALSE
return ..()

//Working the stomach by hand in such a way that you induce vomiting.
/datum/surgery_step/stomach_pump
name = "Pump Stomach"
accept_hand = TRUE
repeatable = TRUE
time = 2 SECONDS

/datum/surgery_step/stomach_pump/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, span_notice("You begin pumping [target]'s stomach..."),
span_notice("[user] begins to pump [target]'s stomach."),
span_notice("[user] begins to press on [target]'s chest."))
display_pain(target, "You feel a horrible sloshing feeling in your gut! You're going to be sick!")

/datum/surgery_step/stomach_pump/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
if(ishuman(target))
var/mob/living/carbon/human/target_human = target
display_results(user, target, span_notice("[user] forces [target_human] to vomit, cleansing their stomach of some chemicals!"),
span_notice("[user] forces [target_human] to vomit, cleansing their stomach of some chemicals!"),
"[user] forces [target_human] to vomit!")
target_human.vomit(20, FALSE, TRUE, 1, TRUE, FALSE, purge_ratio = 0.67) //higher purge ratio than regular vomiting
return ..()

/datum/surgery_step/stomach_pump/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(ishuman(target))
var/mob/living/carbon/human/target_human = target
display_results(user, target, span_warning("You screw up, brusing [target_human]'s chest!"),
span_warning("[user] screws up, brusing [target_human]'s abdomen!"),
span_warning("[user] screws up!"))
target_human.adjustOrganLoss(ORGAN_SLOT_STOMACH, 10)
target_human.adjustBruteLoss(5)
14 changes: 14 additions & 0 deletions code/modules/surgery/surgery_step.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,17 @@
//if(ishuman(target) &&fuckup_damage_type == BRUTE && prob(final_ouchie_chance/2))
//var/mob/living/carbon/human/H = target
//H.bleed_rate += min(fuckup_damage/4, 10)

/**
* Sends a pain message to the target, including a chance of screaming.
*
* Arguments:
* * target - Who the message will be sent to
* * pain_message - The message to be displayed
* * mechanical_surgery - Boolean flag that represents if a surgery step is done on a mechanical limb (therefore does not force scream)
*/
/datum/surgery_step/proc/display_pain(mob/living/target, pain_message, mechanical_surgery = FALSE)
if(!HAS_TRAIT(target, TRAIT_SURGERY_PREPARED))
to_chat(target, span_userdanger(pain_message))
if(prob(30) && !mechanical_surgery)
target.emote("scream")
1 change: 1 addition & 0 deletions yogstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3153,6 +3153,7 @@
#include "code\modules\surgery\prosthetic_replacement.dm"
#include "code\modules\surgery\remove_embedded_object.dm"
#include "code\modules\surgery\repair_puncture.dm"
#include "code\modules\surgery\stomachpump.dm"
#include "code\modules\surgery\surgery.dm"
#include "code\modules\surgery\surgery_step.dm"
#include "code\modules\surgery\tools.dm"
Expand Down