Skip to content

Commit

Permalink
Telephones Networking (#4131)
Browse files Browse the repository at this point in the history
# About the pull request
Telephones can now receive multiple networks as well as transmit on
multiple networks.
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
Allows for more dynamic phone setups.
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
add: Telephones can now receive calls from multiple networks.
add: Adds UPP, CLF and WY prefab phones.
fix: UPP RTO pack is now titled UPP rather than USCM
/:cl:
  • Loading branch information
realforest2001 authored Aug 25, 2023
1 parent 03c3a21 commit 869b543
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 25 deletions.
10 changes: 6 additions & 4 deletions code/game/objects/items/storage/backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r
var/obj/structure/transmitter/internal/internal_transmitter

var/phone_category = PHONE_MARINE
var/network_receive = FACTION_MARINE
var/list/networks_receive = list(FACTION_MARINE)
var/list/networks_transmit = list(FACTION_MARINE)
var/base_icon

Expand All @@ -523,7 +523,7 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r
internal_transmitter.relay_obj = src
internal_transmitter.phone_category = phone_category
internal_transmitter.enabled = FALSE
internal_transmitter.network_receive = network_receive
internal_transmitter.networks_receive = networks_receive
internal_transmitter.networks_transmit = networks_transmit
RegisterSignal(internal_transmitter, COMSIG_TRANSMITTER_UPDATE_ICON, PROC_REF(check_for_ringing))
GLOB.radio_packs += src
Expand Down Expand Up @@ -593,7 +593,8 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r
. = ..()

/obj/item/storage/backpack/marine/satchel/rto/upp_net
network_receive = FACTION_UPP
name = "\improper UPP Radio Telephone Pack"
networks_receive = list(FACTION_UPP)
networks_transmit = list(FACTION_UPP)

/obj/item/storage/backpack/marine/satchel/rto/small
Expand All @@ -602,7 +603,8 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r


/obj/item/storage/backpack/marine/satchel/rto/small/upp_net
network_receive = FACTION_UPP
name = "\improper UPP Radio Telephone Pack"
networks_receive = list(FACTION_UPP)
networks_transmit = list(FACTION_UPP)
phone_category = PHONE_UPP_SOLDIER

Expand Down
49 changes: 40 additions & 9 deletions code/modules/cm_phone/phone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter)
var/timeout_timer_id
var/timeout_duration = 30 SECONDS

var/network_receive = FACTION_MARINE
var/list/networks_receive = list(FACTION_MARINE)
var/list/networks_transmit = list(FACTION_MARINE)

/obj/structure/transmitter/hidden
Expand Down Expand Up @@ -82,7 +82,12 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter)
var/obj/structure/transmitter/target_phone = possible_phone
if(TRANSMITTER_UNAVAILABLE(target_phone) || !target_phone.callable) // Phone not available
continue
if(!(target_phone.network_receive in networks_transmit))
var/net_link = FALSE
for(var/network in networks_transmit)
if(network in target_phone.networks_receive)
net_link = TRUE
continue
if(!net_link)
continue

var/id = target_phone.phone_id
Expand Down Expand Up @@ -538,23 +543,49 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter)
UnregisterSignal(attached_to, COMSIG_MOVABLE_MOVED)
reset_tether()

//rotary desk phones (need a touch tone handset at some point)
/obj/structure/transmitter/rotary
name = "rotary telephone"
icon_state = "rotary_phone"
desc = "The finger plate is a little stiff."

/obj/structure/transmitter/touchtone
name = "touch-tone telephone"
icon_state = "rotary_phone"//placeholder
desc = "Ancient aliens, it's all true. I'm an expert just like you!"

/obj/structure/transmitter/colony_net
network_receive = FACTION_COLONIST
networks_receive = list(FACTION_COLONIST)
networks_transmit = list(FACTION_COLONIST)

/obj/structure/transmitter/colony_net/rotary
name = "rotary telephone"
icon_state = "rotary_phone"
desc = "The finger plate is a little stiff."

//rotary desk phones (need a touch tone handset at some point)
/obj/structure/transmitter/rotary
/obj/structure/transmitter/upp_net
networks_receive = list(FACTION_UPP)
networks_transmit = list(FACTION_UPP)

/obj/structure/transmitter/upp_net/rotary
name = "rotary telephone"
icon_state = "rotary_phone"
desc = "The finger plate is a little stiff."

/obj/structure/transmitter/touchtone
name = "touch-tone telephone"
icon_state = "rotary_phone"//placeholder
desc = "Ancient aliens, it's all true. I'm an expert just like you!"
/obj/structure/transmitter/clf_net
networks_receive = list(FACTION_CLF)
networks_transmit = list(FACTION_CLF)

/obj/structure/transmitter/clf_net/rotary
name = "rotary telephone"
icon_state = "rotary_phone"
desc = "The finger plate is a little stiff."

/obj/structure/transmitter/wy_net
networks_receive = list(FACTION_WY)
networks_transmit = list(FACTION_WY)

/obj/structure/transmitter/wy_net/rotary
name = "rotary telephone"
icon_state = "rotary_phone"
desc = "The finger plate is a little stiff."
16 changes: 4 additions & 12 deletions maps/map_files/LV624/standalone/clfship.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@
},
/area/lv624/lazarus/crashed_ship)
"fA" = (
/obj/structure/transmitter/colony_net{
network_receive = "CLF";
networks_transmit = list("CLF");
/obj/structure/transmitter/clf_net{
phone_category = "CR-116";
phone_id = "Armoury";
pixel_y = 32
Expand Down Expand Up @@ -666,9 +664,7 @@
"sI" = (
/obj/structure/surface/table/reinforced/prison,
/obj/effect/spawner/random/toolbox,
/obj/structure/transmitter/colony_net/rotary{
network_receive = "CLF";
networks_transmit = list("CLF");
/obj/structure/transmitter/clf_net/rotary{
phone_category = "CR-116";
phone_color = "yellow";
phone_id = "Engineering"
Expand Down Expand Up @@ -1661,9 +1657,7 @@
/area/lv624/lazarus/crashed_ship)
"Qj" = (
/obj/structure/machinery/body_scanconsole,
/obj/structure/transmitter/colony_net{
network_receive = "CLF";
networks_transmit = list("CLF");
/obj/structure/transmitter/clf_net{
phone_category = "CR-116";
phone_color = "green";
phone_id = "Medical Bay";
Expand Down Expand Up @@ -1993,9 +1987,7 @@
},
/area/lv624/lazarus/crashed_ship)
"XM" = (
/obj/structure/transmitter/colony_net{
network_receive = "CLF";
networks_transmit = list("CLF");
/obj/structure/transmitter/clf_net{
phone_category = "CR-116";
phone_id = "Cargo Bay";
pixel_y = 32
Expand Down

0 comments on commit 869b543

Please sign in to comment.