From 911372623e36d953ff55037a448f162864fc6e1d Mon Sep 17 00:00:00 2001 From: "baloh.matevz" Date: Sun, 15 May 2011 01:11:31 +0000 Subject: [PATCH] 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 --- code/WorkInProgress/Chemistry-Tools.dm | 19 +++++++++++++-- .../recycling/sortingmachinery.dm | 3 +++ code/defines/obj/toy.dm | 1 + code/game/magic/cultist/ritual.dm | 3 +++ code/game/objects/devices/aicard.dm | 3 +++ code/game/objects/devices/flash.dm | 3 +++ code/game/objects/items.dm | 7 ++++++ code/game/objects/items/item.dm | 4 ++++ code/game/objects/items/weapons/guns_ammo.dm | 24 +++++++++++++++++++ .../game/objects/items/weapons/hydroponics.dm | 3 +++ code/game/objects/items/weapons/implants.dm | 2 ++ code/game/objects/items/weapons/kitchen.dm | 5 ++++ code/game/objects/items/weapons/misc.dm | 3 +++ .../game/objects/items/weapons/papers_bins.dm | 5 +++- .../objects/items/weapons/swords_axes_etc.dm | 6 +++++ code/game/objects/secstorage/sbriefcase.dm | 4 ++++ code/game/objects/storage/bible.dm | 4 ++++ code/game/objects/storage/briefcase.dm | 4 ++++ .../mob/living/silicon/robot/robot_modules.dm | 3 +++ 19 files changed, 103 insertions(+), 3 deletions(-) diff --git a/code/WorkInProgress/Chemistry-Tools.dm b/code/WorkInProgress/Chemistry-Tools.dm index 950195c80d..1abc69abff 100644 --- a/code/WorkInProgress/Chemistry-Tools.dm +++ b/code/WorkInProgress/Chemistry-Tools.dm @@ -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("[world.time] - has been injected with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to inject [M.name] ([M.ckey])") 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("[] []/[] feeds []/[] with []", world.time, user, user.client, M, M.client, src) - user.attack_log += text("[] []/[] feeds []/[] with []", world.time, user, user.client, M, M.client, src) + M.attack_log += text("[world.time] - has been fed [src.name] by [user.name] ([user.ckey]) Reagents: \ref[reagents]") + user.attack_log += text("[world.time] - has fed [M.name] by [M.name] ([M.ckey]) Reagents: \ref[reagents]") 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("[world.time] - has been fed [src.name] by [user.name] ([user.ckey]) Reagents: \ref[reagents]") + user.attack_log += text("[world.time] - has fed [M.name] by [M.name] ([M.ckey]) Reagents: \ref[reagents]") + + 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("[world.time] - has been fed [src.name] by [user.name] ([user.ckey]) Reagents: \ref[reagents]") + user.attack_log += text("[world.time] - has fed [M.name] by [M.name] ([M.ckey]) Reagents: \ref[reagents]") + + 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("[world.time] - has been fed [src.name] by [user.name] ([user.ckey]) Reagents: \ref[reagents]") + user.attack_log += text("[world.time] - has fed [src.name] by [M.name] ([M.ckey]) Reagents: \ref[reagents]") + + if(reagents.total_volume) reagents.reaction(M, INGEST) spawn(5) diff --git a/code/WorkInProgress/recycling/sortingmachinery.dm b/code/WorkInProgress/recycling/sortingmachinery.dm index 9ba99dbd96..f6fd60950b 100644 --- a/code/WorkInProgress/recycling/sortingmachinery.dm +++ b/code/WorkInProgress/recycling/sortingmachinery.dm @@ -60,6 +60,9 @@ attack(target as obj, mob/user as mob) + + user.attack_log += text("[world.time] - has used [src.name] on \ref[target]") + if (istype(target, /obj/item)) var/obj/item/O = target if (src.amount > 1) diff --git a/code/defines/obj/toy.dm b/code/defines/obj/toy.dm index cf99e2e6f8..6fc215620d 100644 --- a/code/defines/obj/toy.dm +++ b/code/defines/obj/toy.dm @@ -211,6 +211,7 @@ obj/item/toy/blink if(O.client) O.show_message(text("\red [] casually lines up a shot with []'s head and pulls the trigger!", 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-- diff --git a/code/game/magic/cultist/ritual.dm b/code/game/magic/cultist/ritual.dm index 69cbb5a94e..f01b5a9ab0 100644 --- a/code/game/magic/cultist/ritual.dm +++ b/code/game/magic/cultist/ritual.dm @@ -370,6 +370,9 @@ var/runedec = 0 attack(mob/living/M as mob, mob/living/user as mob) + M.attack_log += text("[world.time] - has has had the [src.name] used on him by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used [src.name] on [M.name] ([M.ckey])") + if(istype(M,/mob/dead)) M.invisibility = 0 user.visible_message( \ diff --git a/code/game/objects/devices/aicard.dm b/code/game/objects/devices/aicard.dm index 1315a1ef20..149a43527e 100644 --- a/code/game/objects/devices/aicard.dm +++ b/code/game/objects/devices/aicard.dm @@ -13,6 +13,9 @@ if(!istype(M, /mob/living/silicon/ai))//If target is not an AI. return ..() + M.attack_log += text("[world.time] - has been carded with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to card [M.name] ([M.ckey])") + transfer_ai("AICORE", "AICARD", M, user) return diff --git a/code/game/objects/devices/flash.dm b/code/game/objects/devices/flash.dm index 3ef2a6f6ef..56e58d9e74 100644 --- a/code/game/objects/devices/flash.dm +++ b/code/game/objects/devices/flash.dm @@ -5,6 +5,9 @@ usr.drop_item() return if (src.shots > 0) + M.attack_log += text("[world.time] - has been flashed (attempt) with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to flash [M.name] ([M.ckey])") + var/safety = null if (istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 99f9e0da95..cc33572991 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -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("[world.time] - has been handcuffed (attempt) by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has attempted to handcuff [M.name] ([M.ckey])") + 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("[world.time] - has been stabbed with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to stab [M.name] ([M.ckey])") 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("[world.time] - has been stabbed with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to stab [M.name] ([M.ckey])") if(M.reagents) reagents.trans_to(M, 15) ..() return diff --git a/code/game/objects/items/item.dm b/code/game/objects/items/item.dm index e8bf2e7941..8c99b03909 100644 --- a/code/game/objects/items/item.dm +++ b/code/game/objects/items/item.dm @@ -173,6 +173,10 @@ ///////////////////////// user.lastattacked = M M.lastattacker = user + + user.attack_log += " Attacked [M.name] ([M.ckey]) with [src.name]" + M.attack_log += " Attacked by [user.name] ([user.ckey]) with [src.name]" + //spawn(1800) // this wont work right // M.lastattacker = null ///////////////////////// diff --git a/code/game/objects/items/weapons/guns_ammo.dm b/code/game/objects/items/weapons/guns_ammo.dm index 320df2a2a0..87bd238437 100644 --- a/code/game/objects/items/weapons/guns_ammo.dm +++ b/code/game/objects/items/weapons/guns_ammo.dm @@ -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 [] has been shot point-blank by []!", M, user), 1, "\red You hear a gunshot", 2) + M.attack_log += text("[world.time] - has been shot point blank with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to shoot [M.name] ([M.ckey]) at point blank range.") + 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("[world.time] - has fired the [src.name] at [target.name] at ([target.x], [target.y], [target.z])") + if(ismob(target)) + var/mob/TAR = target + TAR.attack_log += text("[world.time] - has been fired at by [src.name] by [user.name] at ([user.ckey])") + 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("[world.time] - has fired the [src.name] at [target.name] at ([target.x], [target.y], [target.z])") + if(ismob(target)) + var/mob/TAR = target + TAR.attack_log += text("[world.time] - has been fired at by [src.name] by [user.name] at ([user.ckey])") + 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("[world.time] - has been ahot at with a [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has shot witha [src.name] at [M.name] ([M.ckey])") + 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("[world.time] - has been shot at with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has shot with [src.name] at [M.name] ([M.ckey])") + 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("[world.time] - has fired the [src.name] at [target.name] at ([target.x], [target.y], [target.z])") + if(ismob(target)) + var/mob/TAR = target + TAR.attack_log += text("[world.time] - has been fired at by [src.name] by [user.name] ([user.ckey])") if(src.charges < 1) user << "\red *click* *click*"; diff --git a/code/game/objects/items/weapons/hydroponics.dm b/code/game/objects/items/weapons/hydroponics.dm index 2dd25d69c6..48dc758296 100644 --- a/code/game/objects/items/weapons/hydroponics.dm +++ b/code/game/objects/items/weapons/hydroponics.dm @@ -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("[world.time] - has had the [src.name] used on them by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] on [M.name] ([M.ckey])") + M.eye_blurry += force/7 if(prob(20)) M.paralysis += force/6 diff --git a/code/game/objects/items/weapons/implants.dm b/code/game/objects/items/weapons/implants.dm index 23a5d343d9..b7d0e6cb0d 100644 --- a/code/game/objects/items/weapons/implants.dm +++ b/code/game/objects/items/weapons/implants.dm @@ -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("[world.time] - has been implanted with [src.name] ([src.imp.name]) by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] ([src.imp.name]) to implant [M.name] ([M.ckey])") src.imp.loc = M src.imp.imp_in = M src.imp.implanted = 1 diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm index 0855e4e22a..a56fb98a38 100644 --- a/code/game/objects/items/weapons/kitchen.dm +++ b/code/game/objects/items/weapons/kitchen.dm @@ -52,6 +52,9 @@ KNIFE user.take_organ_damage(10) user.paralysis += 2 return + M.attack_log += text("[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])") + 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("[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])") if(prob(15)) M.weakened += 3 diff --git a/code/game/objects/items/weapons/misc.dm b/code/game/objects/items/weapons/misc.dm index 2f928f332d..51541ce064 100644 --- a/code/game/objects/items/weapons/misc.dm +++ b/code/game/objects/items/weapons/misc.dm @@ -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("[world.time] - has been injected with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to inject [M.name] ([M.ckey])") + if (user) if (istype(M, /mob/living/carbon/human)) var/obj/equip_e/human/O = new /obj/equip_e/human( ) diff --git a/code/game/objects/items/weapons/papers_bins.dm b/code/game/objects/items/weapons/papers_bins.dm index e3368be213..35706b34af 100644 --- a/code/game/objects/items/weapons/papers_bins.dm +++ b/code/game/objects/items/weapons/papers_bins.dm @@ -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("[world.time] - has been wrapped with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to wrap [target.name] ([target.ckey])") + else user << "/blue You need more paper." else diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm index 9508f55694..3f2272ab60 100644 --- a/code/game/objects/items/weapons/swords_axes_etc.dm +++ b/code/game/objects/items/weapons/swords_axes_etc.dm @@ -121,6 +121,9 @@ STUN BATON src.add_fingerprint(user) var/mob/living/carbon/human/H = M + M.attack_log += text("[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])") + 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("[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])") + if (user.a_intent == "hurt") if(!..()) return playsound(src.loc, "swing_hit", 50, 1, -1) diff --git a/code/game/objects/secstorage/sbriefcase.dm b/code/game/objects/secstorage/sbriefcase.dm index af6dfa30e8..3a9b29bbdd 100644 --- a/code/game/objects/secstorage/sbriefcase.dm +++ b/code/game/objects/secstorage/sbriefcase.dm @@ -22,6 +22,10 @@ user.paralysis += 2 return + + M.attack_log += text("[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])") + var/t = user:zone_sel.selecting if (t == "head") if (M.stat < 2 && M.health < 50 && prob(90)) diff --git a/code/game/objects/storage/bible.dm b/code/game/objects/storage/bible.dm index 868d518c5a..2e827f50b7 100644 --- a/code/game/objects/storage/bible.dm +++ b/code/game/objects/storage/bible.dm @@ -26,6 +26,10 @@ if(user.mind && (user.mind.assigned_role == "Chaplain")) chaplain = 1 + + M.attack_log += text("[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])") + if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") user << "\red You don't have the dexterity to do this!" return diff --git a/code/game/objects/storage/briefcase.dm b/code/game/objects/storage/briefcase.dm index b10c61ec20..b33d20f29a 100644 --- a/code/game/objects/storage/briefcase.dm +++ b/code/game/objects/storage/briefcase.dm @@ -17,6 +17,10 @@ user.paralysis += 2 return + + M.attack_log += text("[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])") + if (M.stat < 2 && M.health < 50 && prob(90)) var/mob/H = M // ******* Check diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index c0e47666d9..d59013db16 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -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("[world.time] - has been attacked with [src.name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [src.name] to attack [M.name] ([M.ckey])") user.cell.charge -= 30 if (M.weakened < 5) M.weakened = 5