Files
Bubberstation/code/datums/wires/holopad.dm
Maximal08 8752e4e991 Adds wires for holopad (#89947)
## About The Pull Request
Adds wires for the holopad with a red light to turn recording on and off
and a purple one to switch the loop.

An example of a fun use with proximity sensor and looping switching:


https://github.com/user-attachments/assets/ad6a711a-3e10-4bfd-9b8c-ab83ca949f03

And a small piece showing what happens if you try to play a recording
without a disc or with an empty disc:



https://github.com/user-attachments/assets/9dd398d6-f189-4f65-b5e3-f53f2747398f
## Why It's Good For The Game
The holopad has great potential for personal constructions of players,
and I would like to expand its functionality by adding interaction with
the wiring.
## Changelog
🆑
add: Adds wires for holopad
/🆑

---------

Co-authored-by: grungussuss <96586172+Sadboysuss@users.noreply.github.com>
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2025-03-17 08:26:32 +00:00

48 lines
1.2 KiB
Plaintext

/datum/wires/holopad
holder_type = /obj/machinery/holopad
proper_name = "holopad"
/datum/wires/holopad/interactable(mob/user)
var/obj/machinery/holopad/holopad = holder
return holopad.panel_open ? ..() : FALSE
/datum/wires/holopad/New(atom/holder)
wires = list(
WIRE_LOOP_MODE,
WIRE_REPLAY_MODE
)
return ..()
/datum/wires/holopad/get_status()
var/obj/machinery/holopad/holopad = holder
var/list/status = list()
status += "The purple light is [holopad.loop_mode ? "on" : "off"]."
status += "The red light is [holopad.replay_mode ? "on" : "off"]."
return status
/datum/wires/holopad/on_pulse(wire)
var/obj/machinery/holopad/holopad = holder
switch(wire)
if(WIRE_LOOP_MODE)
holopad.loop_mode = !holopad.loop_mode
if(WIRE_REPLAY_MODE)
if (!holopad.replay_mode)
holopad.replay_start()
holopad.replay_mode = TRUE
else
holopad.replay_stop()
holopad.replay_mode = FALSE
return ..()
/datum/wires/holopad/on_cut(wire, mend, source)
var/obj/machinery/holopad/holopad = holder
if(wire == WIRE_REPLAY_MODE)
if(mend)
holopad.replay_stop()
holopad.replay_mode = FALSE
else
holopad.replay_start()
holopad.replay_mode = TRUE
return ..()