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

View File

@@ -77,6 +77,7 @@ Last space-z level = empty
#define CAMERA_LOCK_CENTCOM 4
#define CAMERA_LOCK_REEBE 8
//Ruin Generation
#define PLACEMENT_TRIES 100 //How many times we try to fit the ruin somewhere until giving up (really should just swap to some packing algo)

View File

@@ -5,3 +5,8 @@
#define TOOL_WIRECUTTER "wirecutter"
#define TOOL_WRENCH "wrench"
#define TOOL_WELDER "welder"
// If delay between the start and the end of tool operation is less than MIN_TOOL_SOUND_DELAY,
// tool sound is only played when op is started. If not, it's played twice.
#define MIN_TOOL_SOUND_DELAY 20

View File

@@ -21,6 +21,7 @@
#define TRAIT_PUSHIMMUNE "push_immunity"
#define TRAIT_SHOCKIMMUNE "shock_immunity"
// common trait sources
#define TRAIT_GENERIC "generic"
#define EYE_DAMAGE "eye_damage"

View File

@@ -319,9 +319,10 @@
break
/proc/get_mob_by_key(key)
var/ckey = ckey(key)
for(var/i in GLOB.player_list)
var/mob/M = i
if(M.ckey == lowertext(key))
if(M.ckey == ckey)
return M
return null

View File

@@ -38,7 +38,6 @@
while(parent > 0 && (call(cmp)(L[index],L[parent]) > 0))
L.Swap(index,parent)
index = parent
parent = round(index * 0.5)
@@ -68,6 +67,7 @@
//Replaces a given node so it verify the heap condition
/datum/Heap/proc/ReSort(atom/A)
var/index = L.Find(A)
Swim(index)
Sink(index)

View File

@@ -25,4 +25,4 @@ GLOBAL_LIST_EMPTY(global_mutations) // list of hidden mutation things
GLOBAL_LIST_EMPTY(bad_mutations)
GLOBAL_LIST_EMPTY(good_mutations)
GLOBAL_LIST_EMPTY(not_good_mutations)
GLOBAL_LIST_EMPTY(not_good_mutations)

View File

@@ -24,6 +24,7 @@
//try to find a pre-processed blood-splatter. otherwise, make a new one
var/index = "[REF(icon)]-[icon_state]"
pic = blood_splatter_appearances[index]
if(!pic)
var/icon/blood_splatter_icon = icon(initial(I.icon), initial(I.icon_state), , 1) //we only want to apply blood-splatters to the initial icon_state for each object
blood_splatter_icon.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent)

View File

@@ -23,33 +23,46 @@
set_desc(steps.len)
return
/datum/construction/proc/action(atom/used_atom,mob/user)
/datum/construction/proc/action(obj/item/I, mob/user)
return
/datum/construction/proc/check_step(atom/used_atom,mob/user) //check last step only
var/valid_step = is_right_key(used_atom)
/datum/construction/proc/check_step(obj/item/I, mob/user) //check last step only
var/valid_step = is_right_key(I)
if(valid_step)
if(custom_action(valid_step, used_atom, user))
if(custom_action(valid_step, I, user))
next_step()
return 1
return 0
/datum/construction/proc/is_right_key(atom/used_atom) // returns current step num if used_atom is of the right type.
/datum/construction/proc/is_right_key(obj/item/I) // returns current step num if I is of the right type.
var/list/L = steps[steps.len]
if(istype(used_atom, L["key"]))
if(check_used_item(I, L["key"]))
return steps.len
return 0
/datum/construction/proc/custom_action(step, used_atom, user)
/datum/construction/proc/check_used_item(obj/item/I, key)
if(!key)
return FALSE
if(ispath(key) && istype(I, key))
return TRUE
else if(I.tool_behaviour == key)
return TRUE
return FALSE
/datum/construction/proc/custom_action(step, obj/item/I, user)
return 1
/datum/construction/proc/check_all_steps(atom/used_atom,mob/user) //check all steps, remove matching one.
/datum/construction/proc/check_all_steps(obj/item/I, mob/user) //check all steps, remove matching one.
for(var/i=1;i<=steps.len;i++)
var/list/L = steps[i];
if(istype(used_atom, L["key"]))
if(custom_action(i, used_atom, user))
steps[i]=null;//stupid byond list from list removal...
listclearnulls(steps);
var/list/L = steps[i]
if(check_used_item(I, L["key"]))
if(custom_action(i, I, user))
steps[i] = null//stupid byond list from list removal...
listclearnulls(steps)
if(!steps.len)
spawn_result()
return 1
@@ -76,6 +89,9 @@
holder.desc = step["desc"]
return
/datum/construction/proc/drop_location()
return holder.drop_location()
/datum/construction/reversible
var/index
@@ -92,21 +108,21 @@
set_desc(index)
return
/datum/construction/reversible/is_right_key(atom/used_atom) // returns index step
/datum/construction/reversible/is_right_key(obj/item/I) // returns index step
var/list/L = steps[index]
if(istype(used_atom, L["key"]))
if(check_used_item(I, L["key"]))
return FORWARD //to the first step -> forward
else if(L["backkey"] && istype(used_atom, L["backkey"]))
else if(check_used_item(I, L["backkey"]))
return BACKWARD //to the last step -> backwards
return 0
return FALSE
/datum/construction/reversible/check_step(atom/used_atom,mob/user)
var/diff = is_right_key(used_atom)
/datum/construction/reversible/check_step(obj/item/I, mob/user)
var/diff = is_right_key(I)
if(diff)
if(custom_action(index, diff, used_atom, user))
if(custom_action(index, diff, I, user))
update_index(diff)
return 1
return 0
/datum/construction/reversible/custom_action(index, diff, used_atom, user)
/datum/construction/reversible/custom_action(index, diff, obj/item/I, user)
return 1

View File

@@ -87,7 +87,6 @@
description = "A respectable mid-sized shuttle that first saw service shuttling Nanotrasen crew to and from their asteroid belt embedded facilities."
credit_cost = 3000
/datum/map_template/shuttle/emergency/bar
suffix = "bar"
name = "The Emergency Escape Bar"
@@ -110,18 +109,6 @@
admin_notes = "This shuttle will likely crush escape, killing anyone there."
credit_cost = -5000
/datum/map_template/shuttle/emergency/saltmine
suffix = "saltmine"
name = "The Saltmine"
description = "Contains everything that upsets you."
admin_notes = "Don't forget: You're here forever."
credit_cost = 5000
/datum/map_template/shuttle/emergency/saltmine/prerequisites_met()
if("revenant" in SSshuttle.shuttle_purchase_requirements_met)
return TRUE
return FALSE
/datum/map_template/shuttle/emergency/luxury
suffix = "luxury"
name = "Luxury Shuttle"

View File

@@ -1,15 +1,15 @@
#define MAXIMUM_EMP_WIRES 3
/proc/is_wire_tool(obj/item/I)
if(istype(I, /obj/item/device/multitool))
return TRUE
if(istype(I, /obj/item/wirecutters))
if(!I)
return
if(I.tool_behaviour == TOOL_WIRECUTTER || I.tool_behaviour == TOOL_MULTITOOL)
return TRUE
if(istype(I, /obj/item/device/assembly))
var/obj/item/device/assembly/A = I
if(A.attachable)
return TRUE
return
/atom
var/datum/wires/wires = null
@@ -244,29 +244,34 @@
return
var/target_wire = params["wire"]
var/mob/living/L = usr
var/obj/item/I = L.get_active_held_item()
var/obj/item/I
switch(action)
if("cut")
if(istype(I, /obj/item/wirecutters) || IsAdminGhost(usr))
playsound(holder, I.usesound, 20, 1)
I = L.is_holding_tool_quality(TOOL_WIRECUTTER)
if(I || IsAdminGhost(usr))
if(I)
I.play_tool_sound(src, 20)
cut_color(target_wire)
. = TRUE
else
to_chat(L, "<span class='warning'>You need wirecutters!</span>")
if("pulse")
if(istype(I, /obj/item/device/multitool) || IsAdminGhost(usr))
playsound(holder, 'sound/weapons/empty.ogg', 20, 1)
I = L.is_holding_tool_quality(TOOL_MULTITOOL)
if(I || IsAdminGhost(usr))
if(I)
I.play_tool_sound(src, 20)
pulse_color(target_wire, L)
. = TRUE
else
to_chat(L, "<span class='warning'>You need a multitool!</span>")
if("attach")
if(is_attached(target_wire))
var/obj/item/O = detach_assembly(target_wire)
if(O)
L.put_in_hands(O)
I = detach_assembly(target_wire)
if(I)
L.put_in_hands(I)
. = TRUE
else
I = L.get_active_held_item()
if(istype(I, /obj/item/device/assembly))
var/obj/item/device/assembly/A = I
if(A.attachable)

View File

@@ -534,38 +534,38 @@
// Tool behavior procedure. Redirects to tool-specific procs by default.
// You can override it to catch all tool interactions, for use in complex deconstruction procs.
// Just don't forget to return ..() in the end.
/atom/proc/tool_act(mob/living/user, obj/item/tool, tool_type)
/atom/proc/tool_act(mob/living/user, obj/item/I, tool_type)
switch(tool_type)
if(TOOL_CROWBAR)
return crowbar_act(user, tool)
return crowbar_act(user, I)
if(TOOL_MULTITOOL)
return multitool_act(user, tool)
return multitool_act(user, I)
if(TOOL_SCREWDRIVER)
return screwdriver_act(user, tool)
return screwdriver_act(user, I)
if(TOOL_WRENCH)
return wrench_act(user, tool)
return wrench_act(user, I)
if(TOOL_WIRECUTTER)
return wirecutter_act(user, tool)
return wirecutter_act(user, I)
if(TOOL_WELDER)
return welder_act(user, tool)
return welder_act(user, I)
// Tool-specific behavior procs. To be overridden in subtypes.
/atom/proc/crowbar_act(mob/living/user, obj/item/tool)
/atom/proc/crowbar_act(mob/living/user, obj/item/I)
return
/atom/proc/multitool_act(mob/living/user, obj/item/tool)
/atom/proc/multitool_act(mob/living/user, obj/item/I)
return
/atom/proc/screwdriver_act(mob/living/user, obj/item/tool)
/atom/proc/screwdriver_act(mob/living/user, obj/item/I)
return
/atom/proc/wrench_act(mob/living/user, obj/item/tool)
/atom/proc/wrench_act(mob/living/user, obj/item/I)
return
/atom/proc/wirecutter_act(mob/living/user, obj/item/tool)
/atom/proc/wirecutter_act(mob/living/user, obj/item/I)
return
/atom/proc/welder_act(mob/living/user, obj/item/tool)
/atom/proc/welder_act(mob/living/user, obj/item/I)
return
/atom/proc/GenerateTag()

View File

@@ -80,21 +80,19 @@
update_icon()
else if(istype(O, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
var/obj/item/weldingtool/WT = O
if(stat & BROKEN)
if(WT.remove_fuel(0,user))
user.visible_message("[user] is repairing [src].", \
"<span class='notice'>You begin repairing [src]...</span>", \
"<span class='italics'>You hear welding.</span>")
playsound(loc, WT.usesound, 40, 1)
if(do_after(user,40*WT.toolspeed, 1, target = src))
if(!WT.isOn() || !(stat & BROKEN))
return
to_chat(user, "<span class='notice'>You repair [src].</span>")
playsound(loc, 'sound/items/welder2.ogg', 50, 1)
stat &= ~BROKEN
obj_integrity = max_integrity
update_icon()
if(!O.tool_start_check(user, amount=0))
return
user.visible_message("[user] is repairing [src].", \
"<span class='notice'>You begin repairing [src]...</span>", \
"<span class='italics'>You hear welding.</span>")
if(O.use_tool(src, user, 40, volume=50))
if(!(stat & BROKEN))
return
to_chat(user, "<span class='notice'>You repair [src].</span>")
stat &= ~BROKEN
obj_integrity = max_integrity
update_icon()
else
to_chat(user, "<span class='notice'>[src] does not need repairs.</span>")
else

View File

@@ -290,18 +290,17 @@ Class Procs:
/obj/machinery/proc/RefreshParts() //Placeholder proc for machines that are built using frames.
return
/obj/machinery/proc/default_pry_open(obj/item/crowbar/C)
. = !(state_open || panel_open || is_operational() || (flags_1 & NODECONSTRUCT_1)) && istype(C)
/obj/machinery/proc/default_pry_open(obj/item/I)
. = !(state_open || panel_open || is_operational() || (flags_1 & NODECONSTRUCT_1)) && I.tool_behaviour == TOOL_CROWBAR
if(.)
playsound(loc, C.usesound, 50, 1)
I.play_tool_sound(src, 50)
visible_message("<span class='notice'>[usr] pries open \the [src].</span>", "<span class='notice'>You pry open \the [src].</span>")
open_machine()
return 1
/obj/machinery/proc/default_deconstruction_crowbar(obj/item/crowbar/C, ignore_panel = 0)
. = istype(C) && (panel_open || ignore_panel) && !(flags_1 & NODECONSTRUCT_1)
/obj/machinery/proc/default_deconstruction_crowbar(obj/item/I, ignore_panel = 0)
. = (panel_open || ignore_panel) && !(flags_1 & NODECONSTRUCT_1) && I.tool_behaviour == TOOL_CROWBAR
if(.)
playsound(loc, C.usesound, 50, 1)
I.play_tool_sound(src, 50)
deconstruct(TRUE)
/obj/machinery/deconstruct(disassembled = TRUE)
@@ -337,9 +336,9 @@ Class Procs:
update_icon()
updateUsrDialog()
/obj/machinery/proc/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/screwdriver/S)
if(istype(S) && !(flags_1 & NODECONSTRUCT_1))
playsound(loc, S.usesound, 50, 1)
/obj/machinery/proc/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/I)
if(!(flags_1 & NODECONSTRUCT_1) && I.tool_behaviour == TOOL_SCREWDRIVER)
I.play_tool_sound(src, 50)
if(!panel_open)
panel_open = TRUE
icon_state = icon_state_open
@@ -351,9 +350,9 @@ Class Procs:
return 1
return 0
/obj/machinery/proc/default_change_direction_wrench(mob/user, obj/item/wrench/W)
if(panel_open && istype(W))
playsound(loc, W.usesound, 50, 1)
/obj/machinery/proc/default_change_direction_wrench(mob/user, obj/item/I)
if(panel_open && I.tool_behaviour == TOOL_WRENCH)
I.play_tool_sound(src, 50)
setDir(turn(dir,-90))
to_chat(user, "<span class='notice'>You rotate [src].</span>")
return 1
@@ -365,20 +364,20 @@ Class Procs:
return FAILED_UNFASTEN
return SUCCESSFUL_UNFASTEN
/obj/proc/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20) //try to unwrench an object in a WONDERFUL DYNAMIC WAY
if(istype(W) && !(flags_1 & NODECONSTRUCT_1))
/obj/proc/default_unfasten_wrench(mob/user, obj/item/I, time = 20) //try to unwrench an object in a WONDERFUL DYNAMIC WAY
if(!(flags_1 & NODECONSTRUCT_1) && I.tool_behaviour == TOOL_WRENCH)
var/can_be_unfasten = can_be_unfasten_wrench(user)
if(!can_be_unfasten || can_be_unfasten == FAILED_UNFASTEN)
return can_be_unfasten
if(time)
to_chat(user, "<span class='notice'>You begin [anchored ? "un" : ""]securing [src]...</span>")
playsound(loc, W.usesound, 50, 1)
I.play_tool_sound(src, 50)
var/prev_anchored = anchored
//as long as we're the same anchored state and we're either on a floor or are anchored, toggle our anchored state
if(!time || do_after(user, time*W.toolspeed, target = src, extra_checks = CALLBACK(src, .proc/unfasten_wrench_check, prev_anchored, user)))
if(I.use_tool(src, user, time, extra_checks = CALLBACK(src, .proc/unfasten_wrench_check, prev_anchored, user)))
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [src].</span>")
anchored = !anchored
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
return SUCCESSFUL_UNFASTEN
return FAILED_UNFASTEN
return CANT_UNFASTEN

View File

@@ -61,7 +61,7 @@ GLOBAL_LIST_EMPTY(announcement_systems)
/obj/machinery/announcement_system/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/screwdriver))
playsound(src.loc, P.usesound, 50, 1)
P.play_tool_sound(src)
panel_open = !panel_open
to_chat(user, "<span class='notice'>You [panel_open ? "open" : "close"] the maintenance hatch of [src].</span>")
update_icon()

View File

@@ -74,21 +74,21 @@
update_icon()
else if(istype(O, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
var/obj/item/weldingtool/WT = O
if(obj_integrity < max_integrity)
if(WT.remove_fuel(0,user))
user.visible_message("[user] begins repairing [src].", \
"<span class='notice'>You begin repairing [src]...</span>", \
"<span class='italics'>You hear welding.</span>")
playsound(src, WT.usesound, 40, 1)
if(do_after(user,40*WT.toolspeed, TRUE, target = src))
if(!WT.isOn() || !(stat & BROKEN))
return
to_chat(user, "<span class='notice'>You repair [src].</span>")
playsound(src, 'sound/items/welder2.ogg', 50, 1)
stat &= ~BROKEN
obj_integrity = max(obj_integrity, max_integrity)
update_icon()
if(!O.tool_start_check(user, amount=0))
return
user.visible_message("[user] begins repairing [src].", \
"<span class='notice'>You begin repairing [src]...</span>", \
"<span class='italics'>You hear welding.</span>")
if(O.use_tool(src, user, 40, volume=50))
if(!(stat & BROKEN))
return
to_chat(user, "<span class='notice'>You repair [src].</span>")
stat &= ~BROKEN
obj_integrity = max(obj_integrity, max_integrity)
update_icon()
else
to_chat(user, "<span class='notice'>[src] does not need repairs.</span>")
else

View File

@@ -87,8 +87,8 @@
if(!device && !board && istype(W, /obj/item/wrench))
to_chat(user, "<span class='notice'>You start unsecuring the button frame...</span>")
playsound(loc, W.usesound, 50, 1)
if(do_after(user, 40*W.toolspeed, target = src))
W.play_tool_sound(src)
if(W.use_tool(src, user, 40))
to_chat(user, "<span class='notice'>You unsecure the button frame.</span>")
transfer_fingerprints_to(new /obj/item/wallframe/button(get_turf(src)))
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)

View File

@@ -139,7 +139,7 @@
if(istype(W, /obj/item/screwdriver))
panel_open = !panel_open
to_chat(user, "<span class='notice'>You screw the camera's panel [panel_open ? "open" : "closed"].</span>")
playsound(src.loc, W.usesound, 50, 1)
W.play_tool_sound(src)
return
if(panel_open)
@@ -367,19 +367,16 @@
return null
/obj/machinery/camera/proc/weld(obj/item/weldingtool/WT, mob/living/user)
/obj/machinery/camera/proc/weld(obj/item/weldingtool/W, mob/living/user)
if(busy)
return FALSE
if(!WT.remove_fuel(0, user))
if(!W.tool_start_check(user, amount=0))
return FALSE
to_chat(user, "<span class='notice'>You start to weld [src]...</span>")
playsound(src.loc, WT.usesound, 50, 1)
busy = TRUE
if(do_after(user, 100*WT.toolspeed, target = src))
if(W.use_tool(src, user, 100, volume=50))
busy = FALSE
if(!WT.isOn())
return FALSE
return TRUE
busy = FALSE
return FALSE

View File

@@ -81,7 +81,7 @@
var/obj/U = locate(/obj) in upgrades
if(U)
to_chat(user, "<span class='notice'>You unattach an upgrade from the assembly.</span>")
playsound(src, tool.usesound, 50, 1)
tool.play_tool_sound(src)
U.forceMove(drop_location())
upgrades -= U
return TRUE
@@ -90,7 +90,7 @@
if(state != 3)
return FALSE
playsound(src, tool.usesound, 50, 1)
tool.play_tool_sound(src)
var/input = stripped_input(user, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Set Network", "SS13")
if(!input)
to_chat(user, "<span class='warning'>No input found, please hang up and try your call again!</span>")
@@ -109,35 +109,32 @@
C.c_tag = "[A.name] ([rand(1, 999)])"
return TRUE
/obj/structure/camera_assembly/wirecutter_act(mob/user, obj/item/tool)
/obj/structure/camera_assembly/wirecutter_act(mob/user, obj/item/I)
if(state != 3)
return FALSE
new /obj/item/stack/cable_coil(get_turf(src), 2)
playsound(src, tool.usesound, 50, 1)
new /obj/item/stack/cable_coil(drop_location(), 2)
I.play_tool_sound(src)
to_chat(user, "<span class='notice'>You cut the wires from the circuits.</span>")
state = 2
return TRUE
/obj/structure/camera_assembly/wrench_act(mob/user, obj/item/tool)
/obj/structure/camera_assembly/wrench_act(mob/user, obj/item/I)
if(state != 1)
return FALSE
playsound(src, tool.usesound, 50, 1)
I.play_tool_sound(src)
to_chat(user, "<span class='notice'>You unattach the assembly from its place.</span>")
new /obj/item/wallframe/camera(get_turf(src))
new /obj/item/wallframe/camera(drop_location())
qdel(src)
return TRUE
/obj/structure/camera_assembly/proc/weld(obj/item/weldingtool/WT, mob/living/user)
if(!WT.remove_fuel(0, user))
return 0
/obj/structure/camera_assembly/proc/weld(obj/item/weldingtool/W, mob/living/user)
if(!W.tool_start_check(user, amount=0))
return FALSE
to_chat(user, "<span class='notice'>You start to weld \the [src]...</span>")
playsound(src.loc, WT.usesound, 50, 1)
if(do_after(user, 20*WT.toolspeed, target = src))
if(WT.isOn())
playsound(loc, 'sound/items/welder2.ogg', 50, 1)
return 1
return 0
if(W.use_tool(src, user, 20, volume=50))
return TRUE
return FALSE
/obj/structure/camera_assembly/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))

View File

@@ -125,4 +125,4 @@
charging.give(charge_rate) //this is 2558, efficient batteries exist
updateicon()

View File

@@ -69,14 +69,13 @@
update_icon()
return
/obj/machinery/computer/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver) && circuit && !(flags_1&NODECONSTRUCT_1))
playsound(src.loc, I.usesound, 50, 1)
to_chat(user, "<span class='notice'> You start to disconnect the monitor...</span>")
if(do_after(user, 20*I.toolspeed, target = src))
/obj/machinery/computer/screwdriver_act(mob/living/user, obj/item/I)
if(circuit && !(flags_1&NODECONSTRUCT_1))
to_chat(user, "<span class='notice'>You start to disconnect the monitor...</span>")
if(I.use_tool(src, user, 20, volume=50))
deconstruct(TRUE, user)
else
return ..()
return TRUE
/obj/machinery/computer/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)

View File

@@ -105,12 +105,6 @@
authenticated = TRUE
auth_id = "[ID.registered_name] ([ID.assignment])"
log_activity("logged in")
if(!authenticated) //Check for emags
var/obj/item/card/emag/E = usr.get_active_held_item()
if(E && istype(E) && usr.Adjacent(src))
to_chat(usr, "<span class='warning'>You bypass [src]'s access requirements using your emag.</span>")
authenticated = TRUE
log_activity("logged in") //Auth ID doesn't change, hinting that it was illicit
if(href_list["log_out"])
log_activity("logged out")
authenticated = FALSE
@@ -193,12 +187,15 @@
interact(usr) //Refresh the UI after a filter changes
/obj/machinery/computer/apc_control/emag_act(mob/user)
if(obj_flags & EMAGGED)
return
user.visible_message("<span class='warning'>You emag [src], disabling precise logging and allowing you to clear logs.</span>")
log_game("[key_name(user)] emagged [src] at [get_area(src)], disabling operator tracking.")
if(!authenticated)
to_chat(user, "<span class='warning'>You bypass [src]'s access requirements using your emag.</span>")
authenticated = TRUE
log_activity("logged in")
else if(!(obj_flags & EMAGGED))
user.visible_message("<span class='warning'>You emag [src], disabling precise logging and allowing you to clear logs.</span>")
log_game("[key_name(user)] emagged [src] at [get_area(src)], disabling operator tracking.")
obj_flags |= EMAGGED
playsound(src, "sparks", 50, 1)
obj_flags |= EMAGGED
/obj/machinery/computer/apc_control/proc/log_activity(log_text)
var/op_string = operator && !(obj_flags & EMAGGED) ? operator : "\[NULL OPERATOR\]"

View File

@@ -47,7 +47,9 @@
/obj/item/toy/windupToolbox = 2,
/obj/item/toy/clockwork_watch = 2,
/obj/item/toy/toy_dagger = 2,
/obj/item/extendohand/acme = 1)
/obj/item/extendohand/acme = 1,
/obj/item/hot_potato/harmless/toy = 1,
/obj/item/card/emagfake = 1)
light_color = LIGHT_COLOR_GREEN

View File

@@ -8,24 +8,18 @@
switch(state)
if(0)
if(istype(P, /obj/item/wrench))
playsound(src, P.usesound, 50, 1)
to_chat(user, "<span class='notice'>You start wrenching the frame into place...</span>")
if(do_after(user, 20*P.toolspeed, target = src))
if(P.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You wrench the frame into place.</span>")
anchored = TRUE
state = 1
return
if(istype(P, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = P
if(!WT.remove_fuel(0, user))
if(!WT.isOn())
to_chat(user, "<span class='warning'>[WT] must be on to complete this task!</span>")
if(!P.tool_start_check(user, amount=0))
return
playsound(src, P.usesound, 50, 1)
to_chat(user, "<span class='notice'>You start deconstructing the frame...</span>")
if(do_after(user, 20*P.toolspeed, target = src))
if(!src || !WT.isOn())
return
if(P.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You deconstruct the frame.</span>")
var/obj/item/stack/sheet/metal/M = new (drop_location(), 5)
M.add_fingerprint(user)
@@ -33,9 +27,8 @@
return
if(1)
if(istype(P, /obj/item/wrench))
playsound(src, P.usesound, 50, 1)
to_chat(user, "<span class='notice'>You start to unfasten the frame...</span>")
if(do_after(user, 20*P.toolspeed, target = src))
if(P.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You unfasten the frame.</span>")
anchored = FALSE
state = 0
@@ -54,13 +47,13 @@
to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>")
return
if(istype(P, /obj/item/screwdriver) && circuit)
playsound(src, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You screw [circuit] into place.</span>")
state = 2
icon_state = "2"
return
if(istype(P, /obj/item/crowbar) && circuit)
playsound(src, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove [circuit].</span>")
state = 1
icon_state = "0"
@@ -70,54 +63,47 @@
return
if(2)
if(istype(P, /obj/item/screwdriver) && circuit)
playsound(src, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
state = 1
icon_state = "1"
return
if(istype(P, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = P
if(C.get_amount() >= 5)
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You start adding cables to the frame...</span>")
if(do_after(user, 20*P.toolspeed, target = src))
if(C.get_amount() >= 5 && state == 2)
C.use(5)
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
state = 3
icon_state = "3"
else
to_chat(user, "<span class='warning'>You need five lengths of cable to wire the frame!</span>")
if(!P.tool_start_check(user, amount=5))
return
to_chat(user, "<span class='notice'>You start adding cables to the frame...</span>")
if(P.use_tool(src, user, 20, volume=50, amount=5))
if(state != 2)
return
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
state = 3
icon_state = "3"
return
if(3)
if(istype(P, /obj/item/wirecutters))
playsound(src, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the cables.</span>")
state = 2
icon_state = "2"
var/obj/item/stack/cable_coil/A = new (drop_location())
A.amount = 5
var/obj/item/stack/cable_coil/A = new (drop_location(), 5)
A.add_fingerprint(user)
return
if(istype(P, /obj/item/stack/sheet/glass))
var/obj/item/stack/sheet/glass/G = P
if(G.get_amount() < 2)
to_chat(user, "<span class='warning'>You need two glass sheets to continue construction!</span>")
if(!P.tool_start_check(user, amount=2))
return
else
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You start to put in the glass panel...</span>")
if(do_after(user, 20, target = src))
if(G.get_amount() >= 2 && state == 3)
G.use(2)
to_chat(user, "<span class='notice'>You put in the glass panel.</span>")
state = 4
src.icon_state = "4"
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You start to put in the glass panel...</span>")
if(P.use_tool(src, user, 20, amount=2))
if(state != 3)
return
to_chat(user, "<span class='notice'>You put in the glass panel.</span>")
state = 4
src.icon_state = "4"
return
if(4)
if(istype(P, /obj/item/crowbar))
playsound(src, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the glass panel.</span>")
state = 3
icon_state = "3"
@@ -125,7 +111,7 @@
G.add_fingerprint(user)
return
if(istype(P, /obj/item/screwdriver))
playsound(src, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
var/obj/B = new circuit.build_path (loc, circuit)
B.dir = dir

View File

@@ -81,24 +81,20 @@
to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>")
return
if(istype(P, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = P
if(C.get_amount() >= 5)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You start to add cables to the frame...</span>")
if(do_after(user, 20*P.toolspeed, target = src))
if(C.get_amount() >= 5 && state == 1)
C.use(5)
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
state = 2
icon_state = "box_1"
else
to_chat(user, "<span class='warning'>You need five length of cable to wire the frame!</span>")
if(!P.tool_start_check(user, amount=5))
return
to_chat(user, "<span class='notice'>You start to add cables to the frame...</span>")
if(P.use_tool(src, user, 20, volume=50, amount=5))
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
state = 2
icon_state = "box_1"
return
if(istype(P, /obj/item/screwdriver) && !anchored)
playsound(src.loc, P.usesound, 50, 1)
user.visible_message("<span class='warning'>[user] disassembles the frame.</span>", \
"<span class='notice'>You start to disassemble the frame...</span>", "You hear banging and clanking.")
if(do_after(user, 40*P.toolspeed, target = src))
if(P.use_tool(src, user, 40, volume=50))
if(state == 1)
to_chat(user, "<span class='notice'>You disassemble the frame.</span>")
var/obj/item/stack/sheet/metal/M = new (loc, 5)
@@ -107,8 +103,7 @@
return
if(istype(P, /obj/item/wrench))
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
playsound(src.loc, P.usesound, 75, 1)
if(do_after(user, 40*P.toolspeed, target = src))
if(P.use_tool(src, user, 40, volume=75))
if(state == 1)
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>")
anchored = !anchored
@@ -117,8 +112,7 @@
if(2)
if(istype(P, /obj/item/wrench))
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
playsound(src.loc, P.usesound, 75, 1)
if(do_after(user, 40*P.toolspeed, target = src))
if(P.use_tool(src, user, 40, volume=75))
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>")
anchored = !anchored
return
@@ -145,17 +139,16 @@
return
if(istype(P, /obj/item/wirecutters))
playsound(src.loc, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the cables.</span>")
state = 1
icon_state = "box_0"
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
A.amount = 5
new /obj/item/stack/cable_coil(drop_location(), 5)
return
if(3)
if(istype(P, /obj/item/crowbar))
playsound(src.loc, P.usesound, 50, 1)
P.play_tool_sound(src)
state = 2
circuit.forceMove(drop_location())
components.Remove(circuit)
@@ -179,7 +172,7 @@
component_check = 0
break
if(component_check)
playsound(src.loc, P.usesound, 50, 1)
P.play_tool_sound(src)
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc, 1)
new_machine.on_construction()
for(var/obj/O in new_machine.component_parts)

View File

@@ -27,13 +27,13 @@
/obj/structure/barricade/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weldingtool) && user.a_intent != INTENT_HARM && material == METAL)
var/obj/item/weldingtool/WT = I
if(obj_integrity < max_integrity)
if(WT.remove_fuel(0,user))
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
playsound(loc, WT.usesound, 40, 1)
if(do_after(user, 40*I.toolspeed, target = src))
obj_integrity = CLAMP(obj_integrity + 20, 0, max_integrity)
if(!I.tool_start_check(user, amount=0))
return
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
if(I.use_tool(src, user, 40, volume=40))
obj_integrity = CLAMP(obj_integrity + 20, 0, max_integrity)
else
return ..()

View File

@@ -782,15 +782,12 @@
return
if(AIRLOCK_SECURITY_METAL)
if(istype(C, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = C
if(!WT.remove_fuel(2, user))
if(!C.tool_start_check(user, amount=2))
return
to_chat(user, "<span class='notice'>You begin cutting the panel's shielding...</span>")
playsound(loc, WT.usesound, 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(!panel_open || !WT.isOn())
if(C.use_tool(src, user, 40, volume=50, amount = 2))
if(!panel_open)
return
playsound(loc, WT.usesound, 50, 1)
user.visible_message("<span class='notice'>[user] cuts through \the [src]'s shielding.</span>",
"<span class='notice'>You cut through \the [src]'s shielding.</span>",
"<span class='italics'>You hear welding.</span>")
@@ -802,8 +799,7 @@
if(istype(C, /obj/item/crowbar))
var/obj/item/crowbar/W = C
to_chat(user, "<span class='notice'>You start removing the inner layer of shielding...</span>")
playsound(src, W.usesound, 100, 1)
if(do_after(user, 40*W.toolspeed, 1, target = src))
if(W.use_tool(src, user, 40, volume=100))
if(!panel_open)
return
if(security_level != AIRLOCK_SECURITY_PLASTEEL_I_S)
@@ -818,15 +814,12 @@
return
if(AIRLOCK_SECURITY_PLASTEEL_I)
if(istype(C, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = C
if(!WT.remove_fuel(2, user))
if(!C.tool_start_check(user, amount=2))
return
to_chat(user, "<span class='notice'>You begin cutting the inner layer of shielding...</span>")
playsound(loc, WT.usesound, 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(!panel_open || !WT.isOn())
if(C.use_tool(src, user, 40, volume=50, amount=2))
if(!panel_open)
return
playsound(loc, WT.usesound, 50, 1)
user.visible_message("<span class='notice'>[user] cuts through \the [src]'s shielding.</span>",
"<span class='notice'>You cut through \the [src]'s shielding.</span>",
"<span class='italics'>You hear welding.</span>")
@@ -834,10 +827,8 @@
return
if(AIRLOCK_SECURITY_PLASTEEL_O_S)
if(istype(C, /obj/item/crowbar))
var/obj/item/crowbar/W = C
to_chat(user, "<span class='notice'>You start removing outer layer of shielding...</span>")
playsound(src, W.usesound, 100, 1)
if(do_after(user, 40*W.toolspeed, 1, target = src))
if(C.use_tool(src, user, 40, volume=100))
if(!panel_open)
return
if(security_level != AIRLOCK_SECURITY_PLASTEEL_O_S)
@@ -849,15 +840,12 @@
return
if(AIRLOCK_SECURITY_PLASTEEL_O)
if(istype(C, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = C
if(!WT.remove_fuel(2, user))
if(!C.tool_start_check(user, amount=2))
return
to_chat(user, "<span class='notice'>You begin cutting the outer layer of shielding...</span>")
playsound(loc, WT.usesound, 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(!panel_open || !WT.isOn())
if(C.use_tool(src, user, 40, volume=50, amount=2))
if(!panel_open)
return
playsound(loc, WT.usesound, 50, 1)
user.visible_message("<span class='notice'>[user] cuts through \the [src]'s shielding.</span>",
"<span class='notice'>You cut through \the [src]'s shielding.</span>",
"<span class='italics'>You hear welding.</span>")
@@ -865,12 +853,10 @@
return
if(AIRLOCK_SECURITY_PLASTEEL)
if(istype(C, /obj/item/wirecutters))
var/obj/item/wirecutters/W = C
if(src.hasPower() && src.shock(user, 60)) // Protective grille of wiring is electrified
return
to_chat(user, "<span class='notice'>You start cutting through the outer grille.</span>")
playsound(src, W.usesound, 100, 1)
if(do_after(user, 10*W.toolspeed, 1, target = src))
if(C.use_tool(src, user, 10, volume=100))
if(!panel_open)
return
user.visible_message("<span class='notice'>[user] cut through \the [src]'s outer grille.</span>",
@@ -883,11 +869,11 @@
return
panel_open = !panel_open
to_chat(user, "<span class='notice'>You [panel_open ? "open":"close"] the maintenance panel of the airlock.</span>")
playsound(src.loc, C.usesound, 50, 1)
C.play_tool_sound(src)
src.update_icon()
else if(istype(C, /obj/item/wirecutters) && note)
user.visible_message("<span class='notice'>[user] cuts down [note] from [src].</span>", "<span class='notice'>You remove [note] from [src].</span>")
playsound(src, 'sound/items/Wirecutter.ogg', 50, 1)
C.play_tool_sound(src)
note.forceMove(get_turf(user))
note = null
update_icon()
@@ -932,36 +918,34 @@
/obj/machinery/door/airlock/try_to_weld(obj/item/weldingtool/W, mob/user)
if(!operating && density)
if(user.a_intent != INTENT_HELP)
if(W.remove_fuel(0,user))
user.visible_message("[user] is [welded ? "unwelding":"welding"] the airlock.", \
"<span class='notice'>You begin [welded ? "unwelding":"welding"] the airlock...</span>", \
"<span class='italics'>You hear welding.</span>")
playsound(loc, W.usesound, 40, 1)
if(do_after(user,40*W.toolspeed, 1, target = src, extra_checks = CALLBACK(src, .proc/weld_checks, W, user)))
playsound(loc, 'sound/items/welder2.ogg', 50, 1)
welded = !welded
user.visible_message("[user.name] has [welded? "welded shut":"unwelded"] [src].", \
"<span class='notice'>You [welded ? "weld the airlock shut":"unweld the airlock"].</span>")
update_icon()
if(!W.tool_start_check(user, amount=0))
return
user.visible_message("[user] is [welded ? "unwelding":"welding"] the airlock.", \
"<span class='notice'>You begin [welded ? "unwelding":"welding"] the airlock...</span>", \
"<span class='italics'>You hear welding.</span>")
if(W.use_tool(src, user, 40, volume=50, extra_checks = CALLBACK(src, .proc/weld_checks, W, user)))
welded = !welded
user.visible_message("[user.name] has [welded? "welded shut":"unwelded"] [src].", \
"<span class='notice'>You [welded ? "weld the airlock shut":"unweld the airlock"].</span>")
update_icon()
else
if(obj_integrity < max_integrity)
if(W.remove_fuel(0,user))
user.visible_message("[user] is welding the airlock.", \
"<span class='notice'>You begin repairing the airlock...</span>", \
"<span class='italics'>You hear welding.</span>")
playsound(loc, W.usesound, 40, 1)
if(do_after(user,40*W.toolspeed, 1, target = src, extra_checks = CALLBACK(src, .proc/weld_checks, W, user)))
playsound(loc, 'sound/items/welder2.ogg', 50, 1)
obj_integrity = max_integrity
stat &= ~BROKEN
user.visible_message("[user.name] has repaired [src].", \
"<span class='notice'>You finish repairing the airlock.</span>")
update_icon()
if(!W.tool_start_check(user, amount=0))
return
user.visible_message("[user] is welding the airlock.", \
"<span class='notice'>You begin repairing the airlock...</span>", \
"<span class='italics'>You hear welding.</span>")
if(W.use_tool(src, user, 40, volume=50, extra_checks = CALLBACK(src, .proc/weld_checks, W, user)))
obj_integrity = max_integrity
stat &= ~BROKEN
user.visible_message("[user.name] has repaired [src].", \
"<span class='notice'>You finish repairing the airlock.</span>")
update_icon()
else
to_chat(user, "<span class='notice'>The airlock doesn't need repairing.</span>")
/obj/machinery/door/airlock/proc/weld_checks(obj/item/weldingtool/W, mob/user)
return !operating && density && user && W && W.isOn() && user.loc
return !operating && density
/obj/machinery/door/airlock/try_to_crowbar(obj/item/I, mob/living/user)
var/beingcrowbarred = null
@@ -971,8 +955,7 @@
beingcrowbarred = 0
if(panel_open && charge)
to_chat(user, "<span class='notice'>You carefully start removing [charge] from [src]...</span>")
playsound(get_turf(src), I.usesound, 50, 1)
if(!do_after(user, 150*I.toolspeed, target = src))
if(!I.use_tool(src, user, 150, volume=50))
to_chat(user, "<span class='warning'>You slip and [charge] detonates!</span>")
charge.ex_act(EXPLODE_DEVASTATE)
user.Knockdown(60)
@@ -983,13 +966,11 @@
charge = null
return
if(beingcrowbarred && panel_open && ((obj_flags & EMAGGED) || (density && welded && !operating && !hasPower() && !locked)))
playsound(src.loc, I.usesound, 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", \
"<span class='notice'>You start to remove electronics from the airlock assembly...</span>")
if(do_after(user,40*I.toolspeed, target = src))
if(src.loc)
deconstruct(TRUE, user)
return
if(I.use_tool(src, user, 40, volume=100))
deconstruct(TRUE, user)
return
else if(hasPower())
to_chat(user, "<span class='warning'>The airlock's motors resist your efforts to force it!</span>")
else if(locked)

View File

@@ -576,16 +576,14 @@
else if(istype(I, /obj/item/wrench))
if(construction_state == GEAR_SECURE)
user.visible_message("<span class='notice'>[user] begins loosening [src]'s cogwheel...</span>", "<span class='notice'>You begin loosening [src]'s cogwheel...</span>")
playsound(src, I.usesound, 50, 1)
if(!do_after(user, 75*I.toolspeed, target = src) || construction_state != GEAR_SECURE)
if(!I.use_tool(src, user, 75, volume=50) || construction_state != GEAR_SECURE)
return 1
user.visible_message("<span class='notice'>[user] loosens [src]'s cogwheel!</span>", "<span class='notice'>[src]'s cogwheel pops off and dangles loosely.</span>")
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
construction_state = GEAR_LOOSE
else if(construction_state == GEAR_LOOSE)
user.visible_message("<span class='notice'>[user] begins tightening [src]'s cogwheel...</span>", "<span class='notice'>You begin tightening [src]'s cogwheel into place...</span>")
playsound(src, I.usesound, 50, 1)
if(!do_after(user, 75*I.toolspeed, target = src) || construction_state != GEAR_LOOSE)
if(!I.use_tool(src, user, 75, volume=50) || construction_state != GEAR_LOOSE)
return 1
user.visible_message("<span class='notice'>[user] tightens [src]'s cogwheel!</span>", "<span class='notice'>You firmly tighten [src]'s cogwheel into place.</span>")
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
@@ -597,8 +595,7 @@
return 1
else if(construction_state == GEAR_LOOSE)
user.visible_message("<span class='notice'>[user] begins slowly lifting off [src]'s cogwheel...</span>", "<span class='notice'>You slowly begin lifting off [src]'s cogwheel...</span>")
playsound(src, I.usesound, 50, 1)
if(!do_after(user, 75*I.toolspeed, target = src) || construction_state != GEAR_LOOSE)
if(!I.use_tool(src, user, 75, volume=50) || construction_state != GEAR_LOOSE)
return 1
user.visible_message("<span class='notice'>[user] lifts off [src]'s cogwheel, causing it to fall apart!</span>", \
"<span class='notice'>You lift off [src]'s cogwheel, causing it to fall apart!</span>")

View File

@@ -100,10 +100,10 @@
if(boltslocked)
to_chat(user, "<span class='notice'>There are screws locking the bolts in place!</span>")
return
playsound(get_turf(src), C.usesound, 50, 1)
C.play_tool_sound(src)
user.visible_message("<span class='notice'>[user] starts undoing [src]'s bolts...</span>", \
"<span class='notice'>You start unfastening [src]'s floor bolts...</span>")
if(!do_after(user, 50*C.toolspeed, target = src))
if(!C.use_tool(src, user, 50))
return
playsound(get_turf(src), 'sound/items/deconstruct.ogg', 50, 1)
user.visible_message("<span class='notice'>[user] unfastens [src]'s bolts.</span>", \
@@ -113,7 +113,7 @@
if(istype(C, /obj/item/screwdriver))
user.visible_message("<span class='notice'>[user] [boltslocked ? "unlocks" : "locks"] [src]'s bolts.</span>", \
"<span class='notice'>You [boltslocked ? "unlock" : "lock"] [src]'s floor bolts.</span>")
playsound(get_turf(src), C.usesound, 50, 1)
C.play_tool_sound(src)
boltslocked = !boltslocked
return
@@ -123,14 +123,13 @@
return
/obj/machinery/door/firedoor/try_to_weld(obj/item/weldingtool/W, mob/user)
if(W.remove_fuel(0, user))
playsound(get_turf(src), W.usesound, 50, 1)
user.visible_message("<span class='notice'>[user] starts [welded ? "unwelding" : "welding"] [src].</span>", "<span class='notice'>You start welding [src].</span>")
if(do_after(user, 40*W.toolspeed, 1, target=src))
playsound(get_turf(src), W.usesound, 50, 1)
welded = !welded
to_chat(user, "<span class='danger'>[user] [welded?"welds":"unwelds"] [src].</span>", "<span class='notice'>You [welded ? "weld" : "unweld"] [src].</span>")
update_icon()
if(!W.tool_start_check(user, amount=0))
return
user.visible_message("<span class='notice'>[user] starts [welded ? "unwelding" : "welding"] [src].</span>", "<span class='notice'>You start welding [src].</span>")
if(W.use_tool(src, user, 40, volume=50))
welded = !welded
to_chat(user, "<span class='danger'>[user] [welded?"welds":"unwelds"] [src].</span>", "<span class='notice'>You [welded ? "weld" : "unweld"] [src].</span>")
update_icon()
/obj/machinery/door/firedoor/try_to_crowbar(obj/item/I, mob/user)
if(welded || operating)
@@ -284,10 +283,10 @@
switch(constructionStep)
if(CONSTRUCTION_PANEL_OPEN)
if(istype(C, /obj/item/crowbar))
playsound(get_turf(src), C.usesound, 50, 1)
C.play_tool_sound(src)
user.visible_message("<span class='notice'>[user] starts prying something out from [src]...</span>", \
"<span class='notice'>You begin prying out the wire cover...</span>")
if(!do_after(user, 50*C.toolspeed, target = src))
if(!C.use_tool(src, user, 50))
return
if(constructionStep != CONSTRUCTION_PANEL_OPEN)
return
@@ -301,10 +300,10 @@
if(locate(/obj/machinery/door/firedoor) in get_turf(src))
to_chat(user, "<span class='warning'>There's already a firelock there.</span>")
return
playsound(get_turf(src), C.usesound, 50, 1)
C.play_tool_sound(src)
user.visible_message("<span class='notice'>[user] starts bolting down [src]...</span>", \
"<span class='notice'>You begin bolting [src]...</span>")
if(!do_after(user, 30*C.toolspeed, target = src))
if(!C.use_tool(src, user, 30))
return
if(locate(/obj/machinery/door/firedoor) in get_turf(src))
return
@@ -340,10 +339,10 @@
if(CONSTRUCTION_WIRES_EXPOSED)
if(istype(C, /obj/item/wirecutters))
playsound(get_turf(src), C.usesound, 50, 1)
C.play_tool_sound(src)
user.visible_message("<span class='notice'>[user] starts cutting the wires from [src]...</span>", \
"<span class='notice'>You begin removing [src]'s wires...</span>")
if(!do_after(user, 60*C.toolspeed, target = src))
if(!C.use_tool(src, user, 60))
return
if(constructionStep != CONSTRUCTION_WIRES_EXPOSED)
return
@@ -355,10 +354,10 @@
update_icon()
return
if(istype(C, /obj/item/crowbar))
playsound(get_turf(src), C.usesound, 50, 1)
C.play_tool_sound(src)
user.visible_message("<span class='notice'>[user] starts prying a metal plate into [src]...</span>", \
"<span class='notice'>You begin prying the cover plate back onto [src]...</span>")
if(!do_after(user, 80*C.toolspeed, target = src))
if(!C.use_tool(src, user, 80))
return
if(constructionStep != CONSTRUCTION_WIRES_EXPOSED)
return
@@ -372,15 +371,13 @@
if(istype(C, /obj/item/crowbar))
user.visible_message("<span class='notice'>[user] begins removing the circuit board from [src]...</span>", \
"<span class='notice'>You begin prying out the circuit board from [src]...</span>")
playsound(get_turf(src), C.usesound, 50, 1)
if(!do_after(user, 50*C.toolspeed, target = src))
if(!C.use_tool(src, user, 50, volume=50))
return
if(constructionStep != CONSTRUCTION_GUTTED)
return
user.visible_message("<span class='notice'>[user] removes [src]'s circuit board.</span>", \
"<span class='notice'>You remove the circuit board from [src].</span>")
new /obj/item/electronics/firelock(get_turf(src))
playsound(get_turf(src), C.usesound, 50, 1)
new /obj/item/electronics/firelock(drop_location())
constructionStep = CONSTRUCTION_NOCIRCUIT
update_icon()
return
@@ -404,18 +401,17 @@
return
if(CONSTRUCTION_NOCIRCUIT)
if(istype(C, /obj/item/weldingtool))
var/obj/item/weldingtool/W = C
if(W.remove_fuel(1,user))
playsound(get_turf(src), W.usesound, 50, 1)
user.visible_message("<span class='notice'>[user] begins cutting apart [src]'s frame...</span>", \
"<span class='notice'>You begin slicing [src] apart...</span>")
if(!do_after(user, 80*C.toolspeed, target = src))
return
if(!C.tool_start_check(user, amount=1))
return
user.visible_message("<span class='notice'>[user] begins cutting apart [src]'s frame...</span>", \
"<span class='notice'>You begin slicing [src] apart...</span>")
if(C.use_tool(src, user, 40, volume=50, amount=1))
return
if(constructionStep != CONSTRUCTION_NOCIRCUIT)
return
user.visible_message("<span class='notice'>[user] cuts apart [src]!</span>", \
"<span class='notice'>You cut [src] into metal.</span>")
playsound(get_turf(src), 'sound/items/welder2.ogg', 50, 1)
var/turf/T = get_turf(src)
new /obj/item/stack/sheet/metal(T, 3)
if(reinforced)

View File

@@ -227,17 +227,16 @@
if(density || operating)
to_chat(user, "<span class='warning'>You need to open the door to access the maintenance panel!</span>")
return
playsound(src.loc, I.usesound, 50, 1)
I.play_tool_sound(src)
panel_open = !panel_open
to_chat(user, "<span class='notice'>You [panel_open ? "open":"close"] the maintenance panel of the [src.name].</span>")
return
if(istype(I, /obj/item/crowbar))
if(panel_open && !density && !operating)
playsound(src.loc, I.usesound, 100, 1)
user.visible_message("[user] removes the electronics from the [src.name].", \
"<span class='notice'>You start to remove electronics from the [src.name]...</span>")
if(do_after(user,40*I.toolspeed, target = src))
if(I.use_tool(src, user, 40, volume=50))
if(panel_open && !density && !operating && src.loc)
var/obj/structure/windoor_assembly/WA = new /obj/structure/windoor_assembly(src.loc)
switch(base_state)

View File

@@ -29,8 +29,8 @@ GLOBAL_LIST_EMPTY(doppler_arrays)
/obj/machinery/doppler_array/process()
return PROCESS_KILL
/obj/machinery/doppler_array/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/wrench))
/obj/machinery/doppler_array/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench))
if(!anchored && !isinspace())
anchored = TRUE
power_change()
@@ -39,7 +39,7 @@ GLOBAL_LIST_EMPTY(doppler_arrays)
anchored = FALSE
power_change()
to_chat(user, "<span class='notice'>You unfasten [src].</span>")
playsound(loc, O.usesound, 50, 1)
I.play_tool_sound(src)
else
return ..()
@@ -109,14 +109,14 @@ GLOBAL_LIST_EMPTY(doppler_arrays)
. = ..()
if(!istype(linked_techweb))
say("Warning: No linked research system!")
return
return
var/adjusted = orig_light - 10 - linked_techweb.max_bomb_value
if(adjusted <= 0)
say("Explosion not large enough for research calculations.")
return
var/point_gain = techweb_scale_bomb(adjusted)
if(point_gain <= 0)
say("Explosion not large enough for research calculations.")
say("Explosion not large enough for research calculations.")
return
linked_techweb.max_bomb_value = orig_light - 10
linked_techweb.research_points += point_gain

View File

@@ -210,35 +210,26 @@
else
icon_state = icon_on
/obj/machinery/droneDispenser/attackby(obj/item/O, mob/living/user)
if(istype(O, /obj/item/crowbar))
/obj/machinery/droneDispenser/attackby(obj/item/I, mob/living/user)
if(istype(I, /obj/item/crowbar))
GET_COMPONENT(materials, /datum/component/material_container)
materials.retrieve_all()
playsound(loc, O.usesound, 50, 1)
I.play_tool_sound(src)
to_chat(user, "<span class='notice'>You retrieve the materials from [src].</span>")
else if(istype(O, /obj/item/weldingtool))
else if(istype(I, /obj/item/weldingtool))
if(!(stat & BROKEN))
to_chat(user, "<span class='warning'>[src] doesn't need repairs.</span>")
return
var/obj/item/weldingtool/WT = O
if(!WT.isOn())
if(!I.tool_start_check(user, amount=1))
return
if(WT.get_fuel() < 1)
to_chat(user, "<span class='warning'>You need more fuel to complete this task!</span>")
return
playsound(src, WT.usesound, 50, 1)
user.visible_message(
"<span class='notice'>[user] begins patching up [src] with [WT].</span>",
"<span class='notice'>[user] begins patching up [src] with [I].</span>",
"<span class='notice'>You begin restoring the damage to [src]...</span>")
if(!do_after(user, 40*O.toolspeed, target = src))
return
if(!src || !WT.remove_fuel(1, user))
if(!I.use_tool(src, user, 40, volume=50, amount=1))
return
user.visible_message(

View File

@@ -149,7 +149,7 @@
add_fingerprint(user)
if(istype(W, /obj/item/screwdriver) && buildstage == 2)
playsound(src.loc, W.usesound, 50, 1)
W.play_tool_sound(src)
panel_open = !panel_open
to_chat(user, "<span class='notice'>The wires have been [panel_open ? "exposed" : "unexposed"].</span>")
update_icon()
@@ -158,15 +158,14 @@
if(panel_open)
if(istype(W, /obj/item/weldingtool) && user.a_intent == INTENT_HELP)
var/obj/item/weldingtool/WT = W
if(obj_integrity < max_integrity)
if(WT.remove_fuel(0,user))
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
playsound(loc, WT.usesound, 40, 1)
if(do_after(user, 40*WT.toolspeed, target = src))
obj_integrity = max_integrity
playsound(loc, 'sound/items/welder2.ogg', 50, 1)
to_chat(user, "<span class='notice'>You repair [src].</span>")
if(!W.tool_start_check(user, amount=0))
return
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
if(W.use_tool(src, user, 40, volume=50))
obj_integrity = max_integrity
to_chat(user, "<span class='notice'>You repair [src].</span>")
else
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
return
@@ -183,7 +182,7 @@
else if (istype(W, /obj/item/wirecutters))
buildstage = 1
playsound(src.loc, W.usesound, 50, 1)
W.play_tool_sound(src)
new /obj/item/stack/cable_coil(user.loc, 5)
to_chat(user, "<span class='notice'>You cut the wires from \the [src].</span>")
update_icon()
@@ -201,10 +200,9 @@
return
else if(istype(W, /obj/item/crowbar))
playsound(src.loc, W.usesound, 50, 1)
user.visible_message("[user.name] removes the electronics from [src.name].", \
"<span class='notice'>You start prying out the circuit...</span>")
if(do_after(user, 20*W.toolspeed, target = src))
if(W.use_tool(src, user, 20, volume=50))
if(buildstage == 1)
if(stat & BROKEN)
to_chat(user, "<span class='notice'>You remove the destroyed circuit.</span>")
@@ -238,7 +236,7 @@
"<span class='notice'>You remove the fire alarm assembly from the wall.</span>")
var/obj/item/wallframe/firealarm/frame = new /obj/item/wallframe/firealarm()
frame.forceMove(user.drop_location())
playsound(src.loc, W.usesound, 50, 1)
W.play_tool_sound(src)
qdel(src)
return
return ..()

View File

@@ -54,8 +54,7 @@
if (istype(W, /obj/item/wirecutters))
if (bulb)
user.visible_message("[user] begins to disconnect [src]'s flashbulb.", "<span class='notice'>You begin to disconnect [src]'s flashbulb...</span>")
playsound(src.loc, W.usesound, 100, 1)
if(do_after(user, 30*W.toolspeed, target = src) && bulb)
if(W.use_tool(src, user, 30, volume=50) && bulb)
user.visible_message("[user] has disconnected [src]'s flashbulb!", "<span class='notice'>You disconnect [src]'s flashbulb.</span>")
bulb.forceMove(loc)
bulb = null
@@ -74,8 +73,7 @@
else if (istype(W, /obj/item/wrench))
if(!bulb)
to_chat(user, "<span class='notice'>You start unsecuring the flasher frame...</span>")
playsound(loc, W.usesound, 50, 1)
if(do_after(user, 40*W.toolspeed, target = src))
if(W.use_tool(src, user, 40, volume=50))
to_chat(user, "<span class='notice'>You unsecure the flasher frame.</span>")
deconstruct(TRUE)
else
@@ -165,7 +163,7 @@
/obj/machinery/flasher/portable/attackby(obj/item/W, mob/user, params)
if (istype(W, /obj/item/wrench))
playsound(src.loc, W.usesound, 100, 1)
W.play_tool_sound(src, 100)
if (!anchored && !isinspace())
to_chat(user, "<span class='notice'>[src] is now secured.</span>")

View File

@@ -630,4 +630,4 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
alpha = 100
#undef HOLOPAD_PASSIVE_POWER_USAGE
#undef HOLOGRAM_POWER_USAGE
#undef HOLOGRAM_POWER_USAGE

View File

@@ -724,8 +724,8 @@ GLOBAL_LIST_EMPTY(allCasters)
/obj/machinery/newscaster/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/wrench))
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
playsound(loc, I.usesound, 50, 1)
if(do_after(user, 60*I.toolspeed, target = src))
I.play_tool_sound(src)
if(I.use_tool(src, user, 60))
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
if(stat & BROKEN)
to_chat(user, "<span class='warning'>The broken remains of [src] fall on the ground.</span>")
@@ -737,21 +737,19 @@ GLOBAL_LIST_EMPTY(allCasters)
new /obj/item/wallframe/newscaster(loc)
qdel(src)
else if(istype(I, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
var/obj/item/weldingtool/WT = I
if(stat & BROKEN)
if(WT.remove_fuel(0,user))
user.visible_message("[user] is repairing [src].", \
"<span class='notice'>You begin repairing [src]...</span>", \
"<span class='italics'>You hear welding.</span>")
playsound(loc, WT.usesound, 40, 1)
if(do_after(user,40*WT.toolspeed, 1, target = src))
if(!WT.isOn() || !(stat & BROKEN))
return
to_chat(user, "<span class='notice'>You repair [src].</span>")
playsound(loc, 'sound/items/welder2.ogg', 50, 1)
obj_integrity = max_integrity
stat &= ~BROKEN
update_icon()
if(!I.tool_start_check(user, amount=0))
return
user.visible_message("[user] is repairing [src].", \
"<span class='notice'>You begin repairing [src]...</span>", \
"<span class='italics'>You hear welding.</span>")
if(I.use_tool(src, user, 40, volume=50))
if(!(stat & BROKEN))
return
to_chat(user, "<span class='notice'>You repair [src].</span>")
obj_integrity = max_integrity
stat &= ~BROKEN
update_icon()
else
to_chat(user, "<span class='notice'>[src] does not need repairs.</span>")
else

View File

@@ -151,7 +151,7 @@ Buildable meters
A.on_construction(color, piping_layer)
transfer_fingerprints_to(A)
playsound(src, W.usesound, 50, 1)
W.play_tool_sound(src)
user.visible_message( \
"[user] fastens \the [src].", \
"<span class='notice'>You fasten \the [src].</span>", \
@@ -205,7 +205,7 @@ Buildable meters
to_chat(user, "<span class='warning'>You need to fasten it to a pipe!</span>")
return TRUE
new /obj/machinery/meter(loc, piping_layer)
playsound(src, I.usesound, 50, 1)
I.play_tool_sound(src)
to_chat(user, "<span class='notice'>You fasten the meter to the pipe.</span>")
qdel(src)

View File

@@ -64,35 +64,15 @@
to_chat(usr, "<span class='notice'>You put [W] back into [src].</span>")
qdel(W)
return
else if (istype(W, /obj/item/wrench))
if (!anchored && !isinspace())
playsound(src, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to fasten \the [src] to the floor...</span>")
if (do_after(user, 40*W.toolspeed, target = src))
add_fingerprint(user)
user.visible_message( \
"[user] fastens \the [src].", \
"<span class='notice'>You fasten \the [src]. Now it can dispense pipes.</span>", \
"<span class='italics'>You hear ratchet.</span>")
anchored = TRUE
stat &= MAINT
if (usr.machine==src)
usr << browse(null, "window=pipedispenser")
else if(anchored)
playsound(src, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src] from the floor...</span>")
if (do_after(user, 20*W.toolspeed, target = src))
add_fingerprint(user)
user.visible_message( \
"[user] unfastens \the [src].", \
"<span class='notice'>You unfasten \the [src]. Now it can be pulled somewhere else.</span>", \
"<span class='italics'>You hear ratchet.</span>")
anchored = FALSE
stat |= ~MAINT
power_change()
else
return ..()
/obj/machinery/pipedispenser/wrench_act(mob/living/user, obj/item/I)
if(default_unfasten_wrench(user, I, 40))
user << browse(null, "window=pipedispenser")
return TRUE
/obj/machinery/pipedispenser/disposal
name = "disposal pipe dispenser"

View File

@@ -232,7 +232,7 @@
//If the turret is destroyed, you can remove it with a crowbar to
//try and salvage its components
to_chat(user, "<span class='notice'>You begin prying the metal coverings off...</span>")
if(do_after(user, 20*I.toolspeed, target = src))
if(I.use_tool(src, user, 20))
if(prob(70))
if(stored_gun)
stored_gun.forceMove(loc)

View File

@@ -23,14 +23,14 @@
switch(build_step)
if(PTURRET_UNSECURED) //first step
if(istype(I, /obj/item/wrench) && !anchored)
playsound(loc, I.usesound, 100, 1)
I.play_tool_sound(src, 100)
to_chat(user, "<span class='notice'>You secure the external bolts.</span>")
anchored = TRUE
build_step = PTURRET_BOLTED
return
else if(istype(I, /obj/item/crowbar) && !anchored)
playsound(loc, I.usesound, 75, 1)
I.play_tool_sound(src, 75)
to_chat(user, "<span class='notice'>You dismantle the turret construction.</span>")
new /obj/item/stack/sheet/metal( loc, 5)
qdel(src)
@@ -48,7 +48,7 @@
return
else if(istype(I, /obj/item/wrench))
playsound(loc, I.usesound, 75, 1)
I.play_tool_sound(src, 75)
to_chat(user, "<span class='notice'>You unfasten the external bolts.</span>")
anchored = FALSE
build_step = PTURRET_UNSECURED
@@ -57,27 +57,21 @@
if(PTURRET_START_INTERNAL_ARMOUR)
if(istype(I, /obj/item/wrench))
playsound(loc, I.usesound, 100, 1)
I.play_tool_sound(src, 100)
to_chat(user, "<span class='notice'>You bolt the metal armor into place.</span>")
build_step = PTURRET_INTERNAL_ARMOUR_ON
return
else if(istype(I, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = I
if(!WT.isOn())
return
if(WT.get_fuel() < 5) //uses up 5 fuel.
to_chat(user, "<span class='warning'>You need more fuel to complete this task!</span>")
if(!I.tool_start_check(user, amount=5)) //uses up 5 fuel
return
playsound(loc, WT.usesound, 50, 1)
to_chat(user, "<span class='notice'>You start to remove the turret's interior metal armor...</span>")
if(do_after(user, 20*I.toolspeed, target = src))
if(!WT.isOn() || !WT.remove_fuel(5, user))
return
if(I.use_tool(src, user, 20, volume=50, amount=5)) //uses up 5 fuel
build_step = PTURRET_BOLTED
to_chat(user, "<span class='notice'>You remove the turret's interior metal armor.</span>")
new /obj/item/stack/sheet/metal( loc, 2)
new /obj/item/stack/sheet/metal(drop_location(), 2)
return
@@ -92,7 +86,7 @@
return
else if(istype(I, /obj/item/wrench))
playsound(loc, I.usesound, 100, 1)
I.play_tool_sound(src, 100)
to_chat(user, "<span class='notice'>You remove the turret's metal armor bolts.</span>")
build_step = PTURRET_START_INTERNAL_ARMOUR
return
@@ -109,7 +103,7 @@
if(PTURRET_SENSORS_ON)
if(istype(I, /obj/item/screwdriver))
playsound(loc, I.usesound, 100, 1)
I.play_tool_sound(src, 100)
build_step = PTURRET_CLOSED
to_chat(user, "<span class='notice'>You close the internal access hatch.</span>")
return
@@ -126,24 +120,18 @@
return
else if(istype(I, /obj/item/screwdriver))
playsound(loc, I.usesound, 100, 1)
I.play_tool_sound(src, 100)
build_step = PTURRET_SENSORS_ON
to_chat(user, "<span class='notice'>You open the internal access hatch.</span>")
return
if(PTURRET_START_EXTERNAL_ARMOUR)
if(istype(I, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = I
if(!WT.isOn())
if(!I.tool_start_check(user, amount=5))
return
if(WT.get_fuel() < 5)
to_chat(user, "<span class='warning'>You need more fuel to complete this task!</span>")
playsound(loc, WT.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to weld the turret's armor down...</span>")
if(do_after(user, 30*I.toolspeed, target = src))
if(!WT.isOn() || !WT.remove_fuel(5, user))
return
if(I.use_tool(src, user, 30, volume=50, amount=5))
build_step = PTURRET_EXTERNAL_ARMOUR_ON
to_chat(user, "<span class='notice'>You weld the turret's armor down.</span>")
@@ -161,7 +149,7 @@
qdel(src)
else if(istype(I, /obj/item/crowbar))
playsound(loc, I.usesound, 75, 1)
I.play_tool_sound(src, 75)
to_chat(user, "<span class='notice'>You pry off the turret's exterior armor.</span>")
new /obj/item/stack/sheet/metal(loc, 2)
build_step = PTURRET_CLOSED

View File

@@ -29,7 +29,7 @@
anchored = !anchored
power_change()
to_chat(user, "<span class='notice'>You [anchored ? "attached" : "detached"] [src].</span>")
playsound(loc, G.usesound, 75, 1)
G.play_tool_sound(src)
return
var/allowed = is_type_in_typecache(G, allowed_devices)

View File

@@ -144,7 +144,7 @@
/obj/machinery/shieldgen/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver))
playsound(src.loc, W.usesound, 100, 1)
W.play_tool_sound(src, 100)
panel_open = !panel_open
if(panel_open)
to_chat(user, "<span class='notice'>You open the panel and expose the wiring.</span>")
@@ -170,11 +170,11 @@
to_chat(user, "<span class='warning'>The bolts are covered! Unlocking this would retract the covers.</span>")
return
if(!anchored && !isinspace())
playsound(src.loc, W.usesound, 100, 1)
W.play_tool_sound(src, 100)
to_chat(user, "<span class='notice'>You secure \the [src] to the floor!</span>")
anchored = TRUE
else if(anchored)
playsound(src.loc, W.usesound, 100, 1)
W.play_tool_sound(src, 100)
to_chat(user, "<span class='notice'>You unsecure \the [src] from the floor!</span>")
if(active)
to_chat(user, "<span class='notice'>\The [src] shuts off!</span>")

View File

@@ -116,14 +116,14 @@
to_chat(user, "<span class='notice'>The bomb must be placed on solid ground to attach it.</span>")
else
to_chat(user, "<span class='notice'>You firmly wrench the bomb to the floor.</span>")
playsound(loc, I.usesound, 50, 1)
I.play_tool_sound(src)
anchored = TRUE
if(active)
to_chat(user, "<span class='notice'>The bolts lock in place.</span>")
else
if(!active)
to_chat(user, "<span class='notice'>You wrench the bomb from the floor.</span>")
playsound(loc, I.usesound, 50, 1)
I.play_tool_sound(src)
anchored = FALSE
else
to_chat(user, "<span class='warning'>The bolts are locked down!</span>")
@@ -159,18 +159,12 @@
else if(istype(I, /obj/item/weldingtool))
if(payload || !wires.is_all_cut() || !open_panel)
return
var/obj/item/weldingtool/WT = I
if(!WT.isOn())
return
if(WT.get_fuel() < 5) //uses up 5 fuel.
to_chat(user, "<span class='warning'>You need more fuel to complete this task!</span>")
if(!I.tool_start_check(user, amount=5)) //uses up 5 fuel
return
playsound(loc, WT.usesound, 50, 1)
to_chat(user, "<span class='notice'>You start to cut [src] apart...</span>")
if(do_after(user, 20*I.toolspeed, target = src))
if(!WT.isOn() || !WT.remove_fuel(5, user))
return
if(I.use_tool(src, user, 20, volume=50, amount=5)) //uses up 5 fuel
to_chat(user, "<span class='notice'>You cut [src] apart.</span>")
new /obj/item/stack/sheet/plasteel( loc, 5)
qdel(src)
@@ -448,7 +442,7 @@
/obj/item/bombcore/chemical/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/crowbar) && beakers.len > 0)
playsound(loc, I.usesound, 50, 1)
I.play_tool_sound(src)
for (var/obj/item/B in beakers)
B.forceMove(drop_location())
beakers -= B

View File

@@ -260,7 +260,7 @@
cut_overlays()
if(panel_open)
add_overlay("[initial(icon_state)]-panel")
playsound(src, W.usesound, 50, 1)
W.play_tool_sound(src)
updateUsrDialog()
else
to_chat(user, "<span class='warning'>You must first secure [src].</span>")

View File

@@ -2,77 +2,34 @@
///// Construction datums //////
////////////////////////////////
/datum/construction/mecha/custom_action(step, atom/used_atom, mob/user)
if(istype(used_atom, /obj/item/weldingtool))
var/obj/item/weldingtool/W = used_atom
if (W.remove_fuel(0, user))
/datum/construction/mecha/custom_action(step, obj/item/I, mob/user)
if(I.tool_behaviour == TOOL_WELDER)
if(I.use_tool(holder, user, 0))
playsound(holder, 'sound/items/welder2.ogg', 50, 1)
else
return FALSE
else if(istype(used_atom, /obj/item/wrench))
var/obj/item/W = used_atom
playsound(holder, W.usesound, 50, 1)
else if(istype(used_atom, /obj/item/screwdriver))
var/obj/item/W = used_atom
playsound(holder, W.usesound, 50, 1)
else if(I.tool_behaviour)
return I.use_tool(holder, user, 0, volume=50)
else if(istype(used_atom, /obj/item/wirecutters))
var/obj/item/W = used_atom
playsound(holder, W.usesound, 50, 1)
else if(istype(I, /obj/item/stack))
return I.use_tool(holder, user, 0, volume=50, amount=5)
else if(istype(used_atom, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = used_atom
if(C.use(4))
playsound(holder, 'sound/items/deconstruct.ogg', 50, 1)
else
to_chat(user, ("<span class='warning'>There's not enough cable to finish the task!</span>"))
return FALSE
else if(istype(used_atom, /obj/item/stack/ore/bluespace_crystal))
var/obj/item/stack/ore/bluespace_crystal/BSC = used_atom
BSC.use(1)
else if(istype(used_atom, /obj/item/stack))
var/obj/item/stack/S = used_atom
if(S.get_amount() < 5)
to_chat(user, ("<span class='warning'>There's not enough material in this stack!</span>"))
return FALSE
else
S.use(5)
return TRUE
/datum/construction/reversible/mecha/custom_action(index as num, diff as num, atom/used_atom, mob/user)
if(istype(used_atom, /obj/item/weldingtool))
var/obj/item/weldingtool/W = used_atom
if (W.remove_fuel(0, user))
/datum/construction/reversible/mecha/custom_action(index as num, diff as num, obj/item/I, mob/user)
if(I.tool_behaviour == TOOL_WELDER)
if(I.use_tool(holder, user, 0))
playsound(holder, 'sound/items/welder2.ogg', 50, 1)
else
return FALSE
else if(istype(used_atom, /obj/item/wrench))
var/obj/item/W = used_atom
playsound(holder, W.usesound, 50, 1)
else if(istype(used_atom, /obj/item/screwdriver))
var/obj/item/W = used_atom
playsound(holder, W.usesound, 50, 1)
else if(I.tool_behaviour)
return I.use_tool(holder, user, 0, volume=50)
else if(istype(used_atom, /obj/item/wirecutters))
var/obj/item/W = used_atom
playsound(holder, W.usesound, 50, 1)
else if(istype(I, /obj/item/stack))
return I.use_tool(holder, user, 0, volume=50, amount=5)
else if(istype(used_atom, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = used_atom
if (C.use(4))
playsound(holder, 'sound/items/deconstruct.ogg', 50, 1)
else
to_chat(user, ("<span class='warning'>There's not enough cable to finish the task!</span>"))
return FALSE
else if(istype(used_atom, /obj/item/stack))
var/obj/item/stack/S = used_atom
if(S.get_amount() < 5)
to_chat(user, ("<span class='warning'>There's not enough material in this stack!</span>"))
return FALSE
else
S.use(5)
return TRUE

View File

@@ -240,9 +240,8 @@
else if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
user.changeNext_move(CLICK_CD_MELEE)
var/obj/item/weldingtool/WT = W
if(obj_integrity<max_integrity)
if(WT.remove_fuel(1, user))
if(obj_integrity < max_integrity)
if(W.use_tool(src, user, 0, volume=50, amount=1))
if (internal_damage & MECHA_INT_TANK_BREACH)
clearInternalDamage(MECHA_INT_TANK_BREACH)
to_chat(user, "<span class='notice'>You repair the damaged gas tank.</span>")
@@ -251,9 +250,7 @@
obj_integrity += min(10, max_integrity-obj_integrity)
if(obj_integrity == max_integrity)
to_chat(user, "<span class='notice'>It looks to be fully repaired now.</span>")
else
to_chat(user, "<span class='warning'>[WT] needs to be on for this task!</span>")
return 1
return 1
else
to_chat(user, "<span class='warning'>The [name] is at full integrity!</span>")
return 1

View File

@@ -36,23 +36,24 @@
/obj/structure/mecha_wreckage/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weldingtool))
if(salvage_num <= 0)
if(salvage_num <= 0 || !length(welder_salvage))
to_chat(user, "<span class='warning'>You don't see anything that can be cut with [I]!</span>")
return
var/obj/item/weldingtool/WT = I
if(welder_salvage && welder_salvage.len && WT.remove_fuel(0, user))
var/type = prob(70) ? pick(welder_salvage) : null
if(type)
var/N = new type(get_turf(user))
user.visible_message("[user] cuts [N] from [src].", "<span class='notice'>You cut [N] from [src].</span>")
if(istype(N, /obj/item/mecha_parts/part))
welder_salvage -= type
salvage_num--
else
to_chat(user, "<span class='warning'>You fail to salvage anything valuable from [src]!</span>")
else
if(!I.use_tool(src, user, 0, volume=50))
return
var/type = prob(70) ? pick(welder_salvage) : null
if(type)
var/N = new type(get_turf(user))
user.visible_message("[user] cuts [N] from [src].", "<span class='notice'>You cut [N] from [src].</span>")
if(istype(N, /obj/item/mecha_parts/part))
welder_salvage -= type
salvage_num--
else
to_chat(user, "<span class='warning'>You fail to salvage anything valuable from [src]!</span>")
return
else if(istype(I, /obj/item/wirecutters))
if(salvage_num <= 0)
to_chat(user, "<span class='warning'>You don't see anything that can be cut with [I]!</span>")

View File

@@ -88,7 +88,7 @@
/obj/structure/sign/poster/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wirecutters))
playsound(loc, I.usesound, 100, 1)
I.play_tool_sound(src, 100)
if(ruined)
to_chat(user, "<span class='notice'>You remove the remnants of the poster.</span>")
qdel(src)

View File

@@ -30,4 +30,4 @@
/obj/effect/decal/cleanable/robot_debris/old
name = "dusty robot debris"
desc = "Looks like nobody has touched this in a while."
desc = "Looks like nobody has touched this in a while."

View File

@@ -743,3 +743,72 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
/obj/item/MouseExited()
deltimer(tip_timer)//delete any in-progress timer if the mouse is moved off the item before it finishes
closeToolTip(usr)
// Called when a mob tries to use the item as a tool.
// Handles most checks.
/obj/item/proc/use_tool(atom/target, mob/living/user, delay, amount=0, volume=0, datum/callback/extra_checks)
// No delay means there is no start message, and no reason to call tool_start_check before use_tool.
// Run the start check here so we wouldn't have to call it manually.
if(!delay && !tool_start_check(user, amount))
return
delay *= toolspeed
// Play tool sound at the beginning of tool usage.
play_tool_sound(target, volume)
if(delay)
// Create a callback with checks that would be called every tick by do_after.
var/datum/callback/tool_check = CALLBACK(src, .proc/tool_check_callback, user, amount, extra_checks)
if(ismob(target))
if(!do_mob(user, target, delay, extra_checks=tool_check))
return
else
if(!do_after(user, delay, target=target, extra_checks=tool_check))
return
else
// Invoke the extra checks once, just in case.
if(extra_checks && !extra_checks.Invoke())
return
// Use tool's fuel, stack sheets or charges if amount is set.
if(amount && !use(amount))
return
// Play tool sound at the end of tool usage,
// but only if the delay between the beginning and the end is not too small
if(delay >= MIN_TOOL_SOUND_DELAY)
play_tool_sound(target, volume)
return TRUE
// Called before use_tool if there is a delay, or by use_tool if there isn't.
// Only ever used by welding tools and stacks, so it's not added on any other use_tool checks.
/obj/item/proc/tool_start_check(mob/living/user, amount=0)
return tool_use_check(user, amount)
// A check called by tool_start_check once, and by use_tool on every tick of delay.
/obj/item/proc/tool_use_check(mob/living/user, amount)
return !amount
// Generic use proc. Depending on the item, it uses up fuel, charges, sheets, etc.
// Returns TRUE on success, FALSE on failure.
/obj/item/proc/use(used)
return !used
// Plays item's usesound, if any.
/obj/item/proc/play_tool_sound(atom/target, volume=50)
if(target && usesound && volume)
var/played_sound = usesound
if(islist(usesound))
played_sound = pick(usesound)
playsound(target, played_sound, volume, 1)
// Used in a callback that is passed by use_tool into do_after call. Do not override, do not call manually.
/obj/item/proc/tool_check_callback(mob/living/user, amount, datum/callback/extra_checks)
return tool_use_check(user, amount) && (!extra_checks || extra_checks.Invoke())

View File

@@ -11,6 +11,7 @@
flags_1 = CONDUCT_1 | NOBLUDGEON_1
slot_flags = SLOT_BELT
usesound = 'sound/effects/spray2.ogg'
var/obj/item/device/toner/ink = null
@@ -20,7 +21,7 @@
//This proc doesn't just check if the painter can be used, but also uses it.
//Only call this if you are certain that the painter will be used right after this check!
/obj/item/airlock_painter/proc/use(mob/user)
/obj/item/airlock_painter/proc/use_paint(mob/user)
if(can_use(user))
ink.charges--
playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1)

View File

@@ -78,9 +78,17 @@
return
A.emag_act(user)
/obj/item/card/emag/fake/afterattack()
playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1)
return
/obj/item/card/emagfake
desc = "It's a card with a magnetic strip attached to some circuitry."
name = "cryptographic sequencer"
icon_state = "emag"
item_state = "card-id"
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
/obj/item/card/emagfake/afterattack()
. = ..()
playsound(src, 'sound/items/bikehorn.ogg', 50, 1)
/obj/item/card/id
name = "identification card"

View File

@@ -807,4 +807,4 @@ CIGARETTE PACKETS ARE IN FANCY.DM
return
if(reagents && reagents.total_volume)
hand_reagents()
hand_reagents()

View File

@@ -292,7 +292,7 @@
new_setting = "Freezer"
name = initial(new_type.name)
build_path = initial(new_type.build_path)
playsound(user, I.usesound, 50, 1)
I.play_tool_sound(src)
to_chat(user, "<span class='notice'>You change the circuitboard setting to \"[new_setting]\".</span>")
else
return ..()

View File

@@ -170,11 +170,9 @@
to_chat(user, "<span class='warning'>Turn off [src] before you perform this action!</span>")
return 0
user.visible_message("<span class='notice'>[user] unscrews [src]'s maintenance panel and begins fiddling with its innards...</span>", "<span class='notice'>You begin resetting [src]...</span>")
playsound(user, I.usesound, 50, 1)
if(!do_after(user, 40*I.toolspeed, target = user))
if(!I.use_tool(src, user, 40, volume=50))
return 0
user.visible_message("<span class='notice'>[user] refastens [src]'s maintenance panel!</span>", "<span class='notice'>You reset [src] to its factory settings!</span>")
playsound(user, 'sound/items/screwdriver2.ogg', 50, 1)
obj_flags &= ~EMAGGED
radiation_count = 0
update_icon()

View File

@@ -27,6 +27,7 @@
hitsound = 'sound/weapons/tap.ogg'
toolspeed = 1
tool_behaviour = TOOL_MULTITOOL
usesound = 'sound/weapons/empty.ogg'
var/datum/integrated_io/selected_io = null //functional for integrated circuits.
var/mode = 0

View File

@@ -57,37 +57,28 @@
/obj/item/device/radio/intercom/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/screwdriver))
var/obj/item/screwdriver/S = I
if(unfastened)
user.visible_message("<span class='notice'>[user] starts tightening [src]'s screws...</span>", "<span class='notice'>You start screwing in [src]...</span>")
playsound(src, S.usesound, 50, 1)
if(!do_after(user, 30 * S.toolspeed, target = src))
return
user.visible_message("<span class='notice'>[user] tightens [src]'s screws!</span>", "<span class='notice'>You tighten [src]'s screws.</span>")
playsound(src, 'sound/items/screwdriver2.ogg', 50, 1)
unfastened = FALSE
if(I.use_tool(src, user, 30, volume=50))
user.visible_message("<span class='notice'>[user] tightens [src]'s screws!</span>", "<span class='notice'>You tighten [src]'s screws.</span>")
unfastened = FALSE
else
user.visible_message("<span class='notice'>[user] starts loosening [src]'s screws...</span>", "<span class='notice'>You start unscrewing [src]...</span>")
playsound(src, S.usesound, 50, 1)
if(!do_after(user, 60 * S.toolspeed, target = src))
return
user.visible_message("<span class='notice'>[user] loosens [src]'s screws!</span>", "<span class='notice'>You unscrew [src], loosening it from the wall.</span>")
playsound(src, 'sound/items/screwdriver2.ogg', 50, 1)
unfastened = TRUE
if(I.use_tool(src, user, 40, volume=50))
user.visible_message("<span class='notice'>[user] loosens [src]'s screws!</span>", "<span class='notice'>You unscrew [src], loosening it from the wall.</span>")
unfastened = TRUE
return
else if(istype(I, /obj/item/wrench))
if(!unfastened)
to_chat(user, "<span class='warning'>You need to unscrew [src] from the wall first!</span>")
return
var/obj/item/wrench/W = I
user.visible_message("<span class='notice'>[user] starts unsecuring [src]...</span>", "<span class='notice'>You start unsecuring [src]...</span>")
playsound(src, W.usesound, 50, 1)
if(!do_after(user, 80 * W.toolspeed, target = src))
return
user.visible_message("<span class='notice'>[user] unsecures [src]!</span>", "<span class='notice'>You detach [src] from the wall.</span>")
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
new/obj/item/wallframe/intercom(get_turf(src))
qdel(src)
I.play_tool_sound(src)
if(I.use_tool(src, user, 80))
user.visible_message("<span class='notice'>[user] unsecures [src]!</span>", "<span class='notice'>You detach [src] from the wall.</span>")
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
new/obj/item/wallframe/intercom(get_turf(src))
qdel(src)
return
return ..()

View File

@@ -276,17 +276,11 @@
/obj/item/device/tape/attackby(obj/item/I, mob/user, params)
if(ruined)
var/delay = -1
if (istype(I, /obj/item/screwdriver))
delay = 120*I.toolspeed
else if(istype(I, /obj/item/pen))
delay = 120*1.5
if (delay != -1)
to_chat(user, "<span class='notice'>You start winding the tape back in...</span>")
if(do_after(user, delay, target = src))
to_chat(user, "<span class='notice'>You wound the tape back in.</span>")
fix()
if(ruined && istype(I, /obj/item/screwdriver) || istype(I, /obj/item/pen))
to_chat(user, "<span class='notice'>You start winding the tape back in...</span>")
if(I.use_tool(src, user, 120))
to_chat(user, "<span class='notice'>You wound the tape back in.</span>")
fix()
//Random colour tapes
/obj/item/device/tape/random

View File

@@ -55,7 +55,7 @@
if(beakers.len)
stage_change(READY)
to_chat(user, "<span class='notice'>You lock the [initial(name)] assembly.</span>")
playsound(loc, I.usesound, 25, -3)
I.play_tool_sound(src, 25)
else
to_chat(user, "<span class='warning'>You need to add at least one beaker before locking the [initial(name)] assembly!</span>")
else if(stage == READY && !nadeassembly)

View File

@@ -43,7 +43,7 @@
update_icon()
return
if(nadeassembly && istype(I, /obj/item/wirecutters))
playsound(src, I.usesound, 20, 1)
I.play_tool_sound(src, 20)
nadeassembly.forceMove(get_turf(src))
nadeassembly.master = null
nadeassembly = null

View File

@@ -0,0 +1,151 @@
//CREATOR'S NOTE: DO NOT FUCKING GIVE THIS TO BOTANY!
/obj/item/hot_potato
name = "hot potato"
desc = "A label on the side of this potato reads \"Product of DonkCo Service Wing. Activate far away from populated areas. Device will only attach to sapient creatures.\" <span class='boldnotice'>You can attack anyone with it to force it on them instead of yourself!</span>"
icon = 'icons/obj/hydroponics/harvest.dmi'
icon_state = "potato"
flags_1 = NOBLUDGEON_1
force = 0
var/icon_off = "potato"
var/icon_on = "potato_active"
var/detonation_timerid
var/activation_time = 0
var/timer = 600 //deciseconds
var/show_timer = FALSE
var/reusable = FALSE //absolute madman
var/sticky = TRUE
var/forceful_attachment = TRUE
var/stimulant = TRUE
var/detonate_explosion = TRUE
var/detonate_dev_range = 0
var/detonate_heavy_range = 0
var/detonate_light_range = 2
var/detonate_flash_range = 5
var/detonate_fire_range = 5
var/color_val = FALSE
/obj/item/hot_potato/proc/detonate()
var/atom/location = loc
location.visible_message("<span class='userdanger'>[src] [detonate_explosion? "explodes" : "activates"]!</span>", "<span class='userdanger'>[src] activates! You've ran out of time!</span>")
if(detonate_explosion)
explosion(src, detonate_dev_range, detonate_heavy_range, detonate_light_range, detonate_flash_range, flame_range = detonate_fire_range)
deactivate()
if(!reusable)
var/mob/M = loc
if(istype(M))
M.dropItemToGround(src, TRUE)
qdel(src)
/obj/item/hot_potato/proc/is_active()
return isnull(detonation_timerid)? FALSE : TRUE
/obj/item/hot_potato/attack_self(mob/user)
if(activate(timer, user))
user.visible_message("<span class='boldwarning'>[user] squeezes [src], which promptly starts to flash red-hot colors!</span>", "<span class='boldwarning'>You squeeze [src], activating its countdown and attachment mechanism!</span>",
"<span class='boldwarning'>You hear a mechanical click and a loud beeping!</span>")
return
return ..()
/obj/item/hot_potato/process()
if(stimulant)
if(isliving(loc))
var/mob/living/L = loc
L.SetStun(0)
L.SetKnockdown(0)
L.SetSleeping(0)
L.SetUnconscious(0)
L.reagents.add_reagent("muscle_stimulant", CLAMP(5 - L.reagents.get_reagent_amount("muscle_stimulant"), 0, 5)) //If you don't have legs or get bola'd, tough luck!
color_val = !color_val
L.add_atom_colour(color_val? "#ffff00" : "#00ffff", FIXED_COLOUR_PRIORITY)
/obj/item/hot_potato/examine(mob/user)
. = ..()
if(is_active())
to_chat(user, "<span class='warning'>[src] is flashing red-hot! You should probably get rid of it!</span>")
if(show_timer)
to_chat(user, "<span class='warning'>[src]'s timer looks to be at [(activation_time - world.time) / 10] seconds!</span>")
/obj/item/hot_potato/equipped(mob/user)
. = ..()
if(is_active())
to_chat(user, "<span class='userdanger'>You have a really bad feeling about [src]!</span>")
/obj/item/hot_potato/afterattack(atom/target, mob/user, adjacent, params)
if(!adjacent || !ismob(target))
return ..()
force_onto(target, user)
/obj/item/hot_potato/proc/force_onto(mob/living/victim, mob/user)
if(!istype(victim) || user != loc || victim == user)
return FALSE
if(!victim.client)
to_chat(user, "<span class='boldwarning'>[src] refuses to attach to a non-sapient creature!</span>")
if(victim.stat != CONSCIOUS || !victim.get_num_legs())
to_chat(user, "<span class='boldwarning'>[src] refuses to attach to someone incapable of using it!</span>")
user.temporarilyRemoveItemFromInventory(src, TRUE)
. = FALSE
if(!victim.put_in_hands(src))
if(forceful_attachment)
victim.dropItemToGround(victim.get_inactive_held_item())
if(!victim.put_in_hands(src))
victim.dropItemToGround(victim.get_active_held_item())
if(victim.put_in_hands(src))
. = TRUE
else
. = TRUE
else
. = TRUE
if(.)
add_logs(user, victim, "forced a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto")
user.visible_message("<span class='userdanger'>[user] forces [src] onto [victim]!</span>", "<span class='userdanger'>You force [src] onto [victim]!</span>", "<span class='boldwarning'>You hear a mechanical click and a beep.</span>")
user.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY)
else
add_logs(user, victim, "tried to force a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto")
user.visible_message("<span class='boldwarning'>[user] tried to force [src] onto [victim], but it could not attach!</span>", "<span class='boldwarning'>You try to force [src] onto [victim], but it is unable to attach!</span>", "<span class='boldwarning'>You hear a mechanical click and two buzzes.</span>")
user.put_in_hands(src)
/obj/item/hot_potato/dropped(mob/user)
. = ..()
user.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY)
/obj/item/hot_potato/proc/activate(delay, mob/user)
if(is_active())
return
update_icon()
if(sticky)
flags_1 |= NODROP_1
name = "primed [name]"
activation_time = timer + world.time
detonation_timerid = addtimer(CALLBACK(src, .proc/detonate), delay, TIMER_STOPPABLE)
START_PROCESSING(SSfastprocess, src)
var/turf/T = get_turf(src)
message_admins("[user? "[ADMIN_LOOKUPFLW(user)] has primed [src]" : "A [src] has been primed"] (Timer:[delay],Explosive:[detonate_explosion],Range:[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [COORD(T)]([T.loc])")
log_game("[user? "[user] has primed [src]" : "A [src] has been primed"] ([detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [COORD(T)]([T.loc])")
/obj/item/hot_potato/proc/deactivate()
update_icon()
name = initial(name)
flags_1 &= ~NODROP_1
deltimer(detonation_timerid)
STOP_PROCESSING(SSfastprocess, src)
detonation_timerid = null
if(ismob(loc))
var/mob/user = loc
user.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY)
/obj/item/hot_potato/update_icon()
icon_state = is_active()? icon_on : icon_off
/obj/item/hot_potato/syndicate
detonate_light_range = 4
detonate_fire_range = 5
/obj/item/hot_potato/harmless
detonate_explosion = FALSE
/obj/item/hot_potato/harmless/toy
desc = "A label on the side of this potato reads \"Product of DonkCo Toys and Recreation department.\" <span class='boldnotice'>You can attack anyone with it to put it on them instead, if they have a free hand to take it!</span>"
sticky = FALSE
reusable = TRUE
forceful_attachment = FALSE

View File

@@ -62,7 +62,7 @@
/obj/item/inducer/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/screwdriver))
playsound(src, W.usesound, 50, 1)
W.play_tool_sound(src)
if(!opened)
to_chat(user, "<span class='notice'>You unscrew the battery compartment.</span>")
opened = TRUE

View File

@@ -122,7 +122,7 @@
to_chat(user, "<span class='warning'>You already murdered it!</span>")
return
user.visible_message("<span class='notice'>[user] tears out the stuffing from [src]!</span>", "<span class='notice'>You rip a bunch of the stuffing from [src]. Murderer.</span>")
playsound(I, I.usesound, 50, TRUE)
I.play_tool_sound(src)
stuffed = FALSE
else
to_chat(user, "<span class='notice'>You remove the grenade from [src].</span>")

View File

@@ -44,7 +44,7 @@
fisto_setting = 3
if(3)
fisto_setting = 1
playsound(loc, W.usesound, 50, 1)
W.play_tool_sound(src)
to_chat(user, "<span class='notice'>You tweak \the [src]'s piston valve to [fisto_setting].</span>")
else if(istype(W, /obj/item/screwdriver))
if(tank)

View File

@@ -25,14 +25,11 @@
if(pinnedLoc)
pinnedLoc.forceMove(loc)
/obj/item/target/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0, user))
removeOverlays()
to_chat(user, "<span class='notice'>You slice off [src]'s uneven chunks of aluminium and scorch marks.</span>")
else
return ..()
/obj/item/target/welder_act(mob/living/user, obj/item/I)
if(I.use_tool(src, user, 0, volume=40))
removeOverlays()
to_chat(user, "<span class='notice'>You slice off [src]'s uneven chunks of aluminium and scorch marks.</span>")
return TRUE
/obj/item/target/attack_hand(mob/user)
if(pinnedLoc)

View File

@@ -40,17 +40,15 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
icon_state = "rods"
/obj/item/stack/rods/attackby(obj/item/W, mob/user, params)
if (istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(istype(W, /obj/item/weldingtool))
if(get_amount() < 2)
to_chat(user, "<span class='warning'>You need at least two rods to do this!</span>")
return
if(WT.remove_fuel(0,user))
if(W.use_tool(src, user, 0, volume=40))
var/obj/item/stack/sheet/metal/new_item = new(usr.loc)
user.visible_message("[user.name] shaped [src] into metal with the welding tool.", \
"<span class='notice'>You shape [src] into metal with the welding tool.</span>", \
user.visible_message("[user.name] shaped [src] into metal with [W].", \
"<span class='notice'>You shape [src] into metal with [W].</span>", \
"<span class='italics'>You hear welding.</span>")
var/obj/item/stack/rods/R = src
src = null

View File

@@ -279,21 +279,22 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
/obj/item/shard/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/device/lightreplacer))
I.attackby(src, user)
else if(istype(I, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = I
if(WT.remove_fuel(0, user))
var/obj/item/stack/sheet/glass/NG = new (user.loc)
for(var/obj/item/stack/sheet/glass/G in user.loc)
if(G == NG)
continue
if(G.amount >= G.max_amount)
continue
G.attackby(NG, user)
to_chat(user, "<span class='notice'>You add the newly-formed glass to the stack. It now contains [NG.amount] sheet\s.</span>")
qdel(src)
else
return ..()
/obj/item/shard/welder_act(mob/living/user, obj/item/I)
if(I.use_tool(src, user, 0, volume=50))
var/obj/item/stack/sheet/glass/NG = new (user.loc)
for(var/obj/item/stack/sheet/glass/G in user.loc)
if(G == NG)
continue
if(G.amount >= G.max_amount)
continue
G.attackby(NG, user)
to_chat(user, "<span class='notice'>You add the newly-formed glass to the stack. It now contains [NG.amount] sheet\s.</span>")
qdel(src)
return TRUE
/obj/item/shard/Crossed(mob/living/L)
if(istype(L) && has_gravity(loc))
playsound(loc, 'sound/effects/glass_step.ogg', 50, 1)

View File

@@ -25,7 +25,7 @@
/obj/item/stack/on_grind()
for(var/i in 1 to grind_results.len) //This should only call if it's ground, so no need to check if grind_results exists
grind_results[grind_results[i]] *= amount //Gets the key at position i, then the reagent amount of that key, then multiplies it by stack size
grind_results[grind_results[i]] *= get_amount() //Gets the key at position i, then the reagent amount of that key, then multiplies it by stack size
/obj/item/stack/grind_requirements()
if(is_cyborg)
@@ -247,7 +247,7 @@
return 0
return 1
/obj/item/stack/proc/use(used, transfer = FALSE) // return 0 = borked; return 1 = had enough
/obj/item/stack/use(used, transfer = FALSE) // return 0 = borked; return 1 = had enough
if(zero_amount())
return 0
if (is_cyborg)
@@ -260,6 +260,20 @@
update_weight()
return 1
/obj/item/stack/tool_use_check(mob/living/user, amount)
if(get_amount() < amount)
if(singular_name)
if(amount > 1)
to_chat(user, "<span class='warning'>You need at least [amount] [singular_name]\s to do this!</span>")
else
to_chat(user, "<span class='warning'>You need at least [amount] [singular_name] to do this!</span>")
else
to_chat(user, "<span class='warning'>You need at least [amount] to do this!</span>")
return FALSE
return TRUE
/obj/item/stack/proc/zero_amount()
if(is_cyborg)
return source.energy < cost

View File

@@ -21,18 +21,15 @@
/obj/item/stack/tile/attackby(obj/item/W, mob/user, params)
if (istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(get_amount() < 4)
to_chat(user, "<span class='warning'>You need at least four tiles to do this!</span>")
return
if(WT.is_hot() && !mineralType)
if(!mineralType)
to_chat(user, "<span class='warning'>You can not reform this!</span>")
return
if(WT.remove_fuel(0,user))
if(W.use_tool(src, user, 0, volume=40))
if(mineralType == "plasma")
atmos_spawn_air("plasma=5;TEMP=1000")
user.visible_message("<span class='warning'>[user.name] sets the plasma tiles on fire!</span>", \

View File

@@ -34,17 +34,17 @@
/obj/item/storage/secure/attackby(obj/item/W, mob/user, params)
if(locked)
if (istype(W, /obj/item/screwdriver))
if (do_after(user, 20*W.toolspeed, target = user))
if (W.use_tool(src, user, 20))
open =! open
to_chat(user, "<span class='notice'>You [open ? "open" : "close"] the service panel.</span>")
return
if (istype(W, /obj/item/wirecutters) || istype(W, /obj/item/card/emag))
if (istype(W, /obj/item/wirecutters))
to_chat(user, "<span class='danger'>[src] is protected from this sort of tampering, yet it appears the internal memory wires can still be <b>pulsed</b>.</span>")
if ((istype(W, /obj/item/device/multitool)) && (!l_hacking))
if(src.open == 1)
to_chat(user, "<span class='danger'>Now attempting to reset internal memory, please hold.</span>")
src.l_hacking = 1
if (do_after(usr, 400*W.toolspeed, target = user))
if (W.use_tool(src, user, 400))
to_chat(user, "<span class='danger'>Internal memory reset - lock has been disengaged.</span>")
src.l_set = 0
src.l_hacking = 0

View File

@@ -16,7 +16,7 @@
materials = list(MAT_METAL=75)
attack_verb = list("stabbed")
hitsound = 'sound/weapons/bladeslice.ogg'
usesound = 'sound/items/screwdriver.ogg'
usesound = list('sound/items/screwdriver.ogg', 'sound/items/screwdriver2.ogg')
tool_behaviour = TOOL_SCREWDRIVER
toolspeed = 1
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 30)

View File

@@ -12,7 +12,7 @@
force = 3
throwforce = 5
hitsound = "swing_hit"
usesound = 'sound/items/welder.ogg'
usesound = list('sound/items/welder.ogg', 'sound/items/welder2.ogg')
var/acti_sound = 'sound/items/welderactivate.ogg'
var/deac_sound = 'sound/items/welderdeactivate.ogg'
throw_speed = 3
@@ -73,7 +73,7 @@
damtype = "fire"
++burned_fuel_for
if(burned_fuel_for >= WELDER_FUEL_BURN_INTERVAL)
remove_fuel(1)
use(1)
update_icon()
//This is to start fires. process() is only called if the welder is on.
@@ -107,10 +107,10 @@
var/obj/item/bodypart/affecting = H.get_bodypart(check_zone(user.zone_selected))
if(affecting && affecting.status == BODYPART_ROBOTIC && user.a_intent != INTENT_HARM)
if(src.remove_fuel(1))
playsound(loc, usesound, 50, 1)
if(src.use_tool(H, user, 0, volume=50, amount=1))
if(user == H)
user.visible_message("<span class='notice'>[user] starts to fix some of the dents on [H]'s [affecting.name].</span>", "<span class='notice'>You start fixing some of the dents on [H]'s [affecting.name].</span>")
user.visible_message("<span class='notice'>[user] starts to fix some of the dents on [H]'s [affecting.name].</span>",
"<span class='notice'>You start fixing some of the dents on [H]'s [affecting.name].</span>")
if(!do_mob(user, H, 50))
return
item_heal_robotic(H, user, 15, 0)
@@ -125,8 +125,8 @@
reagents.trans_to(O, reagents.total_volume)
to_chat(user, "<span class='notice'>You empty [src]'s fuel tank into [O].</span>")
update_icon()
if(welding)
remove_fuel(1)
if(isOn())
use(1)
var/turf/location = get_turf(user)
location.hotspot_expose(700, 50, 1)
if(get_fuel() <= 0)
@@ -150,26 +150,23 @@
update_icon()
//Returns the amount of fuel in the welder
// Returns the amount of fuel in the welder
/obj/item/weldingtool/proc/get_fuel()
return reagents.get_reagent_amount("welding_fuel")
//Removes fuel from the welding tool. If a mob is passed, it will try to flash the mob's eyes. This should probably be renamed to use()
/obj/item/weldingtool/proc/remove_fuel(amount = 1, mob/living/M = null)
if(!welding || !check_fuel())
return 0
if(amount)
// Uses fuel from the welding tool.
/obj/item/weldingtool/use(used = 0)
if(!isOn() || !check_fuel())
return FALSE
if(used)
burned_fuel_for = 0
if(get_fuel() >= amount)
reagents.remove_reagent("welding_fuel", amount)
if(get_fuel() >= used)
reagents.remove_reagent("welding_fuel", used)
check_fuel()
if(M)
M.flash_act(light_intensity)
return TRUE
else
if(M)
to_chat(M, "<span class='warning'>You need more welding fuel to complete this task!</span>")
return FALSE
@@ -231,6 +228,24 @@
/obj/item/weldingtool/proc/isOn()
return welding
// When welding is about to start, run a normal tool_use_check, then flash a mob if it succeeds.
/obj/item/weldingtool/tool_start_check(mob/living/user, amount=0)
. = tool_use_check(user, amount)
if(. && user)
user.flash_act(light_intensity)
// If welding tool ran out of fuel during a construction task, construction fails.
/obj/item/weldingtool/tool_use_check(mob/living/user, amount)
if(!isOn() || !check_fuel())
to_chat(user, "<span class='warning'>[src] has to be on to complete this task!</span>")
return FALSE
if(get_fuel() >= amount)
return TRUE
else
to_chat(user, "<span class='warning'>You need more welding fuel to complete this task!</span>")
return FALSE
/obj/item/weldingtool/proc/flamethrower_screwdriver(obj/item/I, mob/user)
if(welding)
@@ -260,10 +275,10 @@
to_chat(user, "<span class='warning'>You need one rod to start building a flamethrower!</span>")
/obj/item/weldingtool/ignition_effect(atom/A, mob/user)
if(welding && remove_fuel(1, user))
. = "<span class='notice'>[user] casually lights [A] with [src], what a badass.</span>"
if(use_tool(A, user, 0, amount=1))
return "<span class='notice'>[user] casually lights [A] with [src], what a badass.</span>"
else
. = ""
return ""
/obj/item/weldingtool/largetank
name = "industrial welding tool"

View File

@@ -66,7 +66,7 @@
name = "crushed can"
icon_state = "cola"
resistance_flags = NONE
grind_results = list("aluminum" = 10)
grind_results = list("aluminium" = 10)
/obj/item/trash/attack(mob/M, mob/living/user)
return
@@ -81,4 +81,4 @@
/obj/item/trash/coal/burn()
visible_message("[src] fuses into a diamond! Someone wasn't so naughty after all...")
new /obj/item/stack/ore/diamond(loc)
qdel(src)
qdel(src)

View File

@@ -32,13 +32,12 @@
if(state != EMPTY_CORE)
to_chat(user, "<span class='warning'>The core must be empty to deconstruct it!</span>")
return
var/obj/item/weldingtool/WT = P
if(!WT.isOn())
to_chat(user, "<span class='warning'>The welder must be on for this task!</span>")
if(!P.tool_start_check(user, amount=0))
return
playsound(loc, WT.usesound, 50, 1)
to_chat(user, "<span class='notice'>You start to deconstruct the frame...</span>")
if(do_after(user, 20*P.toolspeed, target = src) && src && state == EMPTY_CORE && WT && WT.remove_fuel(0, user))
if(P.use_tool(src, user, 20, volume=50) && state == EMPTY_CORE)
to_chat(user, "<span class='notice'>You deconstruct the frame.</span>")
deconstruct(TRUE)
return
@@ -56,13 +55,13 @@
return
if(CIRCUIT_CORE)
if(istype(P, /obj/item/screwdriver))
playsound(loc, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You screw the circuit board into place.</span>")
state = SCREWED_CORE
update_icon()
return
if(istype(P, /obj/item/crowbar))
playsound(loc, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the circuit board.</span>")
state = EMPTY_CORE
update_icon()
@@ -71,7 +70,7 @@
return
if(SCREWED_CORE)
if(istype(P, /obj/item/screwdriver) && circuit)
playsound(loc, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
state = CIRCUIT_CORE
update_icon()
@@ -93,7 +92,7 @@
if(brain)
to_chat(user, "<span class='warning'>Get that [brain.name] out of there first!</span>")
else
playsound(loc, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the cables.</span>")
state = SCREWED_CORE
update_icon()
@@ -152,7 +151,7 @@
return
if(istype(P, /obj/item/crowbar) && brain)
playsound(loc, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the brain.</span>")
brain.forceMove(loc)
brain = null
@@ -161,7 +160,7 @@
if(GLASS_CORE)
if(istype(P, /obj/item/crowbar))
playsound(loc, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the glass panel.</span>")
state = CABLED_CORE
update_icon()
@@ -169,7 +168,7 @@
return
if(istype(P, /obj/item/screwdriver))
playsound(loc, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
if(brain)
SSticker.mode.remove_antag_for_borging(brain.brainmob.mind)
@@ -198,7 +197,7 @@
return
if(istype(P, /obj/item/screwdriver))
playsound(loc, P.usesound, 50, 1)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You disconnect the monitor.</span>")
state = GLASS_CORE
update_icon()

View File

@@ -38,7 +38,7 @@
/obj/structure/bed/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
playsound(src.loc, W.usesound, 50, 1)
W.play_tool_sound(src)
deconstruct(TRUE)
else
return ..()

View File

@@ -73,7 +73,7 @@
/obj/structure/chair/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
playsound(src.loc, W.usesound, 50, 1)
W.play_tool_sound(src)
deconstruct()
else if(istype(W, /obj/item/assembly/shock_kit))
if(!user.temporarilyRemoveItemFromInventory(W))

View File

@@ -29,7 +29,6 @@
var/cutting_tool = /obj/item/weldingtool
var/open_sound = 'sound/machines/click.ogg'
var/close_sound = 'sound/machines/click.ogg'
var/cutting_sound = 'sound/items/welder.ogg'
var/material_drop = /obj/item/stack/sheet/metal
var/material_drop_amount = 2
var/delivery_icon = "deliverycloset" //which icon to use when packagewrapped. null to be unwrappable.
@@ -216,19 +215,18 @@
if(opened)
if(istype(W, cutting_tool))
if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0, user))
to_chat(user, "<span class='notice'>You begin cutting \the [src] apart...</span>")
playsound(loc, cutting_sound, 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(!opened || !WT.isOn())
return
playsound(loc, cutting_sound, 50, 1)
user.visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
"<span class='notice'>You cut \the [src] apart with \the [WT].</span>",
"<span class='italics'>You hear welding.</span>")
deconstruct(TRUE)
if(!W.tool_start_check(user, amount=0))
return
to_chat(user, "<span class='notice'>You begin cutting \the [src] apart...</span>")
if(W.use_tool(src, user, 40, volume=50))
if(!opened)
return
user.visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
"<span class='notice'>You cut \the [src] apart with \the [W].</span>",
"<span class='italics'>You hear welding.</span>")
deconstruct(TRUE)
return
else // for example cardboard box is cut with wirecutters
user.visible_message("<span class='notice'>[user] cut apart \the [src].</span>", \
"<span class='notice'>You cut \the [src] apart with \the [W].</span>")
@@ -237,25 +235,23 @@
if(user.transferItemToLoc(W, drop_location())) // so we put in unlit welder too
return
else if(istype(W, /obj/item/weldingtool) && can_weld_shut)
var/obj/item/weldingtool/WT = W
if(!WT.remove_fuel(0, user))
if(!W.tool_start_check(user, amount=0))
return
to_chat(user, "<span class='notice'>You begin [welded ? "unwelding":"welding"] \the [src]...</span>")
playsound(loc, 'sound/items/welder2.ogg', 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(opened || !WT.isOn())
if(W.use_tool(src, user, 40, volume=50))
if(opened)
return
playsound(loc, WT.usesound, 50, 1)
welded = !welded
user.visible_message("<span class='notice'>[user] [welded ? "welds shut" : "unweldeds"] \the [src].</span>",
"<span class='notice'>You [welded ? "weld" : "unwelded"] \the [src] with \the [WT].</span>",
"<span class='notice'>You [welded ? "weld" : "unwelded"] \the [src] with \the [W].</span>",
"<span class='italics'>You hear welding.</span>")
update_icon()
else if(istype(W, /obj/item/wrench) && anchorable)
if(isinspace() && !anchored)
return
anchored = !anchored
playsound(src.loc, W.usesound, 75, 1)
W.play_tool_sound(src, 75)
user.visible_message("<span class='notice'>[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
"<span class='notice'>You [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
"<span class='italics'>You hear a ratchet.</span>")

View File

@@ -10,7 +10,6 @@
can_weld_shut = 0
cutting_tool = /obj/item/wirecutters
open_sound = "rustle"
cutting_sound = 'sound/items/poster_ripped.ogg'
material_drop = /obj/item/stack/sheet/cardboard
delivery_icon = "deliverybox"
anchorable = FALSE
@@ -68,6 +67,5 @@
move_speed_multiplier = 2
cutting_tool = /obj/item/weldingtool
open_sound = 'sound/machines/click.ogg'
cutting_sound = 'sound/items/welder.ogg'
material_drop = /obj/item/stack/sheet/plasteel
#undef SNAKE_SPAM_TICKS

View File

@@ -105,6 +105,7 @@
icon_door = "black"
/obj/structure/closet/wardrobe/chaplain_black/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector/cosmetology(src)
new /obj/item/clothing/under/rank/chaplain(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/suit/nun(src)
@@ -177,6 +178,7 @@
icon_door = "atmos_wardrobe"
/obj/structure/closet/wardrobe/atmospherics_yellow/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector(src)
new /obj/item/storage/backpack/duffelbag/engineering(src)
new /obj/item/storage/backpack/satchel/eng(src)
new /obj/item/storage/backpack/industrial(src)
@@ -193,6 +195,7 @@
icon_door = "yellow"
/obj/structure/closet/wardrobe/engineering_yellow/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector(src)
new /obj/item/storage/backpack/duffelbag/engineering(src)
new /obj/item/storage/backpack/industrial(src)
new /obj/item/storage/backpack/satchel/eng(src)
@@ -211,6 +214,7 @@
name = "medical doctor's wardrobe"
/obj/structure/closet/wardrobe/white/medical/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector(src)
new /obj/item/storage/backpack/duffelbag/med(src)
new /obj/item/storage/backpack/medic(src)
new /obj/item/storage/backpack/satchel/med(src)
@@ -318,6 +322,7 @@
icon_door = "white"
/obj/structure/closet/wardrobe/science_white/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector(src)
new /obj/item/storage/backpack/science(src)
new /obj/item/storage/backpack/science(src)
new /obj/item/storage/backpack/satchel/tox(src)

View File

@@ -33,7 +33,7 @@
do_animate()
else if(istype(W, /obj/item/wrench))
anchored = !anchored
playsound(src.loc, W.usesound, 75, 1)
W.play_tool_sound(src, 75)
else
return ..()

View File

@@ -96,13 +96,13 @@
else
to_chat(user, "<span class='warning'>Access denied.</span>")
else if(istype(W, /obj/item/weldingtool) && user.a_intent == INTENT_HELP && !broken)
var/obj/item/weldingtool/WT = W
if(obj_integrity < max_integrity && WT.remove_fuel(5, user))
if(obj_integrity < max_integrity)
if(!W.tool_start_check(user, amount=5))
return
to_chat(user, "<span class='notice'>You begin repairing [src].</span>")
playsound(loc, WT.usesound, 40, 1)
if(do_after(user, 40*W.toolspeed, target = src))
if(W.use_tool(src, user, 40, amount=5, volume=50))
obj_integrity = max_integrity
playsound(loc, 'sound/items/welder2.ogg', 50, 1)
update_icon()
to_chat(user, "<span class='notice'>You repair [src].</span>")
else
@@ -117,7 +117,7 @@
qdel(src)
else
to_chat(user, "<span class='notice'>You start to [open ? "close":"open"] [src].</span>")
if(do_after(user, 20*W.toolspeed, target = src))
if(W.use_tool(src, user, 20))
to_chat(user, "<span class='notice'>You [open ? "close":"open"] [src].</span>")
toggle_lock(user)
else if(open && !showpiece)
@@ -177,15 +177,15 @@
/obj/structure/displaycase_chassis/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench)) //The player can only deconstruct the wooden frame
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
playsound(src.loc, I.usesound, 50, 1)
if(do_after(user, 30*I.toolspeed, target = src))
I.play_tool_sound(src)
if(I.use_tool(src, user, 30))
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
new /obj/item/stack/sheet/mineral/wood(get_turf(src), 5)
qdel(src)
else if(istype(I, /obj/item/electronics/airlock))
to_chat(user, "<span class='notice'>You start installing the electronics into [src]...</span>")
playsound(src.loc, I.usesound, 50, 1)
I.play_tool_sound(src)
if(do_after(user, 30, target = src) && user.transferItemToLoc(I,src))
electronics = I
to_chat(user, "<span class='notice'>You install the airlock electronics.</span>")

View File

@@ -59,40 +59,34 @@
created_name = t
else if(istype(W, /obj/item/weldingtool) && (mineral || glass || !anchored ))
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0,user))
playsound(src, 'sound/items/welder2.ogg', 50, 1)
if(mineral)
var/obj/item/stack/sheet/mineral/mineral_path = text2path("/obj/item/stack/sheet/mineral/[mineral]")
user.visible_message("[user] welds the [mineral] plating off the airlock assembly.", "You start to weld the [mineral] plating off the airlock assembly...")
if(do_after(user, 40 * WT.toolspeed, target = src))
if(!src || !WT.isOn())
return
to_chat(user, "<span class='notice'>You weld the [mineral] plating off.</span>")
new mineral_path(loc, 2)
var/obj/structure/door_assembly/PA = new previous_assembly(loc)
transfer_assembly_vars(src, PA)
if(!W.tool_start_check(user, amount=0))
return
else if(glass)
user.visible_message("[user] welds the glass panel out of the airlock assembly.", "You start to weld the glass panel out of the airlock assembly...")
if(do_after(user, 40 * WT.toolspeed, target = src))
if(!src || !WT.isOn())
return
to_chat(user, "<span class='notice'>You weld the glass panel out.</span>")
if(heat_proof_finished)
new /obj/item/stack/sheet/rglass(get_turf(src))
heat_proof_finished = 0
else
new /obj/item/stack/sheet/glass(get_turf(src))
glass = 0
else if(!anchored)
user.visible_message("<span class='warning'>[user] disassembles the airlock assembly.</span>", \
"You start to disassemble the airlock assembly...")
if(do_after(user, 40*W.toolspeed, target = src))
if(!WT.isOn())
return
to_chat(user, "<span class='notice'>You disassemble the airlock assembly.</span>")
deconstruct(TRUE)
if(mineral)
var/obj/item/stack/sheet/mineral/mineral_path = text2path("/obj/item/stack/sheet/mineral/[mineral]")
user.visible_message("[user] welds the [mineral] plating off the airlock assembly.", "You start to weld the [mineral] plating off the airlock assembly...")
if(W.use_tool(src, user, 40, volume=50))
to_chat(user, "<span class='notice'>You weld the [mineral] plating off.</span>")
new mineral_path(loc, 2)
var/obj/structure/door_assembly/PA = new previous_assembly(loc)
transfer_assembly_vars(src, PA)
else if(glass)
user.visible_message("[user] welds the glass panel out of the airlock assembly.", "You start to weld the glass panel out of the airlock assembly...")
if(W.use_tool(src, user, 40, volume=50))
to_chat(user, "<span class='notice'>You weld the glass panel out.</span>")
if(heat_proof_finished)
new /obj/item/stack/sheet/rglass(get_turf(src))
heat_proof_finished = 0
else
new /obj/item/stack/sheet/glass(get_turf(src))
glass = 0
else if(!anchored)
user.visible_message("<span class='warning'>[user] disassembles the airlock assembly.</span>", \
"You start to disassemble the airlock assembly...")
if(W.use_tool(src, user, 40, volume=50))
to_chat(user, "<span class='notice'>You disassemble the airlock assembly.</span>")
deconstruct(TRUE)
else if(istype(W, /obj/item/wrench))
if(!anchored )
@@ -103,12 +97,11 @@
break
if(door_check)
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] secures the airlock assembly to the floor.", \
"<span class='notice'>You start to secure the airlock assembly to the floor...</span>", \
"<span class='italics'>You hear wrenching.</span>")
if(do_after(user, 40*W.toolspeed, target = src))
if(W.use_tool(src, user, 40, volume=100))
if(anchored)
return
to_chat(user, "<span class='notice'>You secure the airlock assembly.</span>")
@@ -118,38 +111,34 @@
to_chat(user, "There is another door here!")
else
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] unsecures the airlock assembly from the floor.", \
"<span class='notice'>You start to unsecure the airlock assembly from the floor...</span>", \
"<span class='italics'>You hear wrenching.</span>")
if(do_after(user, 40*W.toolspeed, target = src))
if(!anchored )
if(W.use_tool(src, user, 40, volume=100))
if(!anchored)
return
to_chat(user, "<span class='notice'>You unsecure the airlock assembly.</span>")
name = "airlock assembly"
anchored = FALSE
else if(istype(W, /obj/item/stack/cable_coil) && state == AIRLOCK_ASSEMBLY_NEEDS_WIRES && anchored )
var/obj/item/stack/cable_coil/C = W
if (C.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one length of cable to wire the airlock assembly!</span>")
if(!W.tool_start_check(user, amount=1))
return
user.visible_message("[user] wires the airlock assembly.", \
"<span class='notice'>You start to wire the airlock assembly...</span>")
if(do_after(user, 40, target = src))
if(C.get_amount() < 1 || state != AIRLOCK_ASSEMBLY_NEEDS_WIRES)
if(W.use_tool(src, user, 40, amount=1))
if(state != AIRLOCK_ASSEMBLY_NEEDS_WIRES)
return
C.use(1)
state = AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS
to_chat(user, "<span class='notice'>You wire the airlock assembly.</span>")
name = "wired airlock assembly"
else if(istype(W, /obj/item/wirecutters) && state == AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS )
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] cuts the wires from the airlock assembly.", \
"<span class='notice'>You start to cut the wires from the airlock assembly...</span>")
if(do_after(user, 40*W.toolspeed, target = src))
if(W.use_tool(src, user, 40, volume=100))
if(state != AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS)
return
to_chat(user, "<span class='notice'>You cut the wires from the airlock assembly.</span>")
@@ -158,7 +147,7 @@
name = "secured airlock assembly"
else if(istype(W, /obj/item/electronics/airlock) && state == AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS )
playsound(src, W.usesound, 100, 1)
W.play_tool_sound(src, 100)
user.visible_message("[user] installs the electronics into the airlock assembly.", \
"<span class='notice'>You start to install electronics into the airlock assembly...</span>")
if(do_after(user, 40, target = src))
@@ -174,11 +163,10 @@
else if(istype(W, /obj/item/crowbar) && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", \
"<span class='notice'>You start to remove electronics from the airlock assembly...</span>")
if(do_after(user, 40*W.toolspeed, target = src))
if(W.use_tool(src, user, 40, volume=100))
if(state != AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER)
return
to_chat(user, "<span class='notice'>You remove the airlock electronics.</span>")
@@ -237,11 +225,10 @@
to_chat(user, "<span class='warning'>You cannot add [G] to [src]!</span>")
else if(istype(W, /obj/item/screwdriver) && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] finishes the airlock.", \
"<span class='notice'>You start finishing the airlock...</span>")
if(do_after(user, 40*W.toolspeed, target = src))
if(W.use_tool(src, user, 40, volume=100))
if(loc && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER)
to_chat(user, "<span class='notice'>You finish the airlock.</span>")
var/obj/machinery/door/airlock/door

View File

@@ -6,18 +6,17 @@
density = TRUE
anchored = TRUE
/obj/structure/dresser/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/wrench))
/obj/structure/dresser/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench))
to_chat(user, "<span class='notice'>You begin to [anchored ? "unwrench" : "wrench"] [src].</span>")
playsound(src, P.usesound, 50, 1)
if(do_after(user, 20, target = src))
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You successfully [anchored ? "unwrench" : "wrench"] [src].</span>")
anchored = !anchored
else
return ..()
/obj/structure/dresser/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/mineral/wood (get_turf(src), 10)
new /obj/item/stack/sheet/mineral/wood(drop_location(), 10)
qdel(src)
/obj/structure/dresser/attack_hand(mob/user)

View File

@@ -13,7 +13,7 @@
/obj/structure/chair/e_chair/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench))
var/obj/structure/chair/C = new /obj/structure/chair(loc)
playsound(loc, W.usesound, 50, 1)
W.play_tool_sound(src)
C.setDir(dir)
part.forceMove(loc)
part.master = null

View File

@@ -43,8 +43,8 @@
/obj/structure/extinguisher_cabinet/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench) && !stored_extinguisher)
to_chat(user, "<span class='notice'>You start unsecuring [name]...</span>")
playsound(loc, I.usesound, 50, 1)
if(do_after(user, 60*I.toolspeed, target = src))
I.play_tool_sound(src)
if(I.use_tool(src, user, 60))
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You unsecure [name].</span>")
deconstruct(TRUE)

View File

@@ -109,15 +109,11 @@
else
to_chat(user, "<span class='warning'>You can't reach, close it first!</span>")
else if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0,user))
else if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
if(W.use_tool(src, user, 0, volume=50))
dismantle(user, TRUE)
else if(istype(W, /obj/item/gun/energy/plasmacutter))
dismantle(user, TRUE)
else if(istype(W, /obj/item/pickaxe/drill/jackhammer))
var/obj/item/pickaxe/drill/jackhammer/D = W
D.playDigSound()
W.play_tool_sound(src)
dismantle(user, TRUE)
else
return ..()
@@ -125,7 +121,7 @@
/obj/structure/falsewall/proc/dismantle(mob/user, disassembled=TRUE, obj/item/tool = null)
user.visible_message("[user] dismantles the false wall.", "<span class='notice'>You dismantle the false wall.</span>")
if(tool)
playsound(src, tool.usesound, 100, 1)
tool.play_tool_sound(src, 100)
else
playsound(src, 'sound/items/welder.ogg', 100, 1)
deconstruct(disassembled)

View File

@@ -25,13 +25,13 @@
if(iscyborg(user) || istype(I, /obj/item/device/multitool))
toggle_lock(user)
else if(istype(I, /obj/item/weldingtool) && user.a_intent == INTENT_HELP && !broken)
var/obj/item/weldingtool/WT = I
if(obj_integrity < max_integrity && WT.remove_fuel(2, user))
if(obj_integrity < max_integrity)
if(!I.tool_start_check(user, amount=2))
return
to_chat(user, "<span class='notice'>You begin repairing [src].</span>")
playsound(loc, WT.usesound, 40, 1)
if(do_after(user, 40*I.toolspeed, target = src))
if(I.use_tool(src, user, 40, volume=50, amount=2))
obj_integrity = max_integrity
playsound(loc, 'sound/items/welder2.ogg', 50, 1)
update_icon()
to_chat(user, "<span class='notice'>You repair [src].</span>")
else

View File

@@ -13,13 +13,12 @@
/obj/structure/fluff/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/wrench) && deconstructible)
user.visible_message("<span class='notice'>[user] starts disassembling [src]...</span>", "<span class='notice'>You start disassembling [src]...</span>")
playsound(user, I.usesound, 50, 1)
if(!do_after(user, 50, target = src))
return 0
user.visible_message("<span class='notice'>[user] disassembles [src]!</span>", "<span class='notice'>You break down [src] into scrap metal.</span>")
playsound(user, 'sound/items/deconstruct.ogg', 50, 1)
new/obj/item/stack/sheet/metal(get_turf(src))
qdel(src)
I.play_tool_sound(src)
if(I.use_tool(src, user, 50))
user.visible_message("<span class='notice'>[user] disassembles [src]!</span>", "<span class='notice'>You break down [src] into scrap metal.</span>")
playsound(user, 'sound/items/deconstruct.ogg', 50, 1)
new/obj/item/stack/sheet/metal(drop_location())
qdel(src)
return
..()

View File

@@ -34,18 +34,16 @@
if(istype(W, /obj/item/gun/energy/plasmacutter))
to_chat(user, "<span class='notice'>You start slicing apart the girder...</span>")
playsound(src, 'sound/items/welder.ogg', 100, 1)
if(do_after(user, 40*W.toolspeed, target = src))
if(W.use_tool(src, user, 40, volume=100))
to_chat(user, "<span class='notice'>You slice apart the girder.</span>")
var/obj/item/stack/sheet/metal/M = new (loc, 2)
M.add_fingerprint(user)
qdel(src)
else if(istype(W, /obj/item/pickaxe/drill/jackhammer))
var/obj/item/pickaxe/drill/jackhammer/D = W
to_chat(user, "<span class='notice'>You smash through the girder!</span>")
new /obj/item/stack/sheet/metal(get_turf(src))
D.playDigSound()
W.play_tool_sound(src)
qdel(src)
@@ -68,7 +66,7 @@
return
to_chat(user, "<span class='notice'>You start building a reinforced false wall...</span>")
if(do_after(user, 20, target = src))
if(!src.loc || !S || S.get_amount() < 2)
if(S.get_amount() < 2)
return
S.use(2)
to_chat(user, "<span class='notice'>You create a false wall. Push on it to open or close the passage.</span>")
@@ -80,8 +78,8 @@
to_chat(user, "<span class='warning'>You need at least five rods to add plating!</span>")
return
to_chat(user, "<span class='notice'>You start adding plating...</span>")
if (do_after(user, 40, target = src))
if(!src.loc || !S || S.get_amount() < 5)
if(do_after(user, 40, target = src))
if(S.get_amount() < 5)
return
S.use(5)
to_chat(user, "<span class='notice'>You add the plating.</span>")
@@ -102,7 +100,7 @@
return
to_chat(user, "<span class='notice'>You start building a false wall...</span>")
if(do_after(user, 20, target = src))
if(!src.loc || !S || S.get_amount() < 2)
if(S.get_amount() < 2)
return
S.use(2)
to_chat(user, "<span class='notice'>You create a false wall. Push on it to open or close the passage.</span>")
@@ -115,7 +113,7 @@
return
to_chat(user, "<span class='notice'>You start adding plating...</span>")
if (do_after(user, 40, target = src))
if(loc == null || S.get_amount() < 2)
if(S.get_amount() < 2)
return
S.use(2)
to_chat(user, "<span class='notice'>You add the plating.</span>")
@@ -132,7 +130,7 @@
return
to_chat(user, "<span class='notice'>You start building a reinforced false wall...</span>")
if(do_after(user, 20, target = src))
if(!src.loc || !S || S.get_amount() < 2)
if(S.get_amount() < 2)
return
S.use(2)
to_chat(user, "<span class='notice'>You create a reinforced false wall. Push on it to open or close the passage.</span>")
@@ -145,7 +143,7 @@
return
to_chat(user, "<span class='notice'>You start finalizing the reinforced wall...</span>")
if(do_after(user, 50, target = src))
if(!src.loc || !S || S.get_amount() < 1)
if(S.get_amount() < 1)
return
S.use(1)
to_chat(user, "<span class='notice'>You fully reinforce the wall.</span>")
@@ -158,8 +156,8 @@
if(S.get_amount() < 1)
return
to_chat(user, "<span class='notice'>You start reinforcing the girder...</span>")
if (do_after(user, 60, target = src))
if(!src.loc || !S || S.get_amount() < 1)
if(do_after(user, 60, target = src))
if(S.get_amount() < 1)
return
S.use(1)
to_chat(user, "<span class='notice'>You reinforce the girder.</span>")
@@ -175,7 +173,7 @@
to_chat(user, "<span class='warning'>You need at least two sheets to create a false wall!</span>")
return
if(do_after(user, 20, target = src))
if(!src.loc || !S || S.get_amount() < 2)
if(S.get_amount() < 2)
return
S.use(2)
to_chat(user, "<span class='notice'>You create a false wall. Push on it to open or close the passage.</span>")
@@ -189,7 +187,7 @@
return
to_chat(user, "<span class='notice'>You start adding plating...</span>")
if (do_after(user, 40, target = src))
if(!src.loc || !S || S.get_amount() < 2)
if(S.get_amount() < 2)
return
S.use(2)
to_chat(user, "<span class='notice'>You add the plating.</span>")
@@ -214,11 +212,10 @@
/obj/structure/girder/screwdriver_act(mob/user, obj/item/tool)
. = FALSE
if(state == GIRDER_DISPLACED)
playsound(src, tool.usesound, 100, 1)
user.visible_message("<span class='warning'>[user] disassembles the girder.</span>",
"<span class='notice'>You start to disassemble the girder...</span>",
"You hear clanking and banging noises.")
if(do_after(user, 40 * tool.toolspeed, target = src))
if(tool.use_tool(src, user, 40, volume=100))
if(state != GIRDER_DISPLACED)
return
state = GIRDER_DISASSEMBLED
@@ -226,65 +223,60 @@
var/obj/item/stack/sheet/metal/M = new (loc, 2)
M.add_fingerprint(user)
qdel(src)
return TRUE
return TRUE
else if(state == GIRDER_REINF)
playsound(src, tool.usesound, 100, 1)
to_chat(user, "<span class='notice'>You start unsecuring support struts...</span>")
if(do_after(user, 40 * tool.toolspeed, target = src))
if(tool.use_tool(src, user, 40, volume=100))
if(state != GIRDER_REINF)
return
to_chat(user, "<span class='notice'>You unsecure the support struts.</span>")
state = GIRDER_REINF_STRUTS
return TRUE
return TRUE
else if(state == GIRDER_REINF_STRUTS)
playsound(src, tool.usesound, 100, 1)
to_chat(user, "<span class='notice'>You start securing support struts...</span>")
if(do_after(user, 40 * tool.toolspeed, target = src))
if(tool.use_tool(src, user, 40, volume=100))
if(state != GIRDER_REINF_STRUTS)
return
to_chat(user, "<span class='notice'>You secure the support struts.</span>")
state = GIRDER_REINF
return TRUE
return TRUE
// Wirecutter behavior for girders
/obj/structure/girder/wirecutter_act(mob/user, obj/item/tool)
. = FALSE
if(state == GIRDER_REINF_STRUTS)
playsound(src.loc, tool.usesound, 100, 1)
to_chat(user, "<span class='notice'>You start removing the inner grille...</span>")
if(do_after(user, 40 * tool.toolspeed, target = src))
if(tool.use_tool(src, user, 40, volume=100))
to_chat(user, "<span class='notice'>You remove the inner grille.</span>")
new /obj/item/stack/sheet/plasteel(get_turf(src))
var/obj/structure/girder/G = new (loc)
transfer_fingerprints_to(G)
qdel(src)
return TRUE
return TRUE
/obj/structure/girder/wrench_act(mob/user, obj/item/tool)
. = FALSE
if(state == GIRDER_DISPLACED)
if(!isfloorturf(loc))
to_chat(user, "<span class='warning'>A floor must be present to secure the girder!</span>")
return
playsound(src, tool.usesound, 100, 1)
to_chat(user, "<span class='notice'>You start securing the girder...</span>")
if(do_after(user, 40 * tool.toolspeed, target = src))
if(tool.use_tool(src, user, 40, volume=100))
to_chat(user, "<span class='notice'>You secure the girder.</span>")
var/obj/structure/girder/G = new (loc)
transfer_fingerprints_to(G)
qdel(src)
return TRUE
return TRUE
else if(state == GIRDER_NORMAL && can_displace)
playsound(src, tool.usesound, 100, 1)
to_chat(user, "<span class='notice'>You start unsecuring the girder...</span>")
if(do_after(user, 40 * tool.toolspeed, target = src))
if(tool.use_tool(src, user, 40, volume=100))
to_chat(user, "<span class='notice'>You unsecure the girder.</span>")
var/obj/structure/girder/displaced/D = new (loc)
transfer_fingerprints_to(D)
qdel(src)
return TRUE
return TRUE
/obj/structure/girder/CanPass(atom/movable/mover, turf/target)
if(istype(mover) && (mover.pass_flags & PASSGRILLE))
@@ -348,41 +340,25 @@
add_fingerprint(user)
if(istype(W, /obj/item/melee/cultblade/dagger) && iscultist(user)) //Cultists can demolish cult girders instantly with their tomes
user.visible_message("<span class='warning'>[user] strikes [src] with [W]!</span>", "<span class='notice'>You demolish [src].</span>")
var/obj/item/stack/sheet/runed_metal/R = new(get_turf(src))
R.amount = 1
new /obj/item/stack/sheet/runed_metal(drop_location(), 1)
qdel(src)
else if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0,user))
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You start slicing apart the girder...</span>")
if(do_after(user, 40*W.toolspeed, target = src))
if( !WT.isOn() )
return
to_chat(user, "<span class='notice'>You slice apart the girder.</span>")
var/obj/item/stack/sheet/runed_metal/R = new(get_turf(src))
R.amount = 1
transfer_fingerprints_to(R)
qdel(src)
else if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
if(!W.tool_start_check(user, amount=0))
return
else if(istype(W, /obj/item/gun/energy/plasmacutter))
to_chat(user, "<span class='notice'>You start slicing apart the girder...</span>")
playsound(src, 'sound/items/welder.ogg', 100, 1)
if(do_after(user, 40*W.toolspeed, target = src))
if(W.use_tool(src, user, 40, volume=50))
to_chat(user, "<span class='notice'>You slice apart the girder.</span>")
var/obj/item/stack/sheet/runed_metal/R = new(get_turf(src))
R.amount = 1
var/obj/item/stack/sheet/runed_metal/R = new(drop_location(), 1)
transfer_fingerprints_to(R)
qdel(src)
else if(istype(W, /obj/item/pickaxe/drill/jackhammer))
var/obj/item/pickaxe/drill/jackhammer/D = W
to_chat(user, "<span class='notice'>Your jackhammer smashes through the girder!</span>")
var/obj/item/stack/sheet/runed_metal/R = new(get_turf(src))
R.amount = 2
var/obj/item/stack/sheet/runed_metal/R = new(drop_location(), 2)
transfer_fingerprints_to(R)
D.playDigSound()
W.play_tool_sound(src)
qdel(src)
else if(istype(W, /obj/item/stack/sheet/runed_metal))
@@ -392,7 +368,7 @@
return 0
user.visible_message("<span class='notice'>[user] begins laying runed metal on [src]...</span>", "<span class='notice'>You begin constructing a runed wall...</span>")
if(do_after(user, 50, target = src))
if(R.get_amount() < 1 || !R)
if(R.get_amount() < 1)
return
user.visible_message("<span class='notice'>[user] plates [src] with runed metal.</span>", "<span class='notice'>You construct a runed wall.</span>")
R.use(1)

View File

@@ -137,11 +137,11 @@
add_fingerprint(user)
if(istype(W, /obj/item/wirecutters))
if(!shock(user, 100))
playsound(src, W.usesound, 100, 1)
W.play_tool_sound(src, 100)
deconstruct()
else if((istype(W, /obj/item/screwdriver)) && (isturf(loc) || anchored))
if(!shock(user, 90))
playsound(src, W.usesound, 100, 1)
W.play_tool_sound(src, 100)
anchored = !anchored
user.visible_message("<span class='notice'>[user] [anchored ? "fastens" : "unfastens"] [src].</span>", \
"<span class='notice'>You [anchored ? "fasten [src] to" : "unfasten [src] from"] the floor.</span>")

View File

@@ -82,7 +82,7 @@
mybag.attackby(I, user)
else if(istype(I, /obj/item/crowbar))
user.visible_message("[user] begins to empty the contents of [src].", "<span class='notice'>You begin to empty the contents of [src]...</span>")
if(do_after(user, 30*I.toolspeed, target = src))
if(I.use_tool(src, user, 30))
to_chat(usr, "<span class='notice'>You empty the contents of [src]'s bucket onto the floor.</span>")
reagents.reaction(src.loc)
src.reagents.clear_reagents()

View File

@@ -23,18 +23,13 @@
transfer_fingerprints_to(F)
qdel(src)
else if(istype(I, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = I
if(!WT.remove_fuel(0, user))
if(!I.tool_start_check(user, amount=0))
return
to_chat(user, "<span class='notice'>You begin cutting \the [src] apart...</span>")
playsound(src.loc, WT.usesound, 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(!WT.isOn())
return
playsound(src.loc, WT.usesound, 50, 1)
if(I.use_tool(src, user, 50, volume=50))
visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
"<span class='notice'>You cut \the [src] apart with \the [WT].</span>",
"<span class='italics'>You hear welding.</span>")
"<span class='notice'>You cut \the [src] apart with \the [I].</span>",
"<span class='italics'>You hear welding.</span>")
new /obj/item/stack/sheet/metal(src.loc, 4)
qdel(src)
return
@@ -56,18 +51,15 @@
/obj/structure/kitchenspike/attack_paw(mob/user)
return src.attack_hand(usr)
/obj/structure/kitchenspike/crowbar_act(mob/living/user, obj/item/I)
if(has_buckled_mobs())
to_chat(user, "<span class='notice'>You can't do that while something's on the spike!</span>")
return TRUE
/obj/structure/kitchenspike/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/crowbar))
if(!has_buckled_mobs())
playsound(loc, I.usesound, 100, 1)
if(do_after(user, 20*I.toolspeed, target = src))
to_chat(user, "<span class='notice'>You pry the spikes out of the frame.</span>")
deconstruct(TRUE)
else
to_chat(user, "<span class='notice'>You can't do that while something's on the spike!</span>")
else
return ..()
if(I.use_tool(src, user, 20, volume=100))
to_chat(user, "<span class='notice'>You pry the spikes out of the frame.</span>")
deconstruct(TRUE)
return TRUE
/obj/structure/kitchenspike/attack_hand(mob/user)
if(VIABLE_MOB_CHECK(user.pulling) && user.a_intent == INTENT_GRAB && !has_buckled_mobs())

View File

@@ -59,23 +59,24 @@
new /obj/item/shard( src.loc )
qdel(src)
/obj/structure/mirror/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
var/obj/item/weldingtool/WT = I
if(broken)
user.changeNext_move(CLICK_CD_MELEE)
if(WT.remove_fuel(0, user))
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
playsound(src, 'sound/items/welder.ogg', 100, 1)
if(do_after(user, 10*I.toolspeed, target = src))
if(!user || !WT || !WT.isOn())
return
to_chat(user, "<span class='notice'>You repair [src].</span>")
broken = 0
icon_state = initial(icon_state)
desc = initial(desc)
else
return ..()
/obj/structure/mirror/welder_act(mob/living/user, obj/item/I)
if(user.a_intent == INTENT_HARM)
return FALSE
if(!broken)
return TRUE
if(!I.tool_start_check(user, amount=0))
return TRUE
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
if(I.use_tool(src, user, 10, volume=50))
to_chat(user, "<span class='notice'>You repair [src].</span>")
broken = 0
icon_state = initial(icon_state)
desc = initial(desc)
return TRUE
/obj/structure/mirror/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)

View File

@@ -359,4 +359,4 @@ GLOBAL_LIST_EMPTY(crematoriums)
. = !density
if(ismovableatom(caller))
var/atom/movable/mover = caller
. = . || (mover.pass_flags & PASSTABLE)
. = . || (mover.pass_flags & PASSTABLE)

View File

@@ -370,25 +370,6 @@
user.set_machine(src)
song.interact(user)
/obj/structure/piano/attackby(obj/item/O, mob/user, params)
if (istype(O, /obj/item/wrench))
if (!anchored && !isinspace())
playsound(src, O.usesound, 50, 1)
to_chat(user, "<span class='notice'> You begin to tighten \the [src] to the floor...</span>")
if (do_after(user, 20*O.toolspeed, target = src))
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
"<span class='notice'>You tighten \the [src]'s casters. Now it can be played again.</span>", \
"<span class='italics'>You hear ratchet.</span>")
anchored = TRUE
else if(anchored)
playsound(src, O.usesound, 50, 1)
to_chat(user, "<span class='notice'> You begin to loosen \the [src]'s casters...</span>")
if (do_after(user, 40*O.toolspeed, target = src))
user.visible_message( \
"[user] loosens \the [src]'s casters.", \
"<span class='notice'>You loosen \the [src]. Now it can be pulled somewhere else.</span>", \
"<span class='italics'>You hear ratchet.</span>")
anchored = FALSE
else
return ..()
/obj/structure/piano/wrench_act(mob/living/user, obj/item/I)
default_unfasten_wrench(user, I, 40)
return TRUE

View File

@@ -21,18 +21,16 @@
add_fingerprint(user)
if(istype(W, /obj/item/screwdriver))
if(state == PLASTIC_FLAPS_NORMAL)
playsound(src.loc, W.usesound, 100, 1)
user.visible_message("<span class='warning'>[user] unscrews [src] from the floor.</span>", "<span class='notice'>You start to unscrew [src] from the floor...</span>", "You hear rustling noises.")
if(do_after(user, 100*W.toolspeed, target = src))
if(W.use_tool(src, user, 100, volume=100))
if(state != PLASTIC_FLAPS_NORMAL)
return
state = PLASTIC_FLAPS_DETACHED
anchored = FALSE
to_chat(user, "<span class='notice'>You unscrew [src] from the floor.</span>")
else if(state == PLASTIC_FLAPS_DETACHED)
playsound(src.loc, W.usesound, 100, 1)
user.visible_message("<span class='warning'>[user] screws [src] to the floor.</span>", "<span class='notice'>You start to screw [src] to the floor...</span>", "You hear rustling noises.")
if(do_after(user, 40*W.toolspeed, target = src))
if(W.use_tool(src, user, 40, volume=100))
if(state != PLASTIC_FLAPS_DETACHED)
return
state = PLASTIC_FLAPS_NORMAL
@@ -40,9 +38,8 @@
to_chat(user, "<span class='notice'>You screw [src] from the floor.</span>")
else if(istype(W, /obj/item/wirecutters))
if(state == PLASTIC_FLAPS_DETACHED)
playsound(src.loc, W.usesound, 100, 1)
user.visible_message("<span class='warning'>[user] cuts apart [src].</span>", "<span class='notice'>You start to cut apart [src].</span>", "You hear cutting.")
if(do_after(user, 50*W.toolspeed, target = src))
if(W.use_tool(src, user, 50, volume=100))
if(state != PLASTIC_FLAPS_DETACHED)
return
to_chat(user, "<span class='notice'>You cut apart [src].</span>")

View File

@@ -81,7 +81,7 @@
if(istype(W, /obj/item/screwdriver))
can_rotate = !can_rotate
to_chat(user, "<span class='notice'>You [can_rotate ? "unlock" : "lock"] [src]'s rotation.</span>")
playsound(src, W.usesound, 50, 1)
W.play_tool_sound(src)
return
if(istype(W, /obj/item/wrench))
@@ -89,47 +89,46 @@
to_chat(user, "<span class='warning'>Unweld [src] from the floor first!</span>")
return
user.visible_message("[user] starts to dismantle [src].", "<span class='notice'>You start to dismantle [src]...</span>")
if(do_after(user, 80*W.toolspeed, target = src))
playsound(src, W.usesound, 50, 1)
if(W.use_tool(src, user, 80, volume=50))
to_chat(user, "<span class='notice'>You dismantle [src].</span>")
new framebuildstacktype(drop_location(), framebuildstackamount)
if(buildstackamount)
new buildstacktype(drop_location(), buildstackamount)
qdel(src)
else if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(obj_integrity < max_integrity)
if(WT.remove_fuel(0,user))
user.visible_message("[user] starts to repair [src].",
"<span class='notice'>You begin repairing [src]...</span>",
"<span class='italics'>You hear welding.</span>")
playsound(src, W.usesound, 40, 1)
if(do_after(user,40*WT.toolspeed, target = src))
obj_integrity = max_integrity
user.visible_message("[user] has repaired [src].", \
"<span class='notice'>You finish repairing [src].</span>")
if(!W.tool_start_check(user, amount=0))
return
user.visible_message("[user] starts to repair [src].",
"<span class='notice'>You begin repairing [src]...</span>",
"<span class='italics'>You hear welding.</span>")
if(W.use_tool(src, user, 40, volume=40))
obj_integrity = max_integrity
user.visible_message("[user] has repaired [src].", \
"<span class='notice'>You finish repairing [src].</span>")
else if(!anchored)
if (WT.remove_fuel(0,user))
playsound(src, W.usesound, 50, 1)
user.visible_message("[user] starts to weld [src] to the floor.",
"<span class='notice'>You start to weld [src] to the floor...</span>",
"<span class='italics'>You hear welding.</span>")
if (do_after(user,20*W.toolspeed, target = src))
if(!WT.isOn())
return
anchored = TRUE
to_chat(user, "<span class='notice'>You weld [src] to the floor.</span>")
if(!W.tool_start_check(user, amount=0))
return
user.visible_message("[user] starts to weld [src] to the floor.",
"<span class='notice'>You start to weld [src] to the floor...</span>",
"<span class='italics'>You hear welding.</span>")
if (W.use_tool(src, user, 20, volume=50))
anchored = TRUE
to_chat(user, "<span class='notice'>You weld [src] to the floor.</span>")
else
if (WT.remove_fuel(0,user))
playsound(src, W.usesound, 50, 1)
user.visible_message("[user] starts to cut [src] free from the floor.", "<span class='notice'>You start to cut [src] free from the floor...</span>", "<span class='italics'>You hear welding.</span>")
if (do_after(user,20*W.toolspeed, target = src))
if(!WT.isOn())
return
anchored = FALSE
to_chat(user, "<span class='notice'>You cut [src] free from the floor.</span>")
if(!W.tool_start_check(user, amount=0))
return
user.visible_message("[user] starts to cut [src] free from the floor.",
"<span class='notice'>You start to cut [src] free from the floor...</span>",
"<span class='italics'>You hear welding.</span>")
if (W.use_tool(src, user, 20, volume=50))
anchored = FALSE
to_chat(user, "<span class='notice'>You cut [src] free from the floor.</span>")
//Finishing the frame
else if(istype(W, /obj/item/stack/sheet))
if(finished)

View File

@@ -112,18 +112,17 @@
if(istype(W, /obj/item/screwdriver) && !anchored)
if(deconstruction_state == SHOWCASE_SCREWDRIVERED)
to_chat(user, "<span class='notice'>You screw the screws back into the showcase.</span>")
playsound(loc, W.usesound, 100, 1)
W.play_tool_sound(src, 100)
deconstruction_state = SHOWCASE_CONSTRUCTED
else if (deconstruction_state == SHOWCASE_CONSTRUCTED)
to_chat(user, "<span class='notice'>You unscrew the screws.</span>")
playsound(loc, W.usesound, 100, 1)
W.play_tool_sound(src, 100)
deconstruction_state = SHOWCASE_SCREWDRIVERED
if(istype(W, /obj/item/crowbar) && deconstruction_state == SHOWCASE_SCREWDRIVERED)
if(do_after(user, 20*W.toolspeed, target = src))
playsound(loc, W.usesound, 100, 1)
if(W.use_tool(src, user, 20, volume=100))
to_chat(user, "<span class='notice'>You start to crowbar the showcase apart...</span>")
new /obj/item/stack/sheet/metal (get_turf(src), 4)
new /obj/item/stack/sheet/metal(drop_location(), 4)
qdel(src)
if(deconstruction_state == SHOWCASE_CONSTRUCTED && default_unfasten_wrench(user, W))

View File

@@ -27,21 +27,21 @@
if(BURN)
playsound(loc, 'sound/items/welder.ogg', 80, 1)
/obj/structure/sign/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/wrench) && buildable_sign)
/obj/structure/sign/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench) && buildable_sign)
user.visible_message("<span class='notice'>[user] starts removing [src]...</span>", \
"<span class='notice'>You start unfastening [src].</span>")
playsound(src, O.usesound, 50, 1)
if(!do_after(user, 30*O.toolspeed, target = src))
return
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
user.visible_message("<span class='notice'>[user] unfastens [src].</span>", \
"<span class='notice'>You unfasten [src].</span>")
var/obj/item/sign_backing/SB = new (get_turf(user))
SB.icon_state = icon_state
SB.sign_path = type
qdel(src)
else if(istype(O, /obj/item/pen) && buildable_sign)
I.play_tool_sound(src)
if(I.use_tool(src, user, 40))
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
user.visible_message("<span class='notice'>[user] unfastens [src].</span>", \
"<span class='notice'>You unfasten [src].</span>")
var/obj/item/sign_backing/SB = new (get_turf(user))
SB.icon_state = icon_state
SB.sign_path = type
qdel(src)
return
else if(istype(I, /obj/item/pen) && buildable_sign)
var/list/sign_types = list("Secure Area", "Biohazard", "High Voltage", "Radiation", "Hard Vacuum Ahead", "Disposal: Leads To Space", "Danger: Fire", "No Smoking", "Medbay", "Science", "Chemistry", \
"Hydroponics", "Xenobiology")
var/obj/structure/sign/sign_type

View File

@@ -18,11 +18,10 @@
user.changeNext_move(CLICK_CD_MELEE)
if(istype(W, /obj/item/wrench))
if(anchored)
playsound(src.loc, W.usesound, 100, 1)
user.visible_message("[user] is loosening the [name]'s bolts.", \
"<span class='notice'>You are loosening the [name]'s bolts...</span>")
if(do_after(user,40*W.toolspeed, target = src))
if(!src.loc || !anchored)
if(W.use_tool(src, user, 40, volume=100))
if(!anchored)
return
user.visible_message("[user] loosened the [name]'s bolts!", \
"<span class='notice'>You loosen the [name]'s bolts!</span>")
@@ -31,44 +30,28 @@
if(!isfloorturf(src.loc))
user.visible_message("<span class='warning'>A floor must be present to secure the [name]!</span>")
return
playsound(src.loc, W.usesound, 100, 1)
user.visible_message("[user] is securing the [name]'s bolts...", \
"<span class='notice'>You are securing the [name]'s bolts...</span>")
if(do_after(user, 40*W.toolspeed, target = src))
if(!src.loc || anchored)
if(W.use_tool(src, user, 40, volume=100))
if(anchored)
return
user.visible_message("[user] has secured the [name]'s bolts.", \
"<span class='notice'>You have secured the [name]'s bolts.</span>")
anchored = TRUE
else if(istype(W, /obj/item/gun/energy/plasmacutter))
playsound(src, 'sound/items/welder.ogg', 100, 1)
user.visible_message("[user] is slicing apart the [name]...", \
"<span class='notice'>You are slicing apart the [name]...</span>")
if(do_after(user,40*W.toolspeed, target = src))
if(!src.loc)
return
user.visible_message("[user] slices apart the [name].", \
"<span class='notice'>You slice apart the [name].</span>")
deconstruct(TRUE)
else if(istype(W, /obj/item/pickaxe/drill/jackhammer))
var/obj/item/pickaxe/drill/jackhammer/D = W
if(!src.loc)
return
user.visible_message("[user] destroys the [name]!", \
user.visible_message("[user] destroys the [name]!",
"<span class='notice'>You destroy the [name].</span>")
D.playDigSound()
W.play_tool_sound(src)
qdel(src)
else if(istype(W, /obj/item/weldingtool) && !anchored)
playsound(loc, W.usesound, 40, 1)
else if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
if(!W.tool_start_check(user, amount=0))
return FALSE
user.visible_message("[user] is slicing apart the [name].", \
"<span class='notice'>You are slicing apart the [name]...</span>")
if(do_after(user, 40*W.toolspeed, target = src))
if(!src.loc)
return
playsound(loc, 'sound/items/welder2.ogg', 50, 1)
if(W.use_tool(src, user, 40, volume=50))
user.visible_message("[user] slices apart the [name].", \
"<span class='notice'>You slice apart the [name]!</span>")
deconstruct(TRUE)

View File

@@ -24,8 +24,8 @@
/obj/structure/table_frame/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench))
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
playsound(src.loc, I.usesound, 50, 1)
if(do_after(user, 30*I.toolspeed, target = src))
I.play_tool_sound(src)
if(I.use_tool(src, user, 30))
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
deconstruct(TRUE)
else if(istype(I, /obj/item/stack/sheet/plasteel))

Some files were not shown because too many files have changed in this diff Show More