From 7c2407b3eeee9ebd3609eff63ea547bd77223729 Mon Sep 17 00:00:00 2001 From: "Wowzewow (Wezzy)" <42310821+alsoandanswer@users.noreply.github.com> Date: Sun, 2 Feb 2020 06:10:56 +0800 Subject: [PATCH] Welding sound tweak (#8129) Welding also now plays a sound once you've finished welding --- .../components/unary/vent_pump.dm | 38 ++++--- .../components/unary/vent_scrubber.dm | 39 ++++---- code/game/machinery/doors/airlock.dm | 98 +++++++++---------- html/changelogs/wezzy_weldsound.yml | 41 ++++++++ 4 files changed, 126 insertions(+), 90 deletions(-) create mode 100644 html/changelogs/wezzy_weldsound.yml diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 044ee2ae0a8..97edf465885 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -348,24 +348,22 @@ if(W.iswelder()) var/obj/item/weldingtool/WT = W if (!WT.welding) - to_chat(user, "\The [WT] must be turned on!") + to_chat(user, span("danger", "\The [WT] must be turned on!")) else if (WT.remove_fuel(0,user)) - to_chat(user, "Now welding the vent.") + to_chat(user, span("notice", "Now welding the vent.")) if(do_after(user, 30/W.toolspeed)) - if(!src || !WT.isOn()) return - playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) - if(!welded) - user.visible_message("\The [user] welds \the [src] shut.", "You weld \the [src] shut.", "You hear welding.") - welded = 1 - update_icon() - else - user.visible_message("[user] unwelds \the [src].", "You unweld \the [src].", "You hear welding.") - welded = 0 - update_icon() + if(!src || !WT.isOn()) + return + welded = !welded + update_icon() + playsound(src, 'sound/items/Welder2.ogg', 50, 1) + user.visible_message(span("notice", "\The [user] [welded ? "welds \the [src] shut" : "unwelds \the [src]"]."), \ + span("notice", "You [welded ? "weld \the [src] shut" : "unweld \the [src]"]."), \ + "You hear welding.") else - to_chat(user, "You fail to complete the welding.") + to_chat(user, span("notice", "You fail to complete the welding.")) else - to_chat(user, "You need more welding fuel to complete this task.") + to_chat(user, span("warning", "You need more welding fuel to complete this task.")) return 1 else ..() @@ -388,24 +386,24 @@ if (!W.iswrench()) return ..() if (!(stat & NOPOWER) && use_power) - to_chat(user, "You cannot unwrench \the [src], turn it off first.") + to_chat(user, span("warning", "You cannot unwrench \the [src], turn it off first.")) return 1 var/turf/T = src.loc if (node && node.level==1 && isturf(T) && !T.is_plating()) - to_chat(user, "You must remove the plating first.") + to_chat(user, span("warning", "You must remove the plating first.")) return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - to_chat(user, "You cannot unwrench \the [src], it is too exerted due to internal pressure.") + to_chat(user, span("warning", "You cannot unwrench \the [src], it is too exerted due to internal pressure.")) add_fingerprint(user) return 1 playsound(src.loc, W.usesound, 50, 1) - to_chat(user, "You begin to unfasten \the [src]...") + to_chat(user, span("notice", "You begin to unfasten \the [src]...")) if (do_after(user, 40/W.toolspeed)) user.visible_message( \ - "\The [user] unfastens \the [src].", \ - "You have unfastened \the [src].", \ + span("notice", "\The [user] unfastens \the [src]."), \ + span("notice", "You have unfastened \the [src]."), \ "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) qdel(src) diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index 0094ef4e735..b4d316c60aa 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -259,24 +259,24 @@ /obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/W as obj, var/mob/user as mob) if (W.iswrench()) if (!(stat & NOPOWER) && use_power) - to_chat(user, "You cannot unwrench \the [src], turn it off first.") + to_chat(user, span("warning", "You cannot unwrench \the [src], turn it off first.")) return 1 var/turf/T = src.loc if (node && node.level==1 && isturf(T) && !T.is_plating()) - to_chat(user, "You must remove the plating first.") + to_chat(user, span("warning", "You must remove the plating first.")) return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - to_chat(user, "You cannot unwrench \the [src], it is too exerted due to internal pressure.") + to_chat(user, span("warning", "You cannot unwrench \the [src], it is too exerted due to internal pressure.")) add_fingerprint(user) return 1 playsound(src.loc, W.usesound, 50, 1) - to_chat(user, "You begin to unfasten \the [src]...") + to_chat(user, span("notice", "You begin to unfasten \the [src]...")) if (do_after(user, 40/W.toolspeed, act_target = src)) user.visible_message( \ - "\The [user] unfastens \the [src].", \ - "You have unfastened \the [src].", \ + span("notice", "\The [user] unfastens \the [src]."), \ + span("notice", "You have unfastened \the [src]."), \ "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) qdel(src) @@ -285,24 +285,23 @@ if(W.iswelder()) var/obj/item/weldingtool/WT = W if (!WT.welding) - to_chat(user, "\The [WT] must be turned on!") + to_chat(user, span("danger", "\The [WT] must be turned on!")) else if (WT.remove_fuel(0,user)) - to_chat(user, "Now welding \the [src].") + to_chat(user, span("notice", "Now welding \the [src].")) + playsound(src, 'sound/items/Welder.ogg', 50, 1) if(do_after(user, 20/W.toolspeed, act_target = src)) - if(!src || !WT.isOn()) return - playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) - if(!welded) - user.visible_message("\The [user] welds \the [src] shut.", "You weld \the [src] shut.", "You hear welding.") - welded = 1 - update_icon() - else - user.visible_message("[user] unwelds \the [src].", "You unweld \the [src].", "You hear welding.") - welded = 0 - update_icon() + if(!src || !WT.isOn()) + return + welded = !welded + update_icon() + playsound(src, 'sound/items/Welder2.ogg', 50, 1) + user.visible_message(span("notice", "\The [user] [welded ? "welds \the [src] shut" : "unwelds \the [src]"]."), \ + span("notice", "You [welded ? "weld \the [src] shut" : "unweld \the [src]"]."), \ + "You hear welding.") else - to_chat(user, "You fail to complete the welding.") + to_chat(user, span("notice", "You fail to complete the welding.")) else - to_chat(user, "You need more welding fuel to complete this task.") + to_chat(user, span("warning", "You need more welding fuel to complete this task.")) return 1 return ..() diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 18f3cd0fff4..4741d8eb146 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -63,13 +63,13 @@ if(stat & (BROKEN|NOPOWER)) if(damage >= 10) if(src.density) - visible_message("\The [user] forces \the [src] open!") + visible_message(span("danger", "\The [user] forces \the [src] open!")) open(1) else - visible_message("\The [user] forces \the [src] closed!") + visible_message(span("danger", "\The [user] forces \the [src] closed!")) close(1) else - visible_message("\The [user] strains fruitlessly to force \the [src] [density ? "open" : "closed"].") + visible_message(span("notice", "\The [user] strains fruitlessly to force \the [src] [density ? "open" : "closed"].")) return ..() @@ -462,7 +462,7 @@ About the new airlock wires panel: else /*if(src.justzap)*/ return else if(user.hallucination > 50 && prob(10) && src.operating == 0 && !user.is_diona() && !user.isSynthetic()) - to_chat(user, "You feel a powerful shock course through your body!") + to_chat(user, span("danger", "You feel a powerful shock course through your body!")) user.adjustHalLoss(10) user.stunned += 10 return @@ -787,14 +787,14 @@ About the new airlock wires panel: if(prob(40) && src.density) playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) if(!istype(H.head, /obj/item/clothing/head/helmet)) - user.visible_message("[user] headbutts the airlock.") + user.visible_message(span("warning", "[user] headbutts the airlock.")) var/obj/item/organ/external/affecting = H.get_organ(BP_HEAD) H.Stun(8) H.Weaken(5) if(affecting.take_damage(10, 0)) H.UpdateDamageIcon() else - user.visible_message("[user] headbutts the airlock. Good thing they're wearing a helmet.") + user.visible_message(span("warning", "[user] headbutts the airlock. Good thing they're wearing a helmet.")) return if(H.species.can_shred(H)) @@ -906,16 +906,16 @@ About the new airlock wires panel: /obj/machinery/door/airlock/CanUseTopic(var/mob/user) if(operating < 0) //emagged - to_chat(user, "Unable to interface: Internal error.") + to_chat(user, span("warning", "Unable to interface: Internal error.")) return STATUS_CLOSE if(issilicon(user) && !src.canAIControl()) if(src.canAIHack(user)) src.hack(user) else if (src.isAllPowerLoss()) //don't really like how this gets checked a second time, but not sure how else to do it. - to_chat(user, "Unable to interface: Connection timed out.") + to_chat(user, span("warning", "Unable to interface: Connection timed out.")) else - to_chat(user, "Unable to interface: Connection refused.") + to_chat(user, span("warning", "Unable to interface: Connection refused.")) return STATUS_CLOSE return ..() @@ -1022,7 +1022,7 @@ About the new airlock wires panel: return if (istype(C, /obj/item/device/magnetic_lock)) if (bracer) - to_chat(user, "There is already a [bracer] on [src]!") + to_chat(user, span("notice", "There is already a [bracer] on [src]!")) return var/obj/item/device/magnetic_lock/newbracer = C newbracer.attachto(src, user) @@ -1031,28 +1031,26 @@ About the new airlock wires panel: var/obj/item/weldingtool/WT = C if(WT.isOn()) user.visible_message( - "[user] begins welding [src] [welded ? "open" : "shut"].", - "You begin welding [src] [welded ? "open" : "shut"].", + span("warning", "[user] begins welding [src] [welded ? "open" : "shut"]."), + span("notice", "You begin welding [src] [welded ? "open" : "shut"]."), "You hear a welding torch on metal." ) - playsound(loc, 'sound/items/Welder.ogg', 50, 1) + playsound(src, 'sound/items/Welder.ogg', 50, 1) if (!do_after(user, 2/C.toolspeed SECONDS, act_target = src, extra_checks = CALLBACK(src, .proc/is_open, src.density))) return if(!WT.remove_fuel(0,user)) - to_chat(user, "You need more welding fuel to complete this task.") + to_chat(user, span("notice", "You need more welding fuel to complete this task.")) return - if(!src.welded) - src.welded = 1 - else - src.welded = null - src.update_icon() + playsound(src, 'sound/items/Welder2.ogg', 50, 1) + welded = !welded + update_icon() return else return else if(C.isscrewdriver()) if (src.p_open) if (stat & BROKEN) - to_chat(usr, "The panel is broken and cannot be closed.") + to_chat(usr, span("warning", "The panel is broken and cannot be closed.")) else src.p_open = 0 else @@ -1077,13 +1075,13 @@ About the new airlock wires panel: playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.") if(do_after(user,40/C.toolspeed)) - to_chat(user, "You removed the airlock electronics!") + to_chat(user, span("notice", "You removed the airlock electronics!")) CreateAssembly() return else if(arePowerSystemsOn()) - to_chat(user, "The airlock's motors resist your efforts to force it.") + to_chat(user, span("notice", "The airlock's motors resist your efforts to force it.")) else if(locked) - to_chat(user, "The airlock's bolts prevent it from being forced.") + to_chat(user, span("notice", "The airlock's bolts prevent it from being forced.")) else if(density) open(1) @@ -1091,7 +1089,7 @@ About the new airlock wires panel: close(1) else if(istype(C, /obj/item/material/twohanded/fireaxe) && !arePowerSystemsOn()) if(locked && user.a_intent != I_HURT) - to_chat(user, "The airlock's bolts prevent it from being forced.") + to_chat(user, span("notice", "The airlock's bolts prevent it from being forced.")) else if(locked && user.a_intent == I_HURT) ..() else if(!welded && !operating) @@ -1100,16 +1098,16 @@ About the new airlock wires panel: if(F.wielded) open(1) else - to_chat(user, "You need to be wielding \the [C] to do that.") + to_chat(user, span("warning", "You need to be wielding \the [C] to do that.")) else var/obj/item/material/twohanded/fireaxe/F = C if(F.wielded) close(1) else - to_chat(user, "You need to be wielding \the [C] to do that.") + to_chat(user, span("warning", "You need to be wielding \the [C] to do that.")) else if(istype(C, /obj/item/melee/hammer) && !arePowerSystemsOn()) if(locked && user.a_intent != I_HURT) - to_chat(user, "The airlock's bolts prevent it from being forced.") + to_chat(user, span("notice", "The airlock's bolts prevent it from being forced.")) else if(locked && user.a_intent == I_HURT) ..() else if(!welded && !operating) @@ -1120,25 +1118,25 @@ About the new airlock wires panel: else if(density && istype(C, /obj/item/material/twohanded/chainsaw)) var/obj/item/material/twohanded/chainsaw/ChainSawVar = C if(!ChainSawVar.wielded) - to_chat(user, "Cutting the airlock requires the strength of two hands.") + to_chat(user, span("notice", "Cutting the airlock requires the strength of two hands.")) else if(ChainSawVar.cutting) - to_chat(user, "You are already cutting an airlock open.") + to_chat(user, span("notice", "You are already cutting an airlock open.")) else if(!ChainSawVar.powered) - to_chat(user, "The [C] needs to be on in order to open this door.") + to_chat(user, span("notice", "The [C] needs to be on in order to open this door.")) else if(bracer) //Has a magnetic lock - to_chat(user, "The bracer needs to be removed in order to cut through this door.") + to_chat(user, span("notice", "The bracer needs to be removed in order to cut through this door.")) else if(!arePowerSystemsOn()) ChainSawVar.cutting = 1 user.visible_message(\ - "[user.name] starts cutting the control pannel of the airlock with the [C]!",\ - "You start cutting the airlock control panel...",\ - "You hear a loud buzzing sound and metal grinding on metal..."\ + span("danger", "[user.name] starts cutting the control pannel of the airlock with the [C]!"),\ + span("warning", "You start cutting the airlock control panel..."),\ + span("notice", "You hear a loud buzzing sound and metal grinding on metal...")\ ) if(do_after(user, ChainSawVar.opendelay SECONDS, act_target = user, extra_checks = CALLBACK(src, .proc/CanChainsaw, C))) user.visible_message(\ - "[user.name] finishes cutting the control pannel of the airlock with the [C].",\ - "You finish cutting the airlock control panel.",\ - "You hear a metal clank and some sparks."\ + span("warning", "[user.name] finishes cutting the control pannel of the airlock with the [C]."),\ + span("warning", "You finish cutting the airlock control panel."),\ + span("notice", "You hear a metal clank and some sparks.")\ ) set_broken() sleep(1 SECONDS) @@ -1148,15 +1146,15 @@ About the new airlock wires panel: else if(locked) ChainSawVar.cutting = 1 user.visible_message(\ - "[user.name] starts cutting below the airlock with the [C]!",\ - "You start cutting below the airlock...",\ - "You hear a loud buzzing sound and metal grinding on metal..."\ + span("danger", "[user.name] starts cutting below the airlock with the [C]!"),\ + span("warning", "You start cutting below the airlock..."),\ + span("notice", "You hear a loud buzzing sound and metal grinding on metal...")\ ) if(do_after(user, ChainSawVar.opendelay SECONDS, act_target = user, extra_checks = CALLBACK(src, .proc/CanChainsaw, C))) user.visible_message(\ - "[user.name] finishes cutting below the airlock with the [C].",\ - "You finish cutting below the airlock.",\ - "You hear a metal clank and some sparks."\ + span("warning", "[user.name] finishes cutting below the airlock with the [C]."),\ + span("notice", "You finish cutting below the airlock."),\ + span("notice", "You hear a metal clank and some sparks.")\ ) unlock(1) ChainSawVar.cutting = 0 @@ -1164,15 +1162,15 @@ About the new airlock wires panel: else ChainSawVar.cutting = 1 user.visible_message(\ - "[user.name] starts cutting between the airlock with the [C]!",\ - "You start cutting between the airlock...",\ - "You hear a loud buzzing sound and metal grinding on metal..."\ + span("danger", "[user.name] starts cutting between the airlock with the [C]!"),\ + span("warning", "You start cutting between the airlock..."),\ + span("notice", "You hear a loud buzzing sound and metal grinding on metal...")\ ) if(do_after(user, ChainSawVar.opendelay SECONDS, act_target = user, extra_checks = CALLBACK(src, .proc/CanChainsaw, C))) user.visible_message(\ - "[user.name] finishes cutting between the airlock.",\ - "You finish cutting between the airlock.",\ - "You hear a metal clank and some sparks."\ + span("warning", "[user.name] finishes cutting between the airlock."),\ + span("warning", "You finish cutting between the airlock."),\ + span("notice", "You hear a metal clank and some sparks.")\ ) open(1) take_damage(50) @@ -1222,7 +1220,7 @@ About the new airlock wires panel: return 0 if (bracer) do_animate("braced") - visible_message("[src]'s actuators whirr, but the door does not open.") + visible_message(span("warning", "[src]'s actuators whirr, but the door does not open.")) return 0 if(locked || welded) return 0 diff --git a/html/changelogs/wezzy_weldsound.yml b/html/changelogs/wezzy_weldsound.yml new file mode 100644 index 00000000000..ca3cb394404 --- /dev/null +++ b/html/changelogs/wezzy_weldsound.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Wowzewow (Wezzy) + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: Tweaked welding sounds on airlocks and vents. Now after welding you should hear a second sound when you end your action. \ No newline at end of file