AI Remote Control Fixes (#20198)

Fixes https://github.com/Aurorastation/Aurora.3/issues/13267
Fixes https://github.com/Aurorastation/Aurora.3/issues/16881
Fixes https://github.com/Aurorastation/Aurora.3/issues/14039
Fixes https://github.com/Aurorastation/Aurora.3/issues/14062

Also adds QoL where pressing eject on remote controlled mechs exits
remote control.

---------

Co-authored-by: Ben10083 <Ben10083@users.noreply.github.com>
This commit is contained in:
Ben
2024-12-03 12:44:02 +00:00
committed by GitHub
co-authored by Ben10083
parent 0c3e762d93
commit 534a0774eb
10 changed files with 238 additions and 113 deletions
+71 -79
View File
@@ -15,11 +15,11 @@
* Misc
*/
///sort any value in a list
/// Sort any value in a list
/proc/sort_list(list/list_to_sort, cmp=/proc/cmp_text_asc)
return sortTim(list_to_sort.Copy(), cmp)
///Returns a list in plain english as a string
/// Returns a list in plain english as a string
/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" )
SHOULD_BE_PURE(TRUE)
SHOULD_NOT_SLEEP(TRUE)
@@ -42,7 +42,7 @@
return "[output][and_text][input[index]]"
//Returns a newline-separated list that counts equal-ish items, outputting count and item names, optionally with icons and specific determiners
/// Returns a newline-separated list that counts equal-ish items, outputting count and item names, optionally with icons and specific determiners
/proc/counting_english_list(var/list/input, output_icons = TRUE, determiners = DET_NONE, nothing_text = "nothing", line_prefix = "\t", first_item_prefix = "\n", last_item_suffix = "\n", and_text = "\n", comma_text = "\n", final_comma_text = "")
var/list/counts = list() // counted input items
var/list/items = list() // actual objects for later reference (for icons and formatting)
@@ -90,7 +90,7 @@
// finally return the list using regular english_list builder
return english_list(out, nothing_text, and_text, comma_text, final_comma_text)
//A "preset" for counting_english_list that displays the list "inline" (comma separated)
/// A "preset" for counting_english_list that displays the list "inline" (comma separated)
/proc/inline_counting_english_list(var/list/input, output_icons = TRUE, determiners = DET_NONE, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "", line_prefix = "", first_item_prefix = "", last_item_suffix = "")
return counting_english_list(input, output_icons, determiners, nothing_text, and_text, comma_text, final_comma_text)
@@ -110,7 +110,7 @@
return TRUE
return FALSE
// Checks that all of the values are in the given list
/// Checks that all of the values are in the given list
/proc/all_in_list(var/list/values, var/list/L)
if(!istype(values) || !istype(L))
return FALSE
@@ -160,19 +160,17 @@
return FALSE
return TRUE
//Removes any null entries from the list
//Returns TRUE if the list had nulls, FALSE otherwise
/// Removes any null entries from the list
/// Returns TRUE if the list had nulls, FALSE otherwise
/proc/listclearnulls(list/L)
var/start_len = L.len
var/list/N = new(start_len)
L -= N
return L.len < start_len
/*
* Returns list containing all the entries from first list that are not present in second.
* If skiprep = 1, repeated elements are treated as one.
* If either of arguments is not a list, returns null
*/
/// Returns list containing all the entries from first list that are not present in second.
/// If skiprep = 1, repeated elements are treated as one.
/// If either of arguments is not a list, returns null
/proc/difflist(var/list/first, var/list/second, var/skiprep=0)
if(!islist(first) || !islist(second))
return
@@ -185,11 +183,9 @@
result = first - second
return result
/*
* Returns list containing entries that are in either list but not both.
* If skipref = 1, repeated elements are treated as one.
* If either of arguments is not a list, returns null
*/
/// Returns list containing entries that are in either list but not both.
/// If skipref = 1, repeated elements are treated as one.
/// If either of arguments is not a list, returns null
/proc/uniquemergelist(var/list/first, var/list/second, var/skiprep=0)
if(!islist(first) || !islist(second))
return
@@ -200,11 +196,9 @@
result = first ^ second
return result
/*
* Returns a list with the results from both lists
* If norepeat = TRUE, it won't include repeat instances.
* If unpack = TRUE, it unpacks each list
*/
/// Returns a list with the results from both lists
/// If norepeat = TRUE, it won't include repeat instances.
/// If unpack = TRUE, it unpacks each list
/proc/mergelists(var/list/first, var/list/second, var/norepeat = TRUE, var/unpack = FALSE)
if(!islist(first) || !islist(second))
return
@@ -223,10 +217,8 @@
result += A
return result
/*
* Returns a list with the unpacked results from the list.
* If repeatunpack = TRUE, it unpacks each found list within it
*/
/// Returns a list with the unpacked results from the list.
/// If repeatunpack = TRUE, it unpacks each found list within it
/proc/unpacklist(var/list/packed, repeatunpack = TRUE)
if(!islist(packed))
return
@@ -244,10 +236,10 @@
result += A
return result
//Picks a random element by weight from a list. The list must be correctly constructed in this format:
//mylist[myelement1] = myweight1
//mylist[myelement2] = myweight2
//The proc will return the element index, and not the weight.
/// Picks a random element by weight from a list. The list must be correctly constructed in this format:
/// mylist[myelement1] = myweight1
/// mylist[myelement2] = myweight2
/// The proc will return the element index, and not the weight.
/proc/pickweight(list/L)
var/total = 0
var/item
@@ -266,7 +258,7 @@
return null
//Pick a random element from the list and remove it from the list.
/// Pick a random element from the list and remove it from the list.
/proc/pick_n_take(list/listfrom)
if (listfrom.len > 0)
var/picked = pick(listfrom)
@@ -274,7 +266,7 @@
return picked
return null
//Returns the top(last) element from the list and removes it from the list (typical stack function)
/// Returns the top(last) element from the list and removes it from the list (typical stack function)
/proc/pop(list/listfrom)
if (listfrom.len > 0)
var/picked = listfrom[listfrom.len]
@@ -282,13 +274,13 @@
return picked
return null
//Returns the first element from the list and removes it from the list
/// Returns the first element from the list and removes it from the list
/proc/popleft(list/L)
if(length(L))
. = L[1]
L.Cut(1,2)
//Returns the next element in parameter list after first appearance of parameter element. If it is the last element of the list or not present in list, returns first element.
/// Returns the next element in parameter list after first appearance of parameter element. If it is the last element of the list or not present in list, returns first element.
/proc/next_in_list(element, list/L)
for(var/i=1, i<L.len, i++)
if(L[i] == element)
@@ -315,7 +307,7 @@
* Sorting
*/
//Reverses the order of items in the list
/// Reverses the order of items in the list
/proc/reverselist(list/L)
var/list/output = list()
if(L)
@@ -323,7 +315,7 @@
output += L[i]
return output
//Randomize: Return the list in a random order
/// Randomize: Return the list in a random order
/proc/shuffle(var/list/L)
if(!L)
return
@@ -334,27 +326,27 @@
L.Swap(i, rand(i,L.len))
return L
//Return a list with no duplicate entries
/// Return a list with no duplicate entries
/proc/uniquelist(var/list/L)
. = list()
for(var/i in L)
. |= i
//Mergesort: divides up the list into halves to begin the sort
/// Mergesort: divides up the list into halves to begin the sort
/proc/sortKey(var/list/client/L, var/order = 1)
if (!L)
return
var/list/target = L.Copy()
return sortTim(target, order ? GLOBAL_PROC_REF(cmp_ckey_asc) : GLOBAL_PROC_REF(cmp_ckey_dsc), FALSE)
//Mergesort: divides up the list into halves to begin the sort
/// Mergesort: divides up the list into halves to begin the sort
/proc/sortAtom(var/list/atom/L, var/order = 1)
if (!L)
return
var/list/target = L.Copy()
return sortTim(target, order ? GLOBAL_PROC_REF(cmp_name_asc) : GLOBAL_PROC_REF(cmp_name_dsc), FALSE)
//Mergesort: Specifically for record datums in a list.
/// Mergesort: Specifically for record datums in a list.
/proc/sortRecord(var/list/datum/record/L, var/order = 1)
if (!L)
return
@@ -362,21 +354,21 @@
sortTim(target, order ? GLOBAL_PROC_REF(cmp_records_asc) : GLOBAL_PROC_REF(cmp_records_dsc), FALSE)
return target
//Mergesort: any value in a list
/// Mergesort: any value in a list
/proc/sortList(var/list/L)
if (!L)
return
var/list/target = L.Copy()
return sortTim(target, GLOBAL_PROC_REF(cmp_text_asc))
//Mergsorge: uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead
/// Mergesort: uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead
/proc/sortNames(var/list/L)
if (!L)
return
var/list/target = L.Copy()
return sortTim(target, GLOBAL_PROC_REF(cmp_name_asc), FALSE)
// List of lists, sorts by element[key] - for things like crew monitoring computer sorting records by name.
/// List of lists, sorts by element[key] - for things like crew monitoring computer sorting records by name.
/proc/sortByKey(var/list/L, var/key)
if(L.len < 2)
return L
@@ -401,7 +393,7 @@
return (result + R.Copy(Ri, 0))
//Mergesort: any value in a list, preserves key=value structure
/// Mergesort: any value in a list, preserves key=value structure
/proc/sortAssoc(var/list/L)
var/list/ret = L.Copy()
sortTim(ret, GLOBAL_PROC_REF(cmp_text_asc), FALSE)
@@ -415,7 +407,7 @@
#define BITFIELDMAX 0xFFFFFF
#define BITFIELDMAX_16 0xFFFF
//Converts a bitfield to a list of numbers (or words if a wordlist is provided)
/// Converts a bitfield to a list of numbers (or words if a wordlist is provided)
/proc/bitfield2list(bitfield = 0, list/wordlist)
var/list/r = list()
if(istype(wordlist,/list))
@@ -432,7 +424,7 @@
return r
// Returns the key based on the index
/// Returns the key based on the index
/proc/get_key_by_index(var/list/L, var/index)
var/i = 1
for(var/key in L)
@@ -441,7 +433,7 @@
i++
return null
// Returns the key based on the index
/// Returns the key based on the index
/proc/get_key_by_value(var/list/L, var/value)
for(var/key in L)
if(L[key] == value)
@@ -477,7 +469,7 @@
return (result + L.Copy(Li, 0))
return (result + R.Copy(Ri, 0))
// Insert an object into a sorted list, preserving sortedness
/// Insert an object into a sorted list, preserving sortedness
/proc/dd_insertObjectList(var/list/L, var/O)
var/min = 1
var/max = L.len
@@ -500,12 +492,12 @@
else
min = mid+1
/// Returns a new list with the text values sorted.
/// Use binary search to order by sortValue.
/// This works by going to the half-point of the list, seeing if the node in question is higher or lower cost,
/// then going halfway up or down the list and checking again.
/// This is a very fast way to sort an item into a list.
/proc/dd_sortedtextlist(list/incoming, case_sensitive = 0)
// Returns a new list with the text values sorted.
// Use binary search to order by sortValue.
// This works by going to the half-point of the list, seeing if the node in question is higher or lower cost,
// then going halfway up or down the list and checking again.
// This is a very fast way to sort an item into a list.
var/list/sorted_text = new()
var/low_index
var/high_index
@@ -573,15 +565,15 @@
/proc/is_list_containing_type(var/list/L, type)
return count_by_type(L, type) == L.len
//creates every subtype of prototype (excluding prototype) and adds it to list L.
//if no list/L is provided, one is created.
/// Creates every subtype of prototype (excluding prototype) and adds it to list L.
/// if no list/L is provided, one is created.
/proc/init_subtypes(prototype, list/L)
if(!istype(L)) L = list()
for(var/path in subtypesof(prototype))
L += new path()
return L
//returns a new list with only atoms that are in typecache L
/// Returns a new list with only atoms that are in typecache L
/proc/typecache_filter_list(list/atoms, list/typecache)
. = list()
for(var/atom/A as anything in atoms)
@@ -610,7 +602,7 @@
if(typecache[D.type])
return D
//Like typesof() or subtypesof(), but returns a typecache instead of a list
/// Like typesof() or subtypesof(), but returns a typecache instead of a list
/proc/typecacheof(path, ignore_root_path, only_root_path = FALSE)
if(ispath(path))
var/list/types = list()
@@ -638,7 +630,7 @@
L[T] = TRUE
return L
//Checks for specific types in specifically structured (Assoc "type" = TRUE) lists ('typecaches')
/// Checks for specific types in specifically structured (Assoc "type" = TRUE) lists ('typecaches')
/proc/is_type_in_typecache(atom/A, list/L)
if(!L || !L.len || !A)
@@ -655,12 +647,12 @@
return total
//Move a single element from position fromIndex within a list, to position toIndex
//All elements in the range [1,toIndex) before the move will be before the pivot afterwards
//All elements in the range [toIndex, L.len+1) before the move will be after the pivot afterwards
//In other words, it's as if the range [fromIndex,toIndex) have been rotated using a <<< operation common to other languages.
//fromIndex and toIndex must be in the range [1,L.len+1]
//This will preserve associations ~Carnie
/// Move a single element from position fromIndex within a list, to position toIndex
/// All elements in the range [1,toIndex) before the move will be before the pivot afterwards
/// All elements in the range [toIndex, L.len+1) before the move will be after the pivot afterwards
/// In other words, it's as if the range [fromIndex,toIndex) have been rotated using a <<< operation common to other languages.
/// fromIndex and toIndex must be in the range [1,L.len+1]
/// This will preserve associations ~Carnie
/proc/moveElement(list/L, fromIndex, toIndex)
if(fromIndex == toIndex || fromIndex+1 == toIndex) //no need to move
return
@@ -672,9 +664,9 @@
L.Cut(fromIndex, fromIndex+1)
//Move elements [fromIndex,fromIndex+len) to [toIndex-len, toIndex)
//Same as moveElement but for ranges of elements
//This will preserve associations ~Carnie
/// Move elements [fromIndex,fromIndex+len) to [toIndex-len, toIndex)
/// Same as moveElement but for ranges of elements
/// This will preserve associations ~Carnie
/proc/moveRange(list/L, fromIndex, toIndex, len=1)
var/distance = abs(toIndex - fromIndex)
if(len >= distance) //there are more elements to be moved than the distance to be moved. Therefore the same result can be achieved (with fewer operations) by moving elements between where we are and where we are going. The result being, our range we are moving is shifted left or right by dist elements
@@ -695,7 +687,7 @@
L.Swap(fromIndex, toIndex)
L.Cut(fromIndex, fromIndex+1)
//replaces reverseList ~Carnie
/// Replaces reverseList ~Carnie
/proc/reverseRange(list/L, start=1, end=0)
if(L.len)
start = start % L.len
@@ -711,8 +703,8 @@
return L
//Copies a list, and all lists inside it recusively
//Does not copy any other reference type
/// Copies a list, and all lists inside it recusively
/// Does not copy any other reference type
/proc/deepCopyList(list/l)
if(!islist(l))
return l
@@ -721,7 +713,7 @@
if(islist(.[i]))
.[i] = .(.[i])
//Sets object value at specified path
/// Sets object value at specified path
/proc/obj_query_set(query, subject, value, delimiter = "/", list/keys)
. = FALSE
if(!keys)
@@ -766,7 +758,7 @@
return TRUE
//Gets object value at specified path
/// Gets object value at specified path
/proc/obj_query_get(query, subject, delimiter = "/", list/keys)
. = null
if(!keys)
@@ -815,8 +807,7 @@
/datum/alarm/dd_SortValue()
return "[sanitize_old(last_name)]"
// Insertion into a sorted list, preserving sortedness using binary search
/// Insertion into a sorted list, preserving sortedness using binary search
/proc/dd_binaryInsertSorted(var/list/L, var/O)
var/min = 1
var/max = L.len + 1
@@ -853,12 +844,13 @@
values += value
/proc/list_keys(var/list/L) // Return a list of keys in a list
/// Return a list of keys in a list
/proc/list_keys(var/list/L)
. = list()
for(var/e in L)
. += e
// Return a list of the values in an assoc list (including null)
/// Return a list of the values in an assoc list (including null)
/proc/list_values(var/list/L)
. = list()
for(var/e in L)
@@ -869,7 +861,7 @@
for (var/string in L)
. += capitalize(string)
// Transforms a list of lists (of lists) into a single flat list.
/// Transforms a list of lists (of lists) into a single flat list.
/proc/flatten_list(var/list/L)
. = list()
for(var/M in L)
@@ -878,8 +870,8 @@
else
. += flatten_list(M)
///takes an input_key, as text, and the list of keys already used, outputting a replacement key in the format of "[input_key] ([number_of_duplicates])" if it finds a duplicate
///use this for lists of things that might have the same name, like mobs or objects, that you plan on giving to a player as input
/// takes an input_key, as text, and the list of keys already used, outputting a replacement key in the format of "[input_key] ([number_of_duplicates])" if it finds a duplicate
/// use this for lists of things that might have the same name, like mobs or objects, that you plan on giving to a player as input
/proc/avoid_assoc_duplicate_keys(input_key, list/used_key_list)
if(!input_key || !istype(used_key_list))
return
@@ -158,7 +158,7 @@
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
if(AI.anchored)
AI.remote_control_shell()
AI.remote_control()
else
to_chat(AI, SPAN_WARNING("You are unable to get a good connection while unanchored from the station systems."))
+53 -20
View File
@@ -60,7 +60,7 @@ SUBSYSTEM_DEF(virtualreality)
var/mob/living/vr_mob = null // In which mob is our mind
var/mob/living/old_mob = null // Which mob is our old mob
// Return to our original body
/// Return to original body
/mob/proc/body_return()
set name = "Return to Body"
set category = "IC"
@@ -68,6 +68,8 @@ SUBSYSTEM_DEF(virtualreality)
if(old_mob)
ckey_transfer(old_mob)
languages = list(GLOB.all_languages[LANGUAGE_TCB])
if(old_mob.client)
old_mob.client.init_verbs() // We need to have the stat panel to update, so we call this directly
to_chat(old_mob, SPAN_NOTICE("System exited safely, we hope you enjoyed your stay."))
old_mob = null
else
@@ -81,6 +83,8 @@ SUBSYSTEM_DEF(virtualreality)
if(old_mob)
ckey_transfer(old_mob)
speech_synthesizer_langs = list(GLOB.all_languages[LANGUAGE_TCB])
if(old_mob.client)
old_mob.client.init_verbs()
to_chat(old_mob, SPAN_NOTICE("System exited safely, we hope you enjoyed your stay."))
old_mob = null
else
@@ -95,6 +99,8 @@ SUBSYSTEM_DEF(virtualreality)
ckey_transfer(old_mob)
languages = list(GLOB.all_languages[LANGUAGE_TCB])
internal_id.access = list()
if(old_mob.client)
old_mob.client.init_verbs()
to_chat(old_mob, SPAN_NOTICE("System exited safely, we hope you enjoyed your stay."))
old_mob = null
else
@@ -108,6 +114,8 @@ SUBSYSTEM_DEF(virtualreality)
if(old_mob)
ckey_transfer(old_mob)
languages = list(GLOB.all_languages[LANGUAGE_TCB])
if(old_mob.client)
old_mob.client.init_verbs()
to_chat(old_mob, SPAN_NOTICE("System exited safely, we hope you enjoyed your stay."))
old_mob = null
qdel(src)
@@ -137,11 +145,18 @@ SUBSYSTEM_DEF(virtualreality)
if(target.client)
target.client.screen |= global_hud.vr_control
if(istype(target, /mob/living/simple_animal/spiderbot))
if(istype(target, /mob/living/simple_animal/spiderbot) && !istype(target, /mob/living/simple_animal/spiderbot/ai))
var/mob/living/simple_animal/spiderbot/spider = target
var/obj/item/card/id/original_id = M.GetIdCard()
if(original_id)
var/mob/living/simple_animal/spiderbot/SB = target
SB.internal_id.access = original_id.access
// Update radio
var/obj/item/device/encryptionkey/Key = spider.radio.keyslot
var/obj/item/device/radio/Radio = M.get_radio()
if(Key && Radio)
Key.channels = Radio.channels
spider.radio.recalculateChannels()
target.client.init_verbs()
to_chat(target, SPAN_NOTICE("Connection established, system suite active and calibrated."))
@@ -173,7 +188,8 @@ SUBSYSTEM_DEF(virtualreality)
if(null_vr_mob)
target.vr_mob = null
/datum/controller/subsystem/virtualreality/proc/mech_selection(var/user, var/network)
/// Returns a list with all remote controlable exosuits on the given network
/datum/controller/subsystem/virtualreality/proc/mech_choices(var/user, var/network)
var/list/mech = list()
for(var/mob/living/heavy_vehicle/R in mechs[network])
@@ -193,19 +209,26 @@ SUBSYSTEM_DEF(virtualreality)
continue
mech[R.name] = R
if(!length(mech))
return mech
/// Retrieves a list returned by mech_choices and prompts user to select an option to transfer to
/datum/controller/subsystem/virtualreality/proc/mech_selection(var/user, var/network)
var/list/remote = mech_choices(user, network)
if(!length(remote))
to_chat(user, SPAN_WARNING("No active remote mechs are available."))
return
var/choice = tgui_input_list(usr, "Please select a remote control compatible mech to take over.", "Remote Mech Selection", mech)
var/choice = tgui_input_list(usr, "Please select a remote control compatible mech to take over.", "Remote Mech Selection", remote)
if(!choice)
return
var/mob/living/heavy_vehicle/chosen_mech = mech[choice]
var/mob/living/heavy_vehicle/chosen_mech = remote[choice]
var/mob/living/remote_pilot = chosen_mech.pilots[1] // the first pilot
mind_transfer(user, remote_pilot)
/datum/controller/subsystem/virtualreality/proc/robot_selection(var/user, var/network)
/// Returns a list with all remote controlable robots on the given network
/datum/controller/subsystem/virtualreality/proc/robot_choices(var/user, var/network)
var/list/robot = list()
for(var/mob/living/R in robots[network])
@@ -220,17 +243,22 @@ SUBSYSTEM_DEF(virtualreality)
continue
robot[R.name] = R
if(!length(robot))
to_chat(user, SPAN_WARNING("No active remote robots are available."))
return robot
/// Retrieves a list returned by robot_choices and prompts user to select an option to transfer to
/datum/controller/subsystem/virtualreality/proc/robot_selection(var/user, var/network)
var/list/remote = robot_choices(user, network)
if(!length(remote))
to_chat(user, SPAN_WARNING("No active remote units are available."))
var/choice = tgui_input_list(usr, "Please select a remote control unit to take over.", "Remote Unit Selection", remote)
if(!(choice in remote))
return
var/choice = tgui_input_list(usr, "Please select a remote control robot to take over.", "Remote Robot Selection", robot)
if(!choice)
return
mind_transfer(user, choice)
mind_transfer(user, robot[choice])
/datum/controller/subsystem/virtualreality/proc/bound_selection(var/user, var/network)
/// Returns a list with all remote controlable bound on the given network
/datum/controller/subsystem/virtualreality/proc/bound_choices(var/user, var/network)
var/list/bound = list()
for(var/mob/living/silicon/R in bounded[network])
@@ -245,16 +273,21 @@ SUBSYSTEM_DEF(virtualreality)
continue
bound += R
if(!length(bound))
to_chat(user, SPAN_WARNING("No active remote units are available."))
return
return bound
var/choice = tgui_input_list(usr, "Please select a remote control unit to take over.", "Remote Unit Selection", bound)
if(!(choice in bound))
/// Retrieves a list returned by bound_choices and prompts user to select an option to transfer to
/datum/controller/subsystem/virtualreality/proc/bound_selection(var/user, var/network)
var/list/remote = bound_choices(user, network)
if(!length(remote))
to_chat(user, SPAN_WARNING("No active remote units are available."))
var/choice = tgui_input_list(usr, "Please select a remote control unit to take over.", "Remote Unit Selection", remote)
if(!(choice in remote))
return
mind_transfer(user, choice)
/datum/controller/subsystem/virtualreality/proc/create_virtual_reality_avatar(var/mob/living/carbon/human/user)
if(GLOB.virtual_reality_spawn.len)
var/mob/living/carbon/human/virtual_reality/H = new /mob/living/carbon/human/virtual_reality(pick(GLOB.virtual_reality_spawn))
@@ -636,12 +636,13 @@ var/global/list/default_interrogation_channels = list(
channels = list(CHANNEL_COMMON = TRUE, CHANNEL_ENTERTAINMENT = TRUE)
syndie = FALSE
var/mob/living/silicon/robot/D = loc
if(D.module)
for(var/ch_name in D.module.channels)
if(ch_name in channels)
continue
channels[ch_name] += D.module.channels[ch_name]
if(isrobot(loc))
var/mob/living/silicon/robot/D = loc
if(D.module)
for(var/ch_name in D.module.channels)
if(ch_name in channels)
continue
channels[ch_name] += D.module.channels[ch_name]
if(keyslot)
for(var/ch_name in keyslot.channels)
if(ch_name in channels)
@@ -233,11 +233,13 @@
LAZYDISTINCTADD(user.additional_vision_handlers, src)
update_icon()
GLOB.move_manager.stop_looping(src) // stop it from auto moving when the pilot gets in
return 1
return TRUE
/mob/living/heavy_vehicle/proc/eject(var/mob/user, var/silent)
if(!user || !(user in src.contents))
return
if(remote)
usr.body_return()
if(hatch_closed)
if(hatch_locked)
if(!silent) to_chat(user, SPAN_WARNING("The [body.hatch_descriptor] is locked."))
+4 -1
View File
@@ -131,7 +131,7 @@
. = ..()
/mob/living/heavy_vehicle/IsAdvancedToolUser()
return 1
return TRUE
/mob/living/heavy_vehicle/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
SHOULD_CALL_PARENT(FALSE) //Special snowflake case
@@ -321,6 +321,9 @@
dummy = new dummy_type(get_turf(src))
dummy.real_name = "Remote-Bot"
dummy.name = dummy.real_name
// Give dummy a blank encryption key for later editing if spiderbot
if(istype(dummy, /mob/living/simple_animal/spiderbot) && !istype(dummy, /mob/living/simple_animal/spiderbot/ai))
dummy.radio.keyslot = new /obj/item/device/encryptionkey
remove_verb(dummy, /mob/living/proc/ventcrawl)
remove_verb(dummy, /mob/living/proc/hide)
if(dummy_colour)
+24 -5
View File
@@ -21,7 +21,7 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/proc/core,
/mob/living/silicon/ai/proc/pick_icon,
/mob/living/silicon/ai/proc/sensor_mode,
/mob/living/silicon/ai/proc/remote_control_shell,
/mob/living/silicon/ai/proc/remote_control,
/mob/living/silicon/ai/proc/show_laws_verb,
/mob/living/silicon/ai/proc/toggle_acceleration,
/mob/living/silicon/ai/proc/toggle_camera_light,
@@ -800,14 +800,33 @@ var/list/ai_verbs_default = list(
set desc = "Augment visual feed with internal sensor overlays"
toggle_sensor_mode()
/mob/living/silicon/ai/proc/remote_control_shell()
set name = "Remote Control Shell"
/// Retrieves all mobs assigned to REMOTE_AI_ROBOT or REMOTE_AI_MECH and allows the user to select one to control using SSvirtualreality
/mob/living/silicon/ai/proc/remote_control()
set name = "Remote Control"
set category = "AI Commands"
set desc = "Remotely control any active shells on your AI shell network."
set desc = "Remotely control any active shells or mechs on your AI network."
if(check_unable(AI_CHECK_WIRELESS))
return
SSvirtualreality.bound_selection(src, REMOTE_AI_ROBOT)
// Grab from relevant networks
var/list/remote_shell = SSvirtualreality.bound_choices(src, REMOTE_AI_ROBOT)
var/list/remote_mech = SSvirtualreality.mech_choices(src, REMOTE_AI_MECH)
var/list/remote = flatten_list(list(remote_shell, remote_mech))
if(!length(remote))
to_chat(usr, SPAN_WARNING("No active remote units are available."))
return
var/choice = tgui_input_list(usr, "Please select what to take over.", "Remote Control Selection", remote)
if(!choice)
return
// Transfer
if(choice in remote_mech)
var/mob/living/heavy_vehicle/chosen_mech = remote_mech[choice]
SSvirtualreality.mind_transfer(src, chosen_mech.pilots[1]) // the first pilot
else
SSvirtualreality.mind_transfer(src, choice)
/mob/living/silicon/ai/proc/toggle_hologram_movement()
set name = "Toggle Hologram Movement"
@@ -332,6 +332,13 @@
spawn(3)//A slight delay to let us finish walking out from under the door
layer = initial(layer)
/mob/living/simple_animal/spiderbot/zMove(direction)
if(istype(loc, /mob/living/heavy_vehicle))
var/mob/living/heavy_vehicle/mech = loc
mech.zMove(direction)
return
..()
/mob/living/simple_animal/spiderbot/get_bullet_impact_effect_type(var/def_zone)
return BULLET_IMPACT_METAL
+5
View File
@@ -59,3 +59,8 @@ GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
to_chat(src, SPAN_WARNING("Access denied."))
return min(..(), UI_UPDATE)
/mob/living/simple_animal/spiderbot/default_can_use_topic(src_object)
if(ismech(src_object))
return UI_INTERACTIVE
return ..()
@@ -0,0 +1,63 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# - (fixes bugs)
# wip
# - (work in progress)
# qol
# - (quality of life)
# soundadd
# - (adds a sound)
# sounddel
# - (removes a sound)
# rscadd
# - (adds a feature)
# rscdel
# - (removes a feature)
# imageadd
# - (adds an image or sprite)
# imagedel
# - (removes an image or sprite)
# spellcheck
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# balance
# - (balance changes)
# code_imp
# - (misc internal code change)
# refactor
# - (refactors code)
# config
# - (makes a change to the config files)
# admin
# - (makes changes to administrator tools)
# server
# - (miscellaneous changes to server)
#################################
# Your name.
author: Ben10083
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "AI can remote control mechs again."
- bugfix: "Remote controlled exosuits now can travel between zlevels if capable."
- bugfix: "Remote control no longer makes the client lose verbs until restart."
- bugfix: "Remote controlled exosuit radios now will use the channels the user has access to."
- qol: "Pressing eject in a remotely controlled mech now exits remote control."
- code_imp: "DMdoced lists.dm"