mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 13:30:42 +01:00
Ports use_tool proc from /tg/ (#13411)
This commit is contained in:
@@ -21,11 +21,11 @@
|
||||
var/obj/item/weldingtool/WT = I
|
||||
if(!WT.isOn())
|
||||
return TRUE
|
||||
if(WT.remove_fuel(0,user))
|
||||
if(WT.use(0,user))
|
||||
user.visible_message("<b>[user]</b> starts slicing \the [src] apart.", SPAN_NOTICE("You start slicing \the [src] apart."))
|
||||
playsound(src, 'sound/items/welder.ogg', 100, 1)
|
||||
var/slice_time = reinf_material ? 100 : 30
|
||||
if(do_after(user, slice_time, TRUE))
|
||||
if(WT.use_tool(src, user, slice_time, volume = 50))
|
||||
user.visible_message("<b>[user]</b> slices \the [src] apart.", SPAN_NOTICE("You slice \the [src] apart."))
|
||||
material.place_sheet(get_turf(src))
|
||||
if(reinf_material)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
var/damage = W.force / 4.0
|
||||
if(W.iswelder())
|
||||
var/obj/item/weldingtool/WT = W
|
||||
if(WT.remove_fuel(0, user))
|
||||
if(WT.use(0, user))
|
||||
damage = 15
|
||||
playsound(loc, 'sound/items/welder.ogg', 100, 1)
|
||||
return TRUE
|
||||
|
||||
@@ -871,6 +871,82 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
||||
return
|
||||
usr.UnarmedAttack(src)
|
||||
|
||||
/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(user.is_busy()) to be ported in future if we ever need it
|
||||
// return
|
||||
|
||||
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, 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 TRUE
|
||||
|
||||
// Plays item's usesound, if any.
|
||||
/obj/item/proc/play_tool_sound(atom/target, volume=null) // null, so default value of this proc won't override default value of the playsound.
|
||||
if(target && volume)
|
||||
var/played_sound
|
||||
if(usesound)
|
||||
played_sound = usesound
|
||||
if(islist(usesound))
|
||||
played_sound = pick(usesound)
|
||||
else if(hitsound) // use hitsound if there isn't a use sound.
|
||||
played_sound = hitsound
|
||||
if(islist(usesound))
|
||||
played_sound = pick(hitsound)
|
||||
|
||||
//playsound(target, played_sound, VOL_EFFECTS_MASTER, volume) implement sound channel system in future
|
||||
playsound(target, played_sound, volume, TRUE)
|
||||
|
||||
// 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, mob/M = null)
|
||||
return !used
|
||||
|
||||
// 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())
|
||||
|
||||
/obj/item/proc/catch_fire()
|
||||
return
|
||||
|
||||
|
||||
@@ -51,9 +51,8 @@
|
||||
*/
|
||||
/obj/item/canvas/attackby(obj/item/I, mob/user, params)
|
||||
if(I.iswrench())
|
||||
playsound(src.loc, I.usesound, 100, 1)
|
||||
to_chat(user, SPAN_NOTICE("You begin to [anchored ? "loosen" : "tighten"] \the [src]..."))
|
||||
if(do_after(user, 40 / I.toolspeed))
|
||||
if(I.use_tool(src, user, 40, volume = 50))
|
||||
user.visible_message("<b>[user]</b> [anchored ? "loosens" : "tightens"] \the [src].", SPAN_NOTICE("You [anchored ? "loosen" : "tighten"] \the [src]."), SPAN_NOTICE("You hear a ratchet."))
|
||||
anchored = !anchored
|
||||
return TRUE
|
||||
|
||||
@@ -165,11 +165,11 @@
|
||||
|
||||
if (I.iswelder())
|
||||
var/obj/item/weldingtool/WT = I
|
||||
if (WT.remove_fuel(2, user))
|
||||
if (WT.use(2, user))
|
||||
user.visible_message(SPAN_NOTICE("[user] starts welding the metal shell of [src]."), SPAN_NOTICE("You start [hacked ? "repairing" : "welding open"] the metal covering of [src]."))
|
||||
playsound(loc, 'sound/items/welder.ogg', 50, 1)
|
||||
add_overlay("overlay_welding")
|
||||
if (do_after(user, 25/I.toolspeed))
|
||||
if(WT.use_tool(src, user, 25, volume = 50))
|
||||
to_chat(user, SPAN_NOTICE("You are able to [hacked ? "repair" : "weld through"] the metal shell of [src]."))
|
||||
if (hacked) locked = 1
|
||||
else locked = 0
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
..()
|
||||
to_chat(usr, "It has [uses] use\s left.")
|
||||
|
||||
/obj/item/device/kit/proc/use(var/amt, var/mob/user)
|
||||
/obj/item/device/kit/use(var/amt, var/mob/user)
|
||||
uses -= amt
|
||||
playsound(get_turf(user), 'sound/items/screwdriver.ogg', 50, 1)
|
||||
if(uses<1)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
to_chat(user, SPAN_NOTICE("\The [src] is fully repaired."))
|
||||
return TRUE
|
||||
var/obj/item/weldingtool/WT = W
|
||||
if(WT.remove_fuel(0, user))
|
||||
if(WT.use(0, user))
|
||||
cut_overlays()
|
||||
LAZYCLEARLIST(bullet_holes)
|
||||
icon = initial(icon)
|
||||
|
||||
@@ -72,7 +72,7 @@ var/global/list/datum/stack_recipe/rod_recipes = list(
|
||||
to_chat(user, "<span class='warning'>You need at least two rods to do this.</span>")
|
||||
return
|
||||
|
||||
if(WT.remove_fuel(0,user))
|
||||
if(WT.use(0,user))
|
||||
var/obj/item/stack/material/steel/new_item = new(usr.loc)
|
||||
new_item.add_to_stacks(usr)
|
||||
for (var/mob/M in viewers(src))
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
user.visible_message(SPAN_NOTICE("\The [user] starts drying \the [src] with \the [WT]."), SPAN_NOTICE("You start drying the wet leather with \the [WT]..."))
|
||||
being_dried = TRUE
|
||||
while(do_after(user, 20, act_target = src) && wetness > 0)
|
||||
if(!WT.remove_fuel(1) || !WT.isOn())
|
||||
if(!WT.use(1) || !WT.isOn())
|
||||
break
|
||||
if(prob(5))
|
||||
var/msg = pick("You run the tool over \the [src]...", "The leather is drying nicely...", "You spread the heat out evenly...", "You continue to dry out \the [src].")
|
||||
@@ -173,7 +173,7 @@
|
||||
if(!amount || QDELETED(src)) //Safety
|
||||
break
|
||||
being_dried = FALSE
|
||||
|
||||
|
||||
else
|
||||
to_chat(user, SPAN_NOTICE("\The [WT] dries better when it's lit."))
|
||||
return
|
||||
@@ -194,4 +194,4 @@
|
||||
else
|
||||
new /obj/item/stack/material/leather/fine(get_turf(src))
|
||||
use(1)
|
||||
wetness = initial(wetness)
|
||||
wetness = initial(wetness)
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/item/stack/proc/use(var/used)
|
||||
/obj/item/stack/use(var/used)
|
||||
if (!can_use(used))
|
||||
return 0
|
||||
if(!uses_charge)
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
var/obj/item/wirecutters/W = I
|
||||
user.visible_message(SPAN_WARNING("\The [user] starts snipping some wires in \the [src] with \the [W]..."), \
|
||||
SPAN_NOTICE("You start snipping some wires in \the [src] with \the [W]..."))
|
||||
if(do_after(user, 150, TRUE, src))
|
||||
if(I.use_tool(src, user, 150, volume = 50))
|
||||
if(prob(W.bomb_defusal_chance))
|
||||
to_chat(user, SPAN_NOTICE("You successfully defuse \the [src], though it's missing some essential wiring now."))
|
||||
deactivated = TRUE
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
/obj/item/material/shard/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(W.iswelder() && material.shard_can_repair)
|
||||
var/obj/item/weldingtool/WT = W
|
||||
if(WT.remove_fuel(0, user))
|
||||
if(WT.use(0, user))
|
||||
material.place_sheet(user.loc)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -969,7 +969,7 @@
|
||||
else if(O.isscrewdriver())
|
||||
if(length(contents) == 0)
|
||||
to_chat(user, SPAN_NOTICE("You begin poking holes in \the [src]."))
|
||||
if (do_after(user, 10/O.toolspeed, act_target = src))
|
||||
if(O.use_tool(src, user, 30))
|
||||
if(choice == "SmileyFace")
|
||||
var/obj/item/clothing/head/papersack/smiley/S = new()
|
||||
user.put_in_hands(S)
|
||||
|
||||
@@ -42,23 +42,23 @@
|
||||
return
|
||||
|
||||
if (W.isscrewdriver())
|
||||
if (do_after(user, 20/W.toolspeed))
|
||||
if(W.use_tool(src, user, 20, volume = 50))
|
||||
src.open =! src.open
|
||||
user.show_message(text("<span class='notice'>You [] the service panel.</span>", (src.open ? "open" : "close")))
|
||||
to_chat(user, SPAN_NOTICE("You [src.open ? "open" : "close"] the service panel."))
|
||||
return
|
||||
if ((W.ismultitool()) && (src.open == 1)&& (!src.l_hacking))
|
||||
user.show_message("<span class='notice'>Now attempting to reset internal memory, please hold.</span>", 1)
|
||||
to_chat(user, SPAN_NOTICE("Now attempting to reset internal memory, please hold."))
|
||||
src.l_hacking = 1
|
||||
if (do_after(usr, 100))
|
||||
if (prob(40))
|
||||
src.l_setshort = 1
|
||||
src.l_set = 0
|
||||
user.show_message("<span class='notice'>Internal memory reset. Please give it a few seconds to reinitialize.</span>", 1)
|
||||
to_chat(user, SPAN_NOTICE("Internal memory reset. Please give it a few seconds to reinitialize."))
|
||||
sleep(80)
|
||||
src.l_setshort = 0
|
||||
src.l_hacking = 0
|
||||
else
|
||||
user.show_message("<span class='warning'>Unable to reset internal memory.</span>", 1)
|
||||
to_chat(user, SPAN_WARNING("Unable to reset internal memory."))
|
||||
src.l_hacking = 0
|
||||
else src.l_hacking = 0
|
||||
return
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
user.visible_message("<b>[user]</b> appears out of thin air!", SPAN_NOTICE("You successfully step into your destination."))
|
||||
use()
|
||||
|
||||
/obj/item/syndie/teleporter/proc/use()
|
||||
/obj/item/syndie/teleporter/use()
|
||||
addtimer(CALLBACK(src, .proc/recharge), recharge_time)
|
||||
ready_to_use = FALSE
|
||||
check_maptext(SMALL_FONTS(6, "Charge"))
|
||||
@@ -146,4 +146,4 @@
|
||||
|
||||
/obj/item/syndie/teleporter/proc/recharge()
|
||||
ready_to_use = TRUE
|
||||
check_maptext(SMALL_FONTS(7, "Ready"))
|
||||
check_maptext(SMALL_FONTS(7, "Ready"))
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
|
||||
//Welding tool specific stuff
|
||||
var/welding = 0 //Whether or not the welding tool is off(0), on(1) or currently welding(2)
|
||||
var/status = 1 //Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower)
|
||||
var/status = TRUE //Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower)
|
||||
var/max_fuel = 20 //The max amount of fuel the welder can hold
|
||||
|
||||
var/change_icons = TRUE
|
||||
@@ -362,7 +362,7 @@
|
||||
/obj/item/weldingtool/process()
|
||||
if(welding)
|
||||
if(prob(5))
|
||||
remove_fuel(1, null, colourChange = FALSE)
|
||||
use(1, null, colourChange = FALSE)
|
||||
|
||||
if(get_fuel() < 1)
|
||||
setWelding(0)
|
||||
@@ -414,7 +414,7 @@
|
||||
return
|
||||
|
||||
if(do_mob(user, target, 30))
|
||||
if(remove_fuel(0))
|
||||
if(use(0))
|
||||
var/static/list/repair_messages = list(
|
||||
"patches some dents",
|
||||
"mends some tears",
|
||||
@@ -422,7 +422,7 @@
|
||||
)
|
||||
affecting.heal_damage(brute = 15, robo_repair = TRUE)
|
||||
user.visible_message(SPAN_WARNING("\The [user] [pick(repair_messages)] on [target]'s [affecting.name] with \the [src]."))
|
||||
playsound(target, 'sound/items/welder_pry.ogg', 15)
|
||||
playsound(target, usesound, 15)
|
||||
repair_organ(user, target, affecting)
|
||||
|
||||
/obj/item/weldingtool/afterattack(obj/O, mob/user, proximity)
|
||||
@@ -467,7 +467,7 @@
|
||||
return
|
||||
return
|
||||
if (welding)
|
||||
remove_fuel(1)
|
||||
use(1)
|
||||
var/turf/location = get_turf(user)
|
||||
if(isliving(O))
|
||||
var/mob/living/L = O
|
||||
@@ -483,12 +483,11 @@
|
||||
/obj/item/weldingtool/proc/get_fuel()
|
||||
return REAGENT_VOLUME(reagents, /decl/reagent/fuel)
|
||||
|
||||
//Removes fuel from the welding tool. If a mob is passed, it will perform an eyecheck on the mob. This should probably be renamed to use()
|
||||
/obj/item/weldingtool/proc/remove_fuel(var/amount = 1, var/mob/M = null, var/colourChange = TRUE)
|
||||
//Removes fuel from the welding tool. If a mob is passed, it will perform an eyecheck on the mob.
|
||||
/obj/item/weldingtool/use(var/amount = 1, var/mob/M = null, var/colourChange = TRUE)
|
||||
if(!welding)
|
||||
return 0
|
||||
else if(welding > 0 && colourChange)
|
||||
set_light(0.7, 2, l_color = LIGHT_COLOR_CYAN)
|
||||
addtimer(CALLBACK(src, /atom/proc/update_icon), 5)
|
||||
if(get_fuel() >= amount)
|
||||
reagents.remove_reagent(/decl/reagent/fuel, amount)
|
||||
@@ -530,6 +529,7 @@
|
||||
damtype = BURN
|
||||
w_class = ITEMSIZE_LARGE
|
||||
welding = TRUE
|
||||
hitsound = SOUNDS_LASER_MEAT
|
||||
attack_verb = list("scorched", "burned", "blasted", "blazed")
|
||||
update_icon()
|
||||
set_processing(TRUE)
|
||||
@@ -679,7 +679,7 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/weldingtool/experimental/remove_fuel(amount, mob/M, colourChange)
|
||||
/obj/item/weldingtool/experimental/use(amount, mob/M, colourChange)
|
||||
. = ..(overcap ? amount * 3 : amount, M, colourChange)
|
||||
if(!. && welding && overcap) // to ensure that the fuel gets used even if the amount is high
|
||||
reagents.remove_reagent(/decl/reagent/fuel, get_fuel())
|
||||
@@ -979,7 +979,7 @@
|
||||
attack_verb = list("smashed", "hammered")
|
||||
drop_sound = 'sound/items/drop/crowbar.ogg'
|
||||
pickup_sound = 'sound/items/pickup/crowbar.ogg'
|
||||
usesound = /decl/sound_category/crowbar_sound
|
||||
usesound = /decl/sound_category/hammer_sound
|
||||
|
||||
/obj/item/hammer/Initialize()
|
||||
. = ..()
|
||||
|
||||
@@ -378,14 +378,14 @@
|
||||
|
||||
else if(W.iswelder())
|
||||
var/obj/item/weldingtool/WT = W
|
||||
if(!WT.welding)
|
||||
to_chat(user, SPAN_WARNING("Your \the [W] is off!"))
|
||||
if(!WT.isOn())
|
||||
to_chat(user, SPAN_WARNING("\The [WT] is off!"))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] is trying to slice \the [src] open!</span>",
|
||||
"<span class='notice'>You are trying to slice \the [src] open!</span>")
|
||||
|
||||
if (do_after(user, 30/W.toolspeed, act_target = src))
|
||||
if(WT.remove_fuel(2, user))
|
||||
if(WT.use_tool(src, user, 60, volume = 50))
|
||||
if(WT.use(2, user))
|
||||
user.visible_message("<span class='notice'>[user] slices \the [src] open!</span>",
|
||||
"<span class='notice'>You slice \the [src] open!</span>")
|
||||
new /obj/item/stack/rods(src.loc, resources["rods"])
|
||||
@@ -404,7 +404,7 @@
|
||||
"<span class='notice'>You are trying to [anchored ? "un" : "" ]secure \the [src]!</span>")
|
||||
playsound(src.loc, "sound/items/[pick("Screwdriver", "Screwdriver2")].ogg", 50, 1)
|
||||
|
||||
if (do_after(user, 30/W.toolspeed, act_target = src))
|
||||
if(W.use_tool(src, user, 30, volume = 50))
|
||||
density = !density
|
||||
anchored = !anchored
|
||||
user.visible_message("<span class='notice'>[user] [anchored ? "" : "un" ]secures \the [src]!</span>",
|
||||
@@ -573,9 +573,8 @@
|
||||
|
||||
user.visible_message("<span class='notice'>[user] begins [anchored ? "un" : "" ]securing \the [src]!</span>",
|
||||
"<span class='notice'>You begin [anchored ? "un" : "" ]securing \the [src]!</span>")
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
|
||||
if(do_after(user, 30/W.toolspeed, act_target = src))
|
||||
if(W.use_tool(src, user, 30, volume = 50))
|
||||
anchored = !anchored
|
||||
user.visible_message("<span class='notice'>[user] [anchored ? "" : "un" ]secures \the [src]!</span>",
|
||||
"<span class='notice'>You [anchored ? "" : "un" ]secure \the [src]!</span>")
|
||||
@@ -689,4 +688,4 @@
|
||||
|
||||
if(!L.lying && (L.m_intent == M_RUN) || prob(5))
|
||||
L.visible_message(SPAN_DANGER("\The [L] trips over \the [src]!"), FONT_LARGE(SPAN_DANGER("You trip over \the [src]!")))
|
||||
L.Weaken(3)
|
||||
L.Weaken(3)
|
||||
|
||||
@@ -28,15 +28,9 @@
|
||||
|
||||
/obj/structure/banner/attackby(obj/item/W, mob/user)
|
||||
if(W.iswrench())
|
||||
switch(anchored)
|
||||
if(0)
|
||||
anchored = 1
|
||||
playsound(src.loc, W.usesound, 75, 1)
|
||||
user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet")
|
||||
if(1)
|
||||
anchored = 0
|
||||
playsound(src.loc, W.usesound, 75, 1)
|
||||
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet")
|
||||
anchored = !anchored
|
||||
playsound(src.loc, W.usesound, 75, 1)
|
||||
user.visible_message("[user.name] [anchored ? "" : "un" ]secures \the [src.name] [anchored ? "to" : "from" ] the floor.", "You [anchored ? "" : "un" ]secure \the [src.name] [anchored ? "to" : "from" ] the floor.", "You hear a ratchet.")
|
||||
return
|
||||
|
||||
/obj/structure/banner/unmovable
|
||||
@@ -128,4 +122,4 @@
|
||||
desc = "A deep blue banner adorned with the logo of the Stellar Corporate Conglomerate."
|
||||
desc_fluff = "The Stellar Corporate Conglomerate, also known as Chainlink, is a joint alliance between the NanoTrasen Corporation, Hephaestus Industries, Idris Incorporated, Zeng-Hu Pharmaceuticals and Zavodskoi Interstellar to exercise an undisputed economic dominance over the Orion Spur."
|
||||
icon_state = "scc_banner_down"
|
||||
icon_up = "scc_banner_up"
|
||||
icon_up = "scc_banner_up"
|
||||
|
||||
@@ -179,14 +179,14 @@ LINEN BINS
|
||||
/obj/item/bedsheet/attackby(obj/item/I, mob/user)
|
||||
if(I.isscrewdriver())
|
||||
user.visible_message(SPAN_NOTICE("\The [user] begins poking eyeholes in \the [src] with \the [I]."), SPAN_NOTICE("You begin poking eyeholes in \the [src] with \the [I]."))
|
||||
if(do_after(user, 50/I.toolspeed))
|
||||
if(I.use_tool(src, user, 50, volume = 50))
|
||||
to_chat(user, SPAN_NOTICE("You poke eyeholes in \the [src]!"))
|
||||
new /obj/item/bedsheet/costume(get_turf(src))
|
||||
qdel(src)
|
||||
return TRUE
|
||||
else if(is_sharp(I))
|
||||
user.visible_message(SPAN_NOTICE("\The [user] begins cutting up \the [src] with \the [I]."), SPAN_NOTICE("You begin cutting up \the [src] with \the [I]."))
|
||||
if(do_after(user, 50 / I.toolspeed))
|
||||
if(I.use_tool(src, user, 50, volume = 50))
|
||||
to_chat(user, SPAN_NOTICE("You cut \the [src] into pieces!"))
|
||||
new /obj/item/stack/material/cloth(get_turf(src), rand(2, 5))
|
||||
qdel(src)
|
||||
|
||||
@@ -336,7 +336,7 @@
|
||||
playsound(loc, 'sound/items/welder_pry.ogg', 50, 1)
|
||||
if (!do_after(user, 2 SECONDS, act_target = src, extra_checks = CALLBACK(src, .proc/is_open)))
|
||||
return
|
||||
if(!WT.remove_fuel(0,user))
|
||||
if(!WT.use(0,user))
|
||||
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
|
||||
return
|
||||
else
|
||||
@@ -379,9 +379,9 @@
|
||||
"You hear a welding torch on metal."
|
||||
)
|
||||
playsound(loc, 'sound/items/welder_pry.ogg', 50, 1)
|
||||
if (!do_after(user, 2/W.toolspeed SECONDS, act_target = src, extra_checks = CALLBACK(src, .proc/is_closed)))
|
||||
if(!W.use_tool(src, user, 20, volume = 50, extra_checks = CALLBACK(src, .proc/is_closed)))
|
||||
return
|
||||
if(!WT.remove_fuel(0,user))
|
||||
if(!WT.use(0,user))
|
||||
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
|
||||
return
|
||||
welded = !welded
|
||||
|
||||
@@ -46,10 +46,9 @@
|
||||
manipulating = TRUE
|
||||
visible_message(SPAN_NOTICE("[user] begins cutting down \the [src]."),
|
||||
SPAN_NOTICE("You begin cutting down \the [src]."))
|
||||
if(!do_after(user, 30/W.toolspeed))
|
||||
if(!W.use_tool(src, user, 30, volume = 50))
|
||||
manipulating = FALSE
|
||||
return
|
||||
playsound(src.loc, 'sound/items/wirecutter.ogg', 50, 1)
|
||||
visible_message(SPAN_NOTICE("[user] cuts down \the [src]."),
|
||||
SPAN_NOTICE("You cut down \the [src]."))
|
||||
dismantle()
|
||||
|
||||
@@ -185,11 +185,11 @@
|
||||
to_chat(user, SPAN_WARNING("\The [src] isn't ready to be welded yet. It doesn't have any installed material to remove, and it has to be unsecured to deconstruct it."))
|
||||
return
|
||||
var/obj/item/weldingtool/WT = W
|
||||
if(WT.remove_fuel(0, user))
|
||||
if(WT.use(0, user))
|
||||
playsound(src.loc, 'sound/items/welder_pry.ogg', 50, 1)
|
||||
if(istext(glass))
|
||||
user.visible_message("<b>[user]</b> starts welding the [glass] plating off the airlock assembly.", SPAN_NOTICE("You start welding the [glass] plating off the airlock assembly."))
|
||||
if(do_after(user, 40 / W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src || !WT.isOn())
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You weld the [glass] plating off."))
|
||||
@@ -198,7 +198,7 @@
|
||||
glass = FALSE
|
||||
else if(glass == TRUE)
|
||||
user.visible_message("<b>[user]</b> starts welding the glass panel out of the airlock assembly.", SPAN_NOTICE("You start welding the glass panel out of the airlock assembly."))
|
||||
if(do_after(user, 40 / W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src || !WT.isOn())
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You weld the glass panel out."))
|
||||
@@ -206,7 +206,7 @@
|
||||
glass = FALSE
|
||||
else if(!anchored)
|
||||
user.visible_message("<b>[user]</b> starts disassembling the airlock assembly.", SPAN_NOTICE("You start disassembling the airlock assembly."))
|
||||
if(do_after(user, 40 / W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src || !WT.isOn())
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You disassemble the airlock assembly."))
|
||||
@@ -220,8 +220,6 @@
|
||||
to_chat(user, SPAN_WARNING("You have to remove the wiring before you can use the wrench on \the [src]."))
|
||||
return
|
||||
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
|
||||
if(anchored)
|
||||
user.visible_message("<b>[user]</b> begins unsecuring the airlock assembly from the floor.", \
|
||||
SPAN_NOTICE("You start unsecuring the airlock assembly from the floor."))
|
||||
@@ -229,7 +227,7 @@
|
||||
user.visible_message("<b>[user]</b> begins securing the airlock assembly to the floor.", \
|
||||
SPAN_NOTICE("You start securing the airlock assembly to the floor."))
|
||||
|
||||
if(do_after(user, 40 / W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src)
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You [anchored? "un" : ""]secure \the [src]."))
|
||||
@@ -247,7 +245,7 @@
|
||||
to_chat(user, SPAN_WARNING("You need three lengths of coil to wire the airlock assembly."))
|
||||
return
|
||||
user.visible_message("<b>[user]</b> starts wiring the airlock assembly.", SPAN_NOTICE("You start wiring the airlock assembly."))
|
||||
if(do_after(user, 40) && state == STATE_UNWIRED && anchored)
|
||||
if(W.use_tool(src, user, 40, volume = 50) && state == STATE_UNWIRED && anchored)
|
||||
if(C.use(3))
|
||||
state = STATE_WIRED
|
||||
to_chat(user, SPAN_NOTICE("You wire the airlock."))
|
||||
@@ -263,7 +261,7 @@
|
||||
playsound(src.loc, 'sound/items/wirecutter.ogg', 100, 1)
|
||||
user.visible_message("<b>[user]</b> starts cutting the wires from the airlock assembly.", SPAN_NOTICE("You start cutting the wires from airlock assembly."))
|
||||
|
||||
if(do_after(user, 40 / W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src)
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You cut the airlock wires."))
|
||||
@@ -282,7 +280,7 @@
|
||||
playsound(src.loc, 'sound/items/screwdriver.ogg', 100, 1)
|
||||
user.visible_message("<b>[user]</b> starts installing \the [EL] into the airlock assembly.", SPAN_NOTICE("You start installing \the [EL] into the airlock assembly."))
|
||||
EL.is_installed = TRUE
|
||||
if(do_after(user, 40 / W.toolspeed) && state == STATE_WIRED)
|
||||
if(W.use_tool(src, user, 40, volume = 50) && state == STATE_WIRED)
|
||||
EL.is_installed = FALSE
|
||||
if(!src)
|
||||
return
|
||||
@@ -305,10 +303,9 @@
|
||||
state = STATE_WIRED
|
||||
return
|
||||
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
user.visible_message("<b>[user]</b> starts removing the electronics from \the [src].", SPAN_NOTICE("You start removing the electronics from \the [src]."))
|
||||
|
||||
if(do_after(user, 40 / W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src)
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You remove \the [electronics]."))
|
||||
@@ -325,9 +322,8 @@
|
||||
if(S)
|
||||
if(S.get_amount() >= 1)
|
||||
if(material_name == "rglass")
|
||||
playsound(src.loc, /decl/sound_category/crowbar_sound, 100, 1)
|
||||
user.visible_message("<b>[user]</b> starts installing [S] into the airlock assembly.", "You start installing [S] into the airlock assembly.")
|
||||
if(do_after(user, 40) && !glass)
|
||||
if(W.use_tool(src, user, 40, volume = 50) && !glass)
|
||||
if(S.use(1))
|
||||
to_chat(user, SPAN_NOTICE("You install reinforced glass windows into the airlock assembly."))
|
||||
glass = 1
|
||||
@@ -339,7 +335,7 @@
|
||||
if(S.get_amount() >= 2)
|
||||
playsound(src.loc, /decl/sound_category/crowbar_sound, 100, 1)
|
||||
user.visible_message("<b>[user]</b> starts installing [S] into the airlock assembly.", "You start installing [S] into the airlock assembly.")
|
||||
if(do_after(user, 40) && !glass)
|
||||
if(W.use_tool(src, user, 40, volume = 50) && !glass)
|
||||
if (S.use(2))
|
||||
to_chat(user, SPAN_NOTICE("You install [SSmaterials.material_display_name(material_name)] plating into the airlock assembly."))
|
||||
glass = material_name
|
||||
@@ -349,10 +345,9 @@
|
||||
to_chat(user, SPAN_WARNING("\The [src] doesn't have any electronics installed."))
|
||||
return
|
||||
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
user.visible_message("<b>[user]</b> starts finishing \the [src].", SPAN_NOTICE("You start finishing \the [src]."))
|
||||
|
||||
if(do_after(user, 40 / W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src)
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You finish the airlock!"))
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
if(!WT.isOn())
|
||||
to_chat(user, SPAN_WARNING("\The [WT] isn't turned on."))
|
||||
return
|
||||
if(WT.remove_fuel(0, user))
|
||||
if(WT.use(0, user))
|
||||
to_chat(user, SPAN_NOTICE("You use \the [WT] to remove \the [src]."))
|
||||
playsound(src, WT.usesound, 80, 1)
|
||||
new /obj/item/stack/material/steel(get_turf(src),rand(1,3))
|
||||
|
||||
@@ -73,16 +73,14 @@
|
||||
/obj/structure/girder/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(W.iswrench() && state == 0)
|
||||
if(anchored && !reinf_material)
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now disassembling the girder...</span>")
|
||||
if(do_after(user,40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='notice'>You dissasembled the girder!</span>")
|
||||
dismantle()
|
||||
else if(!anchored)
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now securing the girder...</span>")
|
||||
if(do_after(user, 40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
to_chat(user, "<span class='notice'>You secured the girder!</span>")
|
||||
reset_girder()
|
||||
|
||||
@@ -101,7 +99,7 @@
|
||||
var/obj/item/melee/energy/WT = W
|
||||
if(WT.active)
|
||||
to_chat(user, "<span class='notice'>Now slicing apart the girder...</span>")
|
||||
if(do_after(user,30/W.toolspeed))
|
||||
if(W.use_tool(src, user, 30, volume = 50))
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='notice'>You slice apart the girder!</span>")
|
||||
dismantle()
|
||||
@@ -111,7 +109,7 @@
|
||||
|
||||
else if(istype(W, /obj/item/melee/energy/blade))
|
||||
to_chat(user, "<span class='notice'>Now slicing apart the girder...</span>")
|
||||
if(do_after(user,30/W.toolspeed))
|
||||
if(W.use_tool(src, user, 30, volume = 50))
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='notice'>You slice apart the girder!</span>")
|
||||
dismantle()
|
||||
@@ -120,7 +118,7 @@
|
||||
var/obj/item/melee/chainsword/WT = W
|
||||
if(WT.active)
|
||||
to_chat(user, "<span class='notice'>Now slicing apart the girder...</span>")
|
||||
if(do_after(user,60/W.toolspeed))
|
||||
if(WT.use_tool(src, user, 60, volume = 50))
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='notice'>You slice apart the girder!</span>")
|
||||
dismantle()
|
||||
@@ -142,32 +140,29 @@
|
||||
|
||||
else if(W.isscrewdriver())
|
||||
if(state == 2)
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now unsecuring support struts...</span>")
|
||||
if(do_after(user,40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You unsecured the support struts!</span>")
|
||||
state = 1
|
||||
else if(anchored && !reinf_material)
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
reinforcing = !reinforcing
|
||||
to_chat(user, "<span class='notice'>\The [src] can now be [reinforcing? "reinforced" : "constructed"]!</span>")
|
||||
return
|
||||
|
||||
else if(W.iswirecutter() && state == 1)
|
||||
playsound(src.loc, 'sound/items/wirecutter.ogg', 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now removing support struts...</span>")
|
||||
if(do_after(user,40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='notice'>You removed the support struts!</span>")
|
||||
reinf_material = null
|
||||
reset_girder()
|
||||
|
||||
else if(W.iscrowbar() && state == 0 && anchored)
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now dislodging the girder...</span>")
|
||||
if(do_after(user, 40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='notice'>You dislodged the girder!</span>")
|
||||
icon_state = "displaced"
|
||||
@@ -331,15 +326,14 @@
|
||||
|
||||
/obj/structure/girder/cult/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(W.iswrench())
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now disassembling the girder...</span>")
|
||||
if(do_after(user,40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
to_chat(user, "<span class='notice'>You dissasembled the girder!</span>")
|
||||
dismantle()
|
||||
|
||||
else if(istype(W, /obj/item/gun/energy/plasmacutter))
|
||||
to_chat(user, "<span class='notice'>Now slicing apart the girder...</span>")
|
||||
if(do_after(user,30/W.toolspeed))
|
||||
if(W.use_tool(src, user, 30, volume = 50))
|
||||
to_chat(user, "<span class='notice'>You slice apart the girder!</span>")
|
||||
dismantle()
|
||||
|
||||
@@ -352,7 +346,7 @@
|
||||
var/obj/item/melee/energy/WT = W
|
||||
if(WT.active)
|
||||
to_chat(user, "<span class='notice'>Now slicing apart the girder...</span>")
|
||||
if(do_after(user,30/W.toolspeed))
|
||||
if(W.use_tool(src, user, 30, volume = 50))
|
||||
to_chat(user, "<span class='notice'>You slice apart the girder!</span>")
|
||||
dismantle()
|
||||
else
|
||||
@@ -361,7 +355,7 @@
|
||||
|
||||
else if(istype(W, /obj/item/melee/energy/blade))
|
||||
to_chat(user, "<span class='notice'>Now slicing apart the girder...</span>")
|
||||
if(do_after(user,30/W.toolspeed))
|
||||
if(W.use_tool(src, user, 30, volume = 50))
|
||||
to_chat(user, "<span class='notice'>You slice apart the girder!</span>")
|
||||
dismantle()
|
||||
|
||||
@@ -369,7 +363,7 @@
|
||||
var/obj/item/melee/chainsword/WT = W
|
||||
if(WT.active)
|
||||
to_chat(user, "<span class='notice'>Now slicing apart the girder...</span>")
|
||||
if(do_after(user,60/W.toolspeed))
|
||||
if(WT.use_tool(src, user, 60, volume = 50))
|
||||
to_chat(user, "<span class='notice'>You slice apart the girder!</span>")
|
||||
dismantle()
|
||||
else
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
return
|
||||
if (C.iswelder())
|
||||
var/obj/item/weldingtool/WT = C
|
||||
if(WT.remove_fuel(0, user))
|
||||
if(WT.use(0, user))
|
||||
to_chat(user, "<span class='notice'>Slicing lattice joints ...</span>")
|
||||
new /obj/item/stack/rods(src.loc)
|
||||
qdel(src)
|
||||
@@ -80,23 +80,25 @@
|
||||
layer = 2.7 // Above wires.
|
||||
|
||||
/obj/structure/lattice/catwalk/attackby(obj/item/C, mob/user)
|
||||
if (C.iswelder())
|
||||
if(C.iswelder())
|
||||
var/obj/item/weldingtool/WT = C
|
||||
if (do_after(user, 5/C.toolspeed, act_target = src) && WT.remove_fuel(1, user))
|
||||
to_chat(user, "<span class='notice'>You slice apart [src].</span>")
|
||||
playsound(src, 'sound/items/welder.ogg', 50, 1)
|
||||
if(!WT.use(1, user))
|
||||
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
|
||||
return
|
||||
if(C.use_tool(src, user, 5, volume = 50))
|
||||
to_chat(user, SPAN_NOTICE("You slice apart [src]."))
|
||||
var/obj/item/stack/rods/R = new /obj/item/stack/rods(get_turf(src))
|
||||
R.amount = return_amount
|
||||
R.update_icon()
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/lattice/catwalk/indoor/attackby(obj/item/C, mob/user)
|
||||
if (C.isscrewdriver())
|
||||
anchored = !anchored
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "" : "un"]anchor [src].</span>")
|
||||
playsound(src, C.usesound, 50, 1)
|
||||
queue_smooth(src)
|
||||
queue_smooth_neighbors(src)
|
||||
if(C.isscrewdriver())
|
||||
if(C.use_tool(src, user, 5, volume = 50))
|
||||
anchored = !anchored
|
||||
to_chat(user, SPAN_NOTICE("You [anchored ? "" : "un"]anchor [src]."))
|
||||
queue_smooth(src)
|
||||
queue_smooth_neighbors(src)
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -146,7 +148,7 @@
|
||||
/obj/structure/lattice/catwalk/indoor/grate/attackby(obj/item/C, mob/user)
|
||||
if(C.iswelder() && damaged)
|
||||
var/obj/item/weldingtool/WT = C
|
||||
if(do_after(user, 5/C.toolspeed, act_target = src) && WT.remove_fuel(1, user))
|
||||
if(C.use_tool(src, user, 5, volume = 50) && WT.use(1, user))
|
||||
to_chat(user, SPAN_NOTICE("You slice apart the [src] leaving nothing useful behind."))
|
||||
playsound(src, 'sound/items/welder.ogg', 50, 1)
|
||||
qdel(src)
|
||||
|
||||
@@ -414,23 +414,21 @@
|
||||
|
||||
/obj/structure/device/piano/attackby(obj/item/O as obj, mob/user as mob)
|
||||
if (O.iswrench())
|
||||
if (anchored)
|
||||
playsound(src.loc, 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))
|
||||
if(anchored)
|
||||
to_chat(user, SPAN_NOTICE("You begin to loosen \the [src]'s casters..."))
|
||||
if(O.use_tool(src, user, 40, volume = 50))
|
||||
user.visible_message( \
|
||||
"[user] loosens \the [src]'s casters.", \
|
||||
"<span class='notice'>You have loosened \the [src]. Now it can be pulled somewhere else.</span>", \
|
||||
"You hear ratchet.")
|
||||
src.anchored = 0
|
||||
SPAN_NOTICE("[user] loosens \the [src]'s casters."), \
|
||||
SPAN_NOTICE("You have loosened \the [src]. Now it can be pulled somewhere else."), \
|
||||
"You hear a ratchet.")
|
||||
src.anchored = FALSE
|
||||
else
|
||||
playsound(src.loc, 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))
|
||||
to_chat(user, SPAN_NOTICE("You begin to tighten \the [src] to the floor..."))
|
||||
if(O.use_tool(src, user, 20, volume = 50))
|
||||
user.visible_message( \
|
||||
"[user] tightens \the [src]'s casters.", \
|
||||
"<span class='notice'>You have tightened \the [src]'s casters. Now it can be played again</span>.", \
|
||||
"You hear ratchet.")
|
||||
src.anchored = 1
|
||||
SPAN_NOTICE("[user] tightens \the [src]'s casters."), \
|
||||
SPAN_NOTICE("You have tightened \the [src]'s casters. Now it can be played again"), \
|
||||
"You hear a ratchet.")
|
||||
src.anchored = TRUE
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/obj/structure/pit/attackby(obj/item/W, mob/user)
|
||||
if(istype(W,/obj/item/shovel))
|
||||
visible_message("<span class='notice'>\The [user] starts [open ? "filling" : "digging open"] \the [src]</span>")
|
||||
if(do_after(user, 50))
|
||||
if(W.use_tool(src, user, 50, volume = 50))
|
||||
visible_message("<span class='notice'>\The [user] [open ? "fills" : "digs open"] \the [src]!</span>")
|
||||
if(open)
|
||||
close(user)
|
||||
|
||||
@@ -58,10 +58,9 @@
|
||||
manipulating = TRUE
|
||||
visible_message(SPAN_NOTICE("[user] begins cutting down \the [src]."),
|
||||
SPAN_NOTICE("You begin cutting down \the [src]."))
|
||||
if(!do_after(user, 30/W.toolspeed))
|
||||
if(!W.use_tool(src, user, 30, volume = 50))
|
||||
manipulating = FALSE
|
||||
return
|
||||
playsound(src.loc, 'sound/items/wirecutter.ogg', 50, 1)
|
||||
visible_message(SPAN_NOTICE("[user] cuts down \the [src]."), SPAN_NOTICE("You cut down \the [src]."))
|
||||
dismantle()
|
||||
|
||||
|
||||
@@ -224,9 +224,8 @@
|
||||
// Dismantle
|
||||
if(W.iswrench())
|
||||
if(!anchored)
|
||||
playsound(get_turf(src), W.usesound, 50, TRUE)
|
||||
user.visible_message(SPAN_NOTICE("\The [user] starts dismantling \the [src]..."), SPAN_NOTICE("You start dismantling \the [src]..."))
|
||||
if(do_after(user, 20, src))
|
||||
if(W.use_tool(src, user, 20, volume = 50))
|
||||
if(anchored)
|
||||
return
|
||||
user.visible_message(SPAN_NOTICE("\The [user] dismantles \the [src]."), SPAN_NOTICE("You dismantle \the [src]."))
|
||||
|
||||
@@ -241,9 +241,8 @@
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bed/dismantle(obj/item/W, mob/user)
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
user.visible_message("<b>[user]</b> begins dismantling \the [src].", SPAN_NOTICE("You begin dismantling \the [src]."))
|
||||
if(do_after(user, 20 / W.toolspeed))
|
||||
if(W.use_tool(src, user, 20, volume = 50))
|
||||
user.visible_message("\The [user] dismantles \the [src].", SPAN_NOTICE("You dismantle \the [src]."))
|
||||
if(padding_material)
|
||||
padding_material.place_sheet(get_turf(src))
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
if(I.iscrowbar())
|
||||
to_chat(user, SPAN_NOTICE("You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]."))
|
||||
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
|
||||
if(do_after(user, 30/I.toolspeed))
|
||||
if(I.use_tool(src, user, 30, volume = 0))
|
||||
user.visible_message(SPAN_NOTICE("[user] [cistern ? "replaces the lid on the cistern" : "lifts the lid off the cistern"]!"), SPAN_NOTICE("You [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]!"), "You hear grinding porcelain.")
|
||||
cistern = !cistern
|
||||
update_icon()
|
||||
@@ -176,8 +176,7 @@
|
||||
if(I.iswrench())
|
||||
var/newtemp = input(user, "What setting would you like to set the temperature valve to?", "Water Temperature Valve") in temperature_settings
|
||||
to_chat(user, SPAN_NOTICE("You begin to adjust the temperature valve with \the [I]."))
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
if(do_after(user, 50/I.toolspeed))
|
||||
if(I.use_tool(src, user, 50, volume = 50))
|
||||
watertemp = newtemp
|
||||
user.visible_message(SPAN_NOTICE("[user] adjusts the shower with \the [I]."), SPAN_NOTICE("You adjust the shower with \the [I]."))
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -70,13 +70,13 @@ obj/structure/windoor_assembly/Destroy()
|
||||
//I really should have spread this out across more states but thin little windoors are hard to sprite.
|
||||
switch(state)
|
||||
if("01")
|
||||
if(W.iswelder() && !anchored )
|
||||
if(W.iswelder() && !anchored)
|
||||
var/obj/item/weldingtool/WT = W
|
||||
if (WT.remove_fuel(0,user))
|
||||
if (WT.use(0,user))
|
||||
user.visible_message("[user] dissassembles the windoor assembly.", "You start to dissassemble the windoor assembly.")
|
||||
playsound(src.loc, 'sound/items/welder_pry.ogg', 50, 1)
|
||||
|
||||
if(do_after(user, 40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src || !WT.isOn()) return
|
||||
to_chat(user, "<span class='notice'>You dissasembled the windoor assembly!</span>")
|
||||
new /obj/item/stack/material/glass/reinforced(get_turf(src), 5)
|
||||
@@ -89,10 +89,9 @@ obj/structure/windoor_assembly/Destroy()
|
||||
|
||||
//Wrenching an unsecure assembly anchors it in place. Step 4 complete
|
||||
if(W.iswrench() && !anchored)
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor.")
|
||||
|
||||
if(do_after(user, 40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='notice'>You've secured the windoor assembly!</span>")
|
||||
src.anchored = 1
|
||||
@@ -103,10 +102,9 @@ obj/structure/windoor_assembly/Destroy()
|
||||
|
||||
//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
|
||||
else if(W.iswrench() && anchored)
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
user.visible_message("[user] unsecures the windoor assembly to the floor.", "You start to unsecure the windoor assembly to the floor.")
|
||||
|
||||
if(do_after(user, 40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='notice'>You've unsecured the windoor assembly!</span>")
|
||||
src.anchored = 0
|
||||
@@ -123,7 +121,7 @@ obj/structure/windoor_assembly/Destroy()
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start to reinforce the windoor with rods.</span>")
|
||||
|
||||
if(do_after(user,40/W.toolspeed) && !secure)
|
||||
if(W.use_tool(src, user, 40, volume = 50) && !secure)
|
||||
if (R.use(4))
|
||||
to_chat(user, "<span class='notice'>You reinforce the windoor.</span>")
|
||||
src.secure = "secure_"
|
||||
@@ -137,7 +135,7 @@ obj/structure/windoor_assembly/Destroy()
|
||||
user.visible_message("[user] wires the windoor assembly.", "You start to wire the windoor assembly.")
|
||||
|
||||
var/obj/item/stack/cable_coil/CC = W
|
||||
if(do_after(user, 40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if (CC.use(1))
|
||||
to_chat(user, "<span class='notice'>You wire the windoor!</span>")
|
||||
src.state = "02"
|
||||
@@ -155,7 +153,7 @@ obj/structure/windoor_assembly/Destroy()
|
||||
playsound(src.loc, 'sound/items/wirecutter.ogg', 100, 1)
|
||||
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
|
||||
|
||||
if(do_after(user, 40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src) return
|
||||
|
||||
to_chat(user, "<span class='notice'>You cut the windoor wires.!</span>")
|
||||
@@ -185,10 +183,9 @@ obj/structure/windoor_assembly/Destroy()
|
||||
|
||||
//Screwdriver to remove airlock electronics. Step 6 undone.
|
||||
else if(W.isscrewdriver() && src.electronics)
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to uninstall electronics from the airlock assembly.")
|
||||
|
||||
if(do_after(user, 40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
if(!src || !src.electronics) return
|
||||
to_chat(user, "<span class='notice'>You've removed the airlock electronics!</span>")
|
||||
if(src.secure)
|
||||
@@ -205,10 +202,9 @@ obj/structure/windoor_assembly/Destroy()
|
||||
to_chat(usr, "<span class='warning'>The assembly is missing electronics.</span>")
|
||||
return
|
||||
usr << browse(null, "window=windoor_access")
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
user.visible_message("[user] pries the windoor into the frame.", "You start prying the windoor into the frame.")
|
||||
|
||||
if(do_after(user, 40/W.toolspeed))
|
||||
if(W.use_tool(src, user, 40, volume = 50))
|
||||
|
||||
if(!src) return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user