forked from Sandstorm-Station/Sandstorm-Station-13
-
-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More circuitry, also known as, "THIS IS NOT ENOUGH" (#71)
- Loading branch information
Showing
12 changed files
with
288 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GLOBAL_VAR_INIT(remote_control, TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
GLOBAL_LIST_EMPTY(ic_jammers) | ||
GLOBAL_LIST_EMPTY(ic_speakers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
sandcode/code/game/machinery/telecomms/machine_interactions.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Additional Options for certain machines. Use this when you want to add an option to a specific machine. | ||
// Example of how to use below. | ||
|
||
/obj/machinery/telecomms/proc/Options_Menu() | ||
return "" | ||
|
||
// The topic for Additional Options. Use this for checking href links for your specific option. | ||
// Example of how to use below. | ||
/obj/machinery/telecomms/proc/Options_Topic(href, href_list) | ||
return |
46 changes: 46 additions & 0 deletions
46
sandcode/code/game/machinery/telecomms/machines/receiver.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//Code for the interceptor circuit | ||
/obj/machinery/telecomms/receiver/Options_Menu() | ||
var/dat = "<br>Remote control: <a href='?src=[REF(src)];toggle_remote_control=1'>[GLOB.remote_control ? "<font color='green'><b>ENABLED</b></font>" : "<font color='red'><b>DISABLED</b></font>"]</a>" | ||
dat += "<br>Broadcasting signals: " | ||
for(var/i in GLOB.ic_speakers) | ||
var/obj/item/integrated_circuit/I = i | ||
var/obj/item/O = I.get_object() | ||
if(get_area(O)) //if it isn't in nullspace, can happen due to printer newing all possible circuits to fetch list data | ||
dat += "<br>[O.name] = [O.x], [O.y], [O.z], [get_area(O)]" | ||
dat += "<br><br>Circuit jammer signals: " | ||
for(var/i in GLOB.ic_jammers) | ||
var/obj/item/integrated_circuit/I = i | ||
var/obj/item/O = I.get_object() | ||
if(get_area(O)) //if it isn't in nullspace, can happen due to printer newing all possible circuits to fetch list data | ||
dat += "<br>[O.name] = [O.x], [O.y], [O.z], [get_area(O)]" | ||
return dat | ||
|
||
/obj/machinery/telecomms/receiver/Options_Topic(href, href_list) | ||
if(href_list["toggle_remote_control"]) | ||
GLOB.remote_control = !GLOB.remote_control | ||
|
||
/obj/machinery/telecomms/receiver/receive_signal(datum/signal/signal) | ||
if(LAZYLEN(GLOB.ic_jammers) && GLOB.remote_control) | ||
for(var/i in GLOB.ic_jammers) | ||
var/obj/item/integrated_circuit/input/tcomm_interceptor/T = i | ||
var/obj/item/O = T.get_object() | ||
if(is_station_level(O.z)&& (!istype(get_area(O), /area/space))) | ||
if(!istype(signal.source, /obj/item/radio/headset/integrated)) | ||
signal.data["reject"] = TRUE | ||
break | ||
..() | ||
|
||
//makeshift receiver used for the circuit, so that we don't | ||
//have to edit radio.dm and other shit | ||
/obj/machinery/telecomms/receiver/circuit | ||
idle_power_usage = 0 | ||
var/obj/item/integrated_circuit/input/tcomm_interceptor/holder | ||
|
||
/obj/machinery/telecomms/receiver/circuit/receive_signal(datum/signal/signal) | ||
if(!holder.get_pin_data(IC_INPUT, 1)) | ||
return | ||
if(!signal) | ||
return | ||
holder.receive_signal(signal) | ||
|
||
// End |
88 changes: 88 additions & 0 deletions
88
sandcode/code/modules/integrated_electronics/subtypes/input.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
//Interceptor | ||
//Intercepts a telecomms signal, aka a radio message (;halp getting griff) | ||
//Inputs: | ||
//On (Boolean): If on, the circuit intercepts radio signals. Otherwise it does not. This doesn't affect no pass! | ||
//No pass (Boolean): Decides if the signal will be silently intercepted | ||
// (false) or also blocked from being sent on the radio (true) | ||
//Outputs: | ||
//Source: name of the mob | ||
//Job: job of the mob | ||
//content: the actual message | ||
//spans: a list of spans, there's not much info about this but stuff like robots will have "robot" span | ||
/obj/item/integrated_circuit/input/tcomm_interceptor | ||
name = "telecommunication interceptor" | ||
desc = "This circuit allows for telecomms signals \ | ||
to be fetched prior to being broadcasted." | ||
extended_desc = "Similar \ | ||
to the old NTSL system of realtime signal modification, \ | ||
the circuit connects to telecomms and fetches data \ | ||
for each signal, which can be sent normally or blocked, \ | ||
for cases such as other circuits modifying certain data. \ | ||
Beware, this cannot stop signals from unreachable areas, such \ | ||
as space or zlevels other than station's one." | ||
complexity = 30 | ||
cooldown_per_use = 0.1 | ||
w_class = WEIGHT_CLASS_SMALL | ||
inputs = list( | ||
"intercept" = IC_PINTYPE_BOOLEAN, | ||
"no pass" = IC_PINTYPE_BOOLEAN | ||
) | ||
outputs = list( | ||
"source" = IC_PINTYPE_STRING, | ||
"job" = IC_PINTYPE_STRING, | ||
"content" = IC_PINTYPE_STRING, | ||
"spans" = IC_PINTYPE_LIST, | ||
"frequency" = IC_PINTYPE_NUMBER | ||
) | ||
activators = list( | ||
"on intercept" = IC_PINTYPE_PULSE_OUT | ||
) | ||
power_draw_idle = 0 | ||
spawn_flags = IC_SPAWN_RESEARCH | ||
var/obj/machinery/telecomms/receiver/circuit/receiver | ||
var/list/freq_blacklist = list(FREQ_CENTCOM,FREQ_SYNDICATE,FREQ_CTF_RED,FREQ_CTF_BLUE) | ||
|
||
/obj/item/integrated_circuit/input/tcomm_interceptor/Initialize() | ||
. = ..() | ||
receiver = new(src) | ||
receiver.holder = src | ||
|
||
/obj/item/integrated_circuit/input/tcomm_interceptor/Destroy() | ||
qdel(receiver) | ||
GLOB.ic_jammers -= src | ||
..() | ||
|
||
/obj/item/integrated_circuit/input/tcomm_interceptor/receive_signal(datum/signal/signal) | ||
if((signal.transmission_method == TRANSMISSION_SUBSPACE) && get_pin_data(IC_INPUT, 1)) | ||
if(signal.frequency in freq_blacklist) | ||
return | ||
set_pin_data(IC_OUTPUT, 1, signal.data["name"]) | ||
set_pin_data(IC_OUTPUT, 2, signal.data["job"]) | ||
set_pin_data(IC_OUTPUT, 3, signal.data["message"]) | ||
set_pin_data(IC_OUTPUT, 4, signal.data["spans"]) | ||
set_pin_data(IC_OUTPUT, 5, signal.frequency) | ||
push_data() | ||
activate_pin(1) | ||
|
||
/obj/item/integrated_circuit/input/tcomm_interceptor/on_data_written() | ||
if(get_pin_data(IC_INPUT, 2)) | ||
GLOB.ic_jammers |= src | ||
if(get_pin_data(IC_INPUT, 1)) | ||
power_draw_idle = 200 | ||
else | ||
power_draw_idle = 100 | ||
else | ||
GLOB.ic_jammers -= src | ||
if(get_pin_data(IC_INPUT, 1)) | ||
power_draw_idle = 100 | ||
else | ||
power_draw_idle = 0 | ||
|
||
/obj/item/integrated_circuit/input/tcomm_interceptor/power_fail() | ||
set_pin_data(IC_INPUT, 1, 0) | ||
set_pin_data(IC_INPUT, 2, 0) | ||
|
||
/obj/item/integrated_circuit/input/tcomm_interceptor/disconnect_all() | ||
set_pin_data(IC_INPUT, 1, 0) | ||
set_pin_data(IC_INPUT, 2, 0) | ||
..() |
50 changes: 50 additions & 0 deletions
50
sandcode/code/modules/integrated_electronics/subtypes/manipulation.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/obj/item/integrated_circuit/manipulation/activator | ||
name = "activator" | ||
desc = "Circuit which can activate things remotely!" | ||
icon_state = "pull_claw" | ||
extended_desc = "This circuit needs a reference to a thing to activate, it also needs to know who is activating said item." | ||
w_class = WEIGHT_CLASS_SMALL | ||
size = 3 | ||
cooldown_per_use = 1 | ||
complexity = 10 | ||
inputs = list("target" = IC_PINTYPE_REF, "person" = IC_PINTYPE_REF) | ||
activators = list("pulse in" = IC_PINTYPE_PULSE_IN,"pulse out" = IC_PINTYPE_PULSE_OUT) | ||
spawn_flags = IC_SPAWN_RESEARCH | ||
power_draw_per_use = 50 | ||
ext_cooldown = 1 | ||
|
||
/obj/item/integrated_circuit/manipulation/activator/do_work(ord) | ||
var/obj/acting_object = get_pin_data_as_type(IC_INPUT, 1, /obj/) | ||
var/mob/person = get_pin_data_as_type(IC_INPUT, 2, /mob/) | ||
acting_object.interact(person) | ||
activate_pin(1) | ||
|
||
|
||
/obj/item/integrated_circuit/manipulation/advactivator | ||
name = "advactivator" | ||
desc = "Circuit which can UI elements remotely!" | ||
icon_state = "pull_claw" | ||
extended_desc = "This circuit needs a reference to a to activate, as well as action and parems to pass! Use mode 1 for lists or 0 for single values." | ||
w_class = WEIGHT_CLASS_SMALL | ||
size = 3 | ||
cooldown_per_use = 1 | ||
complexity = 10 | ||
|
||
//inputs = list("target" = IC_PINTYPE_REF, "action" = IC_PINTYPE_STRING, "params" = IC_PINTYPE_STRING) | ||
inputs = list("target" = IC_PINTYPE_REF, "action" = IC_PINTYPE_STRING, "mode" = IC_PINTYPE_NUMBER, "params" = IC_PINTYPE_STRING, "listparams" = IC_PINTYPE_LIST) | ||
activators = list("pulse in" = IC_PINTYPE_PULSE_IN,"pulse out" = IC_PINTYPE_PULSE_OUT) | ||
spawn_flags = IC_SPAWN_RESEARCH | ||
power_draw_per_use = 50 | ||
ext_cooldown = 1 | ||
var/max_grab = GRAB_PASSIVE | ||
|
||
/obj/item/integrated_circuit/manipulation/advactivator/do_work(ord) | ||
var/obj/acting_object = get_pin_data_as_type(IC_INPUT, 1, /obj/) | ||
var/action = get_pin_data(IC_INPUT, 2) | ||
var/mode = get_pin_data(IC_INPUT, 3) | ||
var/params = get_pin_data(IC_INPUT, 4) | ||
if(mode == 1) | ||
params = get_pin_data(IC_INPUT, 5) | ||
|
||
acting_object.ui_act(action, params) | ||
activate_pin(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.