mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-05 15:02:56 +00:00
Circuits Update One (#6852)
Ports a buuuuunch of circuits from Polaris. Allows metabolic siphons and internal energy siphons to consume power to feed their host. Ports /tg/ circuits too while I'm at it. Increases base size and complexity for circuits. You're all adults. Hopefully. Don't abuse it. Ports the integrated circuit detailer.
This commit is contained in:
@@ -396,6 +396,11 @@ proc/TextPreview(var/string,var/len=40)
|
||||
. += ascii2text(letter)
|
||||
. = jointext(.,null)
|
||||
|
||||
/proc/random_string(length, list/characters)
|
||||
. = ""
|
||||
for(var/i=1, i<=length, i++)
|
||||
. += pick(characters)
|
||||
|
||||
#define starts_with(string, substring) (copytext(string,1,1+length(substring)) == substring)
|
||||
|
||||
#define gender2text(gender) capitalize(gender)
|
||||
@@ -478,7 +483,7 @@ proc/TextPreview(var/string,var/len=40)
|
||||
var/next_backslash = findtext(string, "\\")
|
||||
if(!next_backslash)
|
||||
return string
|
||||
|
||||
|
||||
var/leng = length(string)
|
||||
|
||||
var/next_space = findtext(string, " ", next_backslash + 1)
|
||||
|
||||
@@ -262,3 +262,27 @@ proc/tg_list2text(list/list, glue=",")
|
||||
|
||||
/proc/isLeap(y)
|
||||
return ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
|
||||
|
||||
/proc/strtohex(str)
|
||||
if(!istext(str)||!str)
|
||||
return
|
||||
var/r
|
||||
var/c
|
||||
for(var/i = 1 to length(str))
|
||||
c= text2ascii(str,i)
|
||||
r+= num2hex(c)
|
||||
return r
|
||||
|
||||
// Decodes hex to raw byte string.
|
||||
// If safe=TRUE, returns null on incorrect input strings instead of CRASHing
|
||||
/proc/hextostr(str, safe=FALSE)
|
||||
if(!istext(str)||!str)
|
||||
return
|
||||
var/r
|
||||
var/c
|
||||
for(var/i = 1 to length(str)/2)
|
||||
c = hex2num(copytext(str,i*2-1,i*2+1), safe)
|
||||
if(isnull(c))
|
||||
return null
|
||||
r += ascii2text(c)
|
||||
return r
|
||||
Reference in New Issue
Block a user