mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-06 07:22:15 +00:00
A lot of fixes to autopsy.
- Projectiles now leave wounds that can be scanned through autopsy. - The "fake" weapons selected by the scanner are no longer completely random. - The scanner now displays age and severity of the wound.
This commit is contained in:
@@ -324,7 +324,7 @@ CIRCULAR SAW
|
||||
|
||||
/datum/wound_data
|
||||
var
|
||||
weapon_type = null // this is the DEFINITE weapon type that was used
|
||||
weapon = null // this is the DEFINITE weapon type that was used
|
||||
list/organs_scanned = list() // this maps a number of scanned organs to
|
||||
// the wounds to those organs with this data's weapon type
|
||||
organ_names = ""
|
||||
@@ -335,20 +335,18 @@ CIRCULAR SAW
|
||||
for(var/V in O.weapon_wounds)
|
||||
var/datum/wound/W = O.weapon_wounds[V]
|
||||
|
||||
if(!W.pretend_weapon_type)
|
||||
if(!W.pretend_weapon)
|
||||
// the more hits, the more likely it is that we get the right weapon type
|
||||
if(prob(W.hits * 10 + W.damage))
|
||||
W.pretend_weapon_type = W.weapon_type
|
||||
W.pretend_weapon = W.weapon
|
||||
else
|
||||
if(prob(50))
|
||||
W.pretend_weapon_type = pick(/obj/item/weapon/storage/toolbox, /obj/item/weapon/wirecutters, /obj/item/weapon/gun/projectile, /obj/item/weapon/crowbar, /obj/item/weapon/extinguisher)
|
||||
else
|
||||
W.pretend_weapon_type = pick(typesof(/obj/item/weapon))
|
||||
W.pretend_weapon = pick("mechanical toolbox", "wirecutters", "revolver", "crowbar", "fire extinguisher", "tomato soup", "oxygen tank", "emergency oxygen tank", "laser", "bullet")
|
||||
|
||||
|
||||
var/datum/wound_data/D = wdata[V]
|
||||
if(!D)
|
||||
D = new()
|
||||
D.weapon_type = W.weapon_type
|
||||
D.weapon = W.weapon
|
||||
wdata[V] = D
|
||||
|
||||
if(!D.organs_scanned[O.name])
|
||||
@@ -367,21 +365,39 @@ CIRCULAR SAW
|
||||
var/total_hits = 0
|
||||
var/total_score = 0
|
||||
var/list/weapon_chances = list() // maps weapon names to a score
|
||||
var/age = 0
|
||||
|
||||
for(var/wound_idx in D.organs_scanned)
|
||||
var/datum/wound/W = D.organs_scanned[wound_idx]
|
||||
total_hits += W.hits
|
||||
|
||||
var/atom/weapon = new W.pretend_weapon_type()
|
||||
var/wname = W.pretend_weapon
|
||||
|
||||
if(weapon.name in weapon_chances) weapon_chances[weapon.name] += W.damage
|
||||
else weapon_chances[weapon.name] = W.damage
|
||||
if(wname in weapon_chances) weapon_chances[wname] += W.damage
|
||||
else weapon_chances[wname] = W.damage
|
||||
total_score+=W.damage
|
||||
|
||||
del weapon
|
||||
|
||||
var/wound_age = world.time - W.time_inflicted
|
||||
age = max(age, wound_age)
|
||||
|
||||
var/damage_desc
|
||||
|
||||
// total score happens to be the total damage
|
||||
switch(total_score)
|
||||
if(0 to 5)
|
||||
damage_desc = "<font color='green'>negligible</font>"
|
||||
if(5 to 15)
|
||||
damage_desc = "<font color='green'>light</font>"
|
||||
if(15 to 30)
|
||||
damage_desc = "<font color='orange'>moderate</font>"
|
||||
if(30 to 1000)
|
||||
damage_desc = "<font color='red'>severe</font>"
|
||||
|
||||
scan_data += "<b>Weapon #[n]</b><br>"
|
||||
scan_data += "Severity: [damage_desc]<br>"
|
||||
scan_data += "Hits by weapon: [total_hits]<br>"
|
||||
scan_data += "Age of wound: [round(age / (60*10))] minutes<br>"
|
||||
scan_data += "Affected limbs: [D.organ_names]<br>"
|
||||
scan_data += "Possible weapons:<br>"
|
||||
for(var/weapon_name in weapon_chances)
|
||||
|
||||
@@ -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), I)
|
||||
apply_damage(I.force, I.damtype, affecting, armor, is_cut(I), I.name)
|
||||
|
||||
var/bloody = 0
|
||||
if((I.damtype == BRUTE) && prob(25 + (I.force * 2)))
|
||||
|
||||
@@ -50,6 +50,6 @@
|
||||
P.on_hit(src,2)
|
||||
return 2
|
||||
if(!P.nodamage)
|
||||
apply_damage((P.damage/(absorb+1)), P.damage_type)
|
||||
apply_damage((P.damage/(absorb+1)), P.damage_type, used_weapon = P.name)
|
||||
P.on_hit(src, absorb)
|
||||
return absorb
|
||||
@@ -14,19 +14,19 @@
|
||||
|
||||
/datum/wound
|
||||
var
|
||||
weapon_type = null
|
||||
pretend_weapon_type = null
|
||||
weapon = null
|
||||
pretend_weapon = null
|
||||
damage = 0
|
||||
hits = 0
|
||||
scar = 0
|
||||
time_inflicted = 0
|
||||
|
||||
proc/copy()
|
||||
var/datum/wound/W = new()
|
||||
W.weapon_type = src.weapon_type
|
||||
W.pretend_weapon_type = src.pretend_weapon_type
|
||||
W.weapon = src.weapon
|
||||
W.pretend_weapon = src.pretend_weapon
|
||||
W.damage = src.damage
|
||||
W.hits = src.hits
|
||||
W.scar = src.scar
|
||||
W.time_inflicted = src.time_inflicted
|
||||
return W
|
||||
|
||||
/****************************************************
|
||||
@@ -131,20 +131,20 @@
|
||||
if(brute_dam + burn_dam == 0)
|
||||
for(var/V in weapon_wounds)
|
||||
var/datum/wound/W = weapon_wounds[V]
|
||||
W.scar = 1
|
||||
del W
|
||||
weapon_wounds = list()
|
||||
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]
|
||||
proc/add_wound(var/used_weapon, var/damage)
|
||||
var/datum/wound/W = weapon_wounds[used_weapon]
|
||||
if(!W)
|
||||
W = new()
|
||||
W.weapon_type = used_weapon.type
|
||||
weapon_wounds[weapon_type] = W
|
||||
W.weapon = used_weapon
|
||||
weapon_wounds[used_weapon] = W
|
||||
|
||||
W.hits += 1
|
||||
W.damage += damage
|
||||
W.time_inflicted = world.time
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user