IPC overhaul part deux

This commit is contained in:
Markolie
2015-08-16 02:34:52 +02:00
parent e6408b96c2
commit 4a14a97b3b
31 changed files with 274 additions and 202 deletions
+14 -2
View File
@@ -58,6 +58,7 @@ var/list/organ_cache = list()
if(status & ORGAN_ROBOT)
return
damage = max_damage
status |= ORGAN_DEAD
processing_objects -= src
if(dead_icon)
icon_state = dead_icon
@@ -80,17 +81,23 @@ var/list/organ_cache = list()
if ((status & ORGAN_ROBOT) || (owner && owner.species && (owner.species.flags & IS_PLANT)))
germ_level = 0
return
if(!owner)
if(reagents)
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list
if(B && prob(40))
reagents.remove_reagent("blood",0.1)
blood_splatter(src,B,1)
if(prob(5)) //How about we not have organs become completely useless less than a minute after removal?
damage += 1
germ_level += rand(2,6)
if(germ_level >= INFECTION_LEVEL_TWO)
germ_level += rand(2,6)
if(germ_level >= INFECTION_LEVEL_THREE)
die()
if(damage >= max_damage)
die()
else if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
//** Handle antibiotics and curing infections
handle_antibiotics()
@@ -99,6 +106,11 @@ var/list/organ_cache = list()
//check if we've hit max_damage
if(damage >= max_damage)
die()
/obj/item/organ/examine(mob/user)
..(user)
if(status & ORGAN_DEAD)
user << "<span class='notice'>The decay has set in.</span>"
/obj/item/organ/proc/handle_germ_effects()
//** Handle the effects of infections
+19 -23
View File
@@ -106,6 +106,7 @@
/obj/item/organ/external/replaced(var/mob/living/carbon/human/target)
owner = target
status = status & ~ORGAN_DESTROYED
if(istype(owner))
owner.organs_by_name[limb_name] = src
owner.organs |= src
@@ -123,8 +124,8 @@
/obj/item/organ/external/robotize()
..()
//robot limbs take reduced damage
brute_mod = 0.8
burn_mod = 0.8
brute_mod = 0.66
burn_mod = 0.66
/****************************************************
DAMAGE PROCS
@@ -302,12 +303,12 @@ This function completely restores a damaged organ to perfect condition.
W.open_wound(damage)
if(prob(25))
if(status & ORGAN_ROBOT)
owner.visible_message("\red The damage to [owner.name]'s [name] worsens.",\
"\red The damage to your [name] worsens.",\
owner.visible_message("<span class='alert'>The damage to [owner.name]'s [name] worsens.</span>",\
"<span class='alert'>The damage to your [name] worsens.</span>",\
"You hear the screech of abused metal.")
else
owner.visible_message("\red The wound on [owner.name]'s [name] widens with a nasty ripping noise.",\
"\red The wound on your [name] widens with a nasty ripping noise.",\
owner.visible_message("<span class='alert'>The wound on [owner.name]'s [name] widens with a nasty ripping noise.</span>",\
"<span class='alert'>The wound on your [name] widens with a nasty ripping noise.</span>",\
"You hear a nasty ripping noise, as if flesh is being torn apart.")
return
@@ -348,11 +349,6 @@ This function completely restores a damaged organ to perfect condition.
/obj/item/organ/external/process()
if(owner)
//Dismemberment
if(status & ORGAN_DESTROYED)
if(config.limbs_can_break)
droplimb(0,DROPLIMB_EDGE) //Might be worth removing this check since take_damage handles it.
return
if(parent)
if(parent.status & ORGAN_DESTROYED)
status |= ORGAN_DESTROYED
@@ -718,13 +714,13 @@ Note that amputating the affected organ does in fact remove the infection from t
if((status & ORGAN_BROKEN) || cannot_break)
return
owner.visible_message(\
"\red You hear a loud cracking sound coming from \the [owner].",\
"\red <b>Something feels like it shattered in your [name]!</b>",\
"You hear a sickening crack.")
if(owner.species && !(owner.species.flags & NO_PAIN))
owner.emote("scream")
if(owner)
owner.visible_message(\
"\red You hear a loud cracking sound coming from \the [owner].",\
"\red <b>Something feels like it shattered in your [name]!</b>",\
"You hear a sickening crack.")
if(owner.species && !(owner.species.flags & NO_PAIN))
owner.emote("scream")
status |= ORGAN_BROKEN
broken_description = pick("broken","fracture","hairline fracture")
@@ -762,11 +758,11 @@ Note that amputating the affected organ does in fact remove the infection from t
/obj/item/organ/external/proc/mutate()
src.status |= ORGAN_MUTATED
owner.update_body()
if(owner) owner.update_body()
/obj/item/organ/external/proc/unmutate()
src.status &= ~ORGAN_MUTATED
owner.update_body()
if(owner) owner.update_body()
/obj/item/organ/external/proc/get_damage() //returns total damage
return max(brute_dam + burn_dam - perma_injury, perma_injury) //could use health?
@@ -786,7 +782,7 @@ Note that amputating the affected organ does in fact remove the infection from t
return ((status & ORGAN_ROBOT) && (brute_dam + burn_dam) >= 10 && prob(brute_dam + burn_dam))
/obj/item/organ/external/proc/embed(var/obj/item/weapon/W, var/silent = 0)
if(loc != owner)
if(!owner || loc != owner)
return
if(!silent)
owner.visible_message("<span class='danger'>\The [W] sticks in the wound!</span>")
@@ -819,12 +815,12 @@ Note that amputating the affected organ does in fact remove the infection from t
for(var/obj/item/organ/external/O in children)
O.removed()
if(O)
O.loc = src
O.forceMove(src)
// Grab all the internal giblets too.
for(var/obj/item/organ/organ in internal_organs)
organ.removed()
organ.loc = src
organ.forceMove(src)
release_restraints(victim)
victim.organs -= src
+4 -2
View File
@@ -1,7 +1,6 @@
/obj/item/organ/external/stump
name = "limb stump"
icon_name = ""
cannot_amputate = 0 //You need to remove stumps to attach new limbs, but you can't remove stumps... What the fuck?
/obj/item/organ/external/stump/New(var/mob/living/carbon/holder, var/internal, var/obj/item/organ/external/limb)
if(istype(limb))
@@ -13,7 +12,7 @@
..(holder, internal)
if(istype(limb))
max_damage = limb.max_damage
if((limb.status & ORGAN_ROBOT) && (!parent || (parent.status & ORGAN_ROBOT)))
if((limb.status & ORGAN_ROBOT) && (!parent || (parent.status & ORGAN_ROBOT)))
robotize() //if both limb and the parent are robotic, the stump is robotic too
/obj/item/organ/external/stump/is_stump()
@@ -22,3 +21,6 @@
/obj/item/organ/external/stump/removed()
..()
qdel(src)
/obj/item/organ/external/stump/is_usable()
return 0
+1
View File
@@ -125,6 +125,7 @@
name = "head"
max_damage = 50
min_broken_damage = 25
vital = 1
w_class = 3
body_part = HEAD
parent_organ = "chest"
+2 -2
View File
@@ -70,12 +70,12 @@
..()
// This is very ghetto way of rebooting an IPC. TODO better way.
if(owner && owner.stat == DEAD)
owner.stat = 0
owner.stat = ALIVE
owner.visible_message("<span class='danger'>\The [owner] twitches visibly!</span>")
/obj/item/organ/optical_sensor
name = "optical sensor"
organ_tag = "eyes"
organ_tag = "optics"
parent_organ = "head"
icon = 'icons/obj/robot_component.dmi'
icon_state = "camera"