Skip to content

Commit

Permalink
Faction frequences (#5833)
Browse files Browse the repository at this point in the history
# About the pull request

I pondered for a bit whether FORECON fixing radiotowers should allow
them to simply use Almayer's frequences (which might require giving them
appropriate headsets or not), but decided to keep it out of scope for
now. Tell me if we actually want it to be a thing.

Also, we apparently have `FACTION_USCM` and `FACTION_MARINE` both
\#defined as same thing. Before it would get out of hand, I am axing it
in favour of more commonly used one of the two.

P.S. I am not sure what is the matter with wiping frequences. Even after
fixing the spelling in the `switch`, it does now remove them from the
list, but that does not seem to prevent them from working. I am calling
that out of scope for now too and leave investigating it for another
day.

# Explain why it's good for the game

Fixes #4766, fixes #5797.

# Changelog

:cl:
fix: FORECON and RMC now can add their frequences to groundside
radiotowers.
/:cl:
  • Loading branch information
Segrain authored Feb 27, 2024
1 parent 8f186c9 commit bfa7c55
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#define MOB_HUD_XENO_INFECTION 6
#define MOB_HUD_XENO_STATUS 7
#define MOB_HUD_XENO_HOSTILE 8
#define MOB_HUD_FACTION_USCM 9
#define MOB_HUD_FACTION_MARINE 9
#define MOB_HUD_FACTION_OBSERVER 10
#define MOB_HUD_FACTION_UPP 11
#define MOB_HUD_FACTION_WY 12
Expand Down
1 change: 0 additions & 1 deletion code/__DEFINES/sentry_laptop_configurations.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define FACTION_USCM "USCM"
#define FACTION_WEYLAND "WY"
#define FACTION_HUMAN "HUMAN"
#define FACTION_COLONY "COLONY"
Expand Down
2 changes: 1 addition & 1 deletion code/datums/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list(
MOB_HUD_XENO_INFECTION = new /datum/mob_hud/xeno_infection(),
MOB_HUD_XENO_STATUS = new /datum/mob_hud/xeno(),
MOB_HUD_XENO_HOSTILE = new /datum/mob_hud/xeno_hostile(),
MOB_HUD_FACTION_USCM = new /datum/mob_hud/faction(),
MOB_HUD_FACTION_MARINE = new /datum/mob_hud/faction(),
MOB_HUD_FACTION_OBSERVER = new /datum/mob_hud/faction/observer(),
MOB_HUD_FACTION_UPP = new /datum/mob_hud/faction/upp(),
MOB_HUD_FACTION_WY = new /datum/mob_hud/faction/wy(),
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ Additional game mode variables.
var/marine_pop_size = 0
var/uscm_personnel_count = 0
for(var/mob/living/carbon/human/human as anything in GLOB.alive_human_list)
if(human.faction == FACTION_USCM)
if(human.faction == FACTION_MARINE)
uscm_personnel_count++
var/datum/job/job = GET_MAPPED_ROLE(human.job)
marine_pop_size += GLOB.RoleAuthority.calculate_role_weight(job)
Expand Down
6 changes: 5 additions & 1 deletion code/game/machinery/telecomms/presets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers)
to_chat(user, SPAN_WARNING("\The [src.name] needs repairs to have frequencies added to its software!"))
return
var/choice = tgui_input_list(user, "What do you wish to do?", "TC-3T comms tower", list("Wipe communication frequencies", "Add your faction's frequencies"))
if(choice == "Wipe frequencies")
if(choice == "Wipe communication frequencies")
freq_listening = null
to_chat(user, SPAN_NOTICE("You wipe the preexisting frequencies from \the [src]."))
return
Expand All @@ -277,12 +277,16 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers)
switch(user.faction)
if(FACTION_SURVIVOR)
freq_listening |= COLONY_FREQ
if(FACTION_MARINE in user.faction_group) //FORECON survivors
freq_listening |= SOF_FREQ
if(FACTION_CLF)
freq_listening |= CLF_FREQS
if(FACTION_UPP)
freq_listening |= UPP_FREQS
if(FACTION_WY,FACTION_PMC)
freq_listening |= PMC_FREQS
if(FACTION_TWE)
freq_listening |= RMC_FREQ
if(FACTION_YAUTJA)
to_chat(user, SPAN_WARNING("You decide to leave the human machine alone."))
return
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/devices/helmet_visors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
w_class = SIZE_TINY

///The type of HUD our visor shows
var/hud_type = MOB_HUD_FACTION_USCM
var/hud_type = MOB_HUD_FACTION_MARINE

///The sound when toggling on the visor
var/toggle_on_sound = 'sound/handling/hud_on.ogg'
Expand Down Expand Up @@ -302,7 +302,7 @@
/obj/item/device/helmet_visor/night_vision/marine_raider
name = "advanced night vision optic"
desc = "An insertable visor HUD into a standard USCM helmet. This type gives a form of night vision and is standard issue in special forces units."
hud_type = list(MOB_HUD_FACTION_USCM, MOB_HUD_MEDICAL_ADVANCED)
hud_type = list(MOB_HUD_FACTION_MARINE, MOB_HUD_MEDICAL_ADVANCED)
helmet_overlay = "nvg_sight_right_raider"
power_use = 0
visor_glows = FALSE
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/devices/radio/headset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
var/headset_hud_on = FALSE
var/locate_setting = TRACKER_SL
var/misc_tracking = FALSE
var/hud_type = MOB_HUD_FACTION_USCM
var/hud_type = MOB_HUD_FACTION_MARINE
var/default_freq

///The type of minimap this headset is added to
Expand Down Expand Up @@ -341,7 +341,7 @@
var/z_level = turf_gotten.z

if(wearer.assigned_equipment_preset.always_minimap_visible == TRUE || wearer.stat == DEAD) //We show to all marines if we have this flag, separated by faction
if(hud_type == MOB_HUD_FACTION_USCM)
if(hud_type == MOB_HUD_FACTION_MARINE)
marker_flags = MINIMAP_FLAG_USCM
else if(hud_type == MOB_HUD_FACTION_UPP)
marker_flags = MINIMAP_FLAG_UPP
Expand Down Expand Up @@ -1013,7 +1013,7 @@
icon_state = "cmb_headset"
initial_keys = list(/obj/item/device/encryptionkey/cmb)
has_hud = TRUE
hud_type = MOB_HUD_FACTION_USCM
hud_type = MOB_HUD_FACTION_MARINE

/obj/item/device/radio/headset/distress/CMB/limited
name = "\improper Damaged CMB Earpiece"
Expand Down Expand Up @@ -1058,7 +1058,7 @@
initial_keys = list(/obj/item/device/encryptionkey/soc/forecon)
volume = RADIO_VOLUME_QUIET
has_hud = TRUE
hud_type = MOB_HUD_FACTION_USCM
hud_type = MOB_HUD_FACTION_MARINE

/obj/item/device/radio/headset/almayer/mcom/vc
name = "marine vehicle crew radio headset"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/defenses/bell_tower.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
can_be_near_defense = TRUE

choice_categories = list(
SENTRY_CATEGORY_IFF = list(FACTION_USCM, FACTION_WEYLAND, FACTION_HUMAN),
SENTRY_CATEGORY_IFF = list(FACTION_MARINE, FACTION_WEYLAND, FACTION_HUMAN),
)

selected_categories = list(
SENTRY_CATEGORY_IFF = FACTION_USCM,
SENTRY_CATEGORY_IFF = FACTION_MARINE,
)


Expand Down
2 changes: 1 addition & 1 deletion code/modules/defenses/defenses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
*/
/obj/structure/machinery/defenses/proc/handle_iff(selection)
switch(selection)
if(FACTION_USCM)
if(FACTION_MARINE)
faction_group = FACTION_LIST_MARINE
if(FACTION_WEYLAND)
faction_group = FACTION_LIST_MARINE_WY
Expand Down
4 changes: 2 additions & 2 deletions code/modules/defenses/planted_flag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
can_be_near_defense = TRUE

choice_categories = list(
SENTRY_CATEGORY_IFF = list(FACTION_USCM, FACTION_WEYLAND, FACTION_HUMAN),
SENTRY_CATEGORY_IFF = list(FACTION_MARINE, FACTION_WEYLAND, FACTION_HUMAN),
)

selected_categories = list(
SENTRY_CATEGORY_IFF = FACTION_USCM,
SENTRY_CATEGORY_IFF = FACTION_MARINE,
)


Expand Down
10 changes: 5 additions & 5 deletions code/modules/defenses/sentry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
/// action list is configurable for all subtypes, this is just an example
choice_categories = list(
// SENTRY_CATEGORY_ROF = list(ROF_SINGLE, ROF_BURST, ROF_FULL_AUTO),
SENTRY_CATEGORY_IFF = list(FACTION_USCM, FACTION_WEYLAND, FACTION_HUMAN),
SENTRY_CATEGORY_IFF = list(FACTION_MARINE, FACTION_WEYLAND, FACTION_HUMAN),
)

selected_categories = list(
// SENTRY_CATEGORY_ROF = ROF_SINGLE,
SENTRY_CATEGORY_IFF = FACTION_USCM,
SENTRY_CATEGORY_IFF = FACTION_MARINE,
)

/obj/structure/machinery/defenses/sentry/Initialize()
Expand Down Expand Up @@ -478,7 +478,7 @@
/obj/structure/machinery/defenses/sentry/premade/Initialize()
. = ..()
if(selected_categories[SENTRY_CATEGORY_IFF])
selected_categories[SENTRY_CATEGORY_IFF] = FACTION_USCM
selected_categories[SENTRY_CATEGORY_IFF] = FACTION_MARINE

/obj/structure/machinery/defenses/sentry/premade/get_examine_text(mob/user)
. = ..()
Expand Down Expand Up @@ -562,11 +562,11 @@
handheld_type = /obj/item/defenses/handheld/sentry/dmr

choice_categories = list(
SENTRY_CATEGORY_IFF = list(FACTION_USCM, FACTION_WEYLAND, FACTION_HUMAN),
SENTRY_CATEGORY_IFF = list(FACTION_MARINE, FACTION_WEYLAND, FACTION_HUMAN),
)

selected_categories = list(
SENTRY_CATEGORY_IFF = FACTION_USCM,
SENTRY_CATEGORY_IFF = FACTION_MARINE,
)


Expand Down
4 changes: 2 additions & 2 deletions code/modules/defenses/sentry_flamer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

choice_categories = list(
// SENTRY_CATEGORY_ROF = list(ROF_SINGLE, ROF_FULL_AUTO),
SENTRY_CATEGORY_IFF = list(FACTION_USCM, FACTION_WEYLAND, FACTION_HUMAN),
SENTRY_CATEGORY_IFF = list(FACTION_MARINE, FACTION_WEYLAND, FACTION_HUMAN),
)

selected_categories = list(
SENTRY_CATEGORY_ROF = ROF_SINGLE,
SENTRY_CATEGORY_IFF = FACTION_USCM,
SENTRY_CATEGORY_IFF = FACTION_MARINE,
)

/obj/structure/machinery/defenses/sentry/flamer/handle_rof(level)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/defenses/tesla_coil.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
has_camera = FALSE

choice_categories = list(
SENTRY_CATEGORY_IFF = list(FACTION_USCM, FACTION_WEYLAND, FACTION_HUMAN),
SENTRY_CATEGORY_IFF = list(FACTION_MARINE, FACTION_WEYLAND, FACTION_HUMAN),
)

selected_categories = list(
SENTRY_CATEGORY_IFF = FACTION_USCM,
SENTRY_CATEGORY_IFF = FACTION_MARINE,
)


Expand Down
2 changes: 1 addition & 1 deletion code/modules/gear_presets/cmb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
var/obj/item/clothing/under/uniform = new_human.w_uniform
if(istype(uniform))
uniform.has_sensor = UNIFORM_HAS_SENSORS
uniform.sensor_faction = FACTION_USCM
uniform.sensor_faction = FACTION_MARINE
return ..()

//*****************************************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion code/modules/gear_presets/corpses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@
paygrade = PAY_SHORT_ME5
idtype = /obj/item/card/id/dogtag
role_comm_title = "FORECON"
faction_group = list(FACTION_USCM, FACTION_SURVIVOR)
faction_group = list(FACTION_MARINE, FACTION_SURVIVOR)
access = list(
ACCESS_CIVILIAN_PUBLIC,
ACCESS_CIVILIAN_ENGINEERING,
Expand Down
2 changes: 1 addition & 1 deletion code/modules/gear_presets/royal_marines.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/datum/equipment_preset/twe
name = "Three World Empire"
faction = FACTION_TWE
faction_group = list(FACTION_TWE, FACTION_USCM)
faction_group = list(FACTION_TWE, FACTION_MARINE)
languages = list(LANGUAGE_ENGLISH, LANGUAGE_JAPANESE)

/datum/equipment_preset/twe/royal_marine/load_name(mob/living/carbon/human/new_human, randomise)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
idtype = /obj/item/card/id/dogtag
role_comm_title = "FORECON"
rank = JOB_SURVIVOR
faction_group = list(FACTION_USCM, FACTION_SURVIVOR)
faction_group = list(FACTION_MARINE, FACTION_SURVIVOR)
flags = EQUIPMENT_PRESET_START_OF_ROUND
access = list(
ACCESS_CIVILIAN_PUBLIC,
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@
if(med_hud.hudusers[passed_human])
return TRUE
if("squadleader")
var/datum/mob_hud/faction_hud = GLOB.huds[MOB_HUD_FACTION_USCM]
var/datum/mob_hud/faction_hud = GLOB.huds[MOB_HUD_FACTION_MARINE]
if(passed_human.mind && passed_human.assigned_squad && passed_human.assigned_squad.squad_leader == passed_human && faction_hud.hudusers[passed_mob])
return TRUE
else
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/silicon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
H = GLOB.huds[MOB_HUD_SECURITY_ADVANCED]
HUD_nbr = 2
if("Squad HUD")
H = GLOB.huds[MOB_HUD_FACTION_USCM]
H = GLOB.huds[MOB_HUD_FACTION_MARINE]
HUD_nbr = 3
else
return
Expand Down

0 comments on commit bfa7c55

Please sign in to comment.