Attack log should now work. Please report and bugs you might find.

It should report attacking for most weapons. Some (health analyzer, weed killer and such) have been skipped.

As far as guns go it logs shots by and at for tasers, laser guns and energy guns.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1586 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz
2011-05-15 01:11:31 +00:00
parent 8e112f64f4
commit 911372623e
19 changed files with 103 additions and 3 deletions

View File

@@ -1024,6 +1024,9 @@
if (reagents.total_volume)
user << "\blue You inject [M] with the hypospray."
M << "\red You feel a tiny prick!"
M.attack_log += text("<font color='orange'>[world.time] - has been injected with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to inject [M.name] ([M.ckey])</font>")
src.reagents.reaction(M, INGEST)
if(M.reagents)
var/trans = reagents.trans_to(M, amount_per_transfer_from_this)
@@ -1089,8 +1092,8 @@
if(!do_mob(user, M)) return
M.attack_log += text("[] <b>[]/[]</b> feeds <b>[]/[]</b> with <b>[]</b>", world.time, user, user.client, M, M.client, src)
user.attack_log += text("[] <b>[]/[]</b> feeds <b>[]/[]</b> with <b>[]</b>", world.time, user, user.client, M, M.client, src)
M.attack_log += text("<font color='orange'>[world.time] - has been fed [src.name] by [user.name] ([user.ckey]) Reagents: \ref[reagents]</font>")
user.attack_log += text("<font color='red'>[world.time] - has fed [M.name] by [M.name] ([M.ckey]) Reagents: \ref[reagents]</font>")
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] feeds [M] [src].", 1)
@@ -1236,6 +1239,10 @@
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] feeds [M] [src].", 1)
M.attack_log += text("<font color='orange'>[world.time] - has been fed [src.name] by [user.name] ([user.ckey]) Reagents: \ref[reagents]</font>")
user.attack_log += text("<font color='red'>[world.time] - has fed [M.name] by [M.name] ([M.ckey]) Reagents: \ref[reagents]</font>")
if(reagents.total_volume)
reagents.reaction(M, INGEST)
spawn(5)
@@ -1354,6 +1361,10 @@
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] forces [M] to swallow [src].", 1)
M.attack_log += text("<font color='orange'>[world.time] - has been fed [src.name] by [user.name] ([user.ckey]) Reagents: \ref[reagents]</font>")
user.attack_log += text("<font color='red'>[world.time] - has fed [M.name] by [M.name] ([M.ckey]) Reagents: \ref[reagents]</font>")
if(reagents.total_volume)
reagents.reaction(M, INGEST)
spawn(5)
@@ -1801,6 +1812,10 @@
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] feeds [M] [src].", 1)
M.attack_log += text("<font color='orange'>[world.time] - has been fed [src.name] by [user.name] ([user.ckey]) Reagents: \ref[reagents]</font>")
user.attack_log += text("<font color='red'>[world.time] - has fed [src.name] by [M.name] ([M.ckey]) Reagents: \ref[reagents]</font>")
if(reagents.total_volume)
reagents.reaction(M, INGEST)
spawn(5)

View File

@@ -60,6 +60,9 @@
attack(target as obj, mob/user as mob)
user.attack_log += text("<font color='blue'>[world.time] - has used [src.name] on \ref[target]</font>")
if (istype(target, /obj/item))
var/obj/item/O = target
if (src.amount > 1)

View File

@@ -211,6 +211,7 @@ obj/item/toy/blink
if(O.client)
O.show_message(text("\red <B>[] casually lines up a shot with []'s head and pulls the trigger!</B>", user, M), 1, "\red You hear the sound of foam against skull", 2)
O.show_message(text("\red [] was hit in the head by the foam dart!", M), 1)
playsound(user.loc, 'syringeproj.ogg', 50, 1)
new /obj/item/toy/ammo/crossbow(M.loc)
src.bullets--

View File

@@ -370,6 +370,9 @@ var/runedec = 0
attack(mob/living/M as mob, mob/living/user as mob)
M.attack_log += text("<font color='orange'>[world.time] - has has had the [src.name] used on him by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used [src.name] on [M.name] ([M.ckey])</font>")
if(istype(M,/mob/dead))
M.invisibility = 0
user.visible_message( \

View File

@@ -13,6 +13,9 @@
if(!istype(M, /mob/living/silicon/ai))//If target is not an AI.
return ..()
M.attack_log += text("<font color='orange'>[world.time] - has been carded with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to card [M.name] ([M.ckey])</font>")
transfer_ai("AICORE", "AICARD", M, user)
return

View File

@@ -5,6 +5,9 @@
usr.drop_item()
return
if (src.shots > 0)
M.attack_log += text("<font color='orange'>[world.time] - has been flashed (attempt) with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to flash [M.name] ([M.ckey])</font>")
var/safety = null
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M

View File

@@ -34,6 +34,9 @@
usr << "\red You don't have the dexterity to do this!"
return
if (istype(M, /mob/living/carbon/human))
M.attack_log += text("<font color='orange'>[world.time] - has been handcuffed (attempt) by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has attempted to handcuff [M.name] ([M.ckey])</font>")
var/obj/equip_e/human/O = new /obj/equip_e/human( )
O.source = user
O.target = M
@@ -171,6 +174,8 @@
// O.show_message(text("\red [] has been stabbed with [] by [].", M, src, user), 1)
user << "\red You stab [M] with the pen."
M << "\red You feel a tiny prick!"
M.attack_log += text("<font color='orange'>[world.time] - has been stabbed with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to stab [M.name] ([M.ckey])</font>")
if(M.reagents) reagents.trans_to(M, 50) //used to be 150
return
@@ -188,6 +193,8 @@
if (reagents.total_volume)
user << "\red You stab [M] with the penlight."
M << "\red You feel a tiny prick!"
M.attack_log += text("<font color='orange'>[world.time] - has been stabbed with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to stab [M.name] ([M.ckey])</font>")
if(M.reagents) reagents.trans_to(M, 15)
..()
return

View File

@@ -173,6 +173,10 @@
/////////////////////////
user.lastattacked = M
M.lastattacker = user
user.attack_log += "<font color='red'> Attacked [M.name] ([M.ckey]) with [src.name]</font>"
M.attack_log += "<font color='orange'> Attacked by [user.name] ([user.ckey]) with [src.name]</font>"
//spawn(1800) // this wont work right
// M.lastattacker = null
/////////////////////////

View File

@@ -197,6 +197,9 @@ obj/item/weapon/gun/revolver/attackby(obj/item/weapon/ammo/a357/A as obj, mob/li
playsound(user, 'Gunshot.ogg', 100, 1)
for(var/mob/O in viewers(M, null))
if(O.client) O.show_message(text("\red <B>[] has been shot point-blank by []!</B>", M, user), 1, "\red You hear a gunshot", 2)
M.attack_log += text("<font color='orange'>[world.time] - has been shot point blank with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to shoot [M.name] ([M.ckey]) at point blank range.</font>")
M.bullet_act(PROJECTILE_BULLET, src, user.get_organ_target())
src.bullets--
else
@@ -598,6 +601,11 @@ obj/item/weapon/gun/revolver/attackby(obj/item/weapon/ammo/a357/A as obj, mob/li
return
src.add_fingerprint(user)
user.attack_log += text("<font color='red'>[world.time] - has fired the [src.name] at [target.name] at ([target.x], [target.y], [target.z])</font>")
if(ismob(target))
var/mob/TAR = target
TAR.attack_log += text("<font color='orange'>[world.time] - has been fired at by [src.name] by [user.name] at ([user.ckey])</font>")
if(src.charges < 1)
user << "\red *click* *click*"
@@ -681,6 +689,12 @@ obj/item/weapon/gun/revolver/attackby(obj/item/weapon/ammo/a357/A as obj, mob/li
if ((istype(user, /mob/living/carbon/monkey)) && ticker.mode != "monkey")
user << "\red You don't have the dexterity to do this!"
return
user.attack_log += text("<font color='red'>[world.time] - has fired the [src.name] at [target.name] at ([target.x], [target.y], [target.z])</font>")
if(ismob(target))
var/mob/TAR = target
TAR.attack_log += text("<font color='orange'>[world.time] - has been fired at by [src.name] by [user.name] at ([user.ckey])</font>")
src.add_fingerprint(user)
if(!isrobot(user) && src.charges < 1)
user << "\red *click* *click*";
@@ -724,6 +738,9 @@ obj/item/weapon/gun/revolver/attackby(obj/item/weapon/ammo/a357/A as obj, mob/li
usr.paralysis += 60
return
src.add_fingerprint(user)
M.attack_log += text("<font color='orange'>[world.time] - has been ahot at with a [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has shot witha [src.name] at [M.name] ([M.ckey])</font>")
var/mob/living/carbon/human/H = M
if ((istype(H, /mob/living/carbon/human) && istype(H, /obj/item/clothing/head) && H.flags & 8 && prob(80)))
M << "\red The helmet protects you from being hit hard in the head!"
@@ -940,6 +957,9 @@ obj/item/weapon/gun/revolver/attackby(obj/item/weapon/ammo/a357/A as obj, mob/li
point_blank_teleport(usr)
return
src.add_fingerprint(user)
M.attack_log += text("<font color='orange'>[world.time] - has been shot at with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has shot with [src.name] at [M.name] ([M.ckey])</font>")
if(src.charges >= 1)
if (prob(95))
point_blank_teleport(M)
@@ -1082,6 +1102,10 @@ obj/item/weapon/gun/revolver/attackby(obj/item/weapon/ammo/a357/A as obj, mob/li
return
src.add_fingerprint(user)
user.attack_log += text("<font color='red'>[world.time] - has fired the [src.name] at [target.name] at ([target.x], [target.y], [target.z])</font>")
if(ismob(target))
var/mob/TAR = target
TAR.attack_log += text("<font color='orange'>[world.time] - has been fired at by [src.name] by [user.name] ([user.ckey])</font>")
if(src.charges < 1)
user << "\red *click* *click*";

View File

@@ -109,6 +109,9 @@ Deathnettle
if(!..()) return
if(istype(M, /mob/living))
M << "\red You are stunned by the powerful acid of the Deathnettle!"
M.attack_log += text("<font color='orange'>[world.time] - has had the [src.name] used on them by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] on [M.name] ([M.ckey])</font>")
M.eye_blurry += force/7
if(prob(20))
M.paralysis += force/6

View File

@@ -301,6 +301,8 @@ the implant may become unstable and either pre-maturely inject the subject or si
if (user && src.imp)
for (var/mob/O in viewers(M, null))
O.show_message("\red [M] has been implanted by [user].", 1)
M.attack_log += text("<font color='orange'>[world.time] - has been implanted with [src.name] ([src.imp.name]) by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] ([src.imp.name]) to implant [M.name] ([M.ckey])</font>")
src.imp.loc = M
src.imp.imp_in = M
src.imp.implanted = 1

View File

@@ -52,6 +52,9 @@ KNIFE
user.take_organ_damage(10)
user.paralysis += 2
return
M.attack_log += text("<font color='orange'>[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])</font>")
if (M.stat < 2 && M.health < 50 && prob(90))
var/mob/H = M
// ******* Check
@@ -111,6 +114,8 @@ KNIFE
if (istype(location, /turf/simulated))
location.add_blood(H) ///Plik plik, the sound of blood
M.attack_log += text("<font color='orange'>[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])</font>")
if(prob(15))
M.weakened += 3

View File

@@ -63,6 +63,9 @@ DNA INJECTOR
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
user << "\red You don't have the dexterity to do this!"
return
M.attack_log += text("<font color='orange'>[world.time] - has been injected with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to inject [M.name] ([M.ckey])</font>")
if (user)
if (istype(M, /mob/living/carbon/human))
var/obj/equip_e/human/O = new /obj/equip_e/human( )

View File

@@ -456,7 +456,7 @@ CLIPBOARDS
usr << text("There is about [] square units of paper left!", src.amount)
return
/obj/item/weapon/wrapping_paper/attack(target as mob, mob/user as mob)
/obj/item/weapon/wrapping_paper/attack(mob/target as mob, mob/user as mob)
if (!istype(target, /mob/living/carbon/human)) return
if (istype(target:wear_suit, /obj/item/clothing/suit/straight_jacket) || target:stat)
if (src.amount > 2)
@@ -468,6 +468,9 @@ CLIPBOARDS
target:client:eye = present
target:loc = present
target.attack_log += text("<font color='orange'>[world.time] - has been wrapped with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to wrap [target.name] ([target.ckey])</font>")
else
user << "/blue You need more paper."
else

View File

@@ -121,6 +121,9 @@ STUN BATON
src.add_fingerprint(user)
var/mob/living/carbon/human/H = M
M.attack_log += text("<font color='orange'>[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])</font>")
if (status == 0 || (status == 1 && charges ==0))
if(user.a_intent == "hurt")
@@ -215,6 +218,9 @@ STUN BATON
return
src.add_fingerprint(user)
M.attack_log += text("<font color='orange'>[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])</font>")
if (user.a_intent == "hurt")
if(!..()) return
playsound(src.loc, "swing_hit", 50, 1, -1)

View File

@@ -22,6 +22,10 @@
user.paralysis += 2
return
M.attack_log += text("<font color='orange'>[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])</font>")
var/t = user:zone_sel.selecting
if (t == "head")
if (M.stat < 2 && M.health < 50 && prob(90))

View File

@@ -26,6 +26,10 @@
if(user.mind && (user.mind.assigned_role == "Chaplain"))
chaplain = 1
M.attack_log += text("<font color='orange'>[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])</font>")
if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
user << "\red You don't have the dexterity to do this!"
return

View File

@@ -17,6 +17,10 @@
user.paralysis += 2
return
M.attack_log += text("<font color='orange'>[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])</font>")
if (M.stat < 2 && M.health < 50 && prob(90))
var/mob/H = M
// ******* Check

View File

@@ -185,6 +185,9 @@ obj/item/weapon/robot_module/syndicate/New()
icon_state = "shock"
attack(mob/M as mob, mob/living/silicon/robot/user as mob)
M.attack_log += text("<font color='orange'>[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("<font color='red'>[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])</font>")
user.cell.charge -= 30
if (M.weakened < 5)
M.weakened = 5