mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-22 21:38:47 +01:00
8111a8489b
Many, many, many items have inhand sprites in their .dmis but for whatever reasons do not display them in-game. This PR: 1. Updates many item definitions to point to their already-existing inhands correctly. This consists largely of held tools, but also gas tanks and jetpacks mounted in the suit storage slot. 2. Adds a few codersprites made by me for objects with either missing inhands or poorly matching mishands (IE, the tape recorder, which has a black case, reused the white inhand sprites of the health analyzer). The new sprites are modified or recolored variations of other inhand sprites from our repo, except for circuitboards which are new. <img width="444" height="400" alt="image" src="https://github.com/user-attachments/assets/7f107b9a-fe24-4e31-8f16-4d34768ee117" /> 3. Adds inhand sprites for Inflatables and Inflatable Boxes made by Tomixcomics. <img width="424" height="101" alt="image" src="https://github.com/user-attachments/assets/434107c4-8577-49a2-a58e-d6b014c03933" /> 4. Ports inhand sprites for the Hydraulic Rescue Tool from tg's Jaws of Life. <img width="224" height="94" alt="Screenshot 2026-02-07 172931" src="https://github.com/user-attachments/assets/070c7956-f6a8-4fb5-870f-10c64afcc8b3" /> 5. Some additional cleanup while in the area. The 'analyzer' has been renamed the 'gas analyzer' to be consistent with the other analyzer objects, standardized icon_state naming conventions where I saw oddballs, updated code docs to use DMDocs when in the area, etc. ### Asset Licenses The following assets that **have not** been created by myself are included in this PR: | Path | Original Author | License | | --- | --- | --- | | icons/obj/item/hydraulic_rescue_tool.dmi | [SomeAngryMiner (bee station)](https://github.com/BeeStation/BeeStation-Hornet/pull/2487), [maxymax (/tg/station)](https://github.com/tgstation/tgstation/pull/58616) | CC-BY-SA | | icons/obj/item/inflatables.dmi | [Tomixcomics](https://github.com/tomixcomics) | CC-BY-SA |
190 lines
4.9 KiB
Plaintext
190 lines
4.9 KiB
Plaintext
|
|
//moved these here from code/defines/obj/weapon.dm
|
|
//please preference put stuff where it's easy to find - C
|
|
|
|
/obj/item/autopsy_scanner
|
|
name = "autopsy scanner"
|
|
desc = "Extracts information on wounds."
|
|
icon = 'icons/obj/item/scanner.dmi'
|
|
icon_state = "autopsy"
|
|
item_state = "autopsy"
|
|
contained_sprite = TRUE
|
|
obj_flags = OBJ_FLAG_CONDUCTABLE
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
|
|
var/list/datum/autopsy_data_scanner/wdata = list()
|
|
var/list/datum/autopsy_data_scanner/chemtraces = list()
|
|
var/target_name = null
|
|
var/timeofdeath = null
|
|
|
|
/datum/autopsy_data_scanner
|
|
/// The DEFINITE weapon type that was used.
|
|
var/weapon = null
|
|
/// This maps a number of scanned organs to the wounds to those organs with this data's weapon type.
|
|
var/list/organs_scanned = list()
|
|
var/organ_names = ""
|
|
|
|
/datum/autopsy_data
|
|
var/weapon = null
|
|
var/pretend_weapon = null
|
|
var/damage = 0
|
|
var/hits = 0
|
|
var/time_inflicted = 0
|
|
|
|
/datum/autopsy_data/proc/copy()
|
|
var/datum/autopsy_data/W = new()
|
|
W.weapon = weapon
|
|
W.pretend_weapon = pretend_weapon
|
|
W.damage = damage
|
|
W.hits = hits
|
|
W.time_inflicted = time_inflicted
|
|
return W
|
|
|
|
/obj/item/autopsy_scanner/proc/add_data(var/obj/item/organ/external/O)
|
|
if(!O.autopsy_data.len && !O.trace_chemicals.len) return
|
|
|
|
for(var/V in O.autopsy_data)
|
|
var/datum/autopsy_data/W = O.autopsy_data[V]
|
|
|
|
if(!W.pretend_weapon)
|
|
W.pretend_weapon = W.weapon
|
|
|
|
var/datum/autopsy_data_scanner/D = wdata[V]
|
|
if(!D)
|
|
D = new()
|
|
D.weapon = W.weapon
|
|
wdata[V] = D
|
|
|
|
if(!D.organs_scanned[O.name])
|
|
if(D.organ_names == "")
|
|
D.organ_names = O.name
|
|
else
|
|
D.organ_names += ", [O.name]"
|
|
|
|
qdel(D.organs_scanned[O.name])
|
|
D.organs_scanned[O.name] = W.copy()
|
|
|
|
for(var/V in O.trace_chemicals)
|
|
if(O.trace_chemicals[V] > 0 && !chemtraces.Find(V))
|
|
chemtraces += V
|
|
|
|
/obj/item/autopsy_scanner/verb/print_data()
|
|
set name = "Print Data"
|
|
set category = "Object"
|
|
set src in usr
|
|
|
|
if(use_check_and_message(usr))
|
|
return
|
|
|
|
var/scan_data = ""
|
|
|
|
if(timeofdeath)
|
|
scan_data += "<b>Time of death:</b> [worldtime2text(timeofdeath)]<br><br>"
|
|
|
|
var/n = 1
|
|
for(var/wdata_idx in wdata)
|
|
var/datum/autopsy_data_scanner/D = wdata[wdata_idx]
|
|
var/total_hits = 0
|
|
var/total_score = 0
|
|
// Maps weapon names to a score
|
|
var/list/weapon_chances = list()
|
|
var/age = 0
|
|
|
|
for(var/wound_idx in D.organs_scanned)
|
|
var/datum/autopsy_data/W = D.organs_scanned[wound_idx]
|
|
total_hits += W.hits
|
|
|
|
var/wname = W.pretend_weapon
|
|
|
|
if(wname in weapon_chances) weapon_chances[wname] += W.damage
|
|
else weapon_chances[wname] = max(W.damage, 1)
|
|
total_score+=W.damage
|
|
|
|
|
|
var/wound_age = W.time_inflicted
|
|
age = max(age, wound_age)
|
|
|
|
var/damage_desc
|
|
|
|
var/damaging_weapon = (total_score != 0)
|
|
|
|
// Total score happens to be the total damage
|
|
switch(total_score)
|
|
if(0)
|
|
damage_desc = "Unknown"
|
|
if(1 to 5)
|
|
damage_desc = SPAN_DANGER("negligible")
|
|
if(5 to 15)
|
|
damage_desc = SPAN_DANGER("light")
|
|
if(15 to 30)
|
|
damage_desc = "<font color='orange'>moderate</font>"
|
|
if(30 to 1000)
|
|
damage_desc = SPAN_WARNING("severe")
|
|
|
|
if(!total_score) total_score = D.organs_scanned.len
|
|
|
|
scan_data += "<b>Weapon #[n]</b><br>"
|
|
if(damaging_weapon)
|
|
scan_data += "Severity: [damage_desc]<br>"
|
|
scan_data += "Hits by weapon: [total_hits]<br>"
|
|
scan_data += "Approximate time of wound infliction: [worldtime2text(age)]<br>"
|
|
scan_data += "Affected limbs: [D.organ_names]<br>"
|
|
scan_data += "Possible weapons:<br>"
|
|
for(var/weapon_name in weapon_chances)
|
|
scan_data += "\t[100*weapon_chances[weapon_name]/total_score]% [weapon_name]<br>"
|
|
|
|
scan_data += "<br>"
|
|
|
|
n++
|
|
|
|
if(chemtraces.len)
|
|
scan_data += "<b>Trace Chemicals: </b><br>"
|
|
for(var/chemID in chemtraces)
|
|
scan_data += chemID
|
|
scan_data += "<br>"
|
|
|
|
for(var/mob/O in viewers(usr))
|
|
O.show_message(SPAN_NOTICE("\The [src] rattles and prints out a sheet of paper."), 1)
|
|
playsound(loc, 'sound/items/bureaucracy/print_short.ogg', 50, 1)
|
|
|
|
sleep(10)
|
|
|
|
var/obj/item/paper/P = new(usr.loc)
|
|
P.name = "Autopsy Data ([target_name])"
|
|
P.info = "<tt>[scan_data]</tt>"
|
|
P.icon_state = "paper_words"
|
|
|
|
usr.put_in_hands(P)
|
|
|
|
/obj/item/autopsy_scanner/attack(mob/living/target_mob, mob/living/user, target_zone)
|
|
var/mob/living/carbon/human/M = target_mob
|
|
if(!istype(M))
|
|
return
|
|
|
|
if(!can_operate(M))
|
|
return
|
|
|
|
if(target_name != M.name)
|
|
target_name = M.name
|
|
src.wdata = list()
|
|
src.chemtraces = list()
|
|
src.timeofdeath = null
|
|
to_chat(user, SPAN_NOTICE("A new patient has been registered. Purging data for previous patient."))
|
|
|
|
src.timeofdeath = M.timeofdeath
|
|
|
|
var/obj/item/organ/external/S = M.get_organ(user.zone_sel.selecting)
|
|
if(!S)
|
|
to_chat(usr, SPAN_WARNING("You can't scan this body part."))
|
|
return
|
|
if(!S.open)
|
|
to_chat(usr, SPAN_WARNING("You have to cut the limb open first!"))
|
|
return
|
|
for(var/mob/O in viewers(M))
|
|
O.show_message(SPAN_NOTICE("\The [user] scans the wounds on [M.name]'s [S.name] with \the [src]"), 1)
|
|
|
|
flick("autopsy-scan", src)
|
|
src.add_data(S)
|
|
|
|
return 1
|