mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 23:23:28 +01:00
Merge remote-tracking branch 'upstream/master' into tgport-16569
Conflicts: .gitignore
This commit is contained in:
+2
-1
@@ -16,4 +16,5 @@ data/
|
||||
/_maps/map_files/**/*.dmm.backup
|
||||
/nano/debug.html
|
||||
*.db
|
||||
.atom-build.json
|
||||
stddef.dm
|
||||
.atom-build.json
|
||||
|
||||
+2
-2
@@ -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"
|
||||
|
||||
Binary file not shown.
@@ -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
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>
|
||||
|
||||
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<font color='red'>[error]</font>"
|
||||
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
|
||||
@@ -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()
|
||||
@@ -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])
|
||||
|
||||
+22
-4
@@ -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)
|
||||
|
||||
return month_names.Find(month)
|
||||
+4
-151
@@ -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)
|
||||
return matrix(a, b, c, d, e, f)
|
||||
|
||||
@@ -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
|
||||
return matches
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
#define CLICKCATCHER_PLANE -99
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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]]"
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]"
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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,"<")
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.")
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 << "<span class='notice'>You start to slice away at \the [src]...</span>"
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
WT.eyecheck(user)
|
||||
busy = 1
|
||||
if(do_after(user, 50, target = src))
|
||||
busy = 0
|
||||
|
||||
@@ -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)
|
||||
prev_turf = get_turf(src)
|
||||
|
||||
@@ -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 << "<span class='notice'>You start to weld the [src]..</span>"
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
WT.eyecheck(user)
|
||||
busy = 1
|
||||
if(do_after(user, 20, target = src))
|
||||
busy = 0
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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("<span class='disarm'><b>[O]</b> gasps and shields their eyes!</span>")
|
||||
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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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.")
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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("<span class='disarm'>[user] blinds [M] with the [src.name]!</span>")
|
||||
if(M.weakeyes)
|
||||
M.Stun(2)
|
||||
M.visible_message("<span class='disarm'><b>[M]</b> gasps and shields their eyes!</span>")
|
||||
return 1
|
||||
else
|
||||
if(user)
|
||||
user.visible_message("<span class='disarm'>[user] blinds [M] with the [src.name]!</span>")
|
||||
else
|
||||
user.visible_message("<span class='disarm'>[user] fails to blind [M] with the [src.name]!</span>")
|
||||
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("<span class='disarm'>[user] tries to overloads [M]'s sensors with the [src.name], but if blocked by [M]'s shield!</span>", "<span class='danger'>You try to overload [M]'s sensors with the [src.name], but are blocked by his shield!</span>")
|
||||
return 1
|
||||
M.Weaken(rand(5,10))
|
||||
add_logs(M, user, "flashed", object="[src.name]")
|
||||
user.visible_message("<span class='disarm'>[user] overloads [M]'s sensors with the [src.name]!</span>", "<span class='danger'>You overload [M]'s sensors with the [src.name]!</span>")
|
||||
if(M.flash_eyes(affect_silicon = 1))
|
||||
M.Weaken(rand(5,10))
|
||||
user.visible_message("<span class='disarm'>[user] overloads [M]'s sensors with the [src.name]!</span>", "<span class='danger'>You overload [M]'s sensors with the [src.name]!</span>")
|
||||
return 1
|
||||
|
||||
user.visible_message("<span class='disarm'>[user] fails to blind [M] with the [src.name]!</span>", "<span class='warning'>You fail to blind [M] with the [src.name]!</span>")
|
||||
|
||||
@@ -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("<span class='notice'>[M] directs [src] to \his eyes.</span>", \
|
||||
"<span class='notice'>You wave the light in front of your eyes! Trippy!</span>")
|
||||
else
|
||||
M.visible_message("<span class='notice'>[M] directs [src] to \his eyes.</span>", \
|
||||
"<span class='notice'>You wave the light in front of your eyes.</span>")
|
||||
return
|
||||
else
|
||||
|
||||
user.visible_message("<span class='notice'>[user] directs [src] to [M]'s eyes.</span>", \
|
||||
"<span class='notice'>You direct [src] to [M]'s eyes.</span>")
|
||||
user.visible_message("<span class='notice'>[user] directs [src] to [M]'s eyes.</span>", \
|
||||
"<span class='notice'>You direct [src] to [M]'s eyes.</span>")
|
||||
|
||||
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 << "<span class='notice'>[M] pupils does not react to the light!</span>"
|
||||
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 << "<span class='notice'>[M] pupils give an eerie glow!</span>"
|
||||
else //they're okay!
|
||||
if(!M.blinded)
|
||||
flick("flash", M.flash) //flash the affected mob
|
||||
user << "<span class='notice'>[M]'s pupils narrow.</span>"
|
||||
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 << "<span class='notice'>[M] pupils does not react to the light!</span>"
|
||||
else if(XRAY in M.mutations) //mob has X-RAY vision
|
||||
user << "<span class='notice'>[M] pupils give an eerie glow!</span>"
|
||||
else //they're okay!
|
||||
if(M.flash_eyes(visual = 1))
|
||||
user << "<span class='notice'>[M]'s pupils narrow.</span>"
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -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 = "<span class='notice'>You blind [C] by shining [src] in their eyes.</span>"
|
||||
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 << "<span class='info'>A small, bright dot appears in your vision.</span>"
|
||||
if(1)
|
||||
//industrial grade eye protection
|
||||
E.damage += rand(0, 2)
|
||||
C << "<span class='notice'>Something bright flashes in the corner of your vision!</span>"
|
||||
if(2)
|
||||
//basic eye protection (sunglasses)
|
||||
flick("flash", C.flash)
|
||||
E.damage += rand(1, 6)
|
||||
C << "<span class='danger'>Your eyes were blinded!</span>"
|
||||
if(3)
|
||||
//no eye protection
|
||||
if(prob(2))
|
||||
C.Weaken(1)
|
||||
flick("e_flash", C.flash)
|
||||
E.damage += rand(3, 7)
|
||||
C << "<span class='danger'>Your eyes were blinded!</span>"
|
||||
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 << "<span class='danger'>Your eyes were blinded!</span>"
|
||||
else
|
||||
outmsg = "<span class='notice'>You fail to blind [C] by shining [src] at their eyes.</span>"
|
||||
outmsg = "<span class='warning'>You fail to blind [C] by shining [src] at their eyes!</span>"
|
||||
|
||||
//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 << "<span class='warning'>Your sensors were overloaded by a laser!</span>"
|
||||
outmsg = "<span class='notice'>You overload [S] by shining [src] at their sensors.</span>"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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("<span class='disarm'><b>[M]</b> screams and collapses!</span>")
|
||||
M << "<span class='userdanger'>AAAAGH! IT BURNS!</span>"
|
||||
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 << "<span class='warning'>Your eyes start to burn badly!</span>"
|
||||
else
|
||||
M << "<span class='warning'>The flash blinds you!</span>"
|
||||
if(!banglet)
|
||||
if (E.damage >= E.min_broken_damage)
|
||||
M << "<span class='warning'>You can't see anything!</span>"
|
||||
|
||||
//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 << "<span class='warning'>Your ears start to ring badly!</span>"
|
||||
if(!banglet)
|
||||
if(prob(M.ear_damage - 10 + 5))
|
||||
M << "<span class='warning'>You can't hear anything!</span>"
|
||||
M.disabilities |= DEAF
|
||||
if(prob(M.ear_damage - 10 + 5))
|
||||
M << "<span class='warning'>You can't hear anything!</span>"
|
||||
M.disabilities |= DEAF
|
||||
else
|
||||
if (M.ear_damage >= 5)
|
||||
M << "<span class='warning'>Your ears start to ring!</span>"
|
||||
@@ -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
|
||||
|
||||
@@ -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 << "<span class='danger'>Your eyes sting a little.</span>"
|
||||
E.damage += rand(1, 2)
|
||||
if(E.damage > 12)
|
||||
user.eye_blurry += rand(3,6)
|
||||
if(0)
|
||||
usr << "<span class='danger'>Your eyes burn.</span>"
|
||||
E.damage += rand(2, 4)
|
||||
if(E.damage > 10)
|
||||
E.damage += rand(4,10)
|
||||
if(-1)
|
||||
usr << "<span class='danger'>Your thermals intensify the welder's glow. Your eyes itch and burn severely.</span>"
|
||||
user.eye_blurry += rand(12,20)
|
||||
E.damage += rand(12, 16)
|
||||
if(safety<2)
|
||||
if(E.damage > 10)
|
||||
user << "<span class='danger'>Your eyes are really starting to hurt. This can't be good for you!</span>"
|
||||
if (E.damage >= E.min_broken_damage)
|
||||
user << "<span class='danger'>You go blind!</span>"
|
||||
user.sdisabilities |= BLIND
|
||||
else if (E.damage >= E.min_bruised_damage)
|
||||
user << "<span class='danger'>You go blind!</span>"
|
||||
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 << "<span class='warning'>Turn it off first!</span>"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -58,9 +58,9 @@ var/global/nologevent = 0
|
||||
body += "<b>Mob type:</b> [M.type]<br>"
|
||||
if(M.client)
|
||||
if(M.client.related_accounts_cid.len)
|
||||
body += "<b>Related accounts by CID:</b> [list2text(M.client.related_accounts_cid, " - ")]<br>"
|
||||
body += "<b>Related accounts by CID:</b> [jointext(M.client.related_accounts_cid, " - ")]<br>"
|
||||
if(M.client.related_accounts_ip.len)
|
||||
body += "<b>Related accounts by IP:</b> [list2text(M.client.related_accounts_ip, " - ")]<br><br>"
|
||||
body += "<b>Related accounts by IP:</b> [jointext(M.client.related_accounts_ip, " - ")]<br><br>"
|
||||
|
||||
body += "<A href='?_src_=holder;boot2=\ref[M]'>Kick</A> | "
|
||||
body += "<A href='?_src_=holder;warn=[M.ckey]'>Warn</A> | "
|
||||
|
||||
@@ -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 "-"
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -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]\"")
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]\"")
|
||||
|
||||
|
||||
@@ -177,73 +177,7 @@
|
||||
output += "<center><a href='?_src_=holder;addnoteempty=1'>\[Add Note\]</a></center>"
|
||||
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")
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
log_admin("[key_name(usr)] has edited [ckey]'s sticky ban reason from [oldreason] to [reason]")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has edited [ckey]'s sticky ban reason from [oldreason] to [reason]</span>")
|
||||
|
||||
|
||||
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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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--)
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
dat += "<p>[C.ckey] (Player Age: <font color = 'red'>[C.player_age]</font>) - <b>[C.computer_id]</b> / <b>[C.address]</b><br>"
|
||||
if(C.related_accounts_cid.len)
|
||||
dat += "--Accounts associated with CID: "
|
||||
dat += "<b>[list2text(C.related_accounts_cid, " - ")]</b><br>"
|
||||
dat += "<b>[jointext(C.related_accounts_cid, " - ")]</b><br>"
|
||||
if(C.related_accounts_ip.len)
|
||||
dat += "--Accounts associated with IP: "
|
||||
dat += "<b>[list2text(C.related_accounts_ip, " - ")]</b> "
|
||||
dat += "<b>[jointext(C.related_accounts_ip, " - ")]</b> "
|
||||
usr << browse(dat, "window=alt_panel;size=640x480")
|
||||
return
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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) == "'")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
var/obj/item/weapon/paper/P = new(get_turf(src))
|
||||
P.name = "paper- 'Scanner Report'"
|
||||
P.info = "<center><font size='6'><B>Scanner Report</B></font></center><HR><BR>"
|
||||
P.info += list2text(log, "<BR>")
|
||||
P.info += jointext(log, "<BR>")
|
||||
P.info += "<HR><B>Notes:</B><BR>"
|
||||
P.info_links = P.info
|
||||
|
||||
|
||||
@@ -428,8 +428,8 @@ var/const/POS_HEADER = {"<html>
|
||||
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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -270,10 +270,10 @@ You've gained <b>[totalkarma]</b> total karma in your time here.<br>"}
|
||||
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 <b>[totalkarma]</b> total karma in your time here.<br>"}
|
||||
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 <b>[totalkarma]</b> total karma in your time here.<br>"}
|
||||
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 <b>[totalkarma]</b> total karma in your time here.<br>"}
|
||||
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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
. += pick(map[min_char])
|
||||
message = copytext(message, min_index + 1)
|
||||
|
||||
return list2text(.)
|
||||
return jointext(., "")
|
||||
|
||||
#undef AUTOHISS_OFF
|
||||
#undef AUTOHISS_BASIC
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/alien/eyecheck()
|
||||
/mob/living/carbon/alien/check_eye_prot()
|
||||
return 2
|
||||
|
||||
/mob/living/carbon/alien/updatehealth()
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<B>[src]</B> lets out a waning guttural screech, green blood bubbling from its maw...", 1)
|
||||
update_canmove()
|
||||
if(client) blind.layer = 0
|
||||
update_icons()
|
||||
|
||||
timeofdeath = worldtime2text()
|
||||
|
||||
@@ -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
|
||||
@@ -7,7 +7,6 @@
|
||||
if(!gibbed)
|
||||
visible_message("<span class='name'>[src]</span> 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)
|
||||
|
||||
@@ -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
|
||||
@@ -36,4 +36,24 @@
|
||||
src << "<span class='danger'>You feel a searing heat in your lungs!</span>"
|
||||
fire_alert = max(fire_alert, 1)
|
||||
else
|
||||
fire_alert = 0
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 << "<span class='warning'>Your eyes sting a little.</span>"
|
||||
if(prob(40)) //waiting on carbon organs
|
||||
E.damage += 1
|
||||
|
||||
if(2)
|
||||
src << "<span class='warning'>Your eyes burn.</span>"
|
||||
E.damage += rand(2, 4)
|
||||
|
||||
else
|
||||
src << "Your eyes itch and burn severely!</span>"
|
||||
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 << "<span class='warning'>Your eyes start to burn badly!</span>"
|
||||
else //snowflake conditions piss me off for the record
|
||||
src << "<span class='warning'>The flash blinds you!</span>"
|
||||
|
||||
else if(E.damage >= E.min_broken_damage)
|
||||
src << "<span class='warning'>You can't see anything!</span>"
|
||||
|
||||
else
|
||||
src << "<span class='warning'>Your eyes are really starting to hurt. This can't be good for you!</span>"
|
||||
return 1
|
||||
|
||||
else if(damage == 0) // just enough protection
|
||||
if(prob(20))
|
||||
src << "<span class='notice'>Something bright flashes in the corner of your vision!</span>"
|
||||
|
||||
/mob/living/carbon/proc/eyecheck()
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/proc/tintcheck()
|
||||
return 0
|
||||
|
||||
@@ -129,7 +129,6 @@
|
||||
|
||||
if(!gibbed)
|
||||
update_canmove()
|
||||
if(client) blind.layer = 0
|
||||
|
||||
timeofdeath = worldtime2text()
|
||||
med_hud_set_health()
|
||||
|
||||
@@ -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()
|
||||
. |= A.GetAccess()
|
||||
|
||||
@@ -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
|
||||
return 1
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user