Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
AndroBetel committed Jan 10, 2024
1 parent 934cd3c commit f4ba01c
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 13 deletions.
2 changes: 2 additions & 0 deletions code/datums/skills/uscm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ United States Colonial Marines
SKILL_ENDURANCE = SKILL_ENDURANCE_TRAINED,
SKILL_JTAC = SKILL_JTAC_TRAINED,
SKILL_INTEL = SKILL_INTEL_TRAINED,
SKILL_PILOT = SKILL_PILOT_EXPERT,
)

/datum/skills/intel
Expand Down Expand Up @@ -290,6 +291,7 @@ COMMAND STAFF
SKILL_JTAC = SKILL_JTAC_EXPERT,
SKILL_INTEL = SKILL_INTEL_TRAINED,
SKILL_SURGERY = SKILL_SURGERY_NOVICE,
SKILL_PILOT = SKILL_PILOT_EXPERT,
)

/datum/skills/SEA
Expand Down
21 changes: 21 additions & 0 deletions code/game/objects/items/devices/flashlight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,27 @@
qdel(signal)
..()

/obj/effect/landmark/rappel
name = "Rappel Point"
var/datum/cas_signal/signal
invisibility_value = SEE_INVISIBLE_OBSERVER
icon_state = "o_green"

/obj/effect/landmark/rappel/New()
. = ..()
signal = new(src)
signal.target_id = ++cas_tracking_id_increment
name = "Rappel Point #[signal.target_id]"
signal.name = name
cas_groups[FACTION_MARINE].add_signal(signal)

/obj/effect/landmark/rappel/Destroy()
if(signal)
cas_groups[FACTION_MARINE].remove_signal(signal)
QDEL_NULL(signal)
return ..()


/// Signal flares deployed by a flare gun
/obj/item/device/flashlight/flare/signal/gun
activate_message = FALSE
Expand Down
73 changes: 73 additions & 0 deletions code/modules/admin/game_master/game_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ GLOBAL_LIST_EMPTY(game_masters)
/// List of assoc lists that hold "object_name", "objective_info", and "object_ref". Name of the objective, any info typed about the objective, and then a reference to be resolved of the object for passing through TGUI
GLOBAL_LIST_EMPTY(game_master_objectives)

GLOBAL_LIST_EMPTY(game_master_rappels)

/// Percentage of characters end up clear when sent via radio message
GLOBAL_VAR_INIT(radio_communication_clarity, 100)

Expand Down Expand Up @@ -160,6 +162,7 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100)

// Rappel stuff
data["rappel_click_intercept"] = rappel_click_intercept
data["game_master_rappels"] = length(GLOB.game_master_rappels) ? GLOB.game_master_rappels : ""

return data

Expand Down Expand Up @@ -251,6 +254,17 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100)
current_click_intercept_action = OBJECTIVE_CLICK_INTERCEPT_ACTION
return

if("toggle_click_rappel")
if(rappel_click_intercept)
reset_click_overrides()
return

reset_click_overrides()
rappel_click_intercept = TRUE
current_click_intercept_action = RAPPEL_CLICK_INTERCEPT_ACTION
return


if("jump_to")
if(!params["val"])
return
Expand Down Expand Up @@ -295,6 +309,39 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100)

GLOB.radio_communication_clarity = clamp(new_clarity, 0, 100)

if("remove_rappel")
if(!params["val"])
return

var/list/rappel = params["val"]

var/atom/rappel_atom = locate(rappel["rappel_ref"])

if(!rappel_atom)
return TRUE

if(tgui_alert(ui.user, "Do you want to remove [rappel_atom] ?", "Confirmation", list("Yes", "No")) != "Yes")
return TRUE

remove_rappel(rappel_atom)

if("jump_to_rappel")
if(!params["val"])
return

var/list/rappel = params["val"]

var/atom/rappel_atom = locate(rappel["rappel_ref"])

var/turf/rappel_turf = get_turf(rappel_atom)

if(!rappel_turf)
return TRUE

var/client/jumping_client = ui.user.client
jumping_client.jump_to_turf(rappel_turf)
return TRUE

/datum/game_master/ui_close(mob/user)
. = ..()

Expand Down Expand Up @@ -416,6 +463,23 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100)
))
return TRUE

if(RAPPEL_CLICK_INTERCEPT_ACTION)
var/turf/object_turf = get_turf(object)
if(LAZYACCESS(modifiers, MIDDLE_CLICK))
for(var/obj/effect/landmark/rappel/R in object_turf)
GLOB.game_master_rappels -= R
QDEL_NULL(R)
return TRUE

var/obj/effect/landmark/rappel/rappel = new(object_turf)
var/rappel_ref = REF(rappel)
GLOB.game_master_rappels += list(list(
"rappel" = rappel,
"rappel_name" = rappel.name,
"rappel_ref" = rappel_ref,
))
return TRUE

else
if(LAZYACCESS(modifiers, MIDDLE_CLICK))
for(var/datum/game_master_submenu/submenu in current_submenus)
Expand Down Expand Up @@ -455,6 +519,15 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100)

SSminimaps.remove_marker(removing_datum)

/datum/game_master/proc/remove_rappel(obj/removing_datum)
SIGNAL_HANDLER

for(var/list/cycled_rappel in GLOB.game_master_rappels)
if(cycled_rappel["rappel"] == removing_datum)
GLOB.game_master_rappels.Remove(list(cycled_rappel))
QDEL_NULL(removing_datum)



#undef DEFAULT_SPAWN_XENO_STRING
#undef GAME_MASTER_AI_XENOS
Expand Down
23 changes: 10 additions & 13 deletions tgui/packages/tgui/interfaces/GameMaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,33 +229,33 @@ export const GameMasterRappelPanel = (props, context) => {
const { data, act } = useBackend(context);

return (
<Section title="Objective" mb={1}>
<Section title="Rappel" mb={1}>
<Stack direction="column">
<Stack.Item>
<Button
ml={1}
selected={data.objective_click_intercept}
content="Click Objective"
selected={data.rappel_click_intercept}
content="Click Rappel"
onClick={() => {
act('toggle_click_objective');
act('toggle_click_rappel');
}}
/>
</Stack.Item>
{data.game_master_objectives && (
{data.game_master_rappels && (
<Stack.Item>
<Collapsible title="Objectives">
<Collapsible title="Rappel Points">
<Stack vertical>
{data.game_master_objectives.map((val) => {
{data.game_master_rappels.map((val) => {
if (val) {
return (
<Stack.Item>
<Divider />
<Stack>
<Stack.Item align="center">
<Button
content={val.object_name}
content={val.rappel_name}
onClick={() => {
act('jump_to', { val });
act('jump_to_rappel', { val });
}}
/>
</Stack.Item>
Expand All @@ -264,13 +264,10 @@ export const GameMasterRappelPanel = (props, context) => {
content="X"
color="bad"
onClick={() => {
act('remove_objective', { val });
act('remove_rappel', { val });
}}
/>
</Stack.Item>
<Stack.Item grow pl={1} py={0.25} fontSize="12px">
{val.objective_info}
</Stack.Item>
</Stack>
</Stack.Item>
);
Expand Down

0 comments on commit f4ba01c

Please sign in to comment.