Well it compiles; just synthtissue and TongueLoss now.

This commit is contained in:
Fermi
2019-09-19 01:14:12 +01:00
parent dfa40a4b22
commit 107dd67cbe
29 changed files with 107 additions and 106 deletions

View File

@@ -340,7 +340,7 @@
if(istype(C))
var/obj/item/organ/brain/B = C.getorganslot(ORGAN_SLOT_BRAIN)
if(B)
B.vital = FALSE
B.organ_flags &= ~ORGAN_VITAL
B.decoy_override = TRUE
update_changeling_icons_added()
return

View File

@@ -35,7 +35,7 @@
B = new C.dna.species.mutant_brain()
else
B = new()
B.vital = FALSE
B.organ_flags &= ~ORGAN_VITAL
B.decoy_override = TRUE
B.Insert(C)
if(ishuman(user))

View File

@@ -7,7 +7,7 @@
layer = ABOVE_MOB_LAYER
zone = BODY_ZONE_HEAD
slot = ORGAN_SLOT_BRAIN
organ_flags |= ORGAN_VITAL
organ_flags = ORGAN_VITAL
attack_verb = list("attacked", "slapped", "whacked")
///The brain's organ variables are significantly more different than the other organs, with half the decay rate for balance reasons, and twice the maxHealth
decay_factor = STANDARD_ORGAN_DECAY / 2 //30 minutes of decaying to result in a fully damaged brain, since a fast decay rate would be unfun gameplay-wise
@@ -16,7 +16,7 @@
low_threshold = 45
high_threshold = 120
var/mob/living/brain/brainmob = null
var/organ_flags & ORGAN_FAILING = FALSE //whether the brain organ is damaged.
var/brain_death = FALSE //if the brainmob was intentionally killed by attacking the brain after removal, or by severe braindamage
var/decoy_override = FALSE //I apologize to the security players, and myself, who abused this, but this is going to go.
//two variables necessary for calculating whether we get a brain trauma or not
var/damage_delta = 0
@@ -103,16 +103,16 @@
if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent("neurine")) //Neurine fixes dead brains
. = TRUE //don't do attack animation.
var/cached_Bdamage = brainmob?.health
var/cached_Bdamage = brainmob?.health
var/datum/reagent/medicine/neurine/N = reagents.has_reagent("neurine")
if(O.reagents.has_reagent("mannitol")//Just a quick way to bolster the effects if someone mixes up a batch.
if(O.reagents.has_reagent("mannitol"))//Just a quick way to bolster the effects if someone mixes up a batch.
N.volume *= 1.5
if(!O.reagents.has_reagent("neurine", 10))
to_chat(user, "<span class='warning'>There's not enough neurine in [O] to restore [src]!</span>")
return
user.visible_message("<span class='notice'>[user] starts to pour the contents of [O] onto [src].</span>", "<span class='notice'>You start to slowly pour the contents of [O] onto [src].</span>")
if(!do_after(user, 60, TRUE, src))
to_chat(user, "<span class='warning'>You failed to pour [O] onto [src]!</span>")
@@ -123,10 +123,10 @@
O.reagents.clear_reagents()
if(cached_Bdamage) //Fixing dead brains yeilds a trauma
if(cached_Bdamage <= HEALTH_THRESHOLD_DEAD && brainmob.health > HEALTH_THRESHOLD_DEAD)
if((cached_Bdamage <= HEALTH_THRESHOLD_DEAD) && (brainmob.health > HEALTH_THRESHOLD_DEAD))
if(prob(90))
gain_trauma_type(BRAIN_TRAUMA_MILD)
if else(prob(50))
else if(prob(50))
gain_trauma_type(BRAIN_TRAUMA_SEVERE)
else
gain_trauma_type(BRAIN_TRAUMA_SPECIAL)
@@ -136,8 +136,8 @@
. = TRUE //don't do attack animation.
var/datum/reagent/medicine/mannitol/M = reagents.has_reagent("mannitol")
if(brain_death || brainmob?.health <= HEALTH_THRESHOLD_DEAD) //if the brain is fucked anyway, do nothing
to_chat(user, "<span class='warning'>[src] is far too damaged, you'll have to use neurine on it!</span>")
return
to_chat(user, "<span class='warning'>[src] is far too damaged, you'll have to use neurine on it!</span>")
return
if(!O.reagents.has_reagent("mannitol", 10))
to_chat(user, "<span class='warning'>There's not enough mannitol in [O] to restore [src]!</span>")
@@ -152,13 +152,13 @@
setOrganDamage((damage - (0.05 * maxHealth)*M.volume)) //heals a small amount, and by using "setorgandamage", we clear the failing variable if that was up
O.reagents.clear_reagents()
return
/obj/item/organ/brain/examine(mob/user)//BUG_PROBABLE_CAUSE to_chats changed to . +=
/obj/item/organ/brain/examine(mob/user)//BUG_PROBABLE_CAUSE to_chats changed to . +=
. = ..()
if(suicided)
if(user.suiciding)
. += "<span class='info'>It's started turning slightly grey. They must not have been able to handle the stress of it all.</span>"
else if(brainmob)
if(brainmob.get_ghost(FALSE, TRUE))
@@ -247,6 +247,10 @@
owner.death()
brain_death = TRUE
/obj/item/organ/brain/on_death()
if(damage <= BRAIN_DAMAGE_DEATH) //rip
brain_death = FALSE
/obj/item/organ/brain/process() //needs to run in life AND death
..()
//if we're not more injured than before, return without gambling for a trauma

View File

@@ -20,7 +20,7 @@
else if(istype(loc, /obj/item/organ/brain))
BR = loc
if(BR)
BR.organ_flags & ORGAN_FAILING = 1 //beaten to a pulp
BR.brain_death = TRUE
/mob/living/brain/proc/handle_emp_damage()
if(emp_damage)

View File

@@ -814,7 +814,6 @@
reagents.clear_reagents()
var/obj/item/organ/brain/B = getorgan(/obj/item/organ/brain)
if(B)
B.organ_flags & ORGAN_FAILING = FALSE
B.brain_death = FALSE
for(var/thing in diseases)
var/datum/disease/D = thing

View File

@@ -405,16 +405,16 @@
if(istype(ears) && (deafen_pwr || damage_pwr))
var/ear_damage = damage_pwr * effect_amount
var/deaf = max(ears.deaf, deafen_pwr * effect_amount)
var/deaf = deafen_pwr * effect_amount
adjustEarDamage(ear_damage,deaf)
if(ears.ear_damage >= 15)
if(ears.damage >= 15)
to_chat(src, "<span class='warning'>Your ears start to ring badly!</span>")
if(prob(ears.ear_damage - 5))
if(prob(ears.damage - 5))
to_chat(src, "<span class='userdanger'>You can't hear anything!</span>")
ears.ear_damage = min(ears.ear_damage, UNHEALING_EAR_DAMAGE)
ears.damage = min(ears.damage, ears.maxHealth)
// you need earmuffs, inacusiate, or replacement
else if(ears.ear_damage >= 5)
else if(ears.damage >= 5)
to_chat(src, "<span class='warning'>Your ears start to ring!</span>")
SEND_SOUND(src, sound('sound/weapons/flash_ring.ogg',0,1,0,250))
return effect_amount //how soundbanged we are

View File

@@ -147,15 +147,15 @@
if(O)
return O.damage
/mob/living/carbon/adjustAllOrganLoss(amount, maximum)
for(var/o in internal_organs)
/mob/living/carbon/proc/adjustAllOrganLoss(amount, maximum)
for(var/obj/item/organ/O in internal_organs)
if(O && !(status_flags & GODMODE))
continue
if(!maximum)
maximum = O.maxHealth
O.applyOrganDamage(amount, maximum)
O.onDamage(amount, maximum)
////////////////////////////////////////////

View File

@@ -49,7 +49,6 @@
//Start of a breath chain, calls breathe()
/mob/living/carbon/handle_breathing(times_fired)
/mob/living/carbon/handle_breathing(times_fired)
var/next_breath = 4
var/obj/item/organ/lungs/L = getorganslot(ORGAN_SLOT_LUNGS)
var/obj/item/organ/heart/H = getorganslot(ORGAN_SLOT_HEART)

View File

@@ -500,10 +500,12 @@
mood.sanity = SANITY_GREAT
mood.update_mood()
//Heal all organs
if(internal_organs)
for(var/organ in internal_organs)
var/obj/item/organ/O = organ
O.setOrganDamage(0)
if(iscarbon(src))
var/mob/living/carbon/C = src
if(C.internal_organs)
for(var/organ in C.internal_organs)
var/obj/item/organ/O = organ
O.setOrganDamage(0)
//proc called by revive(), to check if we can actually ressuscitate the mob (we don't want to revive him and have him instantly die again)

View File

@@ -75,7 +75,7 @@
O.setOxyLoss(getOxyLoss(), 0)
O.setCloneLoss(getCloneLoss(), 0)
O.adjustFireLoss(getFireLoss(), 0)
O.setBrainLoss(getOrganLoss(ORGAN_SLOT_BRAIN), 0)
O.setOrganLoss(ORGAN_SLOT_BRAIN, getOrganLoss(ORGAN_SLOT_BRAIN), 0)
O.adjustStaminaLoss(getStaminaLoss(), 0)//CIT CHANGE - makes monkey transformations inherit stamina
O.updatehealth()
O.radiation = radiation
@@ -236,7 +236,7 @@
O.setOxyLoss(getOxyLoss(), 0)
O.setCloneLoss(getCloneLoss(), 0)
O.adjustFireLoss(getFireLoss(), 0)
O.setBrainLoss(getOrganLoss(ORGAN_SLOT_BRAIN), 0)
O.setOrganLoss(ORGAN_SLOT_BRAIN, getOrganLoss(ORGAN_SLOT_BRAIN), 0)
O.adjustStaminaLoss(getStaminaLoss(), 0)//CIT CHANGE - makes monkey transformations inherit stamina
O.updatehealth()
O.radiation = radiation

View File

@@ -44,7 +44,7 @@
M.heal_bodypart_damage(5,5)
M.adjustToxLoss(-5, 0, TRUE)
M.hallucination = 0
M.setBrainLoss(0)
M.setOrganLoss(ORGAN_SLOT_BRAIN, 0)
REMOVE_TRAITS_NOT_IN(M, list(SPECIES_TRAIT, ROUNDSTART_TRAIT, ORGAN_TRAIT))
M.set_blurriness(0)
M.set_blindness(0)
@@ -856,16 +856,16 @@
if(M.notify_ghost_cloning(source = M))
spawn (100) //so the ghost has time to re-enter
return
else
M.adjustOxyLoss(-20, 0)
M.adjustToxLoss(-20, 0)
var/mob/living/carbon/H = M
for(var/organ in H.internal_organs)
var/obj/item/organ/O = organ
O.setOrganDamage(0)
O.setOrganDamage(0)
M.updatehealth()
if(M.revive())
M.emote("gasp")
log_combat(M, M, "revived", src)

View File

@@ -198,7 +198,7 @@
if(host_mob.getOrganLoss(ORGAN_SLOT_BRAIN))
return ..()
return FALSE
/datum/nanite_program/brain_heal_advanced/active_effect()
host_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -2, TRUE)
if(iscarbon(host_mob) && prob(10))
@@ -232,7 +232,7 @@
if(!C.getorgan(/obj/item/organ/heart)) //what are we even shocking
return FALSE
var/obj/item/organ/brain/BR = C.getorgan(/obj/item/organ/brain)
if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || BR.suicided)
if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || C.suiciding)
return FALSE
if(C.get_ghost())
return FALSE

View File

@@ -4,7 +4,7 @@
/datum/surgery/graft_synthtissue
name = "Graft_synthtissue"
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
species = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_CHEST)
steps = list(
/datum/surgery_step/incise,
@@ -16,8 +16,8 @@
/datum/surgery_step/close
)
//repair lungs step
/datum/surgery_step/repair_synthtissue
//repair organs
/datum/surgery_step/graft_synthtissue
name = "graft synthtissue"
implements = list(/obj/item/hemostat = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15)
repeatable = TRUE
@@ -25,10 +25,8 @@
chems_needed = list("synthtissue")
var/obj/item/organ/chosen_organ
//Repair lungs
/datum/surgery_step/repair_synthtissue/preop(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(implement_type in implements_extract)
current_type = "insert"
/datum/surgery_step/graft_synthtissue/preop(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(implement_type in implements)
var/list/organs = target.getorganszone(target_zone)
if(!organs.len)
to_chat(user, "<span class='notice'>There are no targetable organs in [target]'s [parse_zone(target_zone)]!</span>")
@@ -39,24 +37,23 @@
organs -= O
organs[O.name] = O
chosen_organ = input("Remove which organ?", "Surgery", null, null) as null|anything in organs
if(chosen_organ.organ_flags & ORGAN_FAILING))
if(chosen_organ.organ_flags & ORGAN_FAILING)
to_chat(user, "<span class='notice'>[target]'s [chosen_organ] is too damaged to repair graft onto!</span>")
return -1
user.visible_message("[user] begins to repair damaged portions of [target]'s [chosen_organ].</span>")
/datum/surgery_step/repair_synthtissue/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
/datum/surgery_step/graft_synthtissue/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if((!chosen_organ)||(chosen_organ.organ_flags & ORGAN_FAILING))
to_chat(user, "[target] has no [chosen_organ] capable of repair!")
else
user.visible_message("[user] successfully repairs part of [target]'s [chosen_organ].", "<span class='notice'>You succeed in repairing parts of [target]'s [chosen_organ].</span>")
chosen_organ.applyOrganDamage(-10)
/datum/surgery_step/repair_synthtissue/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
/datum/surgery_step/graft_synthtissue/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if((!chosen_organ)||(chosen_organ.organ_flags & ORGAN_FAILING))
to_chat(user, "[target] has no [chosen_organ] capable of repair!")
else
user.visible_message("<span class='warning'>[user] accidentally damages part of [target]'s [chosen_organ]!</span>", "<span class='warning'>You damage [target]'s [chosen_organ]! Apply more synthtissue if it's run out.</span>")
chosen_organ.applyOrganDamage(10)
return FALSE

View File

@@ -103,7 +103,7 @@
/obj/item/organ/cyberimp/brain/anti_stun/on_life()
..()
if((crit_fail || !(organ_flags & ORGAN_FAILING)) && amount > 0)
if(crit_fail || !(organ_flags & ORGAN_FAILING))
return
owner.adjustStaminaLoss(-3.5) //Citadel edit, makes it more useful in Stamina based combat
if(owner.AmountStun() > STUN_SET_AMOUNT)

View File

@@ -15,10 +15,8 @@
healing_factor = STANDARD_ORGAN_HEALING
decay_factor = STANDARD_ORGAN_DECAY
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

View File

@@ -416,13 +416,13 @@
var/cold_modifier = H.dna.species.coldmod
if(breath_temperature < cold_level_3_threshold)
H.apply_damage_type(cold_level_3_damage*cold_modifier, cold_damage_type)
adjustOrganLoss(ORGAN_SLOT_LUNG, (cold_level_3_damage*cold_modifier*2))
H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (cold_level_3_damage*cold_modifier*2))
if(breath_temperature > cold_level_3_threshold && breath_temperature < cold_level_2_threshold)
H.apply_damage_type(cold_level_2_damage*cold_modifier, cold_damage_type)
adjustOrganLoss(ORGAN_SLOT_LUNG, (cold_level_2_damage*cold_modifier*2))
H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (cold_level_2_damage*cold_modifier*2))
if(breath_temperature > cold_level_2_threshold && breath_temperature < cold_level_1_threshold)
H.apply_damage_type(cold_level_1_damage*cold_modifier, cold_damage_type)
adjustOrganLoss(ORGAN_SLOT_LUNG, (cold_level_1_damage*cold_modifier*2))
H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (cold_level_1_damage*cold_modifier*2))
if(breath_temperature < cold_level_1_threshold)
if(prob(20))
to_chat(H, "<span class='warning'>You feel [cold_message] in your [name]!</span>")
@@ -431,13 +431,13 @@
var/heat_modifier = H.dna.species.heatmod
if(breath_temperature > heat_level_1_threshold && breath_temperature < heat_level_2_threshold)
H.apply_damage_type(heat_level_1_damage*heat_modifier, heat_damage_type)
adjustOrganLoss(ORGAN_SLOT_LUNG, (heat_level_1_damage*heat_modifier*2))
H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (heat_level_1_damage*heat_modifier*2))
if(breath_temperature > heat_level_2_threshold && breath_temperature < heat_level_3_threshold)
H.apply_damage_type(heat_level_2_damage*heat_modifier, heat_damage_type)
adjustOrganLoss(ORGAN_SLOT_LUNG, (heat_level_2_damage*heat_modifier*2))
H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (heat_level_2_damage*heat_modifier*2))
if(breath_temperature > heat_level_3_threshold)
H.apply_damage_type(heat_level_3_damage*heat_modifier, heat_damage_type)
adjustOrganLoss(ORGAN_SLOT_LUNG, (heat_level_3_damage*heat_modifier*2))
H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (heat_level_3_damage*heat_modifier*2))
if(breath_temperature > heat_level_1_threshold)
if(prob(20))
to_chat(H, "<span class='warning'>You feel [hot_message] in your [name]!</span>")

View File

@@ -29,17 +29,6 @@
var/high_threshold_cleared
var/low_threshold_cleared
/obj/item/organ/proc/Assemble_Failure_Message() //need to assemble a failure message since we can't have variables be based off of the same object's variables
var/name_length
//if no unique failure message is set, output the generic one, otherwise give the one we have set
if(!Unique_Failure_Msg)
name_length = lentext(name)
if(name[name_length] == "s") //plural case, done without much sanitization since I don't know any organ that ends with an "s" that isn't plural at the moment
Unique_Failure_Msg = "<span class='danger'>Subject's [name] are too damaged to function, and needs to be replaced or fixed!</span>"
else
Unique_Failure_Msg = "<span class='danger'>Subject's [name] is too damaged to function, and needs to be replaced or fixed!</span>"
return Unique_Failure_Msg
/obj/item/organ/proc/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE)
if(!iscarbon(M) || owner == M)
return
@@ -94,8 +83,8 @@
var/healing_amount = -(maxHealth * healing_factor)
///Damage decrements again by a percent of its maxhealth, up to a total of 4 extra times depending on the owner's health
healing_amount -= owner.satiety > 0 ? 4 * healing_factor * owner.satiety / MAX_SATIETY : 0
applyOrganDamage(healing_amount) //FERMI_TWEAK
applyOrganDamage(healing_amount) //to FERMI_TWEAK
/obj/item/organ/examine(mob/user)
. = ..()
if(organ_flags & ORGAN_FAILING)

View File

@@ -25,9 +25,6 @@
if(!(organ_flags & ORGAN_FAILING))
H.dna.species.handle_digestion(H)
handle_disgust(H)
if(Nutri)
if(damage < low_threshold)
return
@@ -44,7 +41,7 @@
H.vomit(damage)
to_chat(H, "<span class='warning'>Your stomach reels in pain as you're incapable of holding down all that food!</span>")
/obj/item/organ/stomach/proc/handle_disgust(mob/living/carbon/human/H)
if(H.disgust)

View File

@@ -10,8 +10,7 @@
var/list/languages_possible
var/say_mod = null
var/taste_sensitivity = 15 // lower is more sensitive.
var/maxHealth = TONGUE_MAX_HEALTH
var/damage = 0
maxHealth = TONGUE_MAX_HEALTH
var/modifies_speech = FALSE
var/static/list/languages_possible_base = typecacheof(list(
/datum/language/common,