More logging and fingerprints

Added helper proc for general logging, replaced some logging with this
proc
Pulling now leaves fingerprints
Judging by the opinions in the thread will add some more
logging/fingerprints
This commit is contained in:
Razharas
2013-12-15 05:23:50 +04:00
parent 3e54ed6d54
commit 5045069899
4 changed files with 28 additions and 13 deletions
+19 -3
View File
@@ -34,9 +34,9 @@ proc/random_name(gender, attempts_to_find_unique_name=10)
for(var/i=1, i<=attempts_to_find_unique_name, i++)
if(gender==FEMALE) . = capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names))
else . = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))
if(i != attempts_to_find_unique_name && !findname(.))
break
break
proc/random_skin_tone()
return pick(skin_tones)
@@ -67,4 +67,20 @@ proc/age2agedescription(age)
if(45 to 60) return "middle-aged"
if(60 to 70) return "aging"
if(70 to INFINITY) return "elderly"
else return "unknown"
else return "unknown"
/*
Proc for attack log creation, because really why not
1 argument is the actor
2 argument is the target of action
3 is the description of action(like punched, throwed, or any other verb)
4 is the tool with which the action was made(usually item)
5 is additional information, anything that needs to be added
*/
proc/add_logs(mob/user, mob/target, what_done, var/object=null, var/addition=null)
if(ismob(user))
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Has [what_done] [target.name][ismob(target) ? "([target.ckey])" : ""][object ? " with [object]" : " "][addition]</font>")
if(ismob(target))
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [what_done] by [user.name][ismob(user) ? "([user.ckey])" : ""][object ? " with [object]" : " "][addition]</font>")
log_attack("<font color='red'>[user.name][ismob(user) ? "([user.ckey])" : ""] [what_done] [target.name][ismob(target) ? "([target.ckey])" : ""][object ? " with [object]" : " "][addition]</font>")
+1 -3
View File
@@ -35,9 +35,7 @@
user.lastattacked = M
M.lastattacker = user
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>" )
add_logs(user, M, "attacked", src.name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])")
//spawn(1800) // this wont work right
// M.lastattacker = null
@@ -3,6 +3,7 @@
return
if((M != src) && check_shields(0, M.name))
add_logs(src, M, "attenmped to touch")
visible_message("<span class='warning'>[M] attempted to touch [src]!</span>")
return 0
@@ -10,6 +11,7 @@
if("help")
if(health >= 0)
help_shake_act(M)
add_logs(src, M, "shaked")
return 1
//CPR
@@ -21,6 +23,7 @@
return 0
if(cpr_time < world.time + 30)
add_logs(src, M, "CPRed")
visible_message("<span class='notice'>[M] is trying to perform CPR on [src]!</span>")
if(!do_mob(M, src))
return 0
@@ -33,6 +36,8 @@
src << "<span class='unconscious'>You feel a breath of fresh air enter your lungs. It feels good.</span>"
if("grab")
add_logs(src, M, "grabbed", addition="passively")
if(M == src || anchored)
return 0
if(w_uniform)
@@ -53,10 +58,7 @@
return 1
if("harm")
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Punched [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been punched by [M.name] ([M.ckey])</font>")
log_attack("<font color='red'>[M.name] ([M.ckey]) punched [src.name] ([src.ckey])</font>")
add_logs(src, M, "punched")
var/attack_verb = "punch"
if(lying)
@@ -105,9 +107,7 @@
forcesay(hit_appends)
if("disarm")
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Disarmed [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been disarmed by [M.name] ([M.ckey])</font>")
log_attack("<font color='red'>[M.name] ([M.ckey]) disarmed [src.name] ([src.ckey])</font>")
add_logs(src, M, "disarmed")
if(w_uniform)
w_uniform.add_fingerprint(M)
+1
View File
@@ -528,6 +528,7 @@ var/list/slot_equipment_priority = list( \
if ( !AM || !usr || src==AM || !isturf(src.loc) ) //if there's no person pulling OR the person is pulling themself OR the object being pulled is inside something: abort!
return
if (!( AM.anchored ))
AM.add_fingerprint(src)
// If we're pulling something then drop what we're currently pulling and pull this instead.
if(pulling)