mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 14:37:04 +01:00
Added internal organs.
They can be hurt by their parent organ getting hurt. Ruptured lungs are now represented as damage to the lungs internal organ.
This commit is contained in:
@@ -38,6 +38,11 @@
|
||||
organs_by_name["l_foot"] = new/datum/organ/external/l_foot(organs_by_name["l_leg"])
|
||||
organs_by_name["r_foot"] = new/datum/organ/external/r_foot(organs_by_name["r_leg"])
|
||||
|
||||
new/datum/organ/internal/heart(src)
|
||||
new/datum/organ/internal/lungs(src)
|
||||
new/datum/organ/internal/liver(src)
|
||||
new/datum/organ/internal/kidney(src)
|
||||
|
||||
|
||||
// connect feet to legs and hands to arms
|
||||
/* var/datum/organ/external/organ = organs_by_name["l_hand"]
|
||||
@@ -899,26 +904,24 @@
|
||||
H.brainmob.mind.transfer_to(src)
|
||||
del(H)
|
||||
|
||||
var/datum/organ/external/chest/E = get_organ("chest")
|
||||
if(E.ruptured_lungs == 1)
|
||||
E.ruptured_lungs = 0
|
||||
for(var/datum/organ/internal/I in internal_organs)
|
||||
I.damage = 0
|
||||
|
||||
for (var/datum/disease/virus in viruses)
|
||||
virus.cure()
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/proc/is_lung_ruptured()
|
||||
var/datum/organ/external/chest/E = get_organ("chest")
|
||||
return E.ruptured_lungs
|
||||
|
||||
var/datum/organ/internal/lungs/L = internal_organs["lungs"]
|
||||
return L.is_bruised()
|
||||
|
||||
/mob/living/carbon/human/proc/rupture_lung()
|
||||
var/datum/organ/external/chest/E = get_organ("chest")
|
||||
var/datum/organ/internal/lungs/L = internal_organs["lungs"]
|
||||
|
||||
if(E.ruptured_lungs == 0)
|
||||
if(!L.is_bruised())
|
||||
src.custom_pain("You feel a stabbing pain in your chest!", 1)
|
||||
L.damage = L.min_bruised_damage
|
||||
|
||||
E.ruptured_lungs = 1
|
||||
/*
|
||||
/mob/living/carbon/human/verb/simulate()
|
||||
set name = "sim"
|
||||
|
||||
@@ -155,6 +155,16 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
//At this point, we dun care which blood we are adding to, as long as they get more blood.
|
||||
B.volume = B.volume + 0.1 // regenerate blood VERY slowly
|
||||
|
||||
// Damaged heart virtually reduces the blood volume, as the blood isn't
|
||||
// being pumped properly anymore.
|
||||
var/datum/organ/internal/heart/heart = internal_organs["heart"]
|
||||
switch(heart.damage)
|
||||
if(5 to 10)
|
||||
blood_volume *= 0.8
|
||||
if(11 to 20)
|
||||
blood_volume *= 0.5
|
||||
if(21 to INFINITY)
|
||||
blood_volume *= 0.3
|
||||
|
||||
switch(blood_volume)
|
||||
if(BLOOD_VOLUME_SAFE to 10000)
|
||||
@@ -1044,6 +1054,22 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
var/datum/organ/O = pick(organs)
|
||||
O.trace_chemicals[A.name] = 100
|
||||
|
||||
var/damaged_liver_process_accuracy = 10
|
||||
if(life_tick % damaged_liver_process_accuracy == 0)
|
||||
// Damaged liver means some chemicals are very dangerous
|
||||
var/datum/organ/internal/liver/liver = internal_organs["liver"]
|
||||
if(liver.damage >= liver.min_bruised_damage)
|
||||
for(var/datum/reagent/R in src.reagents.reagent_list)
|
||||
// Ethanol and all drinks are bad
|
||||
if(istype(R, /datum/reagent/ethanol))
|
||||
adjustToxLoss(0.1 * damaged_liver_process_accuracy)
|
||||
|
||||
// Can't cope with toxins at all
|
||||
for(var/toxin in list("toxin", "plasma", "sacid", "pacid", "cyanide", "lexorin", "amatoxin", "chloralhydrate", "carpotoxin", "zombiepowder", "mindbreaker"))
|
||||
if(src.reagents.has_reagent(toxin))
|
||||
adjustToxLoss(0.3 * damaged_liver_process_accuracy)
|
||||
|
||||
|
||||
updatehealth()
|
||||
|
||||
return //TODO: DEFERRED
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
affected.fracture()
|
||||
if (prob(40))
|
||||
user.visible_message("\red Rib pierces the lung!")
|
||||
affected.ruptured_lungs = 1
|
||||
target.rupture_lung()
|
||||
|
||||
/datum/surgery_step/ribcage/mend_ribcage
|
||||
required_tool = /obj/item/weapon/bonegel
|
||||
@@ -168,9 +168,9 @@
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// LUNG SURGERY //
|
||||
// CHEST INTERNAL ORGAN SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
/datum/surgery_step/ribcage/fix_lungs
|
||||
/datum/surgery_step/ribcage/fix_chest_internal
|
||||
required_tool = /obj/item/weapon/scalpel
|
||||
allowed_tools = list(/obj/item/weapon/shard, /obj/item/weapon/kitchenknife)
|
||||
|
||||
@@ -178,19 +178,59 @@
|
||||
max_duration = 90
|
||||
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target.is_lung_ruptured() && target.op_stage.ribcage == 2
|
||||
var/is_chest_organ_damaged = 0
|
||||
var/datum/organ/external/chest/chest = target.get_organ("chest")
|
||||
for(var/datum/organ/internal/I in chest.internal_organs) if(I.damage > 0)
|
||||
is_chest_organ_damaged = 1
|
||||
break
|
||||
return ..() && is_chest_organ_damaged && target.op_stage.ribcage == 2
|
||||
|
||||
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] starts mending the rupture in [target]'s lungs with \the [tool].", \
|
||||
"You start mending the rupture in [target]'s lungs with \the [tool]." )
|
||||
var/datum/organ/internal/heart/heart = target.internal_organs["heart"]
|
||||
var/datum/organ/internal/lungs/lungs = target.internal_organs["lungs"]
|
||||
var/datum/organ/internal/liver/liver = target.internal_organs["liver"]
|
||||
var/datum/organ/internal/liver/kidney = target.internal_organs["kidney"]
|
||||
|
||||
if(lungs.damage > 0)
|
||||
user.visible_message("[user] starts mending the rupture in [target]'s lungs with \the [tool].", \
|
||||
"You start mending the rupture in [target]'s lungs with \the [tool]." )
|
||||
if(heart.damage > 0)
|
||||
user.visible_message("[user] starts mending the bruises on [target]'s heart with \the [tool].", \
|
||||
"You start mending the bruises on [target]'s heart with \the [tool]." )
|
||||
if(liver.damage > 0)
|
||||
user.visible_message("[user] starts mending the bruises on [target]'s liver with \the [tool].", \
|
||||
"You start mending the bruises on [target]'s liver with \the [tool]." )
|
||||
if(kidney.damage > 0)
|
||||
user.visible_message("[user] starts mending the bruises on [target]'s liver with \the [tool].", \
|
||||
"You start mending the bruises on [target]'s kidney with \the [tool]." )
|
||||
target.custom_pain("The pain in your chest is living hell!",1)
|
||||
..()
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ("chest")
|
||||
user.visible_message("\blue [user] mends the rupture in [target]'s lungs with \the [tool].", \
|
||||
"\blue You mend the rupture in [target]'s lungs with \the [tool]." )
|
||||
affected.ruptured_lungs = 0
|
||||
var/datum/organ/internal/heart/heart = target.internal_organs["heart"]
|
||||
var/datum/organ/internal/lungs/lungs = target.internal_organs["lungs"]
|
||||
var/datum/organ/internal/liver/liver = target.internal_organs["liver"]
|
||||
var/datum/organ/internal/liver/kidney = target.internal_organs["kidney"]
|
||||
|
||||
if(lungs.damage > 0)
|
||||
user.visible_message("\blue [user] mends the rupture in [target]'s lungs with \the [tool].", \
|
||||
"\blue You mend the rupture in [target]'s lungs with \the [tool]." )
|
||||
lungs.damage = 0
|
||||
|
||||
if(heart.damage > 0)
|
||||
user.visible_message("\blue [user] treats the bruises on [target]'s heart with \the [tool].", \
|
||||
"\blue You treats the bruises on [target]'s heart with \the [tool]." )
|
||||
heart.damage = 0
|
||||
|
||||
if(liver.damage > 0)
|
||||
user.visible_message("\blue [user] treats the bruises on [target]'s liver with \the [tool].", \
|
||||
"\blue You treats the bruises on [target]'s liver with \the [tool]." )
|
||||
liver.damage = 0
|
||||
|
||||
if(kidney.damage > 0)
|
||||
user.visible_message("\blue [user] treats the bruises on [target]'s kidney with \the [tool].", \
|
||||
"\blue You treats the bruises on [target]'s kidney with \the [tool]." )
|
||||
kidney.damage = 0
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ("chest")
|
||||
|
||||
Reference in New Issue
Block a user