Emags now have a ten-use limit.

This commit is contained in:
Zuhayr
2013-08-24 19:25:05 -07:00
parent 25685c1492
commit 591cde1ccb
4 changed files with 64 additions and 0 deletions

View File

@@ -54,6 +54,14 @@
/*
* ID CARDS
*/
/obj/item/weapon/card/emag_broken
desc = "It's a card with a magnetic strip attached to some circuitry. It looks too busted to be used for anything but salvage."
name = "broken cryptographic sequencer"
icon_state = "emag"
item_state = "card-id"
origin_tech = "magnets=2;syndicate=2"
/obj/item/weapon/card/emag
desc = "It's a card with a magnetic strip attached to some circuitry."
name = "cryptographic sequencer"
@@ -61,6 +69,56 @@
item_state = "card-id"
origin_tech = "magnets=2;syndicate=2"
var/uses = 10
// List of devices that cost a use to emag.
var/list/devices = list(
/obj/item/robot_parts,
/obj/item/weapon/storage/lockbox,
/obj/item/weapon/storage/secure,
/obj/item/weapon/circuitboard,
/obj/item/device/eftpos,
/obj/item/device/lightreplacer,
/obj/item/device/taperecorder,
/obj/item/device/hailer,
/obj/item/clothing/tie/holobadge,
/obj/structure/closet/crate/secure,
/obj/structure/closet/secure_closet,
/obj/machinery/librarycomp,
/obj/machinery/computer,
/obj/machinery/power,
/obj/machinery/suspension_gen,
/obj/machinery/shield_capacitor,
/obj/machinery/shield_gen,
/obj/machinery/zero_point_emitter,
/obj/machinery/clonepod,
/obj/machinery/deployable,
/obj/machinery/door_control,
/obj/machinery/porta_turret,
/obj/machinery/shieldgen,
/obj/machinery/turretid,
/obj/machinery/vending,
/obj/machinery/bot,
/obj/machinery/door,
/obj/machinery/telecomms,
/obj/machinery/mecha_part_fabricator
)
/obj/item/weapon/card/emag/afterattack(var/obj/item/weapon/O as obj, mob/user as mob)
for(var/type in devices)
if(istype(O,type))
uses--
break
if(uses<1)
user.visible_message("[src] fizzles and sparks - it seems it's been used once too often, and is now broken.")
user.drop_item()
var/obj/item/weapon/card/emag_broken/junk = new(user.loc)
junk.add_fingerprint(user)
del(src)
return
..()
/obj/item/weapon/card/id
name = "identification card"