From a7d2e30ee655c23970341850c42462cde1ce85b1 Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Fri, 1 Dec 2023 18:46:10 -0500 Subject: [PATCH] GM button: toggle vehicle blockers (#75) --- code/game/objects/structures/blocker.dm | 5 +++++ code/modules/admin/admin_verbs.dm | 2 ++ .../game_master/extra_buttons/toggle_join_xeno.dm | 2 +- .../extra_buttons/toggle_vehicle_blockers.dm | 10 ++++++++++ colonialmarines.dme | 1 + 5 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 code/modules/admin/game_master/extra_buttons/toggle_vehicle_blockers.dm diff --git a/code/game/objects/structures/blocker.dm b/code/game/objects/structures/blocker.dm index f85b1e65ff..0171b19d7b 100644 --- a/code/game/objects/structures/blocker.dm +++ b/code/game/objects/structures/blocker.dm @@ -101,12 +101,15 @@ 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(!GLOB.vehicle_blockers) + return TRUE if(multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS) return TRUE return FALSE @@ -116,6 +119,8 @@ /obj/structure/blocker/forcefield/multitile_vehicles/handle_vehicle_bump(obj/vehicle/multitile/multitile_vehicle) + if(!GLOB.vehicle_blockers) + return TRUE if(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 8c556d2a9a..3f4e721d59 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -329,6 +329,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)) @@ -361,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, 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 new file mode 100644 index 0000000000..e5b0508c71 --- /dev/null +++ b/code/modules/admin/game_master/extra_buttons/toggle_vehicle_blockers.dm @@ -0,0 +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.Flags" + + if(!admin_holder || !check_rights(R_MOD, FALSE)) + return + + GLOB.vehicle_blockers = !GLOB.vehicle_blockers + message_admins("[src] has [GLOB.vehicle_blockers ? "enabled" : "disabled"] vehicle blockers.") diff --git a/colonialmarines.dme b/colonialmarines.dme index b1fc28f93e..d1942e6e66 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -1384,6 +1384,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"