From 51934abbc85086aa068f32b6fb27a22ed20bcf50 Mon Sep 17 00:00:00 2001 From: xxalpha Date: Sun, 6 Sep 2015 21:14:44 +0100 Subject: [PATCH 1/5] Reworked nuke deconstruction. New nuke sprites. More++ Changelog --- code/game/gamemodes/nuclear/nuclearbomb.dm | 129 ++++++++---------- code/game/objects/items/nuke_tools.dm | 66 ++++++--- .../items/weapons/storage/uplink_kits.dm | 1 - html/changelogs/xxalpha-n_u_c_l_e_a_r.yml | 7 + icons/mob/inhands/items_lefthand.dmi | Bin 98771 -> 99996 bytes icons/mob/inhands/items_righthand.dmi | Bin 97002 -> 98209 bytes icons/obj/machines/bignuke.dmi | Bin 4570 -> 0 bytes icons/obj/machines/nuke.dmi | Bin 2568 -> 3239 bytes icons/obj/machines/nuke_terminal.dmi | Bin 0 -> 4866 bytes icons/obj/nuke_tools.dmi | Bin 1729 -> 2480 bytes 10 files changed, 113 insertions(+), 90 deletions(-) create mode 100644 html/changelogs/xxalpha-n_u_c_l_e_a_r.yml delete mode 100644 icons/obj/machines/bignuke.dmi create mode 100644 icons/obj/machines/nuke_terminal.dmi diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 7e14fb75726..57bf264664b 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -1,8 +1,7 @@ -#define NUKESTATE_INTACT 6 -#define NUKESTATE_OPEN 5 -#define NUKESTATE_OPEN_TRAP 4 -#define NUKESTATE_WIRES_TIED 3 -#define NUKESTATE_CUT_LINES 2 +#define NUKESTATE_INTACT 5 +#define NUKESTATE_UNSCREWED 4 +#define NUKESTATE_PANEL_REMOVED 3 +#define NUKESTATE_WELDED 2 #define NUKESTATE_CORE_EXPOSED 1 #define NUKESTATE_CORE_REMOVED 0 @@ -33,21 +32,20 @@ var/bomb_set var/obj/item/nuke_core/core = null var/deconstruction_state = NUKESTATE_INTACT var/image/lights = null - var/image/panel = null var/image/interior = null - var/image/glow = null /obj/machinery/nuclearbomb/New() ..() nuke_list += src core = new /obj/item/nuke_core(src) + SSobj.processing -= core update_icon() previous_level = get_security_level() /obj/machinery/nuclearbomb/selfdestruct name = "station self-destruct terminal" desc = "For when it all gets too much to bear. Do not taunt." - icon = 'icons/obj/machines/bignuke.dmi' + icon = 'icons/obj/machines/nuke_terminal.dmi' icon_state = "nuclearbomb_base" anchored = 1 //stops it being moved layer = 4 @@ -65,67 +63,69 @@ var/bomb_set if(NUKESTATE_INTACT) if(istype(I, /obj/item/weapon/screwdriver/nuke)) playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1) - user << "You start removing the front panel's screws..." - if(do_after(user, 100,target=src)) - deconstruction_state = NUKESTATE_OPEN - user << "You remove the screws and the front panel slides open." + user << "You start removing [src]'s front panel's screws..." + if(do_after(user, 60,target=src)) + deconstruction_state = NUKESTATE_UNSCREWED + user << "You remove the screws from [src]'s front panel." update_icon() return - if(NUKESTATE_OPEN,NUKESTATE_OPEN_TRAP) - if((deconstruction_state == NUKESTATE_OPEN) && istype(I, /obj/item/weapon/wirecutters)) - playsound(loc, 'sound/effects/sparks4.ogg', 100, 1) - playsound(loc, 'sound/effects/EMPulse.ogg', 100, 1) - user << "You must have cut the wrong wire!" - for(var/mob/living/L in range(5,src)) - L.irradiate(200) - deconstruction_state = NUKESTATE_OPEN_TRAP //cant cut wires no more - else - if(istype(I, /obj/item/stack/cable_coil)) - var/obj/item/stack/cable_coil/S = I - user << "You start tying the wires..." - if(do_after(user,30,target=src)) - if(S.use(15)) - user << "You tie the wires with some cable, clearing the insides of [src]." - deconstruction_state = NUKESTATE_WIRES_TIED - update_icon() - else - user << "You need more cable to do that." - else - user << "You can't do anything with this tangle of cables in the way." - return - if(NUKESTATE_WIRES_TIED) - if(istype(I, /obj/item/weapon/pen)) - user << "You start drawing cut lines..." + if(NUKESTATE_UNSCREWED) + if(istype(I, /obj/item/weapon/crowbar)) + user << "You start removing [src]'s front panel..." + playsound(loc, 'sound/items/Crowbar.ogg', 100, 1) if(do_after(user,30,target=src)) - user << "You draw cut lines inside [src]." - deconstruction_state = NUKESTATE_CUT_LINES + user << "You remove [src]'s front panel." + deconstruction_state = NUKESTATE_PANEL_REMOVED update_icon() return - if(NUKESTATE_CUT_LINES) + if(NUKESTATE_PANEL_REMOVED) if(istype(I, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/welder = I playsound(loc, 'sound/items/Welder.ogg', 100, 1) - user << "You start cutting into [src]'s warhead..." + user << "You start cutting [src]'s inner plate..." if(welder.remove_fuel(1,user)) - if(do_after(user,50,target=src)) - playsound(loc, 'sound/items/Deconstruct.ogg', 100, 1) - user << "You cut into [src]'s warhead. You can see the core's green glow." - deconstruction_state = NUKESTATE_CORE_EXPOSED + if(do_after(user,80,target=src)) + user << "You cut [src]'s inner plate." + deconstruction_state = NUKESTATE_WELDED update_icon() - SSobj.processing += core return + if(NUKESTATE_WELDED) + if(istype(I, /obj/item/weapon/crowbar)) + user << "You start prying off [src]'s inner plate..." + playsound(loc, 'sound/items/Crowbar.ogg', 100, 1) + if(do_after(user,50,target=src)) + user << "You pry off [src]'s inner plate. You can see the core's green glow!" + deconstruction_state = NUKESTATE_CORE_EXPOSED + update_icon() + SSobj.processing += core if(NUKESTATE_CORE_EXPOSED) if(istype(I, /obj/item/nuke_core_container)) var/obj/item/nuke_core_container/core_box = I user << "You start loading the plutonium core into [core_box]..." if(do_after(user,50,target=src)) - if(core_box.load(core,src)) + if(core_box.load(core, user)) user << "You load the plutonium core into [core_box]." deconstruction_state = NUKESTATE_CORE_REMOVED update_icon() + core = null else user << "You fail to load the plutonium core into [core_box]. [core_box] has already been used!" return + if(istype(I, /obj/item/stack/sheet/metal)) + var/obj/item/stack/sheet/metal/M = I + if(M.amount >= 20) + user << "You begin repairing [src]'s inner metal plate..." + if(do_after(user, 100, target=src)) + if(M.use(20)) + user << "You repair [src]'s inner metal plate. The radiation is contained." + deconstruction_state = NUKESTATE_PANEL_REMOVED + SSobj.processing -= core + update_icon() + else + user << "You need more metal to do that!" + else + user << "You need more metal to do that!" + return else ..() @@ -143,6 +143,7 @@ var/bomb_set if(deconstruction_state == NUKESTATE_INTACT) switch(get_nuke_state()) if(NUKE_OFF_LOCKED, NUKE_OFF_UNLOCKED) + icon_state = "nuclearbomb_base" update_icon_interior() update_icon_lights() if(NUKE_ON_TIMING) @@ -152,51 +153,39 @@ var/bomb_set overlays.Cut() icon_state = "nuclearbomb_exploding" else + icon_state = "nuclearbomb_base" update_icon_interior() update_icon_lights() /obj/machinery/nuclearbomb/proc/update_icon_interior() overlays -= interior - overlays -= glow switch(deconstruction_state) - if(NUKESTATE_OPEN_TRAP,NUKESTATE_OPEN) - glow = null + if(NUKESTATE_UNSCREWED) + interior = image(icon,"panel-unscrewed") + if(NUKESTATE_PANEL_REMOVED) interior = image(icon,"panel-removed") - if(NUKESTATE_CORE_REMOVED,NUKESTATE_CUT_LINES,NUKESTATE_WIRES_TIED) - glow = null - interior = image(icon,"wires-sorted") + if(NUKESTATE_WELDED) + interior = image(icon,"plate-welded") if(NUKESTATE_CORE_EXPOSED) - glow = image(icon,"core-exposed") - interior = image(icon,"wires-sorted") + interior = image(icon,"plate-removed") + if(NUKESTATE_CORE_REMOVED) + interior = image(icon,"core-removed") if(NUKESTATE_INTACT) - glow = null - interior = image(icon,"panel-overlay") + interior = null overlays += interior - overlays += glow /obj/machinery/nuclearbomb/proc/update_icon_lights() overlays -= lights - overlays -= panel - panel = null switch(get_nuke_state()) if(NUKE_OFF_LOCKED) - lights = image(icon,"lights-off") - if(deconstruction_state != NUKESTATE_INTACT) - panel = image(icon,"panel-removed-blue") + lights = null if(NUKE_OFF_UNLOCKED) lights = image(icon,"lights-safety") - if(deconstruction_state != NUKESTATE_INTACT) - panel = image(icon,"panel-removed-blue") if(NUKE_ON_TIMING) lights = image(icon,"lights-timing") - if(deconstruction_state != NUKESTATE_INTACT) - panel = image(icon,"panel-removed-timing") if(NUKE_ON_EXPLODING) lights = image(icon,"lights-exploding") - if(deconstruction_state != NUKESTATE_INTACT) - panel = image(icon,"panel-removed-exploding") overlays += lights - overlays += panel /obj/machinery/nuclearbomb/process() if (timing > 0) diff --git a/code/game/objects/items/nuke_tools.dm b/code/game/objects/items/nuke_tools.dm index 109985e306a..ee10b83dbc9 100644 --- a/code/game/objects/items/nuke_tools.dm +++ b/code/game/objects/items/nuke_tools.dm @@ -6,15 +6,25 @@ desc = "Extremely radioactive. Wear goggles." icon = 'icons/obj/nuke_tools.dmi' icon_state = "plutonium_core" + item_state = "plutoniumcore" var/pulse = 0 var/cooldown = 0 +/obj/item/nuke_core/New() + SSobj.processing += src + +/obj/item/nuke_core/attackby(obj/item/nuke_core_container/container, mob/user) + if(istype(container)) + container.load(src, user) + else + ..() + /obj/item/nuke_core/process() - if(cooldown < world.time - 40) + if(cooldown < world.time - 60) cooldown = world.time - for(var/mob/living/L in range(8,get_turf(src))) - var/rads = 100 - get_dist(L,src)*7 - L.irradiate(rads) + flick("plutonium_core_pulse", src) + for(var/mob/living/L in range(4,get_turf(src))) + L.irradiate(40) //nuke core box, for carrying the core /obj/item/nuke_core_container @@ -22,33 +32,51 @@ desc = "Solid container for radioactive objects." icon = 'icons/obj/nuke_tools.dmi' icon_state = "core_container_empty" + item_state = "tile" var/obj/item/nuke_core/core = null -/obj/item/nuke_core_container/proc/load(obj/item/nuke_core/ncore, obj/machinery/nuclearbomb/nuke) - if(core) +/obj/item/nuke_core_container/proc/load(obj/item/nuke_core/ncore, mob/user) + if(core || !istype(ncore)) return 0 - SSobj.processing -= ncore ncore.loc = src core = ncore - nuke.core = null icon_state = "core_container_loaded" + user << "Container is sealing..." + spawn(50) + SSobj.processing -= core + icon_state = "core_container_sealed" + playsound(loc, 'sound/items/Deconstruct.ogg', 100, 1) + if(loc == user) + user << "Container is sealed, the radiation is contained." return 1 +/obj/item/nuke_core_container/attackby(obj/item/nuke_core/core, mob/user) + if(istype(core)) + if(!user.unEquip(core)) + user << "The [core] is stuck to your hand!" + return + else + load(core, user) + else + ..() + //snowflake screwdriver, works as a key to start nuke theft, traitor only /obj/item/weapon/screwdriver/nuke name = "screwdriver" desc = "A screwdriver with an ultra thin tip." + icon = 'icons/obj/nuke_tools.dmi' + icon_state = "screwdriver_nuke" + item_state = "screwdriver_nuke" + +/obj/item/weapon/screwdriver/nuke/New() +//to skip screwdriver icon update /obj/item/weapon/paper/nuke_instructions - info = "How to break into a Nanotrasen self-destruct terminal and remove it's plutonium core:
\ + info = "How to break into a Nanotrasen self-destruct terminal and remove its plutonium core:
\