From 36d92b8c2dcfbc025ad815b9d08b0ea92ef4b630 Mon Sep 17 00:00:00 2001 From: PKPenguin321 Date: Sat, 28 Nov 2015 14:57:36 -0800 Subject: [PATCH] fixes everything i broke everything by giving teleprods a unique attack_self but forgetting to include the original functions of attack_self, making them unable to turn on/off. this fixes that. --- code/game/objects/items/weapons/teleprod.dm | 34 +++++++++++++-------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/code/game/objects/items/weapons/teleprod.dm b/code/game/objects/items/weapons/teleprod.dm index bbb91a69106..058b8e0756d 100644 --- a/code/game/objects/items/weapons/teleprod.dm +++ b/code/game/objects/items/weapons/teleprod.dm @@ -36,15 +36,25 @@ else user.visible_message("You can't install the crystal onto the stunprod while it has a powercell installed!") -/obj/item/weapon/melee/baton/cattleprod/teleprod/attack_self(mob/user, obj/item/I)//handles removing the bluespace crystal - if(!bcell) - var/obj/item/weapon/melee/baton/cattleprod/S = new /obj/item/weapon/melee/baton/cattleprod - if(!remove_item_from_storage(user)) - user.unEquip(src) - var/turf/floorloc = get_turf(user) - floorloc.contents += contents//drops the contents of the prod (the only content should be the crystal) at the user's feet - user.unEquip(I) - user.put_in_hands(S) - user << "You carefully remove the bluespace crystal from the teleprod." - qdel(I) - qdel(src) \ No newline at end of file +/obj/item/weapon/melee/baton/cattleprod/teleprod/attack_self(mob/user, obj/item/I)//handles removing the bluespace crystal + turning the prod on and off + if(bcell && bcell.charge > hitcost) + status = !status + user << "[src] is now [status ? "on" : "off"]." + playsound(loc, "sparks", 75, 1, -1) + else + status = 0 + if(!bcell) + var/obj/item/weapon/melee/baton/cattleprod/S = new /obj/item/weapon/melee/baton/cattleprod + if(!remove_item_from_storage(user)) + user.unEquip(src) + var/turf/floorloc = get_turf(user) + floorloc.contents += contents//drops the contents of the prod (the only content should be the crystal) at the user's feet + user.unEquip(I) + user.put_in_hands(S) + user << "You carefully remove the bluespace crystal from the teleprod." + qdel(I) + qdel(src) + else + user << "[src] is out of charge." + update_icon() + add_fingerprint(user) \ No newline at end of file