mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-06 07:22:42 +00:00
Merge pull request #9711 from mwerezak/syringelog
Syringe gun logs, logging helper reorganization
This commit is contained in:
@@ -20,6 +20,10 @@ var/global/floorIsLava = 0
|
||||
var/msg = rendered
|
||||
C << msg
|
||||
|
||||
proc/admin_notice(var/message, var/rights)
|
||||
for(var/mob/M in mob_list)
|
||||
if(check_rights(rights, 0, M))
|
||||
M << message
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////Panels
|
||||
|
||||
|
||||
48
code/modules/admin/admin_attack_log.dm
Normal file
48
code/modules/admin/admin_attack_log.dm
Normal file
@@ -0,0 +1,48 @@
|
||||
/mob/var/lastattacker = null
|
||||
/mob/var/lastattacked = null
|
||||
/mob/var/attack_log = list( )
|
||||
|
||||
proc/log_and_message_admins(var/message as text, var/mob/user = usr)
|
||||
log_admin(user ? "[key_name(user)] [message]" : "EVENT [message]")
|
||||
message_admins(user ? "[key_name(user)] [message]" : "EVENT [message]")
|
||||
|
||||
proc/log_and_message_admins_many(var/list/mob/users, var/message)
|
||||
if(!users || !users.len)
|
||||
return
|
||||
|
||||
var/list/user_keys = list()
|
||||
for(var/mob/user in users)
|
||||
user_keys += key_name(user)
|
||||
|
||||
log_admin("[english_list(user_keys)] [message]")
|
||||
message_admins("[english_list(user_keys)] [message]")
|
||||
|
||||
proc/admin_log_and_message_admins(var/message as text)
|
||||
log_admin(usr ? "[key_name_admin(usr)] [message]" : "EVENT [message]")
|
||||
message_admins(usr ? "[key_name_admin(usr)] [message]" : "EVENT [message]", 1)
|
||||
|
||||
proc/admin_attack_log(var/mob/attacker, var/mob/victim, var/attacker_message, var/victim_message, var/admin_message)
|
||||
if(victim)
|
||||
victim.attack_log += text("\[[time_stamp()]\] <font color='orange'>[key_name(attacker)] - [victim_message]</font>")
|
||||
if(attacker)
|
||||
attacker.attack_log += text("\[[time_stamp()]\] <font color='red'>[key_name(victim)] - [attacker_message]</font>")
|
||||
|
||||
msg_admin_attack("[key_name(attacker)] [admin_message] [key_name(victim)] (INTENT: [attacker? uppertext(attacker.a_intent) : "N/A"]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[attacker.x];Y=[attacker.y];Z=[attacker.z]'>JMP</a>)")
|
||||
|
||||
proc/admin_attacker_log_many_victims(var/mob/attacker, var/list/mob/victims, var/attacker_message, var/victim_message, var/admin_message)
|
||||
if(!victims || !victims.len)
|
||||
return
|
||||
|
||||
for(var/mob/victim in victims)
|
||||
admin_attack_log(attacker, victim, attacker_message, victim_message, admin_message)
|
||||
|
||||
proc/admin_inject_log(mob/attacker, mob/victim, obj/item/weapon, reagents, amount_transferred, violent=0)
|
||||
if(violent)
|
||||
violent = "violently "
|
||||
else
|
||||
violent = ""
|
||||
admin_attack_log(attacker,
|
||||
victim,
|
||||
"used \the [weapon] to [violent]inject - [reagents] - [amount_transferred]u transferred",
|
||||
"was [violent]injected with \the [weapon] - [reagents] - [amount_transferred]u transferred",
|
||||
"used \the [weapon] to [violent]inject [reagents] ([amount_transferred]u transferred) into")
|
||||
@@ -48,9 +48,6 @@
|
||||
var/use_me = 1 //Allows all mobs to use the me verb by default, will have to manually specify they cannot
|
||||
var/damageoverlaytemp = 0
|
||||
var/computer_id = null
|
||||
var/lastattacker = null
|
||||
var/lastattacked = null
|
||||
var/attack_log = list( )
|
||||
var/already_placed = 0.0
|
||||
var/obj/machinery/machine = null
|
||||
var/other_mobs = null
|
||||
|
||||
@@ -50,9 +50,11 @@
|
||||
if(speed >= 10 && isliving(hit_atom))
|
||||
var/mob/living/L = hit_atom
|
||||
//unfortuately we don't know where the dart will actually hit, since that's done by the parent.
|
||||
if(L.can_inject())
|
||||
if(syringe.reagents)
|
||||
syringe.reagents.trans_to_mob(L, 15, CHEM_BLOOD)
|
||||
if(L.can_inject() && syringe.reagents)
|
||||
var/reagent_log = syringe.reagents.get_reagents()
|
||||
syringe.reagents.trans_to_mob(L, 15, CHEM_BLOOD)
|
||||
admin_inject_log(thrower, L, src, reagent_log, 15, violent=1)
|
||||
|
||||
syringe.break_syringe(iscarbon(hit_atom)? hit_atom : null)
|
||||
syringe.update_icon()
|
||||
|
||||
|
||||
@@ -241,12 +241,10 @@
|
||||
return 0
|
||||
|
||||
/datum/reagents/proc/get_reagents()
|
||||
var/res = ""
|
||||
. = list()
|
||||
for(var/datum/reagent/current in reagent_list)
|
||||
if (res != "") res += ","
|
||||
res += "[current.id]([current.volume])"
|
||||
|
||||
return res
|
||||
. += "[current.id] ([current.volume])"
|
||||
return english_list(., "EMPTY", "", ", ", ", ")
|
||||
|
||||
/* Holder-to-holder and similar procs */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user