Skip to content

Commit

Permalink
cause data
Browse files Browse the repository at this point in the history
  • Loading branch information
Zonespace27 committed Jan 26, 2025
1 parent 7a8dd1b commit 3398fa6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
26 changes: 15 additions & 11 deletions code/datums/statistics/entities/xeno_death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,24 @@
var/ckey
/// How much damage this xeno took before dying
var/damage_taken
/// What killed this xeno ("m39 submachinegun")
var/killed_by

/datum/entity/xeno_death/New(mob/living/carbon/xenomorph/dead_xeno)
/datum/entity/xeno_death/New(mob/living/carbon/xenomorph/dead_xeno, datum/cause_data/death_cause)
. = ..()
map_name = SSmapping.configs[GROUND_MAP]?.map_name
x = dead_xeno.x
y = dead_xeno.y
z = dead_xeno.z
death_minute = floor((world.time * 0.1) / 60)
hive = dead_xeno.hive.name
caste = dead_xeno.caste.caste_type
map_name = SSmapping.configs[GROUND_MAP]?.map_name || "Unknown Map"
x = dead_xeno.x || -1
y = dead_xeno.y || -1
z = dead_xeno.z || -1
death_minute = floor((world.time * 0.1) / 60) || -1
hive = dead_xeno.hive.name || "Unknown Hive"
caste = dead_xeno.caste.caste_type || "Unknown"
strain = dead_xeno.strain?.name || "None"
leader = (dead_xeno in dead_xeno.hive.xeno_leader_list)
minutes_alive = floor((dead_xeno.creation_time * 0.1) / 60)
minutes_alive = floor((dead_xeno.creation_time * 0.1) / 60) || -1
ckey = dead_xeno.ckey || dead_xeno.persistent_ckey || ""
damage_taken = dead_xeno.life_damage_taken_total
damage_taken = dead_xeno.life_damage_taken_total || 0
killed_by = death_cause.cause_name || "Unknown"

SSticker?.mode?.round_stats?.xeno_deaths += src
save()
Expand All @@ -57,5 +60,6 @@
"leader" = DB_FIELDTYPE_INT,
"minutes_alive" = DB_FIELDTYPE_INT,
"ckey" = DB_FIELDTYPE_STRING_MEDIUM,
"damage_taken" = DB_FIELDTYPE_INT
"damage_taken" = DB_FIELDTYPE_INT,
"cause_name" = DB_FIELDTYPE_STRING_MEDIUM,
)
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
update_icons()

if(!should_block_game_interaction(src)) //so xeno players don't get death messages from admin tests
new /datum/entity/xeno_death(src) // Creates a stats logging entry, we don't need to do anything w/ it since it handles everything
new /datum/entity/xeno_death(src, cause) // Creates a stats logging entry, we don't need to do anything w/ it since it handles everything

if(isqueen(src))
var/mob/living/carbon/xenomorph/queen/XQ = src
Expand Down

0 comments on commit 3398fa6

Please sign in to comment.