Organ Update [Cloning isn't broken edition]
This commit is contained in:
@@ -47,4 +47,4 @@
|
||||
var/list/hand_bodyparts = list() //a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems)
|
||||
|
||||
var/icon_render_key = ""
|
||||
var/static/list/limb_icon_cache = list()
|
||||
var/static/list/limb_icon_cache = list()
|
||||
@@ -51,6 +51,18 @@
|
||||
if(!(NOBLOOD in dna.species.species_traits))
|
||||
internal_organs += new /obj/item/organ/heart
|
||||
|
||||
if(!(NOLIVER in dna.species.species_traits))
|
||||
if(dna.species.mutantliver)
|
||||
internal_organs += new dna.species.mutantliver()
|
||||
else
|
||||
internal_organs += new /obj/item/organ/liver()
|
||||
|
||||
if(!(NOSTOMACH in dna.species.species_traits))
|
||||
if(dna.species.mutantstomach)
|
||||
internal_organs += new dna.species.mutantstomach()
|
||||
else
|
||||
internal_organs += new /obj/item/organ/stomach()
|
||||
|
||||
internal_organs += new dna.species.mutanteyes
|
||||
internal_organs += new dna.species.mutantears
|
||||
internal_organs += new dna.species.mutanttongue
|
||||
|
||||
@@ -271,13 +271,6 @@
|
||||
|
||||
return min(1,thermal_protection)
|
||||
|
||||
|
||||
/mob/living/carbon/human/handle_chemicals_in_body()
|
||||
if(reagents)
|
||||
reagents.metabolize(src, can_overdose=1)
|
||||
dna.species.handle_chemicals_in_body(src)
|
||||
|
||||
|
||||
/mob/living/carbon/human/handle_random_events()
|
||||
//Puke if toxloss is too high
|
||||
if(!stat)
|
||||
|
||||
@@ -136,6 +136,11 @@
|
||||
var/obj/item/organ/ears/ears = C.getorganslot("ears")
|
||||
var/obj/item/organ/tongue/tongue = C.getorganslot("tongue")
|
||||
|
||||
var/obj/item/organ/liver/liver = C.getorganslot("liver")
|
||||
var/obj/item/organ/stomach/stomach = C.getorganslot("stomach")
|
||||
|
||||
|
||||
|
||||
if((NOBLOOD in species_traits) && heart)
|
||||
heart.Remove(C)
|
||||
qdel(heart)
|
||||
@@ -147,6 +152,10 @@
|
||||
qdel(lungs)
|
||||
lungs = null
|
||||
|
||||
QDEL_NULL(liver)
|
||||
|
||||
QDEL_NULL(stomach)
|
||||
|
||||
if(C.get_bodypart("head"))
|
||||
if(eyes)
|
||||
qdel(eyes)
|
||||
@@ -170,6 +179,20 @@
|
||||
lungs = new()
|
||||
lungs.Insert(C)
|
||||
|
||||
if((!(NOLIVER in species_traits)) && (!liver))
|
||||
if(mutantliver)
|
||||
liver = new mutantliver()
|
||||
else
|
||||
liver = new()
|
||||
liver.Insert(C)
|
||||
|
||||
if((!(NOSTOMACH in species_traits)) && (!stomach))
|
||||
if(mutantstomach)
|
||||
stomach = new mutantstomach()
|
||||
else
|
||||
stomach = new()
|
||||
stomach.Insert(C)
|
||||
|
||||
if((NOHUNGER in species_traits) && appendix)
|
||||
qdel(appendix)
|
||||
else if((!(NOHUNGER in species_traits)) && (!appendix))
|
||||
@@ -989,10 +1012,10 @@
|
||||
//LIFE//
|
||||
////////
|
||||
|
||||
/datum/species/proc/handle_chemicals_in_body(mob/living/carbon/human/H)
|
||||
/datum/species/proc/handle_digestion(mob/living/carbon/human/H)
|
||||
|
||||
//The fucking FAT mutation is the dumbest shit ever. It makes the code so difficult to work with
|
||||
if(H.disabilities & FAT)
|
||||
if(H.disabilities & FAT)//I share your pain, past coder.
|
||||
if(H.overeatduration < 100)
|
||||
to_chat(H, "<span class='notice'>You feel fit again!</span>")
|
||||
H.disabilities &= ~FAT
|
||||
|
||||
12
code/modules/mob/living/carbon/human/species.dm.rej
Normal file
12
code/modules/mob/living/carbon/human/species.dm.rej
Normal file
@@ -0,0 +1,12 @@
|
||||
diff a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm (rejected hunks)
|
||||
@@ -71,8 +71,8 @@
|
||||
var/obj/item/mutanthands = null
|
||||
var/obj/item/organ/tongue/mutanttongue = /obj/item/organ/tongue
|
||||
|
||||
- var/obj/item/organ/liver/mutantliver = null
|
||||
- var/obj/item/organ/stomach/mutantstomach = null
|
||||
+ var/obj/item/organ/liver/mutantliver
|
||||
+ var/obj/item/organ/stomach/mutantstomach
|
||||
|
||||
///////////
|
||||
// PROCS //
|
||||
@@ -3,6 +3,8 @@
|
||||
id = "fly"
|
||||
say_mod = "buzzes"
|
||||
mutanttongue = /obj/item/organ/tongue/fly
|
||||
mutantliver = /obj/item/organ/liver/fly
|
||||
mutantstomach = /obj/item/organ/stomach/fly
|
||||
meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/fly
|
||||
|
||||
/datum/species/fly/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
id = "jelly"
|
||||
default_color = "00FF90"
|
||||
say_mod = "chirps"
|
||||
species_traits = list(MUTCOLORS,EYECOLOR,NOBLOOD,VIRUSIMMUNE,TOXINLOVER)
|
||||
species_traits = list(MUTCOLORS,EYECOLOR,NOBLOOD,VIRUSIMMUNE,TOXINLOVER)
|
||||
meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/slime
|
||||
exotic_blood = "slimejelly"
|
||||
damage_overlay_type = ""
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
species_traits = list(NOBLOOD,RESISTCOLD,RADIMMUNE,NOTRANSSTING,VIRUSIMMUNE,NOHUNGER)
|
||||
mutantlungs = /obj/item/organ/lungs/plasmaman
|
||||
mutanttongue = /obj/item/organ/tongue/bone/plasmaman
|
||||
mutantliver = /obj/item/organ/liver/plasmaman
|
||||
mutantstomach = /obj/item/organ/stomach/plasmaman
|
||||
dangerous_existence = 1 //So so much
|
||||
blacklisted = 1 //See above
|
||||
burnmod = 1.5
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
name = "Podperson"
|
||||
id = "pod"
|
||||
default_color = "59CE00"
|
||||
species_traits = list(MUTCOLORS,EYECOLOR)
|
||||
species_traits = list(MUTCOLORS,EYECOLOR)
|
||||
attack_verb = "slash"
|
||||
attack_sound = 'sound/weapons/slice.ogg'
|
||||
miss_sound = 'sound/weapons/slashmiss.ogg'
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
//Updates the number of stored chemicals for powers
|
||||
handle_changeling()
|
||||
|
||||
if(stat != DEAD)
|
||||
handle_liver()
|
||||
|
||||
|
||||
if(stat != DEAD)
|
||||
return 1
|
||||
@@ -279,10 +282,6 @@
|
||||
radiation = max(radiation-3,0)
|
||||
adjustToxLoss(3)
|
||||
|
||||
/mob/living/carbon/handle_chemicals_in_body()
|
||||
if(reagents)
|
||||
reagents.metabolize(src)
|
||||
|
||||
|
||||
/mob/living/carbon/handle_stomach()
|
||||
set waitfor = 0
|
||||
@@ -387,3 +386,42 @@
|
||||
if(360.15 to INFINITY) //360.15 is 310.15 + 50, the temperature where you start to feel effects.
|
||||
//We totally need a sweat system cause it totally makes sense...~
|
||||
bodytemperature += min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers
|
||||
/////////
|
||||
//LIVER//
|
||||
/////////
|
||||
|
||||
/mob/living/carbon/proc/handle_liver()
|
||||
var/obj/item/organ/liver/liver = getorganslot("liver")
|
||||
if(liver)
|
||||
if(liver.damage >= 100)
|
||||
liver.failing = TRUE
|
||||
liver_failure()
|
||||
else
|
||||
liver.failing = FALSE
|
||||
|
||||
if(((!(NOLIVER in dna.species.species_traits)) && (!liver)))
|
||||
liver_failure()
|
||||
|
||||
/mob/living/carbon/proc/undergoing_liver_failure()
|
||||
var/obj/item/organ/liver/liver = getorganslot("liver")
|
||||
if(liver && liver.failing)
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/proc/return_liver_damage()
|
||||
var/obj/item/organ/liver/liver = getorganslot("liver")
|
||||
if(liver)
|
||||
return liver.damage
|
||||
|
||||
/mob/living/carbon/proc/applyLiverDamage(var/d)
|
||||
var/obj/item/organ/liver/L = getorganslot("liver")
|
||||
if(L)
|
||||
L.damage += d
|
||||
|
||||
/mob/living/carbon/proc/liver_failure()
|
||||
if(reagents.get_reagent_amount("corazone"))//corazone is processed here an not in the liver because a failing liver can't metabolize reagents
|
||||
reagents.remove_reagent("corazone", 0.4) //corazone slowly deletes itself.
|
||||
return
|
||||
adjustToxLoss(8)
|
||||
if(prob(30))
|
||||
to_chat(src, "<span class='notice'>You feel confused and nauseous...</span>")//actual symptoms of liver failure
|
||||
|
||||
|
||||
@@ -48,10 +48,6 @@
|
||||
domutcheck()
|
||||
..()
|
||||
|
||||
/mob/living/carbon/monkey/handle_chemicals_in_body()
|
||||
if(reagents)
|
||||
reagents.metabolize(src, can_overdose=1)
|
||||
|
||||
/mob/living/carbon/monkey/handle_breath_temperature(datum/gas_mixture/breath)
|
||||
if(abs(310.15 - breath.temperature) > 50)
|
||||
switch(breath.temperature)
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
internal_organs += new /obj/item/organ/tongue
|
||||
internal_organs += new /obj/item/organ/eyes
|
||||
internal_organs += new /obj/item/organ/ears
|
||||
internal_organs += new /obj/item/organ/liver
|
||||
internal_organs += new /obj/item/organ/stomach
|
||||
..()
|
||||
|
||||
/mob/living/carbon/monkey/movement_delay()
|
||||
|
||||
@@ -24,9 +24,6 @@
|
||||
if(stat != DEAD)
|
||||
//Mutations and radiation
|
||||
handle_mutations_and_radiation()
|
||||
if(stat != DEAD)
|
||||
//Chemicals in the body
|
||||
handle_chemicals_in_body()
|
||||
if(stat != DEAD)
|
||||
//Random events (vomiting etc)
|
||||
handle_random_events()
|
||||
@@ -63,9 +60,6 @@
|
||||
radiation = 0 //so radiation don't accumulate in simple animals
|
||||
return
|
||||
|
||||
/mob/living/proc/handle_chemicals_in_body()
|
||||
return
|
||||
|
||||
/mob/living/proc/handle_diginvis()
|
||||
if(!digitaldisguise)
|
||||
src.digitaldisguise = image(loc = src)
|
||||
|
||||
@@ -38,6 +38,8 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.drunkenness < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER)
|
||||
H.drunkenness = max((H.drunkenness + (sqrt(volume) * boozepwr * ALCOHOL_RATE)), 0) //Volume, power, and server alcohol rate effect how quickly one gets drunk
|
||||
var/obj/item/organ/liver/L = H.getorganslot("liver")
|
||||
H.applyLiverDamage((max(sqrt(volume) * boozepwr * L.alcohol_tolerance, 0))/10)
|
||||
return ..() || .
|
||||
|
||||
/datum/reagent/consumable/ethanol/reaction_obj(obj/O, reac_volume)
|
||||
|
||||
@@ -686,7 +686,7 @@
|
||||
taste_description = "dull toxin"
|
||||
|
||||
/datum/reagent/medicine/oculine/on_mob_life(mob/living/M)
|
||||
var/obj/item/organ/eyes/eyes = M.getorganslot("eyes_sight")
|
||||
var/obj/item/organ/eyes/eyes = M.getorganslot("eyes_sight")
|
||||
if (!eyes)
|
||||
return
|
||||
if(M.disabilities & BLIND)
|
||||
@@ -1129,7 +1129,7 @@
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/corazone
|
||||
// Heart attack code will not do as damage if corazone is present
|
||||
// Heart attack code will not do damage if corazone is present
|
||||
// because it's SPACE MAGIC ASPIRIN
|
||||
name = "Corazone"
|
||||
id = "corazone"
|
||||
|
||||
@@ -28,9 +28,8 @@
|
||||
/obj/item/organ/heart/attack_self(mob/user)
|
||||
..()
|
||||
if(!beating)
|
||||
visible_message("<span class='notice'>[user] squeezes [src] to \
|
||||
make it beat again!</span>", "<span class='notice'>You squeeze \
|
||||
[src] to make it beat again!</span>")
|
||||
user.visible_message("<span class='notice'>[user] squeezes [src] to \
|
||||
make it beat again!</span>","<span class='notice'>You squeeze [src] to make it beat again!</span>")
|
||||
Restart()
|
||||
addtimer(CALLBACK(src, .proc/stop_if_unowned), 80)
|
||||
|
||||
|
||||
66
code/modules/surgery/organs/liver.dm
Executable file
66
code/modules/surgery/organs/liver.dm
Executable file
@@ -0,0 +1,66 @@
|
||||
#define LIVER_DEFAULT_HEALTH 100 //amount of damage required for liver failure
|
||||
#define LIVER_DEFAULT_TOX_TOLERANCE 3 //amount of toxins the liver can filter out
|
||||
#define LIVER_DEFAULT_TOX_LETHALITY 0.5 //lower values lower how harmful toxins are to the liver
|
||||
|
||||
/obj/item/organ/liver
|
||||
name = "liver"
|
||||
icon_state = "liver"
|
||||
origin_tech = "biotech=3"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
zone = "chest"
|
||||
slot = "liver"
|
||||
desc = "Pairing suggestion: chianti and fava beans."
|
||||
var/damage = 0 //liver damage, 0 is no damage, damage=maxHealth causes liver failure
|
||||
var/alcohol_tolerance = ALCOHOL_RATE//affects how much damage the liver takes from alcohol
|
||||
var/failing //is this liver failing?
|
||||
var/maxHealth = LIVER_DEFAULT_HEALTH
|
||||
var/toxTolerance = LIVER_DEFAULT_TOX_TOLERANCE//maximum amount of toxins the liver can just shrug off
|
||||
var/toxLethality = LIVER_DEFAULT_TOX_LETHALITY//affects how much damage toxins do to the liver
|
||||
var/filterToxins = TRUE //whether to filter toxins
|
||||
|
||||
/obj/item/organ/liver/on_life()
|
||||
var/mob/living/carbon/C = owner
|
||||
|
||||
//slowly heal liver damage
|
||||
damage = max(0, damage - 0.1)
|
||||
if(damage > maxHealth)//cap liver damage
|
||||
damage = maxHealth
|
||||
|
||||
if(istype(C))
|
||||
if(!failing)//can't process reagents with a failing liver
|
||||
if(filterToxins)
|
||||
//handle liver toxin filtration
|
||||
var/toxamount
|
||||
var/static/list/listOfToxinsInThisBitch = typesof(/datum/reagent/toxin)
|
||||
for(var/datum/reagent/toxin/toxin in listOfToxinsInThisBitch)
|
||||
toxamount += C.reagents.get_reagent_amount(initial(toxin.id))
|
||||
|
||||
if(toxamount <= toxTolerance && toxamount > 0)
|
||||
for(var/datum/reagent/toxin/toxin in listOfToxinsInThisBitch)
|
||||
C.reagents.remove_reagent(initial(toxin.id), 1)
|
||||
else if(toxamount > toxTolerance)
|
||||
damage += toxamount*toxLethality
|
||||
|
||||
|
||||
//metabolize reagents
|
||||
C.reagents.metabolize(C, can_overdose=TRUE)
|
||||
|
||||
if(damage > 10 && prob(damage/3))//the higher the damage the higher the probability
|
||||
to_chat(C, "<span class='notice'>You feel [pick("nauseous", "dull pain in your lower body", "confused")].</span>")
|
||||
|
||||
/obj/item/organ/liver/prepare_eat()
|
||||
var/obj/S = ..()
|
||||
S.reagents.add_reagent("iron", 5)
|
||||
return S
|
||||
|
||||
/obj/item/organ/liver/fly
|
||||
name = "insectoid liver"
|
||||
icon_state = "liver-x" //xenomorph liver? It's just a black liver so it fits.
|
||||
desc = "A mutant liver designed to handle the unique diet of a flyperson."
|
||||
alcohol_tolerance = 0.007 //flies eat vomit, so a lower alcohol tolerance is perfect!
|
||||
|
||||
/obj/item/organ/liver/plasmaman
|
||||
name = "reagent processing crystal"
|
||||
icon_state = "pliver"
|
||||
desc = "A large crystal that is somehow capable of metabolizing chemicals, these are found in plasmamen."
|
||||
|
||||
@@ -113,6 +113,26 @@
|
||||
breathes = FALSE
|
||||
if(NOBLOOD in dna.species.species_traits)
|
||||
blooded = FALSE
|
||||
var/has_liver = (!(NOLIVER in dna.species.species_traits))
|
||||
var/has_stomach = (!(NOSTOMACH in dna.species.species_traits))
|
||||
|
||||
if(has_liver && !getorganslot("liver"))
|
||||
var/obj/item/organ/liver/LI
|
||||
|
||||
if(dna.species.mutantliver)
|
||||
LI = new dna.species.mutantliver()
|
||||
else
|
||||
LI = new()
|
||||
LI.Insert(src)
|
||||
|
||||
if(has_stomach && !getorganslot("stomach"))
|
||||
var/obj/item/organ/stomach/S
|
||||
|
||||
if(dna.species.mutantstomach)
|
||||
S = new dna.species.mutantstomach()
|
||||
else
|
||||
S = new()
|
||||
S.Insert(src)
|
||||
|
||||
if(breathes && !getorganslot("lungs"))
|
||||
var/obj/item/organ/lungs/L = new()
|
||||
|
||||
25
code/modules/surgery/organs/stomach.dm
Executable file
25
code/modules/surgery/organs/stomach.dm
Executable file
@@ -0,0 +1,25 @@
|
||||
/obj/item/organ/stomach
|
||||
name = "stomach"
|
||||
icon_state = "stomach"
|
||||
origin_tech = "biotech=4"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
zone = "chest"
|
||||
slot = "stomach"
|
||||
attack_verb = list("gored", "squished", "slapped", "digested")
|
||||
desc = "Onaka ga suite imasu."
|
||||
|
||||
/obj/item/organ/stomach/on_life()
|
||||
var/mob/living/carbon/human/H = owner
|
||||
|
||||
if(istype(H))
|
||||
H.dna.species.handle_digestion(H)
|
||||
|
||||
/obj/item/organ/stomach/fly
|
||||
name = "insectoid stomach"
|
||||
icon_state = "stomach-x" //xenomorph liver? It's just a black liver so it fits.
|
||||
desc = "A mutant stomach designed to handle the unique diet of a flyperson."
|
||||
|
||||
/obj/item/organ/stomach/plasmaman
|
||||
name = "digestive crystal"
|
||||
icon_state = "pstomach"
|
||||
desc = "A strange crystal that is responsible for metabolizing the unseen energy force that feeds plasmamen."
|
||||
Reference in New Issue
Block a user