Added autopsy.

- When a human is attacked, data about the weapon is added to a special wound datum on the organ.
- This data can be extracted and processed by opening up the limb and using an autopsy scanner on it.
- Added the autopsy-scanner to the map.
This commit is contained in:
cib
2012-01-28 02:26:44 -08:00
parent a7e8d61f76
commit e14dfc5ace
9 changed files with 169 additions and 10 deletions
@@ -39,7 +39,7 @@
return null
/mob/living/carbon/human/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/sharp = 0)
/mob/living/carbon/human/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/sharp = 0, var/used_weapon = null)
if((damagetype != BRUTE) && (damagetype != BURN))
..(damage, damagetype, def_zone, blocked)
return 1
@@ -61,6 +61,10 @@
organ.take_damage(damage, 0, sharp)
if(BURN)
organ.take_damage(0, damage, sharp)
if(used_weapon)
organ.add_wound(used_weapon, damage)
UpdateDamageIcon()
updatehealth()
return 1
@@ -96,7 +96,7 @@ emp_act
var/armor = run_armor_check(affecting, "melee", "Your armor has protected you from a hit to the [hit_area].", "Your armor has softened hit to your [hit_area].")
if(armor >= 2) return 0
if(!I.force) return 0
apply_damage(I.force, I.damtype, affecting, armor, is_cut(I))
apply_damage(I.force, I.damtype, affecting, armor, is_cut(I), I)
var/bloody = 0
if((I.damtype == BRUTE) && prob(25 + (I.force * 2)))
+1 -1
View File
@@ -8,7 +8,7 @@
Returns
standard 0 if fail
*/
/mob/living/proc/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/slash = 0)
/mob/living/proc/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/slash = 0, var/used_weapon = null)
if(!damage || (blocked >= 2)) return 0
switch(damagetype)
if(BRUTE)
+37
View File
@@ -3,6 +3,8 @@
name = "organ"
mob/living/carbon/human/owner = null
list/datum/wound/weapon_wounds = list()
proc/process()
return 0
@@ -10,6 +12,23 @@
proc/receive_chem(chemical as obj)
return 0
/datum/wound
var
weapon_type = null
pretend_weapon_type = null
damage = 0
hits = 0
scar = 0
proc/copy()
var/datum/wound/W = new()
W.weapon_type = src.weapon_type
W.pretend_weapon_type = src.pretend_weapon_type
W.damage = src.damage
W.hits = src.hits
W.scar = src.scar
return W
/****************************************************
EXTERNAL ORGANS
****************************************************/
@@ -108,8 +127,26 @@
if(internal)
broken = 0
perma_injury = 0
// if all damage is healed, replace the wounds with scars
if(brute_dam + burn_dam == 0)
for(var/V in weapon_wounds)
var/datum/wound/W = weapon_wounds[V]
W.scar = 1
return update_icon()
proc/add_wound(var/obj/item/used_weapon, var/damage)
var/weapon_type = "[used_weapon.type]"
var/datum/wound/W = weapon_wounds[weapon_type]
if(!W)
W = new()
W.weapon_type = used_weapon.type
weapon_wounds[weapon_type] = W
W.hits += 1
W.damage += damage
proc/get_damage() //returns total damage
return max(brute_dam + burn_dam - perma_injury,perma_injury) //could use health?