mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-27 06:00:23 +01:00
Alter playsound paradigm
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
|
||||
|
||||
/obj/machinery/power/am_control_unit/proc/produce_power()
|
||||
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
|
||||
playsound(src, 'sound/effects/bang.ogg', 25, 1)
|
||||
var/core_power = reported_core_efficiency//Effectively how much fuel we can safely deal with
|
||||
if(core_power <= 0) return 0//Something is wrong
|
||||
var/core_damage = 0
|
||||
@@ -85,7 +85,7 @@
|
||||
for(var/obj/machinery/am_shielding/AMS in linked_cores)
|
||||
AMS.stability -= core_damage
|
||||
AMS.check_stability(1)
|
||||
playsound(src.loc, 'sound/effects/bang.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/bang.ogg', 50, 1)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -531,12 +531,12 @@ GLOBAL_LIST_EMPTY(apcs)
|
||||
if (has_electronics==1 && terminal)
|
||||
has_electronics = 2
|
||||
stat &= ~MAINT
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "You screw the circuit electronics into place.")
|
||||
else if (has_electronics==2)
|
||||
has_electronics = 1
|
||||
stat |= MAINT
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "You unfasten the electronics.")
|
||||
else /* has_electronics==0 */
|
||||
to_chat(user, "<span class='warning'>There is nothing to secure.</span>")
|
||||
@@ -562,7 +562,7 @@ GLOBAL_LIST_EMPTY(apcs)
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user.name] adds cables to the APC frame.</span>", \
|
||||
"You start adding cables to the APC frame...")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (C.amount >= 10 && !terminal && opened && has_electronics != 2)
|
||||
var/obj/structure/cable/N = T.get_cable_node()
|
||||
@@ -585,7 +585,7 @@ GLOBAL_LIST_EMPTY(apcs)
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user.name] starts dismantling the [src]'s power terminal.</span>", \
|
||||
"You begin to cut the cables...")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 50 * W.toolspeed))
|
||||
if(terminal && opened && has_electronics!=2)
|
||||
if (prob(50) && electrocute_mob(usr, terminal.powernet, terminal))
|
||||
@@ -600,7 +600,7 @@ GLOBAL_LIST_EMPTY(apcs)
|
||||
else if (istype(W, /obj/item/weapon/module/power_control) && opened && has_electronics==0 && !((stat & BROKEN)))
|
||||
user.visible_message("<span class='warning'>[user.name] inserts the power control board into [src].</span>", \
|
||||
"You start to insert the power control board into the frame...")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 10))
|
||||
if(has_electronics==0)
|
||||
has_electronics = 1
|
||||
@@ -660,7 +660,7 @@ GLOBAL_LIST_EMPTY(apcs)
|
||||
if(do_after(user, 50))
|
||||
user.visible_message("<span class='notice'>[user.name] resets the APC with a beep from their [W.name].</span>",\
|
||||
"You finish resetting the APC.")
|
||||
playsound(src.loc, 'sound/machines/chime.ogg', 25, 1)
|
||||
playsound(src, 'sound/machines/chime.ogg', 25, 1)
|
||||
reboot()
|
||||
else
|
||||
if ((stat & BROKEN) \
|
||||
@@ -746,7 +746,7 @@ GLOBAL_LIST_EMPTY(apcs)
|
||||
if(H.species.can_shred(H))
|
||||
user.setClickCooldown(user.get_attack_speed())
|
||||
user.visible_message("<span call='warning'>[user.name] slashes at the [src.name]!</span>", "<span class='notice'>You slash at the [src.name]!</span>")
|
||||
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
|
||||
playsound(src, 'sound/weapons/slash.ogg', 100, 1)
|
||||
|
||||
var/allcut = wires.IsAllCut()
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ GLOBAL_LIST_EMPTY(gravity_generators)
|
||||
if(PS.get_amount() >= 10)
|
||||
PS.use(10)
|
||||
to_chat(user, "<span class='notice'>You add the plating to the framework.</span>")
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 75, 1)
|
||||
playsound(src, 'sound/machines/click.ogg', 75, 1)
|
||||
broken_state++
|
||||
update_icon()
|
||||
else
|
||||
@@ -351,7 +351,7 @@ GLOBAL_LIST_EMPTY(gravity_generators)
|
||||
charge_count -= 2
|
||||
|
||||
if(charge_count % 4 == 0 && prob(75)) // Let them know it is charging/discharging.
|
||||
playsound(src.loc, 'sound/effects/empulse.ogg', 100, 1)
|
||||
playsound(src, 'sound/effects/empulse.ogg', 100, 1)
|
||||
|
||||
updateDialog()
|
||||
if(prob(25)) // To help stop "Your clothes feel warm." spam.
|
||||
|
||||
@@ -112,7 +112,7 @@ var/global/list/light_type_cache = list()
|
||||
new /obj/item/stack/material/steel( get_turf(src.loc), sheets_refunded )
|
||||
user.visible_message("[user.name] deconstructs [src].", \
|
||||
"You deconstruct [src].", "You hear a noise.")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 75, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 75, 1)
|
||||
qdel(src)
|
||||
if (src.stage == 2)
|
||||
to_chat(usr, "You have to remove the wires first.")
|
||||
@@ -129,7 +129,7 @@ var/global/list/light_type_cache = list()
|
||||
new /obj/item/stack/cable_coil(get_turf(src.loc), 1, "red")
|
||||
user.visible_message("[user.name] removes the wiring from [src].", \
|
||||
"You remove the wiring from [src].", "You hear a noise.")
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/stack/cable_coil))
|
||||
@@ -421,7 +421,7 @@ var/global/list/light_type_cache = list()
|
||||
if(!on)
|
||||
needsound = TRUE // Play sound next time we turn on
|
||||
else if(needsound)
|
||||
playsound(src.loc, 'sound/effects/lighton.ogg', 65, 1)
|
||||
playsound(src, 'sound/effects/lighton.ogg', 65, 1)
|
||||
needsound = FALSE // Don't play sound again until we've been turned off
|
||||
//VOREStation Edit End
|
||||
|
||||
@@ -800,7 +800,7 @@ var/global/list/light_type_cache = list()
|
||||
|
||||
if(!skip_sound_and_sparks)
|
||||
if(status == LIGHT_OK || status == LIGHT_BURNED)
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
if(on)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
@@ -1021,7 +1021,7 @@ var/global/list/light_type_cache = list()
|
||||
status = LIGHT_BROKEN
|
||||
force = 5
|
||||
sharp = 1
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
update_icon()
|
||||
|
||||
//Lamp Shade
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/light_switch/dismantle()
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
var/obj/structure/construction/lightswitch/A = new(src.loc, src.dir)
|
||||
A.stage = FRAME_WIRED
|
||||
A.pixel_x = pixel_x
|
||||
@@ -89,7 +89,7 @@
|
||||
if(!WT.remove_fuel(0, user))
|
||||
to_chat(user, "<span class='warning'>\The [src] must be on to complete this task.</span>")
|
||||
return
|
||||
playsound(src.loc, WT.usesound, 50, 1)
|
||||
playsound(src, WT.usesound, 50, 1)
|
||||
user.visible_message( \
|
||||
"<span class='warning'>\The [user] begins deconstructing \the [src].</span>", \
|
||||
"<span class='notice'>You start deconstructing \the [src].</span>")
|
||||
@@ -98,7 +98,7 @@
|
||||
user.visible_message( \
|
||||
"<span class='warning'>\The [user] has deconstructed \the [src].</span>", \
|
||||
"<span class='notice'>You deconstruct \the [src].</span>")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 75, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 75, 1)
|
||||
qdel(src)
|
||||
else if (stage == FRAME_FASTENED)
|
||||
to_chat(user, "You have to unscrew the case first.")
|
||||
@@ -113,7 +113,7 @@
|
||||
new /obj/item/stack/cable_coil(get_turf(src), 1, "red")
|
||||
user.visible_message("\The [user] removes the wiring from \the [src].", \
|
||||
"You remove the wiring from \the [src].", "You hear a snip.")
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
user.update_examine_panel(src)
|
||||
user.visible_message("\The [user] adds wires to \the [src].", \
|
||||
"You add wires to \the [src].", "You hear a noise.")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
else if(!active)
|
||||
if(O.is_wrench())
|
||||
anchored = !anchored
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(anchored)
|
||||
to_chat(user, "<font color='blue'>You secure the generator to the floor.</font>")
|
||||
else
|
||||
@@ -80,13 +80,13 @@
|
||||
SSmachines.makepowernets()
|
||||
else if(O.is_screwdriver())
|
||||
open = !open
|
||||
playsound(loc, O.usesound, 50, 1)
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
if(open)
|
||||
to_chat(user, "<font color='blue'>You open the access panel.</font>")
|
||||
else
|
||||
to_chat(user, "<font color='blue'>You close the access panel.</font>")
|
||||
else if(O.is_crowbar() && !open)
|
||||
playsound(loc, O.usesound, 50, 1)
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/new_frame = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
for(var/obj/item/I in component_parts)
|
||||
I.loc = src.loc
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
else
|
||||
disconnect_from_network()
|
||||
to_chat(user, "<span class='notice'>You unsecure the generator from the floor.</span>")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
anchored = !anchored
|
||||
return
|
||||
else if(default_deconstruction_screwdriver(user, O))
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
going_kaboom = TRUE
|
||||
visible_message("<span class='danger'>\The [src] lets out an shower of sparks as it starts to lose stability!</span>",\
|
||||
"<span class='italics'>You hear a loud electrical crack!</span>")
|
||||
playsound(src.loc, 'sound/effects/lightningshock.ogg', 100, 1, extrarange = 5)
|
||||
playsound(src, 'sound/effects/lightningshock.ogg', 100, 1, extrarange = 5)
|
||||
tesla_zap(src, 5, power_gen * 0.05)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/explosion, get_turf(src), 2, 3, 4, 8), 100) // Not a normal explosion.
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
var/burst_time = (min_burst_delay + max_burst_delay)/2 + 2*(burst_shots-1)
|
||||
var/power_per_shot = active_power_usage * (burst_time/10) / burst_shots
|
||||
|
||||
playsound(src.loc, 'sound/weapons/emitter.ogg', 25, 1)
|
||||
playsound(src, 'sound/weapons/emitter.ogg', 25, 1)
|
||||
if(prob(35))
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
@@ -181,7 +181,7 @@
|
||||
to_chat(user, "<span class='warning'>\The [src] needs to be wrenched to the floor.</span>")
|
||||
if(1)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(loc, WT.usesound, 50, 1)
|
||||
playsound(src, WT.usesound, 50, 1)
|
||||
user.visible_message("[user.name] starts to weld [src] to the floor.", \
|
||||
"You start to weld [src] to the floor.", \
|
||||
"You hear welding")
|
||||
@@ -194,7 +194,7 @@
|
||||
to_chat(user, "<span class='warning'>You need more welding fuel to complete this task.</span>")
|
||||
if(2)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(loc, WT.usesound, 50, 1)
|
||||
playsound(src, WT.usesound, 50, 1)
|
||||
user.visible_message("[user.name] starts to cut [src] free from the floor.", \
|
||||
"You start to cut [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
|
||||
@@ -130,7 +130,7 @@ field_generator power level display
|
||||
return
|
||||
if(1)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(loc, WT.usesound, 50, 1)
|
||||
playsound(src, WT.usesound, 50, 1)
|
||||
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
@@ -142,7 +142,7 @@ field_generator power level display
|
||||
return
|
||||
if(2)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(loc, WT.usesound, 50, 1)
|
||||
playsound(src, WT.usesound, 50, 1)
|
||||
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
return
|
||||
if(W.is_screwdriver())
|
||||
panel_open = !panel_open
|
||||
playsound(loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
visible_message("<span class='notice'>\The [user] adjusts \the [src]'s mechanisms.</span>")
|
||||
if(panel_open && do_after(user, 30))
|
||||
to_chat(user, "<span class='notice'>\The [src] looks like it could be modified.</span>")
|
||||
if(panel_open && do_after(user, 80 * W.toolspeed)) // We don't have skills, so a delayed hint for engineers will have to do for now. (Panel open check for sanity)
|
||||
playsound(loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='cult'>\The [src] looks like it could be adapted to forge advanced materials via particle acceleration, somehow..</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>\The [src]'s mechanisms look secure.</span>")
|
||||
|
||||
@@ -325,7 +325,7 @@ GLOBAL_LIST_EMPTY(smeses)
|
||||
to_chat(user, "<span class='filter_notice'><span class='warning'>You must remove the floor plating first.</span></span>")
|
||||
else
|
||||
to_chat(user, "<span class='filter_notice'><span class='notice'>You begin to cut the cables...</span></span>")
|
||||
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 50 * W.toolspeed))
|
||||
if (prob(50) && electrocute_mob(usr, term.powernet, term))
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
to_chat(user, "<span class='warning'>You have to disassemble the terminal first!</span>")
|
||||
return
|
||||
|
||||
playsound(get_turf(src), W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='warning'>You begin to disassemble the [src]!</span>")
|
||||
if (do_after(usr, (100 * cur_coils) * W.toolspeed)) // More coils = takes longer to disassemble. It's complex so largest one with 5 coils will take 50s with a normal crowbar
|
||||
|
||||
|
||||
@@ -65,14 +65,14 @@ GLOBAL_LIST_EMPTY(solars_list)
|
||||
/obj/machinery/power/solar/attackby(obj/item/weapon/W, mob/user)
|
||||
|
||||
if(W.is_crowbar())
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
playsound(src, 'sound/machines/click.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] begins to take the glass off the solar panel.</span>")
|
||||
if(do_after(user, 50))
|
||||
var/obj/item/solar_assembly/S = locate() in src
|
||||
if(S)
|
||||
S.loc = src.loc
|
||||
S.give_glass()
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] takes the glass off the solar panel.</span>")
|
||||
qdel(src)
|
||||
return
|
||||
@@ -247,7 +247,7 @@ GLOBAL_LIST_EMPTY(solars_list)
|
||||
var/obj/item/stack/material/S = W
|
||||
if(S.use(2))
|
||||
glass_type = W.type
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
playsound(src, 'sound/machines/click.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] places the glass on the solar assembly.</span>")
|
||||
if(tracker)
|
||||
new /obj/machinery/power/tracker(get_turf(src), src)
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
var/power_produced = powernet ? power / power_loss : power
|
||||
add_avail(power_produced*input_power_multiplier)
|
||||
flick("coilhit", src)
|
||||
playsound(src.loc, 'sound/effects/lightningshock.ogg', 100, 1, extrarange = 5)
|
||||
playsound(src, 'sound/effects/lightningshock.ogg', 100, 1, extrarange = 5)
|
||||
tesla_zap(src, 5, power_produced)
|
||||
//addtimer(CALLBACK(src, .proc/reset_shocked), 10)
|
||||
spawn(10) reset_shocked()
|
||||
@@ -92,7 +92,7 @@
|
||||
coeff = max(coeff, 10)
|
||||
var/power = (powernet.avail/2)
|
||||
draw_power(power)
|
||||
playsound(src.loc, 'sound/effects/lightningshock.ogg', 100, 1, extrarange = 5)
|
||||
playsound(src, 'sound/effects/lightningshock.ogg', 100, 1, extrarange = 5)
|
||||
tesla_zap(src, 10, power/(coeff/2))
|
||||
|
||||
//TFF 3/6/19 - Port Cit RP fix for infinite frames
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
move_the_basket_ball(max(wait - 5, 4 + orbiting_balls.len * 1.5))
|
||||
|
||||
playsound(src.loc, 'sound/effects/lightningbolt.ogg', 100, 1, extrarange = 30)
|
||||
playsound(src, 'sound/effects/lightningbolt.ogg', 100, 1, extrarange = 30)
|
||||
|
||||
set_dir(tesla_zap(src, 7, TESLA_DEFAULT_POWER, TRUE))
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
energy_to_lower = energy_to_raise - 20
|
||||
energy_to_raise = energy_to_raise * 1.25
|
||||
|
||||
playsound(src.loc, 'sound/effects/lightning_chargeup.ogg', 100, 1, extrarange = 30)
|
||||
playsound(src, 'sound/effects/lightning_chargeup.ogg', 100, 1, extrarange = 30)
|
||||
//addtimer(CALLBACK(src, .proc/new_mini_ball), 100)
|
||||
spawn(100) new_mini_ball()
|
||||
|
||||
|
||||
@@ -60,14 +60,14 @@
|
||||
/obj/machinery/power/tracker/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
|
||||
if(W.is_crowbar())
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
playsound(src, 'sound/machines/click.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] begins to take the glass off the solar tracker.</span>")
|
||||
if(do_after(user, 50))
|
||||
var/obj/item/solar_assembly/S = locate() in src
|
||||
if(S)
|
||||
S.loc = src.loc
|
||||
S.give_glass()
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] takes the glass off the tracker.</span>")
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user