Skip to content

Commit

Permalink
CMB distress
Browse files Browse the repository at this point in the history
  • Loading branch information
QuickLode committed Sep 28, 2023
1 parent 4e704b0 commit b2eadcc
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 3 deletions.
15 changes: 14 additions & 1 deletion code/datums/emergency_calls/cmb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@
to_chat(M, SPAN_BOLD("Corporate Officers chase after paychecks and promotions, but you are motivated to do your sworn duty and care for the population, no matter how far or isolated a colony may be."))
to_chat(M, SPAN_BOLD("Despite being stretched thin, the stalwart oath of the Marshals has continued to keep communities safe, with the CMB well respected by many. You are a representation of that oath, serve with distinction."))


// A Nearby Colonial Marshal patrol team responding to Marshals in Distress.
/datum/emergency_call/cmb/alt
name = "CMB - Patrol Team - Marshals in Distress (Friendly)"
mob_max = 5
mob_min = 1
probability = 0

/datum/emergency_call/cmb/alt/New()
..()
arrival_message = "CMB Team, this is Anchorpoint Station. We have confirmed you are in distress. Routing nearby units to assist!"
objectives = "Patrol Unit 5807, we have nearby Marshals in Distress! Locate and assist them immediately."

// Anchorpoint Station Colonial Marines, use this primarily for reinforcing or evacuating the CMB, as the CMB themselves are not equipped to handle heavy engagements.
/datum/emergency_call/cmb/anchorpoint
name = "CMB - Anchorpoint Station Colonial Marine QRF (Friendly)"
Expand All @@ -113,7 +126,7 @@
/datum/emergency_call/cmb/anchorpoint/New()
..()
arrival_message = "[MAIN_SHIP_NAME], this is Anchorpoint Station. Be advised, a QRF Team of our Colonial Marines is currently attempting to board you. Open your ports, transmitting docking codes now. Standby."
objectives = "QRF Team. You are here to reinforce the cmb team we deployed earlier. Make contact and work with the CMB Marshal and their deputies. Facilitate their protection and evacuation if necessary. Secondary Objective: Investigate the reason for distress aboard the [MAIN_SHIP_NAME], and assist the crew if possible."
objectives = "QRF Team. You are here to reinforce the CMB team we deployed earlier. Make contact and work with the CMB Marshal and their deputies. Facilitate their protection and evacuation if necessary. Secondary Objective: Investigate the reason for distress aboard the [MAIN_SHIP_NAME], and assist the crew if possible."

/datum/emergency_call/cmb/anchorpoint/create_member(datum/mind/M, turf/override_spawn_loc)
var/turf/spawn_loc = override_spawn_loc ? override_spawn_loc : get_spawn_point()
Expand Down
40 changes: 40 additions & 0 deletions code/game/objects/items/handheld_distress_beacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,43 @@

active = TRUE
update_icon()

// CMB distress beacon held by CMB Marshal for signalling distress to Anchorpoint Station
/obj/item/handheld_distress_beacon_CMB
name = "CMB handheld distress beacon"
desc = "An emergency beacon. This one is branded with a Colonial Marshal Bureau star and 'ANCHORPOINT STATION' is etched in stencil on the side. This device is issued to CMB Marshals and features an extended relay antenna."
icon = 'icons/obj/items/handheld_distress_beacon.dmi'
icon_state = "beacon_inactive"
w_class = SIZE_SMALL

var/active = FALSE

/obj/item/handheld_distress_beacon_CMB/get_examine_text(mob/user)
. = ..()

if(active)
. += "The beacon has been activated!"

/obj/item/handheld_distress_beacon_CMB/update_icon()
. = ..()

if(active)
icon_state = "beacon_active"
else
icon_state = initial(icon_state)

/obj/item/handheld_distress_beacon_CMB/attack_self(mob/user)
. = ..()

if(active)
to_chat(user, "[src] is already active!")
return

for(var/client/C in GLOB.admins)
if((R_ADMIN|R_MOD) & C.admin_holder.rights)
playsound_client(C,'sound/effects/sos-morse-code.ogg',10)
message_admins("[key_name(user)] has signalled CMB in distress, and requests reinforcements! [CC_MARK(user)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];distress_cmb=\ref[user]'>SEND MARINE QRF</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];distress_cmb_alt=\ref[user]'>SEND CMB TEAM</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];deny_cmb=\ref[user]'>DENY</A>) [ADMIN_JMP_USER(user)] [CC_REPLY(user)]")
to_chat(user, SPAN_NOTICE("The CMB distress beacon flashes red, indicating that the device has been activated and is transmitting."))

active = TRUE
update_icon()
34 changes: 33 additions & 1 deletion code/modules/admin/topic/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@
for(var/client/X in GLOB.admins)
if((R_ADMIN|R_MOD) & X.admin_holder.rights)
to_chat(X, SPAN_STAFF_IC("<b>ADMINS/MODS: \red [src.owner] replied to [key_name(H)]'s USCM message with: \blue \")[input]\"</b>"))
to_chat(H, SPAN_DANGER("You hear something crackle in your headset before a voice speaks, please stand by for a message from USCM:\" \blue <b>\"[input]\"</b>"))
to_chat(H, SPAN_DANGER("You hear something crackle in your headset before a voice speaks, please stand by for a message:\" \blue <b>\"[input]\"</b>"))

else if(href_list["SyndicateReply"])
var/mob/living/carbon/human/H = locate(href_list["SyndicateReply"])
Expand Down Expand Up @@ -1903,6 +1903,22 @@
addtimer(CALLBACK(src, PROC_REF(accept_ert), usr, locate(href_list["distress"])), 10 SECONDS)
//unanswered_distress -= ref_person

if(href_list["distress_cmb"]) //CMB distress signal, activates Anchorpoint Marine QRF to assist/rescue Colonial Marshals in distress
distress_cancel = FALSE
message_admins("[key_name_admin(usr)] has opted to SEND The Anchorpoint Station Colonial Marine QRF to assist the CMB! Launching in 10 seconds... (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];distresscancel=\ref[usr]'>CANCEL</A>)")
addtimer(CALLBACK(src, PROC_REF(accept_cmb_ert), usr, locate(href_list["distress"])), 10 SECONDS)

if(href_list["distress_cmb_alt"]) //CMB distress signal, activates a nearby CMB Patrol Team to assist/rescue Colonial Marshals in distress
distress_cancel = FALSE
message_admins("[key_name_admin(usr)] has opted to SEND a nearby CMB Patrol Team to assist the CMB! Launching in 10 seconds... (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];distresscancel=\ref[usr]'>CANCEL</A>)")
addtimer(CALLBACK(src, PROC_REF(accept_cmb_alt_ert), usr, locate(href_list["distress"])), 10 SECONDS)

if(href_list["deny_cmb"]) // Anchorpoint-deny. The distress call is denied, citing unavailable forces
var/mob/ref_person = locate(href_list["deny_cmb"])
to_chat(ref_person, "A voice barely crackles through the static: CMB Team, this is Anchorpoint Station. No can do, QRF currently dispatched elsewhere, relaying distress. Sorry. Good luck, out.")
log_game("[key_name_admin(usr)] has denied a distress beacon, requested by [key_name_admin(ref_person)]")
message_admins("[key_name_admin(usr)] has denied a distress beacon, requested by [key_name_admin(ref_person)]", 1)

if(href_list["distress_pmc"]) //Wey-Yu specific PMC distress signal for chem retrieval ERT
distress_cancel = FALSE
message_admins("[key_name_admin(usr)] has opted to SEND the distress beacon! Launching in 10 seconds... (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];distresscancel=\ref[usr]'>CANCEL</A>)")
Expand Down Expand Up @@ -2055,6 +2071,22 @@
log_game("[key_name_admin(approver)] has sent a randomized distress beacon, requested by [key_name_admin(ref_person)]")
message_admins("[key_name_admin(approver)] has sent a randomized distress beacon, requested by [key_name_admin(ref_person)]")

/datum/admins/proc/accept_cmb_ert(mob/approver, mob/ref_person)
if(distress_cancel)
return
distress_cancel = TRUE
SSticker.mode.get_specific_call("CMB - Anchorpoint Station Colonial Marine QRF (Friendly)", FALSE, FALSE)
log_game("[key_name_admin(approver)] has sent an Anchorpoint Station Colonial Marine QRF response, requested by [key_name_admin(ref_person)]")
message_admins("[key_name_admin(approver)] has sent an Anchorpoint Station Colonial Marine QRF response, requested by [key_name_admin(ref_person)]")

/datum/admins/proc/accept_cmb_alt_ert(mob/approver, mob/ref_person)
if(distress_cancel)
return
distress_cancel = TRUE
SSticker.mode.get_specific_call("CMB - Patrol Team - Marshals in Distress (Friendly)", FALSE, FALSE)
log_game("[key_name_admin(approver)] has sent a CMB Patrol Team distress response, requested by [key_name_admin(ref_person)]")
message_admins("[key_name_admin(approver)] has sent a CMB Patrol Team distress response, requested by [key_name_admin(ref_person)]")

/datum/admins/proc/accept_pmc_ert(mob/approver, mob/ref_person)
if(distress_cancel)
return
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 @@ -184,7 +184,7 @@
new_human.equip_to_slot_or_del(new /obj/item/storage/backpack/satchel/sec, WEAR_BACK)
new_human.equip_to_slot_or_del(new /obj/item/weapon/gun/pistol/holdout, WEAR_IN_BACK)
new_human.equip_to_slot_or_del(new /obj/item/explosive/grenade/high_explosive/m15/rubber, WEAR_IN_BACK)
new_human.equip_to_slot_or_del(new /obj/item/ammo_magazine/revolver/cmb, WEAR_IN_BACK)
new_human.equip_to_slot_or_del(new /obj/item/handheld_distress_beacon_CMB, WEAR_IN_BACK)
new_human.equip_to_slot_or_del(new /obj/item/device/radio, WEAR_IN_BACK)
new_human.equip_to_slot_or_del(new /obj/item/device/flashlight, WEAR_IN_BACK)
new_human.equip_to_slot_or_del(new /obj/item/device/camera, WEAR_IN_BACK)
Expand Down

0 comments on commit b2eadcc

Please sign in to comment.