From c37d7621eba436442b8cc1369a70e4fd50bdda2f Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Thu, 23 Nov 2023 03:13:17 -0500 Subject: [PATCH 1/3] initial --- code/__DEFINES/mode.dm | 1 + code/game/objects/structures/blocker.dm | 4 ++-- code/modules/admin/admin_verbs.dm | 1 + .../extra_buttons/toggle_vehicle_blockers.dm | 14 ++++++++++++++ colonialmarines.dme | 1 + 5 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 code/modules/admin/game_master/extra_buttons/toggle_vehicle_blockers.dm diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 3a3a2473ec..67458ee9ff 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -74,6 +74,7 @@ #define MODE_DISPOSABLE_MOBS (1<<10) // Toggles if mobs fit in disposals or not. Off by default. #define MODE_BYPASS_JOE (1<<11) // Toggles if ghosts can bypass Working Joe spawn limitations, does NOT bypass WL requirement. Off by default. #define MODE_NO_JOIN_AS_XENO (1<<12) // Toggles if players can join as xeno +#define MODE_BYPASS_VEHICLE_BLOCKERS (1<<13) /// Toggles if vehicles can bypass mapped vehicle blockers. Off by default. #define ROUNDSTATUS_FOG_DOWN 1 #define ROUNDSTATUS_PODDOORS_OPEN 2 diff --git a/code/game/objects/structures/blocker.dm b/code/game/objects/structures/blocker.dm index f85b1e65ff..24fab9574a 100644 --- a/code/game/objects/structures/blocker.dm +++ b/code/game/objects/structures/blocker.dm @@ -107,7 +107,7 @@ /obj/structure/blocker/forcefield/vehicles/handle_vehicle_bump(obj/vehicle/multitile/multitile_vehicle) - if(multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS) + if(MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_VEHICLE_BLOCKERS) || multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS) return TRUE return FALSE @@ -116,7 +116,7 @@ /obj/structure/blocker/forcefield/multitile_vehicles/handle_vehicle_bump(obj/vehicle/multitile/multitile_vehicle) - if(multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS) + if(MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_VEHICLE_BLOCKERS) || multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS) return TRUE return FALSE diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index c60555cb4e..d27ecbc6c7 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -330,6 +330,7 @@ var/list/roundstart_mod_verbs = list( add_verb(src, /client/proc/toggle_game_master) add_verb(src, /client/proc/toggle_join_xeno) add_verb(src, /client/proc/game_master_rename_platoon) + add_verb(src, /client/proc/toggle_vehicle_blockers) if(CLIENT_HAS_RIGHTS(src, R_SERVER)) add_verb(src, admin_verbs_server) if(CLIENT_HAS_RIGHTS(src, R_DEBUG)) diff --git a/code/modules/admin/game_master/extra_buttons/toggle_vehicle_blockers.dm b/code/modules/admin/game_master/extra_buttons/toggle_vehicle_blockers.dm new file mode 100644 index 0000000000..4348d836c3 --- /dev/null +++ b/code/modules/admin/game_master/extra_buttons/toggle_vehicle_blockers.dm @@ -0,0 +1,14 @@ +/// For PvE CM a convenient button to enable/disable the invisible vehicle blockers. +/client/proc/toggle_vehicle_blockers() + set name = "Toggle Vehicle Blockers" + set category = "Game Master.Extras" + + if(!admin_holder || !check_rights(R_MOD, FALSE)) + return + + if(!SSticker.mode) + to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) + return + + SSticker.mode.toggleable_flags ^= MODE_BYPASS_VEHICLE_BLOCKERS + message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_VEHICLE_BLOCKERS) ? "allowed vehicles to bypass" : "prevented vehicles from bypassing"] vehicle blockers.") diff --git a/colonialmarines.dme b/colonialmarines.dme index 6fa9e44a96..4a12db7f57 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -1382,6 +1382,7 @@ #include "code\modules\admin\game_master\game_master_submenu.dm" #include "code\modules\admin\game_master\extra_buttons\rename_platoon.dm" #include "code\modules\admin\game_master\extra_buttons\toggle_join_xeno.dm" +#include "code\modules\admin\game_master\extra_buttons\toggle_vehicle_blockers.dm" #include "code\modules\admin\game_master\game_master_submenu\ambush.dm" #include "code\modules\admin\game_master\game_master_submenu\tunnels.dm" #include "code\modules\admin\game_master\game_master_submenu\vents.dm" From 86009e234f19d1f32a1315e24cd3259486dc5b3c Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Sat, 25 Nov 2023 19:19:00 -0500 Subject: [PATCH 2/3] global variable, Flags section --- code/__DEFINES/mode.dm | 1 - code/game/objects/structures/blocker.dm | 9 +++++++-- .../game_master/extra_buttons/toggle_join_xeno.dm | 2 +- .../extra_buttons/toggle_vehicle_blockers.dm | 10 +++------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 67458ee9ff..3a3a2473ec 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -74,7 +74,6 @@ #define MODE_DISPOSABLE_MOBS (1<<10) // Toggles if mobs fit in disposals or not. Off by default. #define MODE_BYPASS_JOE (1<<11) // Toggles if ghosts can bypass Working Joe spawn limitations, does NOT bypass WL requirement. Off by default. #define MODE_NO_JOIN_AS_XENO (1<<12) // Toggles if players can join as xeno -#define MODE_BYPASS_VEHICLE_BLOCKERS (1<<13) /// Toggles if vehicles can bypass mapped vehicle blockers. Off by default. #define ROUNDSTATUS_FOG_DOWN 1 #define ROUNDSTATUS_PODDOORS_OPEN 2 diff --git a/code/game/objects/structures/blocker.dm b/code/game/objects/structures/blocker.dm index 24fab9574a..0171b19d7b 100644 --- a/code/game/objects/structures/blocker.dm +++ b/code/game/objects/structures/blocker.dm @@ -101,13 +101,16 @@ if(!visible) invisibility = 101 +GLOBAL_VAR_INIT(vehicle_blockers, TRUE) /obj/structure/blocker/forcefield/vehicles types = list(/obj/vehicle/) /obj/structure/blocker/forcefield/vehicles/handle_vehicle_bump(obj/vehicle/multitile/multitile_vehicle) - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_VEHICLE_BLOCKERS) || multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS) + if(!GLOB.vehicle_blockers) + return TRUE + if(multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS) return TRUE return FALSE @@ -116,7 +119,9 @@ /obj/structure/blocker/forcefield/multitile_vehicles/handle_vehicle_bump(obj/vehicle/multitile/multitile_vehicle) - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_VEHICLE_BLOCKERS) || multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS) + if(!GLOB.vehicle_blockers) + return TRUE + if(multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS) return TRUE return FALSE diff --git a/code/modules/admin/game_master/extra_buttons/toggle_join_xeno.dm b/code/modules/admin/game_master/extra_buttons/toggle_join_xeno.dm index 5fb931206a..7b2078f794 100644 --- a/code/modules/admin/game_master/extra_buttons/toggle_join_xeno.dm +++ b/code/modules/admin/game_master/extra_buttons/toggle_join_xeno.dm @@ -2,7 +2,7 @@ /// For PvE CM we start without the ability for people to join as xenos. This can be toggled by game masters. /client/proc/toggle_join_xeno() set name = "Toggle Player Xeno Joins" - set category = "Game Master.Extras" + set category = "Game Master.Flags" if(!admin_holder || !check_rights(R_MOD, FALSE)) return diff --git a/code/modules/admin/game_master/extra_buttons/toggle_vehicle_blockers.dm b/code/modules/admin/game_master/extra_buttons/toggle_vehicle_blockers.dm index 4348d836c3..e5b0508c71 100644 --- a/code/modules/admin/game_master/extra_buttons/toggle_vehicle_blockers.dm +++ b/code/modules/admin/game_master/extra_buttons/toggle_vehicle_blockers.dm @@ -1,14 +1,10 @@ /// For PvE CM a convenient button to enable/disable the invisible vehicle blockers. /client/proc/toggle_vehicle_blockers() set name = "Toggle Vehicle Blockers" - set category = "Game Master.Extras" + set category = "Game Master.Flags" if(!admin_holder || !check_rights(R_MOD, FALSE)) return - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_BYPASS_VEHICLE_BLOCKERS - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_VEHICLE_BLOCKERS) ? "allowed vehicles to bypass" : "prevented vehicles from bypassing"] vehicle blockers.") + GLOB.vehicle_blockers = !GLOB.vehicle_blockers + message_admins("[src] has [GLOB.vehicle_blockers ? "enabled" : "disabled"] vehicle blockers.") From 5462ce47d2f0ce8394385ec33bb73b8c83777570 Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Tue, 28 Nov 2023 04:52:49 -0500 Subject: [PATCH 3/3] Update admin_verbs.dm --- code/modules/admin/admin_verbs.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index c3e3401bdd..3f4e721d59 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -362,6 +362,7 @@ var/list/roundstart_mod_verbs = list( /client/proc/toggle_game_master, /client/proc/toggle_join_xeno, /client/proc/game_master_rename_platoon, + /client/proc/toggle_vehicle_blockers, admin_verbs_admin, admin_verbs_ban, admin_verbs_minor_event,