code folder. 221 files changed wew

This commit is contained in:
deathride58
2018-02-12 21:03:40 -05:00
parent e3ad2643b2
commit 72ff7be9bd
221 changed files with 2797 additions and 2172 deletions
+2 -2
View File
@@ -159,14 +159,14 @@
/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench))
if(!anchored)
playsound(src.loc, W.usesound, 75, 1)
W.play_tool_sound(src, 75)
user.visible_message("[user.name] secures the [src.name] to the floor.", \
"<span class='notice'>You secure the anchor bolts to the floor.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
src.anchored = TRUE
connect_to_network()
else if(!linked_shielding.len > 0)
playsound(src.loc, W.usesound, 75, 1)
W.play_tool_sound(src, 75)
user.visible_message("[user.name] unsecures the [src.name].", \
"<span class='notice'>You remove the anchor bolts.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
+14 -18
View File
@@ -383,9 +383,9 @@
if (terminal)
to_chat(user, "<span class='warning'>Disconnect the wires first!</span>")
return
playsound(src.loc, W.usesound, 50, 1)
W.play_tool_sound(src)
to_chat(user, "<span class='notice'>You are trying to remove the power control board...</span>" )
if(do_after(user, 50*W.toolspeed, target = src))
if(W.use_tool(src, user, 50))
if (has_electronics==1)
has_electronics = 0
if (stat & BROKEN)
@@ -417,13 +417,12 @@
else if(integration_cog)
user.visible_message("<span class='notice'>[user] starts prying [integration_cog] from [src]...</span>", \
"<span class='notice'>You painstakingly start tearing [integration_cog] out of [src]'s guts...</span>")
playsound(src, W.usesound, 50, TRUE)
if(!do_after(user, 100 * W.toolspeed, target = src))
return
user.visible_message("<span class='notice'>[user] destroys [integration_cog] in [src]!</span>", \
"<span class='notice'>[integration_cog] comes free with a clank and snaps in two as the machinery returns to normal!</span>")
playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE)
QDEL_NULL(integration_cog)
W.play_tool_sound(src)
if(W.use_tool(src, user, 100))
user.visible_message("<span class='notice'>[user] destroys [integration_cog] in [src]!</span>", \
"<span class='notice'>[integration_cog] comes free with a clank and snaps in two as the machinery returns to normal!</span>")
playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE)
QDEL_NULL(integration_cog)
return
else if (opened!=2) //cover isn't removed
opened = 0
@@ -468,12 +467,12 @@
if (has_electronics==1)
has_electronics = 2
stat &= ~MAINT
playsound(src.loc, W.usesound, 50, 1)
W.play_tool_sound(src)
to_chat(user, "<span class='notice'>You screw the circuit electronics into place.</span>")
else if (has_electronics==2)
has_electronics = 1
stat |= MAINT
playsound(src.loc, W.usesound, 50, 1)
W.play_tool_sound(src)
to_chat(user, "<span class='notice'>You unfasten the electronics.</span>")
else /* has_electronics==0 */
to_chat(user, "<span class='warning'>There is nothing to secure!</span>")
@@ -578,17 +577,12 @@
return
else if (istype(W, /obj/item/weldingtool) && opened && has_electronics==0 && !terminal)
var/obj/item/weldingtool/WT = W
if (WT.get_fuel() < 3)
to_chat(user, "<span class='warning'>You need more welding fuel to complete this task!</span>")
if(!W.tool_start_check(user, amount=3))
return
user.visible_message("[user.name] welds [src].", \
"<span class='notice'>You start welding the APC frame...</span>", \
"<span class='italics'>You hear welding.</span>")
playsound(src.loc, WT.usesound, 50, 1)
if(do_after(user, 50*W.toolspeed, target = src))
if(!src || !WT.remove_fuel(3, user))
return
if(W.use_tool(src, user, 50, volume=50, amount=3))
if ((stat & BROKEN) || opened==2)
new /obj/item/stack/sheet/metal(loc)
user.visible_message(\
@@ -911,6 +905,8 @@
return 1
/obj/machinery/power/apc/proc/toggle_breaker()
if(!is_operational() || failure_timer)
return
operating = !operating
update()
update_icon()
+1
View File
@@ -471,6 +471,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
singular_name = "cable piece"
full_w_class = WEIGHT_CLASS_SMALL
grind_results = list("copper" = 2) //2 copper per cable in the coil
usesound = 'sound/items/deconstruct.ogg'
/obj/item/stack/cable_coil/cyborg
is_cyborg = 1
+1 -1
View File
@@ -70,7 +70,7 @@
return 100*charge/maxcharge
// use power from a cell
/obj/item/stock_parts/cell/proc/use(amount)
/obj/item/stock_parts/cell/use(amount)
if(rigged && amount > 0)
explode()
return 0
+3 -7
View File
@@ -188,20 +188,16 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
if(GRAV_NEEDS_SCREWDRIVER)
if(istype(I, /obj/item/screwdriver))
to_chat(user, "<span class='notice'>You secure the screws of the framework.</span>")
playsound(src.loc, I.usesound, 50, 1)
I.play_tool_sound(src)
broken_state++
update_icon()
return
if(GRAV_NEEDS_WELDING)
if(istype(I, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = I
if(WT.remove_fuel(1, user))
if(I.use_tool(src, user, 0, volume=50, amount=1))
to_chat(user, "<span class='notice'>You mend the damaged framework.</span>")
playsound(src.loc, 'sound/items/welder2.ogg', 50, 1)
broken_state++
update_icon()
else if(WT.isOn())
to_chat(user, "<span class='warning'>You don't have enough fuel to mend the damaged framework!</span>")
return
if(GRAV_NEEDS_PLASTEEL)
if(istype(I, /obj/item/stack/sheet/plasteel))
@@ -218,7 +214,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
if(GRAV_NEEDS_WRENCH)
if(istype(I, /obj/item/wrench))
to_chat(user, "<span class='notice'>You secure the plating to the framework.</span>")
playsound(src.loc, I.usesound, 75, 1)
I.play_tool_sound(src)
set_fix()
return
return ..()
+13 -23
View File
@@ -109,25 +109,19 @@
switch(stage)
if(1)
if(istype(W, /obj/item/wrench))
playsound(src.loc, W.usesound, 75, 1)
to_chat(usr, "<span class='notice'>You begin deconstructing [src]...</span>")
if (!do_after(usr, 30*W.toolspeed, target = src))
return
new /obj/item/stack/sheet/metal( get_turf(src.loc), sheets_refunded )
user.visible_message("[user.name] deconstructs [src].", \
"<span class='notice'>You deconstruct [src].</span>", "<span class='italics'>You hear a ratchet.</span>")
playsound(src.loc, 'sound/items/deconstruct.ogg', 75, 1)
qdel(src)
if (W.use_tool(src, user, 30, volume=50))
new /obj/item/stack/sheet/metal(drop_location(), sheets_refunded)
user.visible_message("[user.name] deconstructs [src].", \
"<span class='notice'>You deconstruct [src].</span>", "<span class='italics'>You hear a ratchet.</span>")
playsound(src.loc, 'sound/items/deconstruct.ogg', 75, 1)
qdel(src)
return
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/coil = W
if(coil.use(1))
switch(fixture_type)
if ("tube")
icon_state = "tube-construct-stage2"
if("bulb")
icon_state = "bulb-construct-stage2"
icon_state = "[fixture_type]-construct-stage2"
stage = 2
user.visible_message("[user.name] adds wires to [src].", \
"<span class='notice'>You add wires to [src].</span>")
@@ -141,25 +135,21 @@
if(istype(W, /obj/item/wirecutters))
stage = 1
switch(fixture_type)
if ("tube")
icon_state = "tube-construct-stage1"
if("bulb")
icon_state = "bulb-construct-stage1"
new /obj/item/stack/cable_coil(get_turf(loc), 1, "red")
icon_state = "[fixture_type]-construct-stage1"
new /obj/item/stack/cable_coil(drop_location(), 1, "red")
user.visible_message("[user.name] removes the wiring from [src].", \
"<span class='notice'>You remove the wiring from [src].</span>", "<span class='italics'>You hear clicking.</span>")
playsound(loc, W.usesound, 100, 1)
W.play_tool_sound(src, 100)
return
if(istype(W, /obj/item/screwdriver))
user.visible_message("[user.name] closes [src]'s casing.", \
"<span class='notice'>You close [src]'s casing.</span>", "<span class='italics'>You hear screwing.</span>")
playsound(loc, W.usesound, 75, 1)
W.play_tool_sound(src, 75)
switch(fixture_type)
if("tube")
newlight = new /obj/machinery/light/built(loc)
if ("bulb")
if("bulb")
newlight = new /obj/machinery/light/small/built(loc)
newlight.setDir(dir)
transfer_fingerprints_to(newlight)
@@ -429,7 +419,7 @@
// attempt to stick weapon into light socket
else if(status == LIGHT_EMPTY)
if(istype(W, /obj/item/screwdriver)) //If it's a screwdriver open it.
playsound(src.loc, W.usesound, 75, 1)
W.play_tool_sound(src, 75)
user.visible_message("[user.name] opens [src]'s casing.", \
"<span class='notice'>You open [src]'s casing.</span>", "<span class='italics'>You hear a noise.</span>")
deconstruct()
+1 -1
View File
@@ -195,7 +195,7 @@
return
else if(istype(O, /obj/item/screwdriver))
panel_open = !panel_open
playsound(src.loc, O.usesound, 50, 1)
O.play_tool_sound(src)
if(panel_open)
to_chat(user, "<span class='notice'>You open the access panel.</span>")
else
+53 -49
View File
@@ -207,10 +207,16 @@
return P
/obj/machinery/power/emitter/can_be_unfasten_wrench(mob/user, silent)
if(state == EM_WELDED)
if(active)
if(!silent)
to_chat(user, "<span class='warning'>Turn \the [src] off first!</span>")
return FAILED_UNFASTEN
else if(state == EM_WELDED)
if(!silent)
to_chat(user, "<span class='warning'>[src] is welded to the floor!</span>")
return FAILED_UNFASTEN
return ..()
/obj/machinery/power/emitter/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20)
@@ -221,45 +227,52 @@
else
state = EM_UNSECURED
/obj/machinery/power/emitter/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench))
if(active)
to_chat(user, "<span class='warning'>Turn \the [src] off first!</span>")
return
default_unfasten_wrench(user, W, 0)
return
/obj/machinery/power/emitter/wrench_act(mob/living/user, obj/item/I)
default_unfasten_wrench(user, I, 0)
return TRUE
if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(active)
to_chat(user, "Turn \the [src] off first.")
return
switch(state)
if(EM_UNSECURED)
to_chat(user, "<span class='warning'>The [src.name] needs to be wrenched to the floor!</span>")
if(EM_SECURED)
if(WT.remove_fuel(0,user))
playsound(loc, WT.usesound, 50, 1)
user.visible_message("[user.name] starts to weld the [name] to the floor.", \
"<span class='notice'>You start to weld \the [src] to the floor...</span>", \
"<span class='italics'>You hear welding.</span>")
if(do_after(user,20*W.toolspeed, target = src) && WT.isOn())
state = EM_WELDED
to_chat(user, "<span class='notice'>You weld \the [src] to the floor.</span>")
connect_to_network()
if(EM_WELDED)
if(WT.remove_fuel(0,user))
playsound(loc, WT.usesound, 50, 1)
user.visible_message("[user.name] starts to cut the [name] free from the floor.", \
"<span class='notice'>You start to cut \the [src] free from the floor...</span>", \
"<span class='italics'>You hear welding.</span>")
if(do_after(user,20*W.toolspeed, target = src) && WT.isOn())
state = EM_SECURED
to_chat(user, "<span class='notice'>You cut \the [src] free from the floor.</span>")
disconnect_from_network()
return
/obj/machinery/power/emitter/welder_act(mob/living/user, obj/item/I)
if(active)
to_chat(user, "Turn \the [src] off first.")
return TRUE
if(W.GetID())
switch(state)
if(EM_UNSECURED)
to_chat(user, "<span class='warning'>The [src.name] needs to be wrenched to the floor!</span>")
if(EM_SECURED)
if(!I.tool_start_check(user, amount=0))
return TRUE
user.visible_message("[user.name] starts to weld the [name] to the floor.", \
"<span class='notice'>You start to weld \the [src] to the floor...</span>", \
"<span class='italics'>You hear welding.</span>")
if(I.use_tool(src, user, 20, volume=50))
state = EM_WELDED
to_chat(user, "<span class='notice'>You weld \the [src] to the floor.</span>")
connect_to_network()
if(EM_WELDED)
if(!I.tool_start_check(user, amount=0))
return TRUE
user.visible_message("[user.name] starts to cut the [name] free from the floor.", \
"<span class='notice'>You start to cut \the [src] free from the floor...</span>", \
"<span class='italics'>You hear welding.</span>")
if(I.use_tool(src, user, 20, volume=50))
state = EM_SECURED
to_chat(user, "<span class='notice'>You cut \the [src] free from the floor.</span>")
disconnect_from_network()
return TRUE
/obj/machinery/power/emitter/crowbar_act(mob/living/user, obj/item/I)
default_deconstruction_crowbar(I)
return TRUE
/obj/machinery/power/emitter/screwdriver_act(mob/living/user, obj/item/I)
default_deconstruction_screwdriver(user, "emitter_open", "emitter", I)
return TRUE
/obj/machinery/power/emitter/attackby(obj/item/I, mob/user, params)
if(I.GetID())
if(obj_flags & EMAGGED)
to_chat(user, "<span class='warning'>The lock seems to be broken!</span>")
return
@@ -273,20 +286,11 @@
to_chat(user, "<span class='danger'>Access denied.</span>")
return
if(is_wire_tool(W) && panel_open)
else if(is_wire_tool(I) && panel_open)
wires.interact(user)
return
if(default_deconstruction_screwdriver(user, "emitter_open", "emitter", W))
return
if(exchange_parts(user, W))
return
if(default_pry_open(W))
return
if(default_deconstruction_crowbar(W))
else if(exchange_parts(user, I))
return
return ..()
@@ -77,10 +77,16 @@ field_generator power level display
to_chat(user, "<span class='warning'>[src] needs to be firmly secured to the floor first!</span>")
/obj/machinery/field/generator/can_be_unfasten_wrench(mob/user, silent)
if(state == FG_WELDED)
if(active)
if(!silent)
to_chat(user, "<span class='warning'>Turn \the [src] off first!</span>")
return FAILED_UNFASTEN
else if(state == FG_WELDED)
if(!silent)
to_chat(user, "<span class='warning'>[src] is welded to the floor!</span>")
return FAILED_UNFASTEN
return ..()
/obj/machinery/field/generator/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20)
@@ -91,41 +97,41 @@ field_generator power level display
else
state = FG_UNSECURED
/obj/machinery/field/generator/attackby(obj/item/W, mob/user, params)
/obj/machinery/field/generator/wrench_act(mob/living/user, obj/item/I)
default_unfasten_wrench(user, I, 0)
return TRUE
/obj/machinery/field/generator/welder_act(mob/living/user, obj/item/I)
if(active)
to_chat(user, "<span class='warning'>[src] needs to be off!</span>")
return
else if(istype(W, /obj/item/wrench))
default_unfasten_wrench(user, W, 0)
return TRUE
else if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
switch(state)
if(FG_UNSECURED)
to_chat(user, "<span class='warning'>[src] needs to be wrenched to the floor!</span>")
switch(state)
if(FG_UNSECURED)
to_chat(user, "<span class='warning'>[src] needs to be wrenched to the floor!</span>")
if(FG_SECURED)
if (WT.remove_fuel(0,user))
playsound(loc, WT.usesound, 50, 1)
user.visible_message("[user] starts to weld [src] to the floor.", \
"<span class='notice'>You start to weld \the [src] to the floor...</span>", \
"<span class='italics'>You hear welding.</span>")
if(do_after(user,20*W.toolspeed, target = src) && state == FG_SECURED && WT.isOn())
state = FG_WELDED
to_chat(user, "<span class='notice'>You weld the field generator to the floor.</span>")
if(FG_SECURED)
if(!I.tool_start_check(user, amount=0))
return TRUE
user.visible_message("[user] starts to weld [src] to the floor.", \
"<span class='notice'>You start to weld \the [src] to the floor...</span>", \
"<span class='italics'>You hear welding.</span>")
if(I.use_tool(src, user, 20, volume=50) && state == FG_SECURED)
state = FG_WELDED
to_chat(user, "<span class='notice'>You weld the field generator to the floor.</span>")
if(FG_WELDED)
if (WT.remove_fuel(0,user))
playsound(loc, WT.usesound, 50, 1)
user.visible_message("[user] starts to cut [src] free from the floor.", \
"<span class='notice'>You start to cut \the [src] free from the floor...</span>", \
"<span class='italics'>You hear welding.</span>")
if(do_after(user,20*W.toolspeed, target = src) && state == FG_WELDED && WT.isOn())
state = FG_SECURED
to_chat(user, "<span class='notice'>You cut \the [src] free from the floor.</span>")
if(FG_WELDED)
if(!I.tool_start_check(user, amount=0))
return TRUE
user.visible_message("[user] starts to cut [src] free from the floor.", \
"<span class='notice'>You start to cut \the [src] free from the floor...</span>", \
"<span class='italics'>You hear welding.</span>")
if(I.use_tool(src, user, 20, volume=50) && state == FG_WELDED)
state = FG_SECURED
to_chat(user, "<span class='notice'>You cut \the [src] free from the floor.</span>")
return TRUE
else
return ..()
/obj/machinery/field/generator/attack_animal(mob/living/simple_animal/M)
if(M.environment_smash & ENVIRONMENT_SMASH_RWALLS && active == FG_OFFLINE && state != FG_UNSECURED)
@@ -65,7 +65,7 @@
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
if(istype(W, /obj/item/wrench) && !isinspace())
playsound(loc, W.usesound, 75, 1)
W.play_tool_sound(src, 75)
anchored = TRUE
user.visible_message("[user.name] secures the [name] to the floor.", \
"You secure the external bolts.")
@@ -73,7 +73,7 @@
did_something = TRUE
if(PA_CONSTRUCTION_UNWIRED)
if(istype(W, /obj/item/wrench))
playsound(loc, W.usesound, 75, 1)
W.play_tool_sound(src, 75)
anchored = FALSE
user.visible_message("[user.name] detaches the [name] from the floor.", \
"You remove the external bolts.")
@@ -270,7 +270,7 @@
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
if(istype(W, /obj/item/wrench) && !isinspace())
playsound(loc, W.usesound, 75, 1)
W.play_tool_sound(src, 75)
anchored = TRUE
user.visible_message("[user.name] secures the [name] to the floor.", \
"You secure the external bolts.")
@@ -278,7 +278,7 @@
did_something = TRUE
if(PA_CONSTRUCTION_UNWIRED)
if(istype(W, /obj/item/wrench))
playsound(loc, W.usesound, 75, 1)
W.play_tool_sound(src, 75)
anchored = FALSE
user.visible_message("[user.name] detaches the [name] from the floor.", \
"You remove the external bolts.")
+11 -14
View File
@@ -56,16 +56,14 @@
obj_integrity = max_integrity
update_icon()
/obj/machinery/power/solar/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/crowbar))
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message("[user] begins to take the glass off the solar panel.", "<span class='notice'>You begin to take the glass off the solar panel...</span>")
if(do_after(user, 50*W.toolspeed, target = src))
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
user.visible_message("[user] takes the glass off the solar panel.", "<span class='notice'>You take the glass off the solar panel.</span>")
deconstruct(TRUE)
else
return ..()
/obj/machinery/power/solar/crowbar_act(mob/user, obj/item/I)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message("[user] begins to take the glass off [src].", "<span class='notice'>You begin to take the glass off [src]...</span>")
if(I.use_tool(src, user, 50))
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
user.visible_message("[user] takes the glass off [src].", "<span class='notice'>You take the glass off [src].</span>")
deconstruct(TRUE)
return TRUE
/obj/machinery/power/solar/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
@@ -214,10 +212,10 @@
anchored = !anchored
if(anchored)
user.visible_message("[user] wrenches the solar assembly into place.", "<span class='notice'>You wrench the solar assembly into place.</span>")
playsound(src.loc, W.usesound, 75, 1)
W.play_tool_sound(src, 75)
else
user.visible_message("[user] unwrenches the solar assembly from its place.", "<span class='notice'>You unwrench the solar assembly from its place.</span>")
playsound(src.loc, W.usesound, 75, 1)
W.play_tool_sound(src, 75)
return 1
if(istype(W, /obj/item/stack/sheet/glass) || istype(W, /obj/item/stack/sheet/rglass))
@@ -407,8 +405,7 @@
/obj/machinery/power/solar_control/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
playsound(src.loc, I.usesound, 50, 1)
if(do_after(user, 20*I.toolspeed, target = src))
if(I.use_tool(src, user, 20, volume=50))
if (src.stat & BROKEN)
to_chat(user, "<span class='notice'>The broken glass falls out.</span>")
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer( src.loc )
+5 -13
View File
@@ -531,19 +531,11 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
if(!istype(W) || (W.flags_1 & ABSTRACT_1) || !istype(user))
return
if(istype(W, /obj/item/scalpel/supermatter))
var/obj/item/scalpel/supermatter/scalpel = W
playsound(src, W.usesound, 100, 1)
to_chat(user, "<span class='notice'>You carefully begin to scrape [src] with [W]...</span>")
if(do_after(user, 60 * W.toolspeed, TRUE, src))
if (scalpel.usesLeft)
to_chat(user, "<span class='notice'>You extract a sliver from [src]. [src] begins to react violently!</span>")
new /obj/item/nuke_core/supermatter_sliver(drop_location())
matter_power += 200
scalpel.usesLeft--
if (!scalpel.usesLeft)
to_chat(user, "<span class='notice'>A tiny piece of [W] falls off, rendering it useless!</span>")
else
to_chat(user, "<span class='notice'>You fail to extract a sliver from [src]. [W] isn't sharp enough anymore!</span>")
to_chat(user, "<span class='notice'>You carefully begin to scrape \the [src] with \the [W]...</span>")
if(W.use_tool(src, user, 60, volume=100))
to_chat(user, "<span class='notice'>You extract a sliver from \the [src]. \The [src] begins to react violently!</span>")
new /obj/item/nuke_core/supermatter_sliver(drop_location())
matter_power += 200
else if(user.dropItemToGround(W))
user.visible_message("<span class='danger'>As [user] touches \the [src] with \a [W], silence fills the room...</span>",\
"<span class='userdanger'>You touch \the [src] with \the [W], and everything suddenly goes silent.</span>\n<span class='notice'>\The [W] flashes into dust as you flinch away from \the [src].</span>",\
+18 -13
View File
@@ -48,26 +48,31 @@
. = 1
/obj/machinery/power/terminal/proc/dismantle(mob/living/user, obj/item/W)
/obj/machinery/power/terminal/proc/dismantle(mob/living/user, obj/item/I)
if(isturf(loc))
var/turf/T = loc
if(T.intact)
to_chat(user, "<span class='warning'>You must first expose the power terminal!</span>")
return
if(!master || master.can_terminal_dismantle())
user.visible_message("[user.name] dismantles the power terminal from [master].", \
"<span class='notice'>You begin to cut the cables...</span>")
if(master && !master.can_terminal_dismantle())
return
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
if(do_after(user, 50*W.toolspeed, target = src))
if(!master || master.can_terminal_dismantle())
if(prob(50) && electrocute_mob(user, powernet, src, 1, TRUE))
do_sparks(5, TRUE, master)
return
new /obj/item/stack/cable_coil(loc, 10)
to_chat(user, "<span class='notice'>You cut the cables and dismantle the power terminal.</span>")
qdel(src)
user.visible_message("[user.name] dismantles the power terminal from [master].",
"<span class='notice'>You begin to cut the cables...</span>")
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
if(I.use_tool(src, user, 50))
if(master && !master.can_terminal_dismantle())
return
if(prob(50) && electrocute_mob(user, powernet, src, 1, TRUE))
do_sparks(5, TRUE, master)
return
new /obj/item/stack/cable_coil(drop_location(), 10)
to_chat(user, "<span class='notice'>You cut the cables and dismantle the power terminal.</span>")
qdel(src)
/obj/machinery/power/terminal/attackby(obj/item/W, mob/living/user, params)
+8 -11
View File
@@ -60,17 +60,14 @@
if(powernet && (powernet == control.powernet)) //update if we're still in the same powernet
control.currentdir = angle
/obj/machinery/power/tracker/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/crowbar))
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message("[user] begins to take the glass off the solar tracker.", "<span class='notice'>You begin to take the glass off the solar tracker...</span>")
if(do_after(user, 50*W.toolspeed, target = src))
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
user.visible_message("[user] takes the glass off the tracker.", "<span class='notice'>You take the glass off the tracker.</span>")
deconstruct(TRUE)
else
return ..()
/obj/machinery/power/tracker/crowbar_act(mob/user, obj/item/I)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message("[user] begins to take the glass off [src].", "<span class='notice'>You begin to take the glass off [src]...</span>")
if(I.use_tool(src, user, 50))
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
user.visible_message("[user] takes the glass off [src].", "<span class='notice'>You take the glass off [src].</span>")
deconstruct(TRUE)
return TRUE
/obj/machinery/power/tracker/obj_break(damage_flag)
if(!(stat & BROKEN) && !(flags_1 & NODECONSTRUCT_1))