Skip to content

Commit

Permalink
GM button: toggle vehicle blockers (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
Doubleumc authored Dec 1, 2023
1 parent d57a33b commit a7d2e30
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions code/game/objects/structures/blocker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.")
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a7d2e30

Please sign in to comment.