Special radio channels now use bitflags instead of individual vars (#85150)

## About The Pull Request

Radios/encryption keys now use a `RADIO_SPECIAL_XXXXX` bitflag for
behaviors related to "special" radio channels (Binary, Centcom, Syndie).

I decided to do this because I wanted to add a radio channel for pirates
and hunters (hence the branch name), but it felt weird adding two more
variables. The more I look at the changes I've made here the more I
realize that the effort was probably not worth the utility but whatever.

This also subtypes some varedited intercoms and makes them their own
objects.
## Why It's Good For The Game

Compresses a whopping three (3!) variables into a single one. Easier to
scale (I guess?). I felt like adding a fourth/fifth variable and just
moving on with the original project, but decided "lets do this the
unnecessarily hard way instead".
## Changelog
🆑 Rhials
code: Radios/encryption keys now use a single variable for "special"
frequencies. Please report if you experience any strangeness with
accessing/being unable to access the Centcom, Syndicate, or Cyborg
radio.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
Rhials
2024-08-18 21:23:46 +00:00
committed by GitHub
co-authored by Ghom
parent 86329bf4c3
commit 00a0d0b890
15 changed files with 66 additions and 83 deletions
@@ -36,7 +36,7 @@
return TRUE
if("set_frequency")
var/new_frequency = text2num(params["new_frequency"])
radio.set_frequency(sanitize_frequency(new_frequency, radio.freerange, radio.syndie))
radio.set_frequency(sanitize_frequency(new_frequency, radio.freerange, (radio.special_channels & RADIO_SPECIAL_SYNDIE)))
return TRUE
return FALSE