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
+3
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
+3
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
+7
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
+4
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
/////////////////////////
@@ -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*";
@@ -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
@@ -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
@@ -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
+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( )
@@ -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
@@ -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)
@@ -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))
+4
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
+4
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