Skip to content

Commit

Permalink
Adds a stomach organ, pills, food and etc go into stomach and only th…
Browse files Browse the repository at this point in the history
…en to blood. (#69)

* hmmmmmmmmm

* vomitting

* Update organ_internal.dm

* hmm

* Update condiment.dm

* hmm

* Update mobs.dm

* Update holder.dm

* Update holder.dm

* Update snacks.dm

* Update holder.dm

* Update living_health_procs.dm

* Update holder.dm

* defib fixes

* guh

* Update limbs.dm

* Update species.dm

* new()

* Update organs.dm

* get_damage

broken stuff in the future detected

* Update living_health_procs.dm

* med analyzer stomach chem contents

* peri

* Update medical.dm

* Update human.dm

* Update shock.dm

* eh

* Update organs.dm

* sanity checks?

* Update death.dm

* Update organs.dm

* vomitting out reagents

* eh

* ueh

* mhm

* delete props

* Update organs.dm

* Update human_defense.dm

* meh

* eh

* vomit

* Update human_status_procs.dm

* eh
  • Loading branch information
Helg2 authored Aug 9, 2024
1 parent 1297b97 commit a3ab9ee
Show file tree
Hide file tree
Showing 60 changed files with 523 additions and 1,253 deletions.
2 changes: 1 addition & 1 deletion _maps/map_files/Campaign maps/nt_base/nt_base.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -21394,7 +21394,7 @@
pixel_x = -11
},
/obj/effect/decal/cleanable/blood/gibs/body,
/obj/item/prop/organ/heart,
/obj/item/organ/heart,
/turf/open/floor/tile/dark2{
dir = 8
},
Expand Down
12 changes: 6 additions & 6 deletions _maps/map_files/Pillar_of_Spring/TGS_Pillar_of_Spring.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -8543,7 +8543,7 @@
/area/mainship/command/self_destruct)
"lcA" = (
/obj/machinery/optable,
/obj/item/prop/organ/kidneys,
/obj/item/organ/kidneys,
/turf/open/floor/cult,
/area/medical/morgue)
"lcL" = (
Expand Down Expand Up @@ -9573,11 +9573,11 @@
"mcR" = (
/obj/structure/toilet,
/obj/structure/closet/crate/freezer,
/obj/item/prop/organ/kidneys,
/obj/item/prop/organ/kidneys,
/obj/item/prop/organ/kidneys,
/obj/item/prop/organ/kidneys,
/obj/item/prop/organ/kidneys,
/obj/item/organ/kidneys,
/obj/item/organ/kidneys,
/obj/item/organ/kidneys,
/obj/item/organ/kidneys,
/obj/item/organ/kidneys,
/turf/open/floor/mainship/floor,
/area/mainship/medical/upper_medical)
"mdp" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/gelida_iv/gelida_iv.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -23274,7 +23274,7 @@
pixel_x = -11
},
/obj/effect/decal/cleanable/blood/gibs/body,
/obj/item/prop/organ/heart,
/obj/item/organ/heart,
/turf/open/floor/tile/dark2{
dir = 8
},
Expand Down
12 changes: 1 addition & 11 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,24 +210,14 @@ GLOBAL_LIST_INIT(xenoupgradetiers, list(XENO_UPGRADE_BASETYPE, XENO_UPGRADE_INVA

///////////////////INTERNAL ORGANS DEFINES///////////////////

#define ORGAN_ASSISTED 1
#define ORGAN_ROBOT 2

#define ORGAN_HEART 1
#define ORGAN_LUNGS 2
#define ORGAN_LIVER 3
#define ORGAN_KIDNEYS 4
#define ORGAN_BRAIN 5
#define ORGAN_EYES 6
#define ORGAN_APPENDIX 7

//organ slots
#define ORGAN_SLOT_APPENDIX "appendix"
#define ORGAN_SLOT_BRAIN "brain"
#define ORGAN_SLOT_EARS "ears"
#define ORGAN_SLOT_EYES "eyes"
#define ORGAN_SLOT_HEART "heart"
#define ORGAN_SLOT_LIVER "liver"
#define ORGAN_SLOT_STOMACH "stomach"
#define ORGAN_SLOT_LUNGS "lungs"
#define ORGAN_SLOT_KIDNEYS "kidneys"

Expand Down
4 changes: 2 additions & 2 deletions code/datums/status_effects/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@
living_owner.adjustToxLoss(3)
if(prob(15))
living_owner.adjust_Losebreath(5)
if(prob(15))
living_owner.vomit()
if(carbon_owner && prob(15))
carbon_owner.vomit()
if(carbon_owner && prob(15))
var/datum/internal_organ/organ = pick(carbon_owner.internal_organs)
if(organ)
Expand Down
1 change: 0 additions & 1 deletion code/game/objects/effects/decals/Cleanable/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
icon_state = "vomit_1"
random_icon_states = list("vomit_1", "vomit_2", "vomit_3", "vomit_4")


/obj/effect/decal/cleanable/tomato_smudge
name = "tomato smudge"
desc = "It's red."
Expand Down
14 changes: 7 additions & 7 deletions code/game/objects/effects/spawners/random/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@
name = "Random surgical organ spawner"
icon_state = "random_organ"
loot = list(
/obj/item/prop/organ/brain,
/obj/item/prop/organ/heart,
/obj/item/prop/organ/lungs,
/obj/item/prop/organ/kidneys,
/obj/item/prop/organ/eyes,
/obj/item/prop/organ/liver,
/obj/item/prop/organ/appendix,
/obj/item/organ/brain,
/obj/item/organ/heart,
/obj/item/organ/lungs,
/obj/item/organ/kidneys,
/obj/item/organ/eyes,
/obj/item/organ/liver,
/obj/item/organ/appendix,
)

/obj/effect/spawner/random/medical/medbottle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
if(reagents.total_volume)
record_reagent_consumption(min(10, reagents.total_volume), reagents.reagent_list, user, M)
reagents.reaction(M, INGEST)
reagents.trans_to(M, 10)
reagents.trans_to(M, 10, transfer_to_stomach = TRUE)
playsound(M.loc,'sound/items/drink.ogg', 15, 1)
return 1
return 0
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/reagent_containers/food/drinks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
record_reagent_consumption(min(gulp_size, reagents.total_volume), reagents.reagent_list, user)
if(reagents.total_volume)
reagents.reaction(M, INGEST)
reagents.trans_to(M, gulp_size)
reagents.trans_to(M, gulp_size, transfer_to_stomach = TRUE)
playsound(M.loc,'sound/items/drink.ogg', 15, 1)
return TRUE
else
Expand All @@ -56,7 +56,7 @@

if(reagents.total_volume)
reagents.reaction(M, INGEST)
reagents.trans_to(M, gulp_size)
reagents.trans_to(M, gulp_size, transfer_to_stomach = TRUE)

playsound(M.loc,'sound/items/drink.ogg', 15, 1)
return TRUE
Expand Down
12 changes: 6 additions & 6 deletions code/game/objects/items/reagent_containers/food/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@
*/
//Why is bitesize used instead of an actual portion???
record_reagent_consumption(bitesize, reagents.reagent_list, user, M)
reagents.trans_to(M, bitesize)
reagents.trans_to(M, bitesize, transfer_to_stomach = TRUE)
else
record_reagent_consumption(reagents.total_volume, reagents.reagent_list, user, M)
reagents.trans_to(M, reagents.total_volume)
reagents.trans_to(M, reagents.total_volume, transfer_to_stomach = TRUE)
bitecount++
On_Consume(M)
return TRUE
Expand Down Expand Up @@ -858,12 +858,12 @@
var/mob/living/carbon/human/H = M
var/datum/limb/E = H.get_limb("chest")
E.fracture()
for (var/datum/internal_organ/I in E.internal_organs)
for(var/datum/internal_organ/I in E.internal_organs)
I.take_damage(rand(I.min_bruised_damage, I.min_broken_damage+1))
if (!E.hidden && prob(60)) //set it snuggly
if(!E.hidden && prob(60)) //set it snuggly
E.hidden = surprise
E.cavity = 0
else //someone is having a bad day
else //someone is having a bad day
E.createwound(CUT, 30)
surprise.embed_into(M, E)
qdel(src)
Expand Down Expand Up @@ -1555,7 +1555,7 @@
/obj/item/reagent_containers/food/snacks/lollipop/proc/handle_reagents()
var/fraction = min(FOOD_METABOLISM/reagents.total_volume, 1)
reagents.reaction(owner, INGEST, fraction)
if(!reagents.trans_to(owner, FOOD_METABOLISM))
if(!reagents.trans_to(owner, FOOD_METABOLISM, transfer_to_stomach = TRUE))
reagents.remove_any(FOOD_METABOLISM)

/obj/item/reagent_containers/food/snacks/lollipop/process()
Expand Down
8 changes: 2 additions & 6 deletions code/game/objects/items/reagent_containers/pill.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
////////////////////////////////////////////////////////////////////////////////
/// Pills.
////////////////////////////////////////////////////////////////////////////////

/obj/item/reagent_containers/pill
name = "pill"
icon = 'icons/obj/items/chemistry.dmi'
Expand Down Expand Up @@ -39,7 +35,7 @@
if(reagents.total_volume)
record_reagent_consumption(reagents.total_volume, reagents.reagent_list, user)
reagents.reaction(M, INGEST)
reagents.trans_to(M, reagents.total_volume)
reagents.trans_to(M, reagents.total_volume, transfer_to_stomach = TRUE)

qdel(src)
return TRUE
Expand Down Expand Up @@ -68,7 +64,7 @@
if(reagents.total_volume)
record_reagent_consumption(reagents.total_volume, reagents.reagent_list, user, M)
reagents.reaction(M, INGEST)
reagents.trans_to(M, reagents.total_volume)
reagents.trans_to(M, reagents.total_volume, transfer_to_stomach = TRUE)
qdel(src)
else
qdel(src)
Expand Down
20 changes: 19 additions & 1 deletion code/game/objects/items/scanners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ REAGENT SCANNER
///Skill required to have the scanner auto refresh
var/upper_skill_threshold = SKILL_MEDICAL_NOVICE
///Current mob being tracked by the scanner
var/mob/living/carbon/patient
var/mob/living/carbon/human/patient
///Current user of the scanner
var/mob/living/carbon/current_user
///Distance the current_user can be away from the patient and still get health data.
Expand Down Expand Up @@ -192,6 +192,24 @@ REAGENT SCANNER
)
data["has_chemicals"] = length(patient.reagents.reagent_list)
data["chemicals_lists"] = chemicals_lists

var/datum/internal_organ/stomach/belly = patient.get_organ_slot(ORGAN_SLOT_STOMACH) // should it be this way?
data["has_stomach_chemicals"] = length(belly.reagents.reagent_list)
var/list/stomach_chemicals_lists = list()
for(var/datum/reagent/reagent AS in belly.reagents.reagent_list)
if(!reagent.scannable)
data["has_unknown_chemicals"] = TRUE
continue
var/reagent_overdosed = FALSE
if(reagent.overdose_threshold && reagent.volume > reagent.overdose_threshold)
reagent_overdosed = TRUE
stomach_chemicals_lists["[reagent.name]"] = list(
"name" = reagent.name,
"amount" = round(reagent.volume, 0.1),
"od" = reagent_overdosed
)
data["stomach_chemicals_lists"] = stomach_chemicals_lists

data["species"] = patient.species.species_flags & ROBOTIC_LIMBS ? "robot" : "human"

var/list/limb_data_lists = list()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/tools/kitchen_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

if (reagents.total_volume > 0)
reagents.reaction(M, INGEST)
reagents.trans_to(M, reagents.total_volume)
reagents.trans_to(M, reagents.total_volume, transfer_to_stomach = TRUE)
if(M == user)
visible_message(span_notice("[user] eats some [loaded] from \the [src]."))
M.reagents.add_reagent(/datum/reagent/consumable/nutriment, 1)
Expand Down
9 changes: 1 addition & 8 deletions code/game/objects/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,8 @@
dat += "</tr>"

for(var/datum/internal_organ/i in occ["internal_organs"])

var/mech = ""
if(i.robotic == ORGAN_ASSISTED)
mech = "Assisted:<br>"
if(i.robotic == ORGAN_ROBOT)
mech = "Mechanical:<br>"

dat += "<tr>"
dat += "<td>[i.name]</td><td>N/A</td><td>[i.damage]</td><td>None:[mech]</td><td></td>"
dat += "<td>[i.name]</td><td>N/A</td><td>[i.damage]</td><td></td>"
dat += "</tr>"
dat += "</table>"

Expand Down
19 changes: 7 additions & 12 deletions code/game/objects/machinery/autodoc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,8 @@

var/organdamagesurgery = 0
for(var/datum/internal_organ/I in L.internal_organs)
if(I.robotic == ORGAN_ASSISTED||I.robotic == ORGAN_ROBOT)
// we can't deal with these
continue
if(I.damage > 0)
if(I.organ_id == ORGAN_EYES) // treat eye surgery differently
if(I.slot == ORGAN_SLOT_EYES) // treat eye surgery differently
continue
if(organdamagesurgery > 0)
continue // avoid duplicates
Expand Down Expand Up @@ -372,7 +369,7 @@
else
occupant.reagents.add_reagent(/datum/reagent/medicine/spaceacillin,inject_per_second)
amount -= inject_per_second
sleep(10*surgery_mod)
sleep(10 * surgery_mod)

if(ADSURGERY_DAMAGE)
say("Beginning organ restoration.")
Expand All @@ -386,15 +383,15 @@
if(S.limb_ref.body_part != GROIN)
open_encased(occupant, S.limb_ref)

if(!istype(S.organ_ref,/datum/internal_organ/brain))
if(!istype(S.organ_ref, /datum/internal_organ/brain))
sleep(FIX_ORGAN_MAX_DURATION*surgery_mod)
else
if(S.organ_ref.damage > BONECHIPS_MAX_DAMAGE)
sleep(HEMOTOMA_MAX_DURATION*surgery_mod)
sleep(BONECHIPS_REMOVAL_MAX_DURATION*surgery_mod)
sleep(HEMOTOMA_MAX_DURATION * surgery_mod)
sleep(BONECHIPS_REMOVAL_MAX_DURATION * surgery_mod)
if(!surgery)
break
if(istype(S.organ_ref,/datum/internal_organ))
if(istype(S.organ_ref, /datum/internal_organ))
S.organ_ref.heal_organ_damage(S.organ_ref.damage)
else
say("Organ is missing.")
Expand All @@ -411,7 +408,7 @@
say("Procedure has been deemed unnecessary.")
surgery_todo_list -= S
continue
if(istype(S.organ_ref,/datum/internal_organ/eyes))
if(istype(S.organ_ref, /datum/internal_organ/eyes))
var/datum/internal_organ/eyes/E = S.organ_ref

if(E.eye_surgery_stage == 0)
Expand Down Expand Up @@ -1219,8 +1216,6 @@
var/datum/limb/L = i
for(var/x in L.internal_organs)
var/datum/internal_organ/I = x
if(I.robotic == ORGAN_ASSISTED || I.robotic == ORGAN_ROBOT)
continue
if(I.damage > 0)
N.fields["autodoc_manual"] += create_autodoc_surgery(L,ORGAN_SURGERY,ADSURGERY_DAMAGE,0,I)
needed++
Expand Down
2 changes: 0 additions & 2 deletions code/game/objects/machinery/flasher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@
else
L.flash_act()


L.Paralyze(strength)


/obj/machinery/flasher/emp_act(severity)
if(machine_stat & (BROKEN|NOPOWER))
..(severity)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/machinery/portable_reagent_tank.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
record_sippies(5, reagents.reagent_list, user)
playsound(user.loc,'sound/items/drink.ogg', 25, 2)
reagents.reaction(user, INGEST)
reagents.trans_to(user, 5)
reagents.trans_to(user, 5, transfer_to_stomach = TRUE)
return TRUE
balloon_alert(user, "It's empty!")

Expand Down
34 changes: 0 additions & 34 deletions code/game/objects/structures/prop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -933,40 +933,6 @@
icon = 'icons/Marine/mainship_props.dmi'
icon_state = "hangarbox"

/obj/item/prop/organ
name = "organ"
desc = "It looks like it probably just plopped out. It's too decayed to be reinserted in a patient."
icon = 'icons/obj/items/organs.dmi'
icon_state = "heart"

/obj/item/prop/organ/heart
name = "heart"
icon_state = "heart-off"

/obj/item/prop/organ/brain
name = "brain"
icon_state = "brain1"

/obj/item/prop/organ/appendix
name = "appendix"
icon_state = "appendix"

/obj/item/prop/organ/lungs
name = "lungs"
icon_state = "lungs"

/obj/item/prop/organ/kidneys
name = "kidneys"
icon_state = "kidneys"

/obj/item/prop/organ/eyes
name = "eyes"
icon_state = "eyes"

/obj/item/prop/organ/liver
name = "liver"
icon_state = "liver"

/obj/item/prop/aimodule
name = "AI module"
desc = "An AI Module for programming laws to an AI."
Expand Down
Loading

0 comments on commit a3ab9ee

Please sign in to comment.