diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index 043158da11..69bc163234 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -38,3 +38,5 @@ #define MANIA_DAMAGE_TO_CONVERT 90 //how much damage is required before it'll convert affected targets #define STATUS_EFFECT_HISWRATH /datum/status_effect/his_wrath //His Wrath. + +#define STATUS_EFFECT_SUMMONEDGHOST /datum/status_effect/cultghost //is a cult ghost and can't use manifest runes \ No newline at end of file diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index 7b5da91e03..4215151058 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -1,491 +1,491 @@ -/* - * Holds procs to help with list operations - * Contains groups: - * Misc - * Sorting - */ - -/* - * Misc - */ - -//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 = "" ) - var/total = input.len - if (!total) - return "[nothing_text]" - else if (total == 1) - return "[input[1]]" - else if (total == 2) - return "[input[1]][and_text][input[2]]" - else - var/output = "" - var/index = 1 - while (index < total) - if (index == total - 1) - comma_text = final_comma_text - - output += "[input[index]][comma_text]" - index++ - - return "[output][and_text][input[index]]" - -//Returns list element or null. Should prevent "index out of bounds" error. -/proc/listgetindex(list/L, index) - if(istype(L)) - if(isnum(index) && IsInteger(index)) - if(IsInRange(index,1,L.len)) - return L[index] - else if(index in L) - return L[index] - return - -//Return either pick(list) or null if list is not of type /list or is empty -/proc/safepick(list/L) - if(istype(L) && L.len) - return pick(L) - -//Checks if the list is empty -/proc/isemptylist(list/L) - if(!L.len) - return 1 - return 0 - -//Checks for specific types in a list -/proc/is_type_in_list(atom/A, list/L) - if(!L || !L.len || !A) - return 0 - for(var/type in L) - if(istype(A, type)) - return 1 - return 0 - -//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) - - return 0 - if(ispath(A)) - . = L[A] - else - . = L[A.type] - -//Checks for a string in a list -/proc/is_string_in_list(string, list/L) - if(!L || !L.len || !string) - return - for(var/V in L) - if(string == V) - return 1 - return - -//Removes a string from a list -/proc/remove_strings_from_list(string, list/L) - if(!L || !L.len || !string) - return - for(var/V in L) - if(V == string) - L -= V //No return here so that it removes all strings of that type - return - -//returns a new list with only atoms that are in typecache L -/proc/typecache_filter_list(list/atoms, list/typecache) - . = list() - for (var/thing in atoms) - var/atom/A = thing - if (typecache[A.type]) - . += A - -//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() - if(only_root_path) - types = list(path) - else - types = ignore_root_path ? subtypesof(path) : typesof(path) - var/list/L = list() - for(var/T in types) - L[T] = TRUE - return L - else if(islist(path)) - var/list/pathlist = path - var/list/L = list() - if(ignore_root_path) - for(var/P in pathlist) - for(var/T in subtypesof(P)) - L[T] = TRUE - else - for(var/P in pathlist) - if(only_root_path) - L[P] = TRUE - else - for(var/T in typesof(P)) - L[T] = TRUE - return L - -//Empties the list by setting the length to 0. Hopefully the elements get garbage collected -/proc/clearlist(list/list) - if(istype(list)) - list.len = 0 - return - -//Removes any null entries from the list -/proc/listclearnulls(list/L) - var/list/N = new(L.len) - L -= N - -/* - * 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(list/first, list/second, skiprep=0) - if(!islist(first) || !islist(second)) - return - var/list/result = new - if(skiprep) - for(var/e in first) - if(!(e in result) && !(e in second)) - result += e - else - 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 - */ -/proc/uniquemergelist(list/first, list/second, skiprep=0) - if(!islist(first) || !islist(second)) - return - var/list/result = new - if(skiprep) - result = difflist(first, second, skiprep)+difflist(second, first, skiprep) - else - result = first ^ second - return result - -//Pretends to pick an element based on its weight but really just seems to pick a random element. -/proc/pickweight(list/L) - var/total = 0 - var/item - for (item in L) - if (!L[item]) - L[item] = 1 - total += L[item] - - total = rand(1, total) - for (item in L) - total -=L [item] - if (total <= 0) - return item - - return null - -//Pick a random element from the list and remove it from the list. -/proc/pick_n_take(list/L) - if(L.len) - var/picked = rand(1,L.len) - . = L[picked] - L.Cut(picked,picked+1) //Cut is far more efficient that Remove() - -//Returns the top(last) element from the list and removes it from the list (typical stack function) -/proc/pop(list/L) - if(L.len) - . = L[L.len] - L.len-- - -/proc/popleft(list/L) - if(L.len) - . = L[1] - L.Cut(1,2) - -/proc/sorted_insert(list/L, thing, comparator) - var/pos = L.len - while(pos > 0 && call(comparator)(thing, L[pos]) > 0) - pos-- - L.Insert(pos+1, thing) - -// Returns the next item in a list -/proc/next_list_item(item, list/L) - var/i - i = L.Find(item) - if(i == L.len) - i = 1 - else - i++ - return L[i] - -// Returns the previous item in a list -/proc/previous_list_item(item, list/L) - var/i - i = L.Find(item) - if(i == 1) - i = L.len - else - i-- - return L[i] - -//Randomize: Return the list in a random order -/proc/shuffle(list/L) - if(!L) - return - L = L.Copy() - - for(var/i=1, i= 0 ? /proc/cmp_ckey_asc : /proc/cmp_ckey_dsc) - -//Specifically for record datums in a list. -/proc/sortRecord(list/L, field = "name", order = 1) - GLOB.cmp_field = field - return sortTim(L, order >= 0 ? /proc/cmp_records_asc : /proc/cmp_records_dsc) - -//any value in a list -/proc/sortList(list/L, cmp=/proc/cmp_text_asc) - return sortTim(L.Copy(), cmp) - -//uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead -/proc/sortNames(list/L, order=1) - return sortTim(L, order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc) - - -//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)) - var/max = min(wordlist.len,16) - var/bit = 1 - for(var/i=1, i<=max, i++) - if(bitfield & bit) - r += wordlist[i] - bit = bit << 1 - else - for(var/bit=1, bit<=65535, bit = bit << 1) - if(bitfield & bit) - r += bit - - return r - -// Returns the key based on the index -#define KEYBYINDEX(L, index) (((index <= L:len) && (index > 0)) ? L[index] : null) - -/proc/count_by_type(list/L, type) - var/i = 0 - for(var/T in L) - if(istype(T, type)) - i++ - return i - -/proc/find_record(field, value, list/L) - for(var/datum/data/record/R in L) - if(R.fields[field] == value) - return R - - -//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 - if(fromIndex > toIndex) - ++fromIndex //since a null will be inserted before fromIndex, the index needs to be nudged right by one - - L.Insert(toIndex, null) - L.Swap(fromIndex, toIndex) - 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 -/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 - if(fromIndex <= toIndex) - return //no need to move - fromIndex += len //we want to shift left instead of right - - for(var/i=0, i toIndex) - fromIndex += len - - for(var/i=0, i distance) //there is an overlap, therefore swapping each element will require more swaps than inserting new elements - if(fromIndex < toIndex) - toIndex += len - else - fromIndex += len - - for(var/i=0, i fromIndex) - var/a = toIndex - toIndex = fromIndex - fromIndex = a - - for(var/i=0, i 512 -#error Remie said that lummox was adding a way to get a lists -#error contents via list.values, if that is true remove this -#error otherwise, update the version and bug lummox -#elseif -//Flattens a keyed list into a list of it's contents -/proc/flatten_list(list/key_list) - if(!islist(key_list)) - return null - . = list() - for(var/key in key_list) - . |= key_list[key] - -//Picks from the list, with some safeties, and returns the "default" arg if it fails -#define DEFAULTPICK(L, default) ((istype(L, /list) && L:len) ? pick(L) : default) - -#define LAZYINITLIST(L) if (!L) L = list() - -#define UNSETEMPTY(L) if (L && !L.len) L = null -#define LAZYREMOVE(L, I) if(L) { L -= I; if(!L.len) { L = null; } } -#define LAZYADD(L, I) if(!L) { L = list(); } L += I; -#define LAZYACCESS(L, I) (L ? (isnum(I) ? (I > 0 && I <= L.len ? L[I] : null) : L[I]) : null) -#define LAZYLEN(L) length(L) -#define LAZYCLEARLIST(L) if(L) L.Cut() -#define SANITIZE_LIST(L) ( islist(L) ? L : list() ) - -/* Definining a counter as a series of key -> numeric value entries - - * All these procs modify in place. -*/ - -/proc/counterlist_scale(list/L, scalar) - var/list/out = list() - for(var/key in L) - out[key] = L[key] * scalar - . = out - -/proc/counterlist_sum(list/L) - . = 0 - for(var/key in L) - . += L[key] - -/proc/counterlist_normalise(list/L) - var/avg = counterlist_sum(L) - if(avg != 0) - . = counterlist_scale(L, 1 / avg) - else - . = L - -/proc/counterlist_combine(list/L1, list/L2) - for(var/key in L2) - var/other_value = L2[key] - if(key in L1) - L1[key] += other_value - else - L1[key] = other_value +/* + * Holds procs to help with list operations + * Contains groups: + * Misc + * Sorting + */ + +/* + * Misc + */ + +//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 = "" ) + var/total = input.len + if (!total) + return "[nothing_text]" + else if (total == 1) + return "[input[1]]" + else if (total == 2) + return "[input[1]][and_text][input[2]]" + else + var/output = "" + var/index = 1 + while (index < total) + if (index == total - 1) + comma_text = final_comma_text + + output += "[input[index]][comma_text]" + index++ + + return "[output][and_text][input[index]]" + +//Returns list element or null. Should prevent "index out of bounds" error. +/proc/listgetindex(list/L, index) + if(istype(L)) + if(isnum(index) && IsInteger(index)) + if(IsInRange(index,1,L.len)) + return L[index] + else if(index in L) + return L[index] + return + +//Return either pick(list) or null if list is not of type /list or is empty +/proc/safepick(list/L) + if(istype(L) && L.len) + return pick(L) + +//Checks if the list is empty +/proc/isemptylist(list/L) + if(!L.len) + return 1 + return 0 + +//Checks for specific types in a list +/proc/is_type_in_list(atom/A, list/L) + if(!L || !L.len || !A) + return 0 + for(var/type in L) + if(istype(A, type)) + return 1 + return 0 + +//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) + + return 0 + if(ispath(A)) + . = L[A] + else + . = L[A.type] + +//Checks for a string in a list +/proc/is_string_in_list(string, list/L) + if(!L || !L.len || !string) + return + for(var/V in L) + if(string == V) + return 1 + return + +//Removes a string from a list +/proc/remove_strings_from_list(string, list/L) + if(!L || !L.len || !string) + return + for(var/V in L) + if(V == string) + L -= V //No return here so that it removes all strings of that type + return + +//returns a new list with only atoms that are in typecache L +/proc/typecache_filter_list(list/atoms, list/typecache) + . = list() + for (var/thing in atoms) + var/atom/A = thing + if (typecache[A.type]) + . += A + +//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() + if(only_root_path) + types = list(path) + else + types = ignore_root_path ? subtypesof(path) : typesof(path) + var/list/L = list() + for(var/T in types) + L[T] = TRUE + return L + else if(islist(path)) + var/list/pathlist = path + var/list/L = list() + if(ignore_root_path) + for(var/P in pathlist) + for(var/T in subtypesof(P)) + L[T] = TRUE + else + for(var/P in pathlist) + if(only_root_path) + L[P] = TRUE + else + for(var/T in typesof(P)) + L[T] = TRUE + return L + +//Empties the list by setting the length to 0. Hopefully the elements get garbage collected +/proc/clearlist(list/list) + if(istype(list)) + list.len = 0 + return + +//Removes any null entries from the list +/proc/listclearnulls(list/L) + var/list/N = new(L.len) + L -= N + +/* + * 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(list/first, list/second, skiprep=0) + if(!islist(first) || !islist(second)) + return + var/list/result = new + if(skiprep) + for(var/e in first) + if(!(e in result) && !(e in second)) + result += e + else + 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 + */ +/proc/uniquemergelist(list/first, list/second, skiprep=0) + if(!islist(first) || !islist(second)) + return + var/list/result = new + if(skiprep) + result = difflist(first, second, skiprep)+difflist(second, first, skiprep) + else + result = first ^ second + return result + +//Pretends to pick an element based on its weight but really just seems to pick a random element. +/proc/pickweight(list/L) + var/total = 0 + var/item + for (item in L) + if (!L[item]) + L[item] = 1 + total += L[item] + + total = rand(1, total) + for (item in L) + total -=L [item] + if (total <= 0) + return item + + return null + +//Pick a random element from the list and remove it from the list. +/proc/pick_n_take(list/L) + if(L.len) + var/picked = rand(1,L.len) + . = L[picked] + L.Cut(picked,picked+1) //Cut is far more efficient that Remove() + +//Returns the top(last) element from the list and removes it from the list (typical stack function) +/proc/pop(list/L) + if(L.len) + . = L[L.len] + L.len-- + +/proc/popleft(list/L) + if(L.len) + . = L[1] + L.Cut(1,2) + +/proc/sorted_insert(list/L, thing, comparator) + var/pos = L.len + while(pos > 0 && call(comparator)(thing, L[pos]) > 0) + pos-- + L.Insert(pos+1, thing) + +// Returns the next item in a list +/proc/next_list_item(item, list/L) + var/i + i = L.Find(item) + if(i == L.len) + i = 1 + else + i++ + return L[i] + +// Returns the previous item in a list +/proc/previous_list_item(item, list/L) + var/i + i = L.Find(item) + if(i == 1) + i = L.len + else + i-- + return L[i] + +//Randomize: Return the list in a random order +/proc/shuffle(list/L) + if(!L) + return + L = L.Copy() + + for(var/i=1, i= 0 ? /proc/cmp_ckey_asc : /proc/cmp_ckey_dsc) + +//Specifically for record datums in a list. +/proc/sortRecord(list/L, field = "name", order = 1) + GLOB.cmp_field = field + return sortTim(L, order >= 0 ? /proc/cmp_records_asc : /proc/cmp_records_dsc) + +//any value in a list +/proc/sortList(list/L, cmp=/proc/cmp_text_asc) + return sortTim(L.Copy(), cmp) + +//uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead +/proc/sortNames(list/L, order=1) + return sortTim(L, order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc) + + +//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)) + var/max = min(wordlist.len,16) + var/bit = 1 + for(var/i=1, i<=max, i++) + if(bitfield & bit) + r += wordlist[i] + bit = bit << 1 + else + for(var/bit=1, bit<=65535, bit = bit << 1) + if(bitfield & bit) + r += bit + + return r + +// Returns the key based on the index +#define KEYBYINDEX(L, index) (((index <= L:len) && (index > 0)) ? L[index] : null) + +/proc/count_by_type(list/L, type) + var/i = 0 + for(var/T in L) + if(istype(T, type)) + i++ + return i + +/proc/find_record(field, value, list/L) + for(var/datum/data/record/R in L) + if(R.fields[field] == value) + return R + + +//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 + if(fromIndex > toIndex) + ++fromIndex //since a null will be inserted before fromIndex, the index needs to be nudged right by one + + L.Insert(toIndex, null) + L.Swap(fromIndex, toIndex) + 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 +/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 + if(fromIndex <= toIndex) + return //no need to move + fromIndex += len //we want to shift left instead of right + + for(var/i=0, i toIndex) + fromIndex += len + + for(var/i=0, i distance) //there is an overlap, therefore swapping each element will require more swaps than inserting new elements + if(fromIndex < toIndex) + toIndex += len + else + fromIndex += len + + for(var/i=0, i fromIndex) + var/a = toIndex + toIndex = fromIndex + fromIndex = a + + for(var/i=0, i 512 +#error Remie said that lummox was adding a way to get a lists +#error contents via list.values, if that is true remove this +#error otherwise, update the version and bug lummox +#elseif +//Flattens a keyed list into a list of it's contents +/proc/flatten_list(list/key_list) + if(!islist(key_list)) + return null + . = list() + for(var/key in key_list) + . |= key_list[key] + +//Picks from the list, with some safeties, and returns the "default" arg if it fails +#define DEFAULTPICK(L, default) ((istype(L, /list) && L:len) ? pick(L) : default) + +#define LAZYINITLIST(L) if (!L) L = list() + +#define UNSETEMPTY(L) if (L && !L.len) L = null +#define LAZYREMOVE(L, I) if(L) { L -= I; if(!L.len) { L = null; } } +#define LAZYADD(L, I) if(!L) { L = list(); } L += I; +#define LAZYACCESS(L, I) (L ? (isnum(I) ? (I > 0 && I <= L.len ? L[I] : null) : L[I]) : null) +#define LAZYLEN(L) length(L) +#define LAZYCLEARLIST(L) if(L) L.Cut() +#define SANITIZE_LIST(L) ( islist(L) ? L : list() ) + +/* Definining a counter as a series of key -> numeric value entries + + * All these procs modify in place. +*/ + +/proc/counterlist_scale(list/L, scalar) + var/list/out = list() + for(var/key in L) + out[key] = L[key] * scalar + . = out + +/proc/counterlist_sum(list/L) + . = 0 + for(var/key in L) + . += L[key] + +/proc/counterlist_normalise(list/L) + var/avg = counterlist_sum(L) + if(avg != 0) + . = counterlist_scale(L, 1 / avg) + else + . = L + +/proc/counterlist_combine(list/L1, list/L2) + for(var/key in L2) + var/other_value = L2[key] + if(key in L1) + L1[key] += other_value + else + L1[key] = other_value diff --git a/code/_globalvars/logging.dm b/code/_globalvars/logging.dm index 06a3272ab7..00665bdfe2 100644 --- a/code/_globalvars/logging.dm +++ b/code/_globalvars/logging.dm @@ -1,34 +1,34 @@ -GLOBAL_VAR(log_directory) -GLOBAL_PROTECT(log_directory) -GLOBAL_VAR(world_game_log) -GLOBAL_PROTECT(world_game_log) -GLOBAL_VAR(world_runtime_log) -GLOBAL_PROTECT(world_runtime_log) -GLOBAL_VAR(world_attack_log) -GLOBAL_PROTECT(world_attack_log) -GLOBAL_VAR(world_href_log) -GLOBAL_PROTECT(world_href_log) -GLOBAL_VAR(round_id) -GLOBAL_PROTECT(round_id) -GLOBAL_VAR(config_error_log) -GLOBAL_PROTECT(config_error_log) - -GLOBAL_LIST_EMPTY(bombers) -GLOBAL_PROTECT(bombers) -GLOBAL_LIST_EMPTY(admin_log) -GLOBAL_PROTECT(admin_log) -GLOBAL_LIST_EMPTY(lastsignalers) //keeps last 100 signals here in format: "[src] used \ref[src] @ location [src.loc]: [freq]/[code]" -GLOBAL_PROTECT(lastsignalers) -GLOBAL_LIST_EMPTY(lawchanges) //Stores who uploaded laws to which silicon-based lifeform, and what the law was -GLOBAL_PROTECT(lawchanges) - -GLOBAL_LIST_EMPTY(combatlog) -GLOBAL_PROTECT(combatlog) -GLOBAL_LIST_EMPTY(IClog) -GLOBAL_PROTECT(IClog) -GLOBAL_LIST_EMPTY(OOClog) -GLOBAL_PROTECT(OOClog) -GLOBAL_LIST_EMPTY(adminlog) -GLOBAL_PROTECT(adminlog) - +GLOBAL_VAR(log_directory) +GLOBAL_PROTECT(log_directory) +GLOBAL_VAR(world_game_log) +GLOBAL_PROTECT(world_game_log) +GLOBAL_VAR(world_runtime_log) +GLOBAL_PROTECT(world_runtime_log) +GLOBAL_VAR(world_attack_log) +GLOBAL_PROTECT(world_attack_log) +GLOBAL_VAR(world_href_log) +GLOBAL_PROTECT(world_href_log) +GLOBAL_VAR(round_id) +GLOBAL_PROTECT(round_id) +GLOBAL_VAR(config_error_log) +GLOBAL_PROTECT(config_error_log) + +GLOBAL_LIST_EMPTY(bombers) +GLOBAL_PROTECT(bombers) +GLOBAL_LIST_EMPTY(admin_log) +GLOBAL_PROTECT(admin_log) +GLOBAL_LIST_EMPTY(lastsignalers) //keeps last 100 signals here in format: "[src] used \ref[src] @ location [src.loc]: [freq]/[code]" +GLOBAL_PROTECT(lastsignalers) +GLOBAL_LIST_EMPTY(lawchanges) //Stores who uploaded laws to which silicon-based lifeform, and what the law was +GLOBAL_PROTECT(lawchanges) + +GLOBAL_LIST_EMPTY(combatlog) +GLOBAL_PROTECT(combatlog) +GLOBAL_LIST_EMPTY(IClog) +GLOBAL_PROTECT(IClog) +GLOBAL_LIST_EMPTY(OOClog) +GLOBAL_PROTECT(OOClog) +GLOBAL_LIST_EMPTY(adminlog) +GLOBAL_PROTECT(adminlog) + GLOBAL_LIST_EMPTY(active_turfs_startlist) \ No newline at end of file diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 4806ba8da2..e808b03ac7 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -1,931 +1,931 @@ -//Configuraton defines //TODO: Move all yes/no switches into bitflags - -//Used by jobs_have_maint_access -#define ASSISTANTS_HAVE_MAINT_ACCESS 1 -#define SECURITY_HAS_MAINT_ACCESS 2 -#define EVERYONE_HAS_MAINT_ACCESS 4 - -/datum/configuration/can_vv_get(var_name) - var/static/list/banned_gets = list("autoadmin", "autoadmin_rank") - if (var_name in banned_gets) - return FALSE - return ..() - -/datum/configuration/vv_edit_var(var_name, var_value) - var/static/list/banned_edits = list("cross_address", "cross_allowed", "autoadmin", "autoadmin_rank") - if(var_name in banned_edits) - return FALSE - return ..() - -/datum/configuration - var/name = "Configuration" // datum name - - var/autoadmin = 0 - var/autoadmin_rank = "Game Admin" - - var/server_name = null // server name (the name of the game window) - var/server_sql_name = null // short form server name used for the DB - var/station_name = null // station name (the name of the station in-game) - var/lobby_countdown = 120 // In between round countdown. - var/round_end_countdown = 25 // Post round murder death kill countdown - var/hub = 0 - - var/log_ooc = 0 // log OOC channel - var/log_access = 0 // log login/logout - var/log_say = 0 // log client say - var/log_admin = 0 // log admin actions - var/log_game = 0 // log game events - var/log_vote = 0 // log voting - var/log_whisper = 0 // log client whisper - var/log_prayer = 0 // log prayers - var/log_law = 0 // log lawchanges - var/log_emote = 0 // log emotes - var/log_attack = 0 // log attack messages - var/log_adminchat = 0 // log admin chat messages - var/log_pda = 0 // log pda messages - var/log_twitter = 0 // log certain expliotable parrots and other such fun things in a JSON file of twitter valid phrases. - var/log_world_topic = 0 // log all world.Topic() calls - var/sql_enabled = 0 // for sql switching - var/allow_admin_ooccolor = 0 // Allows admins with relevant permissions to have their own ooc colour - var/allow_vote_restart = 0 // allow votes to restart - var/allow_vote_mode = 0 // allow votes to change mode - var/vote_delay = 6000 // minimum time between voting sessions (deciseconds, 10 minute default) - var/vote_period = 600 // length of voting period (deciseconds, default 1 minute) - var/vote_no_default = 0 // vote does not default to nochange/norestart (tbi) - var/vote_no_dead = 0 // dead people can't vote (tbi) - var/del_new_on_log = 1 // del's new players if they log before they spawn in - var/allow_Metadata = 0 // Metadata is supported. - var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1. - var/fps = 20 - var/allow_holidays = 0 //toggles whether holiday-specific content should be used - var/tick_limit_mc_init = TICK_LIMIT_MC_INIT_DEFAULT //SSinitialization throttling - - var/hostedby = null - var/respawn = 1 - var/guest_jobban = 1 - var/usewhitelist = 0 - var/inactivity_period = 3000 //time in ds until a player is considered inactive - var/afk_period = 6000 //time in ds until a player is considered afk and kickable - var/kick_inactive = FALSE //force disconnect for inactive players - var/load_jobs_from_txt = 0 - var/automute_on = 0 //enables automuting/spam prevention - var/minimal_access_threshold = 0 //If the number of players is larger than this threshold, minimal access will be turned on. - var/jobs_have_minimal_access = 0 //determines whether jobs use minimal access or expanded access. - var/jobs_have_maint_access = 0 //Who gets maint access? See defines above. - var/sec_start_brig = 0 //makes sec start in brig or dept sec posts - - var/server - var/banappeals - var/wikiurl = "http://www.tgstation13.org/wiki" // Default wiki link. - var/forumurl = "http://tgstation13.org/phpBB/index.php" //default forums - var/rulesurl = "http://www.tgstation13.org/wiki/Rules" // default rules - var/githuburl = "https://www.github.com/tgstation/-tg-station" //default github - var/githubrepoid - - var/forbid_singulo_possession = 0 - var/useircbot = 0 - - var/check_randomizer = 0 - - var/allow_panic_bunker_bounce = 0 //Send new players somewhere else - var/panic_server_name = "somewhere else" - var/panic_address = "byond://" //Reconnect a player this linked server if this server isn't accepting new players - - //IP Intel vars - var/ipintel_email - var/ipintel_rating_bad = 1 - var/ipintel_save_good = 12 - var/ipintel_save_bad = 1 - var/ipintel_domain = "check.getipintel.net" - - var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt - var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt - var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database - var/use_account_age_for_jobs = 0 //Uses the time they made the account for the job restriction stuff. New player joining alerts should be unaffected. - var/see_own_notes = 0 //Can players see their own admin notes (read-only)? Config option in config.txt - - //Population cap vars - var/soft_popcap = 0 - var/hard_popcap = 0 - var/extreme_popcap = 0 - var/soft_popcap_message = "Be warned that the server is currently serving a high number of users, consider using alternative game servers." - var/hard_popcap_message = "The server is currently serving a high number of users, You cannot currently join. You may wait for the number of living crew to decline, observe, or find alternative servers." - var/extreme_popcap_message = "The server is currently serving a high number of users, find alternative servers." - - //game_options.txt configs - var/force_random_names = 0 - var/list/mode_names = list() - var/list/modes = list() // allowed modes - var/list/votable_modes = list() // votable modes - var/list/probabilities = list() // relative probability of each mode - var/list/min_pop = list() // overrides for acceptible player counts in a mode - var/list/max_pop = list() - - var/humans_need_surnames = 0 - var/allow_ai = 0 // allow ai job - var/forbid_secborg = 0 // disallow secborg module to be chosen. - var/forbid_peaceborg = 0 - var/panic_bunker = 0 // prevents new people it hasn't seen before from connecting - var/notify_new_player_age = 0 // how long do we notify admins of a new player - var/notify_new_player_account_age = 0 // how long do we notify admins of a new byond account - var/irc_first_connection_alert = 0 // do we notify the irc channel when somebody is connecting for the first time? - - var/traitor_scaling_coeff = 6 //how much does the amount of players get divided by to determine traitors - var/changeling_scaling_coeff = 6 //how much does the amount of players get divided by to determine changelings - var/security_scaling_coeff = 8 //how much does the amount of players get divided by to determine open security officer positions - var/abductor_scaling_coeff = 15 //how many players per abductor team - - var/traitor_objectives_amount = 2 - var/protect_roles_from_antagonist = 0 //If security and such can be traitor/cult/other - var/protect_assistant_from_antagonist = 0 //If assistants can be traitor/cult/other - var/enforce_human_authority = 0 //If non-human species are barred from joining as a head of staff - var/allow_latejoin_antagonists = 0 // If late-joining players can be traitor/changeling - var/list/continuous = list() // which roundtypes continue if all antagonists die - var/list/midround_antag = list() // which roundtypes use the midround antagonist system - var/midround_antag_time_check = 60 // How late (in minutes) you want the midround antag system to stay on, setting this to 0 will disable the system - var/midround_antag_life_check = 0.7 // A ratio of how many people need to be alive in order for the round not to immediately end in midround antagonist - var/shuttle_refuel_delay = 12000 - var/show_game_type_odds = 0 //if set this allows players to see the odds of each roundtype on the get revision screen - var/mutant_races = 0 //players can choose their mutant race before joining the game - var/list/roundstart_races = list() //races you can play as from the get go. If left undefined the game's roundstart var for species is used - var/mutant_humans = 0 //players can pick mutant bodyparts for humans before joining the game - - var/no_summon_guns //No - var/no_summon_magic //Fun - var/no_summon_events //Allowed - - var/intercept = 1 //Whether or not to send a communications intercept report roundstart. This may be overriden by gamemodes. - var/alert_desc_green = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced." - var/alert_desc_blue_upto = "The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted." - var/alert_desc_blue_downto = "The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed." - var/alert_desc_red_upto = "There is an immediate serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised." - var/alert_desc_red_downto = "The station's destruction has been averted. There is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised." - var/alert_desc_delta = "Destruction of the station is imminent. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill." - - var/revival_pod_plants = FALSE - var/revival_cloning = FALSE - var/revival_brain_life = -1 - - var/rename_cyborg = 0 - var/ooc_during_round = 0 - var/emojis = 0 - - //Used for modifying movement speed for mobs. - //Unversal modifiers - var/run_speed = 0 - var/walk_speed = 0 - - //Mob specific modifiers. NOTE: These will affect different mob types in different ways - var/human_delay = 0 - var/robot_delay = 0 - var/monkey_delay = 0 - var/alien_delay = 0 - var/slime_delay = 0 - var/animal_delay = 0 - - var/gateway_delay = 18000 //How long the gateway takes before it activates. Default is half an hour. - var/ghost_interaction = 0 - - var/silent_ai = 0 - var/silent_borg = 0 - - var/damage_multiplier = 1 //Modifier for damage to all mobs. Impacts healing as well. - - var/allowwebclient = 0 - var/webclientmembersonly = 0 - - var/sandbox_autoclose = 0 // close the sandbox panel after spawning an item, potentially reducing griff - - var/default_laws = 0 //Controls what laws the AI spawns with. - var/silicon_max_law_amount = 12 - var/list/lawids = list() - - var/list/law_weights = list() - - var/assistant_cap = -1 - - var/starlight = 0 - var/generate_minimaps = 0 - var/grey_assistants = 0 - - var/lavaland_budget = 60 - var/space_budget = 16 - - var/aggressive_changelog = 0 - - var/reactionary_explosions = 0 //If we use reactionary explosions, explosions that react to walls and doors - - var/autoconvert_notes = 0 //if all connecting player's notes should attempt to be converted to the database - - var/announce_admin_logout = 0 - var/announce_admin_login = 0 - - var/list/datum/map_config/maplist = list() - var/datum/map_config/defaultmap = null - var/maprotation = 1 - var/maprotatechancedelta = 0.75 - var/allow_map_voting = TRUE - - // Enables random events mid-round when set to 1 - var/allow_random_events = 0 - - // Multipliers for random events minimal starting time and minimal players amounts - var/events_min_time_mul = 1 - var/events_min_players_mul = 1 - - // The object used for the clickable stat() button. - var/obj/effect/statclick/statclick - - var/client_warn_version = 0 - var/client_warn_message = "Your version of byond may have issues or be blocked from accessing this server in the future." - var/client_error_version = 0 - var/client_error_message = "Your version of byond is too old, may have issues, and is blocked from accessing this server." - - var/cross_name = "Other server" - var/cross_address = "byond://" - var/cross_allowed = FALSE - var/showircname = 0 - - var/list/gamemode_cache = null - - var/minutetopiclimit - var/secondtopiclimit - - var/error_cooldown = 600 // The "cooldown" time for each occurrence of a unique error - var/error_limit = 50 // How many occurrences before the next will silence them - var/error_silence_time = 6000 // How long a unique error will be silenced for - var/error_msg_delay = 50 // How long to wait between messaging admins about occurrences of a unique error - - var/arrivals_shuttle_dock_window = 55 //Time from when a player late joins on the arrivals shuttle to when the shuttle docks on the station - var/arrivals_shuttle_require_safe_latejoin = FALSE //Require the arrivals shuttle to be operational in order for latejoiners to join - - var/mice_roundstart = 10 // how many wire chewing rodents spawn at roundstart. - -/datum/configuration/New() - gamemode_cache = typecacheof(/datum/game_mode,TRUE) - for(var/T in gamemode_cache) - // I wish I didn't have to instance the game modes in order to look up - // their information, but it is the only way (at least that I know of). - var/datum/game_mode/M = new T() - - if(M.config_tag) - if(!(M.config_tag in modes)) // ensure each mode is added only once - GLOB.config_error_log << "Adding game mode [M.name] ([M.config_tag]) to configuration." - modes += M.config_tag - mode_names[M.config_tag] = M.name - probabilities[M.config_tag] = M.probability - if(M.votable) - votable_modes += M.config_tag - qdel(M) - votable_modes += "secret" - - Reload() - -/datum/configuration/proc/Reload() - load("config/config.txt") - load("config/game_options.txt","game_options") - loadsql("config/dbconfig.txt") - if (maprotation) - loadmaplist("config/maps.txt") - - // apply some settings from config.. - GLOB.abandon_allowed = respawn - -/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist - var/list/Lines = world.file2list(filename) - - for(var/t in Lines) - if(!t) - continue - - t = trim(t) - if(length(t) == 0) - continue - else if(copytext(t, 1, 2) == "#") - continue - - var/pos = findtext(t, " ") - var/name = null - var/value = null - - if(pos) - name = lowertext(copytext(t, 1, pos)) - value = copytext(t, pos + 1) - else - name = lowertext(t) - - if(!name) - continue - - if(type == "config") - switch(name) - if("hub") - hub = 1 - if("admin_legacy_system") - admin_legacy_system = 1 - if("ban_legacy_system") - ban_legacy_system = 1 - if("use_age_restriction_for_jobs") - use_age_restriction_for_jobs = 1 - if("use_account_age_for_jobs") - use_account_age_for_jobs = 1 - if("lobby_countdown") - lobby_countdown = text2num(value) - if("round_end_countdown") - round_end_countdown = text2num(value) - if("log_ooc") - log_ooc = 1 - if("log_access") - log_access = 1 - if("log_say") - log_say = 1 - if("log_admin") - log_admin = 1 - if("log_prayer") - log_prayer = 1 - if("log_law") - log_law = 1 - if("log_game") - log_game = 1 - if("log_vote") - log_vote = 1 - if("log_whisper") - log_whisper = 1 - if("log_attack") - log_attack = 1 - if("log_emote") - log_emote = 1 - if("log_adminchat") - log_adminchat = 1 - if("log_pda") - log_pda = 1 - if("log_twitter") - log_twitter = 1 - if("log_world_topic") - log_world_topic = 1 - if("allow_admin_ooccolor") - allow_admin_ooccolor = 1 - if("allow_vote_restart") - allow_vote_restart = 1 - if("allow_vote_mode") - allow_vote_mode = 1 - if("no_dead_vote") - vote_no_dead = 1 - if("default_no_vote") - vote_no_default = 1 - if("vote_delay") - vote_delay = text2num(value) - if("vote_period") - vote_period = text2num(value) - if("norespawn") - respawn = 0 - if("servername") - server_name = value - if("serversqlname") - server_sql_name = value - if("stationname") - station_name = value - if("hostedby") - hostedby = value - if("server") - server = value - if("banappeals") - banappeals = value - if("wikiurl") - wikiurl = value - if("forumurl") - forumurl = value - if("rulesurl") - rulesurl = value - if("githuburl") - githuburl = value - if("githubrepoid") - githubrepoid = value - if("guest_jobban") - guest_jobban = 1 - if("guest_ban") - GLOB.guests_allowed = 0 - if("usewhitelist") - usewhitelist = TRUE - if("allow_metadata") - allow_Metadata = 1 - if("inactivity_period") - inactivity_period = text2num(value) * 10 //documented as seconds in config.txt - if("afk_period") - afk_period = text2num(value) * 10 // ^^^ - if("kick_inactive") - kick_inactive = TRUE - if("load_jobs_from_txt") - load_jobs_from_txt = 1 - if("forbid_singulo_possession") - forbid_singulo_possession = 1 - if("popup_admin_pm") - popup_admin_pm = 1 - if("allow_holidays") - allow_holidays = 1 - if("useircbot") - useircbot = 1 - if("ticklag") - var/ticklag = text2num(value) - if(ticklag > 0) - fps = 10 / ticklag - if("tick_limit_mc_init") - tick_limit_mc_init = text2num(value) - if("fps") - fps = text2num(value) - if("automute_on") - automute_on = 1 - if("comms_key") - global.comms_key = value - if(value != "default_pwd" && length(value) > 6) //It's the default value or less than 6 characters long, warn badmins - global.comms_allowed = 1 - if("cross_server_address") - cross_address = value - if(value != "byond:\\address:port") - cross_allowed = 1 - if("cross_comms_name") - cross_name = value - if("panic_server_name") - panic_server_name = value - if("panic_server_address") - panic_address = value - if(value != "byond:\\address:port") - allow_panic_bunker_bounce = 1 - if("medal_hub_address") - global.medal_hub = value - if("medal_hub_password") - global.medal_pass = value - if("show_irc_name") - showircname = 1 - if("see_own_notes") - see_own_notes = 1 - if("soft_popcap") - soft_popcap = text2num(value) - if("hard_popcap") - hard_popcap = text2num(value) - if("extreme_popcap") - extreme_popcap = text2num(value) - if("soft_popcap_message") - soft_popcap_message = value - if("hard_popcap_message") - hard_popcap_message = value - if("extreme_popcap_message") - extreme_popcap_message = value - if("panic_bunker") - panic_bunker = 1 - if("notify_new_player_age") - notify_new_player_age = text2num(value) - if("notify_new_player_account_age") - notify_new_player_account_age = text2num(value) - if("irc_first_connection_alert") - irc_first_connection_alert = 1 - if("check_randomizer") - check_randomizer = 1 - if("ipintel_email") - if (value != "ch@nge.me") - ipintel_email = value - if("ipintel_rating_bad") - ipintel_rating_bad = text2num(value) - if("ipintel_domain") - ipintel_domain = value - if("ipintel_save_good") - ipintel_save_good = text2num(value) - if("ipintel_save_bad") - ipintel_save_bad = text2num(value) - if("aggressive_changelog") - aggressive_changelog = 1 - if("autoconvert_notes") - autoconvert_notes = 1 - if("allow_webclient") - allowwebclient = 1 - if("webclient_only_byond_members") - webclientmembersonly = 1 - if("announce_admin_logout") - announce_admin_logout = 1 - if("announce_admin_login") - announce_admin_login = 1 - if("maprotation") - maprotation = 1 - if("allow_map_voting") - allow_map_voting = text2num(value) - if("maprotationchancedelta") - maprotatechancedelta = text2num(value) - if("autoadmin") - autoadmin = 1 - if(value) - autoadmin_rank = ckeyEx(value) - if("generate_minimaps") - generate_minimaps = 1 - if("client_warn_version") - client_warn_version = text2num(value) - if("client_warn_message") - client_warn_message = value - if("client_error_version") - client_error_version = text2num(value) - if("client_error_message") - client_error_message = value - if("minute_topic_limit") - minutetopiclimit = text2num(value) - if("second_topic_limit") - secondtopiclimit = text2num(value) - if("error_cooldown") - error_cooldown = text2num(value) - if("error_limit") - error_limit = text2num(value) - if("error_silence_time") - error_silence_time = text2num(value) - if("error_msg_delay") - error_msg_delay = text2num(value) - else - GLOB.config_error_log << "Unknown setting in configuration: '[name]'" - - else if(type == "game_options") - switch(name) - if("damage_multiplier") - damage_multiplier = text2num(value) - if("revival_pod_plants") - revival_pod_plants = TRUE - if("revival_cloning") - revival_cloning = TRUE - if("revival_brain_life") - revival_brain_life = text2num(value) - if("rename_cyborg") - rename_cyborg = 1 - if("ooc_during_round") - ooc_during_round = 1 - if("emojis") - emojis = 1 - if("run_delay") - run_speed = text2num(value) - if("walk_delay") - walk_speed = text2num(value) - if("human_delay") - human_delay = text2num(value) - if("robot_delay") - robot_delay = text2num(value) - if("monkey_delay") - monkey_delay = text2num(value) - if("alien_delay") - alien_delay = text2num(value) - if("slime_delay") - slime_delay = text2num(value) - if("animal_delay") - animal_delay = text2num(value) - if("alert_red_upto") - alert_desc_red_upto = value - if("alert_red_downto") - alert_desc_red_downto = value - if("alert_blue_downto") - alert_desc_blue_downto = value - if("alert_blue_upto") - alert_desc_blue_upto = value - if("alert_green") - alert_desc_green = value - if("alert_delta") - alert_desc_delta = value - if("no_intercept_report") - intercept = 0 - if("assistants_have_maint_access") - jobs_have_maint_access |= ASSISTANTS_HAVE_MAINT_ACCESS - if("security_has_maint_access") - jobs_have_maint_access |= SECURITY_HAS_MAINT_ACCESS - if("everyone_has_maint_access") - jobs_have_maint_access |= EVERYONE_HAS_MAINT_ACCESS - if("sec_start_brig") - sec_start_brig = 1 - if("gateway_delay") - gateway_delay = text2num(value) - if("continuous") - var/mode_name = lowertext(value) - if(mode_name in modes) - continuous[mode_name] = 1 - else - GLOB.config_error_log << "Unknown continuous configuration definition: [mode_name]." - if("midround_antag") - var/mode_name = lowertext(value) - if(mode_name in modes) - midround_antag[mode_name] = 1 - else - GLOB.config_error_log << "Unknown midround antagonist configuration definition: [mode_name]." - if("midround_antag_time_check") - midround_antag_time_check = text2num(value) - if("midround_antag_life_check") - midround_antag_life_check = text2num(value) - if("min_pop") - var/pop_pos = findtext(value, " ") - var/mode_name = null - var/mode_value = null - - if(pop_pos) - mode_name = lowertext(copytext(value, 1, pop_pos)) - mode_value = copytext(value, pop_pos + 1) - if(mode_name in modes) - min_pop[mode_name] = text2num(mode_value) - else - GLOB.config_error_log << "Unknown minimum population configuration definition: [mode_name]." - else - GLOB.config_error_log << "Incorrect minimum population configuration definition: [mode_name] [mode_value]." - if("max_pop") - var/pop_pos = findtext(value, " ") - var/mode_name = null - var/mode_value = null - - if(pop_pos) - mode_name = lowertext(copytext(value, 1, pop_pos)) - mode_value = copytext(value, pop_pos + 1) - if(mode_name in modes) - max_pop[mode_name] = text2num(mode_value) - else - GLOB.config_error_log << "Unknown maximum population configuration definition: [mode_name]." - else - GLOB.config_error_log << "Incorrect maximum population configuration definition: [mode_name] [mode_value]." - if("shuttle_refuel_delay") - shuttle_refuel_delay = text2num(value) - if("show_game_type_odds") - show_game_type_odds = 1 - if("ghost_interaction") - ghost_interaction = 1 - if("traitor_scaling_coeff") - traitor_scaling_coeff = text2num(value) - if("changeling_scaling_coeff") - changeling_scaling_coeff = text2num(value) - if("security_scaling_coeff") - security_scaling_coeff = text2num(value) - if("abductor_scaling_coeff") - abductor_scaling_coeff = text2num(value) - if("traitor_objectives_amount") - traitor_objectives_amount = text2num(value) - if("probability") - var/prob_pos = findtext(value, " ") - var/prob_name = null - var/prob_value = null - - if(prob_pos) - prob_name = lowertext(copytext(value, 1, prob_pos)) - prob_value = copytext(value, prob_pos + 1) - if(prob_name in modes) - probabilities[prob_name] = text2num(prob_value) - else - GLOB.config_error_log << "Unknown game mode probability configuration definition: [prob_name]." - else - GLOB.config_error_log << "Incorrect probability configuration definition: [prob_name] [prob_value]." - - if("protect_roles_from_antagonist") - protect_roles_from_antagonist = 1 - if("protect_assistant_from_antagonist") - protect_assistant_from_antagonist = 1 - if("enforce_human_authority") - enforce_human_authority = 1 - if("allow_latejoin_antagonists") - allow_latejoin_antagonists = 1 - if("allow_random_events") - allow_random_events = 1 - - if("events_min_time_mul") - events_min_time_mul = text2num(value) - if("events_min_players_mul") - events_min_players_mul = text2num(value) - - if("minimal_access_threshold") - minimal_access_threshold = text2num(value) - if("jobs_have_minimal_access") - jobs_have_minimal_access = 1 - if("humans_need_surnames") - humans_need_surnames = 1 - if("force_random_names") - force_random_names = 1 - if("allow_ai") - allow_ai = 1 - if("disable_secborg") - forbid_secborg = 1 - if("disable_peaceborg") - forbid_peaceborg = 1 - if("silent_ai") - silent_ai = 1 - if("silent_borg") - silent_borg = 1 - if("sandbox_autoclose") - sandbox_autoclose = 1 - if("default_laws") - default_laws = text2num(value) - if("random_laws") - var/law_id = lowertext(value) - lawids += law_id - if("law_weight") - // Value is in the form "LAWID,NUMBER" - var/list/L = splittext(value, ",") - if(L.len != 2) - GLOB.config_error_log << "Invalid LAW_WEIGHT: " + t - continue - var/lawid = L[1] - var/weight = text2num(L[2]) - law_weights[lawid] = weight - - if("silicon_max_law_amount") - silicon_max_law_amount = text2num(value) - if("join_with_mutant_race") - mutant_races = 1 - if("roundstart_races") - var/race_id = lowertext(value) - for(var/species_id in GLOB.species_list) - if(species_id == race_id) - roundstart_races += GLOB.species_list[species_id] - GLOB.roundstart_species[species_id] = GLOB.species_list[species_id] - if("join_with_mutant_humans") - mutant_humans = 1 - if("assistant_cap") - assistant_cap = text2num(value) - if("starlight") - starlight = 1 - if("grey_assistants") - grey_assistants = 1 - if("lavaland_budget") - lavaland_budget = text2num(value) - if("space_budget") - space_budget = text2num(value) - if("no_summon_guns") - no_summon_guns = 1 - if("no_summon_magic") - no_summon_magic = 1 - if("no_summon_events") - no_summon_events = 1 - if("reactionary_explosions") - reactionary_explosions = 1 - if("bombcap") - var/BombCap = text2num(value) - if (!BombCap) - continue - if (BombCap < 4) - BombCap = 4 - - GLOB.MAX_EX_DEVESTATION_RANGE = round(BombCap/4) - GLOB.MAX_EX_HEAVY_RANGE = round(BombCap/2) - GLOB.MAX_EX_LIGHT_RANGE = BombCap - GLOB.MAX_EX_FLASH_RANGE = BombCap - GLOB.MAX_EX_FLAME_RANGE = BombCap - if("arrivals_shuttle_dock_window") - arrivals_shuttle_dock_window = max(PARALLAX_LOOP_TIME, text2num(value)) - if("arrivals_shuttle_require_safe_latejoin") - arrivals_shuttle_require_safe_latejoin = TRUE - if("mice_roundstart") - mice_roundstart = text2num(value) - if ("mentor_mobname_only") - mentors_mobname_only = 1 - if ("mentor_legacy_system") - mentor_legacy_system = 1 - else - GLOB.config_error_log << "Unknown setting in configuration: '[name]'" - - fps = round(fps) - if(fps <= 0) - fps = initial(fps) - - -/datum/configuration/proc/loadmaplist(filename) - var/list/Lines = world.file2list(filename) - - var/datum/map_config/currentmap = null - for(var/t in Lines) - if(!t) - continue - - t = trim(t) - if(length(t) == 0) - continue - else if(copytext(t, 1, 2) == "#") - continue - - var/pos = findtext(t, " ") - var/command = null - var/data = null - - if(pos) - command = lowertext(copytext(t, 1, pos)) - data = copytext(t, pos + 1) - else - command = lowertext(t) - - if(!command) - continue - - if (!currentmap && command != "map") - continue - - switch (command) - if ("map") - currentmap = new ("_maps/[data].json") - if(currentmap.defaulted) - log_world("Failed to load map config for [data]!") - if ("minplayers","minplayer") - currentmap.config_min_users = text2num(data) - if ("maxplayers","maxplayer") - currentmap.config_max_users = text2num(data) - if ("weight","voteweight") - currentmap.voteweight = text2num(data) - if ("default","defaultmap") - defaultmap = currentmap - if ("endmap") - maplist[currentmap.map_name] = currentmap - currentmap = null - else - GLOB.config_error_log << "Unknown command in map vote config: '[command]'" - - -/datum/configuration/proc/loadsql(filename) - var/list/Lines = world.file2list(filename) - for(var/t in Lines) - if(!t) - continue - - t = trim(t) - if(length(t) == 0) - continue - else if(copytext(t, 1, 2) == "#") - continue - - var/pos = findtext(t, " ") - var/name = null - var/value = null - - if(pos) - name = lowertext(copytext(t, 1, pos)) - value = copytext(t, pos + 1) - else - name = lowertext(t) - - if(!name) - continue - - switch(name) - if("sql_enabled") - sql_enabled = 1 - if("address") - global.sqladdress = value - if("port") - global.sqlport = value - if("feedback_database") - global.sqlfdbkdb = value - if("feedback_login") - global.sqlfdbklogin = value - if("feedback_password") - global.sqlfdbkpass = value - if("feedback_tableprefix") - global.sqlfdbktableprefix = value - else - GLOB.config_error_log << "Unknown setting in configuration: '[name]'" - -/datum/configuration/proc/pick_mode(mode_name) - // I wish I didn't have to instance the game modes in order to look up - // their information, but it is the only way (at least that I know of). - for(var/T in gamemode_cache) - var/datum/game_mode/M = new T() - if(M.config_tag && M.config_tag == mode_name) - return M - qdel(M) - return new /datum/game_mode/extended() - -/datum/configuration/proc/get_runnable_modes() - var/list/datum/game_mode/runnable_modes = new - for(var/T in gamemode_cache) - var/datum/game_mode/M = new T() - //to_chat(world, "DEBUG: [T], tag=[M.config_tag], prob=[probabilities[M.config_tag]]") - if(!(M.config_tag in modes)) - qdel(M) - continue - if(probabilities[M.config_tag]<=0) - qdel(M) - continue - if(min_pop[M.config_tag]) - M.required_players = min_pop[M.config_tag] - if(max_pop[M.config_tag]) - M.maximum_players = max_pop[M.config_tag] - if(M.can_start()) - runnable_modes[M] = probabilities[M.config_tag] - //to_chat(world, "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]") - return runnable_modes - -/datum/configuration/proc/get_runnable_midround_modes(crew) - var/list/datum/game_mode/runnable_modes = new - for(var/T in (gamemode_cache - SSticker.mode.type)) - var/datum/game_mode/M = new T() - if(!(M.config_tag in modes)) - qdel(M) - continue - if(probabilities[M.config_tag]<=0) - qdel(M) - continue - if(min_pop[M.config_tag]) - M.required_players = min_pop[M.config_tag] - if(max_pop[M.config_tag]) - M.maximum_players = max_pop[M.config_tag] - if(M.required_players <= crew) - if(M.maximum_players >= 0 && M.maximum_players < crew) - continue - runnable_modes[M] = probabilities[M.config_tag] - return runnable_modes - -/datum/configuration/proc/stat_entry() - if(!statclick) - statclick = new/obj/effect/statclick/debug(null, "Edit", src) - - stat("[name]:", statclick) \ No newline at end of file +//Configuraton defines //TODO: Move all yes/no switches into bitflags + +//Used by jobs_have_maint_access +#define ASSISTANTS_HAVE_MAINT_ACCESS 1 +#define SECURITY_HAS_MAINT_ACCESS 2 +#define EVERYONE_HAS_MAINT_ACCESS 4 + +/datum/configuration/can_vv_get(var_name) + var/static/list/banned_gets = list("autoadmin", "autoadmin_rank") + if (var_name in banned_gets) + return FALSE + return ..() + +/datum/configuration/vv_edit_var(var_name, var_value) + var/static/list/banned_edits = list("cross_address", "cross_allowed", "autoadmin", "autoadmin_rank") + if(var_name in banned_edits) + return FALSE + return ..() + +/datum/configuration + var/name = "Configuration" // datum name + + var/autoadmin = 0 + var/autoadmin_rank = "Game Admin" + + var/server_name = null // server name (the name of the game window) + var/server_sql_name = null // short form server name used for the DB + var/station_name = null // station name (the name of the station in-game) + var/lobby_countdown = 120 // In between round countdown. + var/round_end_countdown = 25 // Post round murder death kill countdown + var/hub = 0 + + var/log_ooc = 0 // log OOC channel + var/log_access = 0 // log login/logout + var/log_say = 0 // log client say + var/log_admin = 0 // log admin actions + var/log_game = 0 // log game events + var/log_vote = 0 // log voting + var/log_whisper = 0 // log client whisper + var/log_prayer = 0 // log prayers + var/log_law = 0 // log lawchanges + var/log_emote = 0 // log emotes + var/log_attack = 0 // log attack messages + var/log_adminchat = 0 // log admin chat messages + var/log_pda = 0 // log pda messages + var/log_twitter = 0 // log certain expliotable parrots and other such fun things in a JSON file of twitter valid phrases. + var/log_world_topic = 0 // log all world.Topic() calls + var/sql_enabled = 0 // for sql switching + var/allow_admin_ooccolor = 0 // Allows admins with relevant permissions to have their own ooc colour + var/allow_vote_restart = 0 // allow votes to restart + var/allow_vote_mode = 0 // allow votes to change mode + var/vote_delay = 6000 // minimum time between voting sessions (deciseconds, 10 minute default) + var/vote_period = 600 // length of voting period (deciseconds, default 1 minute) + var/vote_no_default = 0 // vote does not default to nochange/norestart (tbi) + var/vote_no_dead = 0 // dead people can't vote (tbi) + var/del_new_on_log = 1 // del's new players if they log before they spawn in + var/allow_Metadata = 0 // Metadata is supported. + var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1. + var/fps = 20 + var/allow_holidays = 0 //toggles whether holiday-specific content should be used + var/tick_limit_mc_init = TICK_LIMIT_MC_INIT_DEFAULT //SSinitialization throttling + + var/hostedby = null + var/respawn = 1 + var/guest_jobban = 1 + var/usewhitelist = 0 + var/inactivity_period = 3000 //time in ds until a player is considered inactive + var/afk_period = 6000 //time in ds until a player is considered afk and kickable + var/kick_inactive = FALSE //force disconnect for inactive players + var/load_jobs_from_txt = 0 + var/automute_on = 0 //enables automuting/spam prevention + var/minimal_access_threshold = 0 //If the number of players is larger than this threshold, minimal access will be turned on. + var/jobs_have_minimal_access = 0 //determines whether jobs use minimal access or expanded access. + var/jobs_have_maint_access = 0 //Who gets maint access? See defines above. + var/sec_start_brig = 0 //makes sec start in brig or dept sec posts + + var/server + var/banappeals + var/wikiurl = "http://www.tgstation13.org/wiki" // Default wiki link. + var/forumurl = "http://tgstation13.org/phpBB/index.php" //default forums + var/rulesurl = "http://www.tgstation13.org/wiki/Rules" // default rules + var/githuburl = "https://www.github.com/tgstation/-tg-station" //default github + var/githubrepoid + + var/forbid_singulo_possession = 0 + var/useircbot = 0 + + var/check_randomizer = 0 + + var/allow_panic_bunker_bounce = 0 //Send new players somewhere else + var/panic_server_name = "somewhere else" + var/panic_address = "byond://" //Reconnect a player this linked server if this server isn't accepting new players + + //IP Intel vars + var/ipintel_email + var/ipintel_rating_bad = 1 + var/ipintel_save_good = 12 + var/ipintel_save_bad = 1 + var/ipintel_domain = "check.getipintel.net" + + var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt + var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt + var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database + var/use_account_age_for_jobs = 0 //Uses the time they made the account for the job restriction stuff. New player joining alerts should be unaffected. + var/see_own_notes = 0 //Can players see their own admin notes (read-only)? Config option in config.txt + + //Population cap vars + var/soft_popcap = 0 + var/hard_popcap = 0 + var/extreme_popcap = 0 + var/soft_popcap_message = "Be warned that the server is currently serving a high number of users, consider using alternative game servers." + var/hard_popcap_message = "The server is currently serving a high number of users, You cannot currently join. You may wait for the number of living crew to decline, observe, or find alternative servers." + var/extreme_popcap_message = "The server is currently serving a high number of users, find alternative servers." + + //game_options.txt configs + var/force_random_names = 0 + var/list/mode_names = list() + var/list/modes = list() // allowed modes + var/list/votable_modes = list() // votable modes + var/list/probabilities = list() // relative probability of each mode + var/list/min_pop = list() // overrides for acceptible player counts in a mode + var/list/max_pop = list() + + var/humans_need_surnames = 0 + var/allow_ai = 0 // allow ai job + var/forbid_secborg = 0 // disallow secborg module to be chosen. + var/forbid_peaceborg = 0 + var/panic_bunker = 0 // prevents new people it hasn't seen before from connecting + var/notify_new_player_age = 0 // how long do we notify admins of a new player + var/notify_new_player_account_age = 0 // how long do we notify admins of a new byond account + var/irc_first_connection_alert = 0 // do we notify the irc channel when somebody is connecting for the first time? + + var/traitor_scaling_coeff = 6 //how much does the amount of players get divided by to determine traitors + var/changeling_scaling_coeff = 6 //how much does the amount of players get divided by to determine changelings + var/security_scaling_coeff = 8 //how much does the amount of players get divided by to determine open security officer positions + var/abductor_scaling_coeff = 15 //how many players per abductor team + + var/traitor_objectives_amount = 2 + var/protect_roles_from_antagonist = 0 //If security and such can be traitor/cult/other + var/protect_assistant_from_antagonist = 0 //If assistants can be traitor/cult/other + var/enforce_human_authority = 0 //If non-human species are barred from joining as a head of staff + var/allow_latejoin_antagonists = 0 // If late-joining players can be traitor/changeling + var/list/continuous = list() // which roundtypes continue if all antagonists die + var/list/midround_antag = list() // which roundtypes use the midround antagonist system + var/midround_antag_time_check = 60 // How late (in minutes) you want the midround antag system to stay on, setting this to 0 will disable the system + var/midround_antag_life_check = 0.7 // A ratio of how many people need to be alive in order for the round not to immediately end in midround antagonist + var/shuttle_refuel_delay = 12000 + var/show_game_type_odds = 0 //if set this allows players to see the odds of each roundtype on the get revision screen + var/mutant_races = 0 //players can choose their mutant race before joining the game + var/list/roundstart_races = list() //races you can play as from the get go. If left undefined the game's roundstart var for species is used + var/mutant_humans = 0 //players can pick mutant bodyparts for humans before joining the game + + var/no_summon_guns //No + var/no_summon_magic //Fun + var/no_summon_events //Allowed + + var/intercept = 1 //Whether or not to send a communications intercept report roundstart. This may be overriden by gamemodes. + var/alert_desc_green = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced." + var/alert_desc_blue_upto = "The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted." + var/alert_desc_blue_downto = "The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed." + var/alert_desc_red_upto = "There is an immediate serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised." + var/alert_desc_red_downto = "The station's destruction has been averted. There is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised." + var/alert_desc_delta = "Destruction of the station is imminent. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill." + + var/revival_pod_plants = FALSE + var/revival_cloning = FALSE + var/revival_brain_life = -1 + + var/rename_cyborg = 0 + var/ooc_during_round = 0 + var/emojis = 0 + + //Used for modifying movement speed for mobs. + //Unversal modifiers + var/run_speed = 0 + var/walk_speed = 0 + + //Mob specific modifiers. NOTE: These will affect different mob types in different ways + var/human_delay = 0 + var/robot_delay = 0 + var/monkey_delay = 0 + var/alien_delay = 0 + var/slime_delay = 0 + var/animal_delay = 0 + + var/gateway_delay = 18000 //How long the gateway takes before it activates. Default is half an hour. + var/ghost_interaction = 0 + + var/silent_ai = 0 + var/silent_borg = 0 + + var/damage_multiplier = 1 //Modifier for damage to all mobs. Impacts healing as well. + + var/allowwebclient = 0 + var/webclientmembersonly = 0 + + var/sandbox_autoclose = 0 // close the sandbox panel after spawning an item, potentially reducing griff + + var/default_laws = 0 //Controls what laws the AI spawns with. + var/silicon_max_law_amount = 12 + var/list/lawids = list() + + var/list/law_weights = list() + + var/assistant_cap = -1 + + var/starlight = 0 + var/generate_minimaps = 0 + var/grey_assistants = 0 + + var/lavaland_budget = 60 + var/space_budget = 16 + + var/aggressive_changelog = 0 + + var/reactionary_explosions = 0 //If we use reactionary explosions, explosions that react to walls and doors + + var/autoconvert_notes = 0 //if all connecting player's notes should attempt to be converted to the database + + var/announce_admin_logout = 0 + var/announce_admin_login = 0 + + var/list/datum/map_config/maplist = list() + var/datum/map_config/defaultmap = null + var/maprotation = 1 + var/maprotatechancedelta = 0.75 + var/allow_map_voting = TRUE + + // Enables random events mid-round when set to 1 + var/allow_random_events = 0 + + // Multipliers for random events minimal starting time and minimal players amounts + var/events_min_time_mul = 1 + var/events_min_players_mul = 1 + + // The object used for the clickable stat() button. + var/obj/effect/statclick/statclick + + var/client_warn_version = 0 + var/client_warn_message = "Your version of byond may have issues or be blocked from accessing this server in the future." + var/client_error_version = 0 + var/client_error_message = "Your version of byond is too old, may have issues, and is blocked from accessing this server." + + var/cross_name = "Other server" + var/cross_address = "byond://" + var/cross_allowed = FALSE + var/showircname = 0 + + var/list/gamemode_cache = null + + var/minutetopiclimit + var/secondtopiclimit + + var/error_cooldown = 600 // The "cooldown" time for each occurrence of a unique error + var/error_limit = 50 // How many occurrences before the next will silence them + var/error_silence_time = 6000 // How long a unique error will be silenced for + var/error_msg_delay = 50 // How long to wait between messaging admins about occurrences of a unique error + + var/arrivals_shuttle_dock_window = 55 //Time from when a player late joins on the arrivals shuttle to when the shuttle docks on the station + var/arrivals_shuttle_require_safe_latejoin = FALSE //Require the arrivals shuttle to be operational in order for latejoiners to join + + var/mice_roundstart = 10 // how many wire chewing rodents spawn at roundstart. + +/datum/configuration/New() + gamemode_cache = typecacheof(/datum/game_mode,TRUE) + for(var/T in gamemode_cache) + // I wish I didn't have to instance the game modes in order to look up + // their information, but it is the only way (at least that I know of). + var/datum/game_mode/M = new T() + + if(M.config_tag) + if(!(M.config_tag in modes)) // ensure each mode is added only once + GLOB.config_error_log << "Adding game mode [M.name] ([M.config_tag]) to configuration." + modes += M.config_tag + mode_names[M.config_tag] = M.name + probabilities[M.config_tag] = M.probability + if(M.votable) + votable_modes += M.config_tag + qdel(M) + votable_modes += "secret" + + Reload() + +/datum/configuration/proc/Reload() + load("config/config.txt") + load("config/game_options.txt","game_options") + loadsql("config/dbconfig.txt") + if (maprotation) + loadmaplist("config/maps.txt") + + // apply some settings from config.. + GLOB.abandon_allowed = respawn + +/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist + var/list/Lines = world.file2list(filename) + + for(var/t in Lines) + if(!t) + continue + + t = trim(t) + if(length(t) == 0) + continue + else if(copytext(t, 1, 2) == "#") + continue + + var/pos = findtext(t, " ") + var/name = null + var/value = null + + if(pos) + name = lowertext(copytext(t, 1, pos)) + value = copytext(t, pos + 1) + else + name = lowertext(t) + + if(!name) + continue + + if(type == "config") + switch(name) + if("hub") + hub = 1 + if("admin_legacy_system") + admin_legacy_system = 1 + if("ban_legacy_system") + ban_legacy_system = 1 + if("use_age_restriction_for_jobs") + use_age_restriction_for_jobs = 1 + if("use_account_age_for_jobs") + use_account_age_for_jobs = 1 + if("lobby_countdown") + lobby_countdown = text2num(value) + if("round_end_countdown") + round_end_countdown = text2num(value) + if("log_ooc") + log_ooc = 1 + if("log_access") + log_access = 1 + if("log_say") + log_say = 1 + if("log_admin") + log_admin = 1 + if("log_prayer") + log_prayer = 1 + if("log_law") + log_law = 1 + if("log_game") + log_game = 1 + if("log_vote") + log_vote = 1 + if("log_whisper") + log_whisper = 1 + if("log_attack") + log_attack = 1 + if("log_emote") + log_emote = 1 + if("log_adminchat") + log_adminchat = 1 + if("log_pda") + log_pda = 1 + if("log_twitter") + log_twitter = 1 + if("log_world_topic") + log_world_topic = 1 + if("allow_admin_ooccolor") + allow_admin_ooccolor = 1 + if("allow_vote_restart") + allow_vote_restart = 1 + if("allow_vote_mode") + allow_vote_mode = 1 + if("no_dead_vote") + vote_no_dead = 1 + if("default_no_vote") + vote_no_default = 1 + if("vote_delay") + vote_delay = text2num(value) + if("vote_period") + vote_period = text2num(value) + if("norespawn") + respawn = 0 + if("servername") + server_name = value + if("serversqlname") + server_sql_name = value + if("stationname") + station_name = value + if("hostedby") + hostedby = value + if("server") + server = value + if("banappeals") + banappeals = value + if("wikiurl") + wikiurl = value + if("forumurl") + forumurl = value + if("rulesurl") + rulesurl = value + if("githuburl") + githuburl = value + if("githubrepoid") + githubrepoid = value + if("guest_jobban") + guest_jobban = 1 + if("guest_ban") + GLOB.guests_allowed = 0 + if("usewhitelist") + usewhitelist = TRUE + if("allow_metadata") + allow_Metadata = 1 + if("inactivity_period") + inactivity_period = text2num(value) * 10 //documented as seconds in config.txt + if("afk_period") + afk_period = text2num(value) * 10 // ^^^ + if("kick_inactive") + kick_inactive = TRUE + if("load_jobs_from_txt") + load_jobs_from_txt = 1 + if("forbid_singulo_possession") + forbid_singulo_possession = 1 + if("popup_admin_pm") + popup_admin_pm = 1 + if("allow_holidays") + allow_holidays = 1 + if("useircbot") + useircbot = 1 + if("ticklag") + var/ticklag = text2num(value) + if(ticklag > 0) + fps = 10 / ticklag + if("tick_limit_mc_init") + tick_limit_mc_init = text2num(value) + if("fps") + fps = text2num(value) + if("automute_on") + automute_on = 1 + if("comms_key") + global.comms_key = value + if(value != "default_pwd" && length(value) > 6) //It's the default value or less than 6 characters long, warn badmins + global.comms_allowed = 1 + if("cross_server_address") + cross_address = value + if(value != "byond:\\address:port") + cross_allowed = 1 + if("cross_comms_name") + cross_name = value + if("panic_server_name") + panic_server_name = value + if("panic_server_address") + panic_address = value + if(value != "byond:\\address:port") + allow_panic_bunker_bounce = 1 + if("medal_hub_address") + global.medal_hub = value + if("medal_hub_password") + global.medal_pass = value + if("show_irc_name") + showircname = 1 + if("see_own_notes") + see_own_notes = 1 + if("soft_popcap") + soft_popcap = text2num(value) + if("hard_popcap") + hard_popcap = text2num(value) + if("extreme_popcap") + extreme_popcap = text2num(value) + if("soft_popcap_message") + soft_popcap_message = value + if("hard_popcap_message") + hard_popcap_message = value + if("extreme_popcap_message") + extreme_popcap_message = value + if("panic_bunker") + panic_bunker = 1 + if("notify_new_player_age") + notify_new_player_age = text2num(value) + if("notify_new_player_account_age") + notify_new_player_account_age = text2num(value) + if("irc_first_connection_alert") + irc_first_connection_alert = 1 + if("check_randomizer") + check_randomizer = 1 + if("ipintel_email") + if (value != "ch@nge.me") + ipintel_email = value + if("ipintel_rating_bad") + ipintel_rating_bad = text2num(value) + if("ipintel_domain") + ipintel_domain = value + if("ipintel_save_good") + ipintel_save_good = text2num(value) + if("ipintel_save_bad") + ipintel_save_bad = text2num(value) + if("aggressive_changelog") + aggressive_changelog = 1 + if("autoconvert_notes") + autoconvert_notes = 1 + if("allow_webclient") + allowwebclient = 1 + if("webclient_only_byond_members") + webclientmembersonly = 1 + if("announce_admin_logout") + announce_admin_logout = 1 + if("announce_admin_login") + announce_admin_login = 1 + if("maprotation") + maprotation = 1 + if("allow_map_voting") + allow_map_voting = text2num(value) + if("maprotationchancedelta") + maprotatechancedelta = text2num(value) + if("autoadmin") + autoadmin = 1 + if(value) + autoadmin_rank = ckeyEx(value) + if("generate_minimaps") + generate_minimaps = 1 + if("client_warn_version") + client_warn_version = text2num(value) + if("client_warn_message") + client_warn_message = value + if("client_error_version") + client_error_version = text2num(value) + if("client_error_message") + client_error_message = value + if("minute_topic_limit") + minutetopiclimit = text2num(value) + if("second_topic_limit") + secondtopiclimit = text2num(value) + if("error_cooldown") + error_cooldown = text2num(value) + if("error_limit") + error_limit = text2num(value) + if("error_silence_time") + error_silence_time = text2num(value) + if("error_msg_delay") + error_msg_delay = text2num(value) + else + GLOB.config_error_log << "Unknown setting in configuration: '[name]'" + + else if(type == "game_options") + switch(name) + if("damage_multiplier") + damage_multiplier = text2num(value) + if("revival_pod_plants") + revival_pod_plants = TRUE + if("revival_cloning") + revival_cloning = TRUE + if("revival_brain_life") + revival_brain_life = text2num(value) + if("rename_cyborg") + rename_cyborg = 1 + if("ooc_during_round") + ooc_during_round = 1 + if("emojis") + emojis = 1 + if("run_delay") + run_speed = text2num(value) + if("walk_delay") + walk_speed = text2num(value) + if("human_delay") + human_delay = text2num(value) + if("robot_delay") + robot_delay = text2num(value) + if("monkey_delay") + monkey_delay = text2num(value) + if("alien_delay") + alien_delay = text2num(value) + if("slime_delay") + slime_delay = text2num(value) + if("animal_delay") + animal_delay = text2num(value) + if("alert_red_upto") + alert_desc_red_upto = value + if("alert_red_downto") + alert_desc_red_downto = value + if("alert_blue_downto") + alert_desc_blue_downto = value + if("alert_blue_upto") + alert_desc_blue_upto = value + if("alert_green") + alert_desc_green = value + if("alert_delta") + alert_desc_delta = value + if("no_intercept_report") + intercept = 0 + if("assistants_have_maint_access") + jobs_have_maint_access |= ASSISTANTS_HAVE_MAINT_ACCESS + if("security_has_maint_access") + jobs_have_maint_access |= SECURITY_HAS_MAINT_ACCESS + if("everyone_has_maint_access") + jobs_have_maint_access |= EVERYONE_HAS_MAINT_ACCESS + if("sec_start_brig") + sec_start_brig = 1 + if("gateway_delay") + gateway_delay = text2num(value) + if("continuous") + var/mode_name = lowertext(value) + if(mode_name in modes) + continuous[mode_name] = 1 + else + GLOB.config_error_log << "Unknown continuous configuration definition: [mode_name]." + if("midround_antag") + var/mode_name = lowertext(value) + if(mode_name in modes) + midround_antag[mode_name] = 1 + else + GLOB.config_error_log << "Unknown midround antagonist configuration definition: [mode_name]." + if("midround_antag_time_check") + midround_antag_time_check = text2num(value) + if("midround_antag_life_check") + midround_antag_life_check = text2num(value) + if("min_pop") + var/pop_pos = findtext(value, " ") + var/mode_name = null + var/mode_value = null + + if(pop_pos) + mode_name = lowertext(copytext(value, 1, pop_pos)) + mode_value = copytext(value, pop_pos + 1) + if(mode_name in modes) + min_pop[mode_name] = text2num(mode_value) + else + GLOB.config_error_log << "Unknown minimum population configuration definition: [mode_name]." + else + GLOB.config_error_log << "Incorrect minimum population configuration definition: [mode_name] [mode_value]." + if("max_pop") + var/pop_pos = findtext(value, " ") + var/mode_name = null + var/mode_value = null + + if(pop_pos) + mode_name = lowertext(copytext(value, 1, pop_pos)) + mode_value = copytext(value, pop_pos + 1) + if(mode_name in modes) + max_pop[mode_name] = text2num(mode_value) + else + GLOB.config_error_log << "Unknown maximum population configuration definition: [mode_name]." + else + GLOB.config_error_log << "Incorrect maximum population configuration definition: [mode_name] [mode_value]." + if("shuttle_refuel_delay") + shuttle_refuel_delay = text2num(value) + if("show_game_type_odds") + show_game_type_odds = 1 + if("ghost_interaction") + ghost_interaction = 1 + if("traitor_scaling_coeff") + traitor_scaling_coeff = text2num(value) + if("changeling_scaling_coeff") + changeling_scaling_coeff = text2num(value) + if("security_scaling_coeff") + security_scaling_coeff = text2num(value) + if("abductor_scaling_coeff") + abductor_scaling_coeff = text2num(value) + if("traitor_objectives_amount") + traitor_objectives_amount = text2num(value) + if("probability") + var/prob_pos = findtext(value, " ") + var/prob_name = null + var/prob_value = null + + if(prob_pos) + prob_name = lowertext(copytext(value, 1, prob_pos)) + prob_value = copytext(value, prob_pos + 1) + if(prob_name in modes) + probabilities[prob_name] = text2num(prob_value) + else + GLOB.config_error_log << "Unknown game mode probability configuration definition: [prob_name]." + else + GLOB.config_error_log << "Incorrect probability configuration definition: [prob_name] [prob_value]." + + if("protect_roles_from_antagonist") + protect_roles_from_antagonist = 1 + if("protect_assistant_from_antagonist") + protect_assistant_from_antagonist = 1 + if("enforce_human_authority") + enforce_human_authority = 1 + if("allow_latejoin_antagonists") + allow_latejoin_antagonists = 1 + if("allow_random_events") + allow_random_events = 1 + + if("events_min_time_mul") + events_min_time_mul = text2num(value) + if("events_min_players_mul") + events_min_players_mul = text2num(value) + + if("minimal_access_threshold") + minimal_access_threshold = text2num(value) + if("jobs_have_minimal_access") + jobs_have_minimal_access = 1 + if("humans_need_surnames") + humans_need_surnames = 1 + if("force_random_names") + force_random_names = 1 + if("allow_ai") + allow_ai = 1 + if("disable_secborg") + forbid_secborg = 1 + if("disable_peaceborg") + forbid_peaceborg = 1 + if("silent_ai") + silent_ai = 1 + if("silent_borg") + silent_borg = 1 + if("sandbox_autoclose") + sandbox_autoclose = 1 + if("default_laws") + default_laws = text2num(value) + if("random_laws") + var/law_id = lowertext(value) + lawids += law_id + if("law_weight") + // Value is in the form "LAWID,NUMBER" + var/list/L = splittext(value, ",") + if(L.len != 2) + GLOB.config_error_log << "Invalid LAW_WEIGHT: " + t + continue + var/lawid = L[1] + var/weight = text2num(L[2]) + law_weights[lawid] = weight + + if("silicon_max_law_amount") + silicon_max_law_amount = text2num(value) + if("join_with_mutant_race") + mutant_races = 1 + if("roundstart_races") + var/race_id = lowertext(value) + for(var/species_id in GLOB.species_list) + if(species_id == race_id) + roundstart_races += GLOB.species_list[species_id] + GLOB.roundstart_species[species_id] = GLOB.species_list[species_id] + if("join_with_mutant_humans") + mutant_humans = 1 + if("assistant_cap") + assistant_cap = text2num(value) + if("starlight") + starlight = 1 + if("grey_assistants") + grey_assistants = 1 + if("lavaland_budget") + lavaland_budget = text2num(value) + if("space_budget") + space_budget = text2num(value) + if("no_summon_guns") + no_summon_guns = 1 + if("no_summon_magic") + no_summon_magic = 1 + if("no_summon_events") + no_summon_events = 1 + if("reactionary_explosions") + reactionary_explosions = 1 + if("bombcap") + var/BombCap = text2num(value) + if (!BombCap) + continue + if (BombCap < 4) + BombCap = 4 + + GLOB.MAX_EX_DEVESTATION_RANGE = round(BombCap/4) + GLOB.MAX_EX_HEAVY_RANGE = round(BombCap/2) + GLOB.MAX_EX_LIGHT_RANGE = BombCap + GLOB.MAX_EX_FLASH_RANGE = BombCap + GLOB.MAX_EX_FLAME_RANGE = BombCap + if("arrivals_shuttle_dock_window") + arrivals_shuttle_dock_window = max(PARALLAX_LOOP_TIME, text2num(value)) + if("arrivals_shuttle_require_safe_latejoin") + arrivals_shuttle_require_safe_latejoin = TRUE + if("mice_roundstart") + mice_roundstart = text2num(value) + if ("mentor_mobname_only") + mentors_mobname_only = 1 + if ("mentor_legacy_system") + mentor_legacy_system = 1 + else + GLOB.config_error_log << "Unknown setting in configuration: '[name]'" + + fps = round(fps) + if(fps <= 0) + fps = initial(fps) + + +/datum/configuration/proc/loadmaplist(filename) + var/list/Lines = world.file2list(filename) + + var/datum/map_config/currentmap = null + for(var/t in Lines) + if(!t) + continue + + t = trim(t) + if(length(t) == 0) + continue + else if(copytext(t, 1, 2) == "#") + continue + + var/pos = findtext(t, " ") + var/command = null + var/data = null + + if(pos) + command = lowertext(copytext(t, 1, pos)) + data = copytext(t, pos + 1) + else + command = lowertext(t) + + if(!command) + continue + + if (!currentmap && command != "map") + continue + + switch (command) + if ("map") + currentmap = new ("_maps/[data].json") + if(currentmap.defaulted) + log_world("Failed to load map config for [data]!") + if ("minplayers","minplayer") + currentmap.config_min_users = text2num(data) + if ("maxplayers","maxplayer") + currentmap.config_max_users = text2num(data) + if ("weight","voteweight") + currentmap.voteweight = text2num(data) + if ("default","defaultmap") + defaultmap = currentmap + if ("endmap") + maplist[currentmap.map_name] = currentmap + currentmap = null + else + GLOB.config_error_log << "Unknown command in map vote config: '[command]'" + + +/datum/configuration/proc/loadsql(filename) + var/list/Lines = world.file2list(filename) + for(var/t in Lines) + if(!t) + continue + + t = trim(t) + if(length(t) == 0) + continue + else if(copytext(t, 1, 2) == "#") + continue + + var/pos = findtext(t, " ") + var/name = null + var/value = null + + if(pos) + name = lowertext(copytext(t, 1, pos)) + value = copytext(t, pos + 1) + else + name = lowertext(t) + + if(!name) + continue + + switch(name) + if("sql_enabled") + sql_enabled = 1 + if("address") + global.sqladdress = value + if("port") + global.sqlport = value + if("feedback_database") + global.sqlfdbkdb = value + if("feedback_login") + global.sqlfdbklogin = value + if("feedback_password") + global.sqlfdbkpass = value + if("feedback_tableprefix") + global.sqlfdbktableprefix = value + else + GLOB.config_error_log << "Unknown setting in configuration: '[name]'" + +/datum/configuration/proc/pick_mode(mode_name) + // I wish I didn't have to instance the game modes in order to look up + // their information, but it is the only way (at least that I know of). + for(var/T in gamemode_cache) + var/datum/game_mode/M = new T() + if(M.config_tag && M.config_tag == mode_name) + return M + qdel(M) + return new /datum/game_mode/extended() + +/datum/configuration/proc/get_runnable_modes() + var/list/datum/game_mode/runnable_modes = new + for(var/T in gamemode_cache) + var/datum/game_mode/M = new T() + //to_chat(world, "DEBUG: [T], tag=[M.config_tag], prob=[probabilities[M.config_tag]]") + if(!(M.config_tag in modes)) + qdel(M) + continue + if(probabilities[M.config_tag]<=0) + qdel(M) + continue + if(min_pop[M.config_tag]) + M.required_players = min_pop[M.config_tag] + if(max_pop[M.config_tag]) + M.maximum_players = max_pop[M.config_tag] + if(M.can_start()) + runnable_modes[M] = probabilities[M.config_tag] + //to_chat(world, "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]") + return runnable_modes + +/datum/configuration/proc/get_runnable_midround_modes(crew) + var/list/datum/game_mode/runnable_modes = new + for(var/T in (gamemode_cache - SSticker.mode.type)) + var/datum/game_mode/M = new T() + if(!(M.config_tag in modes)) + qdel(M) + continue + if(probabilities[M.config_tag]<=0) + qdel(M) + continue + if(min_pop[M.config_tag]) + M.required_players = min_pop[M.config_tag] + if(max_pop[M.config_tag]) + M.maximum_players = max_pop[M.config_tag] + if(M.required_players <= crew) + if(M.maximum_players >= 0 && M.maximum_players < crew) + continue + runnable_modes[M] = probabilities[M.config_tag] + return runnable_modes + +/datum/configuration/proc/stat_entry() + if(!statclick) + statclick = new/obj/effect/statclick/debug(null, "Edit", src) + + stat("[name]:", statclick) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 9f6e481edb..5b7d015e19 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -162,3 +162,8 @@ owner.confused = min(owner.confused + round(severity * 0.025, 1), 25) //2.5% of severity per second above 20 severity owner.adjustToxLoss(severity * 0.02, TRUE, TRUE) //2% of severity per second severity-- + +/datum/status_effect/cultghost //is a cult ghost and can't use manifest runes + id = "cult_ghost" + duration = -1 + alert_type = null \ No newline at end of file diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 6058e8f605..4be3401983 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -26,6 +26,11 @@ return ..() +/obj/item/weapon/melee/cultblade/ghost + name = "eldritch sword" + force = 20 + flags = NODROP|DROPDEL + /obj/item/weapon/melee/cultblade/pickup(mob/living/user) ..() if(!iscultist(user)) @@ -100,12 +105,18 @@ icon_state = "cult_hoodalt" item_state = "cult_hoodalt" +/obj/item/clothing/head/culthood/alt/ghost + flags = NODROP|DROPDEL + /obj/item/clothing/suit/cultrobes/alt name = "cultist robes" desc = "An armored set of robes worn by the followers of Nar-Sie." icon_state = "cultrobesalt" item_state = "cultrobesalt" +/obj/item/clothing/suit/cultrobes/alt/ghost + flags = NODROP|DROPDEL + /obj/item/clothing/head/magus name = "magus helm" diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 40cad5c0dd..4a0ac51b13 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -481,12 +481,7 @@ structure_check() searches for nearby cultist structures required for the invoca if(src) color = "#FF0000" SSticker.mode.eldergod = FALSE - deltimer(GLOB.blood_target_reset_timer) - GLOB.blood_target = new /obj/singularity/narsie/large(T) //Causes Nar-Sie to spawn even if the rune has been removed - for(var/datum/mind/cult_mind in SSticker.mode.cult) - if(isliving(cult_mind.current)) - var/mob/living/L = cult_mind.current - L.narsie_act() + new /obj/singularity/narsie/large(T) //Causes Nar-Sie to spawn even if the rune has been removed /obj/effect/rune/narsie/attackby(obj/I, mob/user, params) //Since the narsie rune takes a long time to make, add logging to removal. if((istype(I, /obj/item/weapon/tome) && iscultist(user))) @@ -895,9 +890,11 @@ structure_check() searches for nearby cultist structures required for the invoca icon_state = "6" construct_invoke = 0 color = "#C80000" + var/ghost_limit = 5 + var/ghosts = 0 -/obj/effect/rune/manifest/New(loc) - ..() +/obj/effect/rune/manifest/Initialize() + . = ..() notify_ghosts("Manifest rune created in [get_area(src)].", 'sound/effects/ghost2.ogg', source = src) /obj/effect/rune/manifest/can_invoke(mob/living/user) @@ -906,6 +903,16 @@ structure_check() searches for nearby cultist structures required for the invoca fail_invoke() log_game("Manifest rune failed - user not standing on rune") return list() + if(user.has_status_effect(STATUS_EFFECT_SUMMONEDGHOST)) + to_chat(user, "Ghosts can't summon more ghosts!") + fail_invoke() + log_game("Manifest rune failed - user is a ghost") + return list() + if(ghosts >= ghost_limit) + to_chat(user, "You are sustaining too many ghosts to summon more!") + fail_invoke() + log_game("Manifest rune failed - too many summoned ghosts") + return list() var/list/ghosts_on_rune = list() for(var/mob/dead/observer/O in get_turf(src)) if(O.client && !jobban_isbanned(O, ROLE_CULTIST)) @@ -927,8 +934,11 @@ structure_check() searches for nearby cultist structures required for the invoca var/mob/living/carbon/human/new_human = new(get_turf(src)) new_human.real_name = ghost_to_spawn.real_name new_human.alpha = 150 //Makes them translucent + new_human.equipOutfit(/datum/outfit/ghost_cultist) //give them armor + new_human.apply_status_effect(STATUS_EFFECT_SUMMONEDGHOST) //ghosts can't summon more ghosts ..() - visible_message("A cloud of red mist forms above [src], and from within steps... a man.") + ghosts++ + visible_message("A cloud of red mist forms above [src], and from within steps... a [new_human.gender == FEMALE ? "wo":""]man.") to_chat(user, "Your blood begins flowing into [src]. You must remain in place and conscious to maintain the forms of those summoned. This will hurt you slowly but surely...") var/turf/T = get_turf(src) var/obj/structure/emergency_shield/invoker/N = new(T) @@ -937,16 +947,17 @@ structure_check() searches for nearby cultist structures required for the invoca SSticker.mode.add_cultist(new_human.mind, 0) to_chat(new_human, "You are a servant of the Geometer. You have been made semi-corporeal by the cult of Nar-Sie, and you are to serve them at all costs.") - while(user in T) - if(user.stat) + while(!QDELETED(src) && !QDELETED(user) && !QDELETED(new_human) && (user in T)) + if(user.stat || new_human.InCritical()) break user.apply_damage(0.1, BRUTE) - sleep(3) + sleep(1) qdel(N) + ghosts-- if(new_human) new_human.visible_message("[new_human] suddenly dissolves into bones and ashes.", \ "Your link to the world fades. Your form breaks apart.") for(var/obj/I in new_human) - new_human.dropItemToGround(I) + new_human.dropItemToGround(I, TRUE) new_human.dust() \ No newline at end of file diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 9819d4374a..2033edd7f7 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -52,7 +52,7 @@ update_icon() /obj/machinery/computer/narsie_act() - if(clockwork && clockwork != initial(clockwork)) //if it's clockwork but isn't normally clockwork + if(clockwork && clockwork != initial(clockwork)) //if it's clockwork but isn't normally clockwork clockwork = FALSE icon_screen = initial(icon_screen) icon_keyboard = initial(icon_keyboard) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 12fcd5ec91..2c2e39c4d7 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -1,397 +1,397 @@ -/* Holograms! - * Contains: - * Holopad - * Hologram - * Other stuff - */ - -/* -Revised. Original based on space ninja hologram code. Which is also mine. /N -How it works: -AI clicks on holopad in camera view. View centers on holopad. -AI clicks again on the holopad to display a hologram. Hologram stays as long as AI is looking at the pad and it (the hologram) is in range of the pad. -AI can use the directional keys to move the hologram around, provided the above conditions are met and the AI in question is the holopad's master. -Any number of AIs can use a holopad. /Lo6 -AI may cancel the hologram at any time by clicking on the holopad once more. - -Possible to do for anyone motivated enough: - Give an AI variable for different hologram icons. - Itegrate EMP effect to disable the unit. -*/ - - -/* - * Holopad - */ - -#define HOLOPAD_PASSIVE_POWER_USAGE 1 -#define HOLOGRAM_POWER_USAGE 2 - -GLOBAL_LIST_EMPTY(holopads) -#define HOLOPAD_MODE RANGE_BASED - -/obj/machinery/holopad - name = "Holopad" - desc = "It's a floor-mounted device for projecting holographic images." - icon_state = "holopad0" - layer = LOW_OBJ_LAYER - flags = HEAR - anchored = 1 - use_power = 1 - idle_power_usage = 5 - active_power_usage = 100 - obj_integrity = 300 - max_integrity = 300 - armor = list(melee = 50, bullet = 20, laser = 20, energy = 20, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 0) - var/list/masters = list()//List of living mobs that use the holopad - var/last_request = 0 //to prevent request spam. ~Carn - var/holo_range = 5 // Change to change how far the AI can move away from the holopad before deactivating. - var/temp = "" - var/list/holo_calls //array of /datum/holocalls - var/datum/holocall/outgoing_call //do not modify the datums only check and call the public procs - var/static/force_answer_call = FALSE //Calls will be automatically answered after a couple rings, here for debugging - var/static/list/holopads = list() - -/obj/machinery/holopad/Initialize() - ..() - var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/holopad(null) - B.apply_default_parts(src) - holopads += src - -/obj/machinery/holopad/Destroy() - if(outgoing_call) - LAZYADD(holo_calls, outgoing_call) - - for(var/I in holo_calls) - var/datum/holocall/HC = I - HC.ConnectionFailure(src) - LAZYCLEARLIST(holo_calls) - - for (var/I in masters) - clear_holo(I) - holopads -= src - return ..() - -/obj/machinery/holopad/power_change() - if (powered()) - stat &= ~NOPOWER - else - stat |= ~NOPOWER - -/obj/machinery/holopad/RefreshParts() - var/holograph_range = 4 - for(var/obj/item/weapon/stock_parts/capacitor/B in component_parts) - holograph_range += 1 * B.rating - holo_range = holograph_range - -/obj/machinery/holopad/attackby(obj/item/P, mob/user, params) - if(default_deconstruction_screwdriver(user, "holopad_open", "holopad0", P)) - return - - if(exchange_parts(user, P)) - return - - if(default_pry_open(P)) - return - - if(default_unfasten_wrench(user, P)) - return - - if(default_deconstruction_crowbar(P)) - return - return ..() - -/obj/machinery/holopad/proc/CheckCallClose() - for(var/I in holo_calls) - var/datum/holocall/HC = I - if(usr == HC.eye) - HC.Disconnect(HC.calling_holopad) //disconnect via clicking the called holopad - return TRUE - return FALSE - -/obj/machinery/holopad/Click(location,control,params) - if(!CheckCallClose()) - return ..() - -/obj/machinery/holopad/AltClick(mob/living/carbon/human/user) - if(!CheckCallClose()) - interact(user) - -/obj/machinery/holopad/interact(mob/living/carbon/human/user) //Carn: Hologram requests. - if(!istype(user)) - return - - if(outgoing_call || user.incapacitated() || !is_operational()) - return - - user.set_machine(src) - var/dat - if(temp) - dat = temp - else - dat = "Request an AI's presence.
" - dat += "Call another holopad.
" - - if(LAZYLEN(holo_calls)) - dat += "=====================================================
" - - var/one_answered_call = FALSE - var/one_unanswered_call = FALSE - for(var/I in holo_calls) - var/datum/holocall/HC = I - if(HC.connected_holopad != src) - dat += "Answer call from [get_area(HC.calling_holopad)].
" - one_unanswered_call = TRUE - else - one_answered_call = TRUE - - if(one_answered_call && one_unanswered_call) - dat += "=====================================================
" - //we loop twice for formatting - for(var/I in holo_calls) - var/datum/holocall/HC = I - if(HC.connected_holopad == src) - dat += "Disconnect call from [HC.user].
" - - - var/datum/browser/popup = new(user, "holopad", name, 300, 130) - popup.set_content(dat) - popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) - popup.open() - -/obj/machinery/holopad/Topic(href, href_list) - if(..() || isAI(usr)) - return - add_fingerprint(usr) - if(!is_operational()) - return - if (href_list["AIrequest"]) - if(last_request + 200 < world.time) - last_request = world.time - temp = "You requested an AI's presence.
" - temp += "Main Menu" - var/area/area = get_area(src) - for(var/mob/living/silicon/ai/AI in GLOB.silicon_mobs) - if(!AI.client) - continue - to_chat(AI, "Your presence is requested at \the [area].") - else - temp = "A request for AI presence was already sent recently.
" - temp += "Main Menu" - - else if(href_list["Holocall"]) - if(outgoing_call) - return - - temp = "You must stand on the holopad to make a call!
" - temp += "Main Menu" - if(usr.loc == loc) - var/list/callnames = list() - for(var/I in holopads) - var/area/A = get_area(I) - if(A) - LAZYADD(callnames[A], I) - callnames -= get_area(src) - - var/result = input(usr, "Choose an area to call", "Holocall") as null|anything in callnames - if(QDELETED(usr) || !result || outgoing_call) - return - - if(usr.loc == loc) - temp = "Dialing...
" - temp += "Main Menu" - new /datum/holocall(usr, src, callnames[result]) - - else if(href_list["connectcall"]) - var/datum/holocall/call_to_connect = locate(href_list["connectcall"]) - if(!QDELETED(call_to_connect)) - call_to_connect.Answer(src) - temp = "" - - else if(href_list["disconnectcall"]) - var/datum/holocall/call_to_disconnect = locate(href_list["disconnectcall"]) - if(!QDELETED(call_to_disconnect)) - call_to_disconnect.Disconnect(src) - temp = "" - - else if(href_list["mainmenu"]) - temp = "" - if(outgoing_call) - outgoing_call.Disconnect() - - updateDialog() - -//do not allow AIs to answer calls or people will use it to meta the AI sattelite -/obj/machinery/holopad/attack_ai(mob/living/silicon/ai/user) - if (!istype(user)) - return - /*There are pretty much only three ways to interact here. - I don't need to check for client since they're clicking on an object. - This may change in the future but for now will suffice.*/ - if(user.eyeobj.loc != src.loc)//Set client eye on the object if it's not already. - user.eyeobj.setLoc(get_turf(src)) - else if(!masters[user])//If there is no hologram, possibly make one. - activate_holo(user) - else//If there is a hologram, remove it. - clear_holo(user) - -/obj/machinery/holopad/process() - for(var/I in masters) - var/mob/living/master = I - var/mob/living/silicon/ai/AI = master - if(!istype(AI)) - AI = null - - if(!QDELETED(master) && !master.incapacitated() && master.client && (!AI || AI.eyeobj))//If there is an AI attached, it's not incapacitated, it has a client, and the client eye is centered on the projector. - if(is_operational())//If the machine has power. - if(AI) //ais are range based - if(get_dist(AI.eyeobj, src) <= holo_range) - continue - else - var/obj/machinery/holopad/pad_close = get_closest_atom(/obj/machinery/holopad, holopads, AI.eyeobj) - if(get_dist(pad_close, AI.eyeobj) <= holo_range) - var/obj/effect/overlay/holo_pad_hologram/h = masters[master] - unset_holo(master) - pad_close.set_holo(master, h) - continue - else - continue - clear_holo(master)//If not, we want to get rid of the hologram. - - if(outgoing_call) - outgoing_call.Check() - - for(var/I in holo_calls) - var/datum/holocall/HC = I - if(HC.connected_holopad != src) - if(force_answer_call && world.time > (HC.call_start_time + (HOLOPAD_MAX_DIAL_TIME / 2))) - HC.Answer(src) - break - if(outgoing_call) - HC.Disconnect(src)//can't answer calls while calling - else - playsound(src, 'sound/machines/twobeep.ogg', 100) //bring, bring! - -/obj/machinery/holopad/proc/activate_holo(mob/living/user) - var/mob/living/silicon/ai/AI = user - if(!istype(AI)) - AI = null - - if(is_operational() && (!AI || AI.eyeobj.loc == loc))//If the projector has power and client eye is on it - if (AI && istype(AI.current, /obj/machinery/holopad)) - to_chat(user, "ERROR: \black Image feed in progress.") - return - - var/obj/effect/overlay/holo_pad_hologram/Hologram = new(loc)//Spawn a blank effect at the location. - if(AI) - Hologram.icon = AI.holo_icon - else //make it like real life - Hologram.icon = user.icon - Hologram.icon_state = user.icon_state - Hologram.copy_overlays(user, TRUE) - //codersprite some holo effects here - Hologram.alpha = 100 - Hologram.add_atom_colour("#77abff", FIXED_COLOUR_PRIORITY) - Hologram.Impersonation = user - - - Hologram.language_holder = user.get_language_holder() - - Hologram.mouse_opacity = 0//So you can't click on it. - Hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them. - Hologram.anchored = 1//So space wind cannot drag it. - Hologram.name = "[user.name] (Hologram)"//If someone decides to right click. - Hologram.set_light(2) //hologram lighting - - set_holo(user, Hologram) - visible_message("A holographic image of [user] flicks to life right before your eyes!") - - return Hologram - else - to_chat(user, "ERROR: \black Unable to project hologram.") - -/*This is the proc for special two-way communication between AI and holopad/people talking near holopad. -For the other part of the code, check silicon say.dm. Particularly robot talk.*/ -/obj/machinery/holopad/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode) - if(speaker && masters.len && !radio_freq)//Master is mostly a safety in case lag hits or something. Radio_freq so AIs dont hear holopad stuff through radios. - for(var/mob/living/silicon/ai/master in masters) - if(masters[master] && speaker != master) - master.relay_speech(message, speaker, message_language, raw_message, radio_freq, spans, message_mode) - - for(var/I in holo_calls) - var/datum/holocall/HC = I - if(HC.connected_holopad == src && speaker != HC.hologram) - HC.user.Hear(message, speaker, message_language, raw_message, radio_freq, spans) - - if(outgoing_call && speaker == outgoing_call.user) - outgoing_call.hologram.say(raw_message) - -/obj/machinery/holopad/proc/SetLightsAndPower() - var/total_users = masters.len + LAZYLEN(holo_calls) - use_power = HOLOPAD_PASSIVE_POWER_USAGE + HOLOGRAM_POWER_USAGE * total_users - if(total_users) - set_light(2) - icon_state = "holopad1" - else - set_light(0) - icon_state = "holopad0" - -/obj/machinery/holopad/proc/set_holo(mob/living/user, var/obj/effect/overlay/holo_pad_hologram/h) - masters[user] = h - var/mob/living/silicon/ai/AI = user - if(istype(AI)) - AI.current = src - SetLightsAndPower() - return TRUE - -/obj/machinery/holopad/proc/clear_holo(mob/living/user) - qdel(masters[user]) // Get rid of user's hologram - unset_holo(user) - return TRUE - -/obj/machinery/holopad/proc/unset_holo(mob/living/user) - var/mob/living/silicon/ai/AI = user - if(istype(AI) && AI.current == src) - AI.current = null - masters -= user // Discard AI from the list of those who use holopad - SetLightsAndPower() - return TRUE - -/obj/machinery/holopad/proc/move_hologram(mob/living/user, turf/new_turf) - if(masters[user]) - var/obj/effect/overlay/holo_pad_hologram/H = masters[user] - step_to(H, new_turf) - H.loc = new_turf - var/area/holo_area = get_area(src) - var/area/eye_area = new_turf.loc - - if(!(eye_area in holo_area.related)) - clear_holo(user) - return TRUE - -/obj/effect/overlay/holo_pad_hologram - var/mob/living/Impersonation - var/datum/holocall/HC - -/obj/effect/overlay/holo_pad_hologram/Destroy() - Impersonation = null - if(HC) - HC.Disconnect(HC.calling_holopad) - return ..() - -/obj/effect/overlay/holo_pad_hologram/Process_Spacemove(movement_dir = 0) - return 1 - -/obj/effect/overlay/holo_pad_hologram/examine(mob/user) - if(Impersonation) - return Impersonation.examine(user) - return ..() - -/obj/item/weapon/circuitboard/machine/holopad - name = "AI Holopad (Machine Board)" - build_path = /obj/machinery/holopad - origin_tech = "programming=1" - req_components = list(/obj/item/weapon/stock_parts/capacitor = 1) - -#undef HOLOPAD_PASSIVE_POWER_USAGE +/* Holograms! + * Contains: + * Holopad + * Hologram + * Other stuff + */ + +/* +Revised. Original based on space ninja hologram code. Which is also mine. /N +How it works: +AI clicks on holopad in camera view. View centers on holopad. +AI clicks again on the holopad to display a hologram. Hologram stays as long as AI is looking at the pad and it (the hologram) is in range of the pad. +AI can use the directional keys to move the hologram around, provided the above conditions are met and the AI in question is the holopad's master. +Any number of AIs can use a holopad. /Lo6 +AI may cancel the hologram at any time by clicking on the holopad once more. + +Possible to do for anyone motivated enough: + Give an AI variable for different hologram icons. + Itegrate EMP effect to disable the unit. +*/ + + +/* + * Holopad + */ + +#define HOLOPAD_PASSIVE_POWER_USAGE 1 +#define HOLOGRAM_POWER_USAGE 2 + +GLOBAL_LIST_EMPTY(holopads) +#define HOLOPAD_MODE RANGE_BASED + +/obj/machinery/holopad + name = "Holopad" + desc = "It's a floor-mounted device for projecting holographic images." + icon_state = "holopad0" + layer = LOW_OBJ_LAYER + flags = HEAR + anchored = 1 + use_power = 1 + idle_power_usage = 5 + active_power_usage = 100 + obj_integrity = 300 + max_integrity = 300 + armor = list(melee = 50, bullet = 20, laser = 20, energy = 20, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 0) + var/list/masters = list()//List of living mobs that use the holopad + var/last_request = 0 //to prevent request spam. ~Carn + var/holo_range = 5 // Change to change how far the AI can move away from the holopad before deactivating. + var/temp = "" + var/list/holo_calls //array of /datum/holocalls + var/datum/holocall/outgoing_call //do not modify the datums only check and call the public procs + var/static/force_answer_call = FALSE //Calls will be automatically answered after a couple rings, here for debugging + var/static/list/holopads = list() + +/obj/machinery/holopad/Initialize() + ..() + var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/holopad(null) + B.apply_default_parts(src) + holopads += src + +/obj/machinery/holopad/Destroy() + if(outgoing_call) + LAZYADD(holo_calls, outgoing_call) + + for(var/I in holo_calls) + var/datum/holocall/HC = I + HC.ConnectionFailure(src) + LAZYCLEARLIST(holo_calls) + + for (var/I in masters) + clear_holo(I) + holopads -= src + return ..() + +/obj/machinery/holopad/power_change() + if (powered()) + stat &= ~NOPOWER + else + stat |= ~NOPOWER + +/obj/machinery/holopad/RefreshParts() + var/holograph_range = 4 + for(var/obj/item/weapon/stock_parts/capacitor/B in component_parts) + holograph_range += 1 * B.rating + holo_range = holograph_range + +/obj/machinery/holopad/attackby(obj/item/P, mob/user, params) + if(default_deconstruction_screwdriver(user, "holopad_open", "holopad0", P)) + return + + if(exchange_parts(user, P)) + return + + if(default_pry_open(P)) + return + + if(default_unfasten_wrench(user, P)) + return + + if(default_deconstruction_crowbar(P)) + return + return ..() + +/obj/machinery/holopad/proc/CheckCallClose() + for(var/I in holo_calls) + var/datum/holocall/HC = I + if(usr == HC.eye) + HC.Disconnect(HC.calling_holopad) //disconnect via clicking the called holopad + return TRUE + return FALSE + +/obj/machinery/holopad/Click(location,control,params) + if(!CheckCallClose()) + return ..() + +/obj/machinery/holopad/AltClick(mob/living/carbon/human/user) + if(!CheckCallClose()) + interact(user) + +/obj/machinery/holopad/interact(mob/living/carbon/human/user) //Carn: Hologram requests. + if(!istype(user)) + return + + if(outgoing_call || user.incapacitated() || !is_operational()) + return + + user.set_machine(src) + var/dat + if(temp) + dat = temp + else + dat = "Request an AI's presence.
" + dat += "Call another holopad.
" + + if(LAZYLEN(holo_calls)) + dat += "=====================================================
" + + var/one_answered_call = FALSE + var/one_unanswered_call = FALSE + for(var/I in holo_calls) + var/datum/holocall/HC = I + if(HC.connected_holopad != src) + dat += "Answer call from [get_area(HC.calling_holopad)].
" + one_unanswered_call = TRUE + else + one_answered_call = TRUE + + if(one_answered_call && one_unanswered_call) + dat += "=====================================================
" + //we loop twice for formatting + for(var/I in holo_calls) + var/datum/holocall/HC = I + if(HC.connected_holopad == src) + dat += "Disconnect call from [HC.user].
" + + + var/datum/browser/popup = new(user, "holopad", name, 300, 130) + popup.set_content(dat) + popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) + popup.open() + +/obj/machinery/holopad/Topic(href, href_list) + if(..() || isAI(usr)) + return + add_fingerprint(usr) + if(!is_operational()) + return + if (href_list["AIrequest"]) + if(last_request + 200 < world.time) + last_request = world.time + temp = "You requested an AI's presence.
" + temp += "Main Menu" + var/area/area = get_area(src) + for(var/mob/living/silicon/ai/AI in GLOB.silicon_mobs) + if(!AI.client) + continue + to_chat(AI, "Your presence is requested at \the [area].") + else + temp = "A request for AI presence was already sent recently.
" + temp += "Main Menu" + + else if(href_list["Holocall"]) + if(outgoing_call) + return + + temp = "You must stand on the holopad to make a call!
" + temp += "Main Menu" + if(usr.loc == loc) + var/list/callnames = list() + for(var/I in holopads) + var/area/A = get_area(I) + if(A) + LAZYADD(callnames[A], I) + callnames -= get_area(src) + + var/result = input(usr, "Choose an area to call", "Holocall") as null|anything in callnames + if(QDELETED(usr) || !result || outgoing_call) + return + + if(usr.loc == loc) + temp = "Dialing...
" + temp += "Main Menu" + new /datum/holocall(usr, src, callnames[result]) + + else if(href_list["connectcall"]) + var/datum/holocall/call_to_connect = locate(href_list["connectcall"]) + if(!QDELETED(call_to_connect)) + call_to_connect.Answer(src) + temp = "" + + else if(href_list["disconnectcall"]) + var/datum/holocall/call_to_disconnect = locate(href_list["disconnectcall"]) + if(!QDELETED(call_to_disconnect)) + call_to_disconnect.Disconnect(src) + temp = "" + + else if(href_list["mainmenu"]) + temp = "" + if(outgoing_call) + outgoing_call.Disconnect() + + updateDialog() + +//do not allow AIs to answer calls or people will use it to meta the AI sattelite +/obj/machinery/holopad/attack_ai(mob/living/silicon/ai/user) + if (!istype(user)) + return + /*There are pretty much only three ways to interact here. + I don't need to check for client since they're clicking on an object. + This may change in the future but for now will suffice.*/ + if(user.eyeobj.loc != src.loc)//Set client eye on the object if it's not already. + user.eyeobj.setLoc(get_turf(src)) + else if(!masters[user])//If there is no hologram, possibly make one. + activate_holo(user) + else//If there is a hologram, remove it. + clear_holo(user) + +/obj/machinery/holopad/process() + for(var/I in masters) + var/mob/living/master = I + var/mob/living/silicon/ai/AI = master + if(!istype(AI)) + AI = null + + if(!QDELETED(master) && !master.incapacitated() && master.client && (!AI || AI.eyeobj))//If there is an AI attached, it's not incapacitated, it has a client, and the client eye is centered on the projector. + if(is_operational())//If the machine has power. + if(AI) //ais are range based + if(get_dist(AI.eyeobj, src) <= holo_range) + continue + else + var/obj/machinery/holopad/pad_close = get_closest_atom(/obj/machinery/holopad, holopads, AI.eyeobj) + if(get_dist(pad_close, AI.eyeobj) <= holo_range) + var/obj/effect/overlay/holo_pad_hologram/h = masters[master] + unset_holo(master) + pad_close.set_holo(master, h) + continue + else + continue + clear_holo(master)//If not, we want to get rid of the hologram. + + if(outgoing_call) + outgoing_call.Check() + + for(var/I in holo_calls) + var/datum/holocall/HC = I + if(HC.connected_holopad != src) + if(force_answer_call && world.time > (HC.call_start_time + (HOLOPAD_MAX_DIAL_TIME / 2))) + HC.Answer(src) + break + if(outgoing_call) + HC.Disconnect(src)//can't answer calls while calling + else + playsound(src, 'sound/machines/twobeep.ogg', 100) //bring, bring! + +/obj/machinery/holopad/proc/activate_holo(mob/living/user) + var/mob/living/silicon/ai/AI = user + if(!istype(AI)) + AI = null + + if(is_operational() && (!AI || AI.eyeobj.loc == loc))//If the projector has power and client eye is on it + if (AI && istype(AI.current, /obj/machinery/holopad)) + to_chat(user, "ERROR: \black Image feed in progress.") + return + + var/obj/effect/overlay/holo_pad_hologram/Hologram = new(loc)//Spawn a blank effect at the location. + if(AI) + Hologram.icon = AI.holo_icon + else //make it like real life + Hologram.icon = user.icon + Hologram.icon_state = user.icon_state + Hologram.copy_overlays(user, TRUE) + //codersprite some holo effects here + Hologram.alpha = 100 + Hologram.add_atom_colour("#77abff", FIXED_COLOUR_PRIORITY) + Hologram.Impersonation = user + + + Hologram.language_holder = user.get_language_holder() + + Hologram.mouse_opacity = 0//So you can't click on it. + Hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them. + Hologram.anchored = 1//So space wind cannot drag it. + Hologram.name = "[user.name] (Hologram)"//If someone decides to right click. + Hologram.set_light(2) //hologram lighting + + set_holo(user, Hologram) + visible_message("A holographic image of [user] flicks to life right before your eyes!") + + return Hologram + else + to_chat(user, "ERROR: \black Unable to project hologram.") + +/*This is the proc for special two-way communication between AI and holopad/people talking near holopad. +For the other part of the code, check silicon say.dm. Particularly robot talk.*/ +/obj/machinery/holopad/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode) + if(speaker && masters.len && !radio_freq)//Master is mostly a safety in case lag hits or something. Radio_freq so AIs dont hear holopad stuff through radios. + for(var/mob/living/silicon/ai/master in masters) + if(masters[master] && speaker != master) + master.relay_speech(message, speaker, message_language, raw_message, radio_freq, spans, message_mode) + + for(var/I in holo_calls) + var/datum/holocall/HC = I + if(HC.connected_holopad == src && speaker != HC.hologram) + HC.user.Hear(message, speaker, message_language, raw_message, radio_freq, spans) + + if(outgoing_call && speaker == outgoing_call.user) + outgoing_call.hologram.say(raw_message) + +/obj/machinery/holopad/proc/SetLightsAndPower() + var/total_users = masters.len + LAZYLEN(holo_calls) + use_power = HOLOPAD_PASSIVE_POWER_USAGE + HOLOGRAM_POWER_USAGE * total_users + if(total_users) + set_light(2) + icon_state = "holopad1" + else + set_light(0) + icon_state = "holopad0" + +/obj/machinery/holopad/proc/set_holo(mob/living/user, var/obj/effect/overlay/holo_pad_hologram/h) + masters[user] = h + var/mob/living/silicon/ai/AI = user + if(istype(AI)) + AI.current = src + SetLightsAndPower() + return TRUE + +/obj/machinery/holopad/proc/clear_holo(mob/living/user) + qdel(masters[user]) // Get rid of user's hologram + unset_holo(user) + return TRUE + +/obj/machinery/holopad/proc/unset_holo(mob/living/user) + var/mob/living/silicon/ai/AI = user + if(istype(AI) && AI.current == src) + AI.current = null + masters -= user // Discard AI from the list of those who use holopad + SetLightsAndPower() + return TRUE + +/obj/machinery/holopad/proc/move_hologram(mob/living/user, turf/new_turf) + if(masters[user]) + var/obj/effect/overlay/holo_pad_hologram/H = masters[user] + step_to(H, new_turf) + H.loc = new_turf + var/area/holo_area = get_area(src) + var/area/eye_area = new_turf.loc + + if(!(eye_area in holo_area.related)) + clear_holo(user) + return TRUE + +/obj/effect/overlay/holo_pad_hologram + var/mob/living/Impersonation + var/datum/holocall/HC + +/obj/effect/overlay/holo_pad_hologram/Destroy() + Impersonation = null + if(HC) + HC.Disconnect(HC.calling_holopad) + return ..() + +/obj/effect/overlay/holo_pad_hologram/Process_Spacemove(movement_dir = 0) + return 1 + +/obj/effect/overlay/holo_pad_hologram/examine(mob/user) + if(Impersonation) + return Impersonation.examine(user) + return ..() + +/obj/item/weapon/circuitboard/machine/holopad + name = "AI Holopad (Machine Board)" + build_path = /obj/machinery/holopad + origin_tech = "programming=1" + req_components = list(/obj/item/weapon/stock_parts/capacitor = 1) + +#undef HOLOPAD_PASSIVE_POWER_USAGE #undef HOLOGRAM_POWER_USAGE \ No newline at end of file diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 1f2f86e42a..7929bf09c3 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -1,602 +1,602 @@ -/obj/item/device/radio - icon = 'icons/obj/radio.dmi' - name = "station bounced radio" - suffix = "\[3\]" - icon_state = "walkietalkie" - item_state = "walkietalkie" - dog_fashion = /datum/dog_fashion/back - var/on = 1 // 0 for off - var/last_transmission - var/frequency = 1459 //common chat - var/traitor_frequency = 0 //tune to frequency to unlock traitor supplies - var/canhear_range = 3 // the range which mobs can hear this radio from - var/obj/item/device/radio/patch_link = null - var/list/secure_radio_connections - var/prison_radio = 0 - var/b_stat = 0 - var/broadcasting = 0 - var/listening = 1 - var/translate_binary = 0 - var/freerange = 0 // 0 - Sanitize frequencies, 1 - Full range - var/list/channels = list() //see communications.dm for full list. First channes is a "default" for :h - var/obj/item/device/encryptionkey/keyslot //To allow the radio to accept encryption keys. - var/subspace_switchable = 0 - var/subspace_transmission = 0 - var/syndie = 0//Holder to see if it's a syndicate encrpyed radio - var/independent = FALSE // If true, bypasses any tcomms machinery. - var/freqlock = 0 //Frequency lock to stop the user from untuning specialist radios. - var/emped = 0 //Highjacked to track the number of consecutive EMPs on the radio, allowing consecutive EMP's to stack properly. -// "Example" = FREQ_LISTENING|FREQ_BROADCASTING - flags = CONDUCT | HEAR - slot_flags = SLOT_BELT - throw_speed = 3 - throw_range = 7 - w_class = WEIGHT_CLASS_SMALL - materials = list(MAT_METAL=75, MAT_GLASS=25) - - var/const/TRANSMISSION_DELAY = 5 // only 2/second/radio - var/const/FREQ_LISTENING = 1 - //FREQ_BROADCASTING = 2 - - var/command = FALSE //If we are speaking into a command headset, our text can be BOLD - var/use_command = FALSE - -/obj/item/device/radio/proc/set_frequency(new_frequency) - remove_radio(src, frequency) - frequency = add_radio(src, new_frequency) - -/obj/item/device/radio/New() - wires = new /datum/wires/radio(src) - if(prison_radio) - wires.cut(WIRE_TX) // OH GOD WHY - secure_radio_connections = new - ..() - -/obj/item/device/radio/proc/recalculateChannels() - channels = list() - translate_binary = 0 - syndie = 0 - independent = FALSE - - if(keyslot) - for(var/ch_name in keyslot.channels) - if(ch_name in src.channels) - continue - channels += ch_name - channels[ch_name] = keyslot.channels[ch_name] - - if(keyslot.translate_binary) - translate_binary = 1 - - if(keyslot.syndie) - syndie = 1 - - if(keyslot.independent) - independent = TRUE - - for(var/ch_name in channels) - secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name]) - -/obj/item/device/radio/proc/make_syndie() // Turns normal radios into Syndicate radios! - qdel(keyslot) - keyslot = new /obj/item/device/encryptionkey/syndicate - syndie = 1 - recalculateChannels() - -/obj/item/device/radio/Destroy() - qdel(wires) - wires = null - remove_radio_all(src) //Just to be sure - patch_link = null - keyslot = null - return ..() - -/obj/item/device/radio/Initialize() - ..() - frequency = sanitize_frequency(frequency, freerange) - set_frequency(frequency) - - for(var/ch_name in channels) - secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name]) - -/obj/item/device/radio/interact(mob/user) - if (..()) - return - if(b_stat && !isAI(user)) - wires.interact(user) - else - ui_interact(user) - -/obj/item/device/radio/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state) - ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) - if(!ui) - ui = new(user, src, ui_key, "radio", name, 370, 220 + channels.len * 22, master_ui, state) - ui.open() - -/obj/item/device/radio/ui_data(mob/user) - var/list/data = list() - - data["broadcasting"] = broadcasting - data["listening"] = listening - data["frequency"] = frequency - data["minFrequency"] = freerange ? MIN_FREE_FREQ : MIN_FREQ - data["maxFrequency"] = freerange ? MAX_FREE_FREQ : MAX_FREQ - data["freqlock"] = freqlock - data["channels"] = list() - for(var/channel in channels) - data["channels"][channel] = channels[channel] & FREQ_LISTENING - data["command"] = command - data["useCommand"] = use_command - data["subspace"] = subspace_transmission - data["subspaceSwitchable"] = subspace_switchable - data["headset"] = istype(src, /obj/item/device/radio/headset) - - return data - -/obj/item/device/radio/ui_act(action, params, datum/tgui/ui) - if(..()) - return - switch(action) - if("frequency") - if(freqlock) - return - var/tune = params["tune"] - var/adjust = text2num(params["adjust"]) - if(tune == "input") - var/min = format_frequency(freerange ? MIN_FREE_FREQ : MIN_FREQ) - var/max = format_frequency(freerange ? MAX_FREE_FREQ : MAX_FREQ) - tune = input("Tune frequency ([min]-[max]):", name, format_frequency(frequency)) as null|num - if(!isnull(tune) && !..()) - . = TRUE - else if(adjust) - tune = frequency + adjust * 10 - . = TRUE - else if(text2num(tune) != null) - tune = tune * 10 - . = TRUE - if(.) - frequency = sanitize_frequency(tune, freerange) - set_frequency(frequency) - if(frequency == traitor_frequency && hidden_uplink) - hidden_uplink.interact(usr) - ui.close() - if("listen") - listening = !listening - . = TRUE - if("broadcast") - broadcasting = !broadcasting - . = TRUE - if("channel") - var/channel = params["channel"] - if(!(channel in channels)) - return - if(channels[channel] & FREQ_LISTENING) - channels[channel] &= ~FREQ_LISTENING - else - channels[channel] |= FREQ_LISTENING - . = TRUE - if("command") - use_command = !use_command - . = TRUE - if("subspace") - if(subspace_switchable) - subspace_transmission = !subspace_transmission - if(!subspace_transmission) - channels = list() - else - recalculateChannels() - . = TRUE - -/obj/item/device/radio/talk_into(atom/movable/M, message, channel, list/spans, datum/language/language) - if(!spans) - spans = M.get_spans() - if(!language) - language = M.get_default_language() - INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans, language) - return ITALICS | REDUCE_RANGE - -/obj/item/device/radio/proc/talk_into_impl(atom/movable/M, message, channel, list/spans, datum/language/language) - if(!on) return // the device has to be on - // Fix for permacell radios, but kinda eh about actually fixing them. - if(!M || !message) return - - if(wires.is_cut(WIRE_TX)) - return - - if(!M.IsVocal()) - return - - if(use_command) - spans |= SPAN_COMMAND - - /* Quick introduction: - This new radio system uses a very robust FTL signaling technology unoriginally - dubbed "subspace" which is somewhat similar to 'blue-space' but can't - actually transmit large mass. Headsets are the only radio devices capable - of sending subspace transmissions to the Communications Satellite. - - A headset sends a signal to a subspace listener/reciever elsewhere in space, - the signal gets processed and logged, and an audible transmission gets sent - to each individual headset. - */ - - /* - be prepared to disregard any comments in all of tcomms code. i tried my best to keep them somewhat up-to-date, but eh - */ - - //get the frequency you buttface. radios no longer use the SSradio. confusing for future generations, convenient for me. - var/freq - if(channel && channels && channels.len > 0) - if(channel == "department") - channel = channels[1] - freq = secure_radio_connections[channel] - if (!channels[channel]) // if the channel is turned off, don't broadcast - return - else - freq = frequency - channel = null - - var/freqnum = text2num(freq) //Why should we call text2num three times when we can just do it here? - var/turf/position = get_turf(src) - - var/jammed = FALSE - for(var/obj/item/device/jammer/jammer in GLOB.active_jammers) - if(get_dist(position,get_turf(jammer)) < jammer.range) - jammed = TRUE - break - - //#### Tagging the signal with all appropriate identity values ####// - - // ||-- The mob's name identity --|| - var/real_name = M.name // mob's real name - var/mobkey = "none" // player key associated with mob - var/voicemask = 0 // the speaker is wearing a voice mask - var/voice = M.GetVoice() // Why reinvent the wheel when there is a proc that does nice things already - if(ismob(M)) - var/mob/speaker = M - real_name = speaker.real_name - if(speaker.client) - mobkey = speaker.key // assign the mob's key - - - var/jobname // the mob's "job" - - if(jammed) - message = Gibberish(message,100) - - // --- Human: use their job as seen on the crew manifest - makes it unneeded to carry an ID for an AI to see their job - if(ishuman(M)) - var/datum/data/record/findjob = find_record("name", voice, GLOB.data_core.general) - - if(voice != real_name) - voicemask = 1 - if(findjob) - jobname = findjob.fields["rank"] - else - jobname = "Unknown" - - // --- Carbon Nonhuman --- - else if(iscarbon(M)) // Nonhuman carbon mob - jobname = "No id" - - // --- AI --- - else if(isAI(M)) - jobname = "AI" - - // --- Cyborg --- - else if(iscyborg(M)) - var/mob/living/silicon/robot/B = M - jobname = "[B.designation] Cyborg" - - // --- Personal AI (pAI) --- - else if(istype(M, /mob/living/silicon/pai)) - jobname = "Personal AI" - - // --- Cold, emotionless machines. --- - else if(isobj(M)) - jobname = "Machine" - - // --- Unidentifiable mob --- - else - jobname = "Unknown" - - /* ###### `independent` radios bypass all comms relays. ###### */ - - if(independent) - var/datum/signal/signal = new - signal.transmission_method = 2 - signal.data = list( - "mob" = M, // store a reference to the mob - "mobtype" = M.type, // the mob's type - "realname" = real_name, // the mob's real name - "name" = voice, // the mob's voice name - "job" = jobname, // the mob's job - "key" = mobkey, // the mob's key - "vmask" = voicemask, // 1 if the mob is using a voice gas mas - - "compression" = 0, // uncompressed radio signal - "message" = message, // the actual sent message - "radio" = src, // stores the radio used for transmission - "slow" = 0, - "traffic" = 0, - "type" = 0, - "server" = null, - "reject" = 0, - "level" = 0, - "language" = language, - "spans" = spans, - "verb_say" = M.verb_say, - "verb_ask" = M.verb_ask, - "verb_exclaim" = M.verb_exclaim, - "verb_yell" = M.verb_yell, - ) - signal.frequency = freqnum // Quick frequency set - Broadcast_Message(M, voicemask, - src, message, voice, jobname, real_name, - 5, signal.data["compression"], list(position.z, 0), freq, spans, - verb_say, verb_ask, verb_exclaim, verb_yell, language) - return - - /* ###### Radio headsets can only broadcast through subspace ###### */ - - if(subspace_transmission) - // First, we want to generate a new radio signal - var/datum/signal/signal = new - signal.transmission_method = 2 // 2 would be a subspace transmission. - // transmission_method could probably be enumerated through #define. Would be neater. - // --- Finally, tag the actual signal with the appropriate values --- - signal.data = list( - // Identity-associated tags: - "mob" = M, // store a reference to the mob - "mobtype" = M.type, // the mob's type - "realname" = real_name, // the mob's real name - "name" = voice, // the mob's voice name - "job" = jobname, // the mob's job - "key" = mobkey, // the mob's key - "vmask" = voicemask, // 1 if the mob is using a voice gas mask - - // We store things that would otherwise be kept in the actual mob - // so that they can be logged even AFTER the mob is deleted or something - - // Other tags: - "compression" = rand(35,65), // compressed radio signal - "message" = message, // the actual sent message - "radio" = src, // stores the radio used for transmission - "slow" = 0, // how much to sleep() before broadcasting - simulates net lag - "traffic" = 0, // dictates the total traffic sum that the signal went through - "type" = 0, // determines what type of radio input it is: normal broadcast - "server" = null, // the last server to log this signal - "reject" = 0, // if nonzero, the signal will not be accepted by any broadcasting machinery - "level" = position.z, // The source's z level - "language" = language, - "spans" = spans, //the span classes of this message. - "verb_say" = M.verb_say, //the verb used when talking normally - "verb_ask" = M.verb_ask, //the verb used when asking - "verb_exclaim" = M.verb_exclaim, //the verb used when exclaiming - "verb_yell" = M.verb_yell //the verb used when yelling - ) - signal.frequency = freq - - //#### Sending the signal to all subspace receivers ####// - - for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list) - R.receive_signal(signal) - - // Allinone can act as receivers. - for(var/obj/machinery/telecomms/allinone/R in GLOB.telecomms_list) - R.receive_signal(signal) - - // Receiving code can be located in Telecommunications.dm - return - - - /* ###### Intercoms and station-bounced radios ###### */ - - var/filter_type = 2 - - var/datum/signal/signal = new - signal.transmission_method = 2 - - - /* --- Try to send a normal subspace broadcast first */ - - signal.data = list( - "mob" = M, // store a reference to the mob - "mobtype" = M.type, // the mob's type - "realname" = real_name, // the mob's real name - "name" = voice, // the mob's voice name - "job" = jobname, // the mob's job - "key" = mobkey, // the mob's key - "vmask" = voicemask, // 1 if the mob is using a voice gas mas - - "compression" = 0, // uncompressed radio signal - "message" = message, // the actual sent message - "radio" = src, // stores the radio used for transmission - "slow" = 0, - "traffic" = 0, - "type" = 0, - "server" = null, - "reject" = 0, - "level" = position.z, - "language" = language, - "spans" = spans, - "verb_say" = M.verb_say, - "verb_ask" = M.verb_ask, - "verb_exclaim" = M.verb_exclaim, - "verb_yell" = M.verb_yell - ) - signal.frequency = freqnum // Quick frequency set - for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list) - R.receive_signal(signal) - - - spawn(20) // wait a little... - - if(signal.data["done"] && position.z in signal.data["level"]) - // we're done here. - return - - // Oh my god; the comms are down or something because the signal hasn't been broadcasted yet in our level. - // Send a mundane broadcast with limited targets: - Broadcast_Message(M, voicemask, - src, message, voice, jobname, real_name, - filter_type, signal.data["compression"], list(position.z), freq, spans, - verb_say, verb_ask, verb_exclaim, verb_yell, language) - -/obj/item/device/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode) - if(radio_freq) - return - if(broadcasting) - if(get_dist(src, speaker) <= canhear_range) - talk_into(speaker, raw_message, , spans, language=message_language) -/* -/obj/item/device/radio/proc/accept_rad(obj/item/device/radio/R as obj, message) - - if ((R.frequency == frequency && message)) - return 1 - else if - - else - return null - return -*/ - - -/obj/item/device/radio/proc/receive_range(freq, level) - // check if this radio can receive on the given frequency, and if so, - // what the range is in which mobs will hear the radio - // returns: -1 if can't receive, range otherwise - - if (wires.is_cut(WIRE_RX)) - return -1 - if(!listening) - return -1 - if(!(0 in level)) - var/turf/position = get_turf(src) - if(!position || !(position.z in level)) - return -1 - if(freq == GLOB.SYND_FREQ) - if(!(src.syndie)) //Checks to see if it's allowed on that frequency, based on the encryption keys - return -1 - if(freq == GLOB.CENTCOM_FREQ) - if(!independent) - return -1 - if (!on) - return -1 - if (!freq) //received on main frequency - if (!listening) - return -1 - else - var/accept = (freq==frequency && listening) - if (!accept) - for(var/ch_name in channels) - if(channels[ch_name] & FREQ_LISTENING) - if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie) //the GLOB.radiochannels list is located in communications.dm - accept = 1 - break - if (!accept) - return -1 - return canhear_range - -/obj/item/device/radio/proc/send_hear(freq, level) - - var/range = receive_range(freq, level) - if(range > -1) - return get_hearers_in_view(canhear_range, src) - - -/obj/item/device/radio/examine(mob/user) - ..() - if (b_stat) - to_chat(user, "[name] can be attached and modified.") - else - to_chat(user, "[name] can not be modified or attached.") - -/obj/item/device/radio/attackby(obj/item/weapon/W, mob/user, params) - add_fingerprint(user) - if(istype(W, /obj/item/weapon/screwdriver)) - b_stat = !b_stat - if(b_stat) - to_chat(user, "The radio can now be attached and modified!") - else - to_chat(user, "The radio can no longer be modified or attached!") - else - return ..() - -/obj/item/device/radio/emp_act(severity) - emped++ //There's been an EMP; better count it - var/curremp = emped //Remember which EMP this was - if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice - to_chat(loc, "\The [src] overloads.") - broadcasting = 0 - listening = 0 - for (var/ch_name in channels) - channels[ch_name] = 0 - on = 0 - spawn(200) - if(emped == curremp) //Don't fix it if it's been EMP'd again - emped = 0 - if (!istype(src, /obj/item/device/radio/intercom)) // intercoms will turn back on on their own - on = 1 - ..() - -/////////////////////////////// -//////////Borg Radios////////// -/////////////////////////////// -//Giving borgs their own radio to have some more room to work with -Sieve - -/obj/item/device/radio/borg - name = "cyborg radio" - subspace_switchable = 1 - dog_fashion = null - -/obj/item/device/radio/borg/Initialize(mapload) - ..() - SET_SECONDARY_FLAG(src, NO_EMP_WIRES) - -/obj/item/device/radio/borg/syndicate - syndie = 1 - keyslot = new /obj/item/device/encryptionkey/syndicate - -/obj/item/device/radio/borg/syndicate/New() - ..() - set_frequency(GLOB.SYND_FREQ) - -/obj/item/device/radio/borg/attackby(obj/item/weapon/W, mob/user, params) - - if(istype(W, /obj/item/weapon/screwdriver)) - if(keyslot) - for(var/ch_name in channels) - SSradio.remove_object(src, GLOB.radiochannels[ch_name]) - secure_radio_connections[ch_name] = null - - - if(keyslot) - var/turf/T = get_turf(user) - if(T) - keyslot.loc = T - keyslot = null - - recalculateChannels() - to_chat(user, "You pop out the encryption key in the radio.") - - else - to_chat(user, "This radio doesn't have any encryption keys!") - - else if(istype(W, /obj/item/device/encryptionkey/)) - if(keyslot) - to_chat(user, "The radio can't hold another key!") - return - - if(!keyslot) - if(!user.transferItemToLoc(W, src)) - return - keyslot = W - - recalculateChannels() - - -/obj/item/device/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag. - listening = 0 // And it's nice to have a subtype too for future features. - dog_fashion = /datum/dog_fashion/back +/obj/item/device/radio + icon = 'icons/obj/radio.dmi' + name = "station bounced radio" + suffix = "\[3\]" + icon_state = "walkietalkie" + item_state = "walkietalkie" + dog_fashion = /datum/dog_fashion/back + var/on = 1 // 0 for off + var/last_transmission + var/frequency = 1459 //common chat + var/traitor_frequency = 0 //tune to frequency to unlock traitor supplies + var/canhear_range = 3 // the range which mobs can hear this radio from + var/obj/item/device/radio/patch_link = null + var/list/secure_radio_connections + var/prison_radio = 0 + var/b_stat = 0 + var/broadcasting = 0 + var/listening = 1 + var/translate_binary = 0 + var/freerange = 0 // 0 - Sanitize frequencies, 1 - Full range + var/list/channels = list() //see communications.dm for full list. First channes is a "default" for :h + var/obj/item/device/encryptionkey/keyslot //To allow the radio to accept encryption keys. + var/subspace_switchable = 0 + var/subspace_transmission = 0 + var/syndie = 0//Holder to see if it's a syndicate encrpyed radio + var/independent = FALSE // If true, bypasses any tcomms machinery. + var/freqlock = 0 //Frequency lock to stop the user from untuning specialist radios. + var/emped = 0 //Highjacked to track the number of consecutive EMPs on the radio, allowing consecutive EMP's to stack properly. +// "Example" = FREQ_LISTENING|FREQ_BROADCASTING + flags = CONDUCT | HEAR + slot_flags = SLOT_BELT + throw_speed = 3 + throw_range = 7 + w_class = WEIGHT_CLASS_SMALL + materials = list(MAT_METAL=75, MAT_GLASS=25) + + var/const/TRANSMISSION_DELAY = 5 // only 2/second/radio + var/const/FREQ_LISTENING = 1 + //FREQ_BROADCASTING = 2 + + var/command = FALSE //If we are speaking into a command headset, our text can be BOLD + var/use_command = FALSE + +/obj/item/device/radio/proc/set_frequency(new_frequency) + remove_radio(src, frequency) + frequency = add_radio(src, new_frequency) + +/obj/item/device/radio/New() + wires = new /datum/wires/radio(src) + if(prison_radio) + wires.cut(WIRE_TX) // OH GOD WHY + secure_radio_connections = new + ..() + +/obj/item/device/radio/proc/recalculateChannels() + channels = list() + translate_binary = 0 + syndie = 0 + independent = FALSE + + if(keyslot) + for(var/ch_name in keyslot.channels) + if(ch_name in src.channels) + continue + channels += ch_name + channels[ch_name] = keyslot.channels[ch_name] + + if(keyslot.translate_binary) + translate_binary = 1 + + if(keyslot.syndie) + syndie = 1 + + if(keyslot.independent) + independent = TRUE + + for(var/ch_name in channels) + secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name]) + +/obj/item/device/radio/proc/make_syndie() // Turns normal radios into Syndicate radios! + qdel(keyslot) + keyslot = new /obj/item/device/encryptionkey/syndicate + syndie = 1 + recalculateChannels() + +/obj/item/device/radio/Destroy() + qdel(wires) + wires = null + remove_radio_all(src) //Just to be sure + patch_link = null + keyslot = null + return ..() + +/obj/item/device/radio/Initialize() + ..() + frequency = sanitize_frequency(frequency, freerange) + set_frequency(frequency) + + for(var/ch_name in channels) + secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name]) + +/obj/item/device/radio/interact(mob/user) + if (..()) + return + if(b_stat && !isAI(user)) + wires.interact(user) + else + ui_interact(user) + +/obj/item/device/radio/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state) + ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "radio", name, 370, 220 + channels.len * 22, master_ui, state) + ui.open() + +/obj/item/device/radio/ui_data(mob/user) + var/list/data = list() + + data["broadcasting"] = broadcasting + data["listening"] = listening + data["frequency"] = frequency + data["minFrequency"] = freerange ? MIN_FREE_FREQ : MIN_FREQ + data["maxFrequency"] = freerange ? MAX_FREE_FREQ : MAX_FREQ + data["freqlock"] = freqlock + data["channels"] = list() + for(var/channel in channels) + data["channels"][channel] = channels[channel] & FREQ_LISTENING + data["command"] = command + data["useCommand"] = use_command + data["subspace"] = subspace_transmission + data["subspaceSwitchable"] = subspace_switchable + data["headset"] = istype(src, /obj/item/device/radio/headset) + + return data + +/obj/item/device/radio/ui_act(action, params, datum/tgui/ui) + if(..()) + return + switch(action) + if("frequency") + if(freqlock) + return + var/tune = params["tune"] + var/adjust = text2num(params["adjust"]) + if(tune == "input") + var/min = format_frequency(freerange ? MIN_FREE_FREQ : MIN_FREQ) + var/max = format_frequency(freerange ? MAX_FREE_FREQ : MAX_FREQ) + tune = input("Tune frequency ([min]-[max]):", name, format_frequency(frequency)) as null|num + if(!isnull(tune) && !..()) + . = TRUE + else if(adjust) + tune = frequency + adjust * 10 + . = TRUE + else if(text2num(tune) != null) + tune = tune * 10 + . = TRUE + if(.) + frequency = sanitize_frequency(tune, freerange) + set_frequency(frequency) + if(frequency == traitor_frequency && hidden_uplink) + hidden_uplink.interact(usr) + ui.close() + if("listen") + listening = !listening + . = TRUE + if("broadcast") + broadcasting = !broadcasting + . = TRUE + if("channel") + var/channel = params["channel"] + if(!(channel in channels)) + return + if(channels[channel] & FREQ_LISTENING) + channels[channel] &= ~FREQ_LISTENING + else + channels[channel] |= FREQ_LISTENING + . = TRUE + if("command") + use_command = !use_command + . = TRUE + if("subspace") + if(subspace_switchable) + subspace_transmission = !subspace_transmission + if(!subspace_transmission) + channels = list() + else + recalculateChannels() + . = TRUE + +/obj/item/device/radio/talk_into(atom/movable/M, message, channel, list/spans, datum/language/language) + if(!spans) + spans = M.get_spans() + if(!language) + language = M.get_default_language() + INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans, language) + return ITALICS | REDUCE_RANGE + +/obj/item/device/radio/proc/talk_into_impl(atom/movable/M, message, channel, list/spans, datum/language/language) + if(!on) return // the device has to be on + // Fix for permacell radios, but kinda eh about actually fixing them. + if(!M || !message) return + + if(wires.is_cut(WIRE_TX)) + return + + if(!M.IsVocal()) + return + + if(use_command) + spans |= SPAN_COMMAND + + /* Quick introduction: + This new radio system uses a very robust FTL signaling technology unoriginally + dubbed "subspace" which is somewhat similar to 'blue-space' but can't + actually transmit large mass. Headsets are the only radio devices capable + of sending subspace transmissions to the Communications Satellite. + + A headset sends a signal to a subspace listener/reciever elsewhere in space, + the signal gets processed and logged, and an audible transmission gets sent + to each individual headset. + */ + + /* + be prepared to disregard any comments in all of tcomms code. i tried my best to keep them somewhat up-to-date, but eh + */ + + //get the frequency you buttface. radios no longer use the SSradio. confusing for future generations, convenient for me. + var/freq + if(channel && channels && channels.len > 0) + if(channel == "department") + channel = channels[1] + freq = secure_radio_connections[channel] + if (!channels[channel]) // if the channel is turned off, don't broadcast + return + else + freq = frequency + channel = null + + var/freqnum = text2num(freq) //Why should we call text2num three times when we can just do it here? + var/turf/position = get_turf(src) + + var/jammed = FALSE + for(var/obj/item/device/jammer/jammer in GLOB.active_jammers) + if(get_dist(position,get_turf(jammer)) < jammer.range) + jammed = TRUE + break + + //#### Tagging the signal with all appropriate identity values ####// + + // ||-- The mob's name identity --|| + var/real_name = M.name // mob's real name + var/mobkey = "none" // player key associated with mob + var/voicemask = 0 // the speaker is wearing a voice mask + var/voice = M.GetVoice() // Why reinvent the wheel when there is a proc that does nice things already + if(ismob(M)) + var/mob/speaker = M + real_name = speaker.real_name + if(speaker.client) + mobkey = speaker.key // assign the mob's key + + + var/jobname // the mob's "job" + + if(jammed) + message = Gibberish(message,100) + + // --- Human: use their job as seen on the crew manifest - makes it unneeded to carry an ID for an AI to see their job + if(ishuman(M)) + var/datum/data/record/findjob = find_record("name", voice, GLOB.data_core.general) + + if(voice != real_name) + voicemask = 1 + if(findjob) + jobname = findjob.fields["rank"] + else + jobname = "Unknown" + + // --- Carbon Nonhuman --- + else if(iscarbon(M)) // Nonhuman carbon mob + jobname = "No id" + + // --- AI --- + else if(isAI(M)) + jobname = "AI" + + // --- Cyborg --- + else if(iscyborg(M)) + var/mob/living/silicon/robot/B = M + jobname = "[B.designation] Cyborg" + + // --- Personal AI (pAI) --- + else if(istype(M, /mob/living/silicon/pai)) + jobname = "Personal AI" + + // --- Cold, emotionless machines. --- + else if(isobj(M)) + jobname = "Machine" + + // --- Unidentifiable mob --- + else + jobname = "Unknown" + + /* ###### `independent` radios bypass all comms relays. ###### */ + + if(independent) + var/datum/signal/signal = new + signal.transmission_method = 2 + signal.data = list( + "mob" = M, // store a reference to the mob + "mobtype" = M.type, // the mob's type + "realname" = real_name, // the mob's real name + "name" = voice, // the mob's voice name + "job" = jobname, // the mob's job + "key" = mobkey, // the mob's key + "vmask" = voicemask, // 1 if the mob is using a voice gas mas + + "compression" = 0, // uncompressed radio signal + "message" = message, // the actual sent message + "radio" = src, // stores the radio used for transmission + "slow" = 0, + "traffic" = 0, + "type" = 0, + "server" = null, + "reject" = 0, + "level" = 0, + "language" = language, + "spans" = spans, + "verb_say" = M.verb_say, + "verb_ask" = M.verb_ask, + "verb_exclaim" = M.verb_exclaim, + "verb_yell" = M.verb_yell, + ) + signal.frequency = freqnum // Quick frequency set + Broadcast_Message(M, voicemask, + src, message, voice, jobname, real_name, + 5, signal.data["compression"], list(position.z, 0), freq, spans, + verb_say, verb_ask, verb_exclaim, verb_yell, language) + return + + /* ###### Radio headsets can only broadcast through subspace ###### */ + + if(subspace_transmission) + // First, we want to generate a new radio signal + var/datum/signal/signal = new + signal.transmission_method = 2 // 2 would be a subspace transmission. + // transmission_method could probably be enumerated through #define. Would be neater. + // --- Finally, tag the actual signal with the appropriate values --- + signal.data = list( + // Identity-associated tags: + "mob" = M, // store a reference to the mob + "mobtype" = M.type, // the mob's type + "realname" = real_name, // the mob's real name + "name" = voice, // the mob's voice name + "job" = jobname, // the mob's job + "key" = mobkey, // the mob's key + "vmask" = voicemask, // 1 if the mob is using a voice gas mask + + // We store things that would otherwise be kept in the actual mob + // so that they can be logged even AFTER the mob is deleted or something + + // Other tags: + "compression" = rand(35,65), // compressed radio signal + "message" = message, // the actual sent message + "radio" = src, // stores the radio used for transmission + "slow" = 0, // how much to sleep() before broadcasting - simulates net lag + "traffic" = 0, // dictates the total traffic sum that the signal went through + "type" = 0, // determines what type of radio input it is: normal broadcast + "server" = null, // the last server to log this signal + "reject" = 0, // if nonzero, the signal will not be accepted by any broadcasting machinery + "level" = position.z, // The source's z level + "language" = language, + "spans" = spans, //the span classes of this message. + "verb_say" = M.verb_say, //the verb used when talking normally + "verb_ask" = M.verb_ask, //the verb used when asking + "verb_exclaim" = M.verb_exclaim, //the verb used when exclaiming + "verb_yell" = M.verb_yell //the verb used when yelling + ) + signal.frequency = freq + + //#### Sending the signal to all subspace receivers ####// + + for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list) + R.receive_signal(signal) + + // Allinone can act as receivers. + for(var/obj/machinery/telecomms/allinone/R in GLOB.telecomms_list) + R.receive_signal(signal) + + // Receiving code can be located in Telecommunications.dm + return + + + /* ###### Intercoms and station-bounced radios ###### */ + + var/filter_type = 2 + + var/datum/signal/signal = new + signal.transmission_method = 2 + + + /* --- Try to send a normal subspace broadcast first */ + + signal.data = list( + "mob" = M, // store a reference to the mob + "mobtype" = M.type, // the mob's type + "realname" = real_name, // the mob's real name + "name" = voice, // the mob's voice name + "job" = jobname, // the mob's job + "key" = mobkey, // the mob's key + "vmask" = voicemask, // 1 if the mob is using a voice gas mas + + "compression" = 0, // uncompressed radio signal + "message" = message, // the actual sent message + "radio" = src, // stores the radio used for transmission + "slow" = 0, + "traffic" = 0, + "type" = 0, + "server" = null, + "reject" = 0, + "level" = position.z, + "language" = language, + "spans" = spans, + "verb_say" = M.verb_say, + "verb_ask" = M.verb_ask, + "verb_exclaim" = M.verb_exclaim, + "verb_yell" = M.verb_yell + ) + signal.frequency = freqnum // Quick frequency set + for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list) + R.receive_signal(signal) + + + spawn(20) // wait a little... + + if(signal.data["done"] && position.z in signal.data["level"]) + // we're done here. + return + + // Oh my god; the comms are down or something because the signal hasn't been broadcasted yet in our level. + // Send a mundane broadcast with limited targets: + Broadcast_Message(M, voicemask, + src, message, voice, jobname, real_name, + filter_type, signal.data["compression"], list(position.z), freq, spans, + verb_say, verb_ask, verb_exclaim, verb_yell, language) + +/obj/item/device/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode) + if(radio_freq) + return + if(broadcasting) + if(get_dist(src, speaker) <= canhear_range) + talk_into(speaker, raw_message, , spans, language=message_language) +/* +/obj/item/device/radio/proc/accept_rad(obj/item/device/radio/R as obj, message) + + if ((R.frequency == frequency && message)) + return 1 + else if + + else + return null + return +*/ + + +/obj/item/device/radio/proc/receive_range(freq, level) + // check if this radio can receive on the given frequency, and if so, + // what the range is in which mobs will hear the radio + // returns: -1 if can't receive, range otherwise + + if (wires.is_cut(WIRE_RX)) + return -1 + if(!listening) + return -1 + if(!(0 in level)) + var/turf/position = get_turf(src) + if(!position || !(position.z in level)) + return -1 + if(freq == GLOB.SYND_FREQ) + if(!(src.syndie)) //Checks to see if it's allowed on that frequency, based on the encryption keys + return -1 + if(freq == GLOB.CENTCOM_FREQ) + if(!independent) + return -1 + if (!on) + return -1 + if (!freq) //received on main frequency + if (!listening) + return -1 + else + var/accept = (freq==frequency && listening) + if (!accept) + for(var/ch_name in channels) + if(channels[ch_name] & FREQ_LISTENING) + if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie) //the GLOB.radiochannels list is located in communications.dm + accept = 1 + break + if (!accept) + return -1 + return canhear_range + +/obj/item/device/radio/proc/send_hear(freq, level) + + var/range = receive_range(freq, level) + if(range > -1) + return get_hearers_in_view(canhear_range, src) + + +/obj/item/device/radio/examine(mob/user) + ..() + if (b_stat) + to_chat(user, "[name] can be attached and modified.") + else + to_chat(user, "[name] can not be modified or attached.") + +/obj/item/device/radio/attackby(obj/item/weapon/W, mob/user, params) + add_fingerprint(user) + if(istype(W, /obj/item/weapon/screwdriver)) + b_stat = !b_stat + if(b_stat) + to_chat(user, "The radio can now be attached and modified!") + else + to_chat(user, "The radio can no longer be modified or attached!") + else + return ..() + +/obj/item/device/radio/emp_act(severity) + emped++ //There's been an EMP; better count it + var/curremp = emped //Remember which EMP this was + if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice + to_chat(loc, "\The [src] overloads.") + broadcasting = 0 + listening = 0 + for (var/ch_name in channels) + channels[ch_name] = 0 + on = 0 + spawn(200) + if(emped == curremp) //Don't fix it if it's been EMP'd again + emped = 0 + if (!istype(src, /obj/item/device/radio/intercom)) // intercoms will turn back on on their own + on = 1 + ..() + +/////////////////////////////// +//////////Borg Radios////////// +/////////////////////////////// +//Giving borgs their own radio to have some more room to work with -Sieve + +/obj/item/device/radio/borg + name = "cyborg radio" + subspace_switchable = 1 + dog_fashion = null + +/obj/item/device/radio/borg/Initialize(mapload) + ..() + SET_SECONDARY_FLAG(src, NO_EMP_WIRES) + +/obj/item/device/radio/borg/syndicate + syndie = 1 + keyslot = new /obj/item/device/encryptionkey/syndicate + +/obj/item/device/radio/borg/syndicate/New() + ..() + set_frequency(GLOB.SYND_FREQ) + +/obj/item/device/radio/borg/attackby(obj/item/weapon/W, mob/user, params) + + if(istype(W, /obj/item/weapon/screwdriver)) + if(keyslot) + for(var/ch_name in channels) + SSradio.remove_object(src, GLOB.radiochannels[ch_name]) + secure_radio_connections[ch_name] = null + + + if(keyslot) + var/turf/T = get_turf(user) + if(T) + keyslot.loc = T + keyslot = null + + recalculateChannels() + to_chat(user, "You pop out the encryption key in the radio.") + + else + to_chat(user, "This radio doesn't have any encryption keys!") + + else if(istype(W, /obj/item/device/encryptionkey/)) + if(keyslot) + to_chat(user, "The radio can't hold another key!") + return + + if(!keyslot) + if(!user.transferItemToLoc(W, src)) + return + keyslot = W + + recalculateChannels() + + +/obj/item/device/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag. + listening = 0 // And it's nice to have a subtype too for future features. + dog_fashion = /datum/dog_fashion/back diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index 4fbc7572d5..d88c1371a7 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -1,259 +1,259 @@ -/obj/item/weapon/melee/energy - var/active = 0 - var/force_on = 30 //force when active - var/throwforce_on = 20 - var/icon_state_on = "axe1" - var/list/attack_verb_on = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") - var/list/possible_colors - w_class = WEIGHT_CLASS_SMALL - sharpness = IS_SHARP - var/w_class_on = WEIGHT_CLASS_BULKY - heat = 3500 - obj_integrity = 200 - max_integrity = 200 - armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 30) - resistance_flags = FIRE_PROOF - var/brightness_on = 3 - -/obj/item/weapon/melee/energy/Initialize() - . = ..() - if(LAZYLEN(possible_colors)) - item_color = pick(possible_colors) - switch(item_color)//Only run this check if the color was picked randomly, so that colors can be manually set for non-random colored energy weapons. - if("red") - light_color = LIGHT_COLOR_RED - if("green") - light_color = LIGHT_COLOR_GREEN - if("blue") - light_color = LIGHT_COLOR_LIGHT_CYAN - if("purple") - light_color = LIGHT_COLOR_LAVENDER - if(active) - set_light(brightness_on) - -/obj/item/weapon/melee/energy/suicide_act(mob/user) - user.visible_message("[user] is [pick("slitting [user.p_their()] stomach open with", "falling on")] [src]! It looks like [user.p_theyre()] trying to commit seppuku!") - return (BRUTELOSS|FIRELOSS) - -/obj/item/weapon/melee/energy/add_blood(list/blood_dna) - return 0 - -/obj/item/weapon/melee/energy/is_sharp() - return active * sharpness - -/obj/item/weapon/melee/energy/axe - name = "energy axe" - desc = "An energized battle axe." - icon_state = "axe0" - force = 40 - force_on = 150 - throwforce = 25 - throwforce_on = 30 - hitsound = 'sound/weapons/bladeslice.ogg' - throw_speed = 3 - throw_range = 5 - w_class = WEIGHT_CLASS_NORMAL - w_class_on = WEIGHT_CLASS_HUGE - flags = CONDUCT - armour_penetration = 100 - origin_tech = "combat=4;magnets=3" - attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut") - attack_verb_on = list() - light_color = "#40ceff" - -/obj/item/weapon/melee/energy/axe/suicide_act(mob/user) - user.visible_message("[user] swings [src] towards [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!") - return (BRUTELOSS|FIRELOSS) - -/obj/item/weapon/melee/energy/sword - name = "energy sword" - desc = "May the force be within you." - icon_state = "sword0" - force = 3 - throwforce = 5 - hitsound = "swing_hit" //it starts deactivated - throw_speed = 3 - throw_range = 5 - sharpness = IS_SHARP - embed_chance = 75 - embedded_impact_pain_multiplier = 10 - armour_penetration = 35 - origin_tech = "combat=3;magnets=4;syndicate=4" - block_chance = 50 - possible_colors = list("red", "blue", "green", "purple") - var/hacked = 0 - -/obj/item/weapon/melee/energy/sword/Destroy() - STOP_PROCESSING(SSobj, src) - . = ..() - -/obj/item/weapon/melee/energy/sword/process() - if(active) - if(hacked) - light_color = pick(LIGHT_COLOR_RED, LIGHT_COLOR_GREEN, LIGHT_COLOR_LIGHT_CYAN, LIGHT_COLOR_LAVENDER) - open_flame() - else - STOP_PROCESSING(SSobj, src) - -/obj/item/weapon/melee/energy/sword/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) - if(active) - return ..() - return 0 - -/obj/item/weapon/melee/energy/attack_self(mob/living/carbon/user) - if(user.disabilities & CLUMSY && prob(50)) - to_chat(user, "You accidentally cut yourself with [src], like a doofus!") - user.take_bodypart_damage(5,5) - active = !active - if (active) - force = force_on - throwforce = throwforce_on - hitsound = 'sound/weapons/blade1.ogg' - throw_speed = 4 - if(attack_verb_on.len) - attack_verb = attack_verb_on - if(!item_color) - icon_state = icon_state_on - else - icon_state = "sword[item_color]" - w_class = w_class_on - playsound(user, 'sound/weapons/saberon.ogg', 35, 1) //changed it from 50% volume to 35% because deafness - to_chat(user, "[src] is now active.") - START_PROCESSING(SSobj, src) - set_light(brightness_on) - else - force = initial(force) - throwforce = initial(throwforce) - hitsound = initial(hitsound) - throw_speed = initial(throw_speed) - if(attack_verb_on.len) - attack_verb = list() - icon_state = initial(icon_state) - w_class = initial(w_class) - playsound(user, 'sound/weapons/saberoff.ogg', 35, 1) //changed it from 50% volume to 35% because deafness - to_chat(user, "[src] can now be concealed.") - STOP_PROCESSING(SSobj, src) - set_light(0) - add_fingerprint(user) - -/obj/item/weapon/melee/energy/is_hot() - return active * heat - -/obj/item/weapon/melee/energy/ignition_effect(atom/A, mob/user) - if(!active) - return "" - - var/in_mouth = "" - if(iscarbon(user)) - var/mob/living/carbon/C = user - if(C.wear_mask == src) - in_mouth = ", barely missing their nose" - . = "[user] swings their \ - [src][in_mouth]. They light [A] in the process." - playsound(loc, hitsound, get_clamped_volume(), 1, -1) - add_fingerprint(user) - -/obj/item/weapon/melee/energy/sword/cyborg - var/hitcost = 50 - -/obj/item/weapon/melee/energy/sword/cyborg/attack(mob/M, var/mob/living/silicon/robot/R) - if(R.cell) - var/obj/item/weapon/stock_parts/cell/C = R.cell - if(active && !(C.use(hitcost))) - attack_self(R) - to_chat(R, "It's out of charge!") - return - ..() - return - -/obj/item/weapon/melee/energy/sword/cyborg/saw //Used by medical Syndicate cyborgs - name = "energy saw" - desc = "For heavy duty cutting. It has a carbon-fiber blade in addition to a toggleable hard-light edge to dramatically increase sharpness." - icon_state = "esaw" - force_on = 30 - force = 18 //About as much as a spear - hitsound = 'sound/weapons/circsawhit.ogg' - icon = 'icons/obj/surgery.dmi' - icon_state = "esaw_0" - icon_state_on = "esaw_1" - hitcost = 75 //Costs more than a standard cyborg esword - item_color = null - w_class = WEIGHT_CLASS_NORMAL - sharpness = IS_SHARP - light_color = "#40ceff" - possible_colors = null - -/obj/item/weapon/melee/energy/sword/cyborg/saw/Initialize() - . = ..() - icon_state = "esaw_0" - item_color = null - -/obj/item/weapon/melee/energy/sword/cyborg/saw/hit_reaction() - return 0 - -/obj/item/weapon/melee/energy/sword/saber - -/obj/item/weapon/melee/energy/sword/saber/blue - possible_colors = list("blue") - -/obj/item/weapon/melee/energy/sword/saber/purple - possible_colors = list("purple") - -/obj/item/weapon/melee/energy/sword/saber/green - possible_colors = list("green") - -/obj/item/weapon/melee/energy/sword/saber/red - possible_colors = list("red") - - -/obj/item/weapon/melee/energy/sword/saber/attackby(obj/item/weapon/W, mob/living/user, params) - if(istype(W, /obj/item/device/multitool)) - if(!hacked) - hacked = TRUE - item_color = "rainbow" - to_chat(user, "RNBW_ENGAGE") - - if(active) - icon_state = "swordrainbow" - user.update_inv_hands() - else - to_chat(user, "It's already fabulous!") - else - return ..() - -/obj/item/weapon/melee/energy/sword/pirate - name = "energy cutlass" - desc = "Arrrr matey." - icon_state = "cutlass0" - icon_state_on = "cutlass1" - light_color = "#ff0000" - -/obj/item/weapon/melee/energy/blade - name = "energy blade" - desc = "A concentrated beam of energy in the shape of a blade. Very stylish... and lethal." - icon_state = "blade" - force = 30 //Normal attacks deal esword damage - hitsound = 'sound/weapons/blade1.ogg' - active = 1 - throwforce = 1//Throwing or dropping the item deletes it. - throw_speed = 3 - throw_range = 1 - w_class = WEIGHT_CLASS_BULKY//So you can't hide it in your pocket or some such. - var/datum/effect_system/spark_spread/spark_system - sharpness = IS_SHARP - -//Most of the other special functions are handled in their own files. aka special snowflake code so kewl -/obj/item/weapon/melee/energy/blade/Initialize() - . = ..() - spark_system = new /datum/effect_system/spark_spread() - spark_system.set_up(5, 0, src) - spark_system.attach(src) - -/obj/item/weapon/melee/energy/blade/attack_self(mob/user) - return - -/obj/item/weapon/melee/energy/blade/hardlight - name = "hardlight blade" - desc = "An extremely sharp blade made out of hard light. Packs quite a punch." - icon_state = "lightblade" - item_state = "lightblade" +/obj/item/weapon/melee/energy + var/active = 0 + var/force_on = 30 //force when active + var/throwforce_on = 20 + var/icon_state_on = "axe1" + var/list/attack_verb_on = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + var/list/possible_colors + w_class = WEIGHT_CLASS_SMALL + sharpness = IS_SHARP + var/w_class_on = WEIGHT_CLASS_BULKY + heat = 3500 + obj_integrity = 200 + max_integrity = 200 + armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 30) + resistance_flags = FIRE_PROOF + var/brightness_on = 3 + +/obj/item/weapon/melee/energy/Initialize() + . = ..() + if(LAZYLEN(possible_colors)) + item_color = pick(possible_colors) + switch(item_color)//Only run this check if the color was picked randomly, so that colors can be manually set for non-random colored energy weapons. + if("red") + light_color = LIGHT_COLOR_RED + if("green") + light_color = LIGHT_COLOR_GREEN + if("blue") + light_color = LIGHT_COLOR_LIGHT_CYAN + if("purple") + light_color = LIGHT_COLOR_LAVENDER + if(active) + set_light(brightness_on) + +/obj/item/weapon/melee/energy/suicide_act(mob/user) + user.visible_message("[user] is [pick("slitting [user.p_their()] stomach open with", "falling on")] [src]! It looks like [user.p_theyre()] trying to commit seppuku!") + return (BRUTELOSS|FIRELOSS) + +/obj/item/weapon/melee/energy/add_blood(list/blood_dna) + return 0 + +/obj/item/weapon/melee/energy/is_sharp() + return active * sharpness + +/obj/item/weapon/melee/energy/axe + name = "energy axe" + desc = "An energized battle axe." + icon_state = "axe0" + force = 40 + force_on = 150 + throwforce = 25 + throwforce_on = 30 + hitsound = 'sound/weapons/bladeslice.ogg' + throw_speed = 3 + throw_range = 5 + w_class = WEIGHT_CLASS_NORMAL + w_class_on = WEIGHT_CLASS_HUGE + flags = CONDUCT + armour_penetration = 100 + origin_tech = "combat=4;magnets=3" + attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut") + attack_verb_on = list() + light_color = "#40ceff" + +/obj/item/weapon/melee/energy/axe/suicide_act(mob/user) + user.visible_message("[user] swings [src] towards [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!") + return (BRUTELOSS|FIRELOSS) + +/obj/item/weapon/melee/energy/sword + name = "energy sword" + desc = "May the force be within you." + icon_state = "sword0" + force = 3 + throwforce = 5 + hitsound = "swing_hit" //it starts deactivated + throw_speed = 3 + throw_range = 5 + sharpness = IS_SHARP + embed_chance = 75 + embedded_impact_pain_multiplier = 10 + armour_penetration = 35 + origin_tech = "combat=3;magnets=4;syndicate=4" + block_chance = 50 + possible_colors = list("red", "blue", "green", "purple") + var/hacked = 0 + +/obj/item/weapon/melee/energy/sword/Destroy() + STOP_PROCESSING(SSobj, src) + . = ..() + +/obj/item/weapon/melee/energy/sword/process() + if(active) + if(hacked) + light_color = pick(LIGHT_COLOR_RED, LIGHT_COLOR_GREEN, LIGHT_COLOR_LIGHT_CYAN, LIGHT_COLOR_LAVENDER) + open_flame() + else + STOP_PROCESSING(SSobj, src) + +/obj/item/weapon/melee/energy/sword/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) + if(active) + return ..() + return 0 + +/obj/item/weapon/melee/energy/attack_self(mob/living/carbon/user) + if(user.disabilities & CLUMSY && prob(50)) + to_chat(user, "You accidentally cut yourself with [src], like a doofus!") + user.take_bodypart_damage(5,5) + active = !active + if (active) + force = force_on + throwforce = throwforce_on + hitsound = 'sound/weapons/blade1.ogg' + throw_speed = 4 + if(attack_verb_on.len) + attack_verb = attack_verb_on + if(!item_color) + icon_state = icon_state_on + else + icon_state = "sword[item_color]" + w_class = w_class_on + playsound(user, 'sound/weapons/saberon.ogg', 35, 1) //changed it from 50% volume to 35% because deafness + to_chat(user, "[src] is now active.") + START_PROCESSING(SSobj, src) + set_light(brightness_on) + else + force = initial(force) + throwforce = initial(throwforce) + hitsound = initial(hitsound) + throw_speed = initial(throw_speed) + if(attack_verb_on.len) + attack_verb = list() + icon_state = initial(icon_state) + w_class = initial(w_class) + playsound(user, 'sound/weapons/saberoff.ogg', 35, 1) //changed it from 50% volume to 35% because deafness + to_chat(user, "[src] can now be concealed.") + STOP_PROCESSING(SSobj, src) + set_light(0) + add_fingerprint(user) + +/obj/item/weapon/melee/energy/is_hot() + return active * heat + +/obj/item/weapon/melee/energy/ignition_effect(atom/A, mob/user) + if(!active) + return "" + + var/in_mouth = "" + if(iscarbon(user)) + var/mob/living/carbon/C = user + if(C.wear_mask == src) + in_mouth = ", barely missing their nose" + . = "[user] swings their \ + [src][in_mouth]. They light [A] in the process." + playsound(loc, hitsound, get_clamped_volume(), 1, -1) + add_fingerprint(user) + +/obj/item/weapon/melee/energy/sword/cyborg + var/hitcost = 50 + +/obj/item/weapon/melee/energy/sword/cyborg/attack(mob/M, var/mob/living/silicon/robot/R) + if(R.cell) + var/obj/item/weapon/stock_parts/cell/C = R.cell + if(active && !(C.use(hitcost))) + attack_self(R) + to_chat(R, "It's out of charge!") + return + ..() + return + +/obj/item/weapon/melee/energy/sword/cyborg/saw //Used by medical Syndicate cyborgs + name = "energy saw" + desc = "For heavy duty cutting. It has a carbon-fiber blade in addition to a toggleable hard-light edge to dramatically increase sharpness." + icon_state = "esaw" + force_on = 30 + force = 18 //About as much as a spear + hitsound = 'sound/weapons/circsawhit.ogg' + icon = 'icons/obj/surgery.dmi' + icon_state = "esaw_0" + icon_state_on = "esaw_1" + hitcost = 75 //Costs more than a standard cyborg esword + item_color = null + w_class = WEIGHT_CLASS_NORMAL + sharpness = IS_SHARP + light_color = "#40ceff" + possible_colors = null + +/obj/item/weapon/melee/energy/sword/cyborg/saw/Initialize() + . = ..() + icon_state = "esaw_0" + item_color = null + +/obj/item/weapon/melee/energy/sword/cyborg/saw/hit_reaction() + return 0 + +/obj/item/weapon/melee/energy/sword/saber + +/obj/item/weapon/melee/energy/sword/saber/blue + possible_colors = list("blue") + +/obj/item/weapon/melee/energy/sword/saber/purple + possible_colors = list("purple") + +/obj/item/weapon/melee/energy/sword/saber/green + possible_colors = list("green") + +/obj/item/weapon/melee/energy/sword/saber/red + possible_colors = list("red") + + +/obj/item/weapon/melee/energy/sword/saber/attackby(obj/item/weapon/W, mob/living/user, params) + if(istype(W, /obj/item/device/multitool)) + if(!hacked) + hacked = TRUE + item_color = "rainbow" + to_chat(user, "RNBW_ENGAGE") + + if(active) + icon_state = "swordrainbow" + user.update_inv_hands() + else + to_chat(user, "It's already fabulous!") + else + return ..() + +/obj/item/weapon/melee/energy/sword/pirate + name = "energy cutlass" + desc = "Arrrr matey." + icon_state = "cutlass0" + icon_state_on = "cutlass1" + light_color = "#ff0000" + +/obj/item/weapon/melee/energy/blade + name = "energy blade" + desc = "A concentrated beam of energy in the shape of a blade. Very stylish... and lethal." + icon_state = "blade" + force = 30 //Normal attacks deal esword damage + hitsound = 'sound/weapons/blade1.ogg' + active = 1 + throwforce = 1//Throwing or dropping the item deletes it. + throw_speed = 3 + throw_range = 1 + w_class = WEIGHT_CLASS_BULKY//So you can't hide it in your pocket or some such. + var/datum/effect_system/spark_spread/spark_system + sharpness = IS_SHARP + +//Most of the other special functions are handled in their own files. aka special snowflake code so kewl +/obj/item/weapon/melee/energy/blade/Initialize() + . = ..() + spark_system = new /datum/effect_system/spark_spread() + spark_system.set_up(5, 0, src) + spark_system.attach(src) + +/obj/item/weapon/melee/energy/blade/attack_self(mob/user) + return + +/obj/item/weapon/melee/energy/blade/hardlight + name = "hardlight blade" + desc = "An extremely sharp blade made out of hard light. Packs quite a punch." + icon_state = "lightblade" + item_state = "lightblade" diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index cbb0fcc5f7..41ef527e1e 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -47,7 +47,7 @@ queue_smooth_neighbors(src) /obj/structure/table/narsie_act() - new /obj/structure/table/wood(src.loc) + new /obj/structure/table/wood(src.loc) /obj/structure/table/ratvar_act() new /obj/structure/table/reinforced/brass(src.loc) diff --git a/code/modules/admin/DB_ban/functions.dm b/code/modules/admin/DB_ban/functions.dm index 0df3434c8e..b2dc6882cb 100644 --- a/code/modules/admin/DB_ban/functions.dm +++ b/code/modules/admin/DB_ban/functions.dm @@ -1,502 +1,502 @@ -#define MAX_ADMIN_BANS_PER_ADMIN 1 - -//Either pass the mob you wish to ban in the 'banned_mob' attribute, or the banckey, banip and bancid variables. If both are passed, the mob takes priority! If a mob is not passed, banckey is the minimum that needs to be passed! banip and bancid are optional. -/datum/admins/proc/DB_ban_record(bantype, mob/banned_mob, duration = -1, reason, job = "", banckey = null, banip = null, bancid = null) - - if(!check_rights(R_BAN)) - return - - if(!SSdbcore.Connect()) - to_chat(src, "Failed to establish database connection.") - return - - var/bantype_pass = 0 - var/bantype_str - var/maxadminbancheck //Used to limit the number of active bans of a certein type that each admin can give. Used to protect against abuse or mutiny. - var/announceinirc //When set, it announces the ban in irc. Intended to be a way to raise an alarm, so to speak. - var/blockselfban //Used to prevent the banning of yourself. - var/kickbannedckey //Defines whether this proc should kick the banned person, if they are connected (if banned_mob is defined). - //some ban types kick players after this proc passes (tempban, permaban), but some are specific to db_ban, so - //they should kick within this proc. - switch(bantype) - if(BANTYPE_PERMA) - bantype_str = "PERMABAN" - duration = -1 - bantype_pass = 1 - blockselfban = 1 - if(BANTYPE_TEMP) - bantype_str = "TEMPBAN" - bantype_pass = 1 - blockselfban = 1 - if(BANTYPE_JOB_PERMA) - bantype_str = "JOB_PERMABAN" - duration = -1 - bantype_pass = 1 - if(BANTYPE_JOB_TEMP) - bantype_str = "JOB_TEMPBAN" - bantype_pass = 1 - if(BANTYPE_ADMIN_PERMA) - bantype_str = "ADMIN_PERMABAN" - duration = -1 - bantype_pass = 1 - maxadminbancheck = 1 - announceinirc = 1 - blockselfban = 1 - kickbannedckey = 1 - if(BANTYPE_ADMIN_TEMP) - bantype_str = "ADMIN_TEMPBAN" - bantype_pass = 1 - maxadminbancheck = 1 - announceinirc = 1 - blockselfban = 1 - kickbannedckey = 1 - if( !bantype_pass ) return - if( !istext(reason) ) return - if( !isnum(duration) ) return - - var/ckey - var/computerid - var/ip - - if(ismob(banned_mob)) - ckey = banned_mob.ckey - if(banned_mob.client) - computerid = banned_mob.client.computer_id - ip = banned_mob.client.address - else - computerid = banned_mob.computer_id - ip = banned_mob.lastKnownIP - else if(banckey) - ckey = ckey(banckey) - computerid = bancid - ip = banip - - var/datum/DBQuery/query_add_ban_get_ckey = SSdbcore.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ckey = '[ckey]'") - if(!query_add_ban_get_ckey.warn_execute()) - return - if(!query_add_ban_get_ckey.NextRow()) - if(!banned_mob || (banned_mob && !IsGuestKey(banned_mob.key))) - if(alert(usr, "[ckey] has not been seen before, are you sure you want to create a ban for them?", "Unknown ckey", "Yes", "No", "Cancel") != "Yes") - return - - var/a_ckey - var/a_computerid - var/a_ip - - if(src.owner && istype(src.owner, /client)) - a_ckey = src.owner:ckey - a_computerid = src.owner:computer_id - a_ip = src.owner:address - - if(blockselfban) - if(a_ckey == ckey) - to_chat(usr, "You cannot apply this ban type on yourself.") - return - - var/who - for(var/client/C in GLOB.clients) - if(!who) - who = "[C]" - else - who += ", [C]" - - var/adminwho - for(var/client/C in GLOB.admins) - if(!adminwho) - adminwho = "[C]" - else - adminwho += ", [C]" - - reason = sanitizeSQL(reason) - - if(maxadminbancheck) - var/datum/DBQuery/query_check_adminban_amt = SSdbcore.NewQuery("SELECT count(id) AS num FROM [format_table_name("ban")] WHERE (a_ckey = '[a_ckey]') AND (bantype = 'ADMIN_PERMABAN' OR (bantype = 'ADMIN_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)") - if(!query_check_adminban_amt.warn_execute()) - return - if(query_check_adminban_amt.NextRow()) - var/adm_bans = text2num(query_check_adminban_amt.item[1]) - if(adm_bans >= MAX_ADMIN_BANS_PER_ADMIN) - to_chat(usr, "You already logged [MAX_ADMIN_BANS_PER_ADMIN] admin ban(s) or more. Do not abuse this function!") - return - if(!computerid) - computerid = "0" - if(!ip) - ip = "0.0.0.0" - var/sql = "INSERT INTO [format_table_name("ban")] (`bantime`,`server_ip`,`server_port`,`bantype`,`reason`,`job`,`duration`,`expiration_time`,`ckey`,`computerid`,`ip`,`a_ckey`,`a_computerid`,`a_ip`,`who`,`adminwho`) VALUES (Now(), INET_ATON('[world.internet_address]'), '[world.port]', '[bantype_str]', '[reason]', '[job]', [(duration)?"[duration]":"0"], Now() + INTERVAL [(duration>0) ? duration : 0] MINUTE, '[ckey]', '[computerid]', INET_ATON('[ip]'), '[a_ckey]', '[a_computerid]', INET_ATON('[a_ip]'), '[who]', '[adminwho]')" - var/datum/DBQuery/query_add_ban = SSdbcore.NewQuery(sql) - if(!query_add_ban.warn_execute()) - return - to_chat(usr, "Ban saved to database.") - var/msg = "[key_name_admin(usr)] has added a [bantype_str] for [ckey] [(job)?"([job])":""] [(duration > 0)?"([duration] minutes)":""] with the reason: \"[reason]\" to the ban database." - message_admins(msg,1) - var/datum/admin_help/AH = admin_ticket_log(ckey, msg) - - if(announceinirc) - send2irc("BAN ALERT","[a_ckey] applied a [bantype_str] on [ckey]") - - if(kickbannedckey) - if(AH) - AH.Resolve() //with prejudice - if(banned_mob && banned_mob.client && banned_mob.client.ckey == banckey) - qdel(banned_mob.client) - return 1 - -/datum/admins/proc/DB_ban_unban(ckey, bantype, job = "") - - if(!check_rights(R_BAN)) - return - - var/bantype_str - if(bantype) - var/bantype_pass = 0 - switch(bantype) - if(BANTYPE_PERMA) - bantype_str = "PERMABAN" - bantype_pass = 1 - if(BANTYPE_TEMP) - bantype_str = "TEMPBAN" - bantype_pass = 1 - if(BANTYPE_JOB_PERMA) - bantype_str = "JOB_PERMABAN" - bantype_pass = 1 - if(BANTYPE_JOB_TEMP) - bantype_str = "JOB_TEMPBAN" - bantype_pass = 1 - if(BANTYPE_ADMIN_PERMA) - bantype_str = "ADMIN_PERMABAN" - bantype_pass = 1 - if(BANTYPE_ADMIN_TEMP) - bantype_str = "ADMIN_TEMPBAN" - bantype_pass = 1 - if(BANTYPE_ANY_FULLBAN) - bantype_str = "ANY" - bantype_pass = 1 - if(BANTYPE_ANY_JOB) - bantype_str = "ANYJOB" - bantype_pass = 1 - if( !bantype_pass ) return - - var/bantype_sql - if(bantype_str == "ANY") - bantype_sql = "(bantype = 'PERMABAN' OR (bantype = 'TEMPBAN' AND expiration_time > Now() ) )" - else if(bantype_str == "ANYJOB") - bantype_sql = "(bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now() ) )" - else - bantype_sql = "bantype = '[bantype_str]'" - - var/sql = "SELECT id FROM [format_table_name("ban")] WHERE ckey = '[ckey]' AND [bantype_sql] AND (unbanned is null OR unbanned = false)" - if(job) - sql += " AND job = '[job]'" - - if(!SSdbcore.Connect()) - return - - var/ban_id - var/ban_number = 0 //failsafe - - var/datum/DBQuery/query_unban_get_id = SSdbcore.NewQuery(sql) - if(!query_unban_get_id.warn_execute()) - return - while(query_unban_get_id.NextRow()) - ban_id = query_unban_get_id.item[1] - ban_number++; - - if(ban_number == 0) - to_chat(usr, "Database update failed due to no bans fitting the search criteria. If this is not a legacy ban you should contact the database admin.") - return - - if(ban_number > 1) - to_chat(usr, "Database update failed due to multiple bans fitting the search criteria. Note down the ckey, job and current time and contact the database admin.") - return - - if(istext(ban_id)) - ban_id = text2num(ban_id) - if(!isnum(ban_id)) - to_chat(usr, "Database update failed due to a ban ID mismatch. Contact the database admin.") - return - - DB_ban_unban_by_id(ban_id) - -/datum/admins/proc/DB_ban_edit(banid = null, param = null) - - if(!check_rights(R_BAN)) - return - - if(!isnum(banid) || !istext(param)) - to_chat(usr, "Cancelled") - return - - var/datum/DBQuery/query_edit_ban_get_details = SSdbcore.NewQuery("SELECT ckey, duration, reason FROM [format_table_name("ban")] WHERE id = [banid]") - if(!query_edit_ban_get_details.warn_execute()) - return - - var/eckey = usr.ckey //Editing admin ckey - var/pckey //(banned) Player ckey - var/duration //Old duration - var/reason //Old reason - - if(query_edit_ban_get_details.NextRow()) - pckey = query_edit_ban_get_details.item[1] - duration = query_edit_ban_get_details.item[2] - reason = query_edit_ban_get_details.item[3] - else - to_chat(usr, "Invalid ban id. Contact the database admin") - return - - reason = sanitizeSQL(reason) - var/value - - switch(param) - if("reason") - if(!value) - value = input("Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", null) as null|text - value = sanitizeSQL(value) - if(!value) - to_chat(usr, "Cancelled") - return - - var/datum/DBQuery/query_edit_ban_reason = SSdbcore.NewQuery("UPDATE [format_table_name("ban")] SET reason = '[value]', edits = CONCAT(edits,'- [eckey] changed ban reason from \\\"[reason]\\\" to \\\"[value]\\\"
') WHERE id = [banid]") - if(!query_edit_ban_reason.warn_execute()) - return - message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s reason from [reason] to [value]",1) - if("duration") - if(!value) - value = input("Insert the new duration (in minutes) for [pckey]'s ban", "New Duration", "[duration]", null) as null|num - if(!isnum(value) || !value) - to_chat(usr, "Cancelled") - return - - var/datum/DBQuery/query_edit_ban_duration = SSdbcore.NewQuery("UPDATE [format_table_name("ban")] SET duration = [value], edits = CONCAT(edits,'- [eckey] changed ban duration from [duration] to [value]
'), expiration_time = DATE_ADD(bantime, INTERVAL [value] MINUTE) WHERE id = [banid]") - if(!query_edit_ban_duration.warn_execute()) - return - message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s duration from [duration] to [value]",1) - if("unban") - if(alert("Unban [pckey]?", "Unban?", "Yes", "No") == "Yes") - DB_ban_unban_by_id(banid) - return - else - to_chat(usr, "Cancelled") - return - else - to_chat(usr, "Cancelled") - return - -/datum/admins/proc/DB_ban_unban_by_id(id) - - if(!check_rights(R_BAN)) - return - - var/sql = "SELECT ckey FROM [format_table_name("ban")] WHERE id = [id]" - - if(!SSdbcore.Connect()) - return - - var/ban_number = 0 //failsafe - - var/pckey - var/datum/DBQuery/query_unban_get_ckey = SSdbcore.NewQuery(sql) - if(!query_unban_get_ckey.warn_execute()) - return - while(query_unban_get_ckey.NextRow()) - pckey = query_unban_get_ckey.item[1] - ban_number++; - - if(ban_number == 0) - to_chat(usr, "Database update failed due to a ban id not being present in the database.") - return - - if(ban_number > 1) - to_chat(usr, "Database update failed due to multiple bans having the same ID. Contact the database admin.") - return - - if(!src.owner || !istype(src.owner, /client)) - return - - var/unban_ckey = src.owner:ckey - var/unban_computerid = src.owner:computer_id - var/unban_ip = src.owner:address - - var/sql_update = "UPDATE [format_table_name("ban")] SET unbanned = 1, unbanned_datetime = Now(), unbanned_ckey = '[unban_ckey]', unbanned_computerid = '[unban_computerid]', unbanned_ip = INET_ATON('[unban_ip]') WHERE id = [id]" - var/datum/DBQuery/query_unban = SSdbcore.NewQuery(sql_update) - if(!query_unban.warn_execute()) - return - message_admins("[key_name_admin(usr)] has lifted [pckey]'s ban.",1) - -/client/proc/DB_ban_panel() - set category = "Admin" - set name = "Banning Panel" - set desc = "Edit admin permissions" - - if(!holder) - return - - holder.DB_ban_panel() - - -/datum/admins/proc/DB_ban_panel(playerckey = null, adminckey = null, page = 0) - if(!usr.client) - return - - if(!check_rights(R_BAN)) - return - - if(!SSdbcore.Connect()) - to_chat(usr, "Failed to establish database connection.") - return - - var/output = "
" - - output += "" - - output += "" - output += "" - output += "
" - output += "

Banning panel

" - output += "
" - - output += "
Add custom ban: (ONLY use this if you can't ban through any other method)" - output += "" - output += "" - output += "" - output += "" - output += "" - output += "" - output += "" - output += "
Ban type:Ckey:
IP: Computer id:
Duration: Job:
" - output += "Reason:

" - output += "" - output += "
" - - output += "
" - - output += "
Search: " - output += "" - output += "Ckey: " - output += "Admin ckey: " - output += "" - output += "
" - output += "Please note that all jobban bans or unbans are in-effect the following round." - - if(adminckey || playerckey) - playerckey = sanitizeSQL(ckey(playerckey)) - adminckey = sanitizeSQL(ckey(adminckey)) - var/playersearch = "" - var/adminsearch = "" - if(playerckey) - playersearch = "AND ckey = '[playerckey]' " - if(adminckey) - adminsearch = "AND a_ckey = '[adminckey]' " - var/bancount = 0 - var/bansperpage = 15 - var/pagecount = 0 - page = text2num(page) - var/datum/DBQuery/query_count_bans = SSdbcore.NewQuery("SELECT COUNT(id) FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch]") - if(!query_count_bans.warn_execute()) - return - if(query_count_bans.NextRow()) - bancount = text2num(query_count_bans.item[1]) - if(bancount > bansperpage) - output += "
Page: " - while(bancount > 0) - output+= "|[pagecount == page ? "\[[pagecount]\]" : "\[[pagecount]\]"]" - bancount -= bansperpage - pagecount++ - output += "|" - var/blcolor = "#ffeeee" //banned light - var/bdcolor = "#ffdddd" //banned dark - var/ulcolor = "#eeffee" //unbanned light - var/udcolor = "#ddffdd" //unbanned dark - - output += "" - output += "" - output += "" - output += "" - output += "" - output += "" - output += "" - output += "" - var/limit = " LIMIT [bansperpage * page], [bansperpage]" - var/datum/DBQuery/query_search_bans = SSdbcore.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch] ORDER BY bantime DESC[limit]") - if(!query_search_bans.warn_execute()) - return - - while(query_search_bans.NextRow()) - var/banid = query_search_bans.item[1] - var/bantime = query_search_bans.item[2] - var/bantype = query_search_bans.item[3] - var/reason = query_search_bans.item[4] - var/job = query_search_bans.item[5] - var/duration = query_search_bans.item[6] - var/expiration = query_search_bans.item[7] - var/ckey = query_search_bans.item[8] - var/ackey = query_search_bans.item[9] - var/unbanned = query_search_bans.item[10] - var/unbanckey = query_search_bans.item[11] - var/unbantime = query_search_bans.item[12] - var/edits = query_search_bans.item[13] - - var/lcolor = blcolor - var/dcolor = bdcolor - if(unbanned) - lcolor = ulcolor - dcolor = udcolor - - var/typedesc ="" - switch(bantype) - if("PERMABAN") - typedesc = "PERMABAN" - if("TEMPBAN") - typedesc = "TEMPBAN
([duration] minutes [(unbanned) ? "" : "(Edit))"]
Expires [expiration]
" - if("JOB_PERMABAN") - typedesc = "JOBBAN
([job])" - if("JOB_TEMPBAN") - typedesc = "TEMP JOBBAN
([job])
([duration] minutes [(unbanned) ? "" : "(Edit))"]
Expires [expiration]" - if("ADMIN_PERMABAN") - typedesc = "ADMIN PERMABAN" - if("ADMIN_TEMPBAN") - typedesc = "ADMIN TEMPBAN
([duration] minutes [(unbanned) ? "" : "(Edit))"]
Expires [expiration]
" - - output += "
" - output += "" - output += "" - output += "" - output += "" - output += "" - output += "" - output += "" - output += "" - output += "" - if(edits) - output += "" - output += "" - output += "" - output += "" - output += "" - output += "" - if(unbanned) - output += "" - output += "" - output += "" - output += "" - output += "" - output += "" - - output += "
TYPECKEYTIME APPLIEDADMINOPTIONS
[typedesc][ckey][bantime][ackey][(unbanned) ? "" : "Unban"]
Reason: [(unbanned) ? "" : "(Edit)"] \"[reason]\"
EDITS
[edits]
UNBANNED by admin [unbanckey] on [unbantime]
 
" - +#define MAX_ADMIN_BANS_PER_ADMIN 1 + +//Either pass the mob you wish to ban in the 'banned_mob' attribute, or the banckey, banip and bancid variables. If both are passed, the mob takes priority! If a mob is not passed, banckey is the minimum that needs to be passed! banip and bancid are optional. +/datum/admins/proc/DB_ban_record(bantype, mob/banned_mob, duration = -1, reason, job = "", banckey = null, banip = null, bancid = null) + + if(!check_rights(R_BAN)) + return + + if(!SSdbcore.Connect()) + to_chat(src, "Failed to establish database connection.") + return + + var/bantype_pass = 0 + var/bantype_str + var/maxadminbancheck //Used to limit the number of active bans of a certein type that each admin can give. Used to protect against abuse or mutiny. + var/announceinirc //When set, it announces the ban in irc. Intended to be a way to raise an alarm, so to speak. + var/blockselfban //Used to prevent the banning of yourself. + var/kickbannedckey //Defines whether this proc should kick the banned person, if they are connected (if banned_mob is defined). + //some ban types kick players after this proc passes (tempban, permaban), but some are specific to db_ban, so + //they should kick within this proc. + switch(bantype) + if(BANTYPE_PERMA) + bantype_str = "PERMABAN" + duration = -1 + bantype_pass = 1 + blockselfban = 1 + if(BANTYPE_TEMP) + bantype_str = "TEMPBAN" + bantype_pass = 1 + blockselfban = 1 + if(BANTYPE_JOB_PERMA) + bantype_str = "JOB_PERMABAN" + duration = -1 + bantype_pass = 1 + if(BANTYPE_JOB_TEMP) + bantype_str = "JOB_TEMPBAN" + bantype_pass = 1 + if(BANTYPE_ADMIN_PERMA) + bantype_str = "ADMIN_PERMABAN" + duration = -1 + bantype_pass = 1 + maxadminbancheck = 1 + announceinirc = 1 + blockselfban = 1 + kickbannedckey = 1 + if(BANTYPE_ADMIN_TEMP) + bantype_str = "ADMIN_TEMPBAN" + bantype_pass = 1 + maxadminbancheck = 1 + announceinirc = 1 + blockselfban = 1 + kickbannedckey = 1 + if( !bantype_pass ) return + if( !istext(reason) ) return + if( !isnum(duration) ) return + + var/ckey + var/computerid + var/ip + + if(ismob(banned_mob)) + ckey = banned_mob.ckey + if(banned_mob.client) + computerid = banned_mob.client.computer_id + ip = banned_mob.client.address + else + computerid = banned_mob.computer_id + ip = banned_mob.lastKnownIP + else if(banckey) + ckey = ckey(banckey) + computerid = bancid + ip = banip + + var/datum/DBQuery/query_add_ban_get_ckey = SSdbcore.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ckey = '[ckey]'") + if(!query_add_ban_get_ckey.warn_execute()) + return + if(!query_add_ban_get_ckey.NextRow()) + if(!banned_mob || (banned_mob && !IsGuestKey(banned_mob.key))) + if(alert(usr, "[ckey] has not been seen before, are you sure you want to create a ban for them?", "Unknown ckey", "Yes", "No", "Cancel") != "Yes") + return + + var/a_ckey + var/a_computerid + var/a_ip + + if(src.owner && istype(src.owner, /client)) + a_ckey = src.owner:ckey + a_computerid = src.owner:computer_id + a_ip = src.owner:address + + if(blockselfban) + if(a_ckey == ckey) + to_chat(usr, "You cannot apply this ban type on yourself.") + return + + var/who + for(var/client/C in GLOB.clients) + if(!who) + who = "[C]" + else + who += ", [C]" + + var/adminwho + for(var/client/C in GLOB.admins) + if(!adminwho) + adminwho = "[C]" + else + adminwho += ", [C]" + + reason = sanitizeSQL(reason) + + if(maxadminbancheck) + var/datum/DBQuery/query_check_adminban_amt = SSdbcore.NewQuery("SELECT count(id) AS num FROM [format_table_name("ban")] WHERE (a_ckey = '[a_ckey]') AND (bantype = 'ADMIN_PERMABAN' OR (bantype = 'ADMIN_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)") + if(!query_check_adminban_amt.warn_execute()) + return + if(query_check_adminban_amt.NextRow()) + var/adm_bans = text2num(query_check_adminban_amt.item[1]) + if(adm_bans >= MAX_ADMIN_BANS_PER_ADMIN) + to_chat(usr, "You already logged [MAX_ADMIN_BANS_PER_ADMIN] admin ban(s) or more. Do not abuse this function!") + return + if(!computerid) + computerid = "0" + if(!ip) + ip = "0.0.0.0" + var/sql = "INSERT INTO [format_table_name("ban")] (`bantime`,`server_ip`,`server_port`,`bantype`,`reason`,`job`,`duration`,`expiration_time`,`ckey`,`computerid`,`ip`,`a_ckey`,`a_computerid`,`a_ip`,`who`,`adminwho`) VALUES (Now(), INET_ATON('[world.internet_address]'), '[world.port]', '[bantype_str]', '[reason]', '[job]', [(duration)?"[duration]":"0"], Now() + INTERVAL [(duration>0) ? duration : 0] MINUTE, '[ckey]', '[computerid]', INET_ATON('[ip]'), '[a_ckey]', '[a_computerid]', INET_ATON('[a_ip]'), '[who]', '[adminwho]')" + var/datum/DBQuery/query_add_ban = SSdbcore.NewQuery(sql) + if(!query_add_ban.warn_execute()) + return + to_chat(usr, "Ban saved to database.") + var/msg = "[key_name_admin(usr)] has added a [bantype_str] for [ckey] [(job)?"([job])":""] [(duration > 0)?"([duration] minutes)":""] with the reason: \"[reason]\" to the ban database." + message_admins(msg,1) + var/datum/admin_help/AH = admin_ticket_log(ckey, msg) + + if(announceinirc) + send2irc("BAN ALERT","[a_ckey] applied a [bantype_str] on [ckey]") + + if(kickbannedckey) + if(AH) + AH.Resolve() //with prejudice + if(banned_mob && banned_mob.client && banned_mob.client.ckey == banckey) + qdel(banned_mob.client) + return 1 + +/datum/admins/proc/DB_ban_unban(ckey, bantype, job = "") + + if(!check_rights(R_BAN)) + return + + var/bantype_str + if(bantype) + var/bantype_pass = 0 + switch(bantype) + if(BANTYPE_PERMA) + bantype_str = "PERMABAN" + bantype_pass = 1 + if(BANTYPE_TEMP) + bantype_str = "TEMPBAN" + bantype_pass = 1 + if(BANTYPE_JOB_PERMA) + bantype_str = "JOB_PERMABAN" + bantype_pass = 1 + if(BANTYPE_JOB_TEMP) + bantype_str = "JOB_TEMPBAN" + bantype_pass = 1 + if(BANTYPE_ADMIN_PERMA) + bantype_str = "ADMIN_PERMABAN" + bantype_pass = 1 + if(BANTYPE_ADMIN_TEMP) + bantype_str = "ADMIN_TEMPBAN" + bantype_pass = 1 + if(BANTYPE_ANY_FULLBAN) + bantype_str = "ANY" + bantype_pass = 1 + if(BANTYPE_ANY_JOB) + bantype_str = "ANYJOB" + bantype_pass = 1 + if( !bantype_pass ) return + + var/bantype_sql + if(bantype_str == "ANY") + bantype_sql = "(bantype = 'PERMABAN' OR (bantype = 'TEMPBAN' AND expiration_time > Now() ) )" + else if(bantype_str == "ANYJOB") + bantype_sql = "(bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now() ) )" + else + bantype_sql = "bantype = '[bantype_str]'" + + var/sql = "SELECT id FROM [format_table_name("ban")] WHERE ckey = '[ckey]' AND [bantype_sql] AND (unbanned is null OR unbanned = false)" + if(job) + sql += " AND job = '[job]'" + + if(!SSdbcore.Connect()) + return + + var/ban_id + var/ban_number = 0 //failsafe + + var/datum/DBQuery/query_unban_get_id = SSdbcore.NewQuery(sql) + if(!query_unban_get_id.warn_execute()) + return + while(query_unban_get_id.NextRow()) + ban_id = query_unban_get_id.item[1] + ban_number++; + + if(ban_number == 0) + to_chat(usr, "Database update failed due to no bans fitting the search criteria. If this is not a legacy ban you should contact the database admin.") + return + + if(ban_number > 1) + to_chat(usr, "Database update failed due to multiple bans fitting the search criteria. Note down the ckey, job and current time and contact the database admin.") + return + + if(istext(ban_id)) + ban_id = text2num(ban_id) + if(!isnum(ban_id)) + to_chat(usr, "Database update failed due to a ban ID mismatch. Contact the database admin.") + return + + DB_ban_unban_by_id(ban_id) + +/datum/admins/proc/DB_ban_edit(banid = null, param = null) + + if(!check_rights(R_BAN)) + return + + if(!isnum(banid) || !istext(param)) + to_chat(usr, "Cancelled") + return + + var/datum/DBQuery/query_edit_ban_get_details = SSdbcore.NewQuery("SELECT ckey, duration, reason FROM [format_table_name("ban")] WHERE id = [banid]") + if(!query_edit_ban_get_details.warn_execute()) + return + + var/eckey = usr.ckey //Editing admin ckey + var/pckey //(banned) Player ckey + var/duration //Old duration + var/reason //Old reason + + if(query_edit_ban_get_details.NextRow()) + pckey = query_edit_ban_get_details.item[1] + duration = query_edit_ban_get_details.item[2] + reason = query_edit_ban_get_details.item[3] + else + to_chat(usr, "Invalid ban id. Contact the database admin") + return + + reason = sanitizeSQL(reason) + var/value + + switch(param) + if("reason") + if(!value) + value = input("Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", null) as null|text + value = sanitizeSQL(value) + if(!value) + to_chat(usr, "Cancelled") + return + + var/datum/DBQuery/query_edit_ban_reason = SSdbcore.NewQuery("UPDATE [format_table_name("ban")] SET reason = '[value]', edits = CONCAT(edits,'- [eckey] changed ban reason from \\\"[reason]\\\" to \\\"[value]\\\"
') WHERE id = [banid]") + if(!query_edit_ban_reason.warn_execute()) + return + message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s reason from [reason] to [value]",1) + if("duration") + if(!value) + value = input("Insert the new duration (in minutes) for [pckey]'s ban", "New Duration", "[duration]", null) as null|num + if(!isnum(value) || !value) + to_chat(usr, "Cancelled") + return + + var/datum/DBQuery/query_edit_ban_duration = SSdbcore.NewQuery("UPDATE [format_table_name("ban")] SET duration = [value], edits = CONCAT(edits,'- [eckey] changed ban duration from [duration] to [value]
'), expiration_time = DATE_ADD(bantime, INTERVAL [value] MINUTE) WHERE id = [banid]") + if(!query_edit_ban_duration.warn_execute()) + return + message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s duration from [duration] to [value]",1) + if("unban") + if(alert("Unban [pckey]?", "Unban?", "Yes", "No") == "Yes") + DB_ban_unban_by_id(banid) + return + else + to_chat(usr, "Cancelled") + return + else + to_chat(usr, "Cancelled") + return + +/datum/admins/proc/DB_ban_unban_by_id(id) + + if(!check_rights(R_BAN)) + return + + var/sql = "SELECT ckey FROM [format_table_name("ban")] WHERE id = [id]" + + if(!SSdbcore.Connect()) + return + + var/ban_number = 0 //failsafe + + var/pckey + var/datum/DBQuery/query_unban_get_ckey = SSdbcore.NewQuery(sql) + if(!query_unban_get_ckey.warn_execute()) + return + while(query_unban_get_ckey.NextRow()) + pckey = query_unban_get_ckey.item[1] + ban_number++; + + if(ban_number == 0) + to_chat(usr, "Database update failed due to a ban id not being present in the database.") + return + + if(ban_number > 1) + to_chat(usr, "Database update failed due to multiple bans having the same ID. Contact the database admin.") + return + + if(!src.owner || !istype(src.owner, /client)) + return + + var/unban_ckey = src.owner:ckey + var/unban_computerid = src.owner:computer_id + var/unban_ip = src.owner:address + + var/sql_update = "UPDATE [format_table_name("ban")] SET unbanned = 1, unbanned_datetime = Now(), unbanned_ckey = '[unban_ckey]', unbanned_computerid = '[unban_computerid]', unbanned_ip = INET_ATON('[unban_ip]') WHERE id = [id]" + var/datum/DBQuery/query_unban = SSdbcore.NewQuery(sql_update) + if(!query_unban.warn_execute()) + return + message_admins("[key_name_admin(usr)] has lifted [pckey]'s ban.",1) + +/client/proc/DB_ban_panel() + set category = "Admin" + set name = "Banning Panel" + set desc = "Edit admin permissions" + + if(!holder) + return + + holder.DB_ban_panel() + + +/datum/admins/proc/DB_ban_panel(playerckey = null, adminckey = null, page = 0) + if(!usr.client) + return + + if(!check_rights(R_BAN)) + return + + if(!SSdbcore.Connect()) + to_chat(usr, "Failed to establish database connection.") + return + + var/output = "
" + + output += "" + + output += "" + output += "" + output += "
" + output += "

Banning panel

" + output += "
" + + output += "
Add custom ban: (ONLY use this if you can't ban through any other method)" + output += "" + output += "" + output += "" + output += "" + output += "" + output += "" + output += "" + output += "
Ban type:Ckey:
IP: Computer id:
Duration: Job:
" + output += "Reason:

" + output += "" + output += "
" + + output += "
" + + output += "
Search: " + output += "" + output += "Ckey: " + output += "Admin ckey: " + output += "" + output += "
" + output += "Please note that all jobban bans or unbans are in-effect the following round." + + if(adminckey || playerckey) + playerckey = sanitizeSQL(ckey(playerckey)) + adminckey = sanitizeSQL(ckey(adminckey)) + var/playersearch = "" + var/adminsearch = "" + if(playerckey) + playersearch = "AND ckey = '[playerckey]' " + if(adminckey) + adminsearch = "AND a_ckey = '[adminckey]' " + var/bancount = 0 + var/bansperpage = 15 + var/pagecount = 0 + page = text2num(page) + var/datum/DBQuery/query_count_bans = SSdbcore.NewQuery("SELECT COUNT(id) FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch]") + if(!query_count_bans.warn_execute()) + return + if(query_count_bans.NextRow()) + bancount = text2num(query_count_bans.item[1]) + if(bancount > bansperpage) + output += "
Page: " + while(bancount > 0) + output+= "|[pagecount == page ? "\[[pagecount]\]" : "\[[pagecount]\]"]" + bancount -= bansperpage + pagecount++ + output += "|" + var/blcolor = "#ffeeee" //banned light + var/bdcolor = "#ffdddd" //banned dark + var/ulcolor = "#eeffee" //unbanned light + var/udcolor = "#ddffdd" //unbanned dark + + output += "" + output += "" + output += "" + output += "" + output += "" + output += "" + output += "" + output += "" + var/limit = " LIMIT [bansperpage * page], [bansperpage]" + var/datum/DBQuery/query_search_bans = SSdbcore.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch] ORDER BY bantime DESC[limit]") + if(!query_search_bans.warn_execute()) + return + + while(query_search_bans.NextRow()) + var/banid = query_search_bans.item[1] + var/bantime = query_search_bans.item[2] + var/bantype = query_search_bans.item[3] + var/reason = query_search_bans.item[4] + var/job = query_search_bans.item[5] + var/duration = query_search_bans.item[6] + var/expiration = query_search_bans.item[7] + var/ckey = query_search_bans.item[8] + var/ackey = query_search_bans.item[9] + var/unbanned = query_search_bans.item[10] + var/unbanckey = query_search_bans.item[11] + var/unbantime = query_search_bans.item[12] + var/edits = query_search_bans.item[13] + + var/lcolor = blcolor + var/dcolor = bdcolor + if(unbanned) + lcolor = ulcolor + dcolor = udcolor + + var/typedesc ="" + switch(bantype) + if("PERMABAN") + typedesc = "PERMABAN" + if("TEMPBAN") + typedesc = "TEMPBAN
([duration] minutes [(unbanned) ? "" : "(Edit))"]
Expires [expiration]
" + if("JOB_PERMABAN") + typedesc = "JOBBAN
([job])" + if("JOB_TEMPBAN") + typedesc = "TEMP JOBBAN
([job])
([duration] minutes [(unbanned) ? "" : "(Edit))"]
Expires [expiration]" + if("ADMIN_PERMABAN") + typedesc = "ADMIN PERMABAN" + if("ADMIN_TEMPBAN") + typedesc = "ADMIN TEMPBAN
([duration] minutes [(unbanned) ? "" : "(Edit))"]
Expires [expiration]
" + + output += "
" + output += "" + output += "" + output += "" + output += "" + output += "" + output += "" + output += "" + output += "" + output += "" + if(edits) + output += "" + output += "" + output += "" + output += "" + output += "" + output += "" + if(unbanned) + output += "" + output += "" + output += "" + output += "" + output += "" + output += "" + + output += "
TYPECKEYTIME APPLIEDADMINOPTIONS
[typedesc][ckey][bantime][ackey][(unbanned) ? "" : "Unban"]
Reason: [(unbanned) ? "" : "(Edit)"] \"[reason]\"
EDITS
[edits]
UNBANNED by admin [unbanckey] on [unbantime]
 
" + usr << browse(output,"window=lookupbans;size=900x500") \ No newline at end of file diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index 02c223e507..cdd05a3aad 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -1,21 +1,21 @@ -/atom/proc/investigate_log(message, subject) - if(!message || !subject) - return - var/F = file("[GLOB.log_directory]/[subject].html") - F << "[time_stamp()] \ref[src] ([x],[y],[z]) || [src] [message]
" - - -/client/proc/investigate_show( subject in list("hrefs","notes, memos, watchlist","singulo","wires","telesci", "gravity", "records", "cargo", "supermatter", "atmos", "experimentor", "botany") ) - set name = "Investigate" - set category = "Admin" - if(!holder) - return - switch(subject) - if("notes, memos, watchlist") - browse_messages() - else - var/F = file("[GLOB.log_directory]/[subject].html") - if(!fexists(F)) - to_chat(src, "No [subject] logfile was found.") - return - src << browse(F,"window=investigate[subject];size=800x300") +/atom/proc/investigate_log(message, subject) + if(!message || !subject) + return + var/F = file("[GLOB.log_directory]/[subject].html") + F << "[time_stamp()] \ref[src] ([x],[y],[z]) || [src] [message]
" + + +/client/proc/investigate_show( subject in list("hrefs","notes, memos, watchlist","singulo","wires","telesci", "gravity", "records", "cargo", "supermatter", "atmos", "experimentor", "botany") ) + set name = "Investigate" + set category = "Admin" + if(!holder) + return + switch(subject) + if("notes, memos, watchlist") + browse_messages() + else + var/F = file("[GLOB.log_directory]/[subject].html") + if(!fexists(F)) + to_chat(src, "No [subject] logfile was found.") + return + src << browse(F,"window=investigate[subject];size=800x300") diff --git a/code/modules/atmospherics/machinery/other/meter.dm b/code/modules/atmospherics/machinery/other/meter.dm index b0967bfe43..bd9f3e35df 100644 --- a/code/modules/atmospherics/machinery/other/meter.dm +++ b/code/modules/atmospherics/machinery/other/meter.dm @@ -1,134 +1,134 @@ -/obj/machinery/meter - name = "gas flow meter" - desc = "It measures something." - icon = 'icons/obj/meter.dmi' - icon_state = "meterX" - var/atom/target = null - anchored = 1 - power_channel = ENVIRON - var/frequency = 0 - var/id_tag - use_power = 1 - idle_power_usage = 2 - active_power_usage = 4 - obj_integrity = 150 - max_integrity = 150 - armor = list(melee = 0, bullet = 0, laser = 0, energy = 100, bomb = 0, bio = 100, rad = 100, fire = 40, acid = 0) - - -/obj/machinery/meter/Initialize(mapload) - . = ..() - SSair.atmos_machinery += src - if (mapload && !target) - target = locate(/obj/machinery/atmospherics/pipe) in loc - -/obj/machinery/meter/Destroy() - SSair.atmos_machinery -= src - src.target = null - return ..() - -/obj/machinery/meter/process_atmos() - if(!target) - icon_state = "meterX" - return 0 - - if(stat & (BROKEN|NOPOWER)) - icon_state = "meter0" - return 0 - - use_power(5) - - var/datum/gas_mixture/environment = target.return_air() - if(!environment) - icon_state = "meterX" - return 0 - - var/env_pressure = environment.return_pressure() - if(env_pressure <= 0.15*ONE_ATMOSPHERE) - icon_state = "meter0" - else if(env_pressure <= 1.8*ONE_ATMOSPHERE) - var/val = round(env_pressure/(ONE_ATMOSPHERE*0.3) + 0.5) - icon_state = "meter1_[val]" - else if(env_pressure <= 30*ONE_ATMOSPHERE) - var/val = round(env_pressure/(ONE_ATMOSPHERE*5)-0.35) + 1 - icon_state = "meter2_[val]" - else if(env_pressure <= 59*ONE_ATMOSPHERE) - var/val = round(env_pressure/(ONE_ATMOSPHERE*5) - 6) + 1 - icon_state = "meter3_[val]" - else - icon_state = "meter4" - - if(frequency) - var/datum/radio_frequency/radio_connection = SSradio.return_frequency(frequency) - - if(!radio_connection) - return - - var/datum/signal/signal = new - signal.source = src - signal.transmission_method = 1 - signal.data = list( - "id_tag" = id_tag, - "device" = "AM", - "pressure" = round(env_pressure), - "sigtype" = "status" - ) - radio_connection.post_signal(src, signal) - -/obj/machinery/meter/proc/status() - var/t = "" - if (src.target) - var/datum/gas_mixture/environment = target.return_air() - if(environment) - t += "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)] K ([round(environment.temperature-T0C,0.01)]°C)" - else - t += "The sensor error light is blinking." - else - t += "The connect error light is blinking." - return t - -/obj/machinery/meter/examine(mob/user) - ..() - to_chat(user, status()) - - -/obj/machinery/meter/attackby(obj/item/weapon/W, mob/user, params) - if (istype(W, /obj/item/weapon/wrench)) - playsound(src.loc, W.usesound, 50, 1) - to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40*W.toolspeed, target = src)) - user.visible_message( \ - "[user] unfastens \the [src].", \ - "You unfasten \the [src].", \ - "You hear ratchet.") - new /obj/item/pipe_meter(src.loc) - qdel(src) - else - return ..() - -/obj/machinery/meter/attack_ai(mob/user) - return src.attack_hand(user) - -/obj/machinery/meter/attack_paw(mob/user) - return src.attack_hand(user) - -/obj/machinery/meter/attack_hand(mob/user) - - if(stat & (NOPOWER|BROKEN)) - return 1 - else - to_chat(usr, status()) - return 1 - -/obj/machinery/meter/singularity_pull(S, current_size) - if(current_size >= STAGE_FIVE) - new /obj/item/pipe_meter(loc) - qdel(src) - -// TURF METER - REPORTS A TILE'S AIR CONTENTS -// why are you yelling? -/obj/machinery/meter/turf - -/obj/machinery/meter/turf/Initialize() - ..() - src.target = loc +/obj/machinery/meter + name = "gas flow meter" + desc = "It measures something." + icon = 'icons/obj/meter.dmi' + icon_state = "meterX" + var/atom/target = null + anchored = 1 + power_channel = ENVIRON + var/frequency = 0 + var/id_tag + use_power = 1 + idle_power_usage = 2 + active_power_usage = 4 + obj_integrity = 150 + max_integrity = 150 + armor = list(melee = 0, bullet = 0, laser = 0, energy = 100, bomb = 0, bio = 100, rad = 100, fire = 40, acid = 0) + + +/obj/machinery/meter/Initialize(mapload) + . = ..() + SSair.atmos_machinery += src + if (mapload && !target) + target = locate(/obj/machinery/atmospherics/pipe) in loc + +/obj/machinery/meter/Destroy() + SSair.atmos_machinery -= src + src.target = null + return ..() + +/obj/machinery/meter/process_atmos() + if(!target) + icon_state = "meterX" + return 0 + + if(stat & (BROKEN|NOPOWER)) + icon_state = "meter0" + return 0 + + use_power(5) + + var/datum/gas_mixture/environment = target.return_air() + if(!environment) + icon_state = "meterX" + return 0 + + var/env_pressure = environment.return_pressure() + if(env_pressure <= 0.15*ONE_ATMOSPHERE) + icon_state = "meter0" + else if(env_pressure <= 1.8*ONE_ATMOSPHERE) + var/val = round(env_pressure/(ONE_ATMOSPHERE*0.3) + 0.5) + icon_state = "meter1_[val]" + else if(env_pressure <= 30*ONE_ATMOSPHERE) + var/val = round(env_pressure/(ONE_ATMOSPHERE*5)-0.35) + 1 + icon_state = "meter2_[val]" + else if(env_pressure <= 59*ONE_ATMOSPHERE) + var/val = round(env_pressure/(ONE_ATMOSPHERE*5) - 6) + 1 + icon_state = "meter3_[val]" + else + icon_state = "meter4" + + if(frequency) + var/datum/radio_frequency/radio_connection = SSradio.return_frequency(frequency) + + if(!radio_connection) + return + + var/datum/signal/signal = new + signal.source = src + signal.transmission_method = 1 + signal.data = list( + "id_tag" = id_tag, + "device" = "AM", + "pressure" = round(env_pressure), + "sigtype" = "status" + ) + radio_connection.post_signal(src, signal) + +/obj/machinery/meter/proc/status() + var/t = "" + if (src.target) + var/datum/gas_mixture/environment = target.return_air() + if(environment) + t += "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)] K ([round(environment.temperature-T0C,0.01)]°C)" + else + t += "The sensor error light is blinking." + else + t += "The connect error light is blinking." + return t + +/obj/machinery/meter/examine(mob/user) + ..() + to_chat(user, status()) + + +/obj/machinery/meter/attackby(obj/item/weapon/W, mob/user, params) + if (istype(W, /obj/item/weapon/wrench)) + playsound(src.loc, W.usesound, 50, 1) + to_chat(user, "You begin to unfasten \the [src]...") + if (do_after(user, 40*W.toolspeed, target = src)) + user.visible_message( \ + "[user] unfastens \the [src].", \ + "You unfasten \the [src].", \ + "You hear ratchet.") + new /obj/item/pipe_meter(src.loc) + qdel(src) + else + return ..() + +/obj/machinery/meter/attack_ai(mob/user) + return src.attack_hand(user) + +/obj/machinery/meter/attack_paw(mob/user) + return src.attack_hand(user) + +/obj/machinery/meter/attack_hand(mob/user) + + if(stat & (NOPOWER|BROKEN)) + return 1 + else + to_chat(usr, status()) + return 1 + +/obj/machinery/meter/singularity_pull(S, current_size) + if(current_size >= STAGE_FIVE) + new /obj/item/pipe_meter(loc) + qdel(src) + +// TURF METER - REPORTS A TILE'S AIR CONTENTS +// why are you yelling? +/obj/machinery/meter/turf + +/obj/machinery/meter/turf/Initialize() + ..() + src.target = loc diff --git a/code/modules/awaymissions/mission_code/Academy.dm b/code/modules/awaymissions/mission_code/Academy.dm index 1608623080..c120f53660 100644 --- a/code/modules/awaymissions/mission_code/Academy.dm +++ b/code/modules/awaymissions/mission_code/Academy.dm @@ -1,309 +1,309 @@ - -//Academy Items - -/obj/singularity/academy - dissipate = 0 - move_self = 0 - grav_pull = 1 - -/obj/singularity/academy/admin_investigate_setup() - return - -/obj/singularity/academy/process() - eat() - if(prob(1)) - mezzer() - - -/obj/item/clothing/glasses/meson/truesight - name = "The Lens of Truesight" - desc = "I can see forever!" - icon_state = "monocle" - item_state = "headset" - - -/obj/structure/academy_wizard_spawner - name = "Academy Defensive System" - desc = "Made by Abjuration Inc" - icon = 'icons/obj/cult.dmi' - icon_state = "forge" - anchored = 1 - obj_integrity = 200 - max_integrity = 200 - var/mob/living/current_wizard = null - var/next_check = 0 - var/cooldown = 600 - var/faction = "wizard" - var/braindead_check = 0 - -/obj/structure/academy_wizard_spawner/New() - START_PROCESSING(SSobj, src) - -/obj/structure/academy_wizard_spawner/Destroy() - if(!broken) - STOP_PROCESSING(SSobj, src) - return ..() - -/obj/structure/academy_wizard_spawner/process() - if(next_check < world.time) - if(!current_wizard) - for(var/mob/living/L in GLOB.player_list) - if(L.z == src.z && L.stat != DEAD && !(faction in L.faction)) - summon_wizard() - break - else - if(current_wizard.stat == DEAD) - current_wizard = null - summon_wizard() - if(!current_wizard.client) - if(!braindead_check) - braindead_check = 1 - else - braindead_check = 0 - give_control() - next_check = world.time + cooldown - -/obj/structure/academy_wizard_spawner/proc/give_control() - set waitfor = FALSE - - if(!current_wizard) - return - var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as Wizard Academy Defender?", "wizard", null, be_special_flag = ROLE_WIZARD, M = current_wizard) - var/mob/dead/observer/chosen = null - - if(candidates.len) - chosen = pick(candidates) - message_admins("[key_name_admin(chosen)] was spawned as Wizard Academy Defender") - current_wizard.ghostize() // on the off chance braindead defender gets back in - current_wizard.key = chosen.key - -/obj/structure/academy_wizard_spawner/proc/summon_wizard() - var/turf/T = src.loc - - var/mob/living/carbon/human/wizbody = new(T) - wizbody.equipOutfit(/datum/outfit/wizard/academy) - var/obj/item/weapon/implant/exile/Implant = new/obj/item/weapon/implant/exile(wizbody) - Implant.implant(wizbody) - wizbody.faction |= "wizard" - wizbody.real_name = "Academy Teacher" - wizbody.name = "Academy Teacher" - - var/datum/mind/wizmind = new /datum/mind() - wizmind.name = "Wizard Defender" - wizmind.special_role = "Academy Defender" - var/datum/objective/O = new("Protect Wizard Academy from the intruders") - wizmind.objectives += O - wizmind.transfer_to(wizbody) - SSticker.mode.wizards |= wizmind - - wizmind.AddSpell(new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt) - wizmind.AddSpell(new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile) - wizmind.AddSpell(new /obj/effect/proc_holder/spell/aimed/fireball) - - current_wizard = wizbody - - give_control() - -/obj/structure/academy_wizard_spawner/deconstruct(disassembled = TRUE) - if(!broken) - broken = 1 - visible_message("[src] breaks down!") - icon_state = "forge_off" - STOP_PROCESSING(SSobj, src) - -/datum/outfit/wizard/academy - name = "Academy Wizard" - r_pocket = null - r_hand = null - suit = /obj/item/clothing/suit/wizrobe/red - head = /obj/item/clothing/head/wizard/red - backpack_contents = list(/obj/item/weapon/storage/box/survival = 1) - -/obj/item/weapon/dice/d20/fate - name = "Die of Fate" - desc = "A die with twenty sides. You can feel unearthly energies radiating from it. Using this might be VERY risky." - icon_state = "d20" - sides = 20 - can_be_rigged = FALSE - var/reusable = 1 - var/used = 0 - -/obj/item/weapon/dice/d20/fate/one_use - reusable = 0 - -/obj/item/weapon/dice/d20/fate/diceroll(mob/user) - ..() - if(!used) - if(!ishuman(user) || !user.mind || (user.mind in SSticker.mode.wizards)) - to_chat(user, "You feel the magic of the dice is restricted to ordinary humans!") - return - if(rigged) - effect(user,rigged) - else - effect(user,result) - -/obj/item/weapon/dice/d20/fate/equipped(mob/user, slot) - if(!ishuman(user) || !user.mind || (user.mind in SSticker.mode.wizards)) - to_chat(user, "You feel the magic of the dice is restricted to ordinary humans! You should leave it alone.") - user.drop_item() - - -/obj/item/weapon/dice/d20/fate/proc/effect(var/mob/living/carbon/human/user,roll) - if(!reusable) - used = 1 - visible_message("The die flare briefly.") - switch(roll) - if(1) - //Dust - user.dust() - if(2) - //Death - user.death() - if(3) - //Swarm of creatures - for(var/direction in GLOB.alldirs) - var/turf/T = get_turf(src) - new /mob/living/simple_animal/hostile/creature(get_step(T,direction)) - if(4) - //Destroy Equipment - for (var/obj/item/I in user) - if (istype(I, /obj/item/weapon/implant)) - continue - qdel(I) - if(5) - //Monkeying - user.monkeyize() - if(6) - //Cut speed - var/datum/species/S = user.dna.species - S.speedmod += 1 - if(7) - //Throw - user.Stun(3) - user.adjustBruteLoss(50) - var/throw_dir = pick(GLOB.cardinal) - var/atom/throw_target = get_edge_target_turf(user, throw_dir) - user.throw_at(throw_target, 200, 4) - if(8) - //Fueltank Explosion - explosion(src.loc,-1,0,2, flame_range = 2) - if(9) - //Cold - var/datum/disease/D = new /datum/disease/cold - user.ForceContractDisease(D) - if(10) - //Nothing - visible_message("[src] roll perfectly.") - if(11) - //Cookie - var/obj/item/weapon/reagent_containers/food/snacks/cookie/C = new(get_turf(src)) - C.name = "Cookie of Fate" - if(12) - //Healing - user.revive(full_heal = 1, admin_revive = 1) - if(13) - //Mad Dosh - var/turf/Start = get_turf(src) - for(var/direction in GLOB.alldirs) - var/turf/T = get_step(Start,direction) - if(rand(0,1)) - new /obj/item/stack/spacecash/c1000(T) - else - var/obj/item/weapon/storage/bag/money/M = new(T) - for(var/i in 1 to rand(5,50)) - new /obj/item/weapon/coin/gold(M) - if(14) - //Free Gun - new /obj/item/weapon/gun/ballistic/revolver/mateba(get_turf(src)) - if(15) - //Random One-use spellbook - new /obj/item/weapon/spellbook/oneuse/random(get_turf(src)) - if(16) - //Servant & Servant Summon - var/mob/living/carbon/human/H = new(get_turf(src)) - H.equipOutfit(/datum/outfit/butler) - var/datum/mind/servant_mind = new /datum/mind() - var/datum/objective/O = new("Serve [user.real_name].") - servant_mind.objectives += O - servant_mind.transfer_to(H) - - var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [user.real_name] Servant?", "wizard", mob = H) - var/mob/dead/observer/chosen = null - - if(candidates.len) - chosen = pick(candidates) - message_admins("[key_name_admin(chosen)] was spawned as Dice Servant") - H.key = chosen.key - - var/obj/effect/proc_holder/spell/targeted/summonmob/S = new - S.target_mob = H - user.mind.AddSpell(S) - - if(17) - //Tator Kit - new /obj/item/weapon/storage/box/syndicate/(get_turf(src)) - if(18) - //Captain ID - new /obj/item/weapon/card/id/captains_spare(get_turf(src)) - if(19) - //Instrinct Resistance - to_chat(user, "You feel robust.") - var/datum/species/S = user.dna.species - S.brutemod *= 0.5 - S.burnmod *= 0.5 - S.coldmod *= 0.5 - if(20) - //Free wizard! - user.mind.make_Wizard() - - -/datum/outfit/butler - name = "Butler" - uniform = /obj/item/clothing/under/suit_jacket/really_black - shoes = /obj/item/clothing/shoes/laceup - head = /obj/item/clothing/head/bowler - glasses = /obj/item/clothing/glasses/monocle - gloves = /obj/item/clothing/gloves/color/white - -/obj/effect/proc_holder/spell/targeted/summonmob - name = "Summon Servant" - desc = "This spell can be used to call your servant, whenever you need it." - charge_max = 100 - clothes_req = 0 - invocation = "JE VES" - invocation_type = "whisper" - range = -1 - level_max = 0 //cannot be improved - cooldown_min = 100 - include_user = 1 - - var/mob/living/target_mob - - action_icon_state = "summons" - -/obj/effect/proc_holder/spell/targeted/summonmob/cast(list/targets,mob/user = usr) - if(!target_mob) - return - var/turf/Start = get_turf(user) - for(var/direction in GLOB.alldirs) - var/turf/T = get_step(Start,direction) - if(!T.density) - target_mob.Move(T) - -/obj/structure/ladder/unbreakable/rune - name = "Teleportation Rune" - desc = "Could lead anywhere." - icon = 'icons/obj/rune.dmi' - icon_state = "1" - color = rgb(0,0,255) - -/obj/structure/ladder/unbreakable/rune/update_icon() - return - -/obj/structure/ladder/unbreakable/rune/show_fluff_message(up,mob/user) - user.visible_message("[user] activates \the [src].","You activate \the [src].") - -/obj/structure/ladder/can_use(mob/user) - if(user.mind in SSticker.mode.wizards) - return 0 - return 1 + +//Academy Items + +/obj/singularity/academy + dissipate = 0 + move_self = 0 + grav_pull = 1 + +/obj/singularity/academy/admin_investigate_setup() + return + +/obj/singularity/academy/process() + eat() + if(prob(1)) + mezzer() + + +/obj/item/clothing/glasses/meson/truesight + name = "The Lens of Truesight" + desc = "I can see forever!" + icon_state = "monocle" + item_state = "headset" + + +/obj/structure/academy_wizard_spawner + name = "Academy Defensive System" + desc = "Made by Abjuration Inc" + icon = 'icons/obj/cult.dmi' + icon_state = "forge" + anchored = 1 + obj_integrity = 200 + max_integrity = 200 + var/mob/living/current_wizard = null + var/next_check = 0 + var/cooldown = 600 + var/faction = "wizard" + var/braindead_check = 0 + +/obj/structure/academy_wizard_spawner/New() + START_PROCESSING(SSobj, src) + +/obj/structure/academy_wizard_spawner/Destroy() + if(!broken) + STOP_PROCESSING(SSobj, src) + return ..() + +/obj/structure/academy_wizard_spawner/process() + if(next_check < world.time) + if(!current_wizard) + for(var/mob/living/L in GLOB.player_list) + if(L.z == src.z && L.stat != DEAD && !(faction in L.faction)) + summon_wizard() + break + else + if(current_wizard.stat == DEAD) + current_wizard = null + summon_wizard() + if(!current_wizard.client) + if(!braindead_check) + braindead_check = 1 + else + braindead_check = 0 + give_control() + next_check = world.time + cooldown + +/obj/structure/academy_wizard_spawner/proc/give_control() + set waitfor = FALSE + + if(!current_wizard) + return + var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as Wizard Academy Defender?", "wizard", null, be_special_flag = ROLE_WIZARD, M = current_wizard) + var/mob/dead/observer/chosen = null + + if(candidates.len) + chosen = pick(candidates) + message_admins("[key_name_admin(chosen)] was spawned as Wizard Academy Defender") + current_wizard.ghostize() // on the off chance braindead defender gets back in + current_wizard.key = chosen.key + +/obj/structure/academy_wizard_spawner/proc/summon_wizard() + var/turf/T = src.loc + + var/mob/living/carbon/human/wizbody = new(T) + wizbody.equipOutfit(/datum/outfit/wizard/academy) + var/obj/item/weapon/implant/exile/Implant = new/obj/item/weapon/implant/exile(wizbody) + Implant.implant(wizbody) + wizbody.faction |= "wizard" + wizbody.real_name = "Academy Teacher" + wizbody.name = "Academy Teacher" + + var/datum/mind/wizmind = new /datum/mind() + wizmind.name = "Wizard Defender" + wizmind.special_role = "Academy Defender" + var/datum/objective/O = new("Protect Wizard Academy from the intruders") + wizmind.objectives += O + wizmind.transfer_to(wizbody) + SSticker.mode.wizards |= wizmind + + wizmind.AddSpell(new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt) + wizmind.AddSpell(new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile) + wizmind.AddSpell(new /obj/effect/proc_holder/spell/aimed/fireball) + + current_wizard = wizbody + + give_control() + +/obj/structure/academy_wizard_spawner/deconstruct(disassembled = TRUE) + if(!broken) + broken = 1 + visible_message("[src] breaks down!") + icon_state = "forge_off" + STOP_PROCESSING(SSobj, src) + +/datum/outfit/wizard/academy + name = "Academy Wizard" + r_pocket = null + r_hand = null + suit = /obj/item/clothing/suit/wizrobe/red + head = /obj/item/clothing/head/wizard/red + backpack_contents = list(/obj/item/weapon/storage/box/survival = 1) + +/obj/item/weapon/dice/d20/fate + name = "Die of Fate" + desc = "A die with twenty sides. You can feel unearthly energies radiating from it. Using this might be VERY risky." + icon_state = "d20" + sides = 20 + can_be_rigged = FALSE + var/reusable = 1 + var/used = 0 + +/obj/item/weapon/dice/d20/fate/one_use + reusable = 0 + +/obj/item/weapon/dice/d20/fate/diceroll(mob/user) + ..() + if(!used) + if(!ishuman(user) || !user.mind || (user.mind in SSticker.mode.wizards)) + to_chat(user, "You feel the magic of the dice is restricted to ordinary humans!") + return + if(rigged) + effect(user,rigged) + else + effect(user,result) + +/obj/item/weapon/dice/d20/fate/equipped(mob/user, slot) + if(!ishuman(user) || !user.mind || (user.mind in SSticker.mode.wizards)) + to_chat(user, "You feel the magic of the dice is restricted to ordinary humans! You should leave it alone.") + user.drop_item() + + +/obj/item/weapon/dice/d20/fate/proc/effect(var/mob/living/carbon/human/user,roll) + if(!reusable) + used = 1 + visible_message("The die flare briefly.") + switch(roll) + if(1) + //Dust + user.dust() + if(2) + //Death + user.death() + if(3) + //Swarm of creatures + for(var/direction in GLOB.alldirs) + var/turf/T = get_turf(src) + new /mob/living/simple_animal/hostile/creature(get_step(T,direction)) + if(4) + //Destroy Equipment + for (var/obj/item/I in user) + if (istype(I, /obj/item/weapon/implant)) + continue + qdel(I) + if(5) + //Monkeying + user.monkeyize() + if(6) + //Cut speed + var/datum/species/S = user.dna.species + S.speedmod += 1 + if(7) + //Throw + user.Stun(3) + user.adjustBruteLoss(50) + var/throw_dir = pick(GLOB.cardinal) + var/atom/throw_target = get_edge_target_turf(user, throw_dir) + user.throw_at(throw_target, 200, 4) + if(8) + //Fueltank Explosion + explosion(src.loc,-1,0,2, flame_range = 2) + if(9) + //Cold + var/datum/disease/D = new /datum/disease/cold + user.ForceContractDisease(D) + if(10) + //Nothing + visible_message("[src] roll perfectly.") + if(11) + //Cookie + var/obj/item/weapon/reagent_containers/food/snacks/cookie/C = new(get_turf(src)) + C.name = "Cookie of Fate" + if(12) + //Healing + user.revive(full_heal = 1, admin_revive = 1) + if(13) + //Mad Dosh + var/turf/Start = get_turf(src) + for(var/direction in GLOB.alldirs) + var/turf/T = get_step(Start,direction) + if(rand(0,1)) + new /obj/item/stack/spacecash/c1000(T) + else + var/obj/item/weapon/storage/bag/money/M = new(T) + for(var/i in 1 to rand(5,50)) + new /obj/item/weapon/coin/gold(M) + if(14) + //Free Gun + new /obj/item/weapon/gun/ballistic/revolver/mateba(get_turf(src)) + if(15) + //Random One-use spellbook + new /obj/item/weapon/spellbook/oneuse/random(get_turf(src)) + if(16) + //Servant & Servant Summon + var/mob/living/carbon/human/H = new(get_turf(src)) + H.equipOutfit(/datum/outfit/butler) + var/datum/mind/servant_mind = new /datum/mind() + var/datum/objective/O = new("Serve [user.real_name].") + servant_mind.objectives += O + servant_mind.transfer_to(H) + + var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [user.real_name] Servant?", "wizard", mob = H) + var/mob/dead/observer/chosen = null + + if(candidates.len) + chosen = pick(candidates) + message_admins("[key_name_admin(chosen)] was spawned as Dice Servant") + H.key = chosen.key + + var/obj/effect/proc_holder/spell/targeted/summonmob/S = new + S.target_mob = H + user.mind.AddSpell(S) + + if(17) + //Tator Kit + new /obj/item/weapon/storage/box/syndicate/(get_turf(src)) + if(18) + //Captain ID + new /obj/item/weapon/card/id/captains_spare(get_turf(src)) + if(19) + //Instrinct Resistance + to_chat(user, "You feel robust.") + var/datum/species/S = user.dna.species + S.brutemod *= 0.5 + S.burnmod *= 0.5 + S.coldmod *= 0.5 + if(20) + //Free wizard! + user.mind.make_Wizard() + + +/datum/outfit/butler + name = "Butler" + uniform = /obj/item/clothing/under/suit_jacket/really_black + shoes = /obj/item/clothing/shoes/laceup + head = /obj/item/clothing/head/bowler + glasses = /obj/item/clothing/glasses/monocle + gloves = /obj/item/clothing/gloves/color/white + +/obj/effect/proc_holder/spell/targeted/summonmob + name = "Summon Servant" + desc = "This spell can be used to call your servant, whenever you need it." + charge_max = 100 + clothes_req = 0 + invocation = "JE VES" + invocation_type = "whisper" + range = -1 + level_max = 0 //cannot be improved + cooldown_min = 100 + include_user = 1 + + var/mob/living/target_mob + + action_icon_state = "summons" + +/obj/effect/proc_holder/spell/targeted/summonmob/cast(list/targets,mob/user = usr) + if(!target_mob) + return + var/turf/Start = get_turf(user) + for(var/direction in GLOB.alldirs) + var/turf/T = get_step(Start,direction) + if(!T.density) + target_mob.Move(T) + +/obj/structure/ladder/unbreakable/rune + name = "Teleportation Rune" + desc = "Could lead anywhere." + icon = 'icons/obj/rune.dmi' + icon_state = "1" + color = rgb(0,0,255) + +/obj/structure/ladder/unbreakable/rune/update_icon() + return + +/obj/structure/ladder/unbreakable/rune/show_fluff_message(up,mob/user) + user.visible_message("[user] activates \the [src].","You activate \the [src].") + +/obj/structure/ladder/can_use(mob/user) + if(user.mind in SSticker.mode.wizards) + return 0 + return 1 diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 0aeb922d27..8d5bbde4b3 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1,1643 +1,1643 @@ - - -GLOBAL_LIST_EMPTY(preferences_datums) - - - -/datum/preferences - var/client/parent - //doohickeys for savefiles - var/path - var/default_slot = 1 //Holder so it doesn't default to slot 1, rather the last one used - var/max_save_slots = 10 - - //non-preference stuff - var/muted = 0 - var/last_ip - var/last_id - - //game-preferences - var/lastchangelog = "" //Saved changlog filesize to detect if there was a change - var/ooccolor = null - - //Antag preferences - var/list/be_special = list() //Special role selection - var/tmp/old_be_special = 0 //Bitflag version of be_special, used to update old savefiles and nothing more - //If it's 0, that's good, if it's anything but 0, the owner of this prefs file's antag choices were, - //autocorrected this round, not that you'd need to check that. - - - var/UI_style = "Midnight" - var/hotkeys = FALSE - var/tgui_fancy = TRUE - var/tgui_lock = TRUE - var/windowflashing = TRUE - var/toggles = TOGGLES_DEFAULT - var/chat_toggles = TOGGLES_DEFAULT_CHAT - var/ghost_form = "ghost" - var/ghost_orbit = GHOST_ORBIT_CIRCLE - var/ghost_accs = GHOST_ACCS_DEFAULT_OPTION - var/ghost_others = GHOST_OTHERS_DEFAULT_OPTION - var/ghost_hud = 1 - var/inquisitive_ghost = 1 - var/allow_midround_antag = 1 - var/preferred_map = null - - var/uses_glasses_colour = 0 - - //character preferences - var/real_name //our character's name - var/be_random_name = 0 //whether we'll have a random name every round - var/be_random_body = 0 //whether we'll have a random body every round - var/gender = MALE //gender of character (well duh) - var/age = 30 //age of character - var/underwear = "Nude" //underwear type - var/undershirt = "Nude" //undershirt type - var/socks = "Nude" //socks type - var/backbag = DBACKPACK //backpack type - var/hair_style = "Bald" //Hair type - var/hair_color = "000" //Hair color - var/facial_hair_style = "Shaved" //Face hair type - var/facial_hair_color = "000" //Facial hair color - var/skin_tone = "caucasian1" //Skin color - var/eye_color = "000" //Eye color - var/datum/species/pref_species = new /datum/species/human() //Mutant race - var/list/features = list("mcolor" = "FFF", - "mcolor2" = "FFF", - "mcolor3" = "FFF", - "tail_lizard" = "Smooth", - "tail_human" = "None", - "snout" = "Round", - "horns" = "None", - "ears" = "None", - "wings" = "None", - "frills" = "None", - "spines" = "None", - "body_markings" = "None", - "mam_body_markings" = "None", - "mam_ears" = "None", - "mam_tail" = "None", - "mam_tail_animated" = "None", - "xenodorsal" = "None", - "xenohead" = "None", - "xenotail" = "None", - "legs" = "Normal Legs", - "taur" = "None", - "exhibitionist" = FALSE, - "genitals_use_skintone" = FALSE, - "has_cock" = FALSE, - "cock_shape" = "Human", - "cock_length" = 6, - "cock_girth_ratio" = COCK_GIRTH_RATIO_DEF, - "cock_color" = "fff", - "has_sheath" = FALSE, - "sheath_color" = "fff", - "has_balls" = FALSE, - "balls_internal" = FALSE, - "balls_color" = "fff", - "balls_amount" = 2, - "balls_sack_size" = BALLS_SACK_SIZE_DEF, - "balls_size" = BALLS_SIZE_DEF, - "balls_cum_rate" = CUM_RATE, - "balls_cum_mult" = CUM_RATE_MULT, - "balls_efficiency" = CUM_EFFICIENCY, - "balls_fluid" = "semen", - "has_ovi" = FALSE, - "ovi_shape" = "knotted", - "ovi_length" = 6, - "ovi_color" = "fff", - "has_eggsack" = FALSE, - "eggsack_internal" = TRUE, - "eggsack_color" = "fff", - "eggsack_size" = BALLS_SACK_SIZE_DEF, - "eggsack_egg_color" = "fff", - "eggsack_egg_size" = EGG_GIRTH_DEF, - "has_breasts" = FALSE, - "breasts_color" = "fff", - "breasts_size" = "C", - "breasts_shape" = "Pair", - "breasts_fluid" = "milk", - "has_vag" = FALSE, - "vag_shape" = "Human", - "vag_color" = "fff", - "vag_clits" = 1, - "vag_clit_diam" = 0.25, - "vag_clit_len" = 0.25, - "has_womb" = FALSE, - "womb_cum_rate" = CUM_RATE, - "womb_cum_mult" = CUM_RATE_MULT, - "womb_efficiency" = CUM_EFFICIENCY, - "womb_fluid" = "femcum" - )//MAKE SURE TO UPDATE THE LIST IN MOBS.DM IF YOU'RE GOING TO ADD TO THIS LIST, OTHERWISE THINGS MIGHT GET FUCKEY - - var/list/custom_names = list("clown", "mime", "ai", "cyborg", "religion", "deity") - var/prefered_security_department = SEC_DEPT_RANDOM - - //Mob preview - var/icon/preview_icon = null - - //Jobs, uses bitflags - var/job_civilian_high = 0 - var/job_civilian_med = 0 - var/job_civilian_low = 0 - - var/job_medsci_high = 0 - var/job_medsci_med = 0 - var/job_medsci_low = 0 - - var/job_engsec_high = 0 - var/job_engsec_med = 0 - var/job_engsec_low = 0 - - // Want randomjob if preferences already filled - Donkie - var/joblessrole = BERANDOMJOB //defaults to 1 for fewer assistants - - // 0 = character settings, 1 = game preferences, 2 = character appearance - var/current_tab = 0 - - // OOC Metadata: - var/metadata = "" - - var/unlock_content = 0 - - var/list/ignoring = list() - - var/clientfps = 0 - - var/parallax - - var/uplink_spawn_loc = UPLINK_PDA - - var/list/menuoptions - - //citadel code - var/arousable = TRUE //Allows players to disable arousal from the character creation menu - var/flavor_text = "" - -/datum/preferences/New(client/C) - parent = C - custom_names["ai"] = pick(GLOB.ai_names) - custom_names["cyborg"] = pick(GLOB.ai_names) - custom_names["clown"] = pick(GLOB.clown_names) - custom_names["mime"] = pick(GLOB.mime_names) - if(istype(C)) - if(!IsGuestKey(C.key)) - load_path(C.ckey) - unlock_content = C.IsByondMember() - if(unlock_content) - max_save_slots = 16 - var/loaded_preferences_successfully = load_preferences() - if(loaded_preferences_successfully) - if(load_character()) - return - //we couldn't load character data so just randomize the character appearance + name - random_character() //let's create a random character then - rather than a fat, bald and naked man. - real_name = pref_species.random_name(gender,1) - if(!loaded_preferences_successfully) - save_preferences() - save_character() //let's save this new random character so it doesn't keep generating new ones. - menuoptions = list() - return - -/datum/preferences/proc/ShowChoices(mob/user) - if(!user || !user.client) - return - if(current_tab == 2) - update_preview_icon(nude=TRUE) - else - update_preview_icon(nude=FALSE) - user << browse_rsc(preview_icon, "previewicon.png") - var/dat = "
" - - dat += "Character Settings" - dat += "Character Appearance" - dat += "Game Preferences" - - if(!path) - dat += "
Please create an account to save your preferences
" - - dat += "
" - - dat += "
" - - switch(current_tab) - if (0) // Character Settings# - if(path) - var/savefile/S = new /savefile(path) - if(S) - dat += "
" - var/name - for(var/i=1, i<=max_save_slots, i++) - S.cd = "/character[i]" - S["real_name"] >> name - if(!name) - name = "Character[i]" - //if(i!=1) dat += " | " - dat += "[name] " - dat += "
" - - dat += "

Occupation Choices

" - dat += "Set Occupation Preferences
" - dat += "

Identity

" - dat += "" - - dat += "
" - if(jobban_isbanned(user, "appearance")) - dat += "You are banned from using custom names and appearances. You can continue to adjust your characters, but you will be randomised once you join the game.
" - dat += "Random Name " - dat += "Always Random Name: [be_random_name ? "Yes" : "No"]
" - - dat += "Name: " - dat += "[real_name]
" - - dat += "Gender: [gender == MALE ? "Male" : "Female"]
" - dat += "Age: [age]
" - dat += "Arousal:[arousable == TRUE ? "Enabled" : "Disabled"]
" - dat += "Exhibitionist:[features["exhibitionist"] == TRUE ? "Yes" : "No"]
" - dat += "Special Names:
" - dat += "Clown: [custom_names["clown"]] " - dat += "Mime:[custom_names["mime"]]
" - dat += "AI: [custom_names["ai"]] " - dat += "Cyborg: [custom_names["cyborg"]]
" - dat += "Chaplain religion: [custom_names["religion"]] " - dat += "Chaplain deity: [custom_names["deity"]]
" - - dat += "Custom job preferences:
" - dat += "Prefered security department: [prefered_security_department]
" - - dat += "
" - - dat += "
" -// dat += "Size: [character_size]
" - dat += "
" - - if (1) // Game Preferences - dat += "
" - dat += "

General Settings

" - dat += "UI Style: [UI_style]
" - dat += "Keybindings: [(hotkeys) ? "Hotkeys" : "Default"]
" - dat += "tgui Style: [(tgui_fancy) ? "Fancy" : "No Frills"]
" - dat += "tgui Monitors: [(tgui_lock) ? "Primary" : "All"]
" - dat += "Window Flashing: [(windowflashing) ? "Yes" : "No"]
" - dat += "Play admin midis: [(toggles & SOUND_MIDI) ? "Yes" : "No"]
" - dat += "Play lobby music: [(toggles & SOUND_LOBBY) ? "Yes" : "No"]
" - dat += "Ghost ears: [(chat_toggles & CHAT_GHOSTEARS) ? "All Speech" : "Nearest Creatures"]
" - dat += "Ghost sight: [(chat_toggles & CHAT_GHOSTSIGHT) ? "All Emotes" : "Nearest Creatures"]
" - dat += "Ghost whispers: [(chat_toggles & CHAT_GHOSTWHISPER) ? "All Speech" : "Nearest Creatures"]
" - dat += "Ghost radio: [(chat_toggles & CHAT_GHOSTRADIO) ? "Yes" : "No"]
" - dat += "Ghost pda: [(chat_toggles & CHAT_GHOSTPDA) ? "All Messages" : "Nearest Creatures"]
" - dat += "Pull requests: [(chat_toggles & CHAT_PULLR) ? "Yes" : "No"]
" - dat += "Midround Antagonist: [(toggles & MIDROUND_ANTAG) ? "Yes" : "No"]
" - if(config.allow_Metadata) - dat += "OOC Notes: Edit
" - - if(user.client) - if(user.client.holder) - dat += "Adminhelp Sound: [(toggles & SOUND_ADMINHELP)?"On":"Off"]
" - dat += "Announce Login: [(toggles & ANNOUNCE_LOGIN)?"On":"Off"]
" - - if(unlock_content || check_rights_for(user.client, R_ADMIN)) - dat += "OOC:     Change
" - - if(unlock_content) - dat += "BYOND Membership Publicity: [(toggles & MEMBER_PUBLIC) ? "Public" : "Hidden"]
" - dat += "Ghost Form: [ghost_form]
" - dat += "Ghost Orbit: [ghost_orbit]
" - - var/button_name = "If you see this something went wrong." - switch(ghost_accs) - if(GHOST_ACCS_FULL) - button_name = GHOST_ACCS_FULL_NAME - if(GHOST_ACCS_DIR) - button_name = GHOST_ACCS_DIR_NAME - if(GHOST_ACCS_NONE) - button_name = GHOST_ACCS_NONE_NAME - - dat += "Ghost Accessories: [button_name]
" - - switch(ghost_others) - if(GHOST_OTHERS_THEIR_SETTING) - button_name = GHOST_OTHERS_THEIR_SETTING_NAME - if(GHOST_OTHERS_DEFAULT_SPRITE) - button_name = GHOST_OTHERS_DEFAULT_SPRITE_NAME - if(GHOST_OTHERS_SIMPLE) - button_name = GHOST_OTHERS_SIMPLE_NAME - - dat += "Ghosts of Others: [button_name]
" - - if (config.maprotation) - var/p_map = preferred_map - if (!p_map) - p_map = "Default" - if (config.defaultmap) - p_map += " ([config.defaultmap.map_name])" - else - if (p_map in config.maplist) - var/datum/map_config/VM = config.maplist[p_map] - if (!VM) - p_map += " (No longer exists)" - else - p_map = VM.map_name - else - p_map += " (No longer exists)" - if(config.allow_map_voting) - dat += "Preferred Map: [p_map]
" - - dat += "FPS: [clientfps]
" - - dat += "Parallax (Fancy Space): " - switch (parallax) - if (PARALLAX_LOW) - dat += "Low" - if (PARALLAX_MED) - dat += "Medium" - if (PARALLAX_INSANE) - dat += "Insane" - if (PARALLAX_DISABLE) - dat += "Disabled" - else - dat += "High" - dat += "
" - - dat += "
" - - dat += "

Special Role Settings

" - - if(jobban_isbanned(user, "Syndicate")) - dat += "You are banned from antagonist roles." - src.be_special = list() - - - for (var/i in GLOB.special_roles) - if(jobban_isbanned(user, i)) - dat += "Be [capitalize(i)]: BANNED
" - else - var/days_remaining = null - if(config.use_age_restriction_for_jobs && ispath(GLOB.special_roles[i])) //If it's a game mode antag, check if the player meets the minimum age - var/mode_path = GLOB.special_roles[i] - var/datum/game_mode/temp_mode = new mode_path - days_remaining = temp_mode.get_remaining_days(user.client) - - if(days_remaining) - dat += "Be [capitalize(i)]: \[IN [days_remaining] DAYS]
" - else - dat += "Be [capitalize(i)]: [(i in be_special) ? "Yes" : "No"]
" - - dat += "
" - - //Character Appearance - if(2) - dat += "" - */ - - - dat += "
" - dat += "

" - dat += "Set Flavor Text
" - if(lentext(flavor_text) <= 40) - if(!lentext(flavor_text)) - dat += "\[...\]" - else - dat += "[flavor_text]" - else - dat += "[TextPreview(flavor_text)]...
" - if(config.mutant_races)//really don't need this check, but fuck un-tabbing all those lines - dat += "

Body

" - dat += "Gender: [gender == MALE ? "Male" : "Female"]
" - dat += "Species:[pref_species.id]
" - dat += "Random Body
" - dat += "Always Random Body: [be_random_body ? "Yes" : "No"]
" - if((MUTCOLORS in pref_species.species_traits) || (MUTCOLORS_PARTSONLY in pref_species.species_traits)) - dat += "Primary Color:     Change
" - dat += "Secondary Color:     Change
" - dat += "Tertiary Color:     Change
" - if(pref_species.use_skintones) - dat += "Skin Tone: [skin_tone]
" - dat += "Genitals Use Skintone:[features["genitals_use_skintone"] == TRUE ? "Enabled" : "Disabled"]
" - - if(HAIR in pref_species.species_traits) - dat += "Hair Style: [hair_style]
" - dat += "Hair Color:     Change
" - dat += "Facial Hair Style: [facial_hair_style]
" - dat += "Facial Hair Color:     Change
" - if(EYECOLOR in pref_species.species_traits) - dat += "Eye Color:     Change
" - if("tail_lizard" in pref_species.mutant_bodyparts) - dat += "Tail: [features["tail_lizard"]]
" - else if("mam_tail" in pref_species.mutant_bodyparts) - dat += "Tail: [features["mam_tail"]]
" - else if("tail_human" in pref_species.mutant_bodyparts) - dat += "Tail: [features["tail_human"]]
" - if("snout" in pref_species.mutant_bodyparts) - dat += "Snout: [features["snout"]]
" - if("horns" in pref_species.mutant_bodyparts) - dat += "Snout: [features["horns"]]
" - if("frills" in pref_species.mutant_bodyparts) - dat += "Frills: [features["frills"]]
" - if("spines" in pref_species.mutant_bodyparts) - dat += "Spines: [features["spines"]]
" - if("body_markings" in pref_species.mutant_bodyparts) - dat += "Body Markings: [features["body_markings"]]
" - else if("mam_body_markings" in pref_species.mutant_bodyparts) - dat += "Body Markings: [features["mam_body_markings"]]
" - if("mam_ears" in pref_species.mutant_bodyparts) - dat += "Ears: [features["mam_ears"]]
" - else if("ears" in pref_species.mutant_bodyparts) - dat += "Ears: [features["ears"]]
" - if("legs" in pref_species.mutant_bodyparts) - dat += "Legs: [features["legs"]]
" - if("taur" in pref_species.mutant_bodyparts) - dat += "Taur: [features["taur"]]
" - if("wings" in pref_species.mutant_bodyparts && GLOB.r_wings_list.len >1) - dat += "Wings: [features["wings"]]
" - if("xenohead" in pref_species.mutant_bodyparts) - dat += "Caste: [features["xenohead"]]
" - if("xenotail" in pref_species.mutant_bodyparts) - dat += "Tail: [features["xenotail"]]
" - if("xenodorsal" in pref_species.mutant_bodyparts) - dat += "Dorsal Tubes: [features["xenodorsal"]]
" - - dat += "
" - - - dat += "

Clothing & Equipment

" -//underwear will be refactored later so it fits in with other wearable equipment and isn't just an overlay -// dat += "Underwear:[underwear]
" -// dat += "Undershirt:[undershirt]
" -// dat += "Socks:[socks]
" - dat += "Backpack:[backbag]
" - dat += "Uplink Location:[uplink_spawn_loc]
" - - dat += "

Genitals

" - if(NOGENITALS in pref_species.species_traits) - dat += "Your species ([pref_species.name]) does not support genitals!
" - else - dat += "Has Penis:[features["has_cock"] == TRUE ? "Yes" : "No"]
" - if(features["has_cock"] == TRUE) - if(pref_species.use_skintones && features["genitals_use_skintone"] == TRUE) - dat += "Penis Color:   (Skin tone overriding)
" - else - dat += "Penis Color:    Change
" -// dat += "
" - dat += "Penis Shape: [features["cock_shape"]]
" - dat += "Penis Length: [features["cock_length"]] inch(es)
" - dat += "Has Testicles:[features["has_balls"] == TRUE ? "Yes" : "No"]
" - if(features["has_balls"] == TRUE) - if(pref_species.use_skintones && features["genitals_use_skintone"] == TRUE) - dat += "Testicles Color:   (Skin tone overriding)
" - else - dat += "Testicles Color:    Change
" - dat += "Has Vagina:[features["has_vag"] == TRUE ? "Yes" : "No"]
" - if(features["has_vag"]) - dat += "Vagina Type: [features["vag_shape"]]
" - if(pref_species.use_skintones && features["genitals_use_skintone"] == TRUE) - dat += "Vagina Color:   (Skin tone overriding)
" - else - dat += "Vagina Color:    Change
" - dat += "Has Womb:[features["has_womb"] == TRUE ? "Yes" : "No"]
" - dat += "Has Breasts:[features["has_breasts"] == TRUE ? "Yes" : "No"]
" - if(features["has_breasts"]) - if(pref_species.use_skintones && features["genitals_use_skintone"] == TRUE) - dat += "Color:   (Skin tone overriding)
" - else - dat += "Color:    Change
" - dat += "Cup Size:[features["breasts_size"]]
" - dat += "Breast Shape:[features["breasts_shape"]]
" - /* - dat += "

Ovipositor

" - dat += "Has Ovipositor:[features["has_ovi"] == TRUE ? "Yes" : "No"]" - if(features["has_ovi"]) - dat += "Ovi Color:    Change" - dat += "

Eggsack

" - dat += "Has Eggsack:[features["has_eggsack"] == TRUE ? "Yes" : "No"]
" - if(features["has_eggsack"] == TRUE) - dat += "Color:    Change" - dat += "Egg Color:    Change" - dat += "Egg Size:[features["eggsack_egg_size"]]\" Diameter" - - dat += "
" - dat += "
" - - if(!IsGuestKey(user.key)) - dat += "Undo " - dat += "Save Setup " - - dat += "Reset Setup" - dat += "
" - - var/datum/browser/popup = new(user, "preferences", "
Character Setup
", 640, 770) - popup.set_content(dat) - popup.open(0) - -/datum/preferences/proc/SetChoices(mob/user, limit = 17, list/splitJobs = list("Chief Engineer"), widthPerColumn = 295, height = 620) - if(!SSjob) - return - - //limit - The amount of jobs allowed per column. Defaults to 17 to make it look nice. - //splitJobs - Allows you split the table by job. You can make different tables for each department by including their heads. Defaults to CE to make it look nice. - //widthPerColumn - Screen's width for every column. - //height - Screen's height. - - var/width = widthPerColumn - - var/HTML = "
" - if(SSjob.occupations.len <= 0) - HTML += "The job ticker is not yet finished creating jobs, please try again later" - HTML += "
Done

" // Easier to press up here. - - else - HTML += "Choose occupation chances
" - HTML += "
Left-click to raise an occupation preference, right-click to lower it.
" - HTML += "
Done

" // Easier to press up here. - HTML += "" - HTML += "
" // Table within a table for alignment, also allows you to easily add more colomns. - HTML += "" - var/index = -1 - - //The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows. - var/datum/job/lastJob - - for(var/datum/job/job in SSjob.occupations) - - index += 1 - if((index >= limit) || (job.title in splitJobs)) - width += widthPerColumn - if((index < limit) && (lastJob != null)) - //If the cells were broken up by a job in the splitJob list then it will fill in the rest of the cells with - //the last job's selection color. Creating a rather nice effect. - for(var/i = 0, i < (limit - index), i += 1) - HTML += "" - HTML += "
  
" - index = 0 - - HTML += "" - continue - if(!job.player_old_enough(user.client)) - var/available_in_days = job.available_in_days(user.client) - HTML += "[rank]" - continue - if((job_civilian_low & ASSISTANT) && (rank != "Assistant") && !jobban_isbanned(user, "Assistant")) - HTML += "[rank]" - continue - if(config.enforce_human_authority && !user.client.prefs.pref_species.qualifies_for_rank(rank, user.client.prefs.features)) - if(user.client.prefs.pref_species.id == "human") - HTML += "[rank]" - else - HTML += "[rank]" - continue - if((rank in GLOB.command_positions) || (rank == "AI"))//Bold head jobs - HTML += "[rank]" - else - HTML += "[rank]" - - HTML += "" - continue - - HTML += "[prefLevelLabel]" - HTML += "" - - for(var/i = 1, i < (limit - index), i += 1) // Finish the column so it is even - HTML += "" - - HTML += "
" - var/rank = job.title - lastJob = job - if(jobban_isbanned(user, rank)) - HTML += "[rank] BANNED
\[IN [(available_in_days)] DAYS\]
\[MUTANT\]
\[NON-HUMAN\]
" - - var/prefLevelLabel = "ERROR" - var/prefLevelColor = "pink" - var/prefUpperLevel = -1 // level to assign on left click - var/prefLowerLevel = -1 // level to assign on right click - - if(GetJobDepartment(job, 1) & job.flag) - prefLevelLabel = "High" - prefLevelColor = "slateblue" - prefUpperLevel = 4 - prefLowerLevel = 2 - else if(GetJobDepartment(job, 2) & job.flag) - prefLevelLabel = "Medium" - prefLevelColor = "green" - prefUpperLevel = 1 - prefLowerLevel = 3 - else if(GetJobDepartment(job, 3) & job.flag) - prefLevelLabel = "Low" - prefLevelColor = "orange" - prefUpperLevel = 2 - prefLowerLevel = 4 - else - prefLevelLabel = "NEVER" - prefLevelColor = "red" - prefUpperLevel = 3 - prefLowerLevel = 1 - - - HTML += "" - - if(rank == "Assistant")//Assistant is special - if(job_civilian_low & ASSISTANT) - HTML += "Yes" - else - HTML += "No" - HTML += "
  
" - HTML += "
" - - var/message = "Be an Assistant if preferences unavailable" - if(joblessrole == BERANDOMJOB) - message = "Get random job if preferences unavailable" - else if(joblessrole == RETURNTOLOBBY) - message = "Return to lobby if preferences unavailable" - HTML += "

[message]
" - HTML += "
Reset Preferences
" - - user << browse(null, "window=preferences") - var/datum/browser/popup = new(user, "mob_occupation", "
Occupation Preferences
", width, height) - popup.set_window_options("can_close=0") - popup.set_content(HTML) - popup.open(0) - return - -/datum/preferences/proc/SetJobPreferenceLevel(datum/job/job, level) - if (!job) - return 0 - - if (level == 1) // to high - // remove any other job(s) set to high - job_civilian_med |= job_civilian_high - job_engsec_med |= job_engsec_high - job_medsci_med |= job_medsci_high - job_civilian_high = 0 - job_engsec_high = 0 - job_medsci_high = 0 - - if (job.department_flag == CIVILIAN) - job_civilian_low &= ~job.flag - job_civilian_med &= ~job.flag - job_civilian_high &= ~job.flag - - switch(level) - if (1) - job_civilian_high |= job.flag - if (2) - job_civilian_med |= job.flag - if (3) - job_civilian_low |= job.flag - - return 1 - else if (job.department_flag == ENGSEC) - job_engsec_low &= ~job.flag - job_engsec_med &= ~job.flag - job_engsec_high &= ~job.flag - - switch(level) - if (1) - job_engsec_high |= job.flag - if (2) - job_engsec_med |= job.flag - if (3) - job_engsec_low |= job.flag - - return 1 - else if (job.department_flag == MEDSCI) - job_medsci_low &= ~job.flag - job_medsci_med &= ~job.flag - job_medsci_high &= ~job.flag - - switch(level) - if (1) - job_medsci_high |= job.flag - if (2) - job_medsci_med |= job.flag - if (3) - job_medsci_low |= job.flag - - return 1 - - return 0 - -/datum/preferences/proc/UpdateJobPreference(mob/user, role, desiredLvl) - if(!SSjob || SSjob.occupations.len <= 0) - return - var/datum/job/job = SSjob.GetJob(role) - - if(!job) - user << browse(null, "window=mob_occupation") - ShowChoices(user) - return - - if (!isnum(desiredLvl)) - to_chat(user, "UpdateJobPreference - desired level was not a number. Please notify coders!") - ShowChoices(user) - return - - if(role == "Assistant") - if(job_civilian_low & job.flag) - job_civilian_low &= ~job.flag - else - job_civilian_low |= job.flag - SetChoices(user) - return 1 - - SetJobPreferenceLevel(job, desiredLvl) - SetChoices(user) - - return 1 - - -/datum/preferences/proc/ResetJobs() - - job_civilian_high = 0 - job_civilian_med = 0 - job_civilian_low = 0 - - job_medsci_high = 0 - job_medsci_med = 0 - job_medsci_low = 0 - - job_engsec_high = 0 - job_engsec_med = 0 - job_engsec_low = 0 - - -/datum/preferences/proc/GetJobDepartment(datum/job/job, level) - if(!job || !level) - return 0 - switch(job.department_flag) - if(CIVILIAN) - switch(level) - if(1) - return job_civilian_high - if(2) - return job_civilian_med - if(3) - return job_civilian_low - if(MEDSCI) - switch(level) - if(1) - return job_medsci_high - if(2) - return job_medsci_med - if(3) - return job_medsci_low - if(ENGSEC) - switch(level) - if(1) - return job_engsec_high - if(2) - return job_engsec_med - if(3) - return job_engsec_low - return 0 - -/datum/preferences/proc/process_link(mob/user, list/href_list) - if(href_list["jobbancheck"]) - var/job = sanitizeSQL(href_list["jobbancheck"]) - var/sql_ckey = sanitizeSQL(user.ckey) - var/datum/DBQuery/query_get_jobban = SSdbcore.NewQuery("SELECT reason, bantime, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey = '[sql_ckey]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned) AND job = '[job]'") - if(!query_get_jobban.warn_execute()) - return - if(query_get_jobban.NextRow()) - var/reason = query_get_jobban.item[1] - var/bantime = query_get_jobban.item[2] - var/duration = query_get_jobban.item[3] - var/expiration_time = query_get_jobban.item[4] - var/a_ckey = query_get_jobban.item[5] - var/text - text = "You, or another user of this computer, ([user.ckey]) is banned from playing [job]. The ban reason is:
[reason]
This ban was applied by [a_ckey] on [bantime]" - if(text2num(duration) > 0) - text += ". The ban is for [duration] minutes and expires on [expiration_time] (server time)" - text += ".
" - to_chat(user, text) - return - - if(href_list["preference"] == "job") - switch(href_list["task"]) - if("close") - user << browse(null, "window=mob_occupation") - ShowChoices(user) - if("reset") - ResetJobs() - SetChoices(user) - if("random") - switch(joblessrole) - if(RETURNTOLOBBY) - if(jobban_isbanned(user, "Assistant")) - joblessrole = BERANDOMJOB - else - joblessrole = BEASSISTANT - if(BEASSISTANT) - joblessrole = BERANDOMJOB - if(BERANDOMJOB) - joblessrole = RETURNTOLOBBY - SetChoices(user) - if("setJobLevel") - UpdateJobPreference(user, href_list["text"], text2num(href_list["level"])) - else - SetChoices(user) - return 1 - - switch(href_list["task"]) - if("random") - switch(href_list["preference"]) - if("name") - real_name = pref_species.random_name(gender,1) - if("age") - age = rand(AGE_MIN, AGE_MAX) - if("hair") - hair_color = random_short_color() - if("hair_style") - hair_style = random_hair_style(gender) - if("facial") - facial_hair_color = random_short_color() - if("facial_hair_style") - facial_hair_style = random_facial_hair_style(gender) - if("underwear") - underwear = random_underwear(gender) - if("undershirt") - undershirt = random_undershirt(gender) - if("socks") - socks = random_socks() - if("eyes") - eye_color = random_eye_color() - if("s_tone") - skin_tone = random_skin_tone() - if("bag") - backbag = pick(GLOB.backbaglist) - if("all") - random_character() - - if("input") - switch(href_list["preference"]) - if("ghostform") - if(unlock_content) - var/new_form = input(user, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND",null) as null|anything in GLOB.ghost_forms - if(new_form) - ghost_form = new_form - if("ghostorbit") - if(unlock_content) - var/new_orbit = input(user, "Thanks for supporting BYOND - Choose your ghostly orbit:","Thanks for supporting BYOND", null) as null|anything in GLOB.ghost_orbits - if(new_orbit) - ghost_orbit = new_orbit - - if("ghostaccs") - var/new_ghost_accs = alert("Do you want your ghost to show full accessories where possible, hide accessories but still use the directional sprites where possible, or also ignore the directions and stick to the default sprites?",,GHOST_ACCS_FULL_NAME, GHOST_ACCS_DIR_NAME, GHOST_ACCS_NONE_NAME) - switch(new_ghost_accs) - if(GHOST_ACCS_FULL_NAME) - ghost_accs = GHOST_ACCS_FULL - if(GHOST_ACCS_DIR_NAME) - ghost_accs = GHOST_ACCS_DIR - if(GHOST_ACCS_NONE_NAME) - ghost_accs = GHOST_ACCS_NONE - - if("ghostothers") - var/new_ghost_others = alert("Do you want the ghosts of others to show up as their own setting, as their default sprites or always as the default white ghost?",,GHOST_OTHERS_THEIR_SETTING_NAME, GHOST_OTHERS_DEFAULT_SPRITE_NAME, GHOST_OTHERS_SIMPLE_NAME) - switch(new_ghost_others) - if(GHOST_OTHERS_THEIR_SETTING_NAME) - ghost_others = GHOST_OTHERS_THEIR_SETTING - if(GHOST_OTHERS_DEFAULT_SPRITE_NAME) - ghost_others = GHOST_OTHERS_DEFAULT_SPRITE - if(GHOST_OTHERS_SIMPLE_NAME) - ghost_others = GHOST_OTHERS_SIMPLE - - if("name") - var/new_name = reject_bad_name( input(user, "Choose your character's name:", "Character Preference") as text|null ) - if(new_name) - real_name = new_name - else - to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") - - if("age") - var/new_age = input(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference") as num|null - if(new_age) - age = max(min( round(text2num(new_age)), AGE_MAX),AGE_MIN) - - if("flavor_text") - var/msg = input(usr,"Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!","Flavor Text",html_decode(flavor_text)) as message - if(msg != null) - msg = copytext(msg, 1, MAX_MESSAGE_LEN) - msg = html_encode(msg) - flavor_text = msg - - if("metadata") - var/new_metadata = input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , metadata) as message|null - if(new_metadata) - metadata = sanitize(copytext(new_metadata,1,MAX_MESSAGE_LEN)) - - if("hair") - var/new_hair = input(user, "Choose your character's hair colour:", "Character Preference") as null|color - if(new_hair) - hair_color = sanitize_hexcolor(new_hair) - - - if("hair_style") - var/new_hair_style - if(gender == MALE) - new_hair_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in GLOB.hair_styles_male_list - else - new_hair_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in GLOB.hair_styles_female_list - if(new_hair_style) - hair_style = new_hair_style - - if("next_hair_style") - if (gender == MALE) - hair_style = next_list_item(hair_style, GLOB.hair_styles_male_list) - else - hair_style = next_list_item(hair_style, GLOB.hair_styles_female_list) - - if("previous_hair_style") - if (gender == MALE) - hair_style = previous_list_item(hair_style, GLOB.hair_styles_male_list) - else - hair_style = previous_list_item(hair_style, GLOB.hair_styles_female_list) - - if("facial") - var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference") as null|color - if(new_facial) - facial_hair_color = sanitize_hexcolor(new_facial) - - if("facial_hair_style") - var/new_facial_hair_style - if(gender == MALE) - new_facial_hair_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in GLOB.facial_hair_styles_male_list - else - new_facial_hair_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in GLOB.facial_hair_styles_female_list - if(new_facial_hair_style) - facial_hair_style = new_facial_hair_style - - if("next_facehair_style") - if (gender == MALE) - facial_hair_style = next_list_item(facial_hair_style, GLOB.facial_hair_styles_male_list) - else - facial_hair_style = next_list_item(facial_hair_style, GLOB.facial_hair_styles_female_list) - - if("previous_facehair_style") - if (gender == MALE) - facial_hair_style = previous_list_item(facial_hair_style, GLOB.facial_hair_styles_male_list) - else - facial_hair_style = previous_list_item(facial_hair_style, GLOB.facial_hair_styles_female_list) - - if("underwear") - var/new_underwear - if(gender == MALE) - new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in GLOB.underwear_m - else - new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in GLOB.underwear_f - if(new_underwear) - underwear = new_underwear - - if("undershirt") - var/new_undershirt - if(gender == MALE) - new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in GLOB.undershirt_m - else - new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in GLOB.undershirt_f - if(new_undershirt) - undershirt = new_undershirt - - if("socks") - var/new_socks - new_socks = input(user, "Choose your character's socks:", "Character Preference") as null|anything in GLOB.socks_list - if(new_socks) - socks = new_socks - - if("eyes") - var/new_eyes = input(user, "Choose your character's eye colour:", "Character Preference") as color|null - if(new_eyes) - eye_color = sanitize_hexcolor(new_eyes) - - if("species") - - var/result = input(user, "Select a species", "Species Selection") as null|anything in GLOB.roundstart_species - - if(result) - var/newtype = GLOB.roundstart_species[result] - pref_species = new newtype() - //Now that we changed our species, we must verify that the mutant colour is still allowed. - var/temp_hsv = RGBtoHSV(features["mcolor"]) - if(features["mcolor"] == "#000" || (!(MUTCOLORS_PARTSONLY in pref_species.species_traits) && ReadHSV(temp_hsv)[3] < ReadHSV("#202020")[3])) - features["mcolor"] = pref_species.default_color - if(features["mcolor2"] == "#000" || (!(MUTCOLORS_PARTSONLY in pref_species.species_traits) && ReadHSV(temp_hsv)[3] < ReadHSV("#202020")[3])) - features["mcolor2"] = pref_species.default_color - if(features["mcolor3"] == "#000" || (!(MUTCOLORS_PARTSONLY in pref_species.species_traits) && ReadHSV(temp_hsv)[3] < ReadHSV("#202020")[3])) - features["mcolor3"] = pref_species.default_color - - if("mutant_color") - var/new_mutantcolor = input(user, "Choose your character's primary alien/mutant color:", "Character Preference") as color|null - if(new_mutantcolor) - var/temp_hsv = RGBtoHSV(new_mutantcolor) - if(new_mutantcolor == "#000000") - features["mcolor"] = pref_species.default_color - else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) // mutantcolors must be bright, but only if they affect the skin - features["mcolor"] = sanitize_hexcolor(new_mutantcolor) - else - to_chat(user, "Invalid color. Your color is not bright enough.") - - if("mutant_color2") - var/new_mutantcolor = input(user, "Choose your character's secondary alien/mutant color:", "Character Preference") as color|null - if(new_mutantcolor) - var/temp_hsv = RGBtoHSV(new_mutantcolor) - if(new_mutantcolor == "#000000") - features["mcolor2"] = pref_species.default_color - else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) // mutantcolors must be bright, but only if they affect the skin - features["mcolor2"] = sanitize_hexcolor(new_mutantcolor) - else - to_chat(user, "Invalid color. Your color is not bright enough.") - - if("mutant_color3") - var/new_mutantcolor = input(user, "Choose your character's tertiary alien/mutant color:", "Character Preference") as color|null - if(new_mutantcolor) - var/temp_hsv = RGBtoHSV(new_mutantcolor) - if(new_mutantcolor == "#000000") - features["mcolor3"] = pref_species.default_color - else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) // mutantcolors must be bright, but only if they affect the skin - features["mcolor3"] = sanitize_hexcolor(new_mutantcolor) - else - to_chat(user, "Invalid color. Your color is not bright enough.") - - if("tail_lizard") - var/new_tail - new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.tails_list_lizard - if(new_tail) - features["tail_lizard"] = new_tail - if(new_tail != "None") - features["taur"] = "None" - - if("tail_human") - var/new_tail - new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.tails_list_human - if(new_tail) - features["tail_human"] = new_tail - if(new_tail != "None") - features["taur"] = "None" - if("mam_tail") - var/new_tail - new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.mam_tails_list - if(new_tail) - features["mam_tail"] = new_tail - if(new_tail != "None") - features["taur"] = "None" - - if("taur") - var/new_taur - new_taur = input(user, "Choose your character's tauric body:", "Character Preference") as null|anything in GLOB.taur_list - if(new_taur) - features["taur"] = new_taur - if(new_taur != "None") - features["mam_tail"] = "None" - features["xenotail"] = "None" - -/* Doesn't exist yet. will include facial overlays to mimic 5th port species heads. - if("mam_snout") - var/new_snout - new_snout = input(user, "Choose your character's snout:", "Character Preference") as null|anything in GLOB.mam_snouts_list - if(new_snout) - features["snout"] = new_snout -*/ - - if("snout") - var/new_snout - new_snout = input(user, "Choose your character's snout:", "Character Preference") as null|anything in GLOB.snouts_list - if(new_snout) - features["snout"] = new_snout - - if("horns") - var/new_horns - new_horns = input(user, "Choose your character's horns:", "Character Preference") as null|anything in GLOB.horns_list - if(new_horns) - features["horns"] = new_horns - - if("mam_ears") - var/new_ears - new_ears = input(user, "Choose your character's ears:", "Character Preference") as null|anything in GLOB.mam_ears_list - if(new_ears) - features["mam_ears"] = new_ears - - if("ears") - var/new_ears - new_ears = input(user, "Choose your character's ears:", "Character Preference") as null|anything in GLOB.ears_list - if(new_ears) - features["ears"] = new_ears - - if("wings") - var/new_wings - new_wings = input(user, "Choose your character's wings:", "Character Preference") as null|anything in GLOB.r_wings_list - if(new_wings) - features["wings"] = new_wings - - if("frills") - var/new_frills - new_frills = input(user, "Choose your character's frills:", "Character Preference") as null|anything in GLOB.frills_list - if(new_frills) - features["frills"] = new_frills - - if("spines") - var/new_spines - new_spines = input(user, "Choose your character's spines:", "Character Preference") as null|anything in GLOB.spines_list - if(new_spines) - features["spines"] = new_spines - - if("body_markings") - var/new_body_markings - new_body_markings = input(user, "Choose your character's body markings:", "Character Preference") as null|anything in GLOB.body_markings_list - if(new_body_markings) - features["body_markings"] = new_body_markings - - if("mam_body_markings") - var/new_mam_body_markings - new_mam_body_markings = input(user, "Choose your character's body markings:", "Character Preference") as null|anything in GLOB.mam_body_markings_list - if(new_mam_body_markings) - features["mam_body_markings"] = new_mam_body_markings - - //Xeno Bodyparts - if("xenohead")//Head or caste type - var/new_head - new_head = input(user, "Choose your character's caste:", "Character Preference") as null|anything in GLOB.xeno_head_list - if(new_head) - features["xenohead"] = new_head - - if("xenotail")//Currently one one type, more maybe later if someone sprites them. Might include animated variants in the future. - var/new_tail - new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.xeno_tail_list - if(new_tail) - features["xenotail"] = new_tail - - if("xenodorsal") - var/new_dors - new_dors = input(user, "Choose your character's dorsal tube type:", "Character Preference") as null|anything in GLOB.xeno_dorsal_list - if(new_dors) - features["xenodorsal"] = new_dors - - if("legs") - var/new_legs - new_legs = input(user, "Choose your character's legs:", "Character Preference") as null|anything in GLOB.legs_list - if(new_legs) - features["legs"] = new_legs - - if("s_tone") - var/new_s_tone = input(user, "Choose your character's skin-tone:", "Character Preference") as null|anything in GLOB.skin_tones - if(new_s_tone) - skin_tone = new_s_tone - - if("ooccolor") - var/new_ooccolor = input(user, "Choose your OOC colour:", "Game Preference") as color|null - if(new_ooccolor) - ooccolor = sanitize_ooccolor(new_ooccolor) - - if("bag") - var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in GLOB.backbaglist - if(new_backbag) - backbag = new_backbag - - if("uplink_loc") - var/new_loc = input(user, "Choose your character's traitor uplink spawn location:", "Character Preference") as null|anything in GLOB.uplink_spawn_loc_list - if(new_loc) - uplink_spawn_loc = new_loc - - if("clown_name") - var/new_clown_name = reject_bad_name( input(user, "Choose your character's clown name:", "Character Preference") as text|null ) - if(new_clown_name) - custom_names["clown"] = new_clown_name - else - to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") - - if("mime_name") - var/new_mime_name = reject_bad_name( input(user, "Choose your character's mime name:", "Character Preference") as text|null ) - if(new_mime_name) - custom_names["mime"] = new_mime_name - else - to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") - - if("ai_name") - var/new_ai_name = reject_bad_name( input(user, "Choose your character's AI name:", "Character Preference") as text|null, 1 ) - if(new_ai_name) - custom_names["ai"] = new_ai_name - else - to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, 0-9, -, ' and .") - - if("cyborg_name") - var/new_cyborg_name = reject_bad_name( input(user, "Choose your character's cyborg name:", "Character Preference") as text|null, 1 ) - if(new_cyborg_name) - custom_names["cyborg"] = new_cyborg_name - else - to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, 0-9, -, ' and .") - - if("religion_name") - var/new_religion_name = reject_bad_name( input(user, "Choose your character's religion:", "Character Preference") as text|null ) - if(new_religion_name) - custom_names["religion"] = new_religion_name - else - to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") - - if("deity_name") - var/new_deity_name = reject_bad_name( input(user, "Choose your character's deity:", "Character Preference") as text|null ) - if(new_deity_name) - custom_names["deity"] = new_deity_name - else - to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") - - if("sec_dept") - var/department = input(user, "Choose your prefered security department:", "Security Departments") as null|anything in GLOB.security_depts_prefs - if(department) - prefered_security_department = department - - if ("preferred_map") - var/maplist = list() - var/default = "Default" - if (config.defaultmap) - default += " ([config.defaultmap.map_name])" - for (var/M in config.maplist) - var/datum/map_config/VM = config.maplist[M] - var/friendlyname = "[VM.map_name] " - if (VM.voteweight <= 0) - friendlyname += " (disabled)" - maplist[friendlyname] = VM.map_name - maplist[default] = null - var/pickedmap = input(user, "Choose your preferred map. This will be used to help weight random map selection.", "Character Preference") as null|anything in maplist - if (pickedmap) - preferred_map = maplist[pickedmap] - - if ("clientfps") - var/version_message - if (user.client && user.client.byond_version < 511) - version_message = "\nYou need to be using byond version 511 or later to take advantage of this feature, your version of [user.client.byond_version] is too low" - if (world.byond_version < 511) - version_message += "\nThis server does not currently support client side fps. You can set now for when it does." - var/desiredfps = input(user, "Choose your desired fps.[version_message]\n(0 = synced with server tick rate (currently:[world.fps]))", "Character Preference", clientfps) as null|num - if (!isnull(desiredfps)) - clientfps = desiredfps - if (world.byond_version >= 511 && user.client && user.client.byond_version >= 511) - user.client.vars["fps"] = clientfps - if("ui") - var/pickedui = input(user, "Choose your UI style.", "Character Preference") as null|anything in list("Midnight", "Plasmafire", "Retro", "Slimecore", "Operative", "Clockwork") - if(pickedui) - UI_style = pickedui - - //citadel code - if("cock_color") - var/new_cockcolor = input(user, "Penis color:", "Character Preference") as color|null - if(new_cockcolor) - var/temp_hsv = RGBtoHSV(new_cockcolor) - if(new_cockcolor == "#000000") - features["cock_color"] = pref_species.default_color - else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) - features["cock_color"] = sanitize_hexcolor(new_cockcolor) - else - user << "Invalid color. Your color is not bright enough." - - if("cock_length") - var/new_length = input(user, "Penis length in inches:\n([COCK_SIZE_MIN]-[COCK_SIZE_MAX])", "Character Preference") as num|null - if(new_length) - features["cock_length"] = max(min( round(text2num(new_length)), COCK_SIZE_MAX),COCK_SIZE_MIN) - - if("cock_shape") - var/new_shape - new_shape = input(user, "Penis shape:", "Character Preference") as null|anything in GLOB.cock_shapes_list - if(new_shape) - features["cock_shape"] = new_shape - - if("balls_color") - var/new_ballscolor = input(user, "Testicle Color:", "Character Preference") as color|null - if(new_ballscolor) - var/temp_hsv = RGBtoHSV(new_ballscolor) - if(new_ballscolor == "#000000") - features["balls_color"] = pref_species.default_color - else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) - features["balls_color"] = sanitize_hexcolor(new_ballscolor) - else - user << "Invalid color. Your color is not bright enough." - - if("egg_size") - var/new_size - var/list/egg_sizes = list(1,2,3) - new_size = input(user, "Egg Diameter(inches):", "Egg Size") as null|anything in egg_sizes - if(new_size) - features["eggsack_egg_size"] = new_size - - if("egg_color") - var/new_egg_color = input(user, "Egg Color:", "Character Preference") as color|null - if(new_egg_color) - var/temp_hsv = RGBtoHSV(new_egg_color) - if(ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) - features["eggsack_egg_color"] = sanitize_hexcolor(new_egg_color) - else - user << "Invalid color. Your color is not bright enough." - if("breasts_size") - var/new_size - new_size = input(user, "Breast Size", "Character Preference") as null|anything in GLOB.breasts_size_list - if(new_size) - features["breasts_size"] = new_size - - if("breasts_shape") - var/new_shape - new_shape = input(user, "Breast Shape", "Character Preference") as null|anything in GLOB.breasts_shapes_list - if(new_shape) - features["breasts_shape"] = new_shape - - if("breasts_color") - var/new_breasts_color = input(user, "Breast Color:", "Character Preference") as color|null - if(new_breasts_color) - var/temp_hsv = RGBtoHSV(new_breasts_color) - if(new_breasts_color == "#000000") - features["breasts_color"] = pref_species.default_color - else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) - features["breasts_color"] = sanitize_hexcolor(new_breasts_color) - else - user << "Invalid color. Your color is not bright enough." - if("vag_shape") - var/new_shape - new_shape = input(user, "Vagina Type", "Character Preference") as null|anything in GLOB.vagina_shapes_list - if(new_shape) - features["vag_shape"] = new_shape - if("vag_color") - var/new_vagcolor = input(user, "Vagina color:", "Character Preference") as color|null - if(new_vagcolor) - var/temp_hsv = RGBtoHSV(new_vagcolor) - if(new_vagcolor == "#000000") - features["vag_color"] = pref_species.default_color - else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) - features["vag_color"] = sanitize_hexcolor(new_vagcolor) - else - user << "Invalid color. Your color is not bright enough." - - else - switch(href_list["preference"]) - - //citadel code - if("genital_colour") - switch(features["genitals_use_skintone"]) - if(TRUE) - features["genitals_use_skintone"] = FALSE - if(FALSE) - features["genitals_use_skintone"] = TRUE - else - features["genitals_use_skintone"] = FALSE - if("arousable") - switch(arousable) - if(TRUE) - arousable = FALSE - if(FALSE) - arousable = TRUE - else//failsafe - arousable = FALSE - if("has_cock") - switch(features["has_cock"]) - if(TRUE) - features["has_cock"] = FALSE - if(FALSE) - features["has_cock"] = TRUE - features["has_ovi"] = FALSE - features["has_eggsack"] = FALSE - else - features["has_cock"] = FALSE - features["has_ovi"] = FALSE - if("has_balls") - switch(features["has_balls"]) - if(TRUE) - features["has_balls"] = FALSE - if(FALSE) - features["has_balls"] = TRUE - features["has_eggsack"] = FALSE - else - features["has_balls"] = FALSE - features["has_eggsack"] = FALSE - - if("has_ovi") - switch(features["has_ovi"]) - if(TRUE) - features["has_ovi"] = FALSE - if(FALSE) - features["has_ovi"] = TRUE - features["has_cock"] = FALSE - features["has_balls"] = FALSE - else - features["has_ovi"] = FALSE - features["has_cock"] = FALSE - - if("has_eggsack") - switch(features["has_eggsack"]) - if(TRUE) - features["has_eggsack"] = FALSE - if(FALSE) - features["has_eggsack"] = TRUE - features["has_balls"] = FALSE - else - features["has_eggsack"] = FALSE - features["has_balls"] = FALSE - - if("balls_internal") - switch(features["balls_internal"]) - if(TRUE) - features["balls_internal"] = FALSE - if(FALSE) - features["balls_internal"] = TRUE - features["eggsack_internal"] = FALSE - else - features["balls_internal"] = FALSE - features["eggsack_internal"] = FALSE - - if("eggsack_internal") - switch(features["eggsack_internal"]) - if(TRUE) - features["eggsack_internal"] = FALSE - if(FALSE) - features["eggsack_internal"] = TRUE - features["balls_internal"] = FALSE - else - features["eggsack_internal"] = FALSE - features["balls_internal"] = FALSE - - if("has_breasts") - switch(features["has_breasts"]) - if(TRUE) - features["has_breasts"] = FALSE - if(FALSE) - features["has_breasts"] = TRUE - else - features["has_breasts"] = FALSE - if("has_vag") - switch(features["has_vag"]) - if(TRUE) - features["has_vag"] = FALSE - if(FALSE) - features["has_vag"] = TRUE - else - features["has_vag"] = FALSE - if("has_womb") - switch(features["has_womb"]) - if(TRUE) - features["has_womb"] = FALSE - if(FALSE) - features["has_womb"] = TRUE - else - features["has_womb"] = FALSE - if("exhibitionist") - switch(features["exhibitionist"]) - if(TRUE) - features["exhibitionist"] = FALSE - if(FALSE) - features["exhibitionist"] = TRUE - else - features["exhibitionist"] = FALSE - - if("publicity") - if(unlock_content) - toggles ^= MEMBER_PUBLIC - if("gender") - if(gender == MALE) - gender = FEMALE - else - gender = MALE - underwear = "Nude" - undershirt = "Nude" - socks = "Nude" - facial_hair_style = "Shaved" - hair_style = "Bald" - - if("hotkeys") - hotkeys = !hotkeys - - if("tgui_fancy") - tgui_fancy = !tgui_fancy - if("tgui_lock") - tgui_lock = !tgui_lock - if("winflash") - windowflashing = !windowflashing - if("hear_adminhelps") - toggles ^= SOUND_ADMINHELP - if("announce_login") - toggles ^= ANNOUNCE_LOGIN - - if("be_special") - var/be_special_type = href_list["be_special_type"] - if(be_special_type in be_special) - be_special -= be_special_type - else - be_special += be_special_type - - if("name") - be_random_name = !be_random_name - - if("all") - be_random_body = !be_random_body - - if("hear_midis") - toggles ^= SOUND_MIDI - - if("lobby_music") - toggles ^= SOUND_LOBBY - if((toggles & SOUND_LOBBY) && user.client) - user.client.playtitlemusic() - else - user.stop_sound_channel(CHANNEL_LOBBYMUSIC) - - if("ghost_ears") - chat_toggles ^= CHAT_GHOSTEARS - - if("ghost_sight") - chat_toggles ^= CHAT_GHOSTSIGHT - - if("ghost_whispers") - chat_toggles ^= CHAT_GHOSTWHISPER - - if("ghost_radio") - chat_toggles ^= CHAT_GHOSTRADIO - - if("ghost_pda") - chat_toggles ^= CHAT_GHOSTPDA - - if("pull_requests") - chat_toggles ^= CHAT_PULLR - - if("allow_midround_antag") - toggles ^= MIDROUND_ANTAG - - if("parallaxup") - parallax = Wrap(parallax + 1, PARALLAX_INSANE, PARALLAX_DISABLE + 1) - if (parent && parent.mob && parent.mob.hud_used) - parent.mob.hud_used.update_parallax_pref(parent.mob) - - if("parallaxdown") - parallax = Wrap(parallax - 1, PARALLAX_INSANE, PARALLAX_DISABLE + 1) - if (parent && parent.mob && parent.mob.hud_used) - parent.mob.hud_used.update_parallax_pref(parent.mob) - - if("save") - save_preferences() - save_character() - - if("load") - load_preferences() - load_character() - attempt_vr(parent.prefs_vr,"load_vore","") - - if("changeslot") - attempt_vr(parent.prefs_vr,"load_vore","") - if(!load_character(text2num(href_list["num"]))) - random_character() - real_name = random_unique_name(gender) - save_character() - - if("tab") - if (href_list["tab"]) - current_tab = text2num(href_list["tab"]) - - ShowChoices(user) - return 1 - -/datum/preferences/proc/copy_to(mob/living/carbon/human/character, icon_updates = 1) - if(be_random_name) - real_name = pref_species.random_name(gender) - - if(be_random_body) - random_character(gender) - - if(config.humans_need_surnames) - var/firstspace = findtext(real_name, " ") - var/name_length = length(real_name) - if(!firstspace) //we need a surname - real_name += " [pick(GLOB.last_names)]" - else if(firstspace == name_length) - real_name += "[pick(GLOB.last_names)]" - - character.real_name = real_name - character.name = character.real_name - - character.gender = gender - character.age = age - - character.eye_color = eye_color - var/obj/item/organ/eyes/organ_eyes = character.getorgan(/obj/item/organ/eyes) - if(organ_eyes) - if(!initial(organ_eyes.eye_color)) - organ_eyes.eye_color = eye_color - organ_eyes.old_eye_color = eye_color - character.hair_color = hair_color - character.facial_hair_color = facial_hair_color - - character.skin_tone = skin_tone - character.hair_style = hair_style - character.facial_hair_style = facial_hair_style - character.underwear = underwear - character.undershirt = undershirt - character.socks = socks - - character.backbag = backbag - - character.dna.features = features.Copy() - character.dna.real_name = character.real_name - var/datum/species/chosen_species - if(pref_species != /datum/species/human && config.mutant_races) - chosen_species = pref_species.type - else - chosen_species = /datum/species/human - character.set_species(chosen_species, icon_update=0) - - //citadel code - character.give_genitals() - character.flavor_text = flavor_text - character.canbearoused = arousable - - if(icon_updates) - character.update_body() - character.update_hair() - character.update_body_parts() + + +GLOBAL_LIST_EMPTY(preferences_datums) + + + +/datum/preferences + var/client/parent + //doohickeys for savefiles + var/path + var/default_slot = 1 //Holder so it doesn't default to slot 1, rather the last one used + var/max_save_slots = 10 + + //non-preference stuff + var/muted = 0 + var/last_ip + var/last_id + + //game-preferences + var/lastchangelog = "" //Saved changlog filesize to detect if there was a change + var/ooccolor = null + + //Antag preferences + var/list/be_special = list() //Special role selection + var/tmp/old_be_special = 0 //Bitflag version of be_special, used to update old savefiles and nothing more + //If it's 0, that's good, if it's anything but 0, the owner of this prefs file's antag choices were, + //autocorrected this round, not that you'd need to check that. + + + var/UI_style = "Midnight" + var/hotkeys = FALSE + var/tgui_fancy = TRUE + var/tgui_lock = TRUE + var/windowflashing = TRUE + var/toggles = TOGGLES_DEFAULT + var/chat_toggles = TOGGLES_DEFAULT_CHAT + var/ghost_form = "ghost" + var/ghost_orbit = GHOST_ORBIT_CIRCLE + var/ghost_accs = GHOST_ACCS_DEFAULT_OPTION + var/ghost_others = GHOST_OTHERS_DEFAULT_OPTION + var/ghost_hud = 1 + var/inquisitive_ghost = 1 + var/allow_midround_antag = 1 + var/preferred_map = null + + var/uses_glasses_colour = 0 + + //character preferences + var/real_name //our character's name + var/be_random_name = 0 //whether we'll have a random name every round + var/be_random_body = 0 //whether we'll have a random body every round + var/gender = MALE //gender of character (well duh) + var/age = 30 //age of character + var/underwear = "Nude" //underwear type + var/undershirt = "Nude" //undershirt type + var/socks = "Nude" //socks type + var/backbag = DBACKPACK //backpack type + var/hair_style = "Bald" //Hair type + var/hair_color = "000" //Hair color + var/facial_hair_style = "Shaved" //Face hair type + var/facial_hair_color = "000" //Facial hair color + var/skin_tone = "caucasian1" //Skin color + var/eye_color = "000" //Eye color + var/datum/species/pref_species = new /datum/species/human() //Mutant race + var/list/features = list("mcolor" = "FFF", + "mcolor2" = "FFF", + "mcolor3" = "FFF", + "tail_lizard" = "Smooth", + "tail_human" = "None", + "snout" = "Round", + "horns" = "None", + "ears" = "None", + "wings" = "None", + "frills" = "None", + "spines" = "None", + "body_markings" = "None", + "mam_body_markings" = "None", + "mam_ears" = "None", + "mam_tail" = "None", + "mam_tail_animated" = "None", + "xenodorsal" = "None", + "xenohead" = "None", + "xenotail" = "None", + "legs" = "Normal Legs", + "taur" = "None", + "exhibitionist" = FALSE, + "genitals_use_skintone" = FALSE, + "has_cock" = FALSE, + "cock_shape" = "Human", + "cock_length" = 6, + "cock_girth_ratio" = COCK_GIRTH_RATIO_DEF, + "cock_color" = "fff", + "has_sheath" = FALSE, + "sheath_color" = "fff", + "has_balls" = FALSE, + "balls_internal" = FALSE, + "balls_color" = "fff", + "balls_amount" = 2, + "balls_sack_size" = BALLS_SACK_SIZE_DEF, + "balls_size" = BALLS_SIZE_DEF, + "balls_cum_rate" = CUM_RATE, + "balls_cum_mult" = CUM_RATE_MULT, + "balls_efficiency" = CUM_EFFICIENCY, + "balls_fluid" = "semen", + "has_ovi" = FALSE, + "ovi_shape" = "knotted", + "ovi_length" = 6, + "ovi_color" = "fff", + "has_eggsack" = FALSE, + "eggsack_internal" = TRUE, + "eggsack_color" = "fff", + "eggsack_size" = BALLS_SACK_SIZE_DEF, + "eggsack_egg_color" = "fff", + "eggsack_egg_size" = EGG_GIRTH_DEF, + "has_breasts" = FALSE, + "breasts_color" = "fff", + "breasts_size" = "C", + "breasts_shape" = "Pair", + "breasts_fluid" = "milk", + "has_vag" = FALSE, + "vag_shape" = "Human", + "vag_color" = "fff", + "vag_clits" = 1, + "vag_clit_diam" = 0.25, + "vag_clit_len" = 0.25, + "has_womb" = FALSE, + "womb_cum_rate" = CUM_RATE, + "womb_cum_mult" = CUM_RATE_MULT, + "womb_efficiency" = CUM_EFFICIENCY, + "womb_fluid" = "femcum" + )//MAKE SURE TO UPDATE THE LIST IN MOBS.DM IF YOU'RE GOING TO ADD TO THIS LIST, OTHERWISE THINGS MIGHT GET FUCKEY + + var/list/custom_names = list("clown", "mime", "ai", "cyborg", "religion", "deity") + var/prefered_security_department = SEC_DEPT_RANDOM + + //Mob preview + var/icon/preview_icon = null + + //Jobs, uses bitflags + var/job_civilian_high = 0 + var/job_civilian_med = 0 + var/job_civilian_low = 0 + + var/job_medsci_high = 0 + var/job_medsci_med = 0 + var/job_medsci_low = 0 + + var/job_engsec_high = 0 + var/job_engsec_med = 0 + var/job_engsec_low = 0 + + // Want randomjob if preferences already filled - Donkie + var/joblessrole = BERANDOMJOB //defaults to 1 for fewer assistants + + // 0 = character settings, 1 = game preferences, 2 = character appearance + var/current_tab = 0 + + // OOC Metadata: + var/metadata = "" + + var/unlock_content = 0 + + var/list/ignoring = list() + + var/clientfps = 0 + + var/parallax + + var/uplink_spawn_loc = UPLINK_PDA + + var/list/menuoptions + + //citadel code + var/arousable = TRUE //Allows players to disable arousal from the character creation menu + var/flavor_text = "" + +/datum/preferences/New(client/C) + parent = C + custom_names["ai"] = pick(GLOB.ai_names) + custom_names["cyborg"] = pick(GLOB.ai_names) + custom_names["clown"] = pick(GLOB.clown_names) + custom_names["mime"] = pick(GLOB.mime_names) + if(istype(C)) + if(!IsGuestKey(C.key)) + load_path(C.ckey) + unlock_content = C.IsByondMember() + if(unlock_content) + max_save_slots = 16 + var/loaded_preferences_successfully = load_preferences() + if(loaded_preferences_successfully) + if(load_character()) + return + //we couldn't load character data so just randomize the character appearance + name + random_character() //let's create a random character then - rather than a fat, bald and naked man. + real_name = pref_species.random_name(gender,1) + if(!loaded_preferences_successfully) + save_preferences() + save_character() //let's save this new random character so it doesn't keep generating new ones. + menuoptions = list() + return + +/datum/preferences/proc/ShowChoices(mob/user) + if(!user || !user.client) + return + if(current_tab == 2) + update_preview_icon(nude=TRUE) + else + update_preview_icon(nude=FALSE) + user << browse_rsc(preview_icon, "previewicon.png") + var/dat = "
" + + dat += "Character Settings" + dat += "Character Appearance" + dat += "Game Preferences" + + if(!path) + dat += "
Please create an account to save your preferences
" + + dat += "
" + + dat += "
" + + switch(current_tab) + if (0) // Character Settings# + if(path) + var/savefile/S = new /savefile(path) + if(S) + dat += "
" + var/name + for(var/i=1, i<=max_save_slots, i++) + S.cd = "/character[i]" + S["real_name"] >> name + if(!name) + name = "Character[i]" + //if(i!=1) dat += " | " + dat += "[name] " + dat += "
" + + dat += "

Occupation Choices

" + dat += "Set Occupation Preferences
" + dat += "

Identity

" + dat += "" + + dat += "
" + if(jobban_isbanned(user, "appearance")) + dat += "You are banned from using custom names and appearances. You can continue to adjust your characters, but you will be randomised once you join the game.
" + dat += "Random Name " + dat += "Always Random Name: [be_random_name ? "Yes" : "No"]
" + + dat += "Name: " + dat += "[real_name]
" + + dat += "Gender: [gender == MALE ? "Male" : "Female"]
" + dat += "Age: [age]
" + dat += "Arousal:[arousable == TRUE ? "Enabled" : "Disabled"]
" + dat += "Exhibitionist:[features["exhibitionist"] == TRUE ? "Yes" : "No"]
" + dat += "Special Names:
" + dat += "Clown: [custom_names["clown"]] " + dat += "Mime:[custom_names["mime"]]
" + dat += "AI: [custom_names["ai"]] " + dat += "Cyborg: [custom_names["cyborg"]]
" + dat += "Chaplain religion: [custom_names["religion"]] " + dat += "Chaplain deity: [custom_names["deity"]]
" + + dat += "Custom job preferences:
" + dat += "Prefered security department: [prefered_security_department]
" + + dat += "
" + + dat += "
" +// dat += "Size: [character_size]
" + dat += "
" + + if (1) // Game Preferences + dat += "
" + dat += "

General Settings

" + dat += "UI Style: [UI_style]
" + dat += "Keybindings: [(hotkeys) ? "Hotkeys" : "Default"]
" + dat += "tgui Style: [(tgui_fancy) ? "Fancy" : "No Frills"]
" + dat += "tgui Monitors: [(tgui_lock) ? "Primary" : "All"]
" + dat += "Window Flashing: [(windowflashing) ? "Yes" : "No"]
" + dat += "Play admin midis: [(toggles & SOUND_MIDI) ? "Yes" : "No"]
" + dat += "Play lobby music: [(toggles & SOUND_LOBBY) ? "Yes" : "No"]
" + dat += "Ghost ears: [(chat_toggles & CHAT_GHOSTEARS) ? "All Speech" : "Nearest Creatures"]
" + dat += "Ghost sight: [(chat_toggles & CHAT_GHOSTSIGHT) ? "All Emotes" : "Nearest Creatures"]
" + dat += "Ghost whispers: [(chat_toggles & CHAT_GHOSTWHISPER) ? "All Speech" : "Nearest Creatures"]
" + dat += "Ghost radio: [(chat_toggles & CHAT_GHOSTRADIO) ? "Yes" : "No"]
" + dat += "Ghost pda: [(chat_toggles & CHAT_GHOSTPDA) ? "All Messages" : "Nearest Creatures"]
" + dat += "Pull requests: [(chat_toggles & CHAT_PULLR) ? "Yes" : "No"]
" + dat += "Midround Antagonist: [(toggles & MIDROUND_ANTAG) ? "Yes" : "No"]
" + if(config.allow_Metadata) + dat += "OOC Notes: Edit
" + + if(user.client) + if(user.client.holder) + dat += "Adminhelp Sound: [(toggles & SOUND_ADMINHELP)?"On":"Off"]
" + dat += "Announce Login: [(toggles & ANNOUNCE_LOGIN)?"On":"Off"]
" + + if(unlock_content || check_rights_for(user.client, R_ADMIN)) + dat += "OOC:     Change
" + + if(unlock_content) + dat += "BYOND Membership Publicity: [(toggles & MEMBER_PUBLIC) ? "Public" : "Hidden"]
" + dat += "Ghost Form: [ghost_form]
" + dat += "Ghost Orbit: [ghost_orbit]
" + + var/button_name = "If you see this something went wrong." + switch(ghost_accs) + if(GHOST_ACCS_FULL) + button_name = GHOST_ACCS_FULL_NAME + if(GHOST_ACCS_DIR) + button_name = GHOST_ACCS_DIR_NAME + if(GHOST_ACCS_NONE) + button_name = GHOST_ACCS_NONE_NAME + + dat += "Ghost Accessories: [button_name]
" + + switch(ghost_others) + if(GHOST_OTHERS_THEIR_SETTING) + button_name = GHOST_OTHERS_THEIR_SETTING_NAME + if(GHOST_OTHERS_DEFAULT_SPRITE) + button_name = GHOST_OTHERS_DEFAULT_SPRITE_NAME + if(GHOST_OTHERS_SIMPLE) + button_name = GHOST_OTHERS_SIMPLE_NAME + + dat += "Ghosts of Others: [button_name]
" + + if (config.maprotation) + var/p_map = preferred_map + if (!p_map) + p_map = "Default" + if (config.defaultmap) + p_map += " ([config.defaultmap.map_name])" + else + if (p_map in config.maplist) + var/datum/map_config/VM = config.maplist[p_map] + if (!VM) + p_map += " (No longer exists)" + else + p_map = VM.map_name + else + p_map += " (No longer exists)" + if(config.allow_map_voting) + dat += "Preferred Map: [p_map]
" + + dat += "FPS: [clientfps]
" + + dat += "Parallax (Fancy Space): " + switch (parallax) + if (PARALLAX_LOW) + dat += "Low" + if (PARALLAX_MED) + dat += "Medium" + if (PARALLAX_INSANE) + dat += "Insane" + if (PARALLAX_DISABLE) + dat += "Disabled" + else + dat += "High" + dat += "
" + + dat += "
" + + dat += "

Special Role Settings

" + + if(jobban_isbanned(user, "Syndicate")) + dat += "You are banned from antagonist roles." + src.be_special = list() + + + for (var/i in GLOB.special_roles) + if(jobban_isbanned(user, i)) + dat += "Be [capitalize(i)]: BANNED
" + else + var/days_remaining = null + if(config.use_age_restriction_for_jobs && ispath(GLOB.special_roles[i])) //If it's a game mode antag, check if the player meets the minimum age + var/mode_path = GLOB.special_roles[i] + var/datum/game_mode/temp_mode = new mode_path + days_remaining = temp_mode.get_remaining_days(user.client) + + if(days_remaining) + dat += "Be [capitalize(i)]: \[IN [days_remaining] DAYS]
" + else + dat += "Be [capitalize(i)]: [(i in be_special) ? "Yes" : "No"]
" + + dat += "
" + + //Character Appearance + if(2) + dat += "" + */ + + + dat += "
" + dat += "

" + dat += "Set Flavor Text
" + if(lentext(flavor_text) <= 40) + if(!lentext(flavor_text)) + dat += "\[...\]" + else + dat += "[flavor_text]" + else + dat += "[TextPreview(flavor_text)]...
" + if(config.mutant_races)//really don't need this check, but fuck un-tabbing all those lines + dat += "

Body

" + dat += "Gender: [gender == MALE ? "Male" : "Female"]
" + dat += "Species:[pref_species.id]
" + dat += "Random Body
" + dat += "Always Random Body: [be_random_body ? "Yes" : "No"]
" + if((MUTCOLORS in pref_species.species_traits) || (MUTCOLORS_PARTSONLY in pref_species.species_traits)) + dat += "Primary Color:     Change
" + dat += "Secondary Color:     Change
" + dat += "Tertiary Color:     Change
" + if(pref_species.use_skintones) + dat += "Skin Tone: [skin_tone]
" + dat += "Genitals Use Skintone:[features["genitals_use_skintone"] == TRUE ? "Enabled" : "Disabled"]
" + + if(HAIR in pref_species.species_traits) + dat += "Hair Style: [hair_style]
" + dat += "Hair Color:     Change
" + dat += "Facial Hair Style: [facial_hair_style]
" + dat += "Facial Hair Color:     Change
" + if(EYECOLOR in pref_species.species_traits) + dat += "Eye Color:     Change
" + if("tail_lizard" in pref_species.mutant_bodyparts) + dat += "Tail: [features["tail_lizard"]]
" + else if("mam_tail" in pref_species.mutant_bodyparts) + dat += "Tail: [features["mam_tail"]]
" + else if("tail_human" in pref_species.mutant_bodyparts) + dat += "Tail: [features["tail_human"]]
" + if("snout" in pref_species.mutant_bodyparts) + dat += "Snout: [features["snout"]]
" + if("horns" in pref_species.mutant_bodyparts) + dat += "Snout: [features["horns"]]
" + if("frills" in pref_species.mutant_bodyparts) + dat += "Frills: [features["frills"]]
" + if("spines" in pref_species.mutant_bodyparts) + dat += "Spines: [features["spines"]]
" + if("body_markings" in pref_species.mutant_bodyparts) + dat += "Body Markings: [features["body_markings"]]
" + else if("mam_body_markings" in pref_species.mutant_bodyparts) + dat += "Body Markings: [features["mam_body_markings"]]
" + if("mam_ears" in pref_species.mutant_bodyparts) + dat += "Ears: [features["mam_ears"]]
" + else if("ears" in pref_species.mutant_bodyparts) + dat += "Ears: [features["ears"]]
" + if("legs" in pref_species.mutant_bodyparts) + dat += "Legs: [features["legs"]]
" + if("taur" in pref_species.mutant_bodyparts) + dat += "Taur: [features["taur"]]
" + if("wings" in pref_species.mutant_bodyparts && GLOB.r_wings_list.len >1) + dat += "Wings: [features["wings"]]
" + if("xenohead" in pref_species.mutant_bodyparts) + dat += "Caste: [features["xenohead"]]
" + if("xenotail" in pref_species.mutant_bodyparts) + dat += "Tail: [features["xenotail"]]
" + if("xenodorsal" in pref_species.mutant_bodyparts) + dat += "Dorsal Tubes: [features["xenodorsal"]]
" + + dat += "
" + + + dat += "

Clothing & Equipment

" +//underwear will be refactored later so it fits in with other wearable equipment and isn't just an overlay +// dat += "Underwear:[underwear]
" +// dat += "Undershirt:[undershirt]
" +// dat += "Socks:[socks]
" + dat += "Backpack:[backbag]
" + dat += "Uplink Location:[uplink_spawn_loc]
" + + dat += "

Genitals

" + if(NOGENITALS in pref_species.species_traits) + dat += "Your species ([pref_species.name]) does not support genitals!
" + else + dat += "Has Penis:[features["has_cock"] == TRUE ? "Yes" : "No"]
" + if(features["has_cock"] == TRUE) + if(pref_species.use_skintones && features["genitals_use_skintone"] == TRUE) + dat += "Penis Color:   (Skin tone overriding)
" + else + dat += "Penis Color:    Change
" +// dat += "
" + dat += "Penis Shape: [features["cock_shape"]]
" + dat += "Penis Length: [features["cock_length"]] inch(es)
" + dat += "Has Testicles:[features["has_balls"] == TRUE ? "Yes" : "No"]
" + if(features["has_balls"] == TRUE) + if(pref_species.use_skintones && features["genitals_use_skintone"] == TRUE) + dat += "Testicles Color:   (Skin tone overriding)
" + else + dat += "Testicles Color:    Change
" + dat += "Has Vagina:[features["has_vag"] == TRUE ? "Yes" : "No"]
" + if(features["has_vag"]) + dat += "Vagina Type: [features["vag_shape"]]
" + if(pref_species.use_skintones && features["genitals_use_skintone"] == TRUE) + dat += "Vagina Color:   (Skin tone overriding)
" + else + dat += "Vagina Color:    Change
" + dat += "Has Womb:[features["has_womb"] == TRUE ? "Yes" : "No"]
" + dat += "Has Breasts:[features["has_breasts"] == TRUE ? "Yes" : "No"]
" + if(features["has_breasts"]) + if(pref_species.use_skintones && features["genitals_use_skintone"] == TRUE) + dat += "Color:   (Skin tone overriding)
" + else + dat += "Color:    Change
" + dat += "Cup Size:[features["breasts_size"]]
" + dat += "Breast Shape:[features["breasts_shape"]]
" + /* + dat += "

Ovipositor

" + dat += "Has Ovipositor:[features["has_ovi"] == TRUE ? "Yes" : "No"]" + if(features["has_ovi"]) + dat += "Ovi Color:    Change" + dat += "

Eggsack

" + dat += "Has Eggsack:[features["has_eggsack"] == TRUE ? "Yes" : "No"]
" + if(features["has_eggsack"] == TRUE) + dat += "Color:    Change" + dat += "Egg Color:    Change" + dat += "Egg Size:[features["eggsack_egg_size"]]\" Diameter" + + dat += "
" + dat += "
" + + if(!IsGuestKey(user.key)) + dat += "Undo " + dat += "Save Setup " + + dat += "Reset Setup" + dat += "
" + + var/datum/browser/popup = new(user, "preferences", "
Character Setup
", 640, 770) + popup.set_content(dat) + popup.open(0) + +/datum/preferences/proc/SetChoices(mob/user, limit = 17, list/splitJobs = list("Chief Engineer"), widthPerColumn = 295, height = 620) + if(!SSjob) + return + + //limit - The amount of jobs allowed per column. Defaults to 17 to make it look nice. + //splitJobs - Allows you split the table by job. You can make different tables for each department by including their heads. Defaults to CE to make it look nice. + //widthPerColumn - Screen's width for every column. + //height - Screen's height. + + var/width = widthPerColumn + + var/HTML = "
" + if(SSjob.occupations.len <= 0) + HTML += "The job ticker is not yet finished creating jobs, please try again later" + HTML += "
Done

" // Easier to press up here. + + else + HTML += "Choose occupation chances
" + HTML += "
Left-click to raise an occupation preference, right-click to lower it.
" + HTML += "
Done

" // Easier to press up here. + HTML += "" + HTML += "
" // Table within a table for alignment, also allows you to easily add more colomns. + HTML += "" + var/index = -1 + + //The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows. + var/datum/job/lastJob + + for(var/datum/job/job in SSjob.occupations) + + index += 1 + if((index >= limit) || (job.title in splitJobs)) + width += widthPerColumn + if((index < limit) && (lastJob != null)) + //If the cells were broken up by a job in the splitJob list then it will fill in the rest of the cells with + //the last job's selection color. Creating a rather nice effect. + for(var/i = 0, i < (limit - index), i += 1) + HTML += "" + HTML += "
  
" + index = 0 + + HTML += "" + continue + if(!job.player_old_enough(user.client)) + var/available_in_days = job.available_in_days(user.client) + HTML += "[rank]" + continue + if((job_civilian_low & ASSISTANT) && (rank != "Assistant") && !jobban_isbanned(user, "Assistant")) + HTML += "[rank]" + continue + if(config.enforce_human_authority && !user.client.prefs.pref_species.qualifies_for_rank(rank, user.client.prefs.features)) + if(user.client.prefs.pref_species.id == "human") + HTML += "[rank]" + else + HTML += "[rank]" + continue + if((rank in GLOB.command_positions) || (rank == "AI"))//Bold head jobs + HTML += "[rank]" + else + HTML += "[rank]" + + HTML += "" + continue + + HTML += "[prefLevelLabel]" + HTML += "" + + for(var/i = 1, i < (limit - index), i += 1) // Finish the column so it is even + HTML += "" + + HTML += "
" + var/rank = job.title + lastJob = job + if(jobban_isbanned(user, rank)) + HTML += "[rank] BANNED
\[IN [(available_in_days)] DAYS\]
\[MUTANT\]
\[NON-HUMAN\]
" + + var/prefLevelLabel = "ERROR" + var/prefLevelColor = "pink" + var/prefUpperLevel = -1 // level to assign on left click + var/prefLowerLevel = -1 // level to assign on right click + + if(GetJobDepartment(job, 1) & job.flag) + prefLevelLabel = "High" + prefLevelColor = "slateblue" + prefUpperLevel = 4 + prefLowerLevel = 2 + else if(GetJobDepartment(job, 2) & job.flag) + prefLevelLabel = "Medium" + prefLevelColor = "green" + prefUpperLevel = 1 + prefLowerLevel = 3 + else if(GetJobDepartment(job, 3) & job.flag) + prefLevelLabel = "Low" + prefLevelColor = "orange" + prefUpperLevel = 2 + prefLowerLevel = 4 + else + prefLevelLabel = "NEVER" + prefLevelColor = "red" + prefUpperLevel = 3 + prefLowerLevel = 1 + + + HTML += "" + + if(rank == "Assistant")//Assistant is special + if(job_civilian_low & ASSISTANT) + HTML += "Yes" + else + HTML += "No" + HTML += "
  
" + HTML += "
" + + var/message = "Be an Assistant if preferences unavailable" + if(joblessrole == BERANDOMJOB) + message = "Get random job if preferences unavailable" + else if(joblessrole == RETURNTOLOBBY) + message = "Return to lobby if preferences unavailable" + HTML += "

[message]
" + HTML += "
Reset Preferences
" + + user << browse(null, "window=preferences") + var/datum/browser/popup = new(user, "mob_occupation", "
Occupation Preferences
", width, height) + popup.set_window_options("can_close=0") + popup.set_content(HTML) + popup.open(0) + return + +/datum/preferences/proc/SetJobPreferenceLevel(datum/job/job, level) + if (!job) + return 0 + + if (level == 1) // to high + // remove any other job(s) set to high + job_civilian_med |= job_civilian_high + job_engsec_med |= job_engsec_high + job_medsci_med |= job_medsci_high + job_civilian_high = 0 + job_engsec_high = 0 + job_medsci_high = 0 + + if (job.department_flag == CIVILIAN) + job_civilian_low &= ~job.flag + job_civilian_med &= ~job.flag + job_civilian_high &= ~job.flag + + switch(level) + if (1) + job_civilian_high |= job.flag + if (2) + job_civilian_med |= job.flag + if (3) + job_civilian_low |= job.flag + + return 1 + else if (job.department_flag == ENGSEC) + job_engsec_low &= ~job.flag + job_engsec_med &= ~job.flag + job_engsec_high &= ~job.flag + + switch(level) + if (1) + job_engsec_high |= job.flag + if (2) + job_engsec_med |= job.flag + if (3) + job_engsec_low |= job.flag + + return 1 + else if (job.department_flag == MEDSCI) + job_medsci_low &= ~job.flag + job_medsci_med &= ~job.flag + job_medsci_high &= ~job.flag + + switch(level) + if (1) + job_medsci_high |= job.flag + if (2) + job_medsci_med |= job.flag + if (3) + job_medsci_low |= job.flag + + return 1 + + return 0 + +/datum/preferences/proc/UpdateJobPreference(mob/user, role, desiredLvl) + if(!SSjob || SSjob.occupations.len <= 0) + return + var/datum/job/job = SSjob.GetJob(role) + + if(!job) + user << browse(null, "window=mob_occupation") + ShowChoices(user) + return + + if (!isnum(desiredLvl)) + to_chat(user, "UpdateJobPreference - desired level was not a number. Please notify coders!") + ShowChoices(user) + return + + if(role == "Assistant") + if(job_civilian_low & job.flag) + job_civilian_low &= ~job.flag + else + job_civilian_low |= job.flag + SetChoices(user) + return 1 + + SetJobPreferenceLevel(job, desiredLvl) + SetChoices(user) + + return 1 + + +/datum/preferences/proc/ResetJobs() + + job_civilian_high = 0 + job_civilian_med = 0 + job_civilian_low = 0 + + job_medsci_high = 0 + job_medsci_med = 0 + job_medsci_low = 0 + + job_engsec_high = 0 + job_engsec_med = 0 + job_engsec_low = 0 + + +/datum/preferences/proc/GetJobDepartment(datum/job/job, level) + if(!job || !level) + return 0 + switch(job.department_flag) + if(CIVILIAN) + switch(level) + if(1) + return job_civilian_high + if(2) + return job_civilian_med + if(3) + return job_civilian_low + if(MEDSCI) + switch(level) + if(1) + return job_medsci_high + if(2) + return job_medsci_med + if(3) + return job_medsci_low + if(ENGSEC) + switch(level) + if(1) + return job_engsec_high + if(2) + return job_engsec_med + if(3) + return job_engsec_low + return 0 + +/datum/preferences/proc/process_link(mob/user, list/href_list) + if(href_list["jobbancheck"]) + var/job = sanitizeSQL(href_list["jobbancheck"]) + var/sql_ckey = sanitizeSQL(user.ckey) + var/datum/DBQuery/query_get_jobban = SSdbcore.NewQuery("SELECT reason, bantime, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey = '[sql_ckey]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned) AND job = '[job]'") + if(!query_get_jobban.warn_execute()) + return + if(query_get_jobban.NextRow()) + var/reason = query_get_jobban.item[1] + var/bantime = query_get_jobban.item[2] + var/duration = query_get_jobban.item[3] + var/expiration_time = query_get_jobban.item[4] + var/a_ckey = query_get_jobban.item[5] + var/text + text = "You, or another user of this computer, ([user.ckey]) is banned from playing [job]. The ban reason is:
[reason]
This ban was applied by [a_ckey] on [bantime]" + if(text2num(duration) > 0) + text += ". The ban is for [duration] minutes and expires on [expiration_time] (server time)" + text += ".
" + to_chat(user, text) + return + + if(href_list["preference"] == "job") + switch(href_list["task"]) + if("close") + user << browse(null, "window=mob_occupation") + ShowChoices(user) + if("reset") + ResetJobs() + SetChoices(user) + if("random") + switch(joblessrole) + if(RETURNTOLOBBY) + if(jobban_isbanned(user, "Assistant")) + joblessrole = BERANDOMJOB + else + joblessrole = BEASSISTANT + if(BEASSISTANT) + joblessrole = BERANDOMJOB + if(BERANDOMJOB) + joblessrole = RETURNTOLOBBY + SetChoices(user) + if("setJobLevel") + UpdateJobPreference(user, href_list["text"], text2num(href_list["level"])) + else + SetChoices(user) + return 1 + + switch(href_list["task"]) + if("random") + switch(href_list["preference"]) + if("name") + real_name = pref_species.random_name(gender,1) + if("age") + age = rand(AGE_MIN, AGE_MAX) + if("hair") + hair_color = random_short_color() + if("hair_style") + hair_style = random_hair_style(gender) + if("facial") + facial_hair_color = random_short_color() + if("facial_hair_style") + facial_hair_style = random_facial_hair_style(gender) + if("underwear") + underwear = random_underwear(gender) + if("undershirt") + undershirt = random_undershirt(gender) + if("socks") + socks = random_socks() + if("eyes") + eye_color = random_eye_color() + if("s_tone") + skin_tone = random_skin_tone() + if("bag") + backbag = pick(GLOB.backbaglist) + if("all") + random_character() + + if("input") + switch(href_list["preference"]) + if("ghostform") + if(unlock_content) + var/new_form = input(user, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND",null) as null|anything in GLOB.ghost_forms + if(new_form) + ghost_form = new_form + if("ghostorbit") + if(unlock_content) + var/new_orbit = input(user, "Thanks for supporting BYOND - Choose your ghostly orbit:","Thanks for supporting BYOND", null) as null|anything in GLOB.ghost_orbits + if(new_orbit) + ghost_orbit = new_orbit + + if("ghostaccs") + var/new_ghost_accs = alert("Do you want your ghost to show full accessories where possible, hide accessories but still use the directional sprites where possible, or also ignore the directions and stick to the default sprites?",,GHOST_ACCS_FULL_NAME, GHOST_ACCS_DIR_NAME, GHOST_ACCS_NONE_NAME) + switch(new_ghost_accs) + if(GHOST_ACCS_FULL_NAME) + ghost_accs = GHOST_ACCS_FULL + if(GHOST_ACCS_DIR_NAME) + ghost_accs = GHOST_ACCS_DIR + if(GHOST_ACCS_NONE_NAME) + ghost_accs = GHOST_ACCS_NONE + + if("ghostothers") + var/new_ghost_others = alert("Do you want the ghosts of others to show up as their own setting, as their default sprites or always as the default white ghost?",,GHOST_OTHERS_THEIR_SETTING_NAME, GHOST_OTHERS_DEFAULT_SPRITE_NAME, GHOST_OTHERS_SIMPLE_NAME) + switch(new_ghost_others) + if(GHOST_OTHERS_THEIR_SETTING_NAME) + ghost_others = GHOST_OTHERS_THEIR_SETTING + if(GHOST_OTHERS_DEFAULT_SPRITE_NAME) + ghost_others = GHOST_OTHERS_DEFAULT_SPRITE + if(GHOST_OTHERS_SIMPLE_NAME) + ghost_others = GHOST_OTHERS_SIMPLE + + if("name") + var/new_name = reject_bad_name( input(user, "Choose your character's name:", "Character Preference") as text|null ) + if(new_name) + real_name = new_name + else + to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") + + if("age") + var/new_age = input(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference") as num|null + if(new_age) + age = max(min( round(text2num(new_age)), AGE_MAX),AGE_MIN) + + if("flavor_text") + var/msg = input(usr,"Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!","Flavor Text",html_decode(flavor_text)) as message + if(msg != null) + msg = copytext(msg, 1, MAX_MESSAGE_LEN) + msg = html_encode(msg) + flavor_text = msg + + if("metadata") + var/new_metadata = input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , metadata) as message|null + if(new_metadata) + metadata = sanitize(copytext(new_metadata,1,MAX_MESSAGE_LEN)) + + if("hair") + var/new_hair = input(user, "Choose your character's hair colour:", "Character Preference") as null|color + if(new_hair) + hair_color = sanitize_hexcolor(new_hair) + + + if("hair_style") + var/new_hair_style + if(gender == MALE) + new_hair_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in GLOB.hair_styles_male_list + else + new_hair_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in GLOB.hair_styles_female_list + if(new_hair_style) + hair_style = new_hair_style + + if("next_hair_style") + if (gender == MALE) + hair_style = next_list_item(hair_style, GLOB.hair_styles_male_list) + else + hair_style = next_list_item(hair_style, GLOB.hair_styles_female_list) + + if("previous_hair_style") + if (gender == MALE) + hair_style = previous_list_item(hair_style, GLOB.hair_styles_male_list) + else + hair_style = previous_list_item(hair_style, GLOB.hair_styles_female_list) + + if("facial") + var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference") as null|color + if(new_facial) + facial_hair_color = sanitize_hexcolor(new_facial) + + if("facial_hair_style") + var/new_facial_hair_style + if(gender == MALE) + new_facial_hair_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in GLOB.facial_hair_styles_male_list + else + new_facial_hair_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in GLOB.facial_hair_styles_female_list + if(new_facial_hair_style) + facial_hair_style = new_facial_hair_style + + if("next_facehair_style") + if (gender == MALE) + facial_hair_style = next_list_item(facial_hair_style, GLOB.facial_hair_styles_male_list) + else + facial_hair_style = next_list_item(facial_hair_style, GLOB.facial_hair_styles_female_list) + + if("previous_facehair_style") + if (gender == MALE) + facial_hair_style = previous_list_item(facial_hair_style, GLOB.facial_hair_styles_male_list) + else + facial_hair_style = previous_list_item(facial_hair_style, GLOB.facial_hair_styles_female_list) + + if("underwear") + var/new_underwear + if(gender == MALE) + new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in GLOB.underwear_m + else + new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in GLOB.underwear_f + if(new_underwear) + underwear = new_underwear + + if("undershirt") + var/new_undershirt + if(gender == MALE) + new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in GLOB.undershirt_m + else + new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in GLOB.undershirt_f + if(new_undershirt) + undershirt = new_undershirt + + if("socks") + var/new_socks + new_socks = input(user, "Choose your character's socks:", "Character Preference") as null|anything in GLOB.socks_list + if(new_socks) + socks = new_socks + + if("eyes") + var/new_eyes = input(user, "Choose your character's eye colour:", "Character Preference") as color|null + if(new_eyes) + eye_color = sanitize_hexcolor(new_eyes) + + if("species") + + var/result = input(user, "Select a species", "Species Selection") as null|anything in GLOB.roundstart_species + + if(result) + var/newtype = GLOB.roundstart_species[result] + pref_species = new newtype() + //Now that we changed our species, we must verify that the mutant colour is still allowed. + var/temp_hsv = RGBtoHSV(features["mcolor"]) + if(features["mcolor"] == "#000" || (!(MUTCOLORS_PARTSONLY in pref_species.species_traits) && ReadHSV(temp_hsv)[3] < ReadHSV("#202020")[3])) + features["mcolor"] = pref_species.default_color + if(features["mcolor2"] == "#000" || (!(MUTCOLORS_PARTSONLY in pref_species.species_traits) && ReadHSV(temp_hsv)[3] < ReadHSV("#202020")[3])) + features["mcolor2"] = pref_species.default_color + if(features["mcolor3"] == "#000" || (!(MUTCOLORS_PARTSONLY in pref_species.species_traits) && ReadHSV(temp_hsv)[3] < ReadHSV("#202020")[3])) + features["mcolor3"] = pref_species.default_color + + if("mutant_color") + var/new_mutantcolor = input(user, "Choose your character's primary alien/mutant color:", "Character Preference") as color|null + if(new_mutantcolor) + var/temp_hsv = RGBtoHSV(new_mutantcolor) + if(new_mutantcolor == "#000000") + features["mcolor"] = pref_species.default_color + else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) // mutantcolors must be bright, but only if they affect the skin + features["mcolor"] = sanitize_hexcolor(new_mutantcolor) + else + to_chat(user, "Invalid color. Your color is not bright enough.") + + if("mutant_color2") + var/new_mutantcolor = input(user, "Choose your character's secondary alien/mutant color:", "Character Preference") as color|null + if(new_mutantcolor) + var/temp_hsv = RGBtoHSV(new_mutantcolor) + if(new_mutantcolor == "#000000") + features["mcolor2"] = pref_species.default_color + else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) // mutantcolors must be bright, but only if they affect the skin + features["mcolor2"] = sanitize_hexcolor(new_mutantcolor) + else + to_chat(user, "Invalid color. Your color is not bright enough.") + + if("mutant_color3") + var/new_mutantcolor = input(user, "Choose your character's tertiary alien/mutant color:", "Character Preference") as color|null + if(new_mutantcolor) + var/temp_hsv = RGBtoHSV(new_mutantcolor) + if(new_mutantcolor == "#000000") + features["mcolor3"] = pref_species.default_color + else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) // mutantcolors must be bright, but only if they affect the skin + features["mcolor3"] = sanitize_hexcolor(new_mutantcolor) + else + to_chat(user, "Invalid color. Your color is not bright enough.") + + if("tail_lizard") + var/new_tail + new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.tails_list_lizard + if(new_tail) + features["tail_lizard"] = new_tail + if(new_tail != "None") + features["taur"] = "None" + + if("tail_human") + var/new_tail + new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.tails_list_human + if(new_tail) + features["tail_human"] = new_tail + if(new_tail != "None") + features["taur"] = "None" + if("mam_tail") + var/new_tail + new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.mam_tails_list + if(new_tail) + features["mam_tail"] = new_tail + if(new_tail != "None") + features["taur"] = "None" + + if("taur") + var/new_taur + new_taur = input(user, "Choose your character's tauric body:", "Character Preference") as null|anything in GLOB.taur_list + if(new_taur) + features["taur"] = new_taur + if(new_taur != "None") + features["mam_tail"] = "None" + features["xenotail"] = "None" + +/* Doesn't exist yet. will include facial overlays to mimic 5th port species heads. + if("mam_snout") + var/new_snout + new_snout = input(user, "Choose your character's snout:", "Character Preference") as null|anything in GLOB.mam_snouts_list + if(new_snout) + features["snout"] = new_snout +*/ + + if("snout") + var/new_snout + new_snout = input(user, "Choose your character's snout:", "Character Preference") as null|anything in GLOB.snouts_list + if(new_snout) + features["snout"] = new_snout + + if("horns") + var/new_horns + new_horns = input(user, "Choose your character's horns:", "Character Preference") as null|anything in GLOB.horns_list + if(new_horns) + features["horns"] = new_horns + + if("mam_ears") + var/new_ears + new_ears = input(user, "Choose your character's ears:", "Character Preference") as null|anything in GLOB.mam_ears_list + if(new_ears) + features["mam_ears"] = new_ears + + if("ears") + var/new_ears + new_ears = input(user, "Choose your character's ears:", "Character Preference") as null|anything in GLOB.ears_list + if(new_ears) + features["ears"] = new_ears + + if("wings") + var/new_wings + new_wings = input(user, "Choose your character's wings:", "Character Preference") as null|anything in GLOB.r_wings_list + if(new_wings) + features["wings"] = new_wings + + if("frills") + var/new_frills + new_frills = input(user, "Choose your character's frills:", "Character Preference") as null|anything in GLOB.frills_list + if(new_frills) + features["frills"] = new_frills + + if("spines") + var/new_spines + new_spines = input(user, "Choose your character's spines:", "Character Preference") as null|anything in GLOB.spines_list + if(new_spines) + features["spines"] = new_spines + + if("body_markings") + var/new_body_markings + new_body_markings = input(user, "Choose your character's body markings:", "Character Preference") as null|anything in GLOB.body_markings_list + if(new_body_markings) + features["body_markings"] = new_body_markings + + if("mam_body_markings") + var/new_mam_body_markings + new_mam_body_markings = input(user, "Choose your character's body markings:", "Character Preference") as null|anything in GLOB.mam_body_markings_list + if(new_mam_body_markings) + features["mam_body_markings"] = new_mam_body_markings + + //Xeno Bodyparts + if("xenohead")//Head or caste type + var/new_head + new_head = input(user, "Choose your character's caste:", "Character Preference") as null|anything in GLOB.xeno_head_list + if(new_head) + features["xenohead"] = new_head + + if("xenotail")//Currently one one type, more maybe later if someone sprites them. Might include animated variants in the future. + var/new_tail + new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.xeno_tail_list + if(new_tail) + features["xenotail"] = new_tail + + if("xenodorsal") + var/new_dors + new_dors = input(user, "Choose your character's dorsal tube type:", "Character Preference") as null|anything in GLOB.xeno_dorsal_list + if(new_dors) + features["xenodorsal"] = new_dors + + if("legs") + var/new_legs + new_legs = input(user, "Choose your character's legs:", "Character Preference") as null|anything in GLOB.legs_list + if(new_legs) + features["legs"] = new_legs + + if("s_tone") + var/new_s_tone = input(user, "Choose your character's skin-tone:", "Character Preference") as null|anything in GLOB.skin_tones + if(new_s_tone) + skin_tone = new_s_tone + + if("ooccolor") + var/new_ooccolor = input(user, "Choose your OOC colour:", "Game Preference") as color|null + if(new_ooccolor) + ooccolor = sanitize_ooccolor(new_ooccolor) + + if("bag") + var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in GLOB.backbaglist + if(new_backbag) + backbag = new_backbag + + if("uplink_loc") + var/new_loc = input(user, "Choose your character's traitor uplink spawn location:", "Character Preference") as null|anything in GLOB.uplink_spawn_loc_list + if(new_loc) + uplink_spawn_loc = new_loc + + if("clown_name") + var/new_clown_name = reject_bad_name( input(user, "Choose your character's clown name:", "Character Preference") as text|null ) + if(new_clown_name) + custom_names["clown"] = new_clown_name + else + to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") + + if("mime_name") + var/new_mime_name = reject_bad_name( input(user, "Choose your character's mime name:", "Character Preference") as text|null ) + if(new_mime_name) + custom_names["mime"] = new_mime_name + else + to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") + + if("ai_name") + var/new_ai_name = reject_bad_name( input(user, "Choose your character's AI name:", "Character Preference") as text|null, 1 ) + if(new_ai_name) + custom_names["ai"] = new_ai_name + else + to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, 0-9, -, ' and .") + + if("cyborg_name") + var/new_cyborg_name = reject_bad_name( input(user, "Choose your character's cyborg name:", "Character Preference") as text|null, 1 ) + if(new_cyborg_name) + custom_names["cyborg"] = new_cyborg_name + else + to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, 0-9, -, ' and .") + + if("religion_name") + var/new_religion_name = reject_bad_name( input(user, "Choose your character's religion:", "Character Preference") as text|null ) + if(new_religion_name) + custom_names["religion"] = new_religion_name + else + to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") + + if("deity_name") + var/new_deity_name = reject_bad_name( input(user, "Choose your character's deity:", "Character Preference") as text|null ) + if(new_deity_name) + custom_names["deity"] = new_deity_name + else + to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") + + if("sec_dept") + var/department = input(user, "Choose your prefered security department:", "Security Departments") as null|anything in GLOB.security_depts_prefs + if(department) + prefered_security_department = department + + if ("preferred_map") + var/maplist = list() + var/default = "Default" + if (config.defaultmap) + default += " ([config.defaultmap.map_name])" + for (var/M in config.maplist) + var/datum/map_config/VM = config.maplist[M] + var/friendlyname = "[VM.map_name] " + if (VM.voteweight <= 0) + friendlyname += " (disabled)" + maplist[friendlyname] = VM.map_name + maplist[default] = null + var/pickedmap = input(user, "Choose your preferred map. This will be used to help weight random map selection.", "Character Preference") as null|anything in maplist + if (pickedmap) + preferred_map = maplist[pickedmap] + + if ("clientfps") + var/version_message + if (user.client && user.client.byond_version < 511) + version_message = "\nYou need to be using byond version 511 or later to take advantage of this feature, your version of [user.client.byond_version] is too low" + if (world.byond_version < 511) + version_message += "\nThis server does not currently support client side fps. You can set now for when it does." + var/desiredfps = input(user, "Choose your desired fps.[version_message]\n(0 = synced with server tick rate (currently:[world.fps]))", "Character Preference", clientfps) as null|num + if (!isnull(desiredfps)) + clientfps = desiredfps + if (world.byond_version >= 511 && user.client && user.client.byond_version >= 511) + user.client.vars["fps"] = clientfps + if("ui") + var/pickedui = input(user, "Choose your UI style.", "Character Preference") as null|anything in list("Midnight", "Plasmafire", "Retro", "Slimecore", "Operative", "Clockwork") + if(pickedui) + UI_style = pickedui + + //citadel code + if("cock_color") + var/new_cockcolor = input(user, "Penis color:", "Character Preference") as color|null + if(new_cockcolor) + var/temp_hsv = RGBtoHSV(new_cockcolor) + if(new_cockcolor == "#000000") + features["cock_color"] = pref_species.default_color + else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) + features["cock_color"] = sanitize_hexcolor(new_cockcolor) + else + user << "Invalid color. Your color is not bright enough." + + if("cock_length") + var/new_length = input(user, "Penis length in inches:\n([COCK_SIZE_MIN]-[COCK_SIZE_MAX])", "Character Preference") as num|null + if(new_length) + features["cock_length"] = max(min( round(text2num(new_length)), COCK_SIZE_MAX),COCK_SIZE_MIN) + + if("cock_shape") + var/new_shape + new_shape = input(user, "Penis shape:", "Character Preference") as null|anything in GLOB.cock_shapes_list + if(new_shape) + features["cock_shape"] = new_shape + + if("balls_color") + var/new_ballscolor = input(user, "Testicle Color:", "Character Preference") as color|null + if(new_ballscolor) + var/temp_hsv = RGBtoHSV(new_ballscolor) + if(new_ballscolor == "#000000") + features["balls_color"] = pref_species.default_color + else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) + features["balls_color"] = sanitize_hexcolor(new_ballscolor) + else + user << "Invalid color. Your color is not bright enough." + + if("egg_size") + var/new_size + var/list/egg_sizes = list(1,2,3) + new_size = input(user, "Egg Diameter(inches):", "Egg Size") as null|anything in egg_sizes + if(new_size) + features["eggsack_egg_size"] = new_size + + if("egg_color") + var/new_egg_color = input(user, "Egg Color:", "Character Preference") as color|null + if(new_egg_color) + var/temp_hsv = RGBtoHSV(new_egg_color) + if(ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) + features["eggsack_egg_color"] = sanitize_hexcolor(new_egg_color) + else + user << "Invalid color. Your color is not bright enough." + if("breasts_size") + var/new_size + new_size = input(user, "Breast Size", "Character Preference") as null|anything in GLOB.breasts_size_list + if(new_size) + features["breasts_size"] = new_size + + if("breasts_shape") + var/new_shape + new_shape = input(user, "Breast Shape", "Character Preference") as null|anything in GLOB.breasts_shapes_list + if(new_shape) + features["breasts_shape"] = new_shape + + if("breasts_color") + var/new_breasts_color = input(user, "Breast Color:", "Character Preference") as color|null + if(new_breasts_color) + var/temp_hsv = RGBtoHSV(new_breasts_color) + if(new_breasts_color == "#000000") + features["breasts_color"] = pref_species.default_color + else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) + features["breasts_color"] = sanitize_hexcolor(new_breasts_color) + else + user << "Invalid color. Your color is not bright enough." + if("vag_shape") + var/new_shape + new_shape = input(user, "Vagina Type", "Character Preference") as null|anything in GLOB.vagina_shapes_list + if(new_shape) + features["vag_shape"] = new_shape + if("vag_color") + var/new_vagcolor = input(user, "Vagina color:", "Character Preference") as color|null + if(new_vagcolor) + var/temp_hsv = RGBtoHSV(new_vagcolor) + if(new_vagcolor == "#000000") + features["vag_color"] = pref_species.default_color + else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) + features["vag_color"] = sanitize_hexcolor(new_vagcolor) + else + user << "Invalid color. Your color is not bright enough." + + else + switch(href_list["preference"]) + + //citadel code + if("genital_colour") + switch(features["genitals_use_skintone"]) + if(TRUE) + features["genitals_use_skintone"] = FALSE + if(FALSE) + features["genitals_use_skintone"] = TRUE + else + features["genitals_use_skintone"] = FALSE + if("arousable") + switch(arousable) + if(TRUE) + arousable = FALSE + if(FALSE) + arousable = TRUE + else//failsafe + arousable = FALSE + if("has_cock") + switch(features["has_cock"]) + if(TRUE) + features["has_cock"] = FALSE + if(FALSE) + features["has_cock"] = TRUE + features["has_ovi"] = FALSE + features["has_eggsack"] = FALSE + else + features["has_cock"] = FALSE + features["has_ovi"] = FALSE + if("has_balls") + switch(features["has_balls"]) + if(TRUE) + features["has_balls"] = FALSE + if(FALSE) + features["has_balls"] = TRUE + features["has_eggsack"] = FALSE + else + features["has_balls"] = FALSE + features["has_eggsack"] = FALSE + + if("has_ovi") + switch(features["has_ovi"]) + if(TRUE) + features["has_ovi"] = FALSE + if(FALSE) + features["has_ovi"] = TRUE + features["has_cock"] = FALSE + features["has_balls"] = FALSE + else + features["has_ovi"] = FALSE + features["has_cock"] = FALSE + + if("has_eggsack") + switch(features["has_eggsack"]) + if(TRUE) + features["has_eggsack"] = FALSE + if(FALSE) + features["has_eggsack"] = TRUE + features["has_balls"] = FALSE + else + features["has_eggsack"] = FALSE + features["has_balls"] = FALSE + + if("balls_internal") + switch(features["balls_internal"]) + if(TRUE) + features["balls_internal"] = FALSE + if(FALSE) + features["balls_internal"] = TRUE + features["eggsack_internal"] = FALSE + else + features["balls_internal"] = FALSE + features["eggsack_internal"] = FALSE + + if("eggsack_internal") + switch(features["eggsack_internal"]) + if(TRUE) + features["eggsack_internal"] = FALSE + if(FALSE) + features["eggsack_internal"] = TRUE + features["balls_internal"] = FALSE + else + features["eggsack_internal"] = FALSE + features["balls_internal"] = FALSE + + if("has_breasts") + switch(features["has_breasts"]) + if(TRUE) + features["has_breasts"] = FALSE + if(FALSE) + features["has_breasts"] = TRUE + else + features["has_breasts"] = FALSE + if("has_vag") + switch(features["has_vag"]) + if(TRUE) + features["has_vag"] = FALSE + if(FALSE) + features["has_vag"] = TRUE + else + features["has_vag"] = FALSE + if("has_womb") + switch(features["has_womb"]) + if(TRUE) + features["has_womb"] = FALSE + if(FALSE) + features["has_womb"] = TRUE + else + features["has_womb"] = FALSE + if("exhibitionist") + switch(features["exhibitionist"]) + if(TRUE) + features["exhibitionist"] = FALSE + if(FALSE) + features["exhibitionist"] = TRUE + else + features["exhibitionist"] = FALSE + + if("publicity") + if(unlock_content) + toggles ^= MEMBER_PUBLIC + if("gender") + if(gender == MALE) + gender = FEMALE + else + gender = MALE + underwear = "Nude" + undershirt = "Nude" + socks = "Nude" + facial_hair_style = "Shaved" + hair_style = "Bald" + + if("hotkeys") + hotkeys = !hotkeys + + if("tgui_fancy") + tgui_fancy = !tgui_fancy + if("tgui_lock") + tgui_lock = !tgui_lock + if("winflash") + windowflashing = !windowflashing + if("hear_adminhelps") + toggles ^= SOUND_ADMINHELP + if("announce_login") + toggles ^= ANNOUNCE_LOGIN + + if("be_special") + var/be_special_type = href_list["be_special_type"] + if(be_special_type in be_special) + be_special -= be_special_type + else + be_special += be_special_type + + if("name") + be_random_name = !be_random_name + + if("all") + be_random_body = !be_random_body + + if("hear_midis") + toggles ^= SOUND_MIDI + + if("lobby_music") + toggles ^= SOUND_LOBBY + if((toggles & SOUND_LOBBY) && user.client) + user.client.playtitlemusic() + else + user.stop_sound_channel(CHANNEL_LOBBYMUSIC) + + if("ghost_ears") + chat_toggles ^= CHAT_GHOSTEARS + + if("ghost_sight") + chat_toggles ^= CHAT_GHOSTSIGHT + + if("ghost_whispers") + chat_toggles ^= CHAT_GHOSTWHISPER + + if("ghost_radio") + chat_toggles ^= CHAT_GHOSTRADIO + + if("ghost_pda") + chat_toggles ^= CHAT_GHOSTPDA + + if("pull_requests") + chat_toggles ^= CHAT_PULLR + + if("allow_midround_antag") + toggles ^= MIDROUND_ANTAG + + if("parallaxup") + parallax = Wrap(parallax + 1, PARALLAX_INSANE, PARALLAX_DISABLE + 1) + if (parent && parent.mob && parent.mob.hud_used) + parent.mob.hud_used.update_parallax_pref(parent.mob) + + if("parallaxdown") + parallax = Wrap(parallax - 1, PARALLAX_INSANE, PARALLAX_DISABLE + 1) + if (parent && parent.mob && parent.mob.hud_used) + parent.mob.hud_used.update_parallax_pref(parent.mob) + + if("save") + save_preferences() + save_character() + + if("load") + load_preferences() + load_character() + attempt_vr(parent.prefs_vr,"load_vore","") + + if("changeslot") + attempt_vr(parent.prefs_vr,"load_vore","") + if(!load_character(text2num(href_list["num"]))) + random_character() + real_name = random_unique_name(gender) + save_character() + + if("tab") + if (href_list["tab"]) + current_tab = text2num(href_list["tab"]) + + ShowChoices(user) + return 1 + +/datum/preferences/proc/copy_to(mob/living/carbon/human/character, icon_updates = 1) + if(be_random_name) + real_name = pref_species.random_name(gender) + + if(be_random_body) + random_character(gender) + + if(config.humans_need_surnames) + var/firstspace = findtext(real_name, " ") + var/name_length = length(real_name) + if(!firstspace) //we need a surname + real_name += " [pick(GLOB.last_names)]" + else if(firstspace == name_length) + real_name += "[pick(GLOB.last_names)]" + + character.real_name = real_name + character.name = character.real_name + + character.gender = gender + character.age = age + + character.eye_color = eye_color + var/obj/item/organ/eyes/organ_eyes = character.getorgan(/obj/item/organ/eyes) + if(organ_eyes) + if(!initial(organ_eyes.eye_color)) + organ_eyes.eye_color = eye_color + organ_eyes.old_eye_color = eye_color + character.hair_color = hair_color + character.facial_hair_color = facial_hair_color + + character.skin_tone = skin_tone + character.hair_style = hair_style + character.facial_hair_style = facial_hair_style + character.underwear = underwear + character.undershirt = undershirt + character.socks = socks + + character.backbag = backbag + + character.dna.features = features.Copy() + character.dna.real_name = character.real_name + var/datum/species/chosen_species + if(pref_species != /datum/species/human && config.mutant_races) + chosen_species = pref_species.type + else + chosen_species = /datum/species/human + character.set_species(chosen_species, icon_update=0) + + //citadel code + character.give_genitals() + character.flavor_text = flavor_text + character.canbearoused = arousable + + if(icon_updates) + character.update_body() + character.update_hair() + character.update_body_parts() diff --git a/code/modules/clothing/head/jobs.dm b/code/modules/clothing/head/jobs.dm index e457caed32..083332c3bd 100644 --- a/code/modules/clothing/head/jobs.dm +++ b/code/modules/clothing/head/jobs.dm @@ -1,162 +1,162 @@ - -//Chef -/obj/item/clothing/head/chefhat - name = "chef's hat" - item_state = "chef" - icon_state = "chef" - desc = "The commander in chef's head wear." - strip_delay = 10 - put_on_delay = 10 - dog_fashion = /datum/dog_fashion/head/chef - -/obj/item/clothing/head/chefhat/suicide_act(mob/user) - user.visible_message("[user] is donning [src]! It looks like [user.p_theyre()] trying to become a chef.") - user.say("Bork Bork Bork!") - sleep(20) - user.visible_message("[user] climbs into an imaginary oven!") - user.say("BOOORK!") - playsound(user, 'sound/machines/ding.ogg', 50, 1) - return(FIRELOSS) - -//Captain -/obj/item/clothing/head/caphat - name = "captain's hat" - desc = "It's good being the king." - icon_state = "captain" - item_state = "that" - flags_inv = 0 - armor = list(melee = 25, bullet = 15, laser = 25, energy = 10, bomb = 25, bio = 0, rad = 0, fire = 50, acid = 50) - strip_delay = 60 - dog_fashion = /datum/dog_fashion/head/captain - -//Captain: This is no longer space-worthy -/obj/item/clothing/head/caphat/parade - name = "captain's parade cap" - desc = "Worn only by Captains with an abundance of class." - icon_state = "capcap" - - dog_fashion = null - - -//Head of Personnel -/obj/item/clothing/head/hopcap - name = "head of personnel's cap" - icon_state = "hopcap" - desc = "The symbol of true bureaucratic micromanagement." - armor = list(melee = 25, bullet = 15, laser = 25, energy = 10, bomb = 25, bio = 0, rad = 0, fire = 50, acid = 50) - dog_fashion = /datum/dog_fashion/head/hop - -//Chaplain -/obj/item/clothing/head/nun_hood - name = "nun hood" - desc = "Maximum piety in this star system." - icon_state = "nun_hood" - flags_inv = HIDEHAIR - flags_cover = HEADCOVERSEYES - -/obj/item/clothing/head/cage - name = "cage" - desc = "A cage that restrains the will of the self, allowing one to see the profane world for what it is." - alternate_worn_icon = 'icons/mob/large-worn-icons/64x64/head.dmi' - icon_state = "cage" - item_state = "cage" - worn_x_dimension = 64 - worn_y_dimension = 64 - - -/obj/item/clothing/head/witchunter_hat - name = "witchunter hat" - desc = "This hat saw much use back in the day." - icon_state = "witchhunterhat" - item_state = "witchhunterhat" - flags_cover = HEADCOVERSEYES - -//Detective -/obj/item/clothing/head/det_hat - name = "detective's fedora" - desc = "There's only one man who can sniff out the dirty stench of crime, and he's likely wearing this hat." - icon_state = "detective" - armor = list(melee = 25, bullet = 5, laser = 25, energy = 10, bomb = 0, bio = 0, rad = 0, fire = 30, acid = 50) - var/candy_cooldown = 0 - pockets = /obj/item/weapon/storage/internal/pocket/small/detective - dog_fashion = /datum/dog_fashion/head/detective - -/obj/item/clothing/head/det_hat/AltClick() - ..() - if(ismob(loc)) - var/mob/M = loc - if(candy_cooldown < world.time) - var/obj/item/weapon/reagent_containers/food/snacks/candy_corn/CC = new /obj/item/weapon/reagent_containers/food/snacks/candy_corn(src) - M.put_in_hands(CC) - to_chat(M, "You slip a candy corn from your hat.") - candy_cooldown = world.time+1200 - else - to_chat(M, "You just took a candy corn! You should wait a couple minutes, lest you burn through your stash.") - - -//Mime -/obj/item/clothing/head/beret - name = "beret" - desc = "A beret, a mime's favorite headwear." - icon_state = "beret" - - dog_fashion = /datum/dog_fashion/head/beret - -/obj/item/clothing/head/beret/highlander - desc = "That was white fabric. Was." - flags = NODROP - dog_fashion = null //THIS IS FOR SLAUGHTER, NOT PUPPIES - -//Security - -/obj/item/clothing/head/HoS - name = "head of security cap" - desc = "The robust standard-issue cap of the Head of Security. For showing the officers who's in charge." - icon_state = "hoscap" - armor = list(melee = 40, bullet = 30, laser = 25, energy = 10, bomb = 25, bio = 10, rad = 0, fire = 50, acid = 60) - strip_delay = 80 - -/obj/item/clothing/head/HoS/beret - name = "head of security beret" - desc = "A robust beret for the Head of Security, for looking stylish while not sacrificing protection." - icon_state = "hosberetblack" - -/obj/item/clothing/head/warden - name = "warden's police hat" - desc = "It's a special armored hat issued to the Warden of a security force. Protects the head from impacts." - icon_state = "policehelm" - armor = list(melee = 40, bullet = 30, laser = 30, energy = 10, bomb = 25, bio = 0, rad = 0, fire = 30, acid = 60) - strip_delay = 60 - dog_fashion = /datum/dog_fashion/head/warden - -/obj/item/clothing/head/beret/sec - name = "security beret" - desc = "A robust beret with the security insignia emblazoned on it. Uses reinforced fabric to offer sufficent protection." - icon_state = "beret_badge" - armor = list(melee = 40, bullet = 30, laser = 30,energy = 10, bomb = 25, bio = 0, rad = 0, fire = 20, acid = 50) - strip_delay = 60 - dog_fashion = null - -/obj/item/clothing/head/beret/sec/navyhos - name = "head of security's beret" - desc = "A special beret with the Head of Security's insignia emblazoned on it. A symbol of excellence, a badge of courage, a mark of distinction." - icon_state = "hosberet" - -/obj/item/clothing/head/beret/sec/navywarden - name = "warden's beret" - desc = "A special beret with the Warden's insignia emblazoned on it. For wardens with class." - icon_state = "wardenberet" - armor = list(melee = 40, bullet = 30, laser = 30, energy = 10, bomb = 25, bio = 0, rad = 0, fire = 30, acid = 50) - strip_delay = 60 - -/obj/item/clothing/head/beret/sec/navyofficer - desc = "A special beret with the security insignia emblazoned on it. For officers with class." - icon_state = "officerberet" - -//Curator -/obj/item/clothing/head/curator - name = "treasure hunter's fedora" - desc = "You got red text today kid, but it doesn't mean you have to like it." - icon_state = "curator" - armor = list(melee = 25, bullet = 5, laser = 25, energy = 10, bomb = 0, bio = 0, rad = 0, fire = 30, acid = 50) + +//Chef +/obj/item/clothing/head/chefhat + name = "chef's hat" + item_state = "chef" + icon_state = "chef" + desc = "The commander in chef's head wear." + strip_delay = 10 + put_on_delay = 10 + dog_fashion = /datum/dog_fashion/head/chef + +/obj/item/clothing/head/chefhat/suicide_act(mob/user) + user.visible_message("[user] is donning [src]! It looks like [user.p_theyre()] trying to become a chef.") + user.say("Bork Bork Bork!") + sleep(20) + user.visible_message("[user] climbs into an imaginary oven!") + user.say("BOOORK!") + playsound(user, 'sound/machines/ding.ogg', 50, 1) + return(FIRELOSS) + +//Captain +/obj/item/clothing/head/caphat + name = "captain's hat" + desc = "It's good being the king." + icon_state = "captain" + item_state = "that" + flags_inv = 0 + armor = list(melee = 25, bullet = 15, laser = 25, energy = 10, bomb = 25, bio = 0, rad = 0, fire = 50, acid = 50) + strip_delay = 60 + dog_fashion = /datum/dog_fashion/head/captain + +//Captain: This is no longer space-worthy +/obj/item/clothing/head/caphat/parade + name = "captain's parade cap" + desc = "Worn only by Captains with an abundance of class." + icon_state = "capcap" + + dog_fashion = null + + +//Head of Personnel +/obj/item/clothing/head/hopcap + name = "head of personnel's cap" + icon_state = "hopcap" + desc = "The symbol of true bureaucratic micromanagement." + armor = list(melee = 25, bullet = 15, laser = 25, energy = 10, bomb = 25, bio = 0, rad = 0, fire = 50, acid = 50) + dog_fashion = /datum/dog_fashion/head/hop + +//Chaplain +/obj/item/clothing/head/nun_hood + name = "nun hood" + desc = "Maximum piety in this star system." + icon_state = "nun_hood" + flags_inv = HIDEHAIR + flags_cover = HEADCOVERSEYES + +/obj/item/clothing/head/cage + name = "cage" + desc = "A cage that restrains the will of the self, allowing one to see the profane world for what it is." + alternate_worn_icon = 'icons/mob/large-worn-icons/64x64/head.dmi' + icon_state = "cage" + item_state = "cage" + worn_x_dimension = 64 + worn_y_dimension = 64 + + +/obj/item/clothing/head/witchunter_hat + name = "witchunter hat" + desc = "This hat saw much use back in the day." + icon_state = "witchhunterhat" + item_state = "witchhunterhat" + flags_cover = HEADCOVERSEYES + +//Detective +/obj/item/clothing/head/det_hat + name = "detective's fedora" + desc = "There's only one man who can sniff out the dirty stench of crime, and he's likely wearing this hat." + icon_state = "detective" + armor = list(melee = 25, bullet = 5, laser = 25, energy = 10, bomb = 0, bio = 0, rad = 0, fire = 30, acid = 50) + var/candy_cooldown = 0 + pockets = /obj/item/weapon/storage/internal/pocket/small/detective + dog_fashion = /datum/dog_fashion/head/detective + +/obj/item/clothing/head/det_hat/AltClick() + ..() + if(ismob(loc)) + var/mob/M = loc + if(candy_cooldown < world.time) + var/obj/item/weapon/reagent_containers/food/snacks/candy_corn/CC = new /obj/item/weapon/reagent_containers/food/snacks/candy_corn(src) + M.put_in_hands(CC) + to_chat(M, "You slip a candy corn from your hat.") + candy_cooldown = world.time+1200 + else + to_chat(M, "You just took a candy corn! You should wait a couple minutes, lest you burn through your stash.") + + +//Mime +/obj/item/clothing/head/beret + name = "beret" + desc = "A beret, a mime's favorite headwear." + icon_state = "beret" + + dog_fashion = /datum/dog_fashion/head/beret + +/obj/item/clothing/head/beret/highlander + desc = "That was white fabric. Was." + flags = NODROP + dog_fashion = null //THIS IS FOR SLAUGHTER, NOT PUPPIES + +//Security + +/obj/item/clothing/head/HoS + name = "head of security cap" + desc = "The robust standard-issue cap of the Head of Security. For showing the officers who's in charge." + icon_state = "hoscap" + armor = list(melee = 40, bullet = 30, laser = 25, energy = 10, bomb = 25, bio = 10, rad = 0, fire = 50, acid = 60) + strip_delay = 80 + +/obj/item/clothing/head/HoS/beret + name = "head of security beret" + desc = "A robust beret for the Head of Security, for looking stylish while not sacrificing protection." + icon_state = "hosberetblack" + +/obj/item/clothing/head/warden + name = "warden's police hat" + desc = "It's a special armored hat issued to the Warden of a security force. Protects the head from impacts." + icon_state = "policehelm" + armor = list(melee = 40, bullet = 30, laser = 30, energy = 10, bomb = 25, bio = 0, rad = 0, fire = 30, acid = 60) + strip_delay = 60 + dog_fashion = /datum/dog_fashion/head/warden + +/obj/item/clothing/head/beret/sec + name = "security beret" + desc = "A robust beret with the security insignia emblazoned on it. Uses reinforced fabric to offer sufficent protection." + icon_state = "beret_badge" + armor = list(melee = 40, bullet = 30, laser = 30,energy = 10, bomb = 25, bio = 0, rad = 0, fire = 20, acid = 50) + strip_delay = 60 + dog_fashion = null + +/obj/item/clothing/head/beret/sec/navyhos + name = "head of security's beret" + desc = "A special beret with the Head of Security's insignia emblazoned on it. A symbol of excellence, a badge of courage, a mark of distinction." + icon_state = "hosberet" + +/obj/item/clothing/head/beret/sec/navywarden + name = "warden's beret" + desc = "A special beret with the Warden's insignia emblazoned on it. For wardens with class." + icon_state = "wardenberet" + armor = list(melee = 40, bullet = 30, laser = 30, energy = 10, bomb = 25, bio = 0, rad = 0, fire = 30, acid = 50) + strip_delay = 60 + +/obj/item/clothing/head/beret/sec/navyofficer + desc = "A special beret with the security insignia emblazoned on it. For officers with class." + icon_state = "officerberet" + +//Curator +/obj/item/clothing/head/curator + name = "treasure hunter's fedora" + desc = "You got red text today kid, but it doesn't mean you have to like it." + icon_state = "curator" + armor = list(melee = 25, bullet = 5, laser = 25, energy = 10, bomb = 0, bio = 0, rad = 0, fire = 30, acid = 50) pockets = /obj/item/weapon/storage/internal/pocket/small \ No newline at end of file diff --git a/code/modules/clothing/outfits/standard.dm b/code/modules/clothing/outfits/standard.dm index 944d3a624e..6344ef22d7 100644 --- a/code/modules/clothing/outfits/standard.dm +++ b/code/modules/clothing/outfits/standard.dm @@ -242,6 +242,15 @@ R.set_frequency(GLOB.CENTCOM_FREQ) R.freqlock = 1 +/datum/outfit/ghost_cultist + name = "Cultist Ghost" + + uniform = /obj/item/clothing/under/color/black/ghost + suit = /obj/item/clothing/suit/cultrobes/alt/ghost + shoes = /obj/item/clothing/shoes/cult/alt/ghost + head = /obj/item/clothing/head/culthood/alt/ghost + r_hand = /obj/item/weapon/melee/cultblade/ghost + /datum/outfit/wizard name = "Blue Wizard" diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index 25e09b9af7..6643920e01 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -142,6 +142,9 @@ name = "cultist boots" icon_state = "cultalt" +/obj/item/clothing/shoes/cult/alt/ghost + flags = NODROP|DROPDEL + /obj/item/clothing/shoes/cyborg name = "cyborg boots" desc = "Shoes for a cyborg costume." diff --git a/code/modules/clothing/suits/jobs.dm b/code/modules/clothing/suits/jobs.dm index 61d9909e69..6774bf3f9e 100644 --- a/code/modules/clothing/suits/jobs.dm +++ b/code/modules/clothing/suits/jobs.dm @@ -1,188 +1,188 @@ -/* - * Job related - */ - -//Botanist -/obj/item/clothing/suit/apron - name = "apron" - desc = "A basic blue apron." - icon_state = "apron" - item_state = "apron" - blood_overlay_type = "armor" - body_parts_covered = CHEST|GROIN - allowed = list(/obj/item/weapon/reagent_containers/spray/plantbgone,/obj/item/device/plant_analyzer,/obj/item/seeds,/obj/item/weapon/reagent_containers/glass/bottle, /obj/item/weapon/reagent_containers/glass/beaker, /obj/item/weapon/cultivator,/obj/item/weapon/reagent_containers/spray/pestspray,/obj/item/weapon/hatchet,/obj/item/weapon/storage/bag/plants) - -//Captain -/obj/item/clothing/suit/captunic - name = "captain's parade tunic" - desc = "Worn by a Captain to show their class." - icon_state = "captunic" - item_state = "bio_suit" - body_parts_covered = CHEST|GROIN|LEGS|ARMS - flags_inv = HIDEJUMPSUIT - allowed = list(/obj/item/weapon/disk, /obj/item/weapon/stamp, /obj/item/weapon/reagent_containers/food/drinks/flask, /obj/item/weapon/melee, /obj/item/weapon/storage/lockbox/medal, /obj/item/device/assembly/flash/handheld, /obj/item/weapon/storage/box/matches, /obj/item/weapon/lighter, /obj/item/clothing/mask/cigarette, /obj/item/weapon/storage/fancy/cigarettes, /obj/item/weapon/tank/internals/emergency_oxygen) - -//Chaplain -/obj/item/clothing/suit/hooded/chaplain_hoodie - name = "chaplain hoodie" - desc = "This suit says to you 'hush'!" - icon_state = "chaplain_hoodie" - item_state = "chaplain_hoodie" - body_parts_covered = CHEST|GROIN|LEGS|ARMS - allowed = list(/obj/item/weapon/storage/book/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/internals/emergency_oxygen) - hoodtype = /obj/item/clothing/head/hooded/chaplain_hood - -/obj/item/clothing/head/hooded/chaplain_hood - name = "chaplain hood" - desc = "For protecting your identity when immolating demons." - icon_state = "chaplain_hood" - body_parts_covered = HEAD - flags_inv = HIDEHAIR|HIDEFACE|HIDEEARS - -/obj/item/clothing/suit/nun - name = "nun robe" - desc = "Maximum piety in this star system." - icon_state = "nun" - item_state = "nun" - body_parts_covered = CHEST|GROIN|LEGS|ARMS|HANDS - flags_inv = HIDESHOES|HIDEJUMPSUIT - allowed = list(/obj/item/weapon/storage/book/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/internals/emergency_oxygen) - -/obj/item/clothing/suit/studentuni - name = "student robe" - desc = "The uniform of a bygone institute of learning." - icon_state = "studentuni" - item_state = "studentuni" - body_parts_covered = ARMS|CHEST - allowed = list(/obj/item/weapon/storage/book/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/internals/emergency_oxygen) - -/obj/item/clothing/suit/witchhunter - name = "witchunter garb" - desc = "This worn outfit saw much use back in the day." - icon_state = "witchhunter" - item_state = "witchhunter" - body_parts_covered = CHEST|GROIN|LEGS|ARMS - allowed = list(/obj/item/weapon/storage/book/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/internals/emergency_oxygen) - -//Chef -/obj/item/clothing/suit/toggle/chef - name = "chef's apron" - desc = "An apron-jacket used by a high class chef." - icon_state = "chef" - item_state = "chef" - gas_transfer_coefficient = 0.90 - permeability_coefficient = 0.50 - body_parts_covered = CHEST|GROIN|ARMS - allowed = list(/obj/item/weapon/kitchen) - togglename = "sleeves" - -//Cook -/obj/item/clothing/suit/apron/chef - name = "cook's apron" - desc = "A basic, dull, white chef's apron." - icon_state = "apronchef" - item_state = "apronchef" - blood_overlay_type = "armor" - body_parts_covered = CHEST|GROIN - allowed = list(/obj/item/weapon/kitchen) - -//Detective -/obj/item/clothing/suit/det_suit - name = "trenchcoat" - desc = "An 18th-century multi-purpose trenchcoat. Someone who wears this means serious business." - icon_state = "detective" - item_state = "det_suit" - blood_overlay_type = "coat" - body_parts_covered = CHEST|GROIN|LEGS|ARMS - allowed = list(/obj/item/weapon/tank/internals/emergency_oxygen,/obj/item/weapon/reagent_containers/spray/pepper,/obj/item/device/flashlight,/obj/item/weapon/gun/energy,/obj/item/weapon/gun/ballistic,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/restraints/handcuffs,/obj/item/weapon/storage/fancy/cigarettes,/obj/item/weapon/lighter,/obj/item/device/detective_scanner,/obj/item/device/taperecorder,/obj/item/weapon/melee/classic_baton) - armor = list(melee = 25, bullet = 10, laser = 25, energy = 10, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 45) - cold_protection = CHEST|GROIN|LEGS|ARMS - heat_protection = CHEST|GROIN|LEGS|ARMS - -/obj/item/clothing/suit/det_suit/grey - name = "noir trenchcoat" - desc = "A hard-boiled private investigator's grey trenchcoat." - icon_state = "greydet" - item_state = "greydet" - -//Engineering -/obj/item/clothing/suit/hazardvest - name = "hazard vest" - desc = "A high-visibility vest used in work zones." - icon_state = "hazard" - item_state = "hazard" - blood_overlay_type = "armor" - allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/internals/emergency_oxygen,/obj/item/device/t_scanner,/obj/item/device/radio) - resistance_flags = 0 -//Lawyer -/obj/item/clothing/suit/toggle/lawyer - name = "blue suit jacket" - desc = "A snappy dress jacket." - icon_state = "suitjacket_blue" - item_state = "suitjacket_blue" - blood_overlay_type = "coat" - body_parts_covered = CHEST|ARMS - togglename = "buttons" - -/obj/item/clothing/suit/toggle/lawyer/purple - name = "purple suit jacket" - desc = "A foppish dress jacket." - icon_state = "suitjacket_purp" - item_state = "suitjacket_purp" - -/obj/item/clothing/suit/toggle/lawyer/black - name = "black suit jacket" - desc = "A professional suit jacket." - icon_state = "suitjacket_black" - item_state = "ro_suit" - - -//Mime -/obj/item/clothing/suit/suspenders - name = "suspenders" - desc = "They suspend the illusion of the mime's play." - icon = 'icons/obj/clothing/belts.dmi' - icon_state = "suspenders" - blood_overlay_type = "armor" //it's the less thing that I can put here - -//Security -/obj/item/clothing/suit/security/officer - name = "security officer's jacket" - desc = "This jacket is for those special occasions when a security officer isn't required to wear their armor." - icon_state = "officerbluejacket" - item_state = "officerbluejacket" - body_parts_covered = CHEST|ARMS - -/obj/item/clothing/suit/security/warden - name = "warden's jacket" - desc = "Perfectly suited for the warden that wants to leave an impression of style on those who visit the brig." - icon_state = "wardenbluejacket" - item_state = "wardenbluejacket" - body_parts_covered = CHEST|ARMS - -/obj/item/clothing/suit/security/hos - name = "head of security's jacket" - desc = "This piece of clothing was specifically designed for asserting superior authority." - icon_state = "hosbluejacket" - item_state = "hosbluejacket" - body_parts_covered = CHEST|ARMS - -//Surgeon -/obj/item/clothing/suit/apron/surgical - name = "surgical apron" - desc = "A sterile blue surgical apron." - icon_state = "surgical" - allowed = list(/obj/item/weapon/scalpel, /obj/item/weapon/surgical_drapes, /obj/item/weapon/cautery, /obj/item/weapon/hemostat, /obj/item/weapon/retractor) - -//Curator -/obj/item/clothing/suit/curator - name = "treasure hunter's coat" - desc = "Both fashionable and lightly armoured, this jacket is favoured by treasure hunters the galaxy over." - icon_state = "curator" - item_state = "curator" - blood_overlay_type = "coat" - body_parts_covered = CHEST|ARMS - allowed = list(/obj/item/weapon/tank/internals, /obj/item/weapon/melee/curator_whip) - armor = list(melee = 25, bullet = 10, laser = 25, energy = 10, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 45) - cold_protection = CHEST|ARMS - heat_protection = CHEST|ARMS +/* + * Job related + */ + +//Botanist +/obj/item/clothing/suit/apron + name = "apron" + desc = "A basic blue apron." + icon_state = "apron" + item_state = "apron" + blood_overlay_type = "armor" + body_parts_covered = CHEST|GROIN + allowed = list(/obj/item/weapon/reagent_containers/spray/plantbgone,/obj/item/device/plant_analyzer,/obj/item/seeds,/obj/item/weapon/reagent_containers/glass/bottle, /obj/item/weapon/reagent_containers/glass/beaker, /obj/item/weapon/cultivator,/obj/item/weapon/reagent_containers/spray/pestspray,/obj/item/weapon/hatchet,/obj/item/weapon/storage/bag/plants) + +//Captain +/obj/item/clothing/suit/captunic + name = "captain's parade tunic" + desc = "Worn by a Captain to show their class." + icon_state = "captunic" + item_state = "bio_suit" + body_parts_covered = CHEST|GROIN|LEGS|ARMS + flags_inv = HIDEJUMPSUIT + allowed = list(/obj/item/weapon/disk, /obj/item/weapon/stamp, /obj/item/weapon/reagent_containers/food/drinks/flask, /obj/item/weapon/melee, /obj/item/weapon/storage/lockbox/medal, /obj/item/device/assembly/flash/handheld, /obj/item/weapon/storage/box/matches, /obj/item/weapon/lighter, /obj/item/clothing/mask/cigarette, /obj/item/weapon/storage/fancy/cigarettes, /obj/item/weapon/tank/internals/emergency_oxygen) + +//Chaplain +/obj/item/clothing/suit/hooded/chaplain_hoodie + name = "chaplain hoodie" + desc = "This suit says to you 'hush'!" + icon_state = "chaplain_hoodie" + item_state = "chaplain_hoodie" + body_parts_covered = CHEST|GROIN|LEGS|ARMS + allowed = list(/obj/item/weapon/storage/book/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/internals/emergency_oxygen) + hoodtype = /obj/item/clothing/head/hooded/chaplain_hood + +/obj/item/clothing/head/hooded/chaplain_hood + name = "chaplain hood" + desc = "For protecting your identity when immolating demons." + icon_state = "chaplain_hood" + body_parts_covered = HEAD + flags_inv = HIDEHAIR|HIDEFACE|HIDEEARS + +/obj/item/clothing/suit/nun + name = "nun robe" + desc = "Maximum piety in this star system." + icon_state = "nun" + item_state = "nun" + body_parts_covered = CHEST|GROIN|LEGS|ARMS|HANDS + flags_inv = HIDESHOES|HIDEJUMPSUIT + allowed = list(/obj/item/weapon/storage/book/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/internals/emergency_oxygen) + +/obj/item/clothing/suit/studentuni + name = "student robe" + desc = "The uniform of a bygone institute of learning." + icon_state = "studentuni" + item_state = "studentuni" + body_parts_covered = ARMS|CHEST + allowed = list(/obj/item/weapon/storage/book/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/internals/emergency_oxygen) + +/obj/item/clothing/suit/witchhunter + name = "witchunter garb" + desc = "This worn outfit saw much use back in the day." + icon_state = "witchhunter" + item_state = "witchhunter" + body_parts_covered = CHEST|GROIN|LEGS|ARMS + allowed = list(/obj/item/weapon/storage/book/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/internals/emergency_oxygen) + +//Chef +/obj/item/clothing/suit/toggle/chef + name = "chef's apron" + desc = "An apron-jacket used by a high class chef." + icon_state = "chef" + item_state = "chef" + gas_transfer_coefficient = 0.90 + permeability_coefficient = 0.50 + body_parts_covered = CHEST|GROIN|ARMS + allowed = list(/obj/item/weapon/kitchen) + togglename = "sleeves" + +//Cook +/obj/item/clothing/suit/apron/chef + name = "cook's apron" + desc = "A basic, dull, white chef's apron." + icon_state = "apronchef" + item_state = "apronchef" + blood_overlay_type = "armor" + body_parts_covered = CHEST|GROIN + allowed = list(/obj/item/weapon/kitchen) + +//Detective +/obj/item/clothing/suit/det_suit + name = "trenchcoat" + desc = "An 18th-century multi-purpose trenchcoat. Someone who wears this means serious business." + icon_state = "detective" + item_state = "det_suit" + blood_overlay_type = "coat" + body_parts_covered = CHEST|GROIN|LEGS|ARMS + allowed = list(/obj/item/weapon/tank/internals/emergency_oxygen,/obj/item/weapon/reagent_containers/spray/pepper,/obj/item/device/flashlight,/obj/item/weapon/gun/energy,/obj/item/weapon/gun/ballistic,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/restraints/handcuffs,/obj/item/weapon/storage/fancy/cigarettes,/obj/item/weapon/lighter,/obj/item/device/detective_scanner,/obj/item/device/taperecorder,/obj/item/weapon/melee/classic_baton) + armor = list(melee = 25, bullet = 10, laser = 25, energy = 10, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 45) + cold_protection = CHEST|GROIN|LEGS|ARMS + heat_protection = CHEST|GROIN|LEGS|ARMS + +/obj/item/clothing/suit/det_suit/grey + name = "noir trenchcoat" + desc = "A hard-boiled private investigator's grey trenchcoat." + icon_state = "greydet" + item_state = "greydet" + +//Engineering +/obj/item/clothing/suit/hazardvest + name = "hazard vest" + desc = "A high-visibility vest used in work zones." + icon_state = "hazard" + item_state = "hazard" + blood_overlay_type = "armor" + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/internals/emergency_oxygen,/obj/item/device/t_scanner,/obj/item/device/radio) + resistance_flags = 0 +//Lawyer +/obj/item/clothing/suit/toggle/lawyer + name = "blue suit jacket" + desc = "A snappy dress jacket." + icon_state = "suitjacket_blue" + item_state = "suitjacket_blue" + blood_overlay_type = "coat" + body_parts_covered = CHEST|ARMS + togglename = "buttons" + +/obj/item/clothing/suit/toggle/lawyer/purple + name = "purple suit jacket" + desc = "A foppish dress jacket." + icon_state = "suitjacket_purp" + item_state = "suitjacket_purp" + +/obj/item/clothing/suit/toggle/lawyer/black + name = "black suit jacket" + desc = "A professional suit jacket." + icon_state = "suitjacket_black" + item_state = "ro_suit" + + +//Mime +/obj/item/clothing/suit/suspenders + name = "suspenders" + desc = "They suspend the illusion of the mime's play." + icon = 'icons/obj/clothing/belts.dmi' + icon_state = "suspenders" + blood_overlay_type = "armor" //it's the less thing that I can put here + +//Security +/obj/item/clothing/suit/security/officer + name = "security officer's jacket" + desc = "This jacket is for those special occasions when a security officer isn't required to wear their armor." + icon_state = "officerbluejacket" + item_state = "officerbluejacket" + body_parts_covered = CHEST|ARMS + +/obj/item/clothing/suit/security/warden + name = "warden's jacket" + desc = "Perfectly suited for the warden that wants to leave an impression of style on those who visit the brig." + icon_state = "wardenbluejacket" + item_state = "wardenbluejacket" + body_parts_covered = CHEST|ARMS + +/obj/item/clothing/suit/security/hos + name = "head of security's jacket" + desc = "This piece of clothing was specifically designed for asserting superior authority." + icon_state = "hosbluejacket" + item_state = "hosbluejacket" + body_parts_covered = CHEST|ARMS + +//Surgeon +/obj/item/clothing/suit/apron/surgical + name = "surgical apron" + desc = "A sterile blue surgical apron." + icon_state = "surgical" + allowed = list(/obj/item/weapon/scalpel, /obj/item/weapon/surgical_drapes, /obj/item/weapon/cautery, /obj/item/weapon/hemostat, /obj/item/weapon/retractor) + +//Curator +/obj/item/clothing/suit/curator + name = "treasure hunter's coat" + desc = "Both fashionable and lightly armoured, this jacket is favoured by treasure hunters the galaxy over." + icon_state = "curator" + item_state = "curator" + blood_overlay_type = "coat" + body_parts_covered = CHEST|ARMS + allowed = list(/obj/item/weapon/tank/internals, /obj/item/weapon/melee/curator_whip) + armor = list(melee = 25, bullet = 10, laser = 25, energy = 10, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 45) + cold_protection = CHEST|ARMS + heat_protection = CHEST|ARMS diff --git a/code/modules/clothing/under/color.dm b/code/modules/clothing/under/color.dm index 7e48b495f0..e4c79e2cfc 100644 --- a/code/modules/clothing/under/color.dm +++ b/code/modules/clothing/under/color.dm @@ -16,6 +16,9 @@ item_color = "black" resistance_flags = 0 +/obj/item/clothing/under/color/black/ghost + flags = NODROP|DROPDEL + /obj/item/clothing/under/color/grey name = "grey jumpsuit" desc = "A tasteful grey jumpsuit that reminds you of the good old days." diff --git a/code/modules/jobs/job_types/civilian.dm b/code/modules/jobs/job_types/civilian.dm index 062834ca03..fd01846467 100644 --- a/code/modules/jobs/job_types/civilian.dm +++ b/code/modules/jobs/job_types/civilian.dm @@ -1,201 +1,201 @@ -/* -Clown -*/ -/datum/job/clown - title = "Clown" - flag = CLOWN - department_head = list("Head of Personnel") - department_flag = CIVILIAN - faction = "Station" - total_positions = 1 - spawn_positions = 1 - supervisors = "the head of personnel" - selection_color = "#dddddd" - - outfit = /datum/outfit/job/clown - - access = list(GLOB.access_theatre) - minimal_access = list(GLOB.access_theatre) - -/datum/job/clown/after_spawn(mob/living/carbon/human/H, mob/M) - H.rename_self("clown", M.client) - -/datum/outfit/job/clown - name = "Clown" - jobtype = /datum/job/clown - - belt = /obj/item/device/pda/clown - uniform = /obj/item/clothing/under/rank/clown - shoes = /obj/item/clothing/shoes/clown_shoes - mask = /obj/item/clothing/mask/gas/clown_hat - l_pocket = /obj/item/weapon/bikehorn - r_pocket = /obj/item/toy/crayon/rainbow - backpack_contents = list( - /obj/item/weapon/stamp/clown = 1, - /obj/item/weapon/reagent_containers/spray/waterflower = 1, - /obj/item/weapon/reagent_containers/food/snacks/grown/banana = 1, - /obj/item/device/megaphone/clown = 1, - /obj/item/weapon/reagent_containers/food/drinks/soda_cans/canned_laughter = 1, - /obj/item/weapon/pneumatic_cannon/pie = 1 - ) - - implants = list(/obj/item/weapon/implant/sad_trombone) - - backpack = /obj/item/weapon/storage/backpack/clown - satchel = /obj/item/weapon/storage/backpack/clown - dufflebag = /obj/item/weapon/storage/backpack/dufflebag/clown //strangely has a duffle - - box = /obj/item/weapon/storage/box/hug/survival - - -/datum/outfit/job/clown/pre_equip(mob/living/carbon/human/H, visualsOnly = FALSE) - ..() - if(visualsOnly) - return - - H.fully_replace_character_name(H.real_name, pick(GLOB.clown_names)) - -/datum/outfit/job/clown/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) - ..() - if(visualsOnly) - return - - H.dna.add_mutation(CLOWNMUT) - -/* -Mime -*/ -/datum/job/mime - title = "Mime" - flag = MIME - department_head = list("Head of Personnel") - department_flag = CIVILIAN - faction = "Station" - total_positions = 1 - spawn_positions = 1 - supervisors = "the head of personnel" - selection_color = "#dddddd" - - outfit = /datum/outfit/job/mime - - access = list(GLOB.access_theatre) - minimal_access = list(GLOB.access_theatre) - -/datum/job/mime/after_spawn(mob/living/carbon/human/H, mob/M) - H.rename_self("mime", M.client) - -/datum/outfit/job/mime - name = "Mime" - jobtype = /datum/job/mime - - belt = /obj/item/device/pda/mime - uniform = /obj/item/clothing/under/rank/mime - mask = /obj/item/clothing/mask/gas/mime - gloves = /obj/item/clothing/gloves/color/white - head = /obj/item/clothing/head/beret - suit = /obj/item/clothing/suit/suspenders - backpack_contents = list(/obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing=1,\ - /obj/item/toy/crayon/mime=1) - - backpack = /obj/item/weapon/storage/backpack/mime - satchel = /obj/item/weapon/storage/backpack/mime - - -/datum/outfit/job/mime/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) - ..() - - if(visualsOnly) - return - - if(H.mind) - H.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/conjure/mime_wall(null)) - H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/mime/speak(null)) - H.mind.miming = 1 - -/* -Curator -*/ -/datum/job/curator - title = "Curator" - flag = CURATOR - department_head = list("Head of Personnel") - department_flag = CIVILIAN - faction = "Station" - total_positions = 1 - spawn_positions = 1 - supervisors = "the head of personnel" - selection_color = "#dddddd" - - outfit = /datum/outfit/job/curator - - access = list(GLOB.access_library) - minimal_access = list(GLOB.access_library, GLOB.access_construction,GLOB.access_mining_station) - -/datum/outfit/job/curator - name = "Curator" - jobtype = /datum/job/curator - - belt = /obj/item/device/pda/curator - uniform = /obj/item/clothing/under/rank/curator - l_hand = /obj/item/weapon/storage/bag/books - r_pocket = /obj/item/key/displaycase - l_pocket = /obj/item/device/laser_pointer - backpack_contents = list( - /obj/item/weapon/melee/curator_whip = 1, - /obj/item/soapstone = 1, - /obj/item/weapon/barcodescanner = 1 - ) - - -/datum/outfit/job/curator/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) - ..() - - if(visualsOnly) - return - - H.grant_all_languages(omnitongue=TRUE) - -/* -Lawyer -*/ -/datum/job/lawyer - title = "Lawyer" - flag = LAWYER - department_head = list("Head of Personnel") - department_flag = CIVILIAN - faction = "Station" - total_positions = 2 - spawn_positions = 2 - supervisors = "the head of personnel" - selection_color = "#dddddd" - var/lawyers = 0 //Counts lawyer amount - - outfit = /datum/outfit/job/lawyer - - access = list(GLOB.access_lawyer, GLOB.access_court, GLOB.access_sec_doors) - minimal_access = list(GLOB.access_lawyer, GLOB.access_court, GLOB.access_sec_doors) - -/datum/outfit/job/lawyer - name = "Lawyer" - jobtype = /datum/job/lawyer - - belt = /obj/item/device/pda/lawyer - ears = /obj/item/device/radio/headset/headset_sec - uniform = /obj/item/clothing/under/lawyer/bluesuit - suit = /obj/item/clothing/suit/toggle/lawyer - shoes = /obj/item/clothing/shoes/laceup - l_hand = /obj/item/weapon/storage/briefcase/lawyer - l_pocket = /obj/item/device/laser_pointer - r_pocket = /obj/item/clothing/tie/lawyers_badge - - -/datum/outfit/job/lawyer/pre_equip(mob/living/carbon/human/H, visualsOnly = FALSE) - ..() - if(visualsOnly) - return - - var/datum/job/lawyer/J = SSjob.GetJobType(jobtype) - J.lawyers++ - if(J.lawyers>1) - uniform = /obj/item/clothing/under/lawyer/purpsuit - suit = /obj/item/clothing/suit/toggle/lawyer/purple +/* +Clown +*/ +/datum/job/clown + title = "Clown" + flag = CLOWN + department_head = list("Head of Personnel") + department_flag = CIVILIAN + faction = "Station" + total_positions = 1 + spawn_positions = 1 + supervisors = "the head of personnel" + selection_color = "#dddddd" + + outfit = /datum/outfit/job/clown + + access = list(GLOB.access_theatre) + minimal_access = list(GLOB.access_theatre) + +/datum/job/clown/after_spawn(mob/living/carbon/human/H, mob/M) + H.rename_self("clown", M.client) + +/datum/outfit/job/clown + name = "Clown" + jobtype = /datum/job/clown + + belt = /obj/item/device/pda/clown + uniform = /obj/item/clothing/under/rank/clown + shoes = /obj/item/clothing/shoes/clown_shoes + mask = /obj/item/clothing/mask/gas/clown_hat + l_pocket = /obj/item/weapon/bikehorn + r_pocket = /obj/item/toy/crayon/rainbow + backpack_contents = list( + /obj/item/weapon/stamp/clown = 1, + /obj/item/weapon/reagent_containers/spray/waterflower = 1, + /obj/item/weapon/reagent_containers/food/snacks/grown/banana = 1, + /obj/item/device/megaphone/clown = 1, + /obj/item/weapon/reagent_containers/food/drinks/soda_cans/canned_laughter = 1, + /obj/item/weapon/pneumatic_cannon/pie = 1 + ) + + implants = list(/obj/item/weapon/implant/sad_trombone) + + backpack = /obj/item/weapon/storage/backpack/clown + satchel = /obj/item/weapon/storage/backpack/clown + dufflebag = /obj/item/weapon/storage/backpack/dufflebag/clown //strangely has a duffle + + box = /obj/item/weapon/storage/box/hug/survival + + +/datum/outfit/job/clown/pre_equip(mob/living/carbon/human/H, visualsOnly = FALSE) + ..() + if(visualsOnly) + return + + H.fully_replace_character_name(H.real_name, pick(GLOB.clown_names)) + +/datum/outfit/job/clown/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) + ..() + if(visualsOnly) + return + + H.dna.add_mutation(CLOWNMUT) + +/* +Mime +*/ +/datum/job/mime + title = "Mime" + flag = MIME + department_head = list("Head of Personnel") + department_flag = CIVILIAN + faction = "Station" + total_positions = 1 + spawn_positions = 1 + supervisors = "the head of personnel" + selection_color = "#dddddd" + + outfit = /datum/outfit/job/mime + + access = list(GLOB.access_theatre) + minimal_access = list(GLOB.access_theatre) + +/datum/job/mime/after_spawn(mob/living/carbon/human/H, mob/M) + H.rename_self("mime", M.client) + +/datum/outfit/job/mime + name = "Mime" + jobtype = /datum/job/mime + + belt = /obj/item/device/pda/mime + uniform = /obj/item/clothing/under/rank/mime + mask = /obj/item/clothing/mask/gas/mime + gloves = /obj/item/clothing/gloves/color/white + head = /obj/item/clothing/head/beret + suit = /obj/item/clothing/suit/suspenders + backpack_contents = list(/obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing=1,\ + /obj/item/toy/crayon/mime=1) + + backpack = /obj/item/weapon/storage/backpack/mime + satchel = /obj/item/weapon/storage/backpack/mime + + +/datum/outfit/job/mime/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) + ..() + + if(visualsOnly) + return + + if(H.mind) + H.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/conjure/mime_wall(null)) + H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/mime/speak(null)) + H.mind.miming = 1 + +/* +Curator +*/ +/datum/job/curator + title = "Curator" + flag = CURATOR + department_head = list("Head of Personnel") + department_flag = CIVILIAN + faction = "Station" + total_positions = 1 + spawn_positions = 1 + supervisors = "the head of personnel" + selection_color = "#dddddd" + + outfit = /datum/outfit/job/curator + + access = list(GLOB.access_library) + minimal_access = list(GLOB.access_library, GLOB.access_construction,GLOB.access_mining_station) + +/datum/outfit/job/curator + name = "Curator" + jobtype = /datum/job/curator + + belt = /obj/item/device/pda/curator + uniform = /obj/item/clothing/under/rank/curator + l_hand = /obj/item/weapon/storage/bag/books + r_pocket = /obj/item/key/displaycase + l_pocket = /obj/item/device/laser_pointer + backpack_contents = list( + /obj/item/weapon/melee/curator_whip = 1, + /obj/item/soapstone = 1, + /obj/item/weapon/barcodescanner = 1 + ) + + +/datum/outfit/job/curator/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) + ..() + + if(visualsOnly) + return + + H.grant_all_languages(omnitongue=TRUE) + +/* +Lawyer +*/ +/datum/job/lawyer + title = "Lawyer" + flag = LAWYER + department_head = list("Head of Personnel") + department_flag = CIVILIAN + faction = "Station" + total_positions = 2 + spawn_positions = 2 + supervisors = "the head of personnel" + selection_color = "#dddddd" + var/lawyers = 0 //Counts lawyer amount + + outfit = /datum/outfit/job/lawyer + + access = list(GLOB.access_lawyer, GLOB.access_court, GLOB.access_sec_doors) + minimal_access = list(GLOB.access_lawyer, GLOB.access_court, GLOB.access_sec_doors) + +/datum/outfit/job/lawyer + name = "Lawyer" + jobtype = /datum/job/lawyer + + belt = /obj/item/device/pda/lawyer + ears = /obj/item/device/radio/headset/headset_sec + uniform = /obj/item/clothing/under/lawyer/bluesuit + suit = /obj/item/clothing/suit/toggle/lawyer + shoes = /obj/item/clothing/shoes/laceup + l_hand = /obj/item/weapon/storage/briefcase/lawyer + l_pocket = /obj/item/device/laser_pointer + r_pocket = /obj/item/clothing/tie/lawyers_badge + + +/datum/outfit/job/lawyer/pre_equip(mob/living/carbon/human/H, visualsOnly = FALSE) + ..() + if(visualsOnly) + return + + var/datum/job/lawyer/J = SSjob.GetJobType(jobtype) + J.lawyers++ + if(J.lawyers>1) + uniform = /obj/item/clothing/under/lawyer/purpsuit + suit = /obj/item/clothing/suit/toggle/lawyer/purple diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index b5214f18a3..926e88787e 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -241,7 +241,7 @@ return 1 /mob/living/proc/InCritical() - return (src.health < 0 && src.health > -95 && stat == UNCONSCIOUS) + return (health < 0 && health > -100 && stat == UNCONSCIOUS) //This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually //affects them once clothing is factored in. ~Errorage diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index c0f88e3641..7c2fcb178b 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -1,364 +1,364 @@ -/mob/living/simple_animal/hostile/construct - name = "Construct" - real_name = "Construct" - desc = "" - gender = NEUTER - speak_emote = list("hisses") - response_help = "thinks better of touching" - response_disarm = "flails at" - response_harm = "punches" - speak_chance = 1 - icon = 'icons/mob/mob.dmi' - speed = 0 - a_intent = INTENT_HARM - stop_automated_movement = 1 - status_flags = CANPUSH - attack_sound = 'sound/weapons/punch1.ogg' - see_in_dark = 7 - lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE - damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0) - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) - minbodytemp = 0 - maxbodytemp = INFINITY - healable = 0 - faction = list("cult") - movement_type = FLYING - pressure_resistance = 100 - unique_name = 1 - AIStatus = AI_OFF //normal constructs don't have AI - loot = list(/obj/item/weapon/ectoplasm) - del_on_death = TRUE - initial_language_holder = /datum/language_holder/construct - deathmessage = "collapses in a shattered heap." - var/list/construct_spells = list() - var/playstyle_string = "You are a generic construct! Your job is to not exist, and you should probably adminhelp this." - var/master = null - var/seeking = FALSE - var/can_repair_constructs = FALSE - var/can_repair_self = FALSE - -/mob/living/simple_animal/hostile/construct/Initialize() - . = ..() - update_health_hud() - for(var/spell in construct_spells) - AddSpell(new spell(null)) - -/mob/living/simple_animal/hostile/construct/Login() - ..() - to_chat(src, playstyle_string) - -/mob/living/simple_animal/hostile/construct/examine(mob/user) - var/t_He = p_they(TRUE) - var/t_s = p_s() - var/msg = "*---------*\nThis is \icon[src] \a [src]!\n" - msg += "[desc]\n" - if(health < maxHealth) - msg += "" - if(health >= maxHealth/2) - msg += "[t_He] look[t_s] slightly dented.\n" - else - msg += "[t_He] look[t_s] severely dented!\n" - msg += "" - msg += "*---------*" - - to_chat(user, msg) - -/mob/living/simple_animal/hostile/construct/attack_animal(mob/living/simple_animal/M) - if(isconstruct(M)) //is it a construct? - var/mob/living/simple_animal/hostile/construct/C = M - if(!C.can_repair_constructs || (C == src && !C.can_repair_self)) - return - if(health < maxHealth) - adjustHealth(-5) - if(src != M) - Beam(M,icon_state="sendbeam",time=4) - M.visible_message("[M] repairs some of \the [src]'s dents.", \ - "You repair some of [src]'s dents, leaving [src] at [health]/[maxHealth] health.") - else - M.visible_message("[M] repairs some of [p_their()] own dents.", \ - "You repair some of your own dents, leaving you at [M.health]/[M.maxHealth] health.") - else - if(src != M) - to_chat(M, "You cannot repair [src]'s dents, as [p_they()] [p_have()] none!") - else - to_chat(M, "You cannot repair your own dents, as you have none!") - else if(src != M) - return ..() - -/mob/living/simple_animal/hostile/construct/Process_Spacemove(movement_dir = 0) - return 1 - -/mob/living/simple_animal/hostile/construct/narsie_act() - return - -/mob/living/simple_animal/hostile/construct/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0, illusion = 0, stun = TRUE) - return 0 - -/mob/living/simple_animal/hostile/construct/adjustHealth(amount, updating_health = TRUE, forced = FALSE) - . = ..() - if(updating_health) - update_health_hud() - -/////////////////Juggernaut/////////////// -/mob/living/simple_animal/hostile/construct/armored - name = "Juggernaut" - real_name = "Juggernaut" - desc = "A massive, armored construct built to spearhead attacks and soak up enemy fire." - icon_state = "behemoth" - icon_living = "behemoth" - maxHealth = 250 - health = 250 - response_harm = "harmlessly punches" - harm_intent_damage = 0 - obj_damage = 90 - melee_damage_lower = 30 - melee_damage_upper = 30 - attacktext = "smashes their armored gauntlet into" - speed = 3 - environment_smash = 2 - attack_sound = 'sound/weapons/punch3.ogg' - status_flags = 0 - mob_size = MOB_SIZE_LARGE - force_threshold = 11 - construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/lesserforcewall) - playstyle_string = "You are a Juggernaut. Though slow, your shell can withstand extreme punishment, \ - create shield walls, rip apart enemies and walls alike, and even deflect energy weapons." - -/mob/living/simple_animal/hostile/construct/armored/hostile //actually hostile, will move around, hit things - AIStatus = AI_ON - environment_smash = 1 //only token destruction, don't smash the cult wall NO STOP - -/mob/living/simple_animal/hostile/construct/armored/bullet_act(obj/item/projectile/P) - if(istype(P, /obj/item/projectile/energy) || istype(P, /obj/item/projectile/beam)) - var/reflectchance = 80 - round(P.damage/3) - if(prob(reflectchance)) - apply_damage(P.damage * 0.5, P.damage_type) - visible_message("The [P.name] is reflected by [src]'s armored shell!", \ - "The [P.name] is reflected by your armored shell!") - - // Find a turf near or on the original location to bounce to - if(P.starting) - var/new_x = P.starting.x + pick(0, 0, -1, 1, -2, 2, -2, 2, -2, 2, -3, 3, -3, 3) - var/new_y = P.starting.y + pick(0, 0, -1, 1, -2, 2, -2, 2, -2, 2, -3, 3, -3, 3) - var/turf/curloc = get_turf(src) - - // redirect the projectile - P.original = locate(new_x, new_y, P.z) - P.starting = curloc - P.current = curloc - P.firer = src - P.yo = new_y - curloc.y - P.xo = new_x - curloc.x - - return -1 // complete projectile permutation - - return (..(P)) - - - -////////////////////////Wraith///////////////////////////////////////////// -/mob/living/simple_animal/hostile/construct/wraith - name = "Wraith" - real_name = "Wraith" - desc = "A wicked, clawed shell constructed to assassinate enemies and sow chaos behind enemy lines." - icon_state = "floating" - icon_living = "floating" - maxHealth = 75 - health = 75 - melee_damage_lower = 25 - melee_damage_upper = 25 - retreat_distance = 2 //AI wraiths will move in and out of combat - attacktext = "slashes" - attack_sound = 'sound/weapons/bladeslice.ogg' - construct_spells = list(/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift) - playstyle_string = "You are a Wraith. Though relatively fragile, you are fast, deadly, and even able to phase through walls." - -/mob/living/simple_animal/hostile/construct/wraith/hostile //actually hostile, will move around, hit things - AIStatus = AI_ON - - - -/////////////////////////////Artificer///////////////////////// -/mob/living/simple_animal/hostile/construct/builder - name = "Artificer" - real_name = "Artificer" - desc = "A bulbous construct dedicated to building and maintaining the Cult of Nar-Sie's armies." - icon_state = "artificer" - icon_living = "artificer" - maxHealth = 50 - health = 50 - response_harm = "viciously beats" - harm_intent_damage = 5 - obj_damage = 60 - melee_damage_lower = 5 - melee_damage_upper = 5 - retreat_distance = 10 - minimum_distance = 10 //AI artificers will flee like fuck - attacktext = "rams" - environment_smash = 2 - attack_sound = 'sound/weapons/punch2.ogg' - construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/wall, - /obj/effect/proc_holder/spell/aoe_turf/conjure/floor, - /obj/effect/proc_holder/spell/aoe_turf/conjure/soulstone, - /obj/effect/proc_holder/spell/aoe_turf/conjure/construct/lesser, - /obj/effect/proc_holder/spell/targeted/projectile/magic_missile/lesser) - playstyle_string = "You are an Artificer. You are incredibly weak and fragile, but you are able to construct fortifications, \ - use magic missile, repair allied constructs, shades, and yourself (by clicking on them), \ - and, most important of all, create new constructs by producing soulstones to capture souls, \ - and shells to place those soulstones into." - can_repair_constructs = TRUE - can_repair_self = TRUE - -/mob/living/simple_animal/hostile/construct/builder/Found(atom/A) //what have we found here? - if(isconstruct(A)) //is it a construct? - var/mob/living/simple_animal/hostile/construct/C = A - if(C.health < C.maxHealth) //is it hurt? let's go heal it if it is - return 1 - else - return 0 - else - return 0 - -/mob/living/simple_animal/hostile/construct/builder/CanAttack(atom/the_target) - if(see_invisible < the_target.invisibility)//Target's invisible to us, forget it - return 0 - if(Found(the_target) || ..()) //If we Found it or Can_Attack it normally, we Can_Attack it as long as it wasn't invisible - return 1 //as a note this shouldn't be added to base hostile mobs because it'll mess up retaliate hostile mobs - -/mob/living/simple_animal/hostile/construct/builder/MoveToTarget(var/list/possible_targets) - ..() - if(isliving(target)) - var/mob/living/L = target - if(isconstruct(L) && L.health >= L.maxHealth) //is this target an unhurt construct? stop trying to heal it - LoseTarget() - return 0 - if(L.health <= melee_damage_lower+melee_damage_upper) //ey bucko you're hurt as fuck let's go hit you - retreat_distance = null - minimum_distance = 1 - -/mob/living/simple_animal/hostile/construct/builder/Aggro() - ..() - if(isconstruct(target)) //oh the target is a construct no need to flee - retreat_distance = null - minimum_distance = 1 - -/mob/living/simple_animal/hostile/construct/builder/LoseAggro() - ..() - retreat_distance = initial(retreat_distance) - minimum_distance = initial(minimum_distance) - -/mob/living/simple_animal/hostile/construct/builder/hostile //actually hostile, will move around, hit things, heal other constructs - AIStatus = AI_ON - environment_smash = 1 //only token destruction, don't smash the cult wall NO STOP - -/////////////////////////////Non-cult Artificer///////////////////////// -/mob/living/simple_animal/hostile/construct/builder/noncult - construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/wall, - /obj/effect/proc_holder/spell/aoe_turf/conjure/floor, - /obj/effect/proc_holder/spell/aoe_turf/conjure/soulstone/noncult, - /obj/effect/proc_holder/spell/aoe_turf/conjure/construct/lesser, - /obj/effect/proc_holder/spell/targeted/projectile/magic_missile/lesser) - - -/////////////////////////////Harvester///////////////////////// -/mob/living/simple_animal/hostile/construct/harvester - name = "Harvester" - real_name = "Harvester" - desc = "A long, thin construct built to herald Nar-Sie's rise. It'll be all over soon." - icon_state = "harvester" - icon_living = "harvester" - maxHealth = 60 - health = 60 - sight = SEE_MOBS - melee_damage_lower = 15 - melee_damage_upper = 20 - attacktext = "butchers" - attack_sound = 'sound/weapons/bladeslice.ogg' - construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/area_conversion, - /obj/effect/proc_holder/spell/aoe_turf/conjure/lesserforcewall) - playstyle_string = "You are a Harvester. You are incapable of directly killing humans, but your attacks will remove their limbs: \ - Bring those who still cling to this world of illusion back to the Geometer so they may know Truth." - can_repair_constructs = TRUE - -/mob/living/simple_animal/hostile/construct/harvester/Bump(atom/AM) - . = ..() - if(istype(AM, /turf/closed/wall/mineral/cult) && AM != loc) //we can go through cult walls - var/atom/movable/stored_pulling = pulling - if(stored_pulling) - stored_pulling.setDir(get_dir(stored_pulling.loc, loc)) - stored_pulling.forceMove(loc) - forceMove(AM) - if(stored_pulling) - start_pulling(stored_pulling, TRUE) //drag anything we're pulling through the wall with us by magic - -/mob/living/simple_animal/hostile/construct/harvester/AttackingTarget() - if(iscarbon(target)) - var/mob/living/carbon/C = target - var/list/parts = list() - var/undismembermerable_limbs = 0 - for(var/X in C.bodyparts) - var/obj/item/bodypart/BP = X - if(BP.body_part != HEAD && BP.body_part != CHEST) - if(BP.dismemberable) - parts += BP - else - undismembermerable_limbs++ - if(!LAZYLEN(parts)) - if(undismembermerable_limbs) //they have limbs we can't remove, and no parts we can, attack! - return ..() - to_chat(src, "\"Bring [C.p_them()] to me.\"") - return FALSE - do_attack_animation(C) - var/obj/item/bodypart/BP = pick(parts) - BP.dismember() - return FALSE - . = ..() - - -///////////////////////Master-Tracker/////////////////////// - -/datum/action/innate/seek_master - name = "Seek your Master" - desc = "You and your master share a soul-link that informs you of their location" - background_icon_state = "bg_demon" - buttontooltipstyle = "cult" - button_icon_state = "cult_mark" - var/tracking = FALSE - var/mob/living/simple_animal/hostile/construct/the_construct - -/datum/action/innate/seek_master/Grant(var/mob/living/C) - the_construct = C - ..() - -/datum/action/innate/seek_master/Activate() - if(!the_construct.master) - to_chat(the_construct, "You have no master to seek!") - the_construct.seeking = FALSE - return - if(tracking) - tracking = FALSE - the_construct.seeking = FALSE - to_chat(the_construct, "You are no longer tracking your master.") - return - else - tracking = TRUE - the_construct.seeking = TRUE - to_chat(the_construct, "You are now tracking your master.") - - -/////////////////////////////ui stuff///////////////////////////// - -/mob/living/simple_animal/hostile/construct/update_health_hud() - if(hud_used) - if(health >= maxHealth) - hud_used.healths.icon_state = "[icon_state]_health0" - else if(health > maxHealth*0.8) - hud_used.healths.icon_state = "[icon_state]_health2" - else if(health > maxHealth*0.6) - hud_used.healths.icon_state = "[icon_state]_health3" - else if(health > maxHealth*0.4) - hud_used.healths.icon_state = "[icon_state]_health4" - else if(health > maxHealth*0.2) - hud_used.healths.icon_state = "[icon_state]_health5" - else - hud_used.healths.icon_state = "[icon_state]_health6" +/mob/living/simple_animal/hostile/construct + name = "Construct" + real_name = "Construct" + desc = "" + gender = NEUTER + speak_emote = list("hisses") + response_help = "thinks better of touching" + response_disarm = "flails at" + response_harm = "punches" + speak_chance = 1 + icon = 'icons/mob/mob.dmi' + speed = 0 + a_intent = INTENT_HARM + stop_automated_movement = 1 + status_flags = CANPUSH + attack_sound = 'sound/weapons/punch1.ogg' + see_in_dark = 7 + lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE + damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0) + atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + minbodytemp = 0 + maxbodytemp = INFINITY + healable = 0 + faction = list("cult") + movement_type = FLYING + pressure_resistance = 100 + unique_name = 1 + AIStatus = AI_OFF //normal constructs don't have AI + loot = list(/obj/item/weapon/ectoplasm) + del_on_death = TRUE + initial_language_holder = /datum/language_holder/construct + deathmessage = "collapses in a shattered heap." + var/list/construct_spells = list() + var/playstyle_string = "You are a generic construct! Your job is to not exist, and you should probably adminhelp this." + var/master = null + var/seeking = FALSE + var/can_repair_constructs = FALSE + var/can_repair_self = FALSE + +/mob/living/simple_animal/hostile/construct/Initialize() + . = ..() + update_health_hud() + for(var/spell in construct_spells) + AddSpell(new spell(null)) + +/mob/living/simple_animal/hostile/construct/Login() + ..() + to_chat(src, playstyle_string) + +/mob/living/simple_animal/hostile/construct/examine(mob/user) + var/t_He = p_they(TRUE) + var/t_s = p_s() + var/msg = "*---------*\nThis is \icon[src] \a [src]!\n" + msg += "[desc]\n" + if(health < maxHealth) + msg += "" + if(health >= maxHealth/2) + msg += "[t_He] look[t_s] slightly dented.\n" + else + msg += "[t_He] look[t_s] severely dented!\n" + msg += "" + msg += "*---------*" + + to_chat(user, msg) + +/mob/living/simple_animal/hostile/construct/attack_animal(mob/living/simple_animal/M) + if(isconstruct(M)) //is it a construct? + var/mob/living/simple_animal/hostile/construct/C = M + if(!C.can_repair_constructs || (C == src && !C.can_repair_self)) + return + if(health < maxHealth) + adjustHealth(-5) + if(src != M) + Beam(M,icon_state="sendbeam",time=4) + M.visible_message("[M] repairs some of \the [src]'s dents.", \ + "You repair some of [src]'s dents, leaving [src] at [health]/[maxHealth] health.") + else + M.visible_message("[M] repairs some of [p_their()] own dents.", \ + "You repair some of your own dents, leaving you at [M.health]/[M.maxHealth] health.") + else + if(src != M) + to_chat(M, "You cannot repair [src]'s dents, as [p_they()] [p_have()] none!") + else + to_chat(M, "You cannot repair your own dents, as you have none!") + else if(src != M) + return ..() + +/mob/living/simple_animal/hostile/construct/Process_Spacemove(movement_dir = 0) + return 1 + +/mob/living/simple_animal/hostile/construct/narsie_act() + return + +/mob/living/simple_animal/hostile/construct/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0, illusion = 0, stun = TRUE) + return 0 + +/mob/living/simple_animal/hostile/construct/adjustHealth(amount, updating_health = TRUE, forced = FALSE) + . = ..() + if(updating_health) + update_health_hud() + +/////////////////Juggernaut/////////////// +/mob/living/simple_animal/hostile/construct/armored + name = "Juggernaut" + real_name = "Juggernaut" + desc = "A massive, armored construct built to spearhead attacks and soak up enemy fire." + icon_state = "behemoth" + icon_living = "behemoth" + maxHealth = 250 + health = 250 + response_harm = "harmlessly punches" + harm_intent_damage = 0 + obj_damage = 90 + melee_damage_lower = 30 + melee_damage_upper = 30 + attacktext = "smashes their armored gauntlet into" + speed = 3 + environment_smash = 2 + attack_sound = 'sound/weapons/punch3.ogg' + status_flags = 0 + mob_size = MOB_SIZE_LARGE + force_threshold = 11 + construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/lesserforcewall) + playstyle_string = "You are a Juggernaut. Though slow, your shell can withstand extreme punishment, \ + create shield walls, rip apart enemies and walls alike, and even deflect energy weapons." + +/mob/living/simple_animal/hostile/construct/armored/hostile //actually hostile, will move around, hit things + AIStatus = AI_ON + environment_smash = 1 //only token destruction, don't smash the cult wall NO STOP + +/mob/living/simple_animal/hostile/construct/armored/bullet_act(obj/item/projectile/P) + if(istype(P, /obj/item/projectile/energy) || istype(P, /obj/item/projectile/beam)) + var/reflectchance = 80 - round(P.damage/3) + if(prob(reflectchance)) + apply_damage(P.damage * 0.5, P.damage_type) + visible_message("The [P.name] is reflected by [src]'s armored shell!", \ + "The [P.name] is reflected by your armored shell!") + + // Find a turf near or on the original location to bounce to + if(P.starting) + var/new_x = P.starting.x + pick(0, 0, -1, 1, -2, 2, -2, 2, -2, 2, -3, 3, -3, 3) + var/new_y = P.starting.y + pick(0, 0, -1, 1, -2, 2, -2, 2, -2, 2, -3, 3, -3, 3) + var/turf/curloc = get_turf(src) + + // redirect the projectile + P.original = locate(new_x, new_y, P.z) + P.starting = curloc + P.current = curloc + P.firer = src + P.yo = new_y - curloc.y + P.xo = new_x - curloc.x + + return -1 // complete projectile permutation + + return (..(P)) + + + +////////////////////////Wraith///////////////////////////////////////////// +/mob/living/simple_animal/hostile/construct/wraith + name = "Wraith" + real_name = "Wraith" + desc = "A wicked, clawed shell constructed to assassinate enemies and sow chaos behind enemy lines." + icon_state = "floating" + icon_living = "floating" + maxHealth = 75 + health = 75 + melee_damage_lower = 25 + melee_damage_upper = 25 + retreat_distance = 2 //AI wraiths will move in and out of combat + attacktext = "slashes" + attack_sound = 'sound/weapons/bladeslice.ogg' + construct_spells = list(/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift) + playstyle_string = "You are a Wraith. Though relatively fragile, you are fast, deadly, and even able to phase through walls." + +/mob/living/simple_animal/hostile/construct/wraith/hostile //actually hostile, will move around, hit things + AIStatus = AI_ON + + + +/////////////////////////////Artificer///////////////////////// +/mob/living/simple_animal/hostile/construct/builder + name = "Artificer" + real_name = "Artificer" + desc = "A bulbous construct dedicated to building and maintaining the Cult of Nar-Sie's armies." + icon_state = "artificer" + icon_living = "artificer" + maxHealth = 50 + health = 50 + response_harm = "viciously beats" + harm_intent_damage = 5 + obj_damage = 60 + melee_damage_lower = 5 + melee_damage_upper = 5 + retreat_distance = 10 + minimum_distance = 10 //AI artificers will flee like fuck + attacktext = "rams" + environment_smash = 2 + attack_sound = 'sound/weapons/punch2.ogg' + construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/wall, + /obj/effect/proc_holder/spell/aoe_turf/conjure/floor, + /obj/effect/proc_holder/spell/aoe_turf/conjure/soulstone, + /obj/effect/proc_holder/spell/aoe_turf/conjure/construct/lesser, + /obj/effect/proc_holder/spell/targeted/projectile/magic_missile/lesser) + playstyle_string = "You are an Artificer. You are incredibly weak and fragile, but you are able to construct fortifications, \ + use magic missile, repair allied constructs, shades, and yourself (by clicking on them), \ + and, most important of all, create new constructs by producing soulstones to capture souls, \ + and shells to place those soulstones into." + can_repair_constructs = TRUE + can_repair_self = TRUE + +/mob/living/simple_animal/hostile/construct/builder/Found(atom/A) //what have we found here? + if(isconstruct(A)) //is it a construct? + var/mob/living/simple_animal/hostile/construct/C = A + if(C.health < C.maxHealth) //is it hurt? let's go heal it if it is + return 1 + else + return 0 + else + return 0 + +/mob/living/simple_animal/hostile/construct/builder/CanAttack(atom/the_target) + if(see_invisible < the_target.invisibility)//Target's invisible to us, forget it + return 0 + if(Found(the_target) || ..()) //If we Found it or Can_Attack it normally, we Can_Attack it as long as it wasn't invisible + return 1 //as a note this shouldn't be added to base hostile mobs because it'll mess up retaliate hostile mobs + +/mob/living/simple_animal/hostile/construct/builder/MoveToTarget(var/list/possible_targets) + ..() + if(isliving(target)) + var/mob/living/L = target + if(isconstruct(L) && L.health >= L.maxHealth) //is this target an unhurt construct? stop trying to heal it + LoseTarget() + return 0 + if(L.health <= melee_damage_lower+melee_damage_upper) //ey bucko you're hurt as fuck let's go hit you + retreat_distance = null + minimum_distance = 1 + +/mob/living/simple_animal/hostile/construct/builder/Aggro() + ..() + if(isconstruct(target)) //oh the target is a construct no need to flee + retreat_distance = null + minimum_distance = 1 + +/mob/living/simple_animal/hostile/construct/builder/LoseAggro() + ..() + retreat_distance = initial(retreat_distance) + minimum_distance = initial(minimum_distance) + +/mob/living/simple_animal/hostile/construct/builder/hostile //actually hostile, will move around, hit things, heal other constructs + AIStatus = AI_ON + environment_smash = 1 //only token destruction, don't smash the cult wall NO STOP + +/////////////////////////////Non-cult Artificer///////////////////////// +/mob/living/simple_animal/hostile/construct/builder/noncult + construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/wall, + /obj/effect/proc_holder/spell/aoe_turf/conjure/floor, + /obj/effect/proc_holder/spell/aoe_turf/conjure/soulstone/noncult, + /obj/effect/proc_holder/spell/aoe_turf/conjure/construct/lesser, + /obj/effect/proc_holder/spell/targeted/projectile/magic_missile/lesser) + + +/////////////////////////////Harvester///////////////////////// +/mob/living/simple_animal/hostile/construct/harvester + name = "Harvester" + real_name = "Harvester" + desc = "A long, thin construct built to herald Nar-Sie's rise. It'll be all over soon." + icon_state = "harvester" + icon_living = "harvester" + maxHealth = 60 + health = 60 + sight = SEE_MOBS + melee_damage_lower = 15 + melee_damage_upper = 20 + attacktext = "butchers" + attack_sound = 'sound/weapons/bladeslice.ogg' + construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/area_conversion, + /obj/effect/proc_holder/spell/aoe_turf/conjure/lesserforcewall) + playstyle_string = "You are a Harvester. You are incapable of directly killing humans, but your attacks will remove their limbs: \ + Bring those who still cling to this world of illusion back to the Geometer so they may know Truth." + can_repair_constructs = TRUE + +/mob/living/simple_animal/hostile/construct/harvester/Bump(atom/AM) + . = ..() + if(istype(AM, /turf/closed/wall/mineral/cult) && AM != loc) //we can go through cult walls + var/atom/movable/stored_pulling = pulling + if(stored_pulling) + stored_pulling.setDir(get_dir(stored_pulling.loc, loc)) + stored_pulling.forceMove(loc) + forceMove(AM) + if(stored_pulling) + start_pulling(stored_pulling, TRUE) //drag anything we're pulling through the wall with us by magic + +/mob/living/simple_animal/hostile/construct/harvester/AttackingTarget() + if(iscarbon(target)) + var/mob/living/carbon/C = target + var/list/parts = list() + var/undismembermerable_limbs = 0 + for(var/X in C.bodyparts) + var/obj/item/bodypart/BP = X + if(BP.body_part != HEAD && BP.body_part != CHEST) + if(BP.dismemberable) + parts += BP + else + undismembermerable_limbs++ + if(!LAZYLEN(parts)) + if(undismembermerable_limbs) //they have limbs we can't remove, and no parts we can, attack! + return ..() + to_chat(src, "\"Bring [C.p_them()] to me.\"") + return FALSE + do_attack_animation(C) + var/obj/item/bodypart/BP = pick(parts) + BP.dismember() + return FALSE + . = ..() + + +///////////////////////Master-Tracker/////////////////////// + +/datum/action/innate/seek_master + name = "Seek your Master" + desc = "You and your master share a soul-link that informs you of their location" + background_icon_state = "bg_demon" + buttontooltipstyle = "cult" + button_icon_state = "cult_mark" + var/tracking = FALSE + var/mob/living/simple_animal/hostile/construct/the_construct + +/datum/action/innate/seek_master/Grant(var/mob/living/C) + the_construct = C + ..() + +/datum/action/innate/seek_master/Activate() + if(!the_construct.master) + to_chat(the_construct, "You have no master to seek!") + the_construct.seeking = FALSE + return + if(tracking) + tracking = FALSE + the_construct.seeking = FALSE + to_chat(the_construct, "You are no longer tracking your master.") + return + else + tracking = TRUE + the_construct.seeking = TRUE + to_chat(the_construct, "You are now tracking your master.") + + +/////////////////////////////ui stuff///////////////////////////// + +/mob/living/simple_animal/hostile/construct/update_health_hud() + if(hud_used) + if(health >= maxHealth) + hud_used.healths.icon_state = "[icon_state]_health0" + else if(health > maxHealth*0.8) + hud_used.healths.icon_state = "[icon_state]_health2" + else if(health > maxHealth*0.6) + hud_used.healths.icon_state = "[icon_state]_health3" + else if(health > maxHealth*0.4) + hud_used.healths.icon_state = "[icon_state]_health4" + else if(health > maxHealth*0.2) + hud_used.healths.icon_state = "[icon_state]_health5" + else + hud_used.healths.icon_state = "[icon_state]_health6" diff --git a/code/modules/mob/living/simple_animal/shade.dm b/code/modules/mob/living/simple_animal/shade.dm index 7dfb76f579..268a61380b 100644 --- a/code/modules/mob/living/simple_animal/shade.dm +++ b/code/modules/mob/living/simple_animal/shade.dm @@ -44,10 +44,10 @@ return TRUE //this doesn't make much sense; you'd thing TRUE would mean it'd process spacemove but it means it doesn't /mob/living/simple_animal/shade/attack_animal(mob/living/simple_animal/M) - if(isconstruct(M)) - var/mob/living/simple_animal/hostile/construct/C = M - if(!C.can_repair_constructs) - return + if(isconstruct(M)) + var/mob/living/simple_animal/hostile/construct/C = M + if(!C.can_repair_constructs) + return if(health < maxHealth) adjustHealth(-25) Beam(M,icon_state="sendbeam",time=4) diff --git a/interface/skin.dmf b/interface/skin.dmf index f48b58e34a..02adcb7726 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -1,1709 +1,1709 @@ -macro "default" - elem - name = "TAB" - command = ".winset \"mainwindow.macro=hotkeys mapwindow.map.focus=true input.background-color=#e0e0e0\"" - is-disabled = false - elem - name = "CENTER+REP" - command = ".center" - is-disabled = false - elem - name = "NORTHEAST" - command = ".northeast" - is-disabled = false - elem - name = "SOUTHEAST" - command = ".southeast" - is-disabled = false - elem - name = "SOUTHWEST" - command = ".southwest" - is-disabled = false - elem - name = "NORTHWEST" - command = ".northwest" - is-disabled = false - elem - name = "CTRL+WEST" - command = "westface" - is-disabled = false - elem - name = "WEST+REP" - command = ".moveleft" - is-disabled = false - elem - name = "CTRL+NORTH" - command = "northface" - is-disabled = false - elem - name = "NORTH+REP" - command = ".moveup" - is-disabled = false - elem - name = "CTRL+EAST" - command = "eastface" - is-disabled = false - elem - name = "EAST+REP" - command = ".moveright" - is-disabled = false - elem - name = "CTRL+SOUTH" - command = "southface" - is-disabled = false - elem - name = "SOUTH+REP" - command = ".movedown" - is-disabled = false - elem - name = "INSERT" - command = "a-intent right" - is-disabled = false - elem - name = "DELETE" - command = "delete-key-pressed" - is-disabled = false - elem - name = "CTRL+1" - command = "a-intent help" - is-disabled = false - elem - name = "CTRL+2" - command = "a-intent disarm" - is-disabled = false - elem - name = "CTRL+3" - command = "a-intent grab" - is-disabled = false - elem - name = "CTRL+4" - command = "a-intent harm" - is-disabled = false - elem - name = "CTRL+A+REP" - command = ".moveleft" - is-disabled = false - elem - name = "CTRL+B" - command = "resist" - is-disabled = false - elem - name = "CTRL+D+REP" - command = ".moveright" - is-disabled = false - elem - name = "CTRL+E" - command = "quick-equip" - is-disabled = false - elem - name = "CTRL+F" - command = "a-intent left" - is-disabled = false - elem - name = "CTRL+G" - command = "a-intent right" - is-disabled = false - elem - name = "CTRL+H" - command = "talk-wheel" - is-disabled = false - elem - name = "CTRL+O" - command = "ooc" - is-disabled = false - elem - name = "CTRL+Q" - command = ".northwest" - is-disabled = false - elem - name = "CTRL+R" - command = ".southwest" - is-disabled = false - elem - name = "CTRL+S+REP" - command = ".movedown" - is-disabled = false - elem - name = "CTRL+W+REP" - command = ".moveup" - is-disabled = false - elem - name = "CTRL+X" - command = ".northeast" - is-disabled = false - elem - name = "CTRL+Y" - command = "Activate-Held-Object" - is-disabled = false - elem - name = "CTRL+Z" - command = "Activate-Held-Object" - is-disabled = false - elem - name = "CTRL+NUMPAD1" - command = "body-r-leg" - is-disabled = false - elem - name = "CTRL+NUMPAD2" - command = "body-groin" - is-disabled = false - elem - name = "CTRL+NUMPAD3" - command = "body-l-leg" - is-disabled = false - elem - name = "CTRL+NUMPAD4" - command = "body-r-arm" - is-disabled = false - elem - name = "CTRL+NUMPAD5" - command = "body-chest" - is-disabled = false - elem - name = "CTRL+NUMPAD6" - command = "body-l-arm" - is-disabled = false - elem - name = "CTRL+NUMPAD8" - command = "body-toggle-head" - is-disabled = false - elem - name = "CTRL+ADD" - command = "Add-View-Range 1" - is-disabled = false - elem - name = "CTRL+SUBTRACT" - command = "Add-View-Range -1" - is_disabled = false - elem - name = "F1" - command = "adminhelp" - is-disabled = false - elem - name = "CTRL+SHIFT+F1+REP" - command = ".options" - is-disabled = false - elem - name = "F2+REP" - command = ".screenshot auto" - is-disabled = false - elem - name = "SHIFT+F2+REP" - command = ".screenshot" - is-disabled = false - elem - name = "F5" - command = "Aghost" - is-disabled = false - elem - name = "F6" - command = "Player-Panel" - is-disabled = false - elem - name = "F7" - command = "Toggle-Build-Mode-Self" - is-disabled = false - elem - name = "CTRL+F7" - command = "Stealth-Mode" - is-disabled = false - elem - name = "F8" - command = "Invisimin" - is-disabled = false - elem - name = "F12" - command = "F12" - is-disabled = false - elem - name = "ALT" - command = "toggle-walk-run" - is-disabled = false - elem - name = "ALT+UP" - command = "toggle-walk-run" - is-disabled = false - -macro "hotkeys" - elem - name = "TAB" - command = ".winset \"mainwindow.macro=default input.focus=true input.background-color=#d3b5b5\"" - is-disabled = false - elem - name = "CENTER+REP" - command = ".center" - is-disabled = false - elem - name = "NORTHEAST" - command = ".northeast" - is-disabled = false - elem - name = "SOUTHEAST" - command = ".southeast" - is-disabled = false - elem - name = "SOUTHWEST" - command = ".southwest" - is-disabled = false - elem - name = "NORTHWEST" - command = ".northwest" - is-disabled = false - elem - name = "CTRL+WEST" - command = "westface" - is-disabled = false - elem - name = "WEST+REP" - command = ".moveleft" - is-disabled = false - elem - name = "CTRL+NORTH" - command = "northface" - is-disabled = false - elem - name = "NORTH+REP" - command = ".moveup" - is-disabled = false - elem - name = "CTRL+EAST" - command = "eastface" - is-disabled = false - elem - name = "EAST+REP" - command = ".moveright" - is-disabled = false - elem - name = "CTRL+SOUTH" - command = "southface" - is-disabled = false - elem - name = "SOUTH+REP" - command = ".movedown" - is-disabled = false - elem - name = "INSERT" - command = "a-intent right" - is-disabled = false - elem - name = "DELETE" - command = "delete-key-pressed" - is-disabled = false - elem - name = "1" - command = "a-intent help" - is-disabled = false - elem - name = "CTRL+1" - command = "a-intent help" - is-disabled = false - elem - name = "2" - command = "a-intent disarm" - is-disabled = false - elem - name = "CTRL+2" - command = "a-intent disarm" - is-disabled = false - elem - name = "3" - command = "a-intent grab" - is-disabled = false - elem - name = "CTRL+3" - command = "a-intent grab" - is-disabled = false - elem - name = "4" - command = "a-intent harm" - is-disabled = false - elem - name = "CTRL+4" - command = "a-intent harm" - is-disabled = false - elem - name = "A+REP" - command = ".moveleft" - is-disabled = false - elem - name = "CTRL+A+REP" - command = ".moveleft" - is-disabled = false - elem - name = "B" - command = "resist" - is-disabled = false - elem - name = "CTRL+B" - command = "resist" - is-disabled = false - elem - name = "D+REP" - command = ".moveright" - is-disabled = false - elem - name = "CTRL+D+REP" - command = ".moveright" - is-disabled = false - elem - name = "E" - command = "quick-equip" - is-disabled = false - elem - name = "CTRL+E" - command = "quick-equip" - is-disabled = false - elem - name = "F" - command = "a-intent left" - is-disabled = false - elem - name = "CTRL+F" - command = "a-intent left" - is-disabled = false - elem - name = "G" - command = "a-intent right" - is-disabled = false - elem - name = "CTRL+G" - command = "a-intent right" - is-disabled = false - elem - name = "H" - command = "talk-wheel" - is-disabled = false - elem - name = "CTRL+H" - command = "talk-wheel" - is-disabled = false - elem - name = "M" - command = "me" - is-disabled = false - elem - name = "O" - command = "ooc" - is-disabled = false - elem - name = "CTRL+O" - command = "ooc" - is-disabled = false - elem - name = "Q" - command = ".northwest" - is-disabled = false - elem - name = "CTRL+Q" - command = ".northwest" - is-disabled = false - elem - name = "R" - command = ".southwest" - is-disabled = false - elem - name = "CTRL+R" - command = ".southwest" - is-disabled = false - elem "s_key" - name = "S+REP" - command = ".movedown" - is-disabled = false - elem - name = "CTRL+S+REP" - command = ".movedown" - is-disabled = false - elem - name = "T" - command = "say" - is-disabled = false - elem "w_key" - name = "W+REP" - command = ".moveup" - is-disabled = false - elem - name = "CTRL+W+REP" - command = ".moveup" - is-disabled = false - elem - name = "X" - command = ".northeast" - is-disabled = false - elem - name = "CTRL+X" - command = ".northeast" - is-disabled = false - elem - name = "Y" - command = "Activate-Held-Object" - is-disabled = false - elem - name = "CTRL+Y" - command = "Activate-Held-Object" - is-disabled = false - elem - name = "Z" - command = "Activate-Held-Object" - is-disabled = false - elem - name = "CTRL+Z" - command = "Activate-Held-Object" - is-disabled = false - elem - name = "NUMPAD1" - command = "body-r-leg" - is-disabled = false - elem - name = "NUMPAD2" - command = "body-groin" - is-disabled = false - elem - name = "NUMPAD3" - command = "body-l-leg" - is-disabled = false - elem - name = "NUMPAD4" - command = "body-r-arm" - is-disabled = false - elem - name = "NUMPAD5" - command = "body-chest" - is-disabled = false - elem - name = "NUMPAD6" - command = "body-l-arm" - is-disabled = false - elem - name = "NUMPAD8" - command = "body-toggle-head" - is-disabled = false - elem - name = "CTRL+ADD" - command = "Add-View-Range 1" - is-disabled = false - elem - name = "CTRL+SUBTRACT" - command = "Add-View-Range -1" - is_disabled = false - elem - name = "F1" - command = "adminhelp" - is-disabled = false - elem - name = "CTRL+SHIFT+F1+REP" - command = ".options" - is-disabled = false - elem - name = "F2+REP" - command = ".screenshot auto" - is-disabled = false - elem - name = "SHIFT+F2+REP" - command = ".screenshot" - is-disabled = false - elem - name = "F5" - command = "Aghost" - is-disabled = false - elem - name = "F6" - command = "Player-Panel" - is-disabled = false - elem - name = "F7" - command = "Stealth-Mode" - is-disabled = false - elem - name = "CTRL+F7" - command = "Stealth-Mode" - is-disabled = false - elem - name = "F8" - command = "Toggle-Build-Mode-Self" - is-disabled = false - elem - name = "F12" - command = "F12" - is-disabled = false - elem - name = "ALT" - command = "toggle-walk-run" - is-disabled = false - elem - name = "ALT+UP" - command = "toggle-walk-run" - is-disabled = false - -macro "robot-default" - elem - name = "TAB" - command = ".winset \"mainwindow.macro=robot-hotkeys mapwindow.map.focus=true input.background-color=#e0e0e0\"" - is-disabled = false - elem - name = "CENTER+REP" - command = ".center" - is-disabled = false - elem - name = "NORTHEAST" - command = ".northeast" - is-disabled = false - elem - name = "SOUTHEAST" - command = ".southeast" - is-disabled = false - elem - name = "NORTHWEST" - command = "unequip-module" - is-disabled = false - elem - name = "CTRL+WEST" - command = "westface" - is-disabled = false - elem - name = "WEST+REP" - command = ".moveleft" - is-disabled = false - elem - name = "CTRL+NORTH" - command = "northface" - is-disabled = false - elem - name = "NORTH+REP" - command = ".moveup" - is-disabled = false - elem - name = "CTRL+EAST" - command = "eastface" - is-disabled = false - elem - name = "EAST+REP" - command = ".moveright" - is-disabled = false - elem - name = "CTRL+SOUTH" - command = "southface" - is-disabled = false - elem - name = "SOUTH+REP" - command = ".movedown" - is-disabled = false - elem - name = "INSERT" - command = "a-intent right" - is-disabled = false - elem - name = "DELETE" - command = "delete-key-pressed" - is-disabled = false - elem - name = "CTRL+1" - command = "toggle-module 1" - is-disabled = false - elem - name = "CTRL+2" - command = "toggle-module 2" - is-disabled = false - elem - name = "CTRL+3" - command = "toggle-module 3" - is-disabled = false - elem - name = "CTRL+4" - command = "a-intent left" - is-disabled = false - elem - name = "CTRL+A+REP" - command = ".moveleft" - is-disabled = false - elem - name = "CTRL+B" - command = "resist" - is-disabled = false - elem - name = "CTRL+H" - command = "talk-wheel" - is-disabled = false - elem - name = "CTRL+O" - command = "ooc" - is-disabled = false - elem - name = "CTRL+D+REP" - command = ".moveright" - is-disabled = false - elem - name = "CTRL+F" - command = "a-intent left" - is-disabled = false - elem - name = "CTRL+G" - command = "a-intent right" - is-disabled = false - elem - name = "CTRL+Q" - command = "unequip-module" - is-disabled = false - elem - name = "CTRL+S+REP" - command = ".movedown" - is-disabled = false - elem - name = "CTRL+W+REP" - command = ".moveup" - is-disabled = false - elem - name = "CTRL+X" - command = ".northeast" - is-disabled = false - elem - name = "CTRL+Y" - command = "Activate-Held-Object" - is-disabled = false - elem - name = "CTRL+Z" - command = "Activate-Held-Object" - is-disabled = false - elem - name = "CTRL+NUMPAD1" - command = "body-r-leg" - is-disabled = false - elem - name = "CTRL+NUMPAD2" - command = "body-groin" - is-disabled = false - elem - name = "CTRL+NUMPAD3" - command = "body-l-leg" - is-disabled = false - elem - name = "CTRL+NUMPAD4" - command = "body-r-arm" - is-disabled = false - elem - name = "CTRL+NUMPAD5" - command = "body-chest" - is-disabled = false - elem - name = "CTRL+NUMPAD6" - command = "body-l-arm" - is-disabled = false - elem - name = "CTRL+NUMPAD8" - command = "body-toggle-head" - is-disabled = false - elem - name = "F1" - command = "adminhelp" - is-disabled = false - elem - name = "CTRL+SHIFT+F1+REP" - command = ".options" - is-disabled = false - elem - name = "F2+REP" - command = ".screenshot auto" - is-disabled = false - elem - name = "SHIFT+F2+REP" - command = ".screenshot" - is-disabled = false - elem - name = "F5" - command = "Aghost" - is-disabled = false - elem - name = "F6" - command = "Player-Panel" - is-disabled = false - elem - name = "F7" - command = "Toggle-Build-Mode-Self" - is-disabled = false - elem - name = "CTRL+F7" - command = "Stealth-Mode" - is-disabled = false - elem - name = "F8" - command = "Invisimin" - is-disabled = false - elem - name = "F12" - command = "F12" - is-disabled = false - -macro "robot-hotkeys" - elem - name = "TAB" - command = ".winset \"mainwindow.macro=robot-default input.focus=true input.background-color=#d3b5b5\"" - is-disabled = false - elem - name = "CENTER+REP" - command = ".center" - is-disabled = false - elem - name = "NORTHEAST" - command = ".northeast" - is-disabled = false - elem - name = "SOUTHEAST" - command = ".southeast" - is-disabled = false - elem - name = "NORTHWEST" - command = "unequip-module" - is-disabled = false - elem - name = "CTRL+WEST" - command = "westface" - is-disabled = false - elem - name = "WEST+REP" - command = ".moveleft" - is-disabled = false - elem - name = "CTRL+NORTH" - command = "northface" - is-disabled = false - elem - name = "NORTH+REP" - command = ".moveup" - is-disabled = false - elem - name = "CTRL+EAST" - command = "eastface" - is-disabled = false - elem - name = "EAST+REP" - command = ".moveright" - is-disabled = false - elem - name = "CTRL+SOUTH" - command = "southface" - is-disabled = false - elem - name = "SOUTH+REP" - command = ".movedown" - is-disabled = false - elem - name = "INSERT" - command = "a-intent right" - is-disabled = false - elem - name = "DELETE" - command = "delete-key-pressed" - is-disabled = false - elem - name = "1" - command = "toggle-module 1" - is-disabled = false - elem - name = "CTRL+1" - command = "toggle-module 1" - is-disabled = false - elem - name = "2" - command = "toggle-module 2" - is-disabled = false - elem - name = "CTRL+2" - command = "toggle-module 2" - is-disabled = false - elem - name = "3" - command = "toggle-module 3" - is-disabled = false - elem - name = "CTRL+3" - command = "toggle-module 3" - is-disabled = false - elem - name = "4" - command = "a-intent left" - is-disabled = false - elem - name = "CTRL+4" - command = "a-intent left" - is-disabled = false - elem - name = "A+REP" - command = ".moveleft" - is-disabled = false - elem - name = "CTRL+A+REP" - command = ".moveleft" - is-disabled = false - elem - name = "B" - command = "resist" - is-disabled = false - elem - name = "CTRL+B" - command = "resist" - is-disabled = false - elem - name = "H" - command = "talk-wheel" - is-disabled = false - elem - name = "CTRL+H" - command = "talk-wheel" - is-disabled = false - elem - name = "M" - command = "me" - is-disabled = false - elem - name = "O" - command = "ooc" - is-disabled = false - elem - name = "CTRL+O" - command = "ooc" - is-disabled = false - elem - name = "D+REP" - command = ".moveright" - is-disabled = false - elem - name = "CTRL+D+REP" - command = ".moveright" - is-disabled = false - elem - name = "F" - command = "a-intent left" - is-disabled = false - elem - name = "CTRL+F" - command = "a-intent left" - is-disabled = false - elem - name = "G" - command = "a-intent right" - is-disabled = false - elem - name = "CTRL+G" - command = "a-intent right" - is-disabled = false - elem - name = "Q" - command = "unequip-module" - is-disabled = false - elem - name = "CTRL+Q" - command = "unequip-module" - is-disabled = false - elem "s_key" - name = "S+REP" - command = ".movedown" - is-disabled = false - elem - name = "CTRL+S+REP" - command = ".movedown" - is-disabled = false - elem - name = "T" - command = "say" - is-disabled = false - elem "w_key" - name = "W+REP" - command = ".moveup" - is-disabled = false - elem - name = "CTRL+W+REP" - command = ".moveup" - is-disabled = false - elem - name = "X" - command = ".northeast" - is-disabled = false - elem - name = "CTRL+X" - command = ".northeast" - is-disabled = false - elem - name = "Y" - command = "Activate-Held-Object" - is-disabled = false - elem - name = "CTRL+Y" - command = "Activate-Held-Object" - is-disabled = false - elem - name = "Z" - command = "Activate-Held-Object" - is-disabled = false - elem - name = "CTRL+Z" - command = "Activate-Held-Object" - is-disabled = false - elem - name = "NUMPAD1" - command = "body-r-leg" - is-disabled = false - elem - name = "NUMPAD2" - command = "body-groin" - is-disabled = false - elem - name = "NUMPAD3" - command = "body-l-leg" - is-disabled = false - elem - name = "NUMPAD4" - command = "body-r-arm" - is-disabled = false - elem - name = "NUMPAD5" - command = "body-chest" - is-disabled = false - elem - name = "NUMPAD6" - command = "body-l-arm" - is-disabled = false - elem - name = "NUMPAD8" - command = "body-toggle-head" - is-disabled = false - elem - name = "F1" - command = "adminhelp" - is-disabled = false - elem - name = "CTRL+SHIFT+F1+REP" - command = ".options" - is-disabled = false - elem - name = "F2+REP" - command = ".screenshot auto" - is-disabled = false - elem - name = "SHIFT+F2+REP" - command = ".screenshot" - is-disabled = false - elem - name = "F5" - command = "Aghost" - is-disabled = false - elem - name = "F6" - command = "Player-Panel" - is-disabled = false - elem - name = "F7" - command = "Toggle-Build-Mode-Self" - is-disabled = false - elem - name = "CTRL+F7" - command = "Stealth-Mode" - is-disabled = false - elem - name = "F8" - command = "Invisimin" - is-disabled = false - elem - name = "F12" - command = "F12" - is-disabled = false - - -menu "menu" - elem - name = "&File" - command = "" - category = "" - is-checked = false - can-check = false - group = "" - is-disabled = false - saved-params = "is-checked" - elem - name = "&Quick screenshot\tF2" - command = ".screenshot auto" - category = "&File" - is-checked = false - can-check = false - group = "" - is-disabled = false - saved-params = "is-checked" - elem - name = "&Save screenshot as...\tShift+F2" - command = ".screenshot" - category = "&File" - is-checked = false - can-check = false - group = "" - is-disabled = false - saved-params = "is-checked" - elem - name = "" - command = "" - category = "&File" - is-checked = false - can-check = false - group = "" - is-disabled = false - saved-params = "is-checked" - elem "reconnectbutton" - name = "&Reconnect" - command = ".reconnect" - category = "&File" - is-checked = false - can-check = false - group = "" - is-disabled = false - saved-params = "is-checked" - elem - name = "&Quit\tAlt-F4" - command = ".quit" - category = "&File" - is-checked = false - can-check = false - group = "" - is-disabled = false - saved-params = "is-checked" - elem - name = "&Help" - command = "" - category = "" - is-checked = false - can-check = false - group = "" - is-disabled = false - saved-params = "is-checked" - elem - name = "&Admin Help\tF1" - command = "adminhelp" - category = "&Help" - is-checked = false - can-check = false - group = "" - is-disabled = false - saved-params = "is-checked" - elem - name = "&Hotkeys" - command = "hotkeys-help" - category = "&Help" - is-checked = false - can-check = false - group = "" - is-disabled = false - saved-params = "is-checked" - - -window "mainwindow" - elem "mainwindow" - type = MAIN - pos = 0,0 - size = 640x440 - anchor1 = none - anchor2 = none - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = true - border = none - drop-zone = false - right-click = false - saved-params = "pos;size;is-minimized;is-maximized" - on-size = "" - title = "" - titlebar = true - statusbar = true - can-close = true - can-minimize = true - can-resize = true - is-pane = false - is-minimized = false - is-maximized = false - can-scroll = none - icon = 'icons\\ss13_64.png' - image = "" - image-mode = stretch - keep-aspect = false - transparent-color = none - alpha = 255 - macro = "macro" - menu = "menu" - on-close = "" - elem "split" - type = CHILD - pos = 3,0 - size = 634x417 - anchor1 = 0,0 - anchor2 = 100,100 - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "splitter" - on-size = "" - left = "mapwindow" - right = "infowindow" - is-vert = true - splitter = 50 - show-splitter = true - lock = none - elem "input" - type = INPUT - pos = 5,420 - size = 595x20 - anchor1 = 0,100 - anchor2 = 100,100 - font-family = "" - font-size = 10 - font-style = "" - text-color = #000000 - background-color = #d3b5b5 - is-visible = true - is-disabled = false - is-transparent = false - is-default = true - border = none - drop-zone = false - right-click = false - saved-params = "command" - on-size = "" - command = "" - multi-line = false - is-password = false - no-command = false - elem "say" - type = BUTTON - pos = 600,420 - size = 37x20 - anchor1 = 100,100 - anchor2 = none - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "is-checked" - on-size = "" - text = "Chat" - image = "" - command = ".winset \"say.is-checked=true ? input.command=\"!say \\\"\" : input.command=\"" - is-flat = true - stretch = false - is-checked = false - group = "" - button-type = pushbox - elem "asset_cache_browser" - type = BROWSER - pos = 0,0 - size = 200x200 - anchor1 = none - anchor2 = none - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = false - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "" - on-size = "" - show-history = false - show-url = false - auto-format = true - use-title = false - on-show = "" - on-hide = "" - elem "tooltip" - type = BROWSER - pos = 0,0 - size = 999x999 - anchor1 = none - anchor2 = none - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = false - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "" - on-size = "" - show-history = false - show-url = false - auto-format = true - use-title = false - on-show = "" - on-hide = "" - -window "mapwindow" - elem "mapwindow" - type = MAIN - pos = 0,0 - size = 640x480 - anchor1 = none - anchor2 = none - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "pos;size;is-minimized;is-maximized" - on-size = "" - title = "" - titlebar = true - statusbar = true - can-close = true - can-minimize = true - can-resize = true - is-pane = true - is-minimized = false - is-maximized = false - can-scroll = none - icon = "" - image = "" - image-mode = stretch - keep-aspect = false - transparent-color = none - alpha = 255 - macro = "" - menu = "" - on-close = "" - elem "map" - type = MAP - pos = 0,0 - size = 640x480 - anchor1 = 0,0 - anchor2 = 100,100 - font-family = "Arial" - font-size = 7 - font-style = "" - text-color = none - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = true - border = none - drop-zone = true - right-click = false - saved-params = "icon-size" - on-size = "" - icon-size = 0 - text-mode = false - letterbox = true - zoom = 0 - on-show = "" - on-hide = "" - style = "" - zoom-mode = "distort" - -window "infowindow" - elem "infowindow" - type = MAIN - pos = 0,0 - size = 640x480 - anchor1 = none - anchor2 = none - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "pos;size;is-minimized;is-maximized" - on-size = "" - title = "" - titlebar = true - statusbar = true - can-close = true - can-minimize = true - can-resize = true - is-pane = true - is-minimized = false - is-maximized = false - can-scroll = none - icon = "" - image = "" - image-mode = stretch - keep-aspect = false - transparent-color = none - alpha = 255 - macro = "" - menu = "" - on-close = "" - elem "info" - type = CHILD - pos = 0,30 - size = 640x445 - anchor1 = 0,0 - anchor2 = 100,100 - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "splitter" - on-size = "" - left = "statwindow" - right = "outputwindow" - is-vert = false - splitter = 50 - show-splitter = true - lock = none - elem "changelog" - type = BUTTON - pos = 16,5 - size = 104x20 - anchor1 = 3,0 - anchor2 = 19,0 - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "is-checked" - on-size = "" - text = "Changelog" - image = "" - command = "changelog" - is-flat = false - stretch = false - is-checked = false - group = "" - button-type = pushbutton - elem "rules" - type = BUTTON - pos = 120,5 - size = 100x20 - anchor1 = 19,0 - anchor2 = 34,0 - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "is-checked" - on-size = "" - text = "Rules" - image = "" - command = "rules" - is-flat = false - stretch = false - is-checked = false - group = "" - button-type = pushbutton - elem "wiki" - type = BUTTON - pos = 220,5 - size = 100x20 - anchor1 = 34,0 - anchor2 = 50,0 - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "is-checked" - on-size = "" - text = "Wiki" - image = "" - command = "wiki" - is-flat = false - stretch = false - is-checked = false - group = "" - button-type = pushbutton - elem "forum" - type = BUTTON - pos = 320,5 - size = 100x20 - anchor1 = 50,0 - anchor2 = 66,0 - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "is-checked" - on-size = "" - text = "Forum" - image = "" - command = "forum" - is-flat = false - stretch = false - is-checked = false - group = "" - button-type = pushbutton - elem "github" - type = BUTTON - pos = 420,5 - size = 100x20 - anchor1 = 66,0 - anchor2 = 81,0 - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "is-checked" - on-size = "" - text = "Github" - image = "" - command = "github" - is-flat = false - stretch = false - is-checked = false - group = "" - button-type = pushbutton - elem "report-issue" - type = BUTTON - pos = 520,5 - size = 100x20 - anchor1 = 81,0 - anchor2 = 97,0 - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "is-checked" - on-size = "" - text = "Report Issue" - image = "" - command = "report-issue" - is-flat = false - stretch = false - is-checked = false - group = "" - button-type = pushbutton - -window "outputwindow" - elem "outputwindow" - type = MAIN - pos = 0,0 - size = 640x480 - anchor1 = none - anchor2 = none - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "pos;size;is-minimized;is-maximized" - on-size = "" - title = "" - titlebar = true - statusbar = true - can-close = true - can-minimize = true - can-resize = true - is-pane = true - is-minimized = false - is-maximized = false - can-scroll = none - icon = "" - image = "" - image-mode = stretch - keep-aspect = false - transparent-color = none - alpha = 255 - macro = "" - menu = "" - on-close = "" - elem "output" - type = OUTPUT - pos = 0,0 - size = 640x480 - anchor1 = 0,0 - anchor2 = 100,100 - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = #ffffff - is-visible = true - is-disabled = false - is-transparent = false - is-default = true - border = none - drop-zone = false - right-click = false - saved-params = "max-lines" - on-size = "" - link-color = #0000ff - visited-color = #ff00ff - style = "" - enable-http-images = false - max-lines = 1000 - image = "" - -window "statwindow" - elem "statwindow" - type = MAIN - pos = 0,0 - size = 640x480 - anchor1 = none - anchor2 = none - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = none - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = false - right-click = false - saved-params = "pos;size;is-minimized;is-maximized" - on-size = "" - title = "" - titlebar = true - statusbar = true - can-close = true - can-minimize = true - can-resize = true - is-pane = true - is-minimized = false - is-maximized = false - can-scroll = none - icon = "" - image = "" - image-mode = stretch - keep-aspect = false - transparent-color = none - alpha = 255 - macro = "" - menu = "" - on-close = "" - elem "stat" - type = INFO - pos = 0,0 - size = 640x480 - anchor1 = 0,0 - anchor2 = 100,100 - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = #ffffff - is-visible = true - is-disabled = false - is-transparent = false - is-default = true - border = none - drop-zone = true - right-click = false - saved-params = "" - on-size = "" - highlight-color = #00ff00 - tab-text-color = #000000 - tab-background-color = none - tab-font-family = "" - tab-font-size = 0 - tab-font-style = "" - allow-html = true - multi-line = true - on-show = "" - on-hide = "" - on-tab = "" - prefix-color = none - suffix-color = none - +macro "default" + elem + name = "TAB" + command = ".winset \"mainwindow.macro=hotkeys mapwindow.map.focus=true input.background-color=#e0e0e0\"" + is-disabled = false + elem + name = "CENTER+REP" + command = ".center" + is-disabled = false + elem + name = "NORTHEAST" + command = ".northeast" + is-disabled = false + elem + name = "SOUTHEAST" + command = ".southeast" + is-disabled = false + elem + name = "SOUTHWEST" + command = ".southwest" + is-disabled = false + elem + name = "NORTHWEST" + command = ".northwest" + is-disabled = false + elem + name = "CTRL+WEST" + command = "westface" + is-disabled = false + elem + name = "WEST+REP" + command = ".moveleft" + is-disabled = false + elem + name = "CTRL+NORTH" + command = "northface" + is-disabled = false + elem + name = "NORTH+REP" + command = ".moveup" + is-disabled = false + elem + name = "CTRL+EAST" + command = "eastface" + is-disabled = false + elem + name = "EAST+REP" + command = ".moveright" + is-disabled = false + elem + name = "CTRL+SOUTH" + command = "southface" + is-disabled = false + elem + name = "SOUTH+REP" + command = ".movedown" + is-disabled = false + elem + name = "INSERT" + command = "a-intent right" + is-disabled = false + elem + name = "DELETE" + command = "delete-key-pressed" + is-disabled = false + elem + name = "CTRL+1" + command = "a-intent help" + is-disabled = false + elem + name = "CTRL+2" + command = "a-intent disarm" + is-disabled = false + elem + name = "CTRL+3" + command = "a-intent grab" + is-disabled = false + elem + name = "CTRL+4" + command = "a-intent harm" + is-disabled = false + elem + name = "CTRL+A+REP" + command = ".moveleft" + is-disabled = false + elem + name = "CTRL+B" + command = "resist" + is-disabled = false + elem + name = "CTRL+D+REP" + command = ".moveright" + is-disabled = false + elem + name = "CTRL+E" + command = "quick-equip" + is-disabled = false + elem + name = "CTRL+F" + command = "a-intent left" + is-disabled = false + elem + name = "CTRL+G" + command = "a-intent right" + is-disabled = false + elem + name = "CTRL+H" + command = "talk-wheel" + is-disabled = false + elem + name = "CTRL+O" + command = "ooc" + is-disabled = false + elem + name = "CTRL+Q" + command = ".northwest" + is-disabled = false + elem + name = "CTRL+R" + command = ".southwest" + is-disabled = false + elem + name = "CTRL+S+REP" + command = ".movedown" + is-disabled = false + elem + name = "CTRL+W+REP" + command = ".moveup" + is-disabled = false + elem + name = "CTRL+X" + command = ".northeast" + is-disabled = false + elem + name = "CTRL+Y" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "CTRL+Z" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "CTRL+NUMPAD1" + command = "body-r-leg" + is-disabled = false + elem + name = "CTRL+NUMPAD2" + command = "body-groin" + is-disabled = false + elem + name = "CTRL+NUMPAD3" + command = "body-l-leg" + is-disabled = false + elem + name = "CTRL+NUMPAD4" + command = "body-r-arm" + is-disabled = false + elem + name = "CTRL+NUMPAD5" + command = "body-chest" + is-disabled = false + elem + name = "CTRL+NUMPAD6" + command = "body-l-arm" + is-disabled = false + elem + name = "CTRL+NUMPAD8" + command = "body-toggle-head" + is-disabled = false + elem + name = "CTRL+ADD" + command = "Add-View-Range 1" + is-disabled = false + elem + name = "CTRL+SUBTRACT" + command = "Add-View-Range -1" + is_disabled = false + elem + name = "F1" + command = "adminhelp" + is-disabled = false + elem + name = "CTRL+SHIFT+F1+REP" + command = ".options" + is-disabled = false + elem + name = "F2+REP" + command = ".screenshot auto" + is-disabled = false + elem + name = "SHIFT+F2+REP" + command = ".screenshot" + is-disabled = false + elem + name = "F5" + command = "Aghost" + is-disabled = false + elem + name = "F6" + command = "Player-Panel" + is-disabled = false + elem + name = "F7" + command = "Toggle-Build-Mode-Self" + is-disabled = false + elem + name = "CTRL+F7" + command = "Stealth-Mode" + is-disabled = false + elem + name = "F8" + command = "Invisimin" + is-disabled = false + elem + name = "F12" + command = "F12" + is-disabled = false + elem + name = "ALT" + command = "toggle-walk-run" + is-disabled = false + elem + name = "ALT+UP" + command = "toggle-walk-run" + is-disabled = false + +macro "hotkeys" + elem + name = "TAB" + command = ".winset \"mainwindow.macro=default input.focus=true input.background-color=#d3b5b5\"" + is-disabled = false + elem + name = "CENTER+REP" + command = ".center" + is-disabled = false + elem + name = "NORTHEAST" + command = ".northeast" + is-disabled = false + elem + name = "SOUTHEAST" + command = ".southeast" + is-disabled = false + elem + name = "SOUTHWEST" + command = ".southwest" + is-disabled = false + elem + name = "NORTHWEST" + command = ".northwest" + is-disabled = false + elem + name = "CTRL+WEST" + command = "westface" + is-disabled = false + elem + name = "WEST+REP" + command = ".moveleft" + is-disabled = false + elem + name = "CTRL+NORTH" + command = "northface" + is-disabled = false + elem + name = "NORTH+REP" + command = ".moveup" + is-disabled = false + elem + name = "CTRL+EAST" + command = "eastface" + is-disabled = false + elem + name = "EAST+REP" + command = ".moveright" + is-disabled = false + elem + name = "CTRL+SOUTH" + command = "southface" + is-disabled = false + elem + name = "SOUTH+REP" + command = ".movedown" + is-disabled = false + elem + name = "INSERT" + command = "a-intent right" + is-disabled = false + elem + name = "DELETE" + command = "delete-key-pressed" + is-disabled = false + elem + name = "1" + command = "a-intent help" + is-disabled = false + elem + name = "CTRL+1" + command = "a-intent help" + is-disabled = false + elem + name = "2" + command = "a-intent disarm" + is-disabled = false + elem + name = "CTRL+2" + command = "a-intent disarm" + is-disabled = false + elem + name = "3" + command = "a-intent grab" + is-disabled = false + elem + name = "CTRL+3" + command = "a-intent grab" + is-disabled = false + elem + name = "4" + command = "a-intent harm" + is-disabled = false + elem + name = "CTRL+4" + command = "a-intent harm" + is-disabled = false + elem + name = "A+REP" + command = ".moveleft" + is-disabled = false + elem + name = "CTRL+A+REP" + command = ".moveleft" + is-disabled = false + elem + name = "B" + command = "resist" + is-disabled = false + elem + name = "CTRL+B" + command = "resist" + is-disabled = false + elem + name = "D+REP" + command = ".moveright" + is-disabled = false + elem + name = "CTRL+D+REP" + command = ".moveright" + is-disabled = false + elem + name = "E" + command = "quick-equip" + is-disabled = false + elem + name = "CTRL+E" + command = "quick-equip" + is-disabled = false + elem + name = "F" + command = "a-intent left" + is-disabled = false + elem + name = "CTRL+F" + command = "a-intent left" + is-disabled = false + elem + name = "G" + command = "a-intent right" + is-disabled = false + elem + name = "CTRL+G" + command = "a-intent right" + is-disabled = false + elem + name = "H" + command = "talk-wheel" + is-disabled = false + elem + name = "CTRL+H" + command = "talk-wheel" + is-disabled = false + elem + name = "M" + command = "me" + is-disabled = false + elem + name = "O" + command = "ooc" + is-disabled = false + elem + name = "CTRL+O" + command = "ooc" + is-disabled = false + elem + name = "Q" + command = ".northwest" + is-disabled = false + elem + name = "CTRL+Q" + command = ".northwest" + is-disabled = false + elem + name = "R" + command = ".southwest" + is-disabled = false + elem + name = "CTRL+R" + command = ".southwest" + is-disabled = false + elem "s_key" + name = "S+REP" + command = ".movedown" + is-disabled = false + elem + name = "CTRL+S+REP" + command = ".movedown" + is-disabled = false + elem + name = "T" + command = "say" + is-disabled = false + elem "w_key" + name = "W+REP" + command = ".moveup" + is-disabled = false + elem + name = "CTRL+W+REP" + command = ".moveup" + is-disabled = false + elem + name = "X" + command = ".northeast" + is-disabled = false + elem + name = "CTRL+X" + command = ".northeast" + is-disabled = false + elem + name = "Y" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "CTRL+Y" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "Z" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "CTRL+Z" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "NUMPAD1" + command = "body-r-leg" + is-disabled = false + elem + name = "NUMPAD2" + command = "body-groin" + is-disabled = false + elem + name = "NUMPAD3" + command = "body-l-leg" + is-disabled = false + elem + name = "NUMPAD4" + command = "body-r-arm" + is-disabled = false + elem + name = "NUMPAD5" + command = "body-chest" + is-disabled = false + elem + name = "NUMPAD6" + command = "body-l-arm" + is-disabled = false + elem + name = "NUMPAD8" + command = "body-toggle-head" + is-disabled = false + elem + name = "CTRL+ADD" + command = "Add-View-Range 1" + is-disabled = false + elem + name = "CTRL+SUBTRACT" + command = "Add-View-Range -1" + is_disabled = false + elem + name = "F1" + command = "adminhelp" + is-disabled = false + elem + name = "CTRL+SHIFT+F1+REP" + command = ".options" + is-disabled = false + elem + name = "F2+REP" + command = ".screenshot auto" + is-disabled = false + elem + name = "SHIFT+F2+REP" + command = ".screenshot" + is-disabled = false + elem + name = "F5" + command = "Aghost" + is-disabled = false + elem + name = "F6" + command = "Player-Panel" + is-disabled = false + elem + name = "F7" + command = "Stealth-Mode" + is-disabled = false + elem + name = "CTRL+F7" + command = "Stealth-Mode" + is-disabled = false + elem + name = "F8" + command = "Toggle-Build-Mode-Self" + is-disabled = false + elem + name = "F12" + command = "F12" + is-disabled = false + elem + name = "ALT" + command = "toggle-walk-run" + is-disabled = false + elem + name = "ALT+UP" + command = "toggle-walk-run" + is-disabled = false + +macro "robot-default" + elem + name = "TAB" + command = ".winset \"mainwindow.macro=robot-hotkeys mapwindow.map.focus=true input.background-color=#e0e0e0\"" + is-disabled = false + elem + name = "CENTER+REP" + command = ".center" + is-disabled = false + elem + name = "NORTHEAST" + command = ".northeast" + is-disabled = false + elem + name = "SOUTHEAST" + command = ".southeast" + is-disabled = false + elem + name = "NORTHWEST" + command = "unequip-module" + is-disabled = false + elem + name = "CTRL+WEST" + command = "westface" + is-disabled = false + elem + name = "WEST+REP" + command = ".moveleft" + is-disabled = false + elem + name = "CTRL+NORTH" + command = "northface" + is-disabled = false + elem + name = "NORTH+REP" + command = ".moveup" + is-disabled = false + elem + name = "CTRL+EAST" + command = "eastface" + is-disabled = false + elem + name = "EAST+REP" + command = ".moveright" + is-disabled = false + elem + name = "CTRL+SOUTH" + command = "southface" + is-disabled = false + elem + name = "SOUTH+REP" + command = ".movedown" + is-disabled = false + elem + name = "INSERT" + command = "a-intent right" + is-disabled = false + elem + name = "DELETE" + command = "delete-key-pressed" + is-disabled = false + elem + name = "CTRL+1" + command = "toggle-module 1" + is-disabled = false + elem + name = "CTRL+2" + command = "toggle-module 2" + is-disabled = false + elem + name = "CTRL+3" + command = "toggle-module 3" + is-disabled = false + elem + name = "CTRL+4" + command = "a-intent left" + is-disabled = false + elem + name = "CTRL+A+REP" + command = ".moveleft" + is-disabled = false + elem + name = "CTRL+B" + command = "resist" + is-disabled = false + elem + name = "CTRL+H" + command = "talk-wheel" + is-disabled = false + elem + name = "CTRL+O" + command = "ooc" + is-disabled = false + elem + name = "CTRL+D+REP" + command = ".moveright" + is-disabled = false + elem + name = "CTRL+F" + command = "a-intent left" + is-disabled = false + elem + name = "CTRL+G" + command = "a-intent right" + is-disabled = false + elem + name = "CTRL+Q" + command = "unequip-module" + is-disabled = false + elem + name = "CTRL+S+REP" + command = ".movedown" + is-disabled = false + elem + name = "CTRL+W+REP" + command = ".moveup" + is-disabled = false + elem + name = "CTRL+X" + command = ".northeast" + is-disabled = false + elem + name = "CTRL+Y" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "CTRL+Z" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "CTRL+NUMPAD1" + command = "body-r-leg" + is-disabled = false + elem + name = "CTRL+NUMPAD2" + command = "body-groin" + is-disabled = false + elem + name = "CTRL+NUMPAD3" + command = "body-l-leg" + is-disabled = false + elem + name = "CTRL+NUMPAD4" + command = "body-r-arm" + is-disabled = false + elem + name = "CTRL+NUMPAD5" + command = "body-chest" + is-disabled = false + elem + name = "CTRL+NUMPAD6" + command = "body-l-arm" + is-disabled = false + elem + name = "CTRL+NUMPAD8" + command = "body-toggle-head" + is-disabled = false + elem + name = "F1" + command = "adminhelp" + is-disabled = false + elem + name = "CTRL+SHIFT+F1+REP" + command = ".options" + is-disabled = false + elem + name = "F2+REP" + command = ".screenshot auto" + is-disabled = false + elem + name = "SHIFT+F2+REP" + command = ".screenshot" + is-disabled = false + elem + name = "F5" + command = "Aghost" + is-disabled = false + elem + name = "F6" + command = "Player-Panel" + is-disabled = false + elem + name = "F7" + command = "Toggle-Build-Mode-Self" + is-disabled = false + elem + name = "CTRL+F7" + command = "Stealth-Mode" + is-disabled = false + elem + name = "F8" + command = "Invisimin" + is-disabled = false + elem + name = "F12" + command = "F12" + is-disabled = false + +macro "robot-hotkeys" + elem + name = "TAB" + command = ".winset \"mainwindow.macro=robot-default input.focus=true input.background-color=#d3b5b5\"" + is-disabled = false + elem + name = "CENTER+REP" + command = ".center" + is-disabled = false + elem + name = "NORTHEAST" + command = ".northeast" + is-disabled = false + elem + name = "SOUTHEAST" + command = ".southeast" + is-disabled = false + elem + name = "NORTHWEST" + command = "unequip-module" + is-disabled = false + elem + name = "CTRL+WEST" + command = "westface" + is-disabled = false + elem + name = "WEST+REP" + command = ".moveleft" + is-disabled = false + elem + name = "CTRL+NORTH" + command = "northface" + is-disabled = false + elem + name = "NORTH+REP" + command = ".moveup" + is-disabled = false + elem + name = "CTRL+EAST" + command = "eastface" + is-disabled = false + elem + name = "EAST+REP" + command = ".moveright" + is-disabled = false + elem + name = "CTRL+SOUTH" + command = "southface" + is-disabled = false + elem + name = "SOUTH+REP" + command = ".movedown" + is-disabled = false + elem + name = "INSERT" + command = "a-intent right" + is-disabled = false + elem + name = "DELETE" + command = "delete-key-pressed" + is-disabled = false + elem + name = "1" + command = "toggle-module 1" + is-disabled = false + elem + name = "CTRL+1" + command = "toggle-module 1" + is-disabled = false + elem + name = "2" + command = "toggle-module 2" + is-disabled = false + elem + name = "CTRL+2" + command = "toggle-module 2" + is-disabled = false + elem + name = "3" + command = "toggle-module 3" + is-disabled = false + elem + name = "CTRL+3" + command = "toggle-module 3" + is-disabled = false + elem + name = "4" + command = "a-intent left" + is-disabled = false + elem + name = "CTRL+4" + command = "a-intent left" + is-disabled = false + elem + name = "A+REP" + command = ".moveleft" + is-disabled = false + elem + name = "CTRL+A+REP" + command = ".moveleft" + is-disabled = false + elem + name = "B" + command = "resist" + is-disabled = false + elem + name = "CTRL+B" + command = "resist" + is-disabled = false + elem + name = "H" + command = "talk-wheel" + is-disabled = false + elem + name = "CTRL+H" + command = "talk-wheel" + is-disabled = false + elem + name = "M" + command = "me" + is-disabled = false + elem + name = "O" + command = "ooc" + is-disabled = false + elem + name = "CTRL+O" + command = "ooc" + is-disabled = false + elem + name = "D+REP" + command = ".moveright" + is-disabled = false + elem + name = "CTRL+D+REP" + command = ".moveright" + is-disabled = false + elem + name = "F" + command = "a-intent left" + is-disabled = false + elem + name = "CTRL+F" + command = "a-intent left" + is-disabled = false + elem + name = "G" + command = "a-intent right" + is-disabled = false + elem + name = "CTRL+G" + command = "a-intent right" + is-disabled = false + elem + name = "Q" + command = "unequip-module" + is-disabled = false + elem + name = "CTRL+Q" + command = "unequip-module" + is-disabled = false + elem "s_key" + name = "S+REP" + command = ".movedown" + is-disabled = false + elem + name = "CTRL+S+REP" + command = ".movedown" + is-disabled = false + elem + name = "T" + command = "say" + is-disabled = false + elem "w_key" + name = "W+REP" + command = ".moveup" + is-disabled = false + elem + name = "CTRL+W+REP" + command = ".moveup" + is-disabled = false + elem + name = "X" + command = ".northeast" + is-disabled = false + elem + name = "CTRL+X" + command = ".northeast" + is-disabled = false + elem + name = "Y" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "CTRL+Y" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "Z" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "CTRL+Z" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "NUMPAD1" + command = "body-r-leg" + is-disabled = false + elem + name = "NUMPAD2" + command = "body-groin" + is-disabled = false + elem + name = "NUMPAD3" + command = "body-l-leg" + is-disabled = false + elem + name = "NUMPAD4" + command = "body-r-arm" + is-disabled = false + elem + name = "NUMPAD5" + command = "body-chest" + is-disabled = false + elem + name = "NUMPAD6" + command = "body-l-arm" + is-disabled = false + elem + name = "NUMPAD8" + command = "body-toggle-head" + is-disabled = false + elem + name = "F1" + command = "adminhelp" + is-disabled = false + elem + name = "CTRL+SHIFT+F1+REP" + command = ".options" + is-disabled = false + elem + name = "F2+REP" + command = ".screenshot auto" + is-disabled = false + elem + name = "SHIFT+F2+REP" + command = ".screenshot" + is-disabled = false + elem + name = "F5" + command = "Aghost" + is-disabled = false + elem + name = "F6" + command = "Player-Panel" + is-disabled = false + elem + name = "F7" + command = "Toggle-Build-Mode-Self" + is-disabled = false + elem + name = "CTRL+F7" + command = "Stealth-Mode" + is-disabled = false + elem + name = "F8" + command = "Invisimin" + is-disabled = false + elem + name = "F12" + command = "F12" + is-disabled = false + + +menu "menu" + elem + name = "&File" + command = "" + category = "" + is-checked = false + can-check = false + group = "" + is-disabled = false + saved-params = "is-checked" + elem + name = "&Quick screenshot\tF2" + command = ".screenshot auto" + category = "&File" + is-checked = false + can-check = false + group = "" + is-disabled = false + saved-params = "is-checked" + elem + name = "&Save screenshot as...\tShift+F2" + command = ".screenshot" + category = "&File" + is-checked = false + can-check = false + group = "" + is-disabled = false + saved-params = "is-checked" + elem + name = "" + command = "" + category = "&File" + is-checked = false + can-check = false + group = "" + is-disabled = false + saved-params = "is-checked" + elem "reconnectbutton" + name = "&Reconnect" + command = ".reconnect" + category = "&File" + is-checked = false + can-check = false + group = "" + is-disabled = false + saved-params = "is-checked" + elem + name = "&Quit\tAlt-F4" + command = ".quit" + category = "&File" + is-checked = false + can-check = false + group = "" + is-disabled = false + saved-params = "is-checked" + elem + name = "&Help" + command = "" + category = "" + is-checked = false + can-check = false + group = "" + is-disabled = false + saved-params = "is-checked" + elem + name = "&Admin Help\tF1" + command = "adminhelp" + category = "&Help" + is-checked = false + can-check = false + group = "" + is-disabled = false + saved-params = "is-checked" + elem + name = "&Hotkeys" + command = "hotkeys-help" + category = "&Help" + is-checked = false + can-check = false + group = "" + is-disabled = false + saved-params = "is-checked" + + +window "mainwindow" + elem "mainwindow" + type = MAIN + pos = 0,0 + size = 640x440 + anchor1 = none + anchor2 = none + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = true + border = none + drop-zone = false + right-click = false + saved-params = "pos;size;is-minimized;is-maximized" + on-size = "" + title = "" + titlebar = true + statusbar = true + can-close = true + can-minimize = true + can-resize = true + is-pane = false + is-minimized = false + is-maximized = false + can-scroll = none + icon = 'icons\\ss13_64.png' + image = "" + image-mode = stretch + keep-aspect = false + transparent-color = none + alpha = 255 + macro = "macro" + menu = "menu" + on-close = "" + elem "split" + type = CHILD + pos = 3,0 + size = 634x417 + anchor1 = 0,0 + anchor2 = 100,100 + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "splitter" + on-size = "" + left = "mapwindow" + right = "infowindow" + is-vert = true + splitter = 50 + show-splitter = true + lock = none + elem "input" + type = INPUT + pos = 5,420 + size = 595x20 + anchor1 = 0,100 + anchor2 = 100,100 + font-family = "" + font-size = 10 + font-style = "" + text-color = #000000 + background-color = #d3b5b5 + is-visible = true + is-disabled = false + is-transparent = false + is-default = true + border = none + drop-zone = false + right-click = false + saved-params = "command" + on-size = "" + command = "" + multi-line = false + is-password = false + no-command = false + elem "say" + type = BUTTON + pos = 600,420 + size = 37x20 + anchor1 = 100,100 + anchor2 = none + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "is-checked" + on-size = "" + text = "Chat" + image = "" + command = ".winset \"say.is-checked=true ? input.command=\"!say \\\"\" : input.command=\"" + is-flat = true + stretch = false + is-checked = false + group = "" + button-type = pushbox + elem "asset_cache_browser" + type = BROWSER + pos = 0,0 + size = 200x200 + anchor1 = none + anchor2 = none + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = false + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "" + on-size = "" + show-history = false + show-url = false + auto-format = true + use-title = false + on-show = "" + on-hide = "" + elem "tooltip" + type = BROWSER + pos = 0,0 + size = 999x999 + anchor1 = none + anchor2 = none + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = false + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "" + on-size = "" + show-history = false + show-url = false + auto-format = true + use-title = false + on-show = "" + on-hide = "" + +window "mapwindow" + elem "mapwindow" + type = MAIN + pos = 0,0 + size = 640x480 + anchor1 = none + anchor2 = none + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "pos;size;is-minimized;is-maximized" + on-size = "" + title = "" + titlebar = true + statusbar = true + can-close = true + can-minimize = true + can-resize = true + is-pane = true + is-minimized = false + is-maximized = false + can-scroll = none + icon = "" + image = "" + image-mode = stretch + keep-aspect = false + transparent-color = none + alpha = 255 + macro = "" + menu = "" + on-close = "" + elem "map" + type = MAP + pos = 0,0 + size = 640x480 + anchor1 = 0,0 + anchor2 = 100,100 + font-family = "Arial" + font-size = 7 + font-style = "" + text-color = none + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = true + border = none + drop-zone = true + right-click = false + saved-params = "icon-size" + on-size = "" + icon-size = 0 + text-mode = false + letterbox = true + zoom = 0 + on-show = "" + on-hide = "" + style = "" + zoom-mode = "distort" + +window "infowindow" + elem "infowindow" + type = MAIN + pos = 0,0 + size = 640x480 + anchor1 = none + anchor2 = none + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "pos;size;is-minimized;is-maximized" + on-size = "" + title = "" + titlebar = true + statusbar = true + can-close = true + can-minimize = true + can-resize = true + is-pane = true + is-minimized = false + is-maximized = false + can-scroll = none + icon = "" + image = "" + image-mode = stretch + keep-aspect = false + transparent-color = none + alpha = 255 + macro = "" + menu = "" + on-close = "" + elem "info" + type = CHILD + pos = 0,30 + size = 640x445 + anchor1 = 0,0 + anchor2 = 100,100 + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "splitter" + on-size = "" + left = "statwindow" + right = "outputwindow" + is-vert = false + splitter = 50 + show-splitter = true + lock = none + elem "changelog" + type = BUTTON + pos = 16,5 + size = 104x20 + anchor1 = 3,0 + anchor2 = 19,0 + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "is-checked" + on-size = "" + text = "Changelog" + image = "" + command = "changelog" + is-flat = false + stretch = false + is-checked = false + group = "" + button-type = pushbutton + elem "rules" + type = BUTTON + pos = 120,5 + size = 100x20 + anchor1 = 19,0 + anchor2 = 34,0 + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "is-checked" + on-size = "" + text = "Rules" + image = "" + command = "rules" + is-flat = false + stretch = false + is-checked = false + group = "" + button-type = pushbutton + elem "wiki" + type = BUTTON + pos = 220,5 + size = 100x20 + anchor1 = 34,0 + anchor2 = 50,0 + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "is-checked" + on-size = "" + text = "Wiki" + image = "" + command = "wiki" + is-flat = false + stretch = false + is-checked = false + group = "" + button-type = pushbutton + elem "forum" + type = BUTTON + pos = 320,5 + size = 100x20 + anchor1 = 50,0 + anchor2 = 66,0 + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "is-checked" + on-size = "" + text = "Forum" + image = "" + command = "forum" + is-flat = false + stretch = false + is-checked = false + group = "" + button-type = pushbutton + elem "github" + type = BUTTON + pos = 420,5 + size = 100x20 + anchor1 = 66,0 + anchor2 = 81,0 + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "is-checked" + on-size = "" + text = "Github" + image = "" + command = "github" + is-flat = false + stretch = false + is-checked = false + group = "" + button-type = pushbutton + elem "report-issue" + type = BUTTON + pos = 520,5 + size = 100x20 + anchor1 = 81,0 + anchor2 = 97,0 + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "is-checked" + on-size = "" + text = "Report Issue" + image = "" + command = "report-issue" + is-flat = false + stretch = false + is-checked = false + group = "" + button-type = pushbutton + +window "outputwindow" + elem "outputwindow" + type = MAIN + pos = 0,0 + size = 640x480 + anchor1 = none + anchor2 = none + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "pos;size;is-minimized;is-maximized" + on-size = "" + title = "" + titlebar = true + statusbar = true + can-close = true + can-minimize = true + can-resize = true + is-pane = true + is-minimized = false + is-maximized = false + can-scroll = none + icon = "" + image = "" + image-mode = stretch + keep-aspect = false + transparent-color = none + alpha = 255 + macro = "" + menu = "" + on-close = "" + elem "output" + type = OUTPUT + pos = 0,0 + size = 640x480 + anchor1 = 0,0 + anchor2 = 100,100 + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = #ffffff + is-visible = true + is-disabled = false + is-transparent = false + is-default = true + border = none + drop-zone = false + right-click = false + saved-params = "max-lines" + on-size = "" + link-color = #0000ff + visited-color = #ff00ff + style = "" + enable-http-images = false + max-lines = 1000 + image = "" + +window "statwindow" + elem "statwindow" + type = MAIN + pos = 0,0 + size = 640x480 + anchor1 = none + anchor2 = none + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = none + is-visible = true + is-disabled = false + is-transparent = false + is-default = false + border = none + drop-zone = false + right-click = false + saved-params = "pos;size;is-minimized;is-maximized" + on-size = "" + title = "" + titlebar = true + statusbar = true + can-close = true + can-minimize = true + can-resize = true + is-pane = true + is-minimized = false + is-maximized = false + can-scroll = none + icon = "" + image = "" + image-mode = stretch + keep-aspect = false + transparent-color = none + alpha = 255 + macro = "" + menu = "" + on-close = "" + elem "stat" + type = INFO + pos = 0,0 + size = 640x480 + anchor1 = 0,0 + anchor2 = 100,100 + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = #ffffff + is-visible = true + is-disabled = false + is-transparent = false + is-default = true + border = none + drop-zone = true + right-click = false + saved-params = "" + on-size = "" + highlight-color = #00ff00 + tab-text-color = #000000 + tab-background-color = none + tab-font-family = "" + tab-font-size = 0 + tab-font-style = "" + allow-html = true + multi-line = true + on-show = "" + on-hide = "" + on-tab = "" + prefix-color = none + suffix-color = none +