mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 06:22:26 +01:00
Ported the Microlathe from Bay, and began autolathe refactor: Take II (#21668)
Continued from #19839 > Part 1 of a refactor to try and make our various fabricators use the same system and basic code. This adds the microlathe as a proof of concept to the whole refactor, ported from Baystation. Currently not mapped anywhere. > This also ports over Nebula's autolathe working sound, however it is adapted to fit our code. As such, I went to the original sound and re-cut it, now including start and stop sounds. Plan is overall to make it much easier to add new types of fabricators. ### Asset Licenses The following assets that **have not** been created by myself are included in this PR: | Path | Original Author | License | | --- | --- | --- | | icons/obj/machinery/fabricators/microlathe.dmi | [BloodyMan](https://github.com/BloodyMan) (Baystation 12) | CC-BY-SA | | sound/machines/fabricators/autolathe/ | [pencilina](https://freesound.org/people/pencilina/) | CC-0 | --------- Co-authored-by: Cody Brittain <cbrittain10@live.com>
This commit is contained in:
co-authored by
Cody Brittain
parent
5e69ccbd6a
commit
ccbfbdc50a
@@ -114,6 +114,51 @@
|
||||
mid_length = 5 SECONDS
|
||||
volume = 75
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// FABRICATORS AND SUBTYPES
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/fabricator
|
||||
start_sound = 'sound/machines/fabricators/autolathe/autolathe_start.ogg'
|
||||
start_length = 2.67 SECONDS
|
||||
mid_sounds = list(
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid01.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid02.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid03.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid04.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid05.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid06.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid07.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid08.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid09.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid10.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid11.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid12.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid13.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid14.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid15.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid16.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid17.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid18.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid19.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid20.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid21.ogg' = 1,
|
||||
'sound/machines/fabricators/autolathe/autolathe_mid22.ogg' = 1,
|
||||
)
|
||||
mid_length = 1 SECOND
|
||||
end_sound = 'sound/machines/fabricators/autolathe/autolathe_end.ogg'
|
||||
each_once = TRUE
|
||||
in_order = TRUE
|
||||
volume = 30
|
||||
extra_range = MEDIUM_RANGE_SOUND_EXTRARANGE
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/fabricator/minilathe
|
||||
volume = 20
|
||||
extra_range = SHORT_RANGE_SOUND_EXTRARANGE
|
||||
ignore_walls = FALSE
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/synth_fab
|
||||
@@ -124,3 +169,4 @@
|
||||
mid_length = 3 SECONDS
|
||||
end_sound = 'sound/machines/synthfab/synthfab_end.ogg'
|
||||
volume = 75
|
||||
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/datum/wires/autolathe
|
||||
proper_name = "Autolathe"
|
||||
holder_type = /obj/machinery/autolathe
|
||||
|
||||
/datum/wires/autolathe/New(atom/holder)
|
||||
wires = list(
|
||||
WIRE_HACK, WIRE_DISABLE,
|
||||
WIRE_SHOCK
|
||||
)
|
||||
add_duds(2)
|
||||
..()
|
||||
|
||||
/datum/wires/autolathe/get_status()
|
||||
var/obj/machinery/autolathe/A = holder
|
||||
. = ..()
|
||||
. += "\The [A] [A.disabled ? "is dead quiet" : "has a soft electric whirr"]."
|
||||
. += "\The [A] [A.shocked ? "is making sparking noises" : "is cycling normally"]."
|
||||
. += "\The [A] [A.hacked ? "rarely" : "occasionally"] makes a beep boop noise."
|
||||
|
||||
/datum/wires/autolathe/interactable(mob/user)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/machinery/autolathe/A = holder
|
||||
if(A.panel_open)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/wires/autolathe/on_cut(wire, mend, source)
|
||||
var/obj/machinery/autolathe/A = holder
|
||||
switch(wire)
|
||||
if(WIRE_HACK)
|
||||
A.hacked = !mend
|
||||
if(WIRE_SHOCK)
|
||||
A.shocked = !mend
|
||||
if(WIRE_DISABLE)
|
||||
A.disabled = !mend
|
||||
|
||||
/datum/wires/autolathe/on_pulse(wire)
|
||||
if(is_cut(wire))
|
||||
return
|
||||
var/obj/machinery/autolathe/A = holder
|
||||
switch(wire)
|
||||
if(WIRE_HACK)
|
||||
A.hacked = !A.hacked
|
||||
spawn(50)
|
||||
if(A && !is_cut(wire))
|
||||
A.hacked = 0
|
||||
interact(usr)
|
||||
if(WIRE_SHOCK)
|
||||
A.shocked = !A.shocked
|
||||
spawn(50)
|
||||
if(A && !is_cut(wire))
|
||||
A.shocked = 0
|
||||
interact(usr)
|
||||
if(WIRE_DISABLE)
|
||||
A.disabled = !A.disabled
|
||||
spawn(50)
|
||||
if(A && !is_cut(wire))
|
||||
A.disabled = 0
|
||||
interact(usr)
|
||||
@@ -0,0 +1,76 @@
|
||||
/datum/wires/fabricator
|
||||
proper_name = "Fabricator"
|
||||
holder_type = /obj/machinery/fabricator
|
||||
|
||||
/datum/wires/fabricator/New(atom/holder)
|
||||
wires = list(
|
||||
WIRE_HACK, WIRE_DISABLE,
|
||||
WIRE_SHOCK
|
||||
)
|
||||
add_duds(2)
|
||||
..()
|
||||
|
||||
/datum/wires/fabricator/get_status()
|
||||
var/obj/machinery/fabricator/A = holder
|
||||
. = ..()
|
||||
. += "\The [A] [(A.fab_status_flags & FAB_DISABLED) ? "is dead quiet" : "has a soft electric whirr"]."
|
||||
. += "\The [A] [(A.fab_status_flags & FAB_SHOCKED) ? "is making sparking noises" : "is cycling normally"]."
|
||||
. += "\The [A] [(A.fab_status_flags & FAB_HACKED) ? "rarely" : "occasionally"] makes a beep boop noise."
|
||||
|
||||
/datum/wires/fabricator/interactable(mob/user)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/machinery/fabricator/A = holder
|
||||
if(A.panel_open)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/wires/fabricator/on_cut(wire, mend, source)
|
||||
var/obj/machinery/fabricator/A = holder
|
||||
switch(wire)
|
||||
if(WIRE_HACK)
|
||||
if(mend)
|
||||
A.fab_status_flags &= ~FAB_HACKED
|
||||
else
|
||||
A.fab_status_flags |= FAB_HACKED
|
||||
if(WIRE_SHOCK)
|
||||
if(mend)
|
||||
A.fab_status_flags &= ~FAB_SHOCKED
|
||||
else
|
||||
A.fab_status_flags |= FAB_SHOCKED
|
||||
if(WIRE_DISABLE)
|
||||
if(mend)
|
||||
A.fab_status_flags &= ~FAB_DISABLED
|
||||
else
|
||||
A.fab_status_flags |= FAB_DISABLED
|
||||
|
||||
/datum/wires/fabricator/proc/reset_flag(wire, user, flag)
|
||||
var/obj/machinery/fabricator/A = holder
|
||||
if(A && !is_cut(wire) && flag)
|
||||
A.fab_status_flags &= ~flag
|
||||
interact(user)
|
||||
|
||||
/datum/wires/fabricator/on_pulse(wire, user)
|
||||
if(is_cut(wire))
|
||||
return
|
||||
var/obj/machinery/fabricator/A = holder
|
||||
switch(wire)
|
||||
if(WIRE_HACK)
|
||||
if(A.fab_status_flags & FAB_HACKED)
|
||||
A.fab_status_flags &= ~FAB_HACKED
|
||||
else
|
||||
A.fab_status_flags |= FAB_HACKED
|
||||
addtimer(CALLBACK(src, PROC_REF(reset_flag), wire, user, FAB_HACKED))
|
||||
if(WIRE_SHOCK)
|
||||
if(A.fab_status_flags & FAB_SHOCKED)
|
||||
A.fab_status_flags &= ~FAB_SHOCKED
|
||||
else
|
||||
A.fab_status_flags |= FAB_SHOCKED
|
||||
addtimer(CALLBACK(src, PROC_REF(reset_flag), wire, user, FAB_SHOCKED))
|
||||
if(WIRE_DISABLE)
|
||||
if(A.fab_status_flags & FAB_DISABLED)
|
||||
A.fab_status_flags &= ~FAB_DISABLED
|
||||
else
|
||||
A.fab_status_flags |= FAB_DISABLED
|
||||
addtimer(CALLBACK(src, PROC_REF(reset_flag), wire, user, FAB_DISABLED))
|
||||
|
||||
Reference in New Issue
Block a user