Merge pull request #11083 from Heroman3003/modwl

Adds possibility of borg module whitelisting
This commit is contained in:
Aronai Sieyes
2021-10-24 19:48:46 -04:00
committed by GitHub
6 changed files with 45 additions and 20 deletions
+17
View File
@@ -89,6 +89,23 @@ var/list/whitelist = list()
return FALSE
/proc/is_borg_whitelisted(mob/M, var/module)
//They are admin or the whitelist isn't in use
if(whitelist_overrides(M))
return 1
//You did something wrong
if(!M || !module)
return 0
//If we have a loaded file, search it
if(alien_whitelist)
for (var/s in alien_whitelist)
if(findtext(s,"[M.ckey] - [module]"))
return 1
if(findtext(s,"[M.ckey] - All"))
return 1
/proc/whitelist_overrides(mob/M)
if(!config.usealienwhitelist)
return TRUE
+15 -2
View File
@@ -134,11 +134,24 @@ var/DBConnection/dbcon_old = new() // /tg/station database (Old database) -- see
var/global/list/alphabet_uppercase = list("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")
// Used by robots and robot preferences.
// Used by robots and robot preferences for regular modules.
var/list/robot_module_types = list(
"Standard", "Engineering", "Surgeon", "Crisis",
"Miner", "Janitor", "Service", "Clerical", "Security",
"Research"
"Research", "Medihound", "K9", "Janihound", "Sci-borg", "Pupdozer",
"Service-Hound", "BoozeHound", "KMine"
)
// List of modules added during code red
var/list/emergency_module_types = list(
"Combat", "ERT"
)
// List of modules available to AI shells
var/list/shell_module_types = list(
"Standard", "Service", "Clerical", "Service-Hound", "BoozeHound"
)
// List of whitelisted modules
var/list/whitelisted_module_types = list(
"Lost", "Stray"
)
// Some scary sounds.
-15
View File
@@ -1,18 +1,3 @@
/hook/startup/proc/modules_vr()
robot_module_types += "Medihound"
robot_module_types += "K9"
robot_module_types += "Janihound"
robot_module_types += "Sci-borg"
robot_module_types += "Pupdozer"
robot_module_types += "Service-Hound"
robot_module_types += "BoozeHound"
robot_module_types += "KMine"
return 1
var/list/shell_module_types = list(
"Standard", "Service", "Clerical", "Service-Hound"
)
var/list/awayabductors = list() // List of scatter landmarks for Abductors in Gateways
var/list/eventdestinations = list() // List of scatter landmarks for VOREStation event portals
var/list/eventabductors = list() // List of scatter landmarks for VOREStation abductor portals
@@ -271,8 +271,10 @@
modules.Add(robot_module_types)
if(crisis || security_level == SEC_LEVEL_RED || crisis_override)
to_chat(src, "<font color='red'>Crisis mode active. Combat module available.</font>")
modules+="Combat"
modules+="ERT"
modules += emergency_module_types
for(var/module_name in whitelisted_module_types)
if(is_borg_whitelisted(src, module_name))
modules += module_name
//VOREStatation Edit End: shell restrictions
modtype = tgui_input_list(usr, "Please, select a module!", "Robot module", modules)
@@ -280,6 +282,8 @@
return
if(!(modtype in robot_modules))
return
if(!is_borg_whitelisted(src, modtype))
return
var/module_type = robot_modules[modtype]
transform_with_anim() //VOREStation edit: sprite animation
@@ -9,7 +9,12 @@ var/global/list/robot_modules = list(
"Security" = /obj/item/weapon/robot_module/robot/security/general,
"Combat" = /obj/item/weapon/robot_module/robot/security/combat,
"Engineering" = /obj/item/weapon/robot_module/robot/engineering/general,
"Janitor" = /obj/item/weapon/robot_module/robot/janitor
"Janitor" = /obj/item/weapon/robot_module/robot/janitor,
"Gravekeeper" = /obj/item/weapon/robot_module/robot/gravekeeper,
"Lost" = /obj/item/weapon/robot_module/robot/lost,
"Protector" = /obj/item/weapon/robot_module/robot/syndicate/protector,
"Mechanist" = /obj/item/weapon/robot_module/robot/syndicate/mechanist,
"Combat Medic" = /obj/item/weapon/robot_module/robot/syndicate/combat_medic
)
/obj/item/weapon/robot_module
@@ -49,6 +49,7 @@
robot_modules["Service-Hound"] = /obj/item/weapon/robot_module/robot/clerical/brodog
robot_modules["BoozeHound"] = /obj/item/weapon/robot_module/robot/booze
robot_modules["KMine"] = /obj/item/weapon/robot_module/robot/kmine
robot_modules["Stray"] = /obj/item/weapon/robot_module/robot/stray
return 1
//Just add a new proc with the robot_module type if you wish to run some other vore code