Added basic germ code.

This will only trigger in surgery for now - That is when you cut someone open in surgery, you'd better wash your hands before, or otherwise you'll get infected wounds.
This commit is contained in:
cib
2012-11-12 12:51:28 +01:00
parent 2d6e97848b
commit e92cecdefe
10 changed files with 72 additions and 12 deletions
+18 -1
View File
@@ -33,6 +33,9 @@
var/open = 0
var/stage = 0
// INTERNAL germs inside the organ, this is BAD if it's greater 0
var/germ_level = 0
// how often wounds should be updated, a higher number means less often
var/wound_update_accuracy = 20 // update every 20 ticks(roughly every minute)
New(var/datum/organ/external/P)
@@ -195,6 +198,11 @@
// amount of healing is spread over all the wounds
W.heal_damage((wound_update_accuracy * amount * W.amount * config.organ_regeneration_multiplier) / (20*owner.number_wounds+1))
if(W.germ_level > 100 && prob(10))
owner.adjustToxLoss(1 * wound_update_accuracy)
if(W.germ_level > 1000)
owner.adjustToxLoss(1 * wound_update_accuracy)
// sync the organ's damage with its wounds
src.update_damages()
@@ -222,6 +230,12 @@
proc/get_damage_fire()
return burn_dam
proc/is_infected()
for(var/datum/wound/W in wounds)
if(W.germ_level > 100)
return 1
return 0
process()
// process wounds, doing healing etc., only do this every 4 ticks to save processing power
if(owner.life_tick % wound_update_accuracy == 0)
@@ -239,6 +253,9 @@
return
if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT))
src.fracture()
if(germ_level > 0)
for(var/datum/wound/W in wounds) if(!W.bandaged)
W.germ_level = max(W.germ_level, germ_level)
return
proc/fracture()
@@ -694,4 +711,4 @@ obj/item/weapon/organ/r_hand
icon_state = "r_hand_l"
obj/item/weapon/organ/r_leg
name = "right leg"
icon_state = "r_leg_l"
icon_state = "r_leg_l"
+5 -2
View File
@@ -41,6 +41,9 @@
// internal wounds can only be fixed through surgery
var/internal = 0
// amount of germs in the wound
var/germ_level = 0
// helper lists
var/tmp/list/desc_list = list()
var/tmp/list/damage_list = list()
@@ -143,7 +146,7 @@
/datum/wound/gaping_wound
max_bleeding_stage = 2
stages = list("gaping wound" = 50, "large blood soaked clot" = 25, "large clot" = 15, "small angry scar" = 5, \
"small straight scar" = 0)
"small straight scar" = 0)
/datum/wound/big_gaping_wound
max_bleeding_stage = 2
@@ -229,4 +232,4 @@
stages = list("severed vein" = 30, "cut vein" = 20, "damaged vein" = 10, "bruised vein" = 5)
max_bleeding_stage = 0
needs_treatment = 1
needs_treatment = 1