Merge pull request #5696 from Heroman3003/shell-restrictions

Restricts AI shells module- and z-level- wise
This commit is contained in:
Novacat
2019-08-23 01:38:59 -04:00
committed by GitHub
8 changed files with 50 additions and 9 deletions

View File

@@ -27,7 +27,7 @@
for(var/borgie in GLOB.available_ai_shells)
var/mob/living/silicon/robot/R = borgie
if(R.shell && !R.deployed && (R.stat != DEAD) && (!R.connected_ai || (R.connected_ai == src) ) )
if(R.shell && !R.deployed && (R.stat != DEAD) && (!R.connected_ai || (R.connected_ai == src) ) && !(using_map.ai_shell_restricted && !(R.z in using_map.ai_shell_allowed_levels)) ) //VOREStation Edit: shell restrictions
possible += R
if(!LAZYLEN(possible))

View File

@@ -259,11 +259,16 @@
if(module)
return
var/list/modules = list()
modules.Add(robot_module_types)
if(crisis || security_level == SEC_LEVEL_RED || crisis_override) // VOREStation Edit
to_chat(src, "<font color='red'>Crisis mode active. Combat module available.</font>")
modules+="Combat"
modules+="ERT" //VOREStation Edit
//VOREStatation Edit Start: shell restrictions
if(shell)
modules.Add(shell_module_types)
else
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"
//VOREStatation Edit End: shell restrictions
modtype = input("Please, select a module!", "Robot module", null, null) as null|anything in modules
if(module)

View File

@@ -48,6 +48,8 @@ var/global/list/robot_modules = list(
apply_status_flags(R)
if(R.radio)
if(R.shell)
channels = R.mainframe.aiRadio.channels
R.radio.recalculateChannels()
vr_add_sprites() //Vorestation Edit: For vorestation only sprites

View File

@@ -69,11 +69,14 @@ GLOBAL_LIST_EMPTY(available_ai_shells)
// Languages and comms.
languages = AI.languages.Copy()
speech_synthesizer_langs = AI.speech_synthesizer_langs.Copy()
if(radio && AI.aiRadio) //AI keeps all channels, including Syndie if it is an Infiltrator.
//VOREStation Edit Start
if(radio && AI.aiRadio && module) //AI keeps all channels, including Syndie if it is an Infiltrator.
// if(AI.radio.syndie)
// radio.make_syndie()
radio.subspace_transmission = TRUE
radio.channels = AI.aiRadio.channels
module.channels = AI.aiRadio.channels
radio.recalculateChannels()
//VOREStation Edit End
// Called after the AI transfers over.
/mob/living/silicon/robot/proc/post_deploy()
@@ -94,7 +97,8 @@ GLOBAL_LIST_EMPTY(available_ai_shells)
mainframe.deployed_shell = null
SetName("[modtype] AI Shell [num2text(ident)]")
// undeployment_action.Remove(src)
if(radio) //Return radio to normal
if(radio && module) //Return radio to normal //VOREStation Edit
module.channels = initial(module.channels) //VOREStation Edit
radio.recalculateChannels()
if(!QDELETED(camera))
camera.c_tag = real_name //update the camera name too

View File

@@ -258,3 +258,10 @@
return
if(buckle_mob(M))
visible_message("<span class='notice'>[M] starts riding [name]!</span>")
/mob/living/silicon/robot/onTransitZ(old_z, new_z)
if(shell)
if(deployed && using_map.ai_shell_restricted && !(new_z in using_map.ai_shell_allowed_levels))
to_chat(src,"<span class='warning'>Your connection with the shell is suddenly interrupted!</span>")
undeploy()
..()