mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
Moved same code into single organ helper to handle embedding.
Conflicts: code/modules/mob/living/carbon/human/human_damage.dm code/modules/mob/living/carbon/human/human_defense.dm code/modules/organs/organ_external.dm
This commit is contained in:
@@ -339,7 +339,7 @@ This function completely restores a damaged organ to perfect condition.
|
||||
|
||||
//Updating germ levels. Handles organ germ levels and necrosis.
|
||||
/*
|
||||
The INFECTION_LEVEL values defined in setup.dm control the time it takes to reach the different
|
||||
The INFECTION_LEVEL values defined in setup.dm control the time it takes to reach the different
|
||||
infection levels. Since infection growth is exponential, you can adjust the time it takes to get
|
||||
from one germ_level to another using the rough formula:
|
||||
|
||||
@@ -351,10 +351,10 @@ the actual time is dependent on RNG.
|
||||
|
||||
INFECTION_LEVEL_ONE below this germ level nothing happens, and the infection doesn't grow
|
||||
INFECTION_LEVEL_TWO above this germ level the infection will start to spread to internal and adjacent organs
|
||||
INFECTION_LEVEL_THREE above this germ level the player will take additional toxin damage per second, and will die in minutes without
|
||||
INFECTION_LEVEL_THREE above this germ level the player will take additional toxin damage per second, and will die in minutes without
|
||||
antitox. also, above this germ level you will need to overdose on spaceacillin to reduce the germ_level.
|
||||
|
||||
Note that amputating the affected organ does in fact remove the infection from the
|
||||
Note that amputating the affected organ does in fact remove the infection from the
|
||||
player's body, though, antitox and spaceacillin are easy enough to get I doubt it will ever be needed.
|
||||
*/
|
||||
/datum/organ/external/proc/update_germs()
|
||||
@@ -369,7 +369,7 @@ player's body, though, antitox and spaceacillin are easy enough to get I doubt i
|
||||
//Open wounds can become infected
|
||||
if (owner.germ_level > W.germ_level && W.infection_check())
|
||||
W.germ_level++
|
||||
|
||||
|
||||
//Infected wounds raise the organ's germ level
|
||||
W.germ_level = max(W.germ_level, germ_level) //Wounds get all the germs
|
||||
if (W.germ_level > germ_level) //Badly infected wounds raise internal germ levels
|
||||
@@ -378,41 +378,41 @@ player's body, though, antitox and spaceacillin are easy enough to get I doubt i
|
||||
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
|
||||
if (germ_level > 0 && antibiotics > 5)
|
||||
if (prob(4*antibiotics)) germ_level-- //the higher the germ level the more antibiotics you'll need.
|
||||
|
||||
|
||||
if(germ_level >= INFECTION_LEVEL_ONE)
|
||||
//having an infection raises your body temperature
|
||||
var/fever_temperature = (owner.species.heat_level_1 - owner.species.body_temperature - 1)* min(germ_level/INFECTION_LEVEL_THREE, 1) + owner.species.body_temperature
|
||||
if (owner.bodytemperature < fever_temperature)
|
||||
//world << "fever: [owner.bodytemperature] < [fever_temperature], raising temperature."
|
||||
owner.bodytemperature++
|
||||
|
||||
|
||||
if(prob(round(germ_level/10)))
|
||||
germ_level++
|
||||
if (prob(5)) //adjust this to tweak how fast people take toxin damage from infections
|
||||
owner.adjustToxLoss(1)
|
||||
|
||||
|
||||
if(germ_level >= INFECTION_LEVEL_TWO)
|
||||
//spread the infection
|
||||
for (var/datum/organ/internal/I in internal_organs)
|
||||
if (I.germ_level < germ_level)
|
||||
I.germ_level++
|
||||
|
||||
|
||||
if (children) //To child organs
|
||||
for (var/datum/organ/external/child in children)
|
||||
if (child.germ_level < germ_level && !(child.status & ORGAN_ROBOT))
|
||||
if (child.germ_level < INFECTION_LEVEL_ONE*2 || prob(30))
|
||||
child.germ_level++
|
||||
|
||||
|
||||
if (parent)
|
||||
if (parent.germ_level < germ_level && !(parent.status & ORGAN_ROBOT))
|
||||
if (parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30))
|
||||
parent.germ_level++
|
||||
|
||||
|
||||
if(germ_level >= INFECTION_LEVEL_THREE && antibiotics < 30) //overdosing is necessary to stop severe infections
|
||||
if (!(status & ORGAN_DEAD))
|
||||
status |= ORGAN_DEAD
|
||||
owner << "<span class='notice'>You can't feel your [display_name] anymore...</span>"
|
||||
|
||||
|
||||
germ_level++
|
||||
owner.adjustToxLoss(1)
|
||||
|
||||
@@ -789,7 +789,7 @@ player's body, though, antitox and spaceacillin are easy enough to get I doubt i
|
||||
/datum/organ/external/proc/process_grasp(var/obj/item/c_hand, var/hand_name)
|
||||
if (!c_hand)
|
||||
return
|
||||
|
||||
|
||||
if(is_broken())
|
||||
owner.u_equip(c_hand)
|
||||
var/emote_scream = pick("screams in pain and", "lets out a sharp cry and", "cries out and")
|
||||
@@ -804,6 +804,18 @@ player's body, though, antitox and spaceacillin are easy enough to get I doubt i
|
||||
spawn(10)
|
||||
del(spark_system)
|
||||
|
||||
/datum/organ/external/proc/embed(var/obj/item/weapon/W, var/silent = 0)
|
||||
if(!silent)
|
||||
owner.visible_message("<span class='danger'>\The [W] sticks in the wound!</span>")
|
||||
implants += W
|
||||
owner.embedded_flag = 1
|
||||
owner.verbs += /mob/proc/yank_out_object
|
||||
W.add_blood(owner)
|
||||
if(ismob(W.loc))
|
||||
var/mob/living/H = W.loc
|
||||
H.drop_item()
|
||||
W.loc = owner
|
||||
|
||||
|
||||
/****************************************************
|
||||
ORGAN DEFINES
|
||||
@@ -833,7 +845,7 @@ player's body, though, antitox and spaceacillin are easy enough to get I doubt i
|
||||
max_damage = 50
|
||||
min_broken_damage = 20
|
||||
body_part = ARM_LEFT
|
||||
|
||||
|
||||
process()
|
||||
..()
|
||||
process_grasp(owner.l_hand, "left hand")
|
||||
@@ -854,7 +866,7 @@ player's body, though, antitox and spaceacillin are easy enough to get I doubt i
|
||||
max_damage = 50
|
||||
min_broken_damage = 20
|
||||
body_part = ARM_RIGHT
|
||||
|
||||
|
||||
process()
|
||||
..()
|
||||
process_grasp(owner.r_hand, "right hand")
|
||||
@@ -893,7 +905,7 @@ player's body, though, antitox and spaceacillin are easy enough to get I doubt i
|
||||
max_damage = 30
|
||||
min_broken_damage = 15
|
||||
body_part = HAND_RIGHT
|
||||
|
||||
|
||||
process()
|
||||
..()
|
||||
process_grasp(owner.r_hand, "right hand")
|
||||
@@ -905,7 +917,7 @@ player's body, though, antitox and spaceacillin are easy enough to get I doubt i
|
||||
max_damage = 30
|
||||
min_broken_damage = 15
|
||||
body_part = HAND_LEFT
|
||||
|
||||
|
||||
process()
|
||||
..()
|
||||
process_grasp(owner.l_hand, "left hand")
|
||||
|
||||
Reference in New Issue
Block a user