diff --git a/.gitignore b/.gitignore index 8c7388a42d2..47ad360a40e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ data/ /_maps/map_files/**/*.dmm.backup /nano/debug.html *.db -.atom-build.json \ No newline at end of file +stddef.dm +.atom-build.json diff --git a/.travis.yml b/.travis.yml index b79cb5e0db3..27dae76378e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,8 @@ git: env: global: - - BYOND_MAJOR="509" - - BYOND_MINOR="1315" + - BYOND_MAJOR="510" + - BYOND_MINOR="1336" matrix: - DM_MAPFILE="cyberiad" - DM_MAPFILE="metastation" diff --git a/bin/bygex.dll b/bin/bygex.dll deleted file mode 100644 index b19c0f14b1e..00000000000 Binary files a/bin/bygex.dll and /dev/null differ diff --git a/btime.dll b/btime.dll deleted file mode 100644 index 36dcbe3af75..00000000000 Binary files a/btime.dll and /dev/null differ diff --git a/code/__DEFINES/btime.dm b/code/__DEFINES/btime.dm deleted file mode 100644 index 33d5def1deb..00000000000 --- a/code/__DEFINES/btime.dm +++ /dev/null @@ -1,18 +0,0 @@ -// Comment this out if the external btime library is unavailable -#define PRECISE_TIMER_AVAILABLE - -#ifdef PRECISE_TIMER_AVAILABLE -var/global/__btime__libName = "btime.[world.system_type==MS_WINDOWS?"dll":"so"]" -#define TimeOfHour (__extern__timeofhour) -#define __extern__timeofhour text2num(call(__btime__libName, "gettime")()) -/hook/startup/proc/checkbtime() - try - // This will always return 1 unless the btime library cannot be accessed - if(TimeOfHour || 1) return 1 - catch(var/exception/e) - log_to_dd("PRECISE_TIMER_AVAILABLE is defined in btime.dm, but calling the btime library failed: [e]") - log_to_dd("This is a fatal error. The world will now shut down.") - del(world) -#else -#define TimeOfHour (world.timeofday % 36000) -#endif diff --git a/code/__DEFINES/process_scheduler.dm b/code/__DEFINES/process_scheduler.dm index af859e314ff..d9c8f106efc 100644 --- a/code/__DEFINES/process_scheduler.dm +++ b/code/__DEFINES/process_scheduler.dm @@ -16,4 +16,4 @@ // SCHECK macros // This references src directly to work around a weird bug with try/catch #define SCHECK_EVERY(this_many_calls) if(++src.calls_since_last_scheck >= this_many_calls) sleepCheck() -#define SCHECK SCHECK_EVERY(50) +#define SCHECK sleepCheck() diff --git a/code/__HELPERS/_string_lists.dm b/code/__HELPERS/_string_lists.dm index 3336e16b560..f9b5e179aa1 100644 --- a/code/__HELPERS/_string_lists.dm +++ b/code/__HELPERS/_string_lists.dm @@ -12,11 +12,11 @@ var/global/list/string_cache var/list/stringsList = list() fileList = file2list("strings/[filename]") for(var/s in fileList) - stringsList = text2list(s, "@=") + stringsList = splittext(s, "@=") if(stringsList.len != 2) CRASH("Invalid string list in strings/[filename]") if(findtext(stringsList[2], "@,")) - string_cache[filename][stringsList[1]] = text2list(stringsList[2], "@,") + string_cache[filename][stringsList[1]] = splittext(stringsList[2], "@,") else string_cache[filename][stringsList[1]] = stringsList[2] // Its a single string! else diff --git a/code/__HELPERS/bygex/bygex.dm b/code/__HELPERS/bygex/bygex.dm deleted file mode 100644 index c5c4999ccca..00000000000 --- a/code/__HELPERS/bygex/bygex.dm +++ /dev/null @@ -1,144 +0,0 @@ -/* - This file is part of bygex. - - bygex is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of - the License, or (at your option) any later version. - - bygex is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with bygex. If not, see - - Based on code by Zac Stringham - Copyright 2009 (LGPL) - Written 6-Oct-2013 - carnie (elly1989@rocketmail.com), accreditation appreciated but not required. - Please do not remove this comment. - - Full source code is available at https://code.google.com/p/byond-regex/ - Please report any relevant issues on the tracker at the above address. - ~Carn -*/ - -#ifdef USE_BYGEX - -#ifndef LIBREGEX_LIBRARY - #define LIBREGEX_LIBRARY "bin/bygex" -#endif - -/proc - regEx_compare(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regEx_compare")(str, exp)) - - regex_compare(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regex_compare")(str, exp)) - - regEx_find(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regEx_find")(str, exp)) - - regex_find(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regex_find")(str, exp)) - - regEx_replaceall(str, exp, fmt) - return call(LIBREGEX_LIBRARY, "regEx_replaceall")(str, exp, fmt) - - regex_replaceall(str, exp, fmt) - return call(LIBREGEX_LIBRARY, "regex_replaceall")(str, exp, fmt) - - replacetextEx(str, exp, fmt) - return call(LIBREGEX_LIBRARY, "regEx_replaceallliteral")(str, exp, fmt) - - replacetext(str, exp, fmt) - return call(LIBREGEX_LIBRARY, "regex_replaceallliteral")(str, exp, fmt) - - regEx_replace(str, exp, fmt) - return call(LIBREGEX_LIBRARY, "regEx_replace")(str, exp, fmt) - - regex_replace(str, exp, fmt) - return call(LIBREGEX_LIBRARY, "regex_replace")(str, exp, fmt) - - regEx_findall(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regEx_findall")(str, exp)) - - regex_findall(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regex_findall")(str, exp)) - - -//upon calling a regex match or search, a /datum/regex object is created with str(haystack) and exp(needle) variables set -//it also contains a list(matches) of /datum/match objects, each of which holds the position and length of the match -//matched strings are not returned from the dll, in order to save on memory allocation for large numbers of strings -//instead, you can use regex.str(matchnum) to fetch this string as needed. -//likewise you can also use regex.pos(matchnum) and regex.len(matchnum) as shorthands -/datum/regex - var/str - var/exp - var/error - var/anchors = 0 - var/list/matches = list() - - New(str, exp, results) - src.str = str - src.exp = exp - - if(findtext(results, "$Err$", 1, 6)) //error message - src.error = results - else - var/list/L = params2list(results) - var/list/M - var{i;j} - for(i in L) - M = L[i] - for(j=2, j<=M.len, j+=2) - matches += new /datum/match(text2num(M[j-1]),text2num(M[j])) - anchors = (j-2)/2 - return matches - - proc - str(i) - if(!i) return str - var/datum/match/M = matches[i] - if(i < 1 || i > matches.len) - throw EXCEPTION("str(): out of bounds") - return copytext(str, M.pos, M.pos+M.len) - - pos(i) - if(!i) return 1 - if(i < 1 || i > matches.len) - throw EXCEPTION("pos(): out of bounds") - var/datum/match/M = matches[i] - return M.pos - - len(i) - if(!i) return length(str) - if(i < 1 || i > matches.len) - throw EXCEPTION("len(): out of bounds") - var/datum/match/M = matches[i] - return M.len - - end(i) - if(!i) return length(str) - if(i < 1 || i > matches.len) - throw EXCEPTION("end() out of bounds") - var/datum/match/M = matches[i] - return M.pos + M.len - - report() //debug tool - . = ":: RESULTS ::\n:: str :: [html_encode(str)]\n:: exp :: [html_encode(exp)]\n:: anchors :: [anchors]" - if(error) - . += "\n[error]" - return - for(var/i=1, i<=matches.len, ++i) - . += "\nMatch[i]\n\t[html_encode(str(i))]\n\tpos=[pos(i)] len=[len(i)]" - -/datum/match - var/pos - var/len - - New(pos, len) - src.pos = pos - src.len = len - -#endif \ No newline at end of file diff --git a/code/__HELPERS/bygex/demo.dm b/code/__HELPERS/bygex/demo.dm deleted file mode 100644 index f89be30ded2..00000000000 --- a/code/__HELPERS/bygex/demo.dm +++ /dev/null @@ -1,54 +0,0 @@ -/mob - var/expression = "\\S+" - var/format = "*" - - var/datum/regex/results - - verb - set_expression() - var/t = input(usr,"Input Expression","title",expression) as text|null - if(t != null) - expression = t - usr << "Expression set to:\t[html_encode(t)]" - - set_format() - var/t = input(usr,"Input Formatter","title",format) as text|null - if(t != null) - format = t - usr << "Format set to:\t[html_encode(t)]" - - compare_casesensitive(t as text) - results = regEx_compare(t, expression) - world << results.report() - - compare(t as text) - results = regex_compare(t, expression) - world << results.report() - - find_casesensitive(t as text) - results = regEx_find(t, expression) - world << results.report() - - find(t as text) - results = regex_find(t, expression) - world << results.report() - - replaceall_casesensitive(t as text) - usr << regEx_replaceall(t, expression, format) - - replaceall(t as text) - usr << regex_replaceall(t, expression, format) - - replace_casesensitive(t as text) - usr << html_encode(regEx_replace(t, expression, format)) - - replace(t as text) - usr << regex_replace(t, expression, format) - - findall(t as text) - results = regex_findall(t, expression) - world << results.report() - - findall_casesensitive(t as text) - results = regEx_findall(t, expression) - world << results.report() \ No newline at end of file diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 703ad8a746b..f85e318de76 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -203,13 +203,6 @@ proc/checkhtml(var/t) * Text modification */ // See bygex.dm -#ifndef USE_BYGEX -/proc/replacetext(text, find, replacement) - return list2text(text2list(text, find), replacement) - -/proc/replacetextEx(text, find, replacement) - return list2text(text2listEx(text, find), replacement) -#endif /proc/replace_characters(var/t,var/list/repl_chars) for(var/char in repl_chars) t = replacetext(t, char, repl_chars[char]) diff --git a/code/__HELPERS/time.dm b/code/__HELPERS/time.dm index 1bdd85841a5..4973de14b81 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -3,6 +3,25 @@ #define MINUTES *600 #define HOURS *36000 +#define TimeOfGame (get_game_time()) +#define TimeOfTick (world.tick_usage*0.01*world.tick_lag) + +/proc/get_game_time() + var/global/time_offset = 0 + var/global/last_time = 0 + var/global/last_usage = 0 + + var/wtime = world.time + var/wusage = world.tick_usage * 0.01 + + if(last_time < wtime && last_usage > 1) + time_offset += last_usage - 1 + + last_time = wtime + last_usage = wusage + + return wtime + (time_offset + wusage) * world.tick_lag + //Returns the world time in english /proc/worldtime2text(time = world.time) return "[round(time / 36000)+12]:[(time / 600 % 60) < 10 ? add_zero(time / 600 % 60, 1) : time / 600 % 60]" @@ -33,15 +52,14 @@ proc/isDay(var/month, var/day) * Returns "watch handle" (really just a timestamp :V) */ /proc/start_watch() - return world.timeofday + return TimeOfGame /** * Returns number of seconds elapsed. * @param wh number The "Watch Handle" from start_watch(). (timestamp) */ /proc/stop_watch(wh) - return round(0.1*(world.timeofday-wh),0.1) + return round(0.1 * (TimeOfGame - wh), 0.1) /proc/month2number(month) - return month_names.Find(month) - \ No newline at end of file + return month_names.Find(month) \ No newline at end of file diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index 99c641f6dd0..ced289358e0 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -2,7 +2,6 @@ * Holds procs designed to change one type of value, into another. * Contains: * hex2num & num2hex - * text2list & list2text * file2list * angle2dir * angle2text @@ -60,161 +59,15 @@ hex = "0[hex]" return hex || "0" -// Concatenates a list of strings into a single string. A seperator may optionally be provided. -/proc/list2text(list/ls, sep) - if(ls.len <= 1) // Early-out code for empty or singleton lists. - return ls.len ? ls[1] : "" - - var/l = ls.len // Made local for sanic speed. - var/i = 0 // Incremented every time a list index is accessed. - - if(sep != null) - // Macros expand to long argument lists like so: sep, ls[++i], sep, ls[++i], sep, ls[++i], etc... - #define S1 sep, ls[++i] - #define S4 S1, S1, S1, S1 - #define S16 S4, S4, S4, S4 - #define S64 S16, S16, S16, S16 - - . = "[ls[++i]]" // Make sure the initial element is converted to text. - - // Having the small concatenations come before the large ones boosted speed by an average of at least 5%. - if(l-1 & 0x01) // 'i' will always be 1 here. - . = text("[][][]", ., S1) // Append 1 element if the remaining elements are not a multiple of 2. - if(l-i & 0x02) - . = text("[][][][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4. - if(l-i & 0x04) - . = text("[][][][][][][][][]", ., S4) // And so on.... - if(l-i & 0x08) - . = text("[][][][][][][][][][][][][][][][][]", ., S4, S4) - if(l-i & 0x10) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16) - if(l-i & 0x20) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16) - if(l-i & 0x40) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64) - while(l > i) // Chomp through the rest of the list, 128 elements at a time. - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64) - - #undef S64 - #undef S16 - #undef S4 - #undef S1 - - else - // Macros expand to long argument lists like so: ls[++i], ls[++i], ls[++i], etc... - #define S1 ls[++i] - #define S4 S1, S1, S1, S1 - #define S16 S4, S4, S4, S4 - #define S64 S16, S16, S16, S16 - - . = "[ls[++i]]" // Make sure the initial element is converted to text. - - if(l-1 & 0x01) // 'i' will always be 1 here. - . += S1 // Append 1 element if the remaining elements are not a multiple of 2. - if(l-i & 0x02) - . = text("[][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4. - if(l-i & 0x04) - . = text("[][][][][]", ., S4) // And so on... - if(l-i & 0x08) - . = text("[][][][][][][][][]", ., S4, S4) - if(l-i & 0x10) - . = text("[][][][][][][][][][][][][][][][][]", ., S16) - if(l-i & 0x20) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16) - if(l-i & 0x40) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64) - while(l > i) // Chomp through the rest of the list, 128 elements at a time. - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64) - - #undef S64 - #undef S16 - #undef S4 - #undef S1 - -//slower then list2text, but correctly processes associative lists. -proc/tg_list2text(list/list, glue=",", assocglue=";") - if(!istype(list) || !list.len) - return - var/output - for(var/i=1 to list.len) - if(!isnull(list["[list[i]]"])) - output += (i!=1? glue : null)+ "[list[i]]"+(i!=1? assocglue : null)+"[list["[list[i]]"]]" - else - output += (i!=1? glue : null)+ "[list[i]]" - return output - -proc/tg_text2list(text, glue=",", assocglue=";") - var/length = length(glue) - if(length < 1) return list(text) - . = list() - var/lastglue_found = 1 - var/foundglue - var/foundassocglue - var/searchtext - do - foundglue = findtext(text, glue, lastglue_found, 0) - searchtext = copytext(text, lastglue_found, foundglue) - foundassocglue = findtext(searchtext, assocglue, 1, 0) - if(foundassocglue) - var/sublist = copytext(searchtext, 1, foundassocglue) - sublist[1] = copytext(searchtext, foundassocglue, 0) - . += sublist - else - . += copytext(text, lastglue_found, foundglue) - lastglue_found = foundglue + length - while(foundglue) - - -//Converts a string into a list by splitting the string at each delimiter found. (discarding the seperator) -/proc/text2list(text, delimiter="\n") - var/delim_len = length(delimiter) - if(delim_len < 1) return list(text) - . = list() - var/last_found = 1 - var/found - do - found = findtext(text, delimiter, last_found, 0) - . += copytext(text, last_found, found) - last_found = found + delim_len - while(found) - -//Case Sensitive! -/proc/text2listEx(text, delimiter="\n") - var/delim_len = length(delimiter) - if(delim_len < 1) return list(text) - . = list() - var/last_found = 1 - var/found - do - found = findtextEx(text, delimiter, last_found, 0) - . += copytext(text, last_found, found) - last_found = found + delim_len - while(found) - /proc/text2numlist(text, delimiter="\n") var/list/num_list = list() - for(var/x in text2list(text, delimiter)) + for(var/x in splittext(text, delimiter)) num_list += text2num(x) return num_list //Splits the text of a file at seperator and returns them in a list. /proc/file2list(filename, seperator="\n") - return text2list(return_file_text(filename),seperator) + return splittext(return_file_text(filename),seperator) //Turns a direction into text @@ -428,7 +281,7 @@ proc/tg_text2list(text, glue=",", assocglue=";") //Argument: Give this a space-separated string consisting of 6 numbers. Returns null if you don't /proc/text2matrix(var/matrixtext) - var/list/matrixtext_list = text2list(matrixtext, " ") + var/list/matrixtext_list = splittext(matrixtext, " ") var/list/matrix_list = list() for(var/item in matrixtext_list) var/entry = text2num(item) @@ -443,4 +296,4 @@ proc/tg_text2list(text, glue=",", assocglue=";") var/d = matrix_list[4] var/e = matrix_list[5] var/f = matrix_list[6] - return matrix(a, b, c, d, e, f) \ No newline at end of file + return matrix(a, b, c, d, e, f) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 0c99ec12416..f5e577f8b8a 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1601,11 +1601,11 @@ var/mob/dview/dview_mob = new return 1 /proc/screen_loc2turf(scr_loc, turf/origin) - var/tX = text2list(scr_loc, ",") - var/tY = text2list(tX[2], ":") + var/tX = splittext(scr_loc, ",") + var/tY = splittext(tX[2], ":") var/tZ = origin.z tY = tY[1] - tX = text2list(tX[1], ":") + tX = splittext(tX[1], ":") tX = tX[1] tX = max(1, min(world.maxx, origin.x + (text2num(tX) - (world.view + 1)))) tY = max(1, min(world.maxy, origin.y + (text2num(tY) - (world.view + 1)))) @@ -1665,4 +1665,4 @@ var/global/list/g_fancy_list_of_types = null var/value = L[key] if(findtext("[key]", filter) || findtext("[value]", filter)) matches[key] = value - return matches \ No newline at end of file + return matches diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 662ec34ceac..12cd9086711 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -13,12 +13,10 @@ #define MAX_NAME_LEN 26 // Version check, terminates compilation if someone is using a version of BYOND that's too old -#if DM_VERSION < 508 +#if DM_VERSION < 510 #error OUTDATED VERSION ERROR - \ Due to BYOND features used in this codebase, you must update to version 508 or later to compile. \ This may require updating to a beta release. #endif var/global/list/processing_objects = list() //This has to be initialized BEFORE world - -#define USE_BYGEX \ No newline at end of file diff --git a/code/_onclick/_defines.dm b/code/_onclick/_defines.dm new file mode 100644 index 00000000000..3c76c35e807 --- /dev/null +++ b/code/_onclick/_defines.dm @@ -0,0 +1 @@ +#define CLICKCATCHER_PLANE -99 \ No newline at end of file diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index d43d12b1e8b..c0fb6204fe6 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -405,9 +405,9 @@ buckled.handle_rotation()*/ /obj/screen/click_catcher - icon = 'icons/mob/screen1_full.dmi' + icon = 'icons/mob/screen_full.dmi' icon_state = "passage0" - layer = 0 + plane = CLICKCATCHER_PLANE mouse_opacity = 2 screen_loc = "CENTER-7,CENTER-7" diff --git a/code/_onclick/hud/alien.dm b/code/_onclick/hud/alien.dm index 568ffa084f2..fa7017fd2d8 100644 --- a/code/_onclick/hud/alien.dm +++ b/code/_onclick/hud/alien.dm @@ -166,21 +166,6 @@ alien_plasma_display.name = "plasma stored" alien_plasma_display.screen_loc = ui_alienplasmadisplay - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen1_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = " " - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.layer = 0 - mymob.blind.mouse_opacity = 0 - - mymob.flash = new /obj/screen() - mymob.flash.icon = 'icons/mob/screen1_alien.dmi' - mymob.flash.icon_state = "blank" - mymob.flash.name = "flash" - mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" - mymob.flash.layer = 17 - mymob.zone_sel = new /obj/screen/zone_sel() mymob.zone_sel.icon = 'icons/mob/screen1_alien.dmi' mymob.zone_sel.overlays.Cut() @@ -188,6 +173,6 @@ mymob.client.screen = list() - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, nightvisionicon, mymob.pullin, alien_plasma_display, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach ) + mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, nightvisionicon, mymob.pullin, alien_plasma_display, mymob.pullin) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach ) mymob.client.screen += src.adding + src.other mymob.client.screen += mymob.client.void \ No newline at end of file diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm index 18c2d344f53..8232f2073e2 100644 --- a/code/_onclick/hud/alien_larva.dm +++ b/code/_onclick/hud/alien_larva.dm @@ -61,21 +61,6 @@ mymob.pullin.update_icon(mymob) mymob.pullin.screen_loc = ui_pull_resist - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen1_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = " " - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.layer = 0 - mymob.blind.mouse_opacity = 0 - - mymob.flash = new /obj/screen() - mymob.flash.icon = 'icons/mob/screen1_alien.dmi' - mymob.flash.icon_state = "blank" - mymob.flash.name = "flash" - mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" - mymob.flash.layer = 17 - mymob.zone_sel = new /obj/screen/zone_sel() mymob.zone_sel.icon = 'icons/mob/screen1_alien.dmi' mymob.zone_sel.overlays.Cut() @@ -83,6 +68,6 @@ mymob.client.screen = list() - mymob.client.screen += list( mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, nightvisionicon, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach ) + mymob.client.screen += list( mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, nightvisionicon, mymob.pullin) //, mymob.rest, mymob.sleep, mymob.mach ) mymob.client.screen += src.adding + src.other mymob.client.screen += mymob.client.void \ No newline at end of file diff --git a/code/_onclick/hud/bot.dm b/code/_onclick/hud/bot.dm index ee8d1e49e2b..c4488376309 100644 --- a/code/_onclick/hud/bot.dm +++ b/code/_onclick/hud/bot.dm @@ -47,24 +47,9 @@ mymob.pullin.update_icon(mymob) mymob.pullin.screen_loc = ui_bot_pull - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen1_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = " " - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.layer = 0 - mymob.blind.mouse_opacity = 0 - - mymob.flash = new /obj/screen() - mymob.flash.icon = 'icons/mob/screen1_bot.dmi' - mymob.flash.icon_state = "blank" - mymob.flash.name = "flash" - mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" - mymob.flash.layer = 17 - mymob.client.screen = list() - mymob.client.screen += list(mymob.oxygen, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) + mymob.client.screen += list(mymob.oxygen, mymob.fire, mymob.healths, mymob.pullin) mymob.client.screen += adding + other mymob.client.screen += mymob.client.void return \ No newline at end of file diff --git a/code/_onclick/hud/fullscreen.dm b/code/_onclick/hud/fullscreen.dm new file mode 100644 index 00000000000..8ab49788e5b --- /dev/null +++ b/code/_onclick/hud/fullscreen.dm @@ -0,0 +1,112 @@ +#define FULLSCREEN_LAYER 18 +#define DAMAGE_LAYER FULLSCREEN_LAYER + 0.1 +#define BLIND_LAYER DAMAGE_LAYER + 0.1 +#define CRIT_LAYER BLIND_LAYER + 0.1 + +/mob + var/list/screens = list() + +/mob/proc/overlay_fullscreen(category, type, severity) + var/obj/screen/fullscreen/screen + if(screens[category]) + screen = screens[category] + if(screen.type != type) + clear_fullscreen(category, FALSE) + return .() + else if(!severity || severity == screen.severity) + return null + else + screen = new type + + screen.icon_state = "[initial(screen.icon_state)][severity]" + screen.severity = severity + + screens[category] = screen + if(client) + client.screen += screen + return screen + +/mob/proc/clear_fullscreen(category, animated = 10) + var/obj/screen/fullscreen/screen = screens[category] + if(!screen) + return + + screens -= category + + if(animated) + spawn(0) + animate(screen, alpha = 0, time = animated) + sleep(animated) + if(client) + client.screen -= screen + qdel(screen) + else + if(client) + client.screen -= screen + qdel(screen) + +/mob/proc/clear_fullscreens() + for(var/category in screens) + clear_fullscreen(category) + +/datum/hud/proc/reload_fullscreen() + var/list/screens = mymob.screens + for(var/category in screens) + mymob.client.screen |= screens[category] + +/obj/screen/fullscreen + icon = 'icons/mob/screen_full.dmi' + icon_state = "default" + screen_loc = "CENTER-7,CENTER-7" + layer = FULLSCREEN_LAYER + mouse_opacity = 0 + var/severity = 0 + +/obj/screen/fullscreen/Destroy() + ..() + severity = 0 + return QDEL_HINT_HARDDEL_NOW + +/obj/screen/fullscreen/brute + icon_state = "brutedamageoverlay" + layer = DAMAGE_LAYER + +/obj/screen/fullscreen/oxy + icon_state = "oxydamageoverlay" + layer = DAMAGE_LAYER + +/obj/screen/fullscreen/crit + icon_state = "passage" + layer = CRIT_LAYER + +/obj/screen/fullscreen/blind + icon_state = "blackimageoverlay" + layer = BLIND_LAYER + +/obj/screen/fullscreen/impaired + icon_state = "impairedoverlay" + +/obj/screen/fullscreen/blurry + icon = 'icons/mob/screen_gen.dmi' + screen_loc = "WEST,SOUTH to EAST,NORTH" + icon_state = "blurry" + +/obj/screen/fullscreen/flash + icon = 'icons/mob/screen_gen.dmi' + screen_loc = "WEST,SOUTH to EAST,NORTH" + icon_state = "flash" + +/obj/screen/fullscreen/flash/noise + icon = 'icons/mob/screen_gen.dmi' + screen_loc = "WEST,SOUTH to EAST,NORTH" + icon_state = "noise" + +/obj/screen/fullscreen/high + icon = 'icons/mob/screen_gen.dmi' + screen_loc = "WEST,SOUTH to EAST,NORTH" + icon_state = "druggy" + +#undef FULLSCREEN_LAYER +#undef BLIND_LAYER +#undef DAMAGE_LAYER +#undef CRIT_LAYER diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 555df404e28..6d5da0da58e 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -1,84 +1,3 @@ -/* - The global hud: - Uses the same visual objects for all players. -*/ -var/datum/global_hud/global_hud = new() - -/datum/hud/var/obj/screen/grab_intent -/datum/hud/var/obj/screen/hurt_intent -/datum/hud/var/obj/screen/disarm_intent -/datum/hud/var/obj/screen/help_intent - -/datum/global_hud - var/obj/screen/druggy - var/obj/screen/blurry - var/list/vimpaired - var/list/darkMask - -/datum/global_hud/New() - //420erryday psychedellic colours screen overlay for when you are high - druggy = new /obj/screen() - druggy.screen_loc = "WEST,SOUTH to EAST,NORTH" - druggy.icon_state = "druggy" - druggy.layer = 17 - druggy.mouse_opacity = 0 - - //that white blurry effect you get when you eyes are damaged - blurry = new /obj/screen() - blurry.screen_loc = "WEST,SOUTH to EAST,NORTH" - blurry.icon_state = "blurry" - blurry.layer = 17 - blurry.mouse_opacity = 0 - - var/obj/screen/O - var/i - //that nasty looking dither you get when you're short-sighted - vimpaired = newlist(/obj/screen,/obj/screen,/obj/screen,/obj/screen) - O = vimpaired[1] - O.screen_loc = "WEST,SOUTH to CENTER-3,NORTH" - O = vimpaired[2] - O.screen_loc = "WEST,SOUTH to EAST,CENTER-3" - O = vimpaired[3] - O.screen_loc = "CENTER+3,SOUTH to EAST,NORTH" - O = vimpaired[4] - O.screen_loc = "WEST,CENTER+3 to EAST,NORTH" - - //welding mask overlay black/dither - darkMask = newlist(/obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen) - O = darkMask[1] - O.screen_loc = "CENTER-5,CENTER-5 to CENTER-3,CENTER+5" - O = darkMask[2] - O.screen_loc = "CENTER-5,CENTER-5 to CENTER+5,CENTER-3" - O = darkMask[3] - O.screen_loc = "CENTER+3,CENTER-5 to CENTER+5,CENTER+5" - O = darkMask[4] - O.screen_loc = "CENTER-5,CENTER+3 to CENTER+5,CENTER+5" - O = darkMask[5] - O.screen_loc = "WEST,SOUTH to CENTER-5,NORTH" - O = darkMask[6] - O.screen_loc = "WEST,SOUTH to EAST,CENTER-5" - O = darkMask[7] - O.screen_loc = "CENTER+5,SOUTH to EAST,NORTH" - O = darkMask[8] - O.screen_loc = "WEST,CENTER+5 to EAST,NORTH" - - for(i = 1, i <= 4, i++) - O = vimpaired[i] - O.icon_state = "dither50" - O.layer = 17 - O.mouse_opacity = 0 - - O = darkMask[i] - O.icon_state = "dither50" - O.layer = 17 - O.mouse_opacity = 0 - - for(i = 5, i <= 8, i++) - O = darkMask[i] - O.icon_state = "black" - O.layer = 17 - O.mouse_opacity = 0 - /* The hud datum Used to show and hide huds for all the different mob types, @@ -182,8 +101,6 @@ datum/hud/New(mob/owner) monkey_hud(ui_style, ui_color, ui_alpha) else if(ishuman(mymob)) human_hud(ui_style, ui_color, ui_alpha) // Pass the player the UI style chosen in preferences - else if(isbrain(mymob)) - brain_hud(ui_style) else if( islarva(mymob) || isfacehugger(mymob) ) larva_hud() else if (isembryo(mymob)) @@ -208,8 +125,8 @@ datum/hud/New(mob/owner) guardian_hud() else if(ispet(mymob)) corgi_hud() - else - + + reload_fullscreen() //Triggered when F12 is pressed (Unless someone changed something in the DMF) /mob/verb/button_pressed_F12(var/full = 0 as null) @@ -275,6 +192,8 @@ datum/hud/New(mob/owner) hud_used.hidden_inventory_update() hud_used.persistant_inventory_update() update_action_buttons() + //hud_used.reorganize_alerts() + else usr << "\red Inventory hiding is currently only supported for human mobs, sorry." else diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 7236feb439f..2bf587c1cc1 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -424,31 +424,6 @@ lingstingdisplay = new /obj/screen/ling/sting() lingstingdisplay.screen_loc = ui_lingstingdisplay - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen1_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = "blind" - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.mouse_opacity = 0 - mymob.blind.layer = 0 - - mymob.damageoverlay = new /obj/screen() - mymob.damageoverlay.icon = 'icons/mob/screen1_full.dmi' - mymob.damageoverlay.icon_state = "oxydamageoverlay0" - mymob.damageoverlay.name = "dmg" - mymob.damageoverlay.screen_loc = "CENTER-7,CENTER-7" - mymob.damageoverlay.mouse_opacity = 0 - mymob.damageoverlay.layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top. - - mymob.flash = new /obj/screen() - mymob.flash.icon = ui_style - mymob.flash.icon_state = "blank" - mymob.flash.name = "flash" - mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" - mymob.flash.layer = 17 - - mymob.pain = new /obj/screen( null ) - mymob.zone_sel = new /obj/screen/zone_sel( null ) mymob.zone_sel.icon = ui_style mymob.zone_sel.color = ui_color @@ -480,10 +455,10 @@ mymob.client.screen = list() - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.healthdoll, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.damageoverlay, mymob.gun_setting_icon, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach ) + mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.healthdoll, mymob.nutrition_icon, mymob.pullin, mymob.gun_setting_icon, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach ) mymob.client.screen += src.adding + src.hotkeybuttons mymob.client.screen += mymob.client.void - inventory_shown = 0; + inventory_shown = 0 return diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index 18b45befa88..b7a9a102116 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -19,59 +19,6 @@ src.adding += using action_intent = using -//intent small hud objects -/* var/icon/ico - - ico = new(ui_style, "black") - ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) - ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height()) - using = new /obj/screen( src ) - using.name = "help" - using.icon = ico - using.screen_loc = ui_acti - using.alpha = ui_alpha - using.layer = 21 - src.adding += using - help_intent = using - - ico = new(ui_style, "black") - ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) - ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height()) - using = new /obj/screen( src ) - using.name = "disarm" - using.icon = ico - using.screen_loc = ui_acti - using.alpha = ui_alpha - using.layer = 21 - src.adding += using - disarm_intent = using - - ico = new(ui_style, "black") - ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) - ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2) - using = new /obj/screen( src ) - using.name = "grab" - using.icon = ico - using.screen_loc = ui_acti - using.alpha = ui_alpha - using.layer = 21 - src.adding += using - grab_intent = using - - ico = new(ui_style, "black") - ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) - ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2) - using = new /obj/screen( src ) - using.name = "harm" - using.icon = ico - using.screen_loc = ui_acti - using.alpha = ui_alpha - using.layer = 21 - src.adding += using - hurt_intent = using -*/ -//end intent small hud objects - using = new /obj/screen/mov_intent() using.name = "mov_intent" using.dir = SOUTHWEST @@ -245,32 +192,6 @@ lingstingdisplay = new /obj/screen/ling/sting() lingstingdisplay.screen_loc = ui_lingstingdisplay - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen1_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = "blind" - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.mouse_opacity = 0 - mymob.blind.layer = 0 - mymob.blind.mouse_opacity = 0 - - mymob.damageoverlay = new /obj/screen() - mymob.damageoverlay.icon = 'icons/mob/screen1_full.dmi' - mymob.damageoverlay.icon_state = "oxydamageoverlay0" - mymob.damageoverlay.name = "dmg" - mymob.damageoverlay.screen_loc = "CENTER-7,CENTER-7" - mymob.damageoverlay.mouse_opacity = 0 - mymob.damageoverlay.layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top. - - mymob.flash = new /obj/screen() - mymob.flash.icon = ui_style - mymob.flash.icon_state = "blank" - mymob.flash.name = "flash" - mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" - mymob.flash.layer = 17 - - mymob.pain = new /obj/screen( null ) - mymob.zone_sel = new /obj/screen/zone_sel( null ) mymob.zone_sel.icon = ui_style mymob.zone_sel.color = ui_color @@ -302,8 +223,8 @@ mymob.client.screen = list() - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.healthdoll, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.damageoverlay, mymob.gun_setting_icon, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach ) + mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.healthdoll, mymob.nutrition_icon, mymob.pullin, mymob.gun_setting_icon, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach ) mymob.client.screen += src.adding + src.hotkeybuttons mymob.client.screen += mymob.client.void - return + return \ No newline at end of file diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index a0dc4827ba9..e8d4e4b3d73 100644 --- a/code/_onclick/hud/movable_screen_objects.dm +++ b/code/_onclick/hud/movable_screen_objects.dm @@ -27,13 +27,13 @@ return //Split screen-loc up into X+Pixel_X and Y+Pixel_Y - var/list/screen_loc_params = text2list(PM["screen-loc"], ",") + var/list/screen_loc_params = splittext(PM["screen-loc"], ",") //Split X+Pixel_X up into list(X, Pixel_X) - var/list/screen_loc_X = text2list(screen_loc_params[1],":") + var/list/screen_loc_X = splittext(screen_loc_params[1],":") //Split Y+Pixel_Y up into list(Y, Pixel_Y) - var/list/screen_loc_Y = text2list(screen_loc_params[2],":") + var/list/screen_loc_Y = splittext(screen_loc_params[2],":") if(snap2grid) //Discard Pixel Values screen_loc = "[screen_loc_X[1]],[screen_loc_Y[1]]" diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm index e2923055324..e0b1ea11f1a 100644 --- a/code/_onclick/hud/other_mobs.dm +++ b/code/_onclick/hud/other_mobs.dm @@ -35,19 +35,10 @@ mymob.toxin.name = "toxin" mymob.toxin.screen_loc = ui_toxin - mymob.client.screen = null + mymob.client.screen = list() mymob.client.screen += list(mymob.fire, mymob.healths, mymob.pullin, mymob.oxygen, mymob.toxin) -/datum/hud/proc/brain_hud(ui_style = 'icons/mob/screen1_Midnight.dmi') - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen1_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = " " - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.layer = 0 - mymob.blind.mouse_opacity = 0 - /datum/hud/proc/blob_hud(ui_style = 'icons/mob/screen1_Midnight.dmi') diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 78ee883960c..b83bfcf411a 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -210,50 +210,17 @@ mymob.pullin.update_icon(mymob) mymob.pullin.screen_loc = ui_borg_pull - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen1_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = " " - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.layer = 0 - mymob.blind.mouse_opacity = 0 - - mymob.flash = new /obj/screen() - mymob.flash.icon = 'icons/mob/screen1_robot.dmi' - mymob.flash.icon_state = "blank" - mymob.flash.name = "flash" - mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" - mymob.flash.layer = 17 - mymob.zone_sel = new /obj/screen/zone_sel() mymob.zone_sel.icon = 'icons/mob/screen1_robot.dmi' mymob.zone_sel.overlays.Cut() mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") - //Handle the gun settings buttons mymob.gun_setting_icon = new /obj/screen/gun/mode(null) mymob.item_use_icon = new /obj/screen/gun/item(null) - //if (mymob.client) - // if (mymob.client.gun_mode) // If in aim mode, correct the sprite - // mymob.gun_setting_icon.dir = 2 - //for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons - // if (G.target) - // mymob.item_use_icon = new /obj/screen/gun/item(null) - // if (mymob.client.target_can_click) - // mymob.item_use_icon.dir = 1 - //src.adding += mymob.item_use_icon - /*mymob.gun_move_icon = new /obj/screen/gun/move(null) - if (mymob.client.target_can_move) - mymob.gun_move_icon.dir = 1 - mymob.gun_run_icon = new /obj/screen/gun/run(null) - if (mymob.client.target_can_run) - mymob.gun_run_icon.dir = 1 - src.adding += mymob.gun_run_icon - src.adding += mymob.gun_move_icon*/ mymob.client.screen = list() - mymob.client.screen += list(mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon, mymob:lamp_button) //, mymob.rest, mymob.sleep, mymob.mach ) + mymob.client.screen += list(mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.gun_setting_icon, mymob:lamp_button) //, mymob.rest, mymob.sleep, mymob.mach ) mymob.client.screen += src.adding + src.other mymob.client.screen += mymob.client.void return diff --git a/code/controllers/ProcessScheduler/core/_stubs.dm b/code/controllers/ProcessScheduler/core/_stubs.dm deleted file mode 100644 index 94f4cc1fc4b..00000000000 --- a/code/controllers/ProcessScheduler/core/_stubs.dm +++ /dev/null @@ -1,27 +0,0 @@ -/** - * _stubs.dm - * - * This file contains constructs that the process scheduler expects to exist - * in a standard ss13 fork. - */ -/* -/** - * message_admins - * - * sends a message to admins - */ -/proc/message_admins(msg) - world << msg -*/ -/** - * logTheThing - * - * In goonstation, this proc writes a message to either the world log or diary. - * - * Blame Keelin. - */ -/proc/logTheThing(type, source, target, text, diaryType) - if(diaryType) - world << "Diary: \[[diaryType]:[type]] [text]" - else - world << "Log: \[[type]] [text]" diff --git a/code/controllers/ProcessScheduler/core/process.dm b/code/controllers/ProcessScheduler/core/process.dm index b7767c367fd..27ba2479ae5 100644 --- a/code/controllers/ProcessScheduler/core/process.dm +++ b/code/controllers/ProcessScheduler/core/process.dm @@ -69,10 +69,10 @@ * recordkeeping vars */ - // Records the time (1/10s timeofday) at which the process last finished sleeping + // Records the time (1/10s timeoftick) at which the process last finished sleeping var/tmp/last_slept = 0 - // Records the time (1/10s timeofday) at which the process last began running + // Records the time (1/10s timeofgame) at which the process last began running var/tmp/run_start = 0 // Records the number of times this process has been killed and restarted @@ -106,12 +106,8 @@ last_object = null /datum/controller/process/proc/started() - var/timeofhour = TimeOfHour - // Initialize last_slept so we can know when to sleep - last_slept = timeofhour - // Initialize run_start so we can detect hung processes. - run_start = timeofhour + run_start = TimeOfGame // Initialize defer count cpu_defer_count = 0 @@ -163,18 +159,13 @@ setStatus(PROCESS_STATUS_HUNG) /datum/controller/process/proc/handleHung() - var/timeofhour = TimeOfHour var/datum/lastObj = last_object var/lastObjType = "null" if(istype(lastObj)) lastObjType = lastObj.type - // If timeofhour has rolled over, then we need to adjust. - if (timeofhour < run_start) - run_start -= 36000 - var/msg = "[name] process hung at tick #[ticks]. Process was unresponsive for [(timeofhour - run_start) / 10] seconds and was restarted. Last task: [last_task]. Last Object Type: [lastObjType]" - logTheThing("debug", null, null, msg) - logTheThing("diary", null, null, msg, "debug") + var/msg = "[name] process hung at tick #[ticks]. Process was unresponsive for [(TimeOfGame - run_start) / 10] seconds and was restarted. Last task: [last_task]. Last Object Type: [lastObjType]" + log_debug(msg) message_admins(msg) main.restartProcess(src.name) @@ -182,8 +173,8 @@ /datum/controller/process/proc/kill() if (!killed) var/msg = "[name] process was killed at tick #[ticks]." - logTheThing("debug", null, null, msg) - logTheThing("diary", null, null, msg, "debug") + log_debug(msg) + message_admins(msg) //finished() // Allow inheritors to clean up if needed @@ -208,17 +199,12 @@ if (main.getCurrentTickElapsedTime() > main.timeAllowance) sleep(world.tick_lag) cpu_defer_count++ - last_slept = TimeOfHour + last_slept = 0 else - var/timeofhour = TimeOfHour - // If timeofhour has rolled over, then we need to adjust. - if (timeofhour < last_slept) - last_slept -= 36000 - - if (timeofhour > last_slept + sleep_interval) + if (TimeOfTick > last_slept + sleep_interval) // If we haven't slept in sleep_interval deciseconds, sleep to allow other work to proceed. sleep(0) - last_slept = TimeOfHour + last_slept = TimeOfTick /datum/controller/process/proc/update() // Clear delta @@ -239,10 +225,7 @@ /datum/controller/process/proc/getElapsedTime() - var/timeofhour = TimeOfHour - if (timeofhour < run_start) - return timeofhour - (run_start - 36000) - return timeofhour - run_start + return TimeOfGame - run_start /datum/controller/process/proc/tickDetail() return diff --git a/code/controllers/ProcessScheduler/core/processScheduler.dm b/code/controllers/ProcessScheduler/core/processScheduler.dm index eccb44c49c5..1c6a0c91a28 100644 --- a/code/controllers/ProcessScheduler/core/processScheduler.dm +++ b/code/controllers/ProcessScheduler/core/processScheduler.dm @@ -43,8 +43,6 @@ var/global/datum/controller/processScheduler/processScheduler var/tmp/currentTick = 0 - var/tmp/currentTickStart = 0 - var/tmp/timeAllowance = 0 var/tmp/cpuAverage = 0 @@ -247,7 +245,7 @@ var/global/datum/controller/processScheduler/processScheduler /datum/controller/processScheduler/proc/recordStart(var/datum/controller/process/process, var/time = null) if (isnull(time)) - time = TimeOfHour + time = TimeOfGame last_queued[process] = world.time last_start[process] = time else @@ -256,11 +254,7 @@ var/global/datum/controller/processScheduler/processScheduler /datum/controller/processScheduler/proc/recordEnd(var/datum/controller/process/process, var/time = null) if (isnull(time)) - time = TimeOfHour - - // If world.timeofday has rolled over, then we need to adjust. - if (time < last_start[process]) - last_start[process] -= 36000 + time = TimeOfGame var/lastRunTime = time - last_start[process] @@ -349,13 +343,12 @@ var/global/datum/controller/processScheduler/processScheduler updateCurrentTickData() return 0 else - return TimeOfHour - currentTickStart + return TimeOfTick /datum/controller/processScheduler/proc/updateCurrentTickData() if (world.time > currentTick) // New tick! currentTick = world.time - currentTickStart = TimeOfHour updateTimeAllowance() cpuAverage = (world.cpu + cpuAverage + cpuAverage) / 3 diff --git a/code/controllers/Processes/timer.dm b/code/controllers/Processes/timer.dm index 49024083940..0e059317058 100644 --- a/code/controllers/Processes/timer.dm +++ b/code/controllers/Processes/timer.dm @@ -60,7 +60,7 @@ var/global/datum/controller/process/timer/timer_master event.thingToCall = thingToCall event.procToCall = procToCall event.timeToRun = world.time + wait - event.hash = list2text(args) + event.hash = jointext(args, null) if(args.len > 4) event.argList = args.Copy(5) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 208c41ffcf6..2d98b267f95 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -167,8 +167,6 @@ var/disable_away_missions = 0 // disable away missions - var/autoconvert_notes = 0 //if all connecting player's notes should attempt to be converted to the database - var/ooc_allowed = 1 var/looc_allowed = 1 var/dooc_allowed = 1 @@ -223,7 +221,7 @@ if(type == "config") switch (name) if ("resource_urls") - config.resource_urls = text2list(value, " ") + config.resource_urls = splittext(value, " ") if ("admin_legacy_system") config.admin_legacy_system = 1 @@ -458,7 +456,7 @@ config.comms_password = value if("irc_bot_host") - config.irc_bot_host = text2list(value, ";") + config.irc_bot_host = splittext(value, ";") if("main_irc") config.main_irc = value @@ -546,9 +544,6 @@ if("disable_away_missions") config.disable_away_missions = 1 - if("autoconvert_notes") - config.autoconvert_notes = 1 - if("disable_lobby_music") config.disable_lobby_music = 1 diff --git a/code/datums/cargoprofile.dm b/code/datums/cargoprofile.dm index 971a6df70f3..eea90b687e6 100644 --- a/code/datums/cargoprofile.dm +++ b/code/datums/cargoprofile.dm @@ -557,7 +557,7 @@ return "[garbletext(copytext(Text,l/2,0))][pick("#","|","/","*",".","."," ","."," "," ")]" proc/garble_keeptags(var/Text) - var/list/L = text2list(Text,">") + var/list/L = splittext(Text,">") var/result = "" for(var/string in L) var/index = findtextEx(string,"<") diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 905f604ec02..c0f19b552b6 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -294,7 +294,7 @@ var/list/advance_cures = list( for(var/datum/symptom/S in symptoms) L += S.id L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in. - var/result = list2text(L, ":") + var/result = jointext(L, ":") id = result return id diff --git a/code/datums/spells/horsemask.dm b/code/datums/spells/horsemask.dm index 2c31c943284..fd9a6e64bed 100644 --- a/code/datums/spells/horsemask.dm +++ b/code/datums/spells/horsemask.dm @@ -44,4 +44,4 @@ qdel(target.wear_mask) target.equip_to_slot_if_possible(magichead, slot_wear_mask, 1, 1) - flick("e_flash", target.flash) + target.flash_eyes() diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 8a9a892123a..831e7004ad6 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -1,5 +1,6 @@ /atom/movable layer = 3 + appearance_flags = TILE_BOUND var/last_move = null var/anchored = 0 // var/elevation = 2 - not used anywhere diff --git a/code/game/dna/genes/goon_disabilities.dm b/code/game/dna/genes/goon_disabilities.dm index 04fa6d5f524..8b1317dfb65 100644 --- a/code/game/dna/genes/goon_disabilities.dm +++ b/code/game/dna/genes/goon_disabilities.dm @@ -205,7 +205,7 @@ else prefix="" - var/list/words = text2list(message," ") + var/list/words = splittext(message," ") var/list/rearranged = list() for(var/i=1;i<=words.len;i++) var/cword = pick(words) @@ -216,7 +216,7 @@ suffix = copytext(cword,length(cword)-1,length(cword) ) if(length(cword)) rearranged += cword - return "[prefix][uppertext(list2text(rearranged," "))]!!" + return "[prefix][uppertext(jointext(rearranged," "))]!!" // WAS: /datum/bioEffect/toxic_farts /datum/dna/gene/disability/toxic_farts diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 43bb42dbd8c..e7903c642a9 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -986,7 +986,7 @@ var/list/sacrificed = list() if(iscarbon(L)) var/mob/living/carbon/C = L - flick("e_flash", C.flash) + C.flash_eyes() if(C.stuttering < 1 && (!(HULK in C.mutations))) C.stuttering = 1 C.Weaken(1) @@ -1013,7 +1013,7 @@ var/list/sacrificed = list() else if(iscarbon(T)) var/mob/living/carbon/C = T - flick("e_flash", C.flash) + C.flash_eyes() if (!(HULK in C.mutations)) C.silent += 15 C.Weaken(10) diff --git a/code/game/gamemodes/mutiny/directives/bluespace_contagion_directive.dm b/code/game/gamemodes/mutiny/directives/bluespace_contagion_directive.dm index cf7179f539d..e8afea4e1d0 100644 --- a/code/game/gamemodes/mutiny/directives/bluespace_contagion_directive.dm +++ b/code/game/gamemodes/mutiny/directives/bluespace_contagion_directive.dm @@ -32,7 +32,7 @@ datum/directive/bluespace_contagion/initialize() infected_names+="[candidate.mind.assigned_role] [candidate.mind.name]" special_orders = list( - "Quarantine these personnel: [list2text(infected_names, ", ")].", + "Quarantine these personnel: [jointext(infected_names, ", ")].", "Allow one hour for a cure to be manufactured.", "If no cure arrives after that time, execute and burn the infected.") diff --git a/code/game/gamemodes/mutiny/directives/vox_heist.dm b/code/game/gamemodes/mutiny/directives/vox_heist.dm index 52e8d0771ef..f652f7016d2 100644 --- a/code/game/gamemodes/mutiny/directives/vox_heist.dm +++ b/code/game/gamemodes/mutiny/directives/vox_heist.dm @@ -69,7 +69,7 @@ datum/directive/vox_heist/initialize() sympathizer_names.Add("[candidate.mind.assigned_role] [candidate.mind.name]") if(sympathizers.len) - special_orders.Add("Brig the following sympathizers: [list2text(sympathizer_names, ", ")]") + special_orders.Add("Brig the following sympathizers: [jointext(sympathizer_names, ", ")]") datum/directive/vox_heist/meets_prerequisites() var/list/candidates = get_vox_candidates() diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index 08f9a73cc2f..d43d5e17e8f 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -134,7 +134,7 @@ if(!req_access) req_access = list() if(req_access_txt) - var/list/req_access_str = text2list(req_access_txt, ";") + var/list/req_access_str = splittext(req_access_txt, ";") for(var/x in req_access_str) var/n = text2num(x) if(n) @@ -143,7 +143,7 @@ if(!req_one_access) req_one_access = list() if(req_one_access_txt) - var/list/req_one_access_str = text2list(req_one_access_txt,";") + var/list/req_one_access_str = splittext(req_one_access_txt,";") for(var/x in req_one_access_str) var/n = text2num(x) if(n) diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index 68610e3c0a7..2574e4bdcd0 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -34,7 +34,7 @@ var/list/whitelist = list() while(query.NextRow()) var/joblist = query.item[1] if(joblist!="*") - var/allowed_jobs = text2list(joblist,",") + var/allowed_jobs = splittext(joblist,",") if(rank in allowed_jobs) return 1 else return 1 return 0 @@ -56,7 +56,7 @@ var/list/whitelist = list() if (!text) diary << "Failed to load config/alienwhitelist.txt\n" else - alien_whitelist = text2list(text, "\n") + alien_whitelist = splittext(text, "\n") //todo: admin aliens /proc/is_alien_whitelisted(mob/M, var/species) @@ -78,7 +78,7 @@ var/list/whitelist = list() while(query.NextRow()) var/specieslist = query.item[1] if(specieslist!="*") - var/allowed_species = text2list(specieslist,",") + var/allowed_species = splittext(specieslist,",") if(species in allowed_species) return 1 else return 1 return 0 diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 99db01bfae2..0f7688bdadb 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -375,7 +375,7 @@ update_flag /obj/machinery/portable_atmospherics/canister/attack_alien(mob/living/carbon/alien/humanoid/user) return - + /obj/machinery/portable_atmospherics/canister/attack_ghost(var/mob/user as mob) return src.ui_interact(user) @@ -427,7 +427,7 @@ update_flag /obj/machinery/portable_atmospherics/canister/Topic(href, href_list) if(..()) return 1 - + if (href_list["choice"] == "menu") menu = text2num(href_list["mode_target"]) @@ -625,13 +625,12 @@ update_flag if(busy) return 0 - if(!WT.isOn()) + if(!WT.remove_fuel(0, user)) return 0 // Do after stuff here user << "You start to slice away at \the [src]..." playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - WT.eyecheck(user) busy = 1 if(do_after(user, 50, target = src)) busy = 0 diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 77616cbb1b6..f74e5ca877d 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -385,4 +385,4 @@ /obj/machinery/camera/portable/process() //Updates whenever the camera is moved. if(cameranet && get_turf(src) != prev_turf) cameranet.updatePortableCamera(src) - prev_turf = get_turf(src) \ No newline at end of file + prev_turf = get_turf(src) diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 73ee5cdb2aa..46c448f2035 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -82,7 +82,7 @@ usr << "No input found please hang up and try your call again." return - var/list/tempnetwork = text2list(input, ",") + var/list/tempnetwork = splittext(input, ",") if(tempnetwork.len < 1) usr << "No network found please hang up and try your call again." return @@ -153,16 +153,15 @@ if(!anchored) ..() -/obj/item/weapon/camera_assembly/proc/weld(var/obj/item/weapon/weldingtool/WT, var/mob/user) +/obj/item/weapon/camera_assembly/proc/weld(var/obj/item/weapon/weldingtool/WT, var/mob/living/user) if(busy) return 0 - if(!WT.isOn()) + if(!WT.remove_fuel(0, user)) return 0 user << "You start to weld the [src].." playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - WT.eyecheck(user) busy = 1 if(do_after(user, 20, target = src)) busy = 0 diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index 5ddc91bfa72..3600503d764 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -221,7 +221,7 @@ What a mess.*/ return Perp = new/list() t1 = lowertext(t1) - var/list/components = text2list(t1, " ") + var/list/components = splittext(t1, " ") if(components.len > 5) return //Lets not let them search too greedily. for(var/datum/data/record/R in data_core.general) diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm b/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm index d03bffcbae5..0cffb34dc6f 100644 --- a/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm +++ b/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm @@ -2,21 +2,21 @@ //this is the master controller, that things will try to dock with. /obj/machinery/embedded_controller/radio/docking_port_multi name = "docking port controller" - + var/child_tags_txt var/child_names_txt var/list/child_names = list() - + var/datum/computer/file/embedded_program/docking/multi/docking_program /obj/machinery/embedded_controller/radio/docking_port_multi/initialize() ..() docking_program = new/datum/computer/file/embedded_program/docking/multi(src) program = docking_program - - var/list/names = text2list(child_names_txt, ";") - var/list/tags = text2list(child_tags_txt, ";") - + + var/list/names = splittext(child_names_txt, ";") + var/list/tags = splittext(child_tags_txt, ";") + if (names.len == tags.len) for (var/i = 1; i <= tags.len; i++) child_names[tags[i]] = names[i] @@ -84,10 +84,10 @@ /obj/machinery/embedded_controller/radio/airlock/docking_port_multi/Topic(href, href_list) if(..()) return - + usr.set_machine(src) src.add_fingerprint(usr) - + var/clean = 0 switch(href_list["command"]) //anti-HTML-hacking checks if("cycle_ext") diff --git a/code/game/machinery/embedded_controller/docking_program_multi.dm b/code/game/machinery/embedded_controller/docking_program_multi.dm index 46f7538afde..dc582b915f9 100644 --- a/code/game/machinery/embedded_controller/docking_program_multi.dm +++ b/code/game/machinery/embedded_controller/docking_program_multi.dm @@ -17,7 +17,7 @@ if (istype(M,/obj/machinery/embedded_controller/radio/docking_port_multi)) //if our parent controller is the right type, then we can auto-init stuff at construction var/obj/machinery/embedded_controller/radio/docking_port_multi/controller = M //parse child_tags_txt and create child tags - children_tags = text2list(controller.child_tags_txt, ";") + children_tags = splittext(controller.child_tags_txt, ";") children_ready = list() children_override = list() diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 86e723bca8b..b133195e055 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -66,31 +66,12 @@ src.last_flash = world.time use_power(1000) - for (var/mob/O in viewers(src, null)) - if (get_dist(src, O) > src.range) + for(var/mob/living/L in viewers(src, null)) + if (get_dist(src, L) > src.range) continue - if (istype(O, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = O - if(!H.eyecheck() <= 0) - continue - - if (istype(O, /mob/living/carbon/alien))//So aliens don't get flashed (they have no external eyes)/N - continue - - O.Weaken(strength) - if(O.weakeyes) - O.Weaken(strength * 1.5) - O.visible_message("[O] gasps and shields their eyes!") - if (istype(O, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = O - var/obj/item/organ/internal/eyes/E = H.get_int_organ(/obj/item/organ/internal/eyes) - if (E && (E.damage > E.min_bruised_damage && prob(E.damage + 50))) - flick("e_flash", O:flash) - E.damage += rand(1, 2) - else - if(!O.blinded) - flick("flash", O:flash) + if(L.flash_eyes(affect_silicon = 1)) + L.Weaken(strength) /obj/machinery/flasher/emp_act(severity) diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 78e775a47cb..041e4cfc3d5 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -46,7 +46,7 @@ codes = new() - var/list/entries = text2list(codes_txt, ";") // entries are separated by semicolons + var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons for(var/e in entries) var/index = findtext(e, "=") // format is "key=value" diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 4a40906dc7b..1265eb8da78 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -102,7 +102,7 @@ wires = new(src) spawn(50) if(product_slogans) - slogan_list += text2list(product_slogans, ";") + slogan_list += splittext(product_slogans, ";") // So not all machines speak at the exact same time. // The first time this machine says something will be at slogantime + this random value, @@ -110,7 +110,7 @@ last_slogan = world.time + rand(0, slogan_delay) if(product_ads) - ads_list += text2list(product_ads, ";") + ads_list += splittext(product_ads, ";") build_inventory() power_change() diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index 068e3144e73..caaf79a9981 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -31,7 +31,7 @@ flame_range = min (MAX_EX_FLAME_RANGE, flame_range) spawn(0) - var/start = TimeOfHour + var/watch = start_watch() if(!epicenter) return var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flame_range) @@ -157,8 +157,7 @@ var/turf/throw_at = get_ranged_target_turf(I, throw_dir, throw_range) I.throw_at(throw_at, throw_range, 2, no_spin = 1) //Throw it at 2 speed, this is purely visual anyway; don't spin the thrown items, it's very costly. */ - var/timeofhour = TimeOfHour - var/took = round((start <= timeofhour) ? ((timeofhour-start)/10) : ((timeofhour-(start-36000))/10), 0.01) + var/took = stop_watch(watch) //You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare if(Debug2) log_to_dd("## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds.") diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 20646a081b7..564e22af0a4 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -238,7 +238,7 @@ if(C.client) C.eye_blurry = max(C.eye_blurry, 3) C.eye_blind = max(C.eye_blind, 1) - if(C.eyecheck() <= 0) // no eye protection? ARGH IT BURNS. + if(C.check_eye_prot() <= 0) // no eye protection? ARGH IT BURNS. C.confused = max(C.confused, 3) C.Weaken(3) C.lip_style = "spray_face" diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index d39a8dfbc93..6f4e25a85e4 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -77,24 +77,21 @@ /obj/item/device/flash/proc/flash_carbon(var/mob/living/carbon/M, var/mob/user = null, var/power = 5, convert = 1) add_logs(M, user, "flashed", object="[src.name]") - if(M.weakeyes) - M.Weaken(3) //quick weaken bypasses eye protection but has no eye flash - var/safety = M:eyecheck() - if(safety <= 0) - M.confused += power - flick("e_flash", M.flash) - if(user && convert) + + if(user) + if(M.flash_eyes(1, 1)) + M.confused += power terrible_conversion_proc(M, user) M.Stun(1) - user.visible_message("[user] blinds [M] with the [src.name]!") if(M.weakeyes) M.Stun(2) M.visible_message("[M] gasps and shields their eyes!") - return 1 - else - if(user) + user.visible_message("[user] blinds [M] with the [src.name]!") + else user.visible_message("[user] fails to blind [M] with the [src.name]!") - return 0 + else + if(M.flash_eyes()) + M.confused += power /obj/item/device/flash/attack(mob/living/M, mob/user) if(!try_use_flash(user)) @@ -111,16 +108,16 @@ else if(issilicon(M)) if(isrobot(M)) var/mob/living/silicon/robot/R = M - - if (R.module) // Perhaps they didn't choose a module yet + if(R.module) // Perhaps they didn't choose a module yet for(var/obj/item/borg/combat/shield/S in R.module.modules) if(R.activated(S)) add_logs(M, user, "flashed", object="[src.name]") user.visible_message("[user] tries to overloads [M]'s sensors with the [src.name], but if blocked by [M]'s shield!", "You try to overload [M]'s sensors with the [src.name], but are blocked by his shield!") return 1 - M.Weaken(rand(5,10)) add_logs(M, user, "flashed", object="[src.name]") - user.visible_message("[user] overloads [M]'s sensors with the [src.name]!", "You overload [M]'s sensors with the [src.name]!") + if(M.flash_eyes(affect_silicon = 1)) + M.Weaken(rand(5,10)) + user.visible_message("[user] overloads [M]'s sensors with the [src.name]!", "You overload [M]'s sensors with the [src.name]!") return 1 user.visible_message("[user] fails to blind [M] with the [src.name]!", "You fail to blind [M] with the [src.name]!") diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index ef8cba90463..caa673882a1 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -55,28 +55,25 @@ return if(M == user) //they're using it on themselves - if(!M.blinded) - flick("flash", M.flash) + if(M.flash_eyes(visual = 1)) M.visible_message("[M] directs [src] to \his eyes.", \ "You wave the light in front of your eyes! Trippy!") else M.visible_message("[M] directs [src] to \his eyes.", \ "You wave the light in front of your eyes.") - return + else - user.visible_message("[user] directs [src] to [M]'s eyes.", \ - "You direct [src] to [M]'s eyes.") + user.visible_message("[user] directs [src] to [M]'s eyes.", \ + "You direct [src] to [M]'s eyes.") - if(istype(M, /mob/living/carbon/human)) //robots and aliens are unaffected - if(M.stat == DEAD || M.sdisabilities & BLIND) //mob is dead or fully blind - user << "[M] pupils does not react to the light!" - else if(XRAY in M.mutations) //mob has X-RAY vision - flick("flash", M.flash) //Yes, you can still get flashed wit X-Ray. - user << "[M] pupils give an eerie glow!" - else //they're okay! - if(!M.blinded) - flick("flash", M.flash) //flash the affected mob - user << "[M]'s pupils narrow." + if(istype(M, /mob/living/carbon/human)) //robots and aliens are unaffected + if(M.stat == DEAD || M.sdisabilities & BLIND) //mob is dead or fully blind + user << "[M] pupils does not react to the light!" + else if(XRAY in M.mutations) //mob has X-RAY vision + user << "[M] pupils give an eerie glow!" + else //they're okay! + if(M.flash_eyes(visual = 1)) + user << "[M]'s pupils narrow." else return ..() diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index e89f3213b4f..d03d2b98887 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -90,66 +90,30 @@ //human/alien mobs if(iscarbon(target)) + var/mob/living/carbon/C = target if(user.zone_sel.selecting == "eyes") - var/mob/living/carbon/C = target + add_logs(C, user, "shone in the eyes", object="laser pointer") + + var/severity = 1 + if(prob(33)) + severity = 2 + else if(prob(50)) + severity = 0 //20% chance to actually hit the eyes - - if(prob(effectchance * diode.rating)) - add_logs(C, user, "shone in the eyes", object="laser pointer") - - - //eye target check + if(prob(effectchance * diode.rating) && C.flash_eyes(severity)) outmsg = "You blind [C] by shining [src] in their eyes." if(C.weakeyes) C.Stun(1) - var/eye_prot = C.eyecheck() - if(C.blinded || eye_prot >= 2) - eye_prot = 4 - var/severity = 3 - eye_prot - if(prob(33)) - severity += 1 - else if(prob(50)) - severity -= 1 - severity = min(max(severity, 0), 4) - var/mob/living/carbon/human/H = C - var/obj/item/organ/internal/eyes/E = H.get_int_organ(/obj/item/organ/internal/eyes) - - switch(severity) - if(0) - //no effect - C << "A small, bright dot appears in your vision." - if(1) - //industrial grade eye protection - E.damage += rand(0, 2) - C << "Something bright flashes in the corner of your vision!" - if(2) - //basic eye protection (sunglasses) - flick("flash", C.flash) - E.damage += rand(1, 6) - C << "Your eyes were blinded!" - if(3) - //no eye protection - if(prob(2)) - C.Weaken(1) - flick("e_flash", C.flash) - E.damage += rand(3, 7) - C << "Your eyes were blinded!" - if(4) - //the effect has been worsened by something - if(prob(5)) - C.Weaken(1) - flick("e_flash", C.flash) - E.damage += rand(5, 10) - C << "Your eyes were blinded!" else - outmsg = "You fail to blind [C] by shining [src] at their eyes." + outmsg = "You fail to blind [C] by shining [src] at their eyes!" //robots and AI else if(issilicon(target)) var/mob/living/silicon/S = target //20% chance to actually hit the sensors if(prob(effectchance * diode.rating)) + S.flash_eyes(affect_silicon = 1) S.Weaken(rand(5,10)) S << "Your sensors were overloaded by a laser!" outmsg = "You overload [S] by shining [src] at their sensors." diff --git a/code/game/objects/items/weapons/grenades/bananade.dm b/code/game/objects/items/weapons/grenades/bananade.dm index 998c19e9837..bbb86c31442 100644 --- a/code/game/objects/items/weapons/grenades/bananade.dm +++ b/code/game/objects/items/weapons/grenades/bananade.dm @@ -16,9 +16,8 @@ var/turf/T // Make a quick flash var/turf/T = get_turf(src) playsound(T, 'sound/items/bikehorn.ogg', 100, 1) - for(var/mob/living/carbon/human/M in viewers(T, null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) // flash dose faggots + for(var/mob/living/carbon/C in viewers(T, null)) + C.flash_eyes() for(var/i=1, i<=deliveryamt, i++) var/atom/movable/x = new spawner_type x.loc = T diff --git a/code/game/objects/items/weapons/grenades/clusterbuster.dm b/code/game/objects/items/weapons/grenades/clusterbuster.dm index ec3e159e874..8ba1782cf18 100644 --- a/code/game/objects/items/weapons/grenades/clusterbuster.dm +++ b/code/game/objects/items/weapons/grenades/clusterbuster.dm @@ -78,7 +78,6 @@ ///////////////////////////////// /obj/item/weapon/grenade/flashbang/cluster icon_state = "flashbang_active" - banglet = 1 /obj/item/weapon/grenade/clusterbuster/emp name = "Electromagnetic Storm" diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm index 51bd36c5839..271f9bdb763 100644 --- a/code/game/objects/items/weapons/grenades/flashbang.dm +++ b/code/game/objects/items/weapons/grenades/flashbang.dm @@ -3,7 +3,6 @@ icon_state = "flashbang" item_state = "flashbang" origin_tech = "materials=2;combat=1" - var/banglet = 0 /obj/item/weapon/grenade/flashbang/prime() update_mob() @@ -24,42 +23,17 @@ playsound(loc, 'sound/effects/bang.ogg', 25, 1) //Checking for protections - var/eye_safety = 0 - var/ear_safety = 0 + var/ear_safety = M.check_ear_prot() var/distance = max(1,get_dist(src,T)) - if(iscarbon(M)) - var/mob/living/carbon/C = M - eye_safety = C.eyecheck() - if(ishuman(C)) - var/mob/living/carbon/human/H = C - if((H.r_ear && (H.r_ear.flags & EARBANGPROTECT)) || (H.l_ear && (H.l_ear.flags & EARBANGPROTECT)) || (H.head && (H.head.flags & HEADBANGPROTECT))) - ear_safety++ - //Flash - var/eye_damage = rand(1,3) - if(M.weakeyes) - M.visible_message("[M] screams and collapses!") - M << "AAAAGH! IT BURNS!" - M.Weaken(15) //hella stunned - M.Stun(15) - eye_damage += 8 - - if(!eye_safety && ishuman(M)) - var/mob/living/carbon/human/H = M - var/obj/item/organ/internal/eyes/E = H.get_int_organ(/obj/item/organ/internal/eyes) - flick("e_flash", M.flash) - if (E) - E.damage += eye_damage + if(M.flash_eyes(affect_silicon = 1)) + if(ishuman(M)) + var/mob/living/carbon/human/H = M + var/obj/item/organ/internal/eyes/E = H.get_int_organ(/obj/item/organ/internal/eyes) + if(E) + E.damage += rand(1, 3) M.Stun(max(10/distance, 3)) M.Weaken(max(10/distance, 3)) - if (istype(E) && E.damage >= E.min_bruised_damage) - if(!(E.status & ORGAN_ROBOT)) - M << "Your eyes start to burn badly!" - else - M << "The flash blinds you!" - if(!banglet) - if (E.damage >= E.min_broken_damage) - M << "You can't see anything!" //Bang if((loc == M) || loc == M.loc)//Holding on person or being exactly where lies is significantly more dangerous and voids protection @@ -72,10 +46,9 @@ M.ear_deaf = max(M.ear_deaf,15) if (M.ear_damage >= 15) M << "Your ears start to ring badly!" - if(!banglet) - if(prob(M.ear_damage - 10 + 5)) - M << "You can't hear anything!" - M.disabilities |= DEAF + if(prob(M.ear_damage - 10 + 5)) + M << "You can't hear anything!" + M.disabilities |= DEAF else if (M.ear_damage >= 5) M << "Your ears start to ring!" \ No newline at end of file diff --git a/code/game/objects/items/weapons/grenades/spawnergrenade.dm b/code/game/objects/items/weapons/grenades/spawnergrenade.dm index dbcb27c5f16..074617d4d10 100644 --- a/code/game/objects/items/weapons/grenades/spawnergrenade.dm +++ b/code/game/objects/items/weapons/grenades/spawnergrenade.dm @@ -5,7 +5,6 @@ icon_state = "delivery" item_state = "flashbang" origin_tech = "materials=3;magnets=4" - var/banglet = 0 var/spawner_type = null // must be an object path var/deliveryamt = 1 // amount of type to deliver spawner_type = /mob/living/simple_animal/hostile/viscerator @@ -16,9 +15,8 @@ // Make a quick flash var/turf/T = get_turf(src) playsound(T, 'sound/effects/phasein.ogg', 100, 1) - for(var/mob/living/carbon/human/M in viewers(T, null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) // flash dose faggots + for(var/mob/living/carbon/C in viewers(T, null)) + C.flash_eyes() for(var/i=1, i<=deliveryamt, i++) var/atom/movable/x = new spawner_type diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index 29bc5bd5861..d01cc125918 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -291,15 +291,15 @@ /obj/item/weapon/weldingtool/proc/get_fuel() return reagents.get_reagent_amount("fuel") -//Removes fuel from the welding tool. If a mob is passed, it will perform an eyecheck on the mob. This should probably be renamed to use() -/obj/item/weapon/weldingtool/proc/remove_fuel(var/amount = 1, var/mob/M = null) +//Removes fuel from the welding tool. If a mob is passed, it will try to flash the mob's eyes. This should probably be renamed to use() +/obj/item/weapon/weldingtool/proc/remove_fuel(var/amount = 1, var/mob/living/M = null) if(!welding || !check_fuel()) return 0 if(get_fuel() >= amount) reagents.remove_reagent("fuel", amount) check_fuel() if(M) - eyecheck(M) + M.flash_eyes(light_intensity) return 1 else if(M) @@ -351,46 +351,6 @@ hitsound = "swing_hit" update_icon() -//Decides whether or not to damage a player's eyes based on what they're wearing as protection -//Note: This should probably be moved to mob -/obj/item/weapon/weldingtool/proc/eyecheck(mob/user as mob) - if(!iscarbon(user)) return 1 - var/safety = user:eyecheck() - if(ishuman(user)) - var/mob/living/carbon/human/H = user - var/obj/item/organ/internal/eyes/E = H.get_int_organ(/obj/item/organ/internal/eyes) - if(!istype(E)) // No eyes? No problem! - return - switch(safety) - if(1) - usr << "Your eyes sting a little." - E.damage += rand(1, 2) - if(E.damage > 12) - user.eye_blurry += rand(3,6) - if(0) - usr << "Your eyes burn." - E.damage += rand(2, 4) - if(E.damage > 10) - E.damage += rand(4,10) - if(-1) - usr << "Your thermals intensify the welder's glow. Your eyes itch and burn severely." - user.eye_blurry += rand(12,20) - E.damage += rand(12, 16) - if(safety<2) - if(E.damage > 10) - user << "Your eyes are really starting to hurt. This can't be good for you!" - if (E.damage >= E.min_broken_damage) - user << "You go blind!" - user.sdisabilities |= BLIND - else if (E.damage >= E.min_bruised_damage) - user << "You go blind!" - user.eye_blind = 5 - user.eye_blurry = 5 - user.disabilities |= NEARSIGHTED - spawn(100) - user.disabilities &= ~NEARSIGHTED - return - /obj/item/weapon/weldingtool/proc/flamethrower_screwdriver(obj/item/I, mob/user) if(welding) user << "Turn it off first!" diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index 367208bbfe4..8a5f144aac2 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -80,10 +80,10 @@ for(var/line in lines) //world << line - for(var/beat in text2list(lowertext(line), ",")) + for(var/beat in splittext(lowertext(line), ",")) //world << "beat: [beat]" - var/list/notes = text2list(beat, "/") - for(var/note in text2list(notes[1], "-")) + var/list/notes = splittext(beat, "/") + for(var/note in splittext(notes[1], "-")) //world << "note: [note]" if(!playing || shouldStopPlaying(user))//If the instrument is playing, or special case playing = 0 @@ -165,7 +165,7 @@ //split into lines spawn() - lines = text2list(t, "\n") + lines = splittext(t, "\n") if(copytext(lines[1],1,6) == "BPM: ") tempo = sanitize_tempo(600 / text2num(copytext(lines[1],6))) lines.Cut(1,2) diff --git a/code/game/objects/structures/transit_tubes/transit_tube.dm b/code/game/objects/structures/transit_tubes/transit_tube.dm index 5a0b7df79a3..c7926870ccf 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube.dm @@ -244,7 +244,7 @@ obj/structure/transit_tube/ex_act(severity) if(text in direction_table) return direction_table[text] - var/list/split_text = text2list(text, "-") + var/list/split_text = splittext(text, "-") // If the first token is D, the icon_state represents // a purely decorative tube, and doesn't actually diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index f497a645f95..67a141f74ba 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -58,9 +58,9 @@ var/global/nologevent = 0 body += "Mob type: [M.type]
" if(M.client) if(M.client.related_accounts_cid.len) - body += "Related accounts by CID: [list2text(M.client.related_accounts_cid, " - ")]
" + body += "Related accounts by CID: [jointext(M.client.related_accounts_cid, " - ")]
" if(M.client.related_accounts_ip.len) - body += "Related accounts by IP: [list2text(M.client.related_accounts_ip, " - ")]

" + body += "Related accounts by IP: [jointext(M.client.related_accounts_ip, " - ")]

" body += "Kick | " body += "Warn | " diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm index ae6ea3c4aae..7b5c4073293 100644 --- a/code/modules/admin/admin_ranks.dm +++ b/code/modules/admin/admin_ranks.dm @@ -14,7 +14,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights if(!length(line)) continue if(copytext(line,1,2) == "#") continue - var/list/List = text2list(line,"+") + var/list/List = splittext(line,"+") if(!List.len) continue var/rank = ckeyEx(List[1]) @@ -78,7 +78,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights if(copytext(line,1,2) == "#") continue //Split the line at every "-" - var/list/List = text2list(line, "-") + var/list/List = splittext(line, "-") if(!List.len) continue //ckey is before the first "-" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index c33bc85061c..500fa010700 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -677,7 +677,7 @@ var/list/admin_verbs_proccall = list ( //load text from file var/list/Lines = file2list("config/admins.txt") for(var/line in Lines) - var/list/splitline = text2list(line, " - ") + var/list/splitline = splittext(line, " - ") if(n_lower(splitline[1]) == ckey) if(splitline.len >= 2) rank = ckeyEx(splitline[2]) diff --git a/code/modules/admin/create_mob.dm b/code/modules/admin/create_mob.dm index a723fe37956..4a892d893da 100644 --- a/code/modules/admin/create_mob.dm +++ b/code/modules/admin/create_mob.dm @@ -2,7 +2,7 @@ /datum/admins/proc/create_mob(var/mob/user) if (!create_mob_html) var/mobjs = null - mobjs = list2text(typesof(/mob), ";") + mobjs = jointext(typesof(/mob), ";") create_mob_html = file2text('html/create_object.html') create_mob_html = replacetext(create_mob_html, "null /* object types */", "\"[mobjs]\"") diff --git a/code/modules/admin/create_object.dm b/code/modules/admin/create_object.dm index 584dd9331b6..c5cb9f42152 100644 --- a/code/modules/admin/create_object.dm +++ b/code/modules/admin/create_object.dm @@ -4,7 +4,7 @@ var/list/create_object_forms = list(/obj, /obj/structure, /obj/machinery, /obj/e /datum/admins/proc/create_object(var/mob/user) if (!create_object_html) var/objectjs = null - objectjs = list2text(typesof(/obj), ";") + objectjs = jointext(typesof(/obj), ";") create_object_html = file2text('html/create_object.html') create_object_html = replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"") @@ -15,7 +15,7 @@ var/list/create_object_forms = list(/obj, /obj/structure, /obj/machinery, /obj/e var/html_form = create_object_forms[path] if (!html_form) - var/objectjs = list2text(typesof(path), ";") + var/objectjs = jointext(typesof(path), ";") html_form = file2text('html/create_object.html') html_form = replacetext(html_form, "null /* object types */", "\"[objectjs]\"") create_object_forms[path] = html_form diff --git a/code/modules/admin/create_turf.dm b/code/modules/admin/create_turf.dm index 0938b7bd33d..fdaa103b5d5 100644 --- a/code/modules/admin/create_turf.dm +++ b/code/modules/admin/create_turf.dm @@ -2,7 +2,7 @@ /datum/admins/proc/create_turf(var/mob/user) if (!create_turf_html) var/turfjs = null - turfjs = list2text(typesof(/turf), ";") + turfjs = jointext(typesof(/turf), ";") create_turf_html = file2text('html/create_object.html') create_turf_html = replacetext(create_turf_html, "null /* object types */", "\"[turfjs]\"") diff --git a/code/modules/admin/sql_notes.dm b/code/modules/admin/sql_notes.dm index c9b472e9f92..7678814f0c6 100644 --- a/code/modules/admin/sql_notes.dm +++ b/code/modules/admin/sql_notes.dm @@ -177,73 +177,7 @@ output += "
\[Add Note\]
" output += ruler usr << browse(output, "window=show_notes;size=900x500") - -/proc/regex_note_sql_extract(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regEx_find")(str, exp)) -// If the AUTOCONVERT_NOTES is turned on, any time a player connects this will be run to try and add all their notes to the database -/proc/convert_notes_sql(ckey) - if(!ckey) - return 0 - - var/playerfile = "data/player_saves/[copytext(ckey, 1, 2)]/[ckey]/info.sav" - var/savefile/info = new(playerfile) - var/list/infos - info >> infos - if(!infos || !infos.len) - fdel(playerfile) - return 0 - - ckey = ckey - for(var/datum/player_info/I in infos) - var/notetext = I.content - var/adminckey = I.author - var/server - if (config && config.server_name) - server = config.server_name - - var/timestamp = I.timestamp - var/regex = "\[A-Za-z\]+\\, (\[A-Za-z\]+) (\[0-9\]+)\[A-Za-z\]+ of (\[0-9\]+)" - var/datum/regex/results = regex_note_sql_extract(timestamp, regex) - var/month = month2number(results.str(2)) - var/day = results.str(3) - var/year = results.str(4) - timestamp = "[year]-[month]-[day] 00:00:00" - - add_note(ckey, notetext, timestamp, adminckey, 0, server, 0) - - fdel(playerfile) - return 1 - -// Using this proc causes lag - you have been warned. -/proc/mass_convert_notes() - if(!check_rights(R_SERVER)) - return 0 - world << "Beginning mass note conversion." - - var/player_notes_file = "data/player_notes.sav" - var/savefile/notesfile = new(player_notes_file) - var/list/note_keys - notesfile >> note_keys - - if(!notesfile) - log_game("Error: Cannot access player_notes.sav file.") - return 0 - if(!note_keys || !note_keys.len) - log_game("Error: player_notes.sav file is empty. Deleting it.") - fdel(player_notes_file) - return 0 - - note_keys = sortList(note_keys) - var/i = 1 - for(i, i <= note_keys.len, i++) - var/ckey = note_keys[i] - convert_notes_sql(ckey) - world << "Finished mass note conversion ([i] notes converted). Remember to turn off AUTOCONVERT_NOTES." - world << "Deleting the player_notes.sav file." - fdel(player_notes_file) - return 1 - /proc/show_player_info_irc(var/key as text) var/target_sql_ckey = sanitizeSQL(key) var/DBQuery/query_get_notes = dbcon.NewQuery("SELECT timestamp, notetext, adminckey, server FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp") diff --git a/code/modules/admin/stickyban.dm b/code/modules/admin/stickyban.dm index 474b7c76265..94f7a84daa1 100644 --- a/code/modules/admin/stickyban.dm +++ b/code/modules/admin/stickyban.dm @@ -126,7 +126,7 @@ log_admin("[key_name(usr)] has edited [ckey]'s sticky ban reason from [oldreason] to [reason]") message_admins("[key_name_admin(usr)] has edited [ckey]'s sticky ban reason from [oldreason] to [reason]") - + spawn(10) stickyban_show() @@ -147,7 +147,7 @@ /datum/admins/proc/stickyban_show() if(!check_rights(R_BAN)) return - + var/list/bans = sortList(world.GetConfig("ban")) var/banhtml = "" for(var/key in bans) @@ -181,23 +181,23 @@ if (!ban) return null . = params2list(ban) - .["keys"] = text2list(.["keys"], ",") - .["type"] = text2list(.["type"], ",") - .["IP"] = text2list(.["IP"], ",") - .["computer_id"] = text2list(.["computer_id"], ",") + .["keys"] = splittext(.["keys"], ",") + .["type"] = splittext(.["type"], ",") + .["IP"] = splittext(.["IP"], ",") + .["computer_id"] = splittext(.["computer_id"], ",") /proc/list2stickyban(var/list/ban) if (!ban || !islist(ban)) return null . = ban.Copy() if (.["keys"]) - .["keys"] = list2text(.["keys"], ",") + .["keys"] = jointext(.["keys"], ",") if (.["type"]) - .["type"] = list2text(.["type"], ",") + .["type"] = jointext(.["type"], ",") if (.["IP"]) - .["IP"] = list2text(.["IP"], ",") + .["IP"] = jointext(.["IP"], ",") if (.["computer_id"]) - .["computer_id"] = list2text(.["computer_id"], ",") + .["computer_id"] = jointext(.["computer_id"], ",") . = list2params(.) /client/proc/stickybanpanel() @@ -206,6 +206,5 @@ if(!check_rights(R_BAN)) return - + holder.stickyban_show() - \ No newline at end of file diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 1a705cde470..b0de84846f0 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1019,7 +1019,7 @@ message_admins("\blue [key_name_admin(usr)] removed [t]", 1) jobban_remove(t) href_list["ban"] = 1 // lets it fall through and refresh - var/t_split = text2list(t, " - ") + var/t_split = splittext(t, " - ") var/key = t_split[1] var/job = t_split[2] DB_ban_unban(ckey(key), BANTYPE_JOB_PERMA, job) @@ -2076,7 +2076,7 @@ alert("Select fewer object types, (max 5)") return - var/list/offset = text2list(href_list["offset"],",") + var/list/offset = splittext(href_list["offset"],",") var/number = dd_range(1, 100, text2num(href_list["object_count"])) var/X = offset.len > 0 ? text2num(offset[1]) : 0 var/Y = offset.len > 1 ? text2num(offset[2]) : 0 diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index b8a6f370834..494961eb767 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -32,7 +32,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," var/original_msg = msg //explode the input msg into a list - var/list/msglist = text2list(msg, " ") + var/list/msglist = splittext(msg, " ") //generate keywords lookup var/list/surnames = list() @@ -43,7 +43,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," if(M.mind) indexing += M.mind.name for(var/string in indexing) - var/list/L = text2list(string, " ") + var/list/L = splittext(string, " ") var/surname_found = 0 //surnames for(var/i=L.len, i>=1, i--) diff --git a/code/modules/admin/verbs/alt_check.dm b/code/modules/admin/verbs/alt_check.dm index 5366f240945..c356ba00b6b 100644 --- a/code/modules/admin/verbs/alt_check.dm +++ b/code/modules/admin/verbs/alt_check.dm @@ -11,10 +11,10 @@ dat += "

[C.ckey] (Player Age: [C.player_age]) - [C.computer_id] / [C.address]
" if(C.related_accounts_cid.len) dat += "--Accounts associated with CID: " - dat += "[list2text(C.related_accounts_cid, " - ")]
" + dat += "[jointext(C.related_accounts_cid, " - ")]
" if(C.related_accounts_ip.len) dat += "--Accounts associated with IP: " - dat += "[list2text(C.related_accounts_ip, " - ")] " + dat += "[jointext(C.related_accounts_ip, " - ")] " usr << browse(dat, "window=alt_panel;size=640x480") return diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index c3489499058..9c6f671fba7 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -1166,21 +1166,21 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Silicons","Clients","Respawnable Mobs")) if("Players") - usr << list2text(player_list,",") + usr << jointext(player_list,",") if("Admins") - usr << list2text(admins,",") + usr << jointext(admins,",") if("Mobs") - usr << list2text(mob_list,",") + usr << jointext(mob_list,",") if("Living Mobs") - usr << list2text(living_mob_list,",") + usr << jointext(living_mob_list,",") if("Dead Mobs") - usr << list2text(dead_mob_list,",") + usr << jointext(dead_mob_list,",") if("Silicons") - usr << list2text(silicon_mob_list,",") + usr << jointext(silicon_mob_list,",") if("Clients") - usr << list2text(clients,",") + usr << jointext(clients,",") if("Respawnable Mobs") - usr << list2text(respawnable_list,",") + usr << jointext(respawnable_list,",") /client/proc/cmd_admin_toggle_block(var/mob/M,var/block) diff --git a/code/modules/awaymissions/maploader/reader.dm b/code/modules/awaymissions/maploader/reader.dm index 0ec790896f6..01b728d4a35 100644 --- a/code/modules/awaymissions/maploader/reader.dm +++ b/code/modules/awaymissions/maploader/reader.dm @@ -143,7 +143,7 @@ var/global/dmm_suite/preloader/_preloader = null var/variables_start = findtext(full_def,"{") if(variables_start)//if there's any variable full_def = copytext(full_def,variables_start+1,length(full_def))//removing the last '}' - fields = text2list(full_def,";") + fields = dmm_splittext(full_def,";") //then fill the members_attributes list with the corresponding variables members_attributes.len++ @@ -245,7 +245,7 @@ var/global/dmm_suite/preloader/_preloader = null //build a list from variables in text form (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7)) //return the filled list -/dmm_suite/proc/text2list(var/text as text,var/delimiter=",") +/dmm_suite/proc/dmm_splittext(var/text as text,var/delimiter=",") var/list/to_return = list() @@ -279,7 +279,7 @@ var/global/dmm_suite/preloader/_preloader = null //Check for list else if(copytext(trim_right,1,5) == "list") - trim_right = text2list(copytext(trim_right,6,length(trim_right))) + trim_right = dmm_splittext(copytext(trim_right,6,length(trim_right))) //Check for file else if(copytext(trim_right,1,2) == "'") diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index c4af5ea7455..2670fcd6376 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -304,9 +304,6 @@ src << message clientmessages.Remove(ckey) - if (config && config.autoconvert_notes) - convert_notes_sql(ckey) - send_resources() @@ -368,7 +365,7 @@ //Log all the alts if(related_accounts_cid.len) - log_access("Alts: [key_name(src)]:[list2text(related_accounts_cid, " - ")]") + log_access("Alts: [key_name(src)]:[jointext(related_accounts_cid, " - ")]") var/watchreason = check_watchlist(sql_ckey) if(watchreason) diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 09b88e8c25c..fc89300fcf0 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -309,9 +309,6 @@ "Vox" = 'icons/mob/species/vox/eyes.dmi' ) -/obj/item/clothing/glasses/welding/proc/getMask() - return global_hud.darkMask - /obj/item/clothing/glasses/welding/attack_self() toggle() @@ -354,9 +351,6 @@ "Vox" = 'icons/mob/species/vox/eyes.dmi' ) -/obj/item/clothing/glasses/welding/superior/getMask() - return null - /obj/item/clothing/glasses/sunglasses/blindfold name = "blindfold" desc = "Covers the eyes, preventing sight." diff --git a/code/modules/computer3/computers/security.dm b/code/modules/computer3/computers/security.dm index 6cc18293a49..3c6560d6aa9 100644 --- a/code/modules/computer3/computers/security.dm +++ b/code/modules/computer3/computers/security.dm @@ -305,7 +305,7 @@ What a mess.*/ return Perp = new/list() t1 = lowertext(t1) - var/list/components = text2list(t1, " ") + var/list/components = splittext(t1, " ") if(components.len > 5) return //Lets not let them search too greedily. for(var/datum/data/record/R in data_core.general) diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 18735c73cc9..909abc1bbdc 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -12,7 +12,7 @@ var/jobmask = query.item[3] var/ok = 0 if(jobmask != "*") - var/list/allowed_jobs = text2list(jobmask,",") + var/list/allowed_jobs = splittext(jobmask,",") for(var/i = 1, i <= allowed_jobs.len, i++) if(istext(allowed_jobs[i])) allowed_jobs[i] = trim(allowed_jobs[i]) @@ -66,13 +66,13 @@ // This is hacky, but since it's difficult as fuck to make a proper parser in BYOND without killing the server, here it is. - N3X /proc/HackProperties(var/mob/living/carbon/human/M,var/obj/item/I,var/script) - var/list/statements = text2list(script,";") + var/list/statements = splittext(script,";") if(statements.len == 0) return for(var/statement in statements) - var/list/assignmentChunks = text2list(statement,"=") + var/list/assignmentChunks = splittext(statement,"=") var/varname = assignmentChunks[1] - var/list/typeChunks=text2list(script,":") + var/list/typeChunks=splittext(script,":") var/desiredType=typeChunks[1] switch(desiredType) if("string") diff --git a/code/modules/detective_work/scanner.dm b/code/modules/detective_work/scanner.dm index 71d0431a420..370c224ce52 100644 --- a/code/modules/detective_work/scanner.dm +++ b/code/modules/detective_work/scanner.dm @@ -25,7 +25,7 @@ var/obj/item/weapon/paper/P = new(get_turf(src)) P.name = "paper- 'Scanner Report'" P.info = "

Scanner Report


" - P.info += list2text(log, "
") + P.info += jointext(log, "
") P.info += "
Notes:
" P.info_links = P.info diff --git a/code/modules/economy/POS.dm b/code/modules/economy/POS.dm index 1601956e0a0..c1e1f83f27b 100644 --- a/code/modules/economy/POS.dm +++ b/code/modules/economy/POS.dm @@ -428,8 +428,8 @@ var/const/POS_HEADER = {" if("Add to Order") AddToOrder(href_list["preset"],text2num(href_list["units"])) if("Add Products") - for(var/list/line in text2list(href_list["csv"],"\n")) - var/list/cells = text2list(line,",") + for(var/list/line in splittext(href_list["csv"],"\n")) + var/list/cells = splittext(line,",") if(cells.len<2) usr << "\red The CSV must have at least two columns: Product Name, followed by Price (as a number)." src.attack_hand(usr) diff --git a/code/modules/events/anomaly_bluespace.dm b/code/modules/events/anomaly_bluespace.dm index 118f4f4ddff..82a4da4cc15 100644 --- a/code/modules/events/anomaly_bluespace.dm +++ b/code/modules/events/anomaly_bluespace.dm @@ -36,10 +36,9 @@ command_announcement.Announce("Massive bluespace translocation detected.", "Anomaly Alert") var/list/flashers = list() - for(var/mob/living/carbon/human/M in viewers(TO, null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) // flash dose faggots - flashers += M + for(var/mob/living/carbon/C in viewers(TO, null)) + if(C.flash_eyes()) + flashers += C var/y_distance = TO.y - FROM.y var/x_distance = TO.x - FROM.x @@ -66,4 +65,3 @@ M.client.screen -= blueeffect qdel(blueeffect) qdel(newAnomaly) - \ No newline at end of file diff --git a/code/modules/flufftext/TextFilters.dm b/code/modules/flufftext/TextFilters.dm index 44cc91a8e45..5a40ea1934a 100644 --- a/code/modules/flufftext/TextFilters.dm +++ b/code/modules/flufftext/TextFilters.dm @@ -26,7 +26,7 @@ proc/Intoxicated(phrase) proc/NewStutter(phrase,stunned) phrase = html_decode(phrase) - var/list/split_phrase = text2list(phrase," ") //Split it up into words. + var/list/split_phrase = splittext(phrase," ") //Split it up into words. var/list/unstuttered_words = split_phrase.Copy() var/i = rand(1,3) @@ -57,7 +57,7 @@ proc/NewStutter(phrase,stunned) split_phrase[index] = word - return sanitize(list2text(split_phrase," ")) + return sanitize(jointext(split_phrase," ")) proc/Stagger(mob/M,d) //Technically not a filter, but it relates to drunkenness. step(M, pick(d,turn(d,90),turn(d,-90))) @@ -67,7 +67,7 @@ proc/Ellipsis(original_msg, chance = 50) if(chance >= 100) return original_msg var/list - words = text2list(original_msg," ") + words = splittext(original_msg," ") new_words = list() var/new_msg = "" @@ -78,6 +78,6 @@ proc/Ellipsis(original_msg, chance = 50) else new_words += w - new_msg = list2text(new_words," ") + new_msg = jointext(new_words," ") return new_msg diff --git a/code/modules/karma/karma.dm b/code/modules/karma/karma.dm index 9633383e98a..c3c0ca4eef1 100644 --- a/code/modules/karma/karma.dm +++ b/code/modules/karma/karma.dm @@ -270,10 +270,10 @@ You've gained [totalkarma] total karma in your time here.
"} karmacharge(cost) if(dbckey) - var/list/joblist = text2list(dbjob,",") + var/list/joblist = splittext(dbjob,",") if(!(job in joblist)) joblist += job - var/newjoblist = list2text(joblist,",") + var/newjoblist = jointext(joblist,",") query = dbcon.NewQuery("UPDATE [format_table_name("whitelist")] SET job='[newjoblist]' WHERE ckey='[dbckey]'") if(!query.Execute()) var/err = query.ErrorMsg() @@ -310,10 +310,10 @@ You've gained [totalkarma] total karma in your time here.
"} karmacharge(cost) if(dbckey) - var/list/specieslist = text2list(dbspecies,",") + var/list/specieslist = splittext(dbspecies,",") if(!(species in specieslist)) specieslist += species - var/newspecieslist = list2text(specieslist,",") + var/newspecieslist = jointext(specieslist,",") query = dbcon.NewQuery("UPDATE [format_table_name("whitelist")] SET species='[newspecieslist]' WHERE ckey='[dbckey]'") if(!query.Execute()) var/err = query.ErrorMsg() @@ -388,15 +388,15 @@ You've gained [totalkarma] total karma in your time here.
"} if(dbckey) var/list/typelist = list() if(type == "job") - typelist = text2list(dbjob,",") + typelist = splittext(dbjob,",") else if(type == "species") - typelist = text2list(dbspecies,",") + typelist = splittext(dbspecies,",") else usr << "\red Type [type] is not a valid column." if(name in typelist) typelist -= name - var/newtypelist = list2text(typelist,",") + var/newtypelist = jointext(typelist,",") query = dbcon.NewQuery("UPDATE [format_table_name("whitelist")] SET [type]='[newtypelist]' WHERE ckey='[dbckey]'") if(!query.Execute()) var/err = query.ErrorMsg() @@ -426,8 +426,8 @@ You've gained [totalkarma] total karma in your time here.
"} dbspecies = query.item[4] if(dbckey) - var/list/joblist = text2list(dbjob,",") - var/list/specieslist = text2list(dbspecies,",") + var/list/joblist = splittext(dbjob,",") + var/list/specieslist = splittext(dbspecies,",") var/list/combinedlist = joblist + specieslist if(name) if(name in combinedlist) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index 872b53ee6dd..c177b94a118 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -203,7 +203,7 @@ var/heard = "" if(prob(15)) var/list/punctuation = list(",", "!", ".", ";", "?") - var/list/messages = text2list(message, " ") + var/list/messages = splittext(message, " ") var/R = rand(1, messages.len) var/heardword = messages[R] if(copytext(heardword,1, 1) in punctuation) diff --git a/code/modules/mob/living/autohiss.dm b/code/modules/mob/living/autohiss.dm index 219ec491624..4b9bfd96f49 100644 --- a/code/modules/mob/living/autohiss.dm +++ b/code/modules/mob/living/autohiss.dm @@ -102,7 +102,7 @@ . += pick(map[min_char]) message = copytext(message, min_index + 1) - return list2text(.) + return jointext(., "") #undef AUTOHISS_OFF #undef AUTOHISS_BASIC diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 1c445f2a003..dd173382124 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -67,7 +67,7 @@ return -/mob/living/carbon/alien/eyecheck() +/mob/living/carbon/alien/check_eye_prot() return 2 /mob/living/carbon/alien/updatehealth() diff --git a/code/modules/mob/living/carbon/alien/death.dm b/code/modules/mob/living/carbon/alien/death.dm index 115a49f20a8..de954cb3c75 100644 --- a/code/modules/mob/living/carbon/alien/death.dm +++ b/code/modules/mob/living/carbon/alien/death.dm @@ -52,7 +52,6 @@ for(var/mob/O in viewers(src, null)) O.show_message("[src] lets out a waning guttural screech, green blood bubbling from its maw...", 1) update_canmove() - if(client) blind.layer = 0 update_icons() timeofdeath = worldtime2text() diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index 6e4fe3705f4..2c79a007fa8 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -130,77 +130,4 @@ if(druggy) druggy = max(druggy-1, 0) - return 1 - - -/mob/living/carbon/alien/humanoid/handle_regular_hud_updates() - - if (stat == 2 || (XRAY in mutations)) - sight |= SEE_TURFS - sight |= SEE_MOBS - sight |= SEE_OBJS - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO - else if (stat != 2) - sight |= SEE_MOBS - sight &= ~SEE_TURFS - sight &= ~SEE_OBJS - if(nightvision) - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_MINIMUM - else if(!nightvision) - see_in_dark = 4 - see_invisible = 45 - if(see_override) - see_invisible = see_override - - if (healths) - if (stat != 2) - switch(health) - if(100 to INFINITY) - healths.icon_state = "health0" - if(75 to 100) - healths.icon_state = "health1" - if(50 to 75) - healths.icon_state = "health2" - if(25 to 50) - healths.icon_state = "health3" - if(0 to 25) - healths.icon_state = "health4" - else - healths.icon_state = "health5" - else - healths.icon_state = "health6" - - if (toxin) toxin.icon_state = "tox[toxins_alert ? 1 : 0]" - if (oxygen) oxygen.icon_state = "oxy[oxygen_alert ? 1 : 0]" - if (fire) fire.icon_state = "fire[fire_alert ? 1 : 0]" - //NOTE: the alerts dont reset when youre out of danger. dont blame me, - //blame the person who coded them. Temporary fix added. - - client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired) - - if ((blind && stat != 2)) - if ((blinded)) - blind.layer = 18 - else - blind.layer = 0 - - if (disabilities & NEARSIGHTED) - client.screen += global_hud.vimpaired - - if (eye_blurry) - client.screen += global_hud.blurry - - if (druggy) - client.screen += global_hud.druggy - - if (stat != 2) - if (machine) - if (!( machine.check_eye(src) )) - reset_view(null) - else - if(!client.adminobs) - reset_view(null) - - return 1 + return 1 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/larva/death.dm b/code/modules/mob/living/carbon/alien/larva/death.dm index 574b617ca58..03eeeaa5c81 100644 --- a/code/modules/mob/living/carbon/alien/larva/death.dm +++ b/code/modules/mob/living/carbon/alien/larva/death.dm @@ -7,7 +7,6 @@ if(!gibbed) visible_message("[src] lets out a waning high-pitched cry.") update_canmove() - if(client) blind.layer = 0 timeofdeath = worldtime2text() if(mind) mind.store_memory("Time of death: [timeofdeath]", 0) diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index d4e57324826..4e7b974d855 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -85,84 +85,4 @@ if(druggy) druggy = max(druggy-1, 0) - return 1 - - -/mob/living/carbon/alien/larva/handle_regular_hud_updates() - - if (stat == 2 || (XRAY in mutations)) - sight |= SEE_TURFS - sight |= SEE_MOBS - sight |= SEE_OBJS - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO - else if (stat != 2) - sight |= SEE_MOBS - sight &= ~SEE_TURFS - sight &= ~SEE_OBJS - if(nightvision) - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_MINIMUM - else if(!nightvision) - see_in_dark = 4 - see_invisible = 45 - if(see_override) - see_invisible = see_override - - if (healths) - if (stat != 2) - switch(health) - if(25 to INFINITY) - healths.icon_state = "health0" - if(19 to 25) - healths.icon_state = "health1" - if(13 to 19) - healths.icon_state = "health2" - if(7 to 13) - healths.icon_state = "health3" - if(0 to 7) - healths.icon_state = "health4" - else - healths.icon_state = "health5" - else - healths.icon_state = "health6" - - if(pullin) - if(pulling) - pullin.icon_state = "pull" - else - pullin.icon_state = "pull0" - - if (toxin) toxin.icon_state = "tox[toxins_alert ? 1 : 0]" - if (oxygen) oxygen.icon_state = "oxy[oxygen_alert ? 1 : 0]" - if (fire) fire.icon_state = "fire[fire_alert ? 1 : 0]" - //NOTE: the alerts dont reset when youre out of danger. dont blame me, - //blame the person who coded them. Temporary fix added. - - - client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired) - - if ((blind && stat != 2)) - if ((blinded)) - blind.layer = 18 - else - blind.layer = 0 - - if (disabilities & NEARSIGHTED) - client.screen += global_hud.vimpaired - - if (eye_blurry) - client.screen += global_hud.blurry - - if (druggy) - client.screen += global_hud.druggy - - if (stat != 2) - if (machine) - if (!( machine.check_eye(src) )) - reset_view(null) - else - if(!client.adminobs) - reset_view(null) - return 1 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index e65165ec31d..a3662187f8b 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -36,4 +36,24 @@ src << "You feel a searing heat in your lungs!" fire_alert = max(fire_alert, 1) else - fire_alert = 0 \ No newline at end of file + fire_alert = 0 + +/mob/living/carbon/alien/update_sight() + if(stat == DEAD || (XRAY in mutations)) + sight |= SEE_TURFS + sight |= SEE_MOBS + sight |= SEE_OBJS + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_LEVEL_TWO + else if(stat != DEAD) + sight |= SEE_MOBS + sight &= ~SEE_TURFS + sight &= ~SEE_OBJS + if(nightvision) + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_MINIMUM + else if(!nightvision) + see_in_dark = 4 + see_invisible = 45 + if(see_override) + see_invisible = see_override diff --git a/code/modules/mob/living/carbon/brain/death.dm b/code/modules/mob/living/carbon/brain/death.dm index efb1b8e8d87..8345c791a22 100644 --- a/code/modules/mob/living/carbon/brain/death.dm +++ b/code/modules/mob/living/carbon/brain/death.dm @@ -6,7 +6,6 @@ container.icon_state = "mmi_dead" stat = DEAD - if(blind) blind.layer = 0 sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS see_in_dark = 8 see_invisible = SEE_INVISIBLE_LEVEL_TWO diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 677b83fac58..5befe1114ba 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -309,9 +309,51 @@ if(H.w_uniform) H.w_uniform.add_fingerprint(M) +/mob/living/carbon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0) + . = ..() + var/damage = intensity - check_eye_prot() + if(.) + if(visual) + return + var/obj/item/organ/internal/eyes/E = get_int_organ(/obj/item/organ/internal/eyes) + if(!E) + return + + switch(damage) + if(1) + src << "Your eyes sting a little." + if(prob(40)) //waiting on carbon organs + E.damage += 1 + + if(2) + src << "Your eyes burn." + E.damage += rand(2, 4) + + else + src << "Your eyes itch and burn severely!" + E.damage += rand(12, 16) + + if(E.damage > E.min_bruised_damage) + eye_blind += damage + eye_blurry += damage * rand(3, 6) + + if(E.damage > (E.min_bruised_damage + E.min_broken_damage) / 2) + if(!(E.status & ORGAN_ROBOT)) + src << "Your eyes start to burn badly!" + else //snowflake conditions piss me off for the record + src << "The flash blinds you!" + + else if(E.damage >= E.min_broken_damage) + src << "You can't see anything!" + + else + src << "Your eyes are really starting to hurt. This can't be good for you!" + return 1 + + else if(damage == 0) // just enough protection + if(prob(20)) + src << "Something bright flashes in the corner of your vision!" -/mob/living/carbon/proc/eyecheck() - return 0 /mob/living/carbon/proc/tintcheck() return 0 diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 589331a7c01..aa31c912841 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -129,7 +129,6 @@ if(!gibbed) update_canmove() - if(client) blind.layer = 0 timeofdeath = worldtime2text() med_hud_set_health() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 0584b1c062f..9fb9f12d264 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1100,24 +1100,32 @@ . = ..() -///eyecheck() +///check_eye_prot() ///Returns a number between -1 to 2 -/mob/living/carbon/human/eyecheck() +/mob/living/carbon/human/check_eye_prot() var/number = ..() - if(istype(src.head, /obj/item/clothing/head)) //are they wearing something on their head - var/obj/item/clothing/head/HFP = src.head //if yes gets the flash protection value from that item + if(istype(head, /obj/item/clothing/head)) //are they wearing something on their head + var/obj/item/clothing/head/HFP = head //if yes gets the flash protection value from that item number += HFP.flash_protect - if(istype(src.glasses, /obj/item/clothing/glasses)) //glasses - var/obj/item/clothing/glasses/GFP = src.glasses + if(istype(glasses, /obj/item/clothing/glasses)) //glasses + var/obj/item/clothing/glasses/GFP = glasses number += GFP.flash_protect - if(istype(src.wear_mask, /obj/item/clothing/mask)) //mask - var/obj/item/clothing/mask/MFP = src.wear_mask + if(istype(wear_mask, /obj/item/clothing/mask)) //mask + var/obj/item/clothing/mask/MFP = wear_mask number += MFP.flash_protect - for(var/obj/item/organ/internal/cyberimp/eyes/EFP in src.internal_organs) + for(var/obj/item/organ/internal/cyberimp/eyes/EFP in internal_organs) number += EFP.flash_protect return number +/mob/living/carbon/human/check_ear_prot() + if(head && (head.flags & HEADBANGPROTECT)) + return 1 + if(l_ear && (l_ear.flags & EARBANGPROTECT)) + return 1 + if(r_ear && (r_ear.flags & EARBANGPROTECT)) + return 1 + ///tintcheck() ///Checks eye covering items for visually impairing tinting, such as welding masks ///Checked in life.dm. 0 & 1 = no impairment, 2 = welding mask overlay, 3 = You can see jack, but you can't see shit. @@ -1887,4 +1895,4 @@ var/obj/item/clothing/under/U = w_uniform if(U.accessories) for(var/obj/item/clothing/accessory/A in U.accessories) - . |= A.GetAccess() \ No newline at end of file + . |= A.GetAccess() diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 0b413d1915c..1b6d62c72a0 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -400,4 +400,4 @@ This function restores all organs. // Will set our damageoverlay icon to the next level, which will then be set back to the normal level the next mob.Life(). updatehealth() - return 1 \ No newline at end of file + return 1 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index f463f30b89c..db69fb5b3c4 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1,30 +1,5 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 - -var/global/list/unconscious_overlays = list("1" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage1"),\ - "2" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage2"),\ - "3" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage3"),\ - "4" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage4"),\ - "5" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage5"),\ - "6" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage6"),\ - "7" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage7"),\ - "8" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage8"),\ - "9" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage9"),\ - "10" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage10")) -var/global/list/oxyloss_overlays = list("1" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay1"),\ - "2" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay2"),\ - "3" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay3"),\ - "4" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay4"),\ - "5" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay5"),\ - "6" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay6"),\ - "7" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay7")) -var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay1"),\ - "2" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay2"),\ - "3" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay3"),\ - "4" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay4"),\ - "5" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay5"),\ - "6" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay6")) - #define TINT_IMPAIR 2 //Threshold of tint level to apply weld mask overlay #define TINT_BLIND 3 //Threshold of tint level to obscure vision fully @@ -51,10 +26,6 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc loc_as_cryobag.used++ in_stasis = 1 - //if(mob_master.current_cycle % 30 == 15) - //hud_updateflag = 1022 - //HudRefactor:WTF do i put here.... - voice = GetVoice() if(..() && !in_stasis) @@ -909,7 +880,6 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc /mob/living/carbon/human/handle_vision() - client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) if(machine) if(!machine.check_eye(src)) reset_view(null) else diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 097a91810da..f2cf58fe29f 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -416,125 +416,147 @@ return 0 /datum/species/proc/handle_vision(mob/living/carbon/human/H) - if( H.stat == DEAD ) + if(H.stat == DEAD) H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) H.see_in_dark = 8 - if(!H.druggy) H.see_invisible = SEE_INVISIBLE_LEVEL_TWO - else - H.sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS) + if(!H.druggy) + H.see_invisible = SEE_INVISIBLE_LEVEL_TWO + return - H.see_in_dark = darksight //set their variables to default, modify them later - H.see_invisible = SEE_INVISIBLE_LIVING + H.sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS) - if(H.mind && H.mind.vampire) - if(H.mind.vampire.get_ability(/datum/vampire_passive/full)) - H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS - H.see_in_dark = 8 - H.see_invisible = SEE_INVISIBLE_MINIMUM - else if(H.mind.vampire.get_ability(/datum/vampire_passive/vision)) - H.sight |= SEE_MOBS + H.see_in_dark = darksight //set their variables to default, modify them later + H.see_invisible = SEE_INVISIBLE_LIVING - if(XRAY in H.mutations) + if(H.mind && H.mind.vampire) + if(H.mind.vampire.get_ability(/datum/vampire_passive/full)) H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS H.see_in_dark = 8 - H.see_invisible = SEE_INVISIBLE_MINIMUM + else if(H.mind.vampire.get_ability(/datum/vampire_passive/vision)) + H.sight |= SEE_MOBS - if(H.seer == 1) - var/obj/effect/rune/R = locate() in H.loc - if(R && R.word1 == cultwords["see"] && R.word2 == cultwords["hell"] && R.word3 == cultwords["join"]) - H.see_invisible = SEE_INVISIBLE_OBSERVER - else - H.see_invisible = SEE_INVISIBLE_LIVING - H.seer = 0 + if(XRAY in H.mutations) + H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS + H.see_in_dark = 8 - //This checks how much the mob's eyewear impairs their vision - if(H.tinttotal >= TINT_IMPAIR) - if(tinted_weldhelh) - if(H.tinttotal >= TINT_BLIND) - H.eye_blind = max(H.eye_blind, 1) - if(H.client) - H.client.screen += global_hud.darkMask + H.see_invisible = SEE_INVISIBLE_MINIMUM - var/minimum_darkness_view = INFINITY - if(H.glasses) - if(istype(H.glasses, /obj/item/clothing/glasses)) - var/obj/item/clothing/glasses/G = H.glasses - H.sight |= G.vision_flags - if(G.darkness_view) - H.see_in_dark = G.darkness_view - minimum_darkness_view = G.darkness_view + if(H.seer == 1) + var/obj/effect/rune/R = locate() in H.loc + if(R && R.word1 == cultwords["see"] && R.word2 == cultwords["hell"] && R.word3 == cultwords["join"]) + H.see_invisible = SEE_INVISIBLE_OBSERVER + else + H.see_invisible = SEE_INVISIBLE_LIVING + H.seer = 0 - if(!G.see_darkness) - H.see_invisible = SEE_INVISIBLE_MINIMUM + //This checks how much the mob's eyewear impairs their vision + if(H.tinttotal >= TINT_IMPAIR) + if(tinted_weldhelh) + H.overlay_fullscreen("tint", /obj/screen/fullscreen/impaired, 2) + if(H.tinttotal >= TINT_BLIND) + H.eye_blind = max(H.eye_blind, 1) + else + H.clear_fullscreen("tint") - if(H.head) - if(istype(H.head, /obj/item/clothing/head)) - var/obj/item/clothing/head/hat = H.head - H.sight |= hat.vision_flags + var/minimum_darkness_view = INFINITY + if(H.glasses) + if(istype(H.glasses, /obj/item/clothing/glasses)) + var/obj/item/clothing/glasses/G = H.glasses + H.sight |= G.vision_flags - if(hat.darkness_view && hat.darkness_view < minimum_darkness_view) // Pick the lowest of the two darkness_views between the glasses and helmet. - H.see_in_dark = hat.darkness_view + if(G.darkness_view) + H.see_in_dark = G.darkness_view + minimum_darkness_view = G.darkness_view - if(!hat.see_darkness) - H.see_invisible = SEE_INVISIBLE_MINIMUM + if(!G.see_darkness) + H.see_invisible = SEE_INVISIBLE_MINIMUM - //switch(hat.HUDType) - // if(SECHUD) - // process_sec_hud(H,1) - // if(MEDHUD) - // process_med_hud(H,1) - // if(ANTAGHUD) - // process_antag_hud(H) + if(H.head) + if(istype(H.head, /obj/item/clothing/head)) + var/obj/item/clothing/head/hat = H.head + H.sight |= hat.vision_flags - if(istype(H.back, /obj/item/weapon/rig)) ///ahhhg so snowflakey - var/obj/item/weapon/rig/rig = H.back - if(rig.visor) - if(!rig.helmet || (H.head && rig.helmet == H.head)) - if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses) - var/obj/item/clothing/glasses/G = rig.visor.vision.glasses - if(istype(G)) - H.see_in_dark = (G.darkness_view ? G.darkness_view : darksight) // Otherwise we keep our darkness view with togglable nightvision. - if(G.vision_flags) // MESONS - H.sight |= G.vision_flags + if(hat.darkness_view && hat.darkness_view < minimum_darkness_view) // Pick the lowest of the two darkness_views between the glasses and helmet. + H.see_in_dark = hat.darkness_view - if(!G.see_darkness) - H.see_invisible = SEE_INVISIBLE_MINIMUM + if(!hat.see_darkness) + H.see_invisible = SEE_INVISIBLE_MINIMUM - //switch(G.HUDType) - // if(SECHUD) - // process_sec_hud(H,1) - // if(MEDHUD) - // process_med_hud(H,1) - // if(ANTAGHUD) - // process_antag_hud(H) + //switch(hat.HUDType) + // if(SECHUD) + // process_sec_hud(H,1) + // if(MEDHUD) + // process_med_hud(H,1) + // if(ANTAGHUD) + // process_antag_hud(H) - if(H.vision_type) - H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, darksight) - H.see_invisible = H.vision_type.see_invisible - if(H.vision_type.light_sensitive) - H.weakeyes = 1 - H.sight |= H.vision_type.sight_flags + if(istype(H.back, /obj/item/weapon/rig)) ///ahhhg so snowflakey + var/obj/item/weapon/rig/rig = H.back + if(rig.visor) + if(!rig.helmet || (H.head && rig.helmet == H.head)) + if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses) + var/obj/item/clothing/glasses/G = rig.visor.vision.glasses + if(istype(G)) + H.see_in_dark = (G.darkness_view ? G.darkness_view : darksight) // Otherwise we keep our darkness view with togglable nightvision. + if(G.vision_flags) // MESONS + H.sight |= G.vision_flags - if(H.see_override) //Override all - H.see_invisible = H.see_override + if(!G.see_darkness) + H.see_invisible = SEE_INVISIBLE_MINIMUM - if(H.blind) - if(H.blinded) H.blind.layer = 18 - else H.blind.layer = 0 + //switch(G.HUDType) + // if(SECHUD) + // process_sec_hud(H,1) + // if(MEDHUD) + // process_med_hud(H,1) + // if(ANTAGHUD) + // process_antag_hud(H) - if(H.disabilities & NEARSIGHTED) //this looks meh but saves a lot of memory by not requiring to add var/prescription - if(H.glasses) //to every /obj/item - var/obj/item/clothing/glasses/G = H.glasses - if(!G.prescription) - H.client.screen += global_hud.vimpaired - else - H.client.screen += global_hud.vimpaired + if(H.vision_type) + H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, darksight) + H.see_invisible = H.vision_type.see_invisible + if(H.vision_type.light_sensitive) + H.weakeyes = 1 + H.sight |= H.vision_type.sight_flags - if(H.eye_blurry) H.client.screen += global_hud.blurry - if(H.druggy) H.client.screen += global_hud.druggy + if(H.see_override) //Override all + H.see_invisible = H.see_override + + if(!H.client) + return 1 + + if(H.blinded || H.eye_blind) + H.overlay_fullscreen("blind", /obj/screen/fullscreen/blind) + //H.throw_alert("blind", /obj/screen/alert/blind) + else + H.clear_fullscreen("blind") + //H.clear_alert("blind") + + + if(H.disabilities & NEARSIGHTED) //this looks meh but saves a lot of memory by not requiring to add var/prescription + if(H.glasses) //to every /obj/item + var/obj/item/clothing/glasses/G = H.glasses + if(!G.prescription) + H.overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1) + else + H.overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1) + else + H.clear_fullscreen("nearsighted") + + if(H.eye_blurry) + H.overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry) + else + H.clear_fullscreen("blurry") + + if(H.druggy) + H.overlay_fullscreen("high", /obj/screen/fullscreen/high) + //H.throw_alert("high", /obj/screen/alert/high) + else + H.clear_fullscreen("high") + //H.clear_alert("high") /datum/species/proc/handle_hud_icons(mob/living/carbon/human/H) if(H.healths) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index df357e66db2..48d0c320145 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -364,83 +364,55 @@ //this handles hud updates. Calls update_vision() and handle_hud_icons() /mob/living/carbon/handle_regular_hud_updates() - if(!client) return 0 + if(!client) + return 0 - if(damageoverlay) - if(damageoverlay.overlays) - damageoverlay.overlays = list() - - if(stat == UNCONSCIOUS) - //Critical damage passage overlay - if(health <= config.health_threshold_crit) - var/image/I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage0") - I.blend_mode = BLEND_OVERLAY //damageoverlay is BLEND_MULTIPLY - switch(health) - if(-20 to -10) - I.icon_state = "passage1" - if(-30 to -20) - I.icon_state = "passage2" - if(-40 to -30) - I.icon_state = "passage3" - if(-50 to -40) - I.icon_state = "passage4" - if(-60 to -50) - I.icon_state = "passage5" - if(-70 to -60) - I.icon_state = "passage6" - if(-80 to -70) - I.icon_state = "passage7" - if(-90 to -80) - I.icon_state = "passage8" - if(-95 to -90) - I.icon_state = "passage9" - if(-INFINITY to -95) - I.icon_state = "passage10" - damageoverlay.overlays += I + if(stat == UNCONSCIOUS && health <= config.health_threshold_crit) + var/severity = 0 + switch(health) + if(-20 to -10) severity = 1 + if(-30 to -20) severity = 2 + if(-40 to -30) severity = 3 + if(-50 to -40) severity = 4 + if(-60 to -50) severity = 5 + if(-70 to -60) severity = 6 + if(-80 to -70) severity = 7 + if(-90 to -80) severity = 8 + if(-95 to -90) severity = 9 + if(-INFINITY to -95) severity = 10 + overlay_fullscreen("crit", /obj/screen/fullscreen/crit, severity) + else + clear_fullscreen("crit") + if(oxyloss) + var/severity = 0 + switch(oxyloss) + if(10 to 20) severity = 1 + if(20 to 25) severity = 2 + if(25 to 30) severity = 3 + if(30 to 35) severity = 4 + if(35 to 40) severity = 5 + if(40 to 45) severity = 6 + if(45 to INFINITY) severity = 7 + overlay_fullscreen("oxy", /obj/screen/fullscreen/oxy, severity) else - //Oxygen damage overlay - if(oxyloss) - var/image/I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay0") - switch(oxyloss) - if(10 to 20) - I.icon_state = "oxydamageoverlay1" - if(20 to 25) - I.icon_state = "oxydamageoverlay2" - if(25 to 30) - I.icon_state = "oxydamageoverlay3" - if(30 to 35) - I.icon_state = "oxydamageoverlay4" - if(35 to 40) - I.icon_state = "oxydamageoverlay5" - if(40 to 45) - I.icon_state = "oxydamageoverlay6" - if(45 to INFINITY) - I.icon_state = "oxydamageoverlay7" - damageoverlay.overlays += I + clear_fullscreen("oxy") + + //Fire and Brute damage overlay (BSSR) + var/hurtdamage = getBruteLoss() + getFireLoss() + damageoverlaytemp + damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not. + if(hurtdamage) + var/severity = 0 + switch(hurtdamage) + if(5 to 15) severity = 1 + if(15 to 30) severity = 2 + if(30 to 45) severity = 3 + if(45 to 70) severity = 4 + if(70 to 85) severity = 5 + if(85 to INFINITY) severity = 6 + overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity) + else + clear_fullscreen("brute") - //Fire and Brute damage overlay (BSSR) - var/hurtdamage = src.getBruteLoss() + src.getFireLoss() + damageoverlaytemp - damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not. - if(hurtdamage) - var/image/I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay0") - I.blend_mode = BLEND_ADD - switch(hurtdamage) - if(5 to 15) - I.icon_state = "brutedamageoverlay1" - if(15 to 30) - I.icon_state = "brutedamageoverlay2" - if(30 to 45) - I.icon_state = "brutedamageoverlay3" - if(45 to 70) - I.icon_state = "brutedamageoverlay4" - if(70 to 85) - I.icon_state = "brutedamageoverlay5" - if(85 to INFINITY) - I.icon_state = "brutedamageoverlay6" - var/image/black = image(I.icon, I.icon_state) //BLEND_ADD doesn't let us darken, so this is just to blacken the edge of the screen - black.color = "#170000" - damageoverlay.overlays += I - damageoverlay.overlays += black ..() return 1 diff --git a/code/modules/mob/living/carbon/slime/death.dm b/code/modules/mob/living/carbon/slime/death.dm index 6e951320bdc..240454f3e0f 100644 --- a/code/modules/mob/living/carbon/slime/death.dm +++ b/code/modules/mob/living/carbon/slime/death.dm @@ -20,8 +20,6 @@ O.show_message("The [name] seizes up and falls limp...", 1) //ded -- Urist update_canmove() - if(blind) - blind.layer = 0 if(ticker && ticker.mode) ticker.mode.check_win() diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm new file mode 100644 index 00000000000..14585f6ae21 --- /dev/null +++ b/code/modules/mob/living/death.dm @@ -0,0 +1,5 @@ +/mob/living/death(gibbed) + blinded = max(blinded, 1) + + clear_fullscreens() + ..(gibbed) \ No newline at end of file diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index f8dcf7a5d0d..ebbda839e52 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -161,7 +161,7 @@ /mob/living/proc/handle_disabilities() //Eyes - if(disabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own + if(sdisabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own eye_blind = max(eye_blind, 1) else if(eye_blind) //blindness, heals slowly over time eye_blind = max(eye_blind-1,0) @@ -187,33 +187,40 @@ return 1 /mob/living/proc/handle_vision() - - client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) - update_sight() - if(stat != DEAD) - if(blind) - if(eye_blind) - blind.layer = 18 - else - blind.layer = 0 + if(stat == DEAD) + return + if(blinded || eye_blind) + overlay_fullscreen("blind", /obj/screen/fullscreen/blind) + //throw_alert("blind", /obj/screen/alert/blind) + else + clear_fullscreen("blind") + //clear_alert("blind") - if (disabilities & NEARSIGHTED) - client.screen += global_hud.vimpaired - - if (eye_blurry) - client.screen += global_hud.blurry - - if (druggy) - client.screen += global_hud.druggy - - if(machine) - if (!( machine.check_eye(src) )) - reset_view(null) + if(disabilities & NEARSIGHTED) + overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1) else - if(!remote_view && !client.adminobs) - reset_view(null) + clear_fullscreen("nearsighted") + + if(eye_blurry) + overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry) + else + clear_fullscreen("blurry") + + if(druggy) + overlay_fullscreen("high", /obj/screen/fullscreen/high) + //throw_alert("high", /obj/screen/alert/high) + else + clear_fullscreen("high") + //clear_alert("high") + + if(machine) + if(!machine.check_eye(src)) + reset_view(null) + else + if(!remote_view && !client.adminobs) + reset_view(null) /mob/living/proc/update_sight() return diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index df3c85e4feb..662937b1af3 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -73,8 +73,7 @@ /mob/living/ex_act(severity) ..() - if(client && !eye_blind) - flick("flash", src.flash) + flash_eyes() /mob/living/proc/updatehealth() if(status_flags & GODMODE) @@ -809,6 +808,18 @@ /mob/living/proc/can_use_vents() return "You can't fit into that vent." +//called when the mob receives a bright flash +/mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash) + if(check_eye_prot() < intensity && (override_blindness_check || !(sdisabilities & BLIND))) + overlay_fullscreen("flash", type) + addtimer(src, "clear_fullscreen", 25, FALSE, "flash", 25) + return 1 + +/mob/living/proc/check_eye_prot() + return 0 + +/mob/living/proc/check_ear_prot() + // The src mob is trying to strip an item from someone // Override if a certain type of mob should be behave differently when stripping items (can't, for example) /mob/living/stripPanelUnequip(obj/item/what, mob/who, where, var/silent = 0) @@ -966,4 +977,4 @@ new path(loc) butcher_results.Remove(path) //In case you want to have things like simple_animals drop their butcher results on gib, so it won't double up below. visible_message("[user] butchers [src].") - gib() \ No newline at end of file + gib() diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 4c1780e34d0..f2523e2d823 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -39,8 +39,6 @@ /mob/living/bullet_act(var/obj/item/projectile/P, var/def_zone) - flash_weak_pain() - //Being hit while using a cloaking device var/obj/item/weapon/cloaking_device/C = locate((/obj/item/weapon/cloaking_device) in src) if(C && C.active) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index a834f9e2569..94305e770fd 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -288,11 +288,11 @@ var/list/ai_verbs_default = list( return if(!custom_sprite) //Check to see if custom sprite time, checking the appopriate file to change a var var/file = file2text("config/custom_sprites.txt") - var/lines = text2list(file, "\n") + var/lines = splittext(file, "\n") for(var/line in lines) // split & clean up - var/list/Entry = text2list(line, ":") + var/list/Entry = splittext(line, ":") for(var/i = 1 to Entry.len) Entry[i] = trim(Entry[i]) @@ -593,8 +593,6 @@ var/list/ai_verbs_default = list( playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1) visible_message("[M] has slashed at [src]!",\ "[M] has slashed at [src]!") - if(prob(8)) - flick("noise", flash) adjustBruteLoss(damage) updatehealth() else diff --git a/code/modules/mob/living/silicon/ai/death.dm b/code/modules/mob/living/silicon/ai/death.dm index 44119424aa0..b0b0f44d0e6 100644 --- a/code/modules/mob/living/silicon/ai/death.dm +++ b/code/modules/mob/living/silicon/ai/death.dm @@ -5,9 +5,8 @@ icon_state = "[ckey]-ai-crash" else icon_state = "ai-crash" update_canmove() - if(src.eyeobj) - src.eyeobj.setLoc(get_turf(src)) - if(blind) blind.layer = 0 + if(eyeobj) + eyeobj.setLoc(get_turf(src)) sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS see_in_dark = 8 see_invisible = SEE_INVISIBLE_LEVEL_TWO diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 93ee8a54a2b..727d03b5696 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -49,22 +49,20 @@ if(aiRestorePowerRoutine == 2) src << "Alert cancelled. Power has been restored without our assistance." aiRestorePowerRoutine = 0 - blind.layer = 0 + clear_fullscreen("blind") else if(aiRestorePowerRoutine == 3) src << "Alert cancelled. Power has been restored." aiRestorePowerRoutine = 0 - blind.layer = 0 + clear_fullscreen("blind") else - - blind.screen_loc = "1,1 to 15,15" - if(blind.layer != 18) - blind.layer = 18 sight &= ~SEE_TURFS sight &= ~SEE_MOBS sight &= ~SEE_OBJS + overlay_fullscreen("blind", /obj/screen/fullscreen/blind) + see_in_dark = 0 see_invisible = SEE_INVISIBLE_LIVING @@ -85,7 +83,6 @@ if(my_area && my_area.power_equip && !istype(T, /turf/space)) src << "Alert cancelled. Power has been restored without our assistance." aiRestorePowerRoutine = 0 - blind.layer = 0 return src << "Fault confirmed: missing external power. Shutting down main control system to save power." sleep(20) @@ -122,7 +119,7 @@ if (!istype(T, /turf/space)) src << "Alert cancelled. Power has been restored without our assistance." aiRestorePowerRoutine = 0 - blind.layer = 0 + clear_fullscreen("blind") return switch(PRP) diff --git a/code/modules/mob/living/silicon/ai/login.dm b/code/modules/mob/living/silicon/ai/login.dm index 95c6e52b13f..7d3a65445ff 100644 --- a/code/modules/mob/living/silicon/ai/login.dm +++ b/code/modules/mob/living/silicon/ai/login.dm @@ -5,21 +5,9 @@ blood.override = 1 client.images += blood regenerate_icons() - flash = new /obj/screen() - flash.icon_state = "blank" - flash.name = "flash" - flash.screen_loc = "WEST,SOUTH to EAST,NORTH" - flash.layer = 17 - blind = new /obj/screen() - blind.icon_state = "black" - blind.name = " " - blind.screen_loc = "1,1 to 15,15" - blind.layer = 0 - client.screen.Add( blind, flash ) if(stat != DEAD) for(var/obj/machinery/ai_status_display/O in machines) //change status O.mode = 1 O.emotion = "Neutral" - src.view_core() - return \ No newline at end of file + view_core() \ No newline at end of file diff --git a/code/modules/mob/living/silicon/ai/say.dm b/code/modules/mob/living/silicon/ai/say.dm index 5e47030f373..2c9d396448e 100644 --- a/code/modules/mob/living/silicon/ai/say.dm +++ b/code/modules/mob/living/silicon/ai/say.dm @@ -43,7 +43,7 @@ var/const/VOX_PATH = "sound/vox_fem/" if(!message || announcing_vox > world.time) return - var/list/words = text2list(trim(message), " ") + var/list/words = splittext(trim(message), " ") var/list/incorrect_words = list() if(words.len > 30) diff --git a/code/modules/mob/living/silicon/pai/death.dm b/code/modules/mob/living/silicon/pai/death.dm index 08ec0e706d3..f9d75773ff9 100644 --- a/code/modules/mob/living/silicon/pai/death.dm +++ b/code/modules/mob/living/silicon/pai/death.dm @@ -12,7 +12,6 @@ card.overlays += "pai-off" stat = DEAD canmove = 0 - if(blind) blind.layer = 0 sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS see_in_dark = 8 see_invisible = SEE_INVISIBLE_LEVEL_TWO diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index e6f29376a3e..0d9d81d3bf5 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -247,7 +247,7 @@ if ((O.client && !( O.blinded ))) O.show_message(text("\red [] has slashed at []!", M, src), 1) if(prob(8)) - flick("noise", src.flash) + flash_eyes(affect_silicon = 1) src.adjustBruteLoss(damage) src.updatehealth() else diff --git a/code/modules/mob/living/silicon/robot/death.dm b/code/modules/mob/living/silicon/robot/death.dm index 6bff1a8260f..b0dc5062a95 100644 --- a/code/modules/mob/living/silicon/robot/death.dm +++ b/code/modules/mob/living/silicon/robot/death.dm @@ -59,7 +59,6 @@ var/obj/machinery/recharge_station/RC = loc RC.go_out() - if(blind) blind.layer = 0 sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS see_in_dark = 8 see_invisible = SEE_INVISIBLE_LEVEL_TWO diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index d7a2a659be4..ab82709dc35 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -338,3 +338,7 @@ /mob/living/silicon/robot/drone/update_canmove() . = ..() density = 0 //this is reset every canmove update otherwise + +/mob/living/simple_animal/drone/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0) + if(affect_silicon) + return ..() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 904bdc0e687..b887de3857e 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -175,11 +175,11 @@ var/list/robot_verbs_default = list( //Check for custom sprite if(!custom_sprite) var/file = file2text("config/custom_sprites.txt") - var/lines = text2list(file, "\n") + var/lines = splittext(file, "\n") for(var/line in lines) // split & clean up - var/list/Entry = text2list(line, ";") + var/list/Entry = splittext(line, ";") for(var/i = 1 to Entry.len) Entry[i] = trim(Entry[i]) @@ -866,7 +866,7 @@ var/list/robot_verbs_default = list( visible_message("[M] has slashed at [src]!",\ "[M] has slashed at [src]!") if(prob(8)) - flick("noise", flash) + flash_eyes(affect_silicon = 1) adjustBruteLoss(damage) updatehealth() else @@ -895,7 +895,7 @@ var/list/robot_verbs_default = list( /mob/living/silicon/robot/attack_slime(mob/living/carbon/slime/M as mob) if(..()) //successful slime shock - flick("noise", flash) + flash_eyes(affect_silicon = 1) var/stunprob = M.powerlevel * 7 + 10 if(prob(stunprob) && M.powerlevel >= 8) adjustBruteLoss(M.powerlevel * rand(6,10)) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 8577410a9b9..c76b159e452 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -73,7 +73,7 @@ if(2) src.take_organ_damage(10) Stun(3) - flick("noise", src:flash) + flash_eyes(affect_silicon = 1) src << "\red *BZZZT*" src << "\red Warning: Electromagnetic pulse detected." ..() @@ -351,3 +351,7 @@ /mob/living/silicon/get_access() return IGNORE_ACCESS //silicons always have access + +/mob/living/silicon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash/noise) + if(affect_silicon) + return ..() \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/bees.dm b/code/modules/mob/living/simple_animal/bees.dm index c5fcf9fc938..687041617be 100644 --- a/code/modules/mob/living/simple_animal/bees.dm +++ b/code/modules/mob/living/simple_animal/bees.dm @@ -49,7 +49,6 @@ //if we're chasing someone, get a little bit angry if(target_mob && prob(10)) feral++ - M.flash_pain() //calm down a little bit if(feral > 0) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 57dfec1d00a..8915a7e46de 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1169,9 +1169,6 @@ var/list/slot_equipment_priority = list( \ /mob/proc/get_species() return "" -/mob/proc/flash_weak_pain() - flick("weak_pain",pain) - /mob/proc/get_visible_implants(var/class = 0) var/list/visible_implants = list() for(var/obj/item/O in embedded) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index e23a621d038..017e29fb2fa 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -11,8 +11,6 @@ //Not in use yet var/obj/effect/organstructure/organStructure = null - var/obj/screen/flash = null - var/obj/screen/blind = null var/obj/screen/hands = null var/obj/screen/pullin = null var/obj/screen/internals = null @@ -26,8 +24,6 @@ var/obj/screen/throw_icon = null var/obj/screen/nutrition_icon = null var/obj/screen/pressure = null - var/obj/screen/damageoverlay = null - var/obj/screen/pain = null var/obj/screen/gun/item/item_use_icon = null var/obj/screen/gun/move/gun_move_icon = null var/obj/screen/gun/run/gun_run_icon = null diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index e78ed83fa1f..f181fab77af 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -106,8 +106,8 @@ active=on var/statestr=on?"on":"off" // Spammy message_admins("Emitter turned [statestr] by radio signal ([signal.data["command"]] @ [frequency]) in [formatJumpTo(src)]",0,1) - log_game("Emitter turned [statestr] by radio signal ([signal.data["command"]] @ [frequency]) in ([x], [y], [z]) AAC prints: [list2text(signal.data["hiddenprints"])]") - investigate_log("turned [statestr] by radio signal ([signal.data["command"]] @ [frequency]) AAC prints: [list2text(signal.data["hiddenprints"])]","singulo") + log_game("Emitter turned [statestr] by radio signal ([signal.data["command"]] @ [frequency]) in ([x], [y], [z]) AAC prints: [jointext(signal.data["hiddenprints"], "")]") + investigate_log("turned [statestr] by radio signal ([signal.data["command"]] @ [frequency]) AAC prints: [jointext(signal.data["hiddenprints"], "")]","singulo") update_icon() /obj/machinery/power/emitter/Destroy() diff --git a/code/modules/procedural_mapping/mapGenerator.dm b/code/modules/procedural_mapping/mapGenerator.dm index c0b89549f3e..d0c5440dc95 100644 --- a/code/modules/procedural_mapping/mapGenerator.dm +++ b/code/modules/procedural_mapping/mapGenerator.dm @@ -156,8 +156,8 @@ src << "Missing Input" return - var/list/startCoords = text2list(startInput, ";") - var/list/endCoords = text2list(endInput, ";") + var/list/startCoords = splittext(startInput, ";") + var/list/endCoords = splittext(endInput, ";") if(!startCoords || !endCoords) src << "Invalid Coords" src << "Start Input: [startInput]" @@ -178,7 +178,7 @@ var/moduleClusters = input("Cluster Flags (Cancel to leave unchanged from defaults)","Map Gen Settings") as null|anything in clusters //null for default - + var/theCluster = 0 if(moduleClusters != "None") if(!clusters[moduleClusters]) @@ -187,7 +187,7 @@ theCluster = clusters[moduleClusters] else theCluster = CLUSTER_CHECK_NONE - + if(theCluster) for(var/datum/mapGeneratorModule/M in N.modules) M.clusterCheckFlags = theCluster diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index dcafea10a35..452a6dc026f 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -230,13 +230,13 @@ in_chamber.p_y = text2num(mouse_control["icon-y"]) if(mouse_control["screen-loc"]) //Split screen-loc up into X+Pixel_X and Y+Pixel_Y - var/list/screen_loc_params = text2list(mouse_control["screen-loc"], ",") + var/list/screen_loc_params = splittext(mouse_control["screen-loc"], ",") //Split X+Pixel_X up into list(X, Pixel_X) - var/list/screen_loc_X = text2list(screen_loc_params[1],":") + var/list/screen_loc_X = splittext(screen_loc_params[1],":") //Split Y+Pixel_Y up into list(Y, Pixel_Y) - var/list/screen_loc_Y = text2list(screen_loc_params[2],":") + var/list/screen_loc_Y = splittext(screen_loc_params[2],":") var/x = text2num(screen_loc_X[1]) * 32 + text2num(screen_loc_X[2]) - 32 var/y = text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32 diff --git a/code/modules/reagents/newchem/pyro.dm b/code/modules/reagents/newchem/pyro.dm index 719d95b6c3c..db1f01da847 100644 --- a/code/modules/reagents/newchem/pyro.dm +++ b/code/modules/reagents/newchem/pyro.dm @@ -249,13 +249,12 @@ datum/reagent/blackpowder/reaction_turf(var/turf/T, var/volume) //oh shit s.set_up(2, 1, location) s.start() for(var/mob/living/carbon/C in viewers(5, location)) - if(C.eyecheck()) - continue - flick("e_flash", C.flash) - if(get_dist(C, location) < 4) - C.Weaken(5) - continue - C.Stun(5) + if(C.flash_eyes()) + if(get_dist(C, location) < 4) + C.Weaken(5) + continue + C.Stun(5) + /datum/chemical_reaction/flash_powder/on_reaction(var/datum/reagents/holder, var/created_volume) if(holder.has_reagent("stabilizing_agent")) @@ -265,13 +264,11 @@ datum/reagent/blackpowder/reaction_turf(var/turf/T, var/volume) //oh shit s.set_up(2, 1, location) s.start() for(var/mob/living/carbon/C in viewers(5, location)) - if(C.eyecheck()) - continue - flick("e_flash", C.flash) - if(get_dist(C, location) < 4) - C.Weaken(5) - continue - C.Stun(5) + if(C.flash_eyes()) + if(get_dist(C, location) < 4) + C.Weaken(5) + continue + C.Stun(5) holder.remove_reagent("flash_powder", created_volume) /datum/reagent/smoke_powder diff --git a/code/modules/reagents/oldchem/chemical_reaction/chemical_reaction_slime.dm b/code/modules/reagents/oldchem/chemical_reaction/chemical_reaction_slime.dm index 7749a79380a..649a32ae373 100644 --- a/code/modules/reagents/oldchem/chemical_reaction/chemical_reaction_slime.dm +++ b/code/modules/reagents/oldchem/chemical_reaction/chemical_reaction_slime.dm @@ -89,9 +89,8 @@ playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1) - for(var/mob/living/carbon/human/M in viewers(get_turf(holder.my_atom), null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) + for(var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null)) + C.flash_eyes() for(var/i = 1, i <= 5, i++) var/chosen = pick(critters) @@ -127,9 +126,8 @@ playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1) - for(var/mob/living/carbon/human/M in viewers(get_turf(holder.my_atom), null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) + for(var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null)) + C.flash_eyes() var/chosen = pick(critters) var/mob/living/simple_animal/hostile/C = new chosen @@ -153,9 +151,8 @@ playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1) - for(var/mob/living/carbon/human/M in viewers(get_turf(holder.my_atom), null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) + for(var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null)) + C.flash_eyes() for(var/i = 1, i <= 4 + rand(1,2), i++) var/chosen = pick(borks) @@ -181,9 +178,8 @@ playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1) - for(var/mob/living/carbon/human/M in viewers(get_turf(holder.my_atom), null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) + for(var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null)) + C.flash_eyes() for(var/i = 1, i <= 4 + rand(1,2), i++) var/chosen = pick(borks) diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index a7a0f1bba7a..5978c615942 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -120,8 +120,8 @@ var/datum/reagent/B if(istype(T,/mob/living/carbon/human)) var/mob/living/carbon/human/H = T - if(H.species && H.species.exotic_blood && H.reagents.total_volume) - H.reagents.trans_to(src,amount) + if(H.species && H.species.exotic_blood && H.vessel.total_volume) + H.vessel.trans_to(src,amount) else B = T.take_blood(src,amount) else @@ -136,6 +136,8 @@ user << "\blue You take a blood sample from [target]" for(var/mob/O in viewers(4, user)) O.show_message("\red [user] takes a blood sample from [target].", 1) + else + user.visible_message("[user] takes a sample from [target].", "You take a sample from [target].") else //if not mob if(!target.reagents.total_volume) diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index 1bb531051d0..7d88f65af04 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -49,12 +49,12 @@ var/list/temp_list if(!id_with_upload.len) temp_list = list() - temp_list = text2list(id_with_upload_string, ";") + temp_list = splittext(id_with_upload_string, ";") for(var/N in temp_list) id_with_upload += text2num(N) if(!id_with_download.len) temp_list = list() - temp_list = text2list(id_with_download_string, ";") + temp_list = splittext(id_with_download_string, ";") for(var/N in temp_list) id_with_download += text2num(N) diff --git a/code/modules/research/xenoarchaeology/finds/finds_talkingitem.dm b/code/modules/research/xenoarchaeology/finds/finds_talkingitem.dm index 65a2e24ca08..4a8c9be2a89 100644 --- a/code/modules/research/xenoarchaeology/finds/finds_talkingitem.dm +++ b/code/modules/research/xenoarchaeology/finds/finds_talkingitem.dm @@ -40,7 +40,7 @@ /*var/l = lentext(msg) if(findtext(msg," ",l,l+1)==0) msg+=" "*/ - seperate = text2list(msg, " ") + seperate = splittext(msg, " ") for(var/Xa = 1,Xa Locates an element/substring inside of a list or string @@ -180,21 +180,20 @@ interpreter.SetProc("shuffle", /proc/shuffle) interpreter.SetProc("uniquevector", /proc/uniquelist) - interpreter.SetProc("text2vector", /proc/text2list) - interpreter.SetProc("text2vectorEx",/proc/text2listEx) - interpreter.SetProc("vector2text", /proc/list2text) + interpreter.SetProc("text2vector", /proc/n_splittext) + interpreter.SetProc("vector2text", /proc/n_jointext) // Donkie~ // Strings interpreter.SetProc("lower", /proc/n_lower) interpreter.SetProc("upper", /proc/n_upper) interpreter.SetProc("explode", /proc/string_explode) - interpreter.SetProc("implode", /proc/list2text) + interpreter.SetProc("implode", /proc/n_jointext) interpreter.SetProc("repeat", /proc/n_repeat) interpreter.SetProc("reverse", /proc/reverse_text) interpreter.SetProc("tonum", /proc/n_str2num) interpreter.SetProc("capitalize", /proc/capitalize) - interpreter.SetProc("replacetextEx",/proc/replacetextEx) + interpreter.SetProc("replacetextEx",/proc/n_replacetextEx) // Numbers interpreter.SetProc("tostring", /proc/n_num2str) diff --git a/code/modules/scripting/Implementations/_Logic.dm b/code/modules/scripting/Implementations/_Logic.dm index c71839eaad9..a97fc320e0e 100644 --- a/code/modules/scripting/Implementations/_Logic.dm +++ b/code/modules/scripting/Implementations/_Logic.dm @@ -167,12 +167,12 @@ proc/string_explode(var/string, var/separator = "") //writepanic("[__FILE__].[__LINE__] \\/proc/string_explode() called tick#: [world.time]") if(istext(string) && (istext(separator) || isnull(separator))) - return text2list(string, separator) + return splittext(string, separator) //Converts a list to a string /proc/list_implode(var/list/li, var/separator) if(istype(li) && (istext(separator) || isnull(separator))) - return list2text(li, separator) + return jointext(li, separator) proc/n_repeat(var/string, var/amount) //writepanic("[__FILE__].[__LINE__] \\/proc/n_repeat() called tick#: [world.time]") @@ -260,4 +260,16 @@ proc/n_round(var/num) /proc/n_log(var/num) if(isnum(num) && 0 < num) - return log(num) \ No newline at end of file + return log(num) + +/proc/n_replacetext(text, r, with) + return replacetext(text, r, with) + +/proc/n_replacetextEx(text, r, with) + return replacetextEx(text, r, with) + +/proc/n_jointext(list, glue) + return jointext(list, glue) + +/proc/n_splittext(text, delim) + return splittext(text, delim) \ No newline at end of file diff --git a/code/modules/space_transition/space_transition.dm b/code/modules/space_transition/space_transition.dm index 81be4604193..fe63154b017 100644 --- a/code/modules/space_transition/space_transition.dm +++ b/code/modules/space_transition/space_transition.dm @@ -87,7 +87,7 @@ var/list/z_levels_list = list() var/datum/space_level/D var/list/config_settings[SLS.len][] for(var/A in SLS) - config_settings[SLS.Find(A)] = text2list(A, ";") + config_settings[SLS.Find(A)] = splittext(A, ";") var/conf_set_len = SLS.len SLS.Cut() for(var/A in config_settings) diff --git a/code/modules/surgery/organs/augments_eyes.dm b/code/modules/surgery/organs/augments_eyes.dm index 622891a4b70..a6fdf24d715 100644 --- a/code/modules/surgery/organs/augments_eyes.dm +++ b/code/modules/surgery/organs/augments_eyes.dm @@ -60,7 +60,7 @@ if(prob(10 * severity)) return owner << "Static obfuscates your vision!" - flick("e_flash", owner.flash) + owner.flash_eyes(visual = 1) diff --git a/code/modules/surgery/organs/pain.dm b/code/modules/surgery/organs/pain.dm index d1aac66a71c..333c314aa48 100644 --- a/code/modules/surgery/organs/pain.dm +++ b/code/modules/surgery/organs/pain.dm @@ -1,6 +1,3 @@ -mob/proc/flash_pain() - flick("pain",pain) - mob/var/list/pain_stored = list() mob/var/last_pain_message = "" mob/var/next_pain_time = 0 @@ -30,20 +27,16 @@ mob/living/carbon/proc/pain(var/partname, var/amount, var/force, var/burning = 0 if(1 to 10) msg = "\red Your [partname] burns." if(11 to 90) - flash_weak_pain() msg = "\red Your [partname] burns badly!" if(91 to 10000) - flash_pain() msg = "\red OH GOD! Your [partname] is on fire!" else switch(amount) if(1 to 10) msg = "Your [partname] hurts." if(11 to 90) - flash_weak_pain() msg = "Your [partname] hurts badly." if(91 to 10000) - flash_pain() msg = "OH GOD! Your [partname] is hurting terribly!" if(msg && (msg != last_pain_message || prob(10))) last_pain_message = msg diff --git a/code/world.dm b/code/world.dm index 899a3ca1b3a..dfb3094a314 100644 --- a/code/world.dm +++ b/code/world.dm @@ -399,7 +399,7 @@ var/world_topic_spam_protect_time = world.timeofday // features += "hosted by [config.hostedby]" if (features) - s += ": [list2text(features, ", ")]" + s += ": [jointext(features, ", ")]" /* does this help? I do not know */ if (src.status != s) diff --git a/config/example/config.txt b/config/example/config.txt index e7eaed2443a..e2061b48652 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -302,9 +302,6 @@ PLAYER_REROUTE_CAP 0 ## Disable the loading of away missions #DISABLE_AWAY_MISSIONS -## Uncomment this if you still use the old .sav file based notes system and haven't used the mass conversion proc -#AUTOCONVERT_NOTES - ## Uncomment to disable the OOC/LOOC channel by default. #DISABLE_OOC diff --git a/html/changelogs/AutoChangeLog-pr-4072.yml b/html/changelogs/AutoChangeLog-pr-4072.yml new file mode 100644 index 00000000000..0f230a8fa0a --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-4072.yml @@ -0,0 +1,4 @@ +author: Crazylemon64 +delete-after: True +changes: + - bugfix: "Syringes will now draw water from slime people." diff --git a/icons/mob/screen1_full.dmi b/icons/mob/screen1_full.dmi deleted file mode 100644 index d660f369ba0..00000000000 Binary files a/icons/mob/screen1_full.dmi and /dev/null differ diff --git a/icons/mob/screen_full.dmi b/icons/mob/screen_full.dmi new file mode 100644 index 00000000000..e84b0546950 Binary files /dev/null and b/icons/mob/screen_full.dmi differ diff --git a/icons/mob/screen_gen.dmi b/icons/mob/screen_gen.dmi index 431f1df9ddb..a97f1abc5a0 100644 Binary files a/icons/mob/screen_gen.dmi and b/icons/mob/screen_gen.dmi differ diff --git a/paradise.dme b/paradise.dme index 8de21296428..986b83d97b3 100644 --- a/paradise.dme +++ b/paradise.dme @@ -18,7 +18,6 @@ #include "code\__DEFINES\admin.dm" #include "code\__DEFINES\atmospherics.dm" #include "code\__DEFINES\bots.dm" -#include "code\__DEFINES\btime.dm" #include "code\__DEFINES\clothing.dm" #include "code\__DEFINES\combat.dm" #include "code\__DEFINES\flags.dm" @@ -60,7 +59,6 @@ #include "code\__HELPERS\timed_alerts.dm" #include "code\__HELPERS\type2type.dm" #include "code\__HELPERS\unsorted.dm" -#include "code\__HELPERS\bygex\bygex.dm" #include "code\_DATASTRUCTURES\heap.dm" #include "code\_DATASTRUCTURES\linked_lists.dm" #include "code\_DATASTRUCTURES\priority_queue.dm" @@ -83,6 +81,7 @@ #include "code\_hooks\area.dm" #include "code\_hooks\hooks.dm" #include "code\_hooks\mob.dm" +#include "code\_onclick\_defines.dm" #include "code\_onclick\adjacent.dm" #include "code\_onclick\ai.dm" #include "code\_onclick\click.dm" @@ -101,6 +100,7 @@ #include "code\_onclick\hud\alien.dm" #include "code\_onclick\hud\alien_larva.dm" #include "code\_onclick\hud\bot.dm" +#include "code\_onclick\hud\fullscreen.dm" #include "code\_onclick\hud\hud.dm" #include "code\_onclick\hud\human.dm" #include "code\_onclick\hud\monkey.dm" @@ -174,7 +174,6 @@ #include "code\controllers\Processes\ticker.dm" #include "code\controllers\Processes\timer.dm" #include "code\controllers\Processes\vote.dm" -#include "code\controllers\ProcessScheduler\core\_stubs.dm" #include "code\controllers\ProcessScheduler\core\process.dm" #include "code\controllers\ProcessScheduler\core\processScheduler.dm" #include "code\datums\ai_law_sets.dm" @@ -1372,6 +1371,7 @@ #include "code\modules\mob\dead\observer\spells.dm" #include "code\modules\mob\living\autohiss.dm" #include "code\modules\mob\living\damage_procs.dm" +#include "code\modules\mob\living\death.dm" #include "code\modules\mob\living\default_language.dm" #include "code\modules\mob\living\life.dm" #include "code\modules\mob\living\living.dm"