Organ Update [Cloning isn't broken edition]
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Executable
+66
@@ -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()
|
||||
|
||||
Executable
+25
@@ -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