From d714b3eef713d79be6cc2f327780c38e89199b17 Mon Sep 17 00:00:00 2001 From: "n3ophyt3@gmail.com" Date: Wed, 23 Mar 2011 18:21:13 +0000 Subject: [PATCH] Cameras can now be constructed, courtesy of some cool guys that run Powerful Station 13. Start with a grenade casing 1)Wrench it into position 2)Stuff a multitool in it 3)Screwdrive the multitool into place 4)Add wire 5)Stuff a remote signaling device in it Optional)If you want a motion camera (mostly useless), stuff a prox sensor in it 6)Add some glass 7)Secure glass with screwdriver 8)Set camera network 9)Set camera sprite direction To start dismantling a camera, disable it, then use a wrench on it. from there; 1)Crowbar to remove glass Optional) Crowbar to remove prox sensor 2)Crowbar to remove signaler 3)Wirecutter to remove wire 4)Screwdriver to unsecure multitool 5)Crowbar to remove multitool 6)Wrench to unsecure casing Also from Powerful Station 13, the AI's change camera network verb is more robust, allowing for use of any new camera networks created by the crew. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1249 316c924e-a436-60f5-8080-3fe189b3f50e --- code/WorkInProgress/Chemistry-Tools.dm | 164 +++++++++++++++++++---- code/game/machinery/camera.dm | 14 ++ code/modules/mob/living/silicon/ai/ai.dm | 49 ++++--- 3 files changed, 177 insertions(+), 50 deletions(-) diff --git a/code/WorkInProgress/Chemistry-Tools.dm b/code/WorkInProgress/Chemistry-Tools.dm index 3b9ed0b9448..b205b699511 100644 --- a/code/WorkInProgress/Chemistry-Tools.dm +++ b/code/WorkInProgress/Chemistry-Tools.dm @@ -3,8 +3,9 @@ // Bandaid fix using spawn - very ugly, need to fix this. ///////////////////////////////Grenades +//Includes changes by Mord_Sith to allow for buildable cameras /obj/item/weapon/chem_grenade - name = "grenade" + name = "Grenade Casing" icon_state = "chemg" icon = 'chemical.dmi' item_state = "flashbang" @@ -12,6 +13,10 @@ force = 2.0 var/stage = 0 var/state = 0 + var/path = 0 + var/motion = 0 + var/direct = "SOUTH" + var/obj/item/weapon/circuitboard/circuit = null var/list/beakers = new/list() var/list/allowed_containers = list("/obj/item/weapon/reagent_containers/glass/beaker", "/obj/item/weapon/reagent_containers/glass/dispenser") var/list/disallowed_container = "/obj/item/weapon/reagent_containers/glass/large" @@ -25,41 +30,147 @@ R.my_atom = src attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W,/obj/item/assembly/time_ignite) && !stage) + if(istype(W,/obj/item/assembly/time_ignite) && !stage && path != 2) + path = 1 user << "\blue You add [W] to the metal casing." playsound(src.loc, 'Screwdriver2.ogg', 25, -3) del(W) //Okay so we're not really adding anything here. cheating. - icon_state = initial(icon_state)+"_ass" + icon_state = "chemg2" + name = "unsecured grenade" stage = 1 - else if(istype(W,/obj/item/weapon/screwdriver) && stage == 1) + else if(istype(W,/obj/item/weapon/screwdriver) && stage == 1 && path != 2) + path = 1 if(beakers.len) user << "\blue You lock the assembly." playsound(src.loc, 'Screwdriver.ogg', 25, -3) - icon_state = initial(icon_state)+"_locked" + name = "grenade" + icon_state = "chemg3" stage = 2 else user << "\red You need to add at least one beaker before locking the assembly." - else - var/found = 0 - for(var/container_type in allowed_containers) - if(istype(W, text2path(container_type))) - found = 1 - break - if(disallowed_container) - if(istype(W, disallowed_container)) - return - if(found) - if(beakers.len == 2) - user << "\red The grenade can not hold more containers." - return + else if (istype(W,/obj/item/weapon/reagent_containers/glass/beaker) && stage == 1 && path != 2) + path = 1 + if(beakers.len == 2) + user << "\red The grenade can not hold more containers." + return + else + if(W.reagents.total_volume) + user << "\blue You add \the [W] to the assembly." + user.drop_item() + W.loc = src + beakers += W else - if(W.reagents.total_volume) - user << "\blue You add \the [W] to the assembly." - user.drop_item() - W.loc = src - beakers += W - else - user << "\red \the [W] is empty." + user << "\red \the [W] is empty." + + else if(path != 1) + if(!istype(src.loc,/turf)) + user << "\red You need to put the canister on the ground to do that!" + else + switch(state) + if(0) + if(istype(W, /obj/item/weapon/wrench)) + playsound(src.loc, 'Ratchet.ogg', 50, 1) + if(do_after(user, 20)) + user << "\blue You wrench the canister in place." + src.name = "Camera Assembly" + src.anchored = 1 + src.state = 1 + path = 2 + if(1) + if(istype(W, /obj/item/weapon/wrench)) + playsound(src.loc, 'Ratchet.ogg', 50, 1) + if(do_after(user, 20)) + user << "\blue You unfasten the canister." + src.name = "Grenade Casing" + src.anchored = 0 + src.state = 0 + path = 0 + if(istype(W, /obj/item/device/multitool)) + playsound(src.loc, 'Deconstruct.ogg', 50, 1) + user << "\blue You place the electronics inside the canister." + src.circuit = W + user.drop_item() + W.loc = src + if(istype(W, /obj/item/weapon/screwdriver) && circuit) + playsound(src.loc, 'Screwdriver.ogg', 50, 1) + user << "\blue You screw the circuitry into place." + src.state = 2 + if(istype(W, /obj/item/weapon/crowbar) && circuit) + playsound(src.loc, 'Crowbar.ogg', 50, 1) + user << "\blue You remove the circuitry." + src.state = 1 + circuit.loc = src.loc + src.circuit = null + if(2) + if(istype(W, /obj/item/weapon/screwdriver) && circuit) + playsound(src.loc, 'Screwdriver.ogg', 50, 1) + user << "\blue You unfasten the circuitry." + src.state = 1 + if(istype(W, /obj/item/weapon/cable_coil)) + if(W:amount >= 1) + playsound(src.loc, 'Deconstruct.ogg', 50, 1) + if(do_after(user, 20)) + W:amount -= 1 + if(!W:amount) del(W) + user << "\blue You add cabling to the canister." + src.state = 3 + if(3) + if(istype(W, /obj/item/weapon/wirecutters)) + playsound(src.loc, 'wirecutter.ogg', 50, 1) + user << "\blue You remove the cabling." + src.state = 2 + var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( src.loc ) + A.amount = 1 + if(istype(W, /obj/item/device/radio/signaler)) + playsound(src.loc, 'Deconstruct.ogg', 50, 1) + user << "\blue You attach the wireless signaller unit to the circutry." + user.drop_item() + W.loc = src + src.state = 4 + if(4) + if(istype(W, /obj/item/weapon/crowbar) && !motion) + playsound(src.loc, 'Crowbar.ogg', 50, 1) + user << "\blue You remove the remote signalling device." + src.state = 3 + new /obj/item/device/radio/signaler( src.loc, 1 ) + if(istype(W, /obj/item/device/prox_sensor) && motion == 0) +// if(W:amount >= 1) + playsound(src.loc, 'Deconstruct.ogg', 50, 1) +// W:use(1) + user << "\blue You attach the proximity sensor." + motion = 1 + if(istype(W, /obj/item/weapon/crowbar) && motion) + playsound(src.loc, 'Crowbar.ogg', 50, 1) + user << "\blue You remove the proximity sensor." + new /obj/item/device/prox_sensor( src.loc, 1 ) + motion = 0 + if(istype(W, /obj/item/stack/sheet/glass)) + if(W:amount >= 1) + playsound(src.loc, 'Deconstruct.ogg', 50, 1) + if(do_after(user, 20)) + W:use(1) + user << "\blue You put in the glass lens." + src.state = 5 + if(5) + if(istype(W, /obj/item/weapon/crowbar)) + playsound(src.loc, 'Crowbar.ogg', 50, 1) + user << "\blue You remove the glass lens." + src.state = 4 + new /obj/item/stack/sheet/glass( src.loc, 2 ) + if(istype(W, /obj/item/weapon/screwdriver)) + playsound(src.loc, 'Screwdriver.ogg', 50, 1) + user << "\blue You connect the lense." + var/B + if(motion == 1) + B = new /obj/machinery/camera/motion( src.loc ) + else + B = new /obj/machinery/camera( src.loc ) + B:network = "SS13" + B:network = input(usr, "Which network would you like to connect this camera to?", "Set Network", "SS13") + direct = input(user, "Direction?", "Assembling Camera", null) in list( "NORTH", "EAST", "SOUTH", "WEST" ) + B:dir = text2dir(direct) + del(src) + afterattack(atom/target as mob|obj|turf|area, mob/user as mob) if (istype(target, /obj/item/weapon/storage)) return ..() @@ -144,6 +255,7 @@ /obj/item/weapon/chem_grenade/metalfoam name = "Metal-Foam Grenade" desc = "Used for emergency sealing of air breaches." + path = 1 stage = 2 New() @@ -162,6 +274,7 @@ /obj/item/weapon/chem_grenade/incendiary name = "Incendiary Grenade" desc = "Used for clearing rooms of living things." + path = 1 stage = 2 New() @@ -181,6 +294,7 @@ name = "Cleaner Grenade" desc = "BLAM!-brand foaming space cleaner. In a special applicator for rapid cleaning of wide areas." stage = 2 + path = 1 New() ..() diff --git a/code/game/machinery/camera.dm b/code/game/machinery/camera.dm index 9fdd5c16c8f..f16a60dfdfb 100644 --- a/code/game/machinery/camera.dm +++ b/code/game/machinery/camera.dm @@ -307,6 +307,20 @@ if (S.current == src) O << "[user] holds a paper up to one of the cameras ..." O << browse(text("[][]", X.name, X.info), text("window=[]", X.name)) + else if (istype(W, /obj/item/weapon/wrench)) //Adding dismantlable cameras to go with the constructable ones. --NEO + if(src.status) + user << "\red You can't dismantle a camera while it is active." + else + user << "\blue Dismantling camera..." + if(do_after(user, 20)) + var/obj/item/weapon/chem_grenade/case = new /obj/item/weapon/chem_grenade(src.loc) + case.path = 2 + case.state = 5 + case.anchored = 1 + case.circuit = new /obj/item/device/multitool + if (istype(src, /obj/machinery/camera/motion)) + case.motion = 1 + del(src) else if (istype(W, /obj/item/weapon/camera_bug)) if (!src.status) user << "\blue Camera non-functional" diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index e0067d4002b..f3518b009c7 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -14,6 +14,8 @@ src.verbs += /mob/living/silicon/ai/proc/ai_call_shuttle src.verbs += /mob/living/silicon/ai/proc/ai_camera_track src.verbs += /mob/living/silicon/ai/proc/ai_camera_list + //Added ai_network_change by Mord_Sith + src.verbs += /mob/living/silicon/ai/proc/ai_network_change src.verbs += /mob/living/silicon/ai/proc/lockdown src.verbs += /mob/living/silicon/ai/proc/disablelockdown src.verbs += /mob/living/silicon/ai/proc/ai_statuschange @@ -353,38 +355,35 @@ src.machine = null src:cameraFollow = null -/mob/living/silicon/ai/verb/change_network() +//Replaces /mob/living/silicon/ai/verb/change_network() in ai.dm & camera.dm +//Adds in /mob/living/silicon/ai/proc/ai_network_change() instead +//Addition by Mord_Sith to define AI's network change ability +/mob/living/silicon/ai/proc/ai_network_change() set category = "AI Commands" set name = "Change Camera Network" src.reset_view(null) src.machine = null src:cameraFollow = null - if(src.network == "AI Satellite") - src.network = "SS13" - else if (src.network == "Prison") - if (ticker.mode.name == "AI malfunction") -// world << "It's malf, checking if this dude is malfunctioning" - var/datum/game_mode/malfunction/malf = ticker.mode - for (var/datum/mind/M in malf.malf_ai) -// world << "There's a malf ai, he belongs to [M.key], while the AI tryign to poke around is [src.mind.key]" - if (src.mind == M) -// world <<"They match" - src.network = "AI Satellite" - src << "\blue Switched to [src.network] camera network." - return - else -// world <<"They don't match" - src.network = "SS13" - src << "\blue Switched to [src.network] camera network." - return -// world <<"Oh shit there isn't a malf AI" - src.network = "SS13" + var/cameralist[0] + + if(usr.stat == 2) + usr << "You can't change your camera network because you are dead!" + return + + for (var/obj/machinery/camera/C in world) + if(C.network == "AI Satellite") + if (ticker.mode.name == "AI malfunction") + var/datum/game_mode/malfunction/malf = ticker.mode + for (var/datum/mind/M in malf.malf_ai) + if (src.mind == M) + cameralist[C.network] = C.network else - src.network = "SS13" - else //(src.network == "SS13") - src.network = "Prison" -// src.network = "AI Satellite" + if(C.network != "CREED" && C.network != "thunder" && C.network != "RD" && C.network != "toxins" && C.network != "Prison") + cameralist[C.network] = C.network + + src.network = input(usr, "Which network would you like to view?") as null|anything in cameralist src << "\blue Switched to [src.network] camera network." +//End of code by Mord_Sith /mob/living/silicon/ai/proc/choose_modules()