Skip to content

Commit

Permalink
Log Updates (#4024)
Browse files Browse the repository at this point in the history
# About the pull request
Adds new and updates old logs.

- Chestbursts now include location data.
- Near miss shots now include the name of the firer.
- Mentor Imaginary Friends now log their speech.
- Ahelps now log to chat when they're deferred to mentors.
- Phonecalls now log speech being relayed through a phone.
- Dropships now log who launched them again. Dropship interactions are
now also logged within attack logs via log_interact.

<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
Knowledge is power.
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>


![image](https://github.com/cmss13-devs/cmss13/assets/41653574/aba3178b-1a4a-4e2f-837b-93431097eae9)


Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
admin: Added logs for speech through telephones and deferring ahelps to
mentors.
admin: Chestburst logs now include location data. Mentor Imaginary
Friend now logs its speech. Narrow miss shots now log who fired them
(where applicable).
admin: Dropship interactions (Launch/Flyby/Autopilot) are now logged
again, and also included in attack logs for the user.
/:cl:
  • Loading branch information
realforest2001 authored Aug 3, 2023
1 parent cdbc91d commit 5ab0070
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 43 deletions.
6 changes: 4 additions & 2 deletions code/__HELPERS/logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@
if (CONFIG_GET(flag/log_interact))
WRITE_LOG(GLOB.world_game_log, "INTERACT: [msg]")
LOG_REDIS("interact", "\[[time]\] [msg]")
origin.attack_log += "\[[time]\]<font color='green'> [msg] </font>"
target.attack_log += "\[[time]\]<font color='green'> [msg] </font>"
if(origin)
origin.attack_log += "\[[time]\]<font color='green'> [msg] </font>"
if(target)
target.attack_log += "\[[time]\]<font color='green'> [msg] </font>"

GLOB.STUI.attack.Add("\[[time]]INTERACT: [msg]")
GLOB.STUI.processing |= STUI_LOG_ATTACK
Expand Down
19 changes: 15 additions & 4 deletions code/datums/statistics/entities/death_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,25 @@
)

/mob/proc/track_mob_death(datum/cause_data/cause_data, turf/death_loc)
if(!mind || statistic_exempt)
return

if(cause_data && !istype(cause_data))
stack_trace("track_mob_death called with string cause ([cause_data]) instead of datum")
cause_data = create_cause_data(cause_data)

var/log_message = "\[[time_stamp()]\] [key_name(src)] died to "
if(cause_data)
log_message += "[cause_data.cause_name]"
else
log_message += "unknown causes"
var/mob/cause_mob = cause_data?.resolve_mob()
if(cause_mob)
log_message += " from [key_name(cause_data.resolve_mob())]"
cause_mob.attack_log += "\[[time_stamp()]\] [key_name(cause_mob)] killed [key_name(src)] with [cause_data.cause_name]."

attack_log += "[log_message]."

if(!mind || statistic_exempt)
return

var/datum/entity/statistic/death/new_death = DB_ENTITY(/datum/entity/statistic/death)
var/datum/entity/player/player_entity = get_player_from_key(mind.ckey)
if(player_entity)
Expand All @@ -96,7 +108,6 @@
new_death.cause_role_name = cause_data?.role
new_death.cause_faction_name = cause_data?.faction

var/mob/cause_mob = cause_data?.resolve_mob()
if(cause_mob)
cause_mob.life_kills_total += life_value

Expand Down
33 changes: 17 additions & 16 deletions code/game/objects/items/explosives/grenades/marines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -547,31 +547,32 @@
ram_distance -- //for max pinballing.
icon_state = inactive_icon

/obj/item/explosive/grenade/slug/proc/impact_mob(mob/living/M)
var/direction = Get_Angle(src,M)
var/target_turf = get_angle_target_turf(src,direction,throw_max)
var/fling = rand(throw_min,throw_max) //WEEEEEEEEEEEEEEEEEEEE What is going to be put into throw_atom
/obj/item/explosive/grenade/slug/proc/impact_mob(mob/living/smacked)
var/direction = Get_Angle(src, smacked)
var/target_turf = get_angle_target_turf(src,direction, throw_max)
var/fling = rand(throw_min, throw_max) //WEEEEEEEEEEEEEEEEEEEE What is going to be put into throw_atom
var/random_tile = 0 //random tile for bounce

playsound(M.loc, impact_sound, 75, 1)
M.apply_damage(impact_damage, BRUTE)
playsound(smacked.loc, impact_sound, 75, 1)
smacked.apply_damage(impact_damage, BRUTE)
smacked.attack_log += "\[[time_stamp()]\] [src], fired by [fingerprintslast], struck [key_name(smacked)]."

random_tile = get_random_turf_in_range(src,ram_distance,ram_distance) //getting random tile for bounce
src.throw_atom(random_tile,ram_distance,SPEED_FAST,src,TRUE,NORMAL_LAUNCH,NO_FLAGS) //time for a little trolling

if(isyautja(M)|| issynth(M))
M.apply_effect(slowdown_time * 0.5, SLOW)
M.apply_effect(dazed_time * 0.5, DAZE)
if(isyautja(smacked)|| issynth(smacked))
smacked.apply_effect(slowdown_time * 0.5, SLOW)
smacked.apply_effect(dazed_time * 0.5, DAZE)

if(M.mob_size >= MOB_SIZE_BIG)//big xenos not KO'ed
M.apply_effect(slowdown_time * 1.2, SLOW)//They are slowed more :trol:
M.apply_effect(dazed_time * 1.2, DAZE)
if(smacked.mob_size >= MOB_SIZE_BIG)//big xenos not KO'ed
smacked.apply_effect(slowdown_time * 1.2, SLOW)//They are slowed more :trol:
smacked.apply_effect(dazed_time * 1.2, DAZE)
return

M.apply_effect(knockout_time, WEAKEN)//but little xenos and humans are
M.throw_atom(target_turf,fling,SPEED_AVERAGE,M,TRUE)
M.apply_effect(slowdown_time, SLOW)
M.apply_effect(dazed_time, DAZE)
smacked.apply_effect(knockout_time, WEAKEN)//but little xenos and humans are
smacked.throw_atom(target_turf, fling, SPEED_AVERAGE, smacked, TRUE)
smacked.apply_effect(slowdown_time, SLOW)
smacked.apply_effect(dazed_time, DAZE)
return

/obj/item/explosive/grenade/slug/baton
Expand Down
1 change: 1 addition & 0 deletions code/modules/admin/verbs/adminhelp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)

AddInteraction("Deferred to Mentors by [key_name_admin(usr)].", player_message = "Deferred to Mentors.")
to_chat(initiator, SPAN_ADMINHELP("Your ticket has been deferred to Mentors."))
log_admin_private("Ticket [TicketHref("#[id]")] deferred to mentors by [usr.key].")
log_ahelp(id, "Defer", "Deferred to mentors by [usr.key]", null, usr.ckey)
Close(silent = TRUE)

Expand Down
1 change: 1 addition & 0 deletions code/modules/cm_phone/phone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter)

P.handle_hear(message, L, speaking)
attached_to.handle_hear(message, L, speaking)
log_say("TELEPHONE: [key_name(speaking)] on Phone '[phone_id]' to '[T.phone_id]' said '[message]'")

/obj/structure/transmitter/attackby(obj/item/W, mob/user)
if(W == attached_to)
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/camera/imaginary_friend.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@

to_chat(owner, "[rendered]")
to_chat(src, "[rendered]")
log_say("Imaginary Friend: [dead_rendered]")
if(!hidden)
var/list/send_to = list()
if(!owner.client?.prefs.lang_chat_disabled)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/living/carbon/xenomorph/Embryo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@
if(larva_embryo.client)
larva_embryo.set_lighting_alpha_from_prefs(larva_embryo.client)

larva_embryo.attack_log += "\[[time_stamp()]\]<font color='red'> chestbursted from [key_name(victim)]</font>"
victim.attack_log += "\[[time_stamp()]\]<font color='orange'> Was chestbursted, larva was [key_name(larva_embryo)]</font>"
larva_embryo.attack_log += "\[[time_stamp()]\]<font color='red'> chestbursted from [key_name(victim)] in [get_area_name(larva_embryo)] at X[victim.x], Y[victim.y], Z[victim.z]</font>"
victim.attack_log += "\[[time_stamp()]\]<font color='orange'> Was chestbursted in [get_area_name(larva_embryo)] at X[victim.x], Y[victim.y], Z[victim.z]. The larva was [key_name(larva_embryo)].</font>"

if(burstcount)
step(larva_embryo, pick(cardinal))
Expand All @@ -359,7 +359,7 @@
if(!victim.first_xeno)
to_chat(larva_embryo, SPAN_XENOHIGHDANGER("The Queen's will overwhelms your instincts..."))
to_chat(larva_embryo, SPAN_XENOHIGHDANGER("\"[hive.hive_orders]\""))
log_attack("[key_name(victim)] chestbursted, the larva was [key_name(larva_embryo)].") //this is so that admins are not spammed with los logs
log_attack("[key_name(victim)] chestbursted in [get_area_name(larva_embryo)] at X[victim.x], Y[victim.y], Z[victim.z]. The larva was [key_name(larva_embryo)].") //this is so that admins are not spammed with los logs

for(var/obj/item/alien_embryo/AE in victim)
qdel(AE)
Expand Down
21 changes: 11 additions & 10 deletions code/modules/projectiles/guns/specialist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -829,26 +829,27 @@
muzzle_flash(angle,user)
simulate_recoil(0, user)

var/obj/item/explosive/grenade/F = cylinder.contents[1]
cylinder.remove_from_storage(F, user.loc)
var/obj/item/explosive/grenade/fired = cylinder.contents[1]
cylinder.remove_from_storage(fired, user.loc)
var/pass_flags = NO_FLAGS
if(is_lobbing)
if(istype(F, /obj/item/explosive/grenade/slug/baton))
if(istype(fired, /obj/item/explosive/grenade/slug/baton))
if(ishuman(user))
var/mob/living/carbon/human/human_user = user
human_user.remember_dropped_object(F)
human_user.remember_dropped_object(fired)
fired.fingerprintslast = key_name(user)
pass_flags |= PASS_MOB_THRU_HUMAN|PASS_MOB_IS_OTHER|PASS_OVER
else
pass_flags |= PASS_MOB_THRU|PASS_HIGH_OVER

msg_admin_attack("[key_name_admin(user)] fired a grenade ([F.name]) from \a ([name]).")
msg_admin_attack("[key_name_admin(user)] fired a grenade ([fired.name]) from \a ([name]).")
log_game("[key_name_admin(user)] used a grenade ([name]).")

F.throw_range = 20
F.det_time = min(10, F.det_time)
F.activate(user, FALSE)
F.forceMove(get_turf(src))
F.throw_atom(target, 20, SPEED_VERY_FAST, user, null, NORMAL_LAUNCH, pass_flags)
fired.throw_range = 20
fired.det_time = min(10, fired.det_time)
fired.activate(user, FALSE)
fired.forceMove(get_turf(src))
fired.throw_atom(target, 20, SPEED_VERY_FAST, user, null, NORMAL_LAUNCH, pass_flags)



Expand Down
9 changes: 5 additions & 4 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -501,13 +501,14 @@
if(ammo.sound_miss) playsound_client(L.client, ammo.sound_miss, get_turf(L), 75, TRUE)
L.visible_message(SPAN_AVOIDHARM("[src] misses [L]!"),
SPAN_AVOIDHARM("[src] narrowly misses you!"), null, 4, CHAT_TYPE_TAKING_HIT)
log_attack("[src] narrowly missed [key_name(L)]")
var/log_message = "[src] narrowly missed [key_name(L)]"

var/mob/living/carbon/shotby = firer
if(istype(shotby))
L.attack_log += "[time_stamp()]\] [src], fired by [key_name(firer)], narrowly missed [key_name(L)]"
shotby.attack_log += "[time_stamp()]\] [src], fired by [key_name(shotby)], narrowly missed [key_name(L)]"

L.attack_log += "\[[time_stamp()]\] [src], fired by [key_name(firer)], narrowly missed [key_name(L)]"
shotby.attack_log += "\[[time_stamp()]\] [src], fired by [key_name(shotby)], narrowly missed [key_name(L)]"
log_message = "[src], fired by [key_name(firer)], narrowly missed [key_name(L)]"
log_attack(log_message)

#if DEBUG_HIT_CHANCE
to_world(SPAN_DEBUG("([L]) Missed."))
Expand Down
22 changes: 18 additions & 4 deletions code/modules/shuttle/computers/dropship_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@
update_equipment(is_optimised)
if(is_set_flyby)
to_chat(user, SPAN_NOTICE("You begin the launch sequence for a flyby."))
var/log = "[key_name(user)] launched the dropship [src.shuttleId] on flyby."
msg_admin_niche(log)
log_interact(user, msg = "[log]")
shuttle.send_for_flyby()
return TRUE
var/dockId = params["target"]
Expand All @@ -387,6 +390,9 @@
return TRUE
SSshuttle.moveShuttle(shuttle.id, dock.id, TRUE)
to_chat(user, SPAN_NOTICE("You begin the launch sequence to [dock]."))
var/log = "[key_name(user)] launched the dropship [src.shuttleId] on transport."
msg_admin_niche(log)
log_interact(user, msg = "[log]")
return TRUE
if("button-push")
playsound(loc, get_sfx("terminal_button"), KEYBOARD_SOUND_VOLUME, 1)
Expand All @@ -403,10 +409,14 @@
to_chat(user, SPAN_WARNING("Door controls have been overridden. Please call technical support."))
if("set-ferry")
is_set_flyby = FALSE
msg_admin_niche("[key_name_admin(usr)] set the dropship [src.shuttleId] into transport")
var/log = "[key_name(user)] set the dropship [src.shuttleId] into transport"
msg_admin_niche(log)
log_interact(user, msg = "[log]")
if("set-flyby")
is_set_flyby = TRUE
msg_admin_niche("[key_name_admin(usr)] set the dropship [src.shuttleId] into flyby")
var/log = "[key_name(user)] set the dropship [src.shuttleId] into flyby."
msg_admin_niche(log)
log_interact(user, msg = "[log]")
if("set-automate")
var/almayer_lz = params["hangar_id"]
var/ground_lz = params["ground_id"]
Expand All @@ -426,7 +436,9 @@
shuttle.automated_lz_id = ground_lz
shuttle.automated_delay = delay
playsound(loc, get_sfx("terminal_button"), KEYBOARD_SOUND_VOLUME, 1)
message_admins("[key_name_admin(usr)] has set auto pilot on '[shuttle.name]'")
var/log = "[key_name(user)] has enabled auto pilot on '[shuttle.name]'"
message_admins(log)
log_interact(user, msg = "[log]")
return
/* TODO
if(!dropship.automated_launch) //If we're toggling it on...
Expand All @@ -440,7 +452,9 @@
shuttle.automated_lz_id = null
shuttle.automated_delay = null
playsound(loc, get_sfx("terminal_button"), KEYBOARD_SOUND_VOLUME, 1)
message_admins("[key_name_admin(usr)] has removed auto pilot on '[shuttle.name]'")
var/log = "[key_name(user)] has disabled auto pilot on '[shuttle.name]'"
message_admins(log)
log_interact(user, msg = "[log]")
return

if("cancel-flyby")
Expand Down

0 comments on commit 5ab0070

Please sign in to comment.