From 934cd3c89b0e40d126eef7d029535fb0b3cba7c5 Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Wed, 10 Jan 2024 22:03:53 +0300 Subject: [PATCH 1/6] 1 --- code/modules/admin/game_master/game_master.dm | 9 +++ tgui/packages/tgui/interfaces/GameMaster.js | 63 +++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/code/modules/admin/game_master/game_master.dm b/code/modules/admin/game_master/game_master.dm index 1e2cbd3cc2..fc86dfa069 100644 --- a/code/modules/admin/game_master/game_master.dm +++ b/code/modules/admin/game_master/game_master.dm @@ -47,6 +47,7 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100) #define SPAWN_CLICK_INTERCEPT_ACTION "spawn_click_intercept_action" #define BEHAVIOR_CLICK_INTERCEPT_ACTION "behavior_click_intercept_action" #define OBJECTIVE_CLICK_INTERCEPT_ACTION "objective_click_intercept_action" +#define RAPPEL_CLICK_INTERCEPT_ACTION "rappel_click_intercept_action" /datum/game_master @@ -101,6 +102,9 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100) /// The holder for the game master's virtual phone var/atom/movable/game_master_phone + /// If we are currently using the click intercept for the rappel section + var/rappel_click_intercept = FALSE + /datum/game_master/New(client/using_client) . = ..() @@ -154,6 +158,9 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100) // Communication stuff data["communication_clarity"] = GLOB.radio_communication_clarity + // Rappel stuff + data["rappel_click_intercept"] = rappel_click_intercept + return data /datum/game_master/ui_static_data(mob/user) @@ -299,6 +306,7 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100) objective_click_intercept = FALSE behavior_click_intercept = FALSE current_click_intercept_action = null + rappel_click_intercept = FALSE for(var/datum/component/ai_behavior_override/override in GLOB.all_ai_behavior_overrides) game_master_client.images -= override.behavior_image @@ -428,6 +436,7 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100) objective_click_intercept = FALSE behavior_click_intercept = FALSE current_click_intercept_action = null + rappel_click_intercept = FALSE /datum/game_master/proc/is_objective(atom/checked_object) for(var/list/cycled_objective in GLOB.game_master_objectives) diff --git a/tgui/packages/tgui/interfaces/GameMaster.js b/tgui/packages/tgui/interfaces/GameMaster.js index 6814a89394..bd927597e9 100644 --- a/tgui/packages/tgui/interfaces/GameMaster.js +++ b/tgui/packages/tgui/interfaces/GameMaster.js @@ -16,6 +16,8 @@ export const GameMaster = (props, context) => { + + @@ -222,3 +224,64 @@ export const GameMasterCommunicationPanel = (props, context) => { ); }; + +export const GameMasterRappelPanel = (props, context) => { + const { data, act } = useBackend(context); + + return ( +
+ + +
+ ); +}; From f4ba01cc5882b61831b7af9499bb66383d1a2d4c Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Wed, 10 Jan 2024 23:33:10 +0300 Subject: [PATCH 2/6] 2 --- code/datums/skills/uscm.dm | 2 + code/game/objects/items/devices/flashlight.dm | 21 ++++++ code/modules/admin/game_master/game_master.dm | 73 +++++++++++++++++++ tgui/packages/tgui/interfaces/GameMaster.js | 23 +++--- 4 files changed, 106 insertions(+), 13 deletions(-) diff --git a/code/datums/skills/uscm.dm b/code/datums/skills/uscm.dm index d3f4823286..871278ff23 100644 --- a/code/datums/skills/uscm.dm +++ b/code/datums/skills/uscm.dm @@ -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 @@ -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 diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 114964464a..3f9dc09ae6 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -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 diff --git a/code/modules/admin/game_master/game_master.dm b/code/modules/admin/game_master/game_master.dm index fc86dfa069..d623cac48b 100644 --- a/code/modules/admin/game_master/game_master.dm +++ b/code/modules/admin/game_master/game_master.dm @@ -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) @@ -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 @@ -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 @@ -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) . = ..() @@ -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) @@ -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 diff --git a/tgui/packages/tgui/interfaces/GameMaster.js b/tgui/packages/tgui/interfaces/GameMaster.js index bd927597e9..a460dafa07 100644 --- a/tgui/packages/tgui/interfaces/GameMaster.js +++ b/tgui/packages/tgui/interfaces/GameMaster.js @@ -229,23 +229,23 @@ export const GameMasterRappelPanel = (props, context) => { const { data, act } = useBackend(context); return ( -
+
); }; - -export const GameMasterRappelPanel = (props, context) => { - const { data, act } = useBackend(context); - - return ( -
- - -
- ); -}; diff --git a/tgui/packages/tgui/interfaces/GameMasterRappelMenu.js b/tgui/packages/tgui/interfaces/GameMasterRappelMenu.js new file mode 100644 index 0000000000..b39e0d4b77 --- /dev/null +++ b/tgui/packages/tgui/interfaces/GameMasterRappelMenu.js @@ -0,0 +1,75 @@ +import { useBackend } from '../backend'; +import { Dropdown, Button, Section, Slider, Collapsible, Stack, Divider } from '../components'; +import { Window } from '../layouts'; + +export const GameMasterRappelMenu = (props, context) => { + const { data, act } = useBackend(context); + + return ( + + + + + + + + ); +}; + +export const GameMasterRappelPanel = (props, context) => { + const { data, act } = useBackend(context); + + return ( +
+ + +
+ ); +}; From a179ea6b269005f852bcbd06d9accb8aae71ae07 Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Thu, 11 Jan 2024 01:38:41 +0300 Subject: [PATCH 4/6] cleanup --- tgui/packages/tgui/interfaces/GameMaster.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tgui/packages/tgui/interfaces/GameMaster.js b/tgui/packages/tgui/interfaces/GameMaster.js index 433e763c1c..6814a89394 100644 --- a/tgui/packages/tgui/interfaces/GameMaster.js +++ b/tgui/packages/tgui/interfaces/GameMaster.js @@ -16,7 +16,6 @@ export const GameMaster = (props, context) => { - From 3cdd31a31a5945bf28c8a290136bfaa3a606d3b7 Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Thu, 11 Jan 2024 01:41:15 +0300 Subject: [PATCH 5/6] cleanup2 --- code/modules/admin/game_master/game_master.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/modules/admin/game_master/game_master.dm b/code/modules/admin/game_master/game_master.dm index 5a27da28e7..1e2cbd3cc2 100644 --- a/code/modules/admin/game_master/game_master.dm +++ b/code/modules/admin/game_master/game_master.dm @@ -48,6 +48,7 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100) #define BEHAVIOR_CLICK_INTERCEPT_ACTION "behavior_click_intercept_action" #define OBJECTIVE_CLICK_INTERCEPT_ACTION "objective_click_intercept_action" + /datum/game_master var/client/game_master_client @@ -100,6 +101,7 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100) /// The holder for the game master's virtual phone var/atom/movable/game_master_phone + /datum/game_master/New(client/using_client) . = ..() @@ -444,6 +446,7 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100) SSminimaps.remove_marker(removing_datum) + #undef DEFAULT_SPAWN_XENO_STRING #undef GAME_MASTER_AI_XENOS #undef DEFAULT_XENO_AMOUNT_TO_SPAWN From bd6c96d8ca9a4160d43da6db5519ff6b37a5c695 Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:10:57 +0300 Subject: [PATCH 6/6] Update GameMasterRappelMenu.js --- tgui/packages/tgui/interfaces/GameMasterRappelMenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgui/packages/tgui/interfaces/GameMasterRappelMenu.js b/tgui/packages/tgui/interfaces/GameMasterRappelMenu.js index b39e0d4b77..f1e3286db4 100644 --- a/tgui/packages/tgui/interfaces/GameMasterRappelMenu.js +++ b/tgui/packages/tgui/interfaces/GameMasterRappelMenu.js @@ -1,5 +1,5 @@ import { useBackend } from '../backend'; -import { Dropdown, Button, Section, Slider, Collapsible, Stack, Divider } from '../components'; +import { Button, Section, Collapsible, Stack, Divider } from '../components'; import { Window } from '../layouts'; export const GameMasterRappelMenu = (props, context) => {