mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 04:57:12 +01:00
minor external organ refactor (#16183)
Co-authored-by: SabreML <57483089+SabreML@users.noreply.github.com> Co-authored-by: dearmochi <1496804+dearmochi@users.noreply.github.com>
This commit is contained in:
co-authored by
SabreML
dearmochi
parent
192fa1815e
commit
31b336da64
+11
-5
@@ -1,11 +1,17 @@
|
||||
///////////////////ORGAN DEFINES///////////////////
|
||||
|
||||
// Organ defines.
|
||||
#define ORGAN_BROKEN 1
|
||||
#define ORGAN_ROBOT 2
|
||||
#define ORGAN_SPLINTED 4
|
||||
#define ORGAN_DEAD 8
|
||||
#define ORGAN_MUTATED 16
|
||||
#define ORGAN_BROKEN (1 << 0)
|
||||
#define ORGAN_ROBOT (1 << 1)
|
||||
#define ORGAN_SPLINTED (1 << 2)
|
||||
#define ORGAN_DEAD (1 << 3)
|
||||
#define ORGAN_MUTATED (1 << 4)
|
||||
#define ORGAN_INT_BLEEDING (1 << 5)
|
||||
#define ORGAN_DISFIGURED (1 << 6)
|
||||
|
||||
// For limb resistance flags
|
||||
#define CANNOT_BREAK (1 << 0)
|
||||
#define CANNOT_DISMEMBER (1 << 1)
|
||||
|
||||
#define PROCESS_ACCURACY 10
|
||||
|
||||
|
||||
@@ -168,6 +168,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
|
||||
#define TRAIT_FLASH_PROTECTION "flash_protection"
|
||||
#define TRAIT_NIGHT_VISION "night_vision"
|
||||
|
||||
#define TRAIT_NO_BONES "no_bones"
|
||||
#define TRAIT_STURDY_LIMBS "sturdy_limbs"
|
||||
|
||||
#define TRAIT_COMIC_SANS "comic_sans"
|
||||
#define TRAIT_NOFINGERPRINTS "no_fingerprints"
|
||||
#define TRAIT_SLOWDIGESTION "slow_digestion"
|
||||
|
||||
@@ -50,6 +50,9 @@ GLOBAL_LIST_INIT(traits_by_type, list(
|
||||
"TRAIT_FLASH_PROTECTION" = TRAIT_FLASH_PROTECTION,
|
||||
"TRAIT_NIGHT_VISION" = TRAIT_NIGHT_VISION,
|
||||
|
||||
"TRAIT_NO_BONES" = TRAIT_NO_BONES,
|
||||
"TRAIT_STURDY_LIMBS" = TRAIT_STURDY_LIMBS,
|
||||
|
||||
"TRAIT_COMIC_SANS" = TRAIT_COMIC_SANS,
|
||||
"TRAIT_NOFINGERPRINTS" = TRAIT_NOFINGERPRINTS,
|
||||
"TRAIT_SLOWDIGESTION" = TRAIT_SLOWDIGESTION,
|
||||
|
||||
@@ -305,7 +305,7 @@
|
||||
for(var/obj/item/organ/external/E in H.bodyparts)
|
||||
if(prob(10))
|
||||
E.mend_fracture()
|
||||
E.internal_bleeding = FALSE
|
||||
E.fix_internal_bleeding()
|
||||
heal_points--
|
||||
else if(issilicon(L))
|
||||
L.adjustBruteLoss(-3.5)
|
||||
@@ -339,7 +339,7 @@
|
||||
H.bodytemperature = H.dna.species.body_temperature
|
||||
for(var/thing in H.bodyparts)
|
||||
var/obj/item/organ/external/E = thing
|
||||
E.internal_bleeding = FALSE
|
||||
E.fix_internal_bleeding()
|
||||
E.mend_fracture()
|
||||
else
|
||||
owner.bodytemperature = BODYTEMP_NORMAL
|
||||
|
||||
@@ -346,7 +346,7 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
"<span class='cultitalic'>Your wounds have been healed. Now spread the blood to others.</span>")
|
||||
for(var/obj/item/organ/external/E in H.bodyparts)
|
||||
E.mend_fracture()
|
||||
E.internal_bleeding = FALSE
|
||||
E.fix_internal_bleeding()
|
||||
for(var/datum/disease/critical/crit in H.viruses) // cure all crit conditions
|
||||
crit.cure()
|
||||
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
for(var/obj/item/organ/external/E in H.bodyparts)
|
||||
if(prob(25))
|
||||
E.mend_fracture()
|
||||
E.internal_bleeding = FALSE
|
||||
E.fix_internal_bleeding()
|
||||
|
||||
return
|
||||
if(H.stat != DEAD)
|
||||
|
||||
@@ -306,7 +306,7 @@
|
||||
if(istype(E, /obj/item/organ/external/chest) && occupant.is_lung_ruptured())
|
||||
organData["lungRuptured"] = TRUE
|
||||
|
||||
if(E.internal_bleeding)
|
||||
if(E.status & ORGAN_INT_BLEEDING)
|
||||
organData["internalBleeding"] = TRUE
|
||||
|
||||
extOrganData.Add(list(organData))
|
||||
@@ -454,7 +454,7 @@
|
||||
var/splint = ""
|
||||
var/internal_bleeding = ""
|
||||
var/lung_ruptured = ""
|
||||
if(e.internal_bleeding)
|
||||
if(e.status & ORGAN_INT_BLEEDING)
|
||||
internal_bleeding = "<br>Internal bleeding"
|
||||
if(istype(e, /obj/item/organ/external/chest) && occupant.is_lung_ruptured())
|
||||
lung_ruptured = "Lung ruptured:"
|
||||
|
||||
@@ -225,7 +225,7 @@ REAGENT SCANNER
|
||||
to_chat(user, "<span class='warning'>Bone fractures detected. Advanced scanner required for location.</span>")
|
||||
break
|
||||
for(var/obj/item/organ/external/e in H.bodyparts)
|
||||
if(e.internal_bleeding)
|
||||
if(e.status & ORGAN_INT_BLEEDING)
|
||||
to_chat(user, "<span class='warning'>Internal bleeding detected. Advanced scanner required for location.</span>")
|
||||
break
|
||||
var/blood_id = H.get_blood_id()
|
||||
@@ -794,7 +794,7 @@ REAGENT SCANNER
|
||||
var/splint = ""
|
||||
var/internal_bleeding = ""
|
||||
var/lung_ruptured = ""
|
||||
if(e.internal_bleeding)
|
||||
if(e.status & ORGAN_INT_BLEEDING)
|
||||
internal_bleeding = "<br>Internal bleeding"
|
||||
if(istype(e, /obj/item/organ/external/chest) && target.is_lung_ruptured())
|
||||
lung_ruptured = "Lung ruptured:"
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
var/obj/item/organ/external/head/H = get_organ("head")
|
||||
|
||||
if(istype(H))
|
||||
H.disfigured = TRUE
|
||||
H.status |= ORGAN_DISFIGURED
|
||||
if(H.f_style)
|
||||
H.f_style = initial(H.f_style)
|
||||
if(H.h_style)
|
||||
@@ -150,7 +150,7 @@
|
||||
ADD_TRAIT(src, TRAIT_HUSK, source)
|
||||
var/obj/item/organ/external/head/H = bodyparts_by_name["head"]
|
||||
if(istype(H))
|
||||
H.disfigured = TRUE //makes them unknown without fucking up other stuff like admintools
|
||||
H.status |= ORGAN_DISFIGURED //makes them unknown without fucking up other stuff like admintools
|
||||
if(H.f_style)
|
||||
H.f_style = "Shaved" //we only change the icon_state of the hair datum, so it doesn't mess up their UI/UE
|
||||
if(H.h_style)
|
||||
@@ -172,7 +172,7 @@
|
||||
if(!HAS_TRAIT(src, TRAIT_HUSK))
|
||||
var/obj/item/organ/external/head/H = bodyparts_by_name["head"]
|
||||
if(istype(H))
|
||||
H.disfigured = FALSE
|
||||
H.status &= ~ORGAN_DISFIGURED
|
||||
update_body()
|
||||
update_mutantrace()
|
||||
UpdateAppearance() // reset hair from DNA
|
||||
|
||||
@@ -398,7 +398,7 @@
|
||||
if(print_flavor_text() && !skipface)
|
||||
if(get_organ("head"))
|
||||
var/obj/item/organ/external/head/H = get_organ("head")
|
||||
if(!H.disfigured)
|
||||
if(!(H.status & ORGAN_DISFIGURED))
|
||||
msg += "[print_flavor_text()]\n"
|
||||
|
||||
msg += "*---------*</span>"
|
||||
|
||||
@@ -484,7 +484,7 @@
|
||||
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
|
||||
/mob/living/carbon/human/proc/get_face_name()
|
||||
var/obj/item/organ/external/head = get_organ("head")
|
||||
if(!head || head.disfigured || cloneloss > 50 || !real_name || HAS_TRAIT(src, TRAIT_HUSK)) //disfigured. use id-name if possible
|
||||
if(!head || (head.status & ORGAN_DISFIGURED) || cloneloss > 50 || !real_name || HAS_TRAIT(src, TRAIT_HUSK)) //disfigured. use id-name if possible
|
||||
return "Unknown"
|
||||
return real_name
|
||||
|
||||
@@ -1269,16 +1269,19 @@
|
||||
item_flags[I] = I.flags
|
||||
I.flags = 0 // Temporary set the flags to 0
|
||||
|
||||
if(!transformation) //Distinguish between creating a mob and switching species
|
||||
dna.species.on_species_gain(src)
|
||||
|
||||
if(retain_damage)
|
||||
//Create a list of body parts which are damaged by burn or brute and save them to apply after new organs are generated. First we just handle external organs.
|
||||
var/bodypart_damages = list()
|
||||
//Loop through all external organs and save the damage states for brute and burn
|
||||
for(var/obj/item/organ/external/E in bodyparts)
|
||||
if(E.brute_dam == 0 && E.burn_dam == 0 && E.internal_bleeding == FALSE) //If there's no damage we don't bother remembering it.
|
||||
for(var/obj/item/organ/external/E as anything in bodyparts)
|
||||
if(E.brute_dam == 0 && E.burn_dam == 0 && !(E.status & ORGAN_INT_BLEEDING)) //If there's no damage we don't bother remembering it.
|
||||
continue
|
||||
var/brute = E.brute_dam
|
||||
var/burn = E.burn_dam
|
||||
var/IB = E.internal_bleeding
|
||||
var/IB = (E.status & ORGAN_INT_BLEEDING)
|
||||
var/obj/item/organ/external/OE = new E.type()
|
||||
var/stats = list(OE, brute, burn, IB)
|
||||
bodypart_damages += list(stats)
|
||||
@@ -1298,17 +1301,16 @@
|
||||
dna.species.create_organs(src)
|
||||
|
||||
//Apply relevant damages and variables to the new organs.
|
||||
for(var/B in bodyparts)
|
||||
var/obj/item/organ/external/E = B
|
||||
for(var/obj/item/organ/external/E as anything in bodyparts)
|
||||
for(var/list/part in bodypart_damages)
|
||||
var/obj/item/organ/external/OE = part[1]
|
||||
if((E.type == OE.type)) // Type has to be explicit, as right limbs are a child of left ones etc.
|
||||
var/brute = part[2]
|
||||
var/burn = part[3]
|
||||
var/IB = part[4]
|
||||
//Deal the damage to the new organ and then delete the entry to prevent duplicate checks
|
||||
var/IB = part[4] //Deal the damage to the new organ and then delete the entry to prevent duplicate checks
|
||||
if(IB)
|
||||
E.status |= ORGAN_INT_BLEEDING
|
||||
E.receive_damage(brute, burn, ignore_resists = TRUE)
|
||||
E.internal_bleeding = IB
|
||||
qdel(part)
|
||||
|
||||
for(var/O in internal_organs)
|
||||
@@ -1372,9 +1374,6 @@
|
||||
|
||||
dna.real_name = real_name
|
||||
|
||||
if (!transformation) //Distinguish between creating a mob and switching species
|
||||
dna.species.on_species_gain(src)
|
||||
|
||||
update_sight()
|
||||
|
||||
dna.species.handle_dna(src) //Give them whatever special dna business they got.
|
||||
|
||||
@@ -304,6 +304,7 @@ This function restores all organs.
|
||||
/mob/living/carbon/human/restore_all_organs()
|
||||
for(var/obj/item/organ/external/current_organ in bodyparts)
|
||||
current_organ.rejuvenate()
|
||||
current_organ.add_limb_flags()
|
||||
|
||||
/mob/living/carbon/human/proc/HealDamage(zone, brute, burn)
|
||||
var/obj/item/organ/external/E = get_organ(zone)
|
||||
|
||||
@@ -125,7 +125,7 @@ emp_act
|
||||
|
||||
/mob/living/carbon/human/check_projectile_dismemberment(obj/item/projectile/P, def_zone)
|
||||
var/obj/item/organ/external/affecting = get_organ(check_zone(def_zone))
|
||||
if(affecting && !affecting.cannot_amputate && affecting.get_damage() >= (affecting.max_damage - P.dismemberment))
|
||||
if(affecting && !(affecting.limb_flags & CANNOT_DISMEMBER) && affecting.get_damage() >= (affecting.max_damage - P.dismemberment))
|
||||
var/damtype = DROPLIMB_SHARP
|
||||
if(!P.sharp)
|
||||
switch(P.damage_type)
|
||||
|
||||
@@ -202,8 +202,9 @@
|
||||
for(var/name in H.bodyparts_by_name)
|
||||
H.bodyparts |= H.bodyparts_by_name[name]
|
||||
|
||||
for(var/obj/item/organ/external/O in H.bodyparts)
|
||||
O.owner = H
|
||||
for(var/obj/item/organ/external/E as anything in H.bodyparts)
|
||||
E.owner = H
|
||||
E.add_limb_flags()
|
||||
|
||||
/datum/species/proc/create_mutant_organs(mob/living/carbon/human/H)
|
||||
var/obj/item/organ/internal/ears/ears = H.get_int_organ(/obj/item/organ/internal/ears)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
icobase = 'icons/mob/human_races/r_golem.dmi'
|
||||
|
||||
species_traits = list(NO_BLOOD, NO_HAIR)
|
||||
inherent_traits = list(TRAIT_RESISTHEAT, TRAIT_NOBREATH, TRAIT_RESISTCOLD, TRAIT_RESISTHIGHPRESSURE, TRAIT_RESISTLOWPRESSURE, TRAIT_NOFIRE, TRAIT_CHUNKYFINGERS, TRAIT_RADIMMUNE, TRAIT_PIERCEIMMUNE, TRAIT_NOPAIN)
|
||||
inherent_traits = list(TRAIT_RESISTHEAT, TRAIT_NOBREATH, TRAIT_RESISTCOLD, TRAIT_RESISTHIGHPRESSURE, TRAIT_RESISTLOWPRESSURE, TRAIT_NOFIRE, TRAIT_CHUNKYFINGERS, TRAIT_RADIMMUNE, TRAIT_PIERCEIMMUNE, TRAIT_NOPAIN, TRAIT_NO_BONES, TRAIT_STURDY_LIMBS)
|
||||
inherent_biotypes = MOB_HUMANOID | MOB_MINERAL
|
||||
dies_at_threshold = TRUE
|
||||
speed_mod = 2
|
||||
@@ -33,18 +33,6 @@
|
||||
"adamantine_resonator" = /obj/item/organ/internal/adamantine_resonator
|
||||
) //Has standard darksight of 2.
|
||||
|
||||
has_limbs = list(
|
||||
"chest" = list("path" = /obj/item/organ/external/chest/unbreakable/sturdy),
|
||||
"groin" = list("path" = /obj/item/organ/external/groin/unbreakable/sturdy),
|
||||
"head" = list("path" = /obj/item/organ/external/head/unbreakable/sturdy),
|
||||
"l_arm" = list("path" = /obj/item/organ/external/arm/unbreakable/sturdy),
|
||||
"r_arm" = list("path" = /obj/item/organ/external/arm/right/unbreakable/sturdy),
|
||||
"l_leg" = list("path" = /obj/item/organ/external/leg/unbreakable/sturdy),
|
||||
"r_leg" = list("path" = /obj/item/organ/external/leg/right/unbreakable/sturdy),
|
||||
"l_hand" = list("path" = /obj/item/organ/external/hand/unbreakable/sturdy),
|
||||
"r_hand" = list("path" = /obj/item/organ/external/hand/right/unbreakable/sturdy),
|
||||
"l_foot" = list("path" = /obj/item/organ/external/foot/unbreakable/sturdy),
|
||||
"r_foot" = list("path" = /obj/item/organ/external/foot/right/unbreakable/sturdy))
|
||||
|
||||
suicide_messages = list(
|
||||
"is crumbling into dust!",
|
||||
@@ -123,7 +111,7 @@
|
||||
name = "Plasma Golem"
|
||||
skinned_type = /obj/item/stack/ore/plasma
|
||||
//Can burn and takes damage from heat
|
||||
inherent_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD, TRAIT_RESISTHIGHPRESSURE, TRAIT_RESISTLOWPRESSURE, TRAIT_CHUNKYFINGERS, TRAIT_RADIMMUNE, TRAIT_PIERCEIMMUNE, TRAIT_NOPAIN) //no RESISTHEAT, NOFIRE
|
||||
inherent_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD, TRAIT_RESISTHIGHPRESSURE, TRAIT_RESISTLOWPRESSURE, TRAIT_CHUNKYFINGERS, TRAIT_RADIMMUNE, TRAIT_PIERCEIMMUNE, TRAIT_NOPAIN, TRAIT_NO_BONES, TRAIT_STURDY_LIMBS) //no RESISTHEAT, NOFIRE
|
||||
golem_colour = rgb(170, 51, 221)
|
||||
info_text = "As a <span class='danger'>Plasma Golem</span>, you burn easily. Be careful, if you get hot enough while burning, you'll blow up!"
|
||||
heatmod = 0 //fine until they blow up
|
||||
@@ -301,7 +289,7 @@
|
||||
golem_colour = rgb(158, 112, 75)
|
||||
skinned_type = /obj/item/stack/sheet/wood
|
||||
//Can burn and take damage from heat
|
||||
inherent_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD, TRAIT_RESISTHIGHPRESSURE, TRAIT_RESISTLOWPRESSURE, TRAIT_CHUNKYFINGERS, TRAIT_RADIMMUNE, TRAIT_PIERCEIMMUNE, TRAIT_NOPAIN)
|
||||
inherent_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD, TRAIT_RESISTHIGHPRESSURE, TRAIT_RESISTLOWPRESSURE, TRAIT_CHUNKYFINGERS, TRAIT_RADIMMUNE, TRAIT_PIERCEIMMUNE, TRAIT_NOPAIN, TRAIT_NO_BONES, TRAIT_STURDY_LIMBS)
|
||||
inherent_biotypes = MOB_ORGANIC | MOB_HUMANOID | MOB_PLANT
|
||||
armor = 30
|
||||
burn_mod = 1.25
|
||||
@@ -575,7 +563,7 @@
|
||||
prefix = "Bananium"
|
||||
special_names = null
|
||||
unarmed_type = /datum/unarmed_attack/golem/bananium
|
||||
inherent_traits = list(TRAIT_RESISTHEAT, TRAIT_NOBREATH, TRAIT_RESISTCOLD, TRAIT_RESISTHIGHPRESSURE, TRAIT_RESISTLOWPRESSURE, TRAIT_NOFIRE, TRAIT_CHUNKYFINGERS, TRAIT_CLUMSY, TRAIT_COMIC_SANS, TRAIT_RADIMMUNE, TRAIT_PIERCEIMMUNE, TRAIT_NOPAIN)
|
||||
inherent_traits = list(TRAIT_RESISTHEAT, TRAIT_NOBREATH, TRAIT_RESISTCOLD, TRAIT_RESISTHIGHPRESSURE, TRAIT_RESISTLOWPRESSURE, TRAIT_NOFIRE, TRAIT_CHUNKYFINGERS, TRAIT_CLUMSY, TRAIT_COMIC_SANS, TRAIT_RADIMMUNE, TRAIT_PIERCEIMMUNE, TRAIT_NOPAIN, TRAIT_NO_BONES, TRAIT_STURDY_LIMBS)
|
||||
var/last_honk = 0
|
||||
var/honkooldown = 0
|
||||
var/last_banana = 0
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
female_cough_sounds = list('sound/effects/slime_squish.ogg')
|
||||
|
||||
species_traits = list(LIPS, IS_WHITELISTED, NO_CLONESCAN, EXOTIC_COLOR)
|
||||
inherent_traits = list(TRAIT_WATERBREATH)
|
||||
inherent_traits = list(TRAIT_WATERBREATH, TRAIT_NO_BONES)
|
||||
clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT | HAS_SOCKS
|
||||
bodyflags = HAS_SKIN_COLOR | NO_EYES
|
||||
dietflags = DIET_CARN
|
||||
@@ -46,19 +46,6 @@
|
||||
"lungs" = /obj/item/organ/internal/lungs/slime
|
||||
)
|
||||
mutantears = null
|
||||
has_limbs = list(
|
||||
"chest" = list("path" = /obj/item/organ/external/chest/unbreakable),
|
||||
"groin" = list("path" = /obj/item/organ/external/groin/unbreakable),
|
||||
"head" = list("path" = /obj/item/organ/external/head/unbreakable),
|
||||
"l_arm" = list("path" = /obj/item/organ/external/arm/unbreakable),
|
||||
"r_arm" = list("path" = /obj/item/organ/external/arm/right/unbreakable),
|
||||
"l_leg" = list("path" = /obj/item/organ/external/leg/unbreakable),
|
||||
"r_leg" = list("path" = /obj/item/organ/external/leg/right/unbreakable),
|
||||
"l_hand" = list("path" = /obj/item/organ/external/hand/unbreakable),
|
||||
"r_hand" = list("path" = /obj/item/organ/external/hand/right/unbreakable),
|
||||
"l_foot" = list("path" = /obj/item/organ/external/foot/unbreakable),
|
||||
"r_foot" = list("path" = /obj/item/organ/external/foot/right/unbreakable)
|
||||
)
|
||||
suicide_messages = list(
|
||||
"is melting into a puddle!",
|
||||
"is ripping out their own core!",
|
||||
@@ -203,6 +190,7 @@
|
||||
H.UpdateDamageIcon()
|
||||
H.adjust_nutrition(-SLIMEPERSON_HUNGERCOST)
|
||||
H.visible_message("<span class='notice'>[H] finishes regrowing [H.p_their()] missing [new_limb]!</span>", "<span class='notice'>You finish regrowing your [limb_select]</span>")
|
||||
new_limb.add_limb_flags()
|
||||
else
|
||||
to_chat(H, "<span class='warning'>You need to hold still in order to regrow a limb!</span>")
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
I.receive_damage(-5, FALSE)
|
||||
for(var/obj/item/organ/external/E in H.bodyparts)
|
||||
E.mend_fracture()
|
||||
E.internal_bleeding = FALSE
|
||||
E.fix_internal_bleeding()
|
||||
M.SetEyeBlind(0, FALSE)
|
||||
M.cure_nearsighted(null, FALSE)
|
||||
M.cure_blind(null, FALSE)
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/organ/external/head/head = H.get_organ("head")
|
||||
if(head)
|
||||
head.disfigured = FALSE
|
||||
head.status &= ~ORGAN_DISFIGURED
|
||||
return ..() | update_flags
|
||||
|
||||
/datum/reagent/medicine/rezadone
|
||||
@@ -161,7 +161,7 @@
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/organ/external/head/head = H.get_organ("head")
|
||||
if(head)
|
||||
head.disfigured = FALSE
|
||||
head.status &= ~ORGAN_DISFIGURED
|
||||
return ..() | update_flags
|
||||
|
||||
/datum/reagent/medicine/rezadone/overdose_process(mob/living/M, severity)
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
return 0
|
||||
if(affected.is_robotic())
|
||||
return 0
|
||||
if(affected.cannot_break)
|
||||
return 0
|
||||
if(affected.limb_flags & CANNOT_BREAK)
|
||||
return FALSE
|
||||
if(affected.status & ORGAN_BROKEN)
|
||||
return 1
|
||||
return 1
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
/datum/surgery_step/glue_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && !affected.is_robotic() && !(affected.cannot_break)
|
||||
return affected && !affected.is_robotic() && !(affected.limb_flags & CANNOT_BREAK)
|
||||
|
||||
/datum/surgery_step/glue_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
@@ -189,8 +189,7 @@
|
||||
"<span class='notice'> You put \the [tool] inside [target]'s [get_cavity(affected)] cavity.</span>" )
|
||||
if((tool.w_class > get_max_wclass(affected) / 2 && prob(50) && !affected.is_robotic()))
|
||||
to_chat(user, "<span class='warning'> You tear some vessels trying to fit the object in the cavity.</span>")
|
||||
affected.internal_bleeding = TRUE
|
||||
affected.owner.custom_pain("You feel something rip in your [affected.name]!")
|
||||
affected.cause_internal_bleeding()
|
||||
user.drop_item()
|
||||
affected.hidden = tool
|
||||
tool.forceMove(affected)
|
||||
|
||||
@@ -213,7 +213,9 @@
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(affected == null)
|
||||
return 0
|
||||
return !affected.cannot_amputate
|
||||
if(affected.limb_flags & CANNOT_DISMEMBER)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/generic/amputate/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
return 0
|
||||
if(affected.is_robotic())
|
||||
return 0
|
||||
if(affected.cannot_amputate)
|
||||
return 0
|
||||
if(affected.limb_flags & CANNOT_DISMEMBER)
|
||||
return FALSE
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
if(BP.open)
|
||||
temp_bleed += 0.5
|
||||
|
||||
if(BP.internal_bleeding)
|
||||
if(BP.status & ORGAN_INT_BLEEDING)
|
||||
internal_bleeding_rate += 0.5
|
||||
|
||||
bleed_rate = max(bleed_rate - 0.5, temp_bleed)//if no wounds, other bleed effects naturally decreases
|
||||
|
||||
@@ -26,9 +26,7 @@
|
||||
var/icon/mob_icon
|
||||
var/gendered_icon = 0
|
||||
var/limb_name
|
||||
var/disfigured = 0
|
||||
var/cannot_amputate
|
||||
var/cannot_break
|
||||
var/limb_flags
|
||||
var/s_tone = null
|
||||
var/s_col = null // If this is instantiated, it should be a hex value.
|
||||
var/list/child_icons = list()
|
||||
@@ -54,7 +52,6 @@
|
||||
|
||||
var/obj/item/hidden = null
|
||||
var/list/embedded_objects = list()
|
||||
var/internal_bleeding = FALSE
|
||||
var/amputation_point // Descriptive string used in amputation.
|
||||
var/can_grasp
|
||||
var/can_stand
|
||||
@@ -105,13 +102,22 @@
|
||||
|
||||
/obj/item/organ/external/New(mob/living/carbon/holder)
|
||||
..()
|
||||
var/mob/living/carbon/human/H = holder
|
||||
icobase = dna.species.icobase
|
||||
if(istype(H))
|
||||
if(ishuman(holder))
|
||||
var/mob/living/carbon/human/H = holder
|
||||
icobase = H.dna.species.icobase
|
||||
replaced(H)
|
||||
sync_colour_to_human(H)
|
||||
get_icon()
|
||||
|
||||
|
||||
/obj/item/organ/external/proc/add_limb_flags()
|
||||
if(HAS_TRAIT(owner, TRAIT_NO_BONES))
|
||||
limb_flags |= CANNOT_BREAK
|
||||
|
||||
if(HAS_TRAIT(owner, TRAIT_STURDY_LIMBS))
|
||||
limb_flags |= CANNOT_DISMEMBER
|
||||
|
||||
|
||||
/obj/item/organ/external/replaced(mob/living/carbon/human/target)
|
||||
owner = target
|
||||
loc = null
|
||||
@@ -227,7 +233,7 @@
|
||||
var/mob/living/carbon/owner_old = owner //Need to update health, but need a reference in case the below check cuts off a limb.
|
||||
//If limb took enough damage, try to cut or tear it off
|
||||
if(owner)
|
||||
if(!cannot_amputate && (brute_dam) >= (max_damage))
|
||||
if(!(limb_flags & CANNOT_DISMEMBER) && brute_dam >= max_damage)
|
||||
if(prob(brute / 2))
|
||||
if(sharp)
|
||||
droplimb(0, DROPLIMB_SHARP)
|
||||
@@ -297,8 +303,6 @@ This function completely restores a damaged organ to perfect condition.
|
||||
brute_dam = 0
|
||||
burn_dam = 0
|
||||
open = 0 //Closing all wounds.
|
||||
internal_bleeding = FALSE
|
||||
disfigured = FALSE
|
||||
|
||||
// handle internal organs
|
||||
for(var/obj/item/organ/internal/current_organ in internal_organs)
|
||||
@@ -408,9 +412,8 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(owner && (NO_BLOOD in owner.dna.species.species_traits))
|
||||
return
|
||||
var/local_damage = brute_dam + damage
|
||||
if(damage > 15 && local_damage > 30 && prob(damage) && !is_robotic())
|
||||
internal_bleeding = TRUE
|
||||
owner.custom_pain("You feel something rip in your [name]!")
|
||||
if(damage > 15 && local_damage > 30 && prob(damage))
|
||||
cause_internal_bleeding()
|
||||
|
||||
// new damage icon system
|
||||
// returns just the brute/burn damage code
|
||||
@@ -456,7 +459,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
//Handles dismemberment
|
||||
/obj/item/organ/external/proc/droplimb(clean, disintegrate, ignore_children, nodamage)
|
||||
|
||||
if(cannot_amputate || !owner)
|
||||
if(limb_flags & CANNOT_DISMEMBER || !owner)
|
||||
return
|
||||
|
||||
if(!disintegrate)
|
||||
@@ -605,7 +608,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(is_robotic())
|
||||
return //ORGAN_BROKEN doesn't have the same meaning for robot limbs
|
||||
|
||||
if((status & ORGAN_BROKEN) || cannot_break)
|
||||
if((status & ORGAN_BROKEN) || (limb_flags & CANNOT_BREAK))
|
||||
return
|
||||
if(owner)
|
||||
owner.visible_message(\
|
||||
@@ -638,6 +641,20 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
owner.handle_splints()
|
||||
return TRUE
|
||||
|
||||
/obj/item/organ/external/proc/cause_internal_bleeding()
|
||||
if(is_robotic())
|
||||
return
|
||||
if(HAS_TRAIT(owner, NO_BLOOD))
|
||||
return
|
||||
status |= ORGAN_INT_BLEEDING
|
||||
owner.custom_pain("You feel something rip in your [name]!")
|
||||
|
||||
/obj/item/organ/external/proc/fix_internal_bleeding()
|
||||
if(is_robotic())
|
||||
return
|
||||
status &= ~ORGAN_INT_BLEEDING
|
||||
perma_injury = 0
|
||||
|
||||
/obj/item/organ/external/robotize(company, make_tough = 0, convert_all = 1)
|
||||
..()
|
||||
//robot limbs take reduced damage
|
||||
@@ -654,7 +671,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(company && istext(company))
|
||||
set_company(company)
|
||||
|
||||
cannot_break = 1
|
||||
limb_flags |= CANNOT_BREAK
|
||||
get_icon()
|
||||
for(var/obj/item/organ/external/T in children)
|
||||
if((convert_all) || (T.type in convertable_children))
|
||||
@@ -738,13 +755,14 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
qdel(src)
|
||||
|
||||
/obj/item/organ/external/proc/disfigure()
|
||||
if(disfigured)
|
||||
if(status & ORGAN_DISFIGURED)
|
||||
return
|
||||
if(owner)
|
||||
owner.visible_message("<span class='warning'>You hear a sickening sound coming from \the [owner]'s [name] as it turns into a mangled mess!</span>", \
|
||||
"<span class='danger'>Your [name] becomes a mangled mess!</span>", \
|
||||
"<span class='warning'>You hear a sickening sound.</span>")
|
||||
disfigured = TRUE
|
||||
|
||||
status |= ORGAN_DISFIGURED
|
||||
|
||||
/obj/item/organ/external/is_primary_organ(mob/living/carbon/human/O = null)
|
||||
if(isnull(O))
|
||||
|
||||
@@ -255,9 +255,8 @@
|
||||
|
||||
/obj/item/organ/external/head/receive_damage(brute, burn, sharp, used_weapon = null, list/forbidden_limbs = list(), ignore_resists = FALSE, updating_health = TRUE)
|
||||
..()
|
||||
if(!disfigured)
|
||||
if(brute_dam + burn_dam > 50)
|
||||
disfigure()
|
||||
if(brute_dam + burn_dam > 50 && !(status & ORGAN_DISFIGURED))
|
||||
disfigure()
|
||||
|
||||
/obj/item/organ/external/head/proc/handle_alt_icon()
|
||||
if(alt_head && GLOB.alt_heads_list[alt_head])
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
/obj/item/organ/external/chest/unbreakable
|
||||
cannot_break = TRUE
|
||||
encased = null
|
||||
convertable_children = list(/obj/item/organ/external/groin/unbreakable)
|
||||
|
||||
/obj/item/organ/external/groin/unbreakable
|
||||
cannot_break = TRUE
|
||||
|
||||
/obj/item/organ/external/arm/unbreakable
|
||||
cannot_break = TRUE
|
||||
convertable_children = list(/obj/item/organ/external/hand/unbreakable)
|
||||
|
||||
/obj/item/organ/external/arm/right/unbreakable
|
||||
cannot_break = TRUE
|
||||
convertable_children = list(/obj/item/organ/external/hand/right/unbreakable)
|
||||
|
||||
/obj/item/organ/external/leg/unbreakable
|
||||
cannot_break = TRUE
|
||||
convertable_children = list(/obj/item/organ/external/foot/unbreakable)
|
||||
|
||||
/obj/item/organ/external/leg/right/unbreakable
|
||||
cannot_break = TRUE
|
||||
convertable_children = list(/obj/item/organ/external/foot/right/unbreakable)
|
||||
|
||||
/obj/item/organ/external/foot/unbreakable
|
||||
cannot_break = TRUE
|
||||
|
||||
/obj/item/organ/external/foot/right/unbreakable
|
||||
cannot_break = TRUE
|
||||
|
||||
/obj/item/organ/external/hand/unbreakable
|
||||
cannot_break = TRUE
|
||||
|
||||
/obj/item/organ/external/hand/right/unbreakable
|
||||
cannot_break = TRUE
|
||||
|
||||
/obj/item/organ/external/head/unbreakable
|
||||
cannot_break = TRUE
|
||||
encased = null
|
||||
|
||||
// Cannot dismember or break
|
||||
/obj/item/organ/external/chest/unbreakable/sturdy
|
||||
cannot_amputate = TRUE
|
||||
convertable_children = list(/obj/item/organ/external/groin/unbreakable/sturdy)
|
||||
|
||||
/obj/item/organ/external/groin/unbreakable/sturdy
|
||||
cannot_amputate = TRUE
|
||||
|
||||
/obj/item/organ/external/arm/unbreakable/sturdy
|
||||
cannot_amputate = TRUE
|
||||
convertable_children = list(/obj/item/organ/external/hand/unbreakable/sturdy)
|
||||
|
||||
/obj/item/organ/external/arm/right/unbreakable/sturdy
|
||||
cannot_amputate = TRUE
|
||||
convertable_children = list(/obj/item/organ/external/hand/right/unbreakable/sturdy)
|
||||
|
||||
/obj/item/organ/external/leg/unbreakable/sturdy
|
||||
cannot_amputate = TRUE
|
||||
convertable_children = list(/obj/item/organ/external/foot/unbreakable/sturdy)
|
||||
|
||||
/obj/item/organ/external/leg/right/unbreakable/sturdy
|
||||
cannot_amputate = TRUE
|
||||
convertable_children = list(/obj/item/organ/external/foot/right/unbreakable/sturdy)
|
||||
|
||||
/obj/item/organ/external/foot/unbreakable/sturdy
|
||||
cannot_amputate = TRUE
|
||||
|
||||
/obj/item/organ/external/foot/right/unbreakable/sturdy
|
||||
cannot_amputate = TRUE
|
||||
|
||||
/obj/item/organ/external/hand/unbreakable/sturdy
|
||||
cannot_amputate = TRUE
|
||||
|
||||
/obj/item/organ/external/hand/right/unbreakable/sturdy
|
||||
cannot_amputate = TRUE
|
||||
|
||||
/obj/item/organ/external/head/unbreakable/sturdy
|
||||
cannot_amputate = TRUE
|
||||
@@ -34,11 +34,11 @@
|
||||
var/mob/living/carbon/human/H = target
|
||||
var/obj/item/organ/external/affected = H.get_organ(user.zone_selected)
|
||||
if(!affected)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(affected.internal_bleeding)
|
||||
return 1
|
||||
return 0
|
||||
if(affected.status & ORGAN_INT_BLEEDING)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/surgery/debridement/can_start(mob/user, mob/living/carbon/target)
|
||||
if(ishuman(target))
|
||||
@@ -72,9 +72,10 @@
|
||||
/datum/surgery_step/fix_vein/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!affected)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
return affected.internal_bleeding
|
||||
if(affected.status & ORGAN_INT_BLEEDING)
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/fix_vein/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -88,7 +89,7 @@
|
||||
user.visible_message("<span class='notice'> [user] has patched the damaged vein in [target]'s [affected.name] with \the [tool].</span>", \
|
||||
"<span class='notice'> You have patched the damaged vein in [target]'s [affected.name] with \the [tool].</span>")
|
||||
|
||||
affected.internal_bleeding = FALSE
|
||||
affected.fix_internal_bleeding()
|
||||
if(ishuman(user) && prob(40))
|
||||
var/mob/living/carbon/human/U = user
|
||||
U.bloody_hands(target, 0)
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
/datum/surgery_step/reshape_face/end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
var/obj/item/organ/external/head/head = target.get_organ(target_zone)
|
||||
var/species_names = target.dna.species.name
|
||||
if(head.disfigured)
|
||||
head.disfigured = FALSE
|
||||
if(head.status & ORGAN_DISFIGURED)
|
||||
head.status &= ~ORGAN_DISFIGURED
|
||||
user.visible_message("[user] successfully restores [target]'s appearance!", "<span class='notice'>You successfully restore [target]'s appearance.</span>")
|
||||
else
|
||||
var/list/names = list()
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
return 0
|
||||
if(!affected.is_robotic())
|
||||
return 0
|
||||
if(affected.cannot_amputate)
|
||||
return 0
|
||||
if(affected.limb_flags & CANNOT_DISMEMBER)
|
||||
return FALSE
|
||||
return 1
|
||||
|
||||
//to do, moar surgerys or condense down ala manipulate organs.
|
||||
@@ -222,7 +222,7 @@
|
||||
|
||||
else if(implement_type in implements_heal_brute)
|
||||
current_type = "brute"
|
||||
if(!(affected.brute_dam > 0 || affected.disfigured))
|
||||
if(!(affected.brute_dam > 0 || (affected.status & ORGAN_DISFIGURED)))
|
||||
to_chat(user, "<span class='warning'>\The [affected] does not require welding repair!</span>")
|
||||
return -1
|
||||
if(tool.tool_behaviour == TOOL_WELDER)
|
||||
@@ -247,7 +247,7 @@
|
||||
user.visible_message("<span class='notice'> [user] finishes patching damage to [target]'s [affected.name] with \the [tool].</span>", \
|
||||
"<span class='notice'> You finish patching damage to [target]'s [affected.name] with \the [tool].</span>")
|
||||
affected.heal_damage(rand(30,50),0,1,1)
|
||||
affected.disfigured = FALSE
|
||||
affected.status &= ~ORGAN_DISFIGURED
|
||||
if("burn")
|
||||
user.visible_message("<span class='notice'> [user] finishes splicing cable into [target]'s [affected.name].</span>", \
|
||||
"<span class='notice'> You finishes splicing new cable into [target]'s [affected.name].</span>")
|
||||
|
||||
@@ -2480,7 +2480,6 @@
|
||||
#include "code\modules\surgery\organs\subtypes\standard.dm"
|
||||
#include "code\modules\surgery\organs\subtypes\tajaran.dm"
|
||||
#include "code\modules\surgery\organs\subtypes\unathi.dm"
|
||||
#include "code\modules\surgery\organs\subtypes\unbreakable.dm"
|
||||
#include "code\modules\surgery\organs\subtypes\vox.dm"
|
||||
#include "code\modules\surgery\organs\subtypes\vulpkanin.dm"
|
||||
#include "code\modules\surgery\organs\subtypes\wryn.dm"
|
||||
|
||||
Reference in New Issue
Block a user