Files
Aurora.3/code/modules/power/tesla/coil.dm
T
FluffyandGitHub 9acce89e2a Weapons Racks (#19338)
Added weapons racks, can be locked/unlocked with an ID card.
Added weapons racks sprites, from Wezzy.
Refactored some circuitboard code, moved the defines, applied the
defines, DMDocs.
Moved mutable appearance appearance flag set to the mutable appearance
file.
Reorganized the Horizon armory with the weapons racks, moved things
around, put down markers on lockers depending on the danger level of
their content, reorganized content of the remaining lockers.
Made weapons racks constructable with circuitboards.


![image](https://github.com/Aurorastation/Aurora.3/assets/65877598/8b4ec7ae-40c4-4cd7-b338-76120d468b90)

![image](https://github.com/Aurorastation/Aurora.3/assets/65877598/a69d1f85-c4b2-4643-af2b-6832e3ea2c43)

![image](https://github.com/Aurorastation/Aurora.3/assets/65877598/11c1afe4-0fa1-4708-8eb4-64e1f5594913)

sound/items/metal_shutter.ogg -
https://freesound.org/people/bruno.auzet/sounds/524695/ (CC0, sound was
edited)
2024-06-09 17:07:52 +00:00

118 lines
3.7 KiB
Plaintext

/obj/machinery/power/tesla_coil
name = "tesla coil"
desc = "For the union!"
icon = 'icons/obj/tesla_engine/tesla_coil.dmi'
icon_state = "coil"
anchored = 0
density = 1
var/power_loss = 2
var/input_power_multiplier = 1
component_types = list(
/obj/item/circuitboard/tesla_coil,
/obj/item/stock_parts/capacitor
)
/obj/machinery/power/tesla_coil/update_icon()
ClearOverlays()
if(anchored)
AddOverlays("[icon_state]+bolts")
var/image/lights_image = image(icon, null, "[icon_state]+lights")
lights_image.plane = EFFECTS_ABOVE_LIGHTING_PLANE
AddOverlays(lights_image)
/obj/machinery/power/tesla_coil/RefreshParts()
var/power_multiplier = 0
for(var/obj/item/stock_parts/capacitor/C in component_parts)
power_multiplier += C.rating
input_power_multiplier = power_multiplier
/obj/machinery/power/tesla_coil/attackby(obj/item/attacking_item, mob/user)
if(default_deconstruction_screwdriver(user, attacking_item))
return
if(default_deconstruction_crowbar(user, attacking_item))
return
if(default_part_replacement(user, attacking_item))
return
if(attacking_item.iswrench())
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You [anchored ? "unfasten" : "fasten"] [src] to the flooring."))
anchored = !anchored
update_icon()
if(!anchored)
disconnect_from_network()
else
connect_to_network()
return
/obj/machinery/power/tesla_coil/tesla_act(var/power, var/melt = FALSE)
if(anchored && !melt)
being_shocked = 1
//don't lose arc power when it's not connected to anything
//please place tesla coils all around the station to maximize effectiveness
var/power_produced = powernet ? power / power_loss : power
add_avail(power_produced*input_power_multiplier)
flick("coilhit", src)
playsound(src.loc, 'sound/magic/LightningShock.ogg', 100, 1, extrarange = 5)
tesla_zap(src, 5, power_produced)
addtimer(CALLBACK(src, PROC_REF(reset_shocked)), 10)
else
..()
/obj/machinery/power/grounding_rod
name = "grounding rod"
desc = "Keep an area from being fried from Edison's Bane."
icon = 'icons/obj/tesla_engine/tesla_coil.dmi'
icon_state = "grounding_rod"
anchored = 0
density = 1
component_types = list(
/obj/item/circuitboard/grounding_rod,
/obj/item/stock_parts/capacitor
)
/obj/machinery/power/grounding_rod/update_icon()
ClearOverlays()
if(anchored)
AddOverlays("[icon_state]+bolts")
var/image/lights_image = image(icon, null, "[icon_state]+lights")
lights_image.plane = EFFECTS_ABOVE_LIGHTING_PLANE
AddOverlays(lights_image)
/obj/machinery/power/grounding_rod/attackby(obj/item/attacking_item, mob/user)
if(default_deconstruction_screwdriver(user, attacking_item))
return
if(default_deconstruction_crowbar(user, attacking_item))
return
if(default_part_replacement(user, attacking_item))
return
if(attacking_item.iswrench())
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You [anchored ? "unfasten" : "fasten"] [src] to the flooring."))
anchored = !anchored
update_icon()
return
/obj/machinery/power/grounding_rod/tesla_act(var/power, var/melt = FALSE)
flick("coil_shock_1", src)
/obj/item/circuitboard/tesla_coil
name = "tesla coil circuitry"
desc = "The circuitboard for a tesla coil."
build_path = /obj/machinery/power/tesla_coil
origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2)
req_components = list("/obj/item/stock_parts/capacitor" = 1)
board_type = BOARD_MACHINE
/obj/item/circuitboard/grounding_rod
name = "grounding rod circuitry"
desc = "The circuitboard for a grounding rod."
build_path = /obj/machinery/power/grounding_rod
origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2)
req_components = list("/obj/item/stock_parts/capacitor" = 1)
board_type = BOARD_MACHINE