From 0abb642a606a60900a277716000e4259321ebebb Mon Sep 17 00:00:00 2001 From: Yoshax Date: Thu, 5 May 2016 19:59:36 +0100 Subject: [PATCH] Adds the ability to feed telecrystals to emags for more uses --- code/game/objects/items/weapons/cards_ids.dm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 17e9d35ab95..6d1a2eaa3dc 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -68,6 +68,7 @@ icon_state = "emag" item_state = "card-id" origin_tech = list(TECH_MAGNET = 2, TECH_ILLEGAL = 2) + var/default_uses = 10 var/uses = 10 /obj/item/weapon/card/emag/resolve_attackby(atom/A, mob/user) @@ -87,6 +88,12 @@ qdel(src) return 1 +/obj/item/weapon/card/emag/attackby(obj/item/O as obj, mob/user as mob) + if(istype(O, /obj/item/device/telecrystal)) + src.uses += default_uses/2 //Adds half the default amount of uses which is more than you get per TC when buying, as to balance the utility of having multiple emags vs one heavily usable one + usr << "You add \the [O] to \the [src]. Increasing the uses of \the [src] to [uses]." + qdel(O) + /obj/item/weapon/card/id name = "identification card"