Modified TK to be more effective and polished. You can use the TK grab to interact with machines and stuff from far away (but you cannot pick them up!). This means you can also bonk people with items you are holding with your TK grab.

Changed the energy gun sprites to a better-looking version, made by Khodoque!

More work on NTSL. Including the ability to create comments by using // and /* insert comment here */.

Removed the traffic control machine from telecomms, as requested by Urist. NTSL is still a work in progress, and needs to be completely fool-proof before players can get anywhere near it.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3252 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
vageyenaman@gmail.com
2012-03-04 21:41:51 +00:00
parent 6bb33ff412
commit d5bff25b5b
14 changed files with 2001 additions and 1899 deletions

View File

@@ -52,6 +52,10 @@
message+="[id]'. "
if(T)message+="Found '[T.value]'."
UnterminatedComment
message="Unterminated multi-line comment statement: expected */"
DuplicateFunction
New(name, token/t)
message="Function '[name]' defined twice."

View File

@@ -59,6 +59,10 @@
line = 1
linepos = 0 //column=codepos-linepos
n_scriptOptions/nS_Options/options
commenting = 0
// 1: single-line
// 2: multi-line
list
/*
Variable: ignore
@@ -112,12 +116,16 @@
Scan() //Creates a list of tokens from source code
var/list/tokens=new
for(, src.codepos<=lentext(code), src.codepos++)
var/char=copytext(code, codepos, codepos+1)
if(char=="\n")
line++
linepos=codepos
if(ignore.Find(char))
continue
else if(char == "/")
ReadComment()
else if(end_stmt.Find(char))
tokens+=new /token/end(char, line, COL)
else if(string_delim.Find(char))
@@ -129,6 +137,8 @@
tokens+=ReadNumber()
else if(options.symbols.Find(char))
tokens+=ReadSymbol()
codepos=initial(codepos)
line=initial(line)
linepos=initial(linepos)
@@ -228,4 +238,50 @@
errors+=new/scriptError("Bad number: ", T)
T.value=0
codepos-- //allow main Scan() proc to read the next character
return T
return T
/*
Proc: ReadComment
Reads a comment and outputs the type of comment
*/
ReadComment()
var
char=copytext(code, codepos, codepos+1)
nextchar=copytext(code, codepos+1, codepos+2)
charstring = char+nextchar
comm = 1
// 1: single-line comment
// 2: multi-line comment
expectedend = 0
if(charstring == "//" || charstring == "/*")
if(charstring == "/*")
comm = 2 // starts a multi-line comment
while(comm)
if(++codepos>lentext(code)) break
if(expectedend) // ending statement expected...
char = copytext(code, codepos, codepos+1)
if(char == "/") // ending statement found - beak the comment
comm = 0
break
if(comm == 2)
// multi-line comments are broken by ending statements
char = copytext(code, codepos, codepos+1)
if(char == "*")
expectedend = 1
continue
else
char = copytext(code, codepos, codepos+1)
if(char == "\n")
comm = 0
break
if(expectedend) expectedend = 0
if(comm == 2)
errors+=new/scriptError/UnterminatedComment()