diff --git a/DMCompiler/DMStandard/Types/Atoms/Movable.dm b/DMCompiler/DMStandard/Types/Atoms/Movable.dm index 115a670a20..e37d3ef7ee 100644 --- a/DMCompiler/DMStandard/Types/Atoms/Movable.dm +++ b/DMCompiler/DMStandard/Types/Atoms/Movable.dm @@ -17,7 +17,7 @@ proc/Bump(atom/Obstacle) - proc/Move(atom/NewLoc, Dir=0) as num + proc/Move(atom/NewLoc, Dir=0 as num) if (isnull(NewLoc) || loc == NewLoc) return FALSE @@ -57,5 +57,4 @@ newarea.Entered(src, oldloc) return TRUE - else - return FALSE + return FALSE diff --git a/DMCompiler/DMStandard/Types/Atoms/_Atom.dm b/DMCompiler/DMStandard/Types/Atoms/_Atom.dm index f7faeb029c..96699f6bbc 100644 --- a/DMCompiler/DMStandard/Types/Atoms/_Atom.dm +++ b/DMCompiler/DMStandard/Types/Atoms/_Atom.dm @@ -29,7 +29,10 @@ var/layer = 2.0 as num var/plane = 0 as num var/alpha = 255 as num - var/color = "#FFFFFF" + // currently we coerce text (hex string) and list(num) (color matrix) to the color type + // in the future this should probably be colorstring|colormatrix|null or something + // or 'as color' could be a shorthand for that + var/color = "#FFFFFF" as color|null var/invisibility = 0 as num var/mouse_opacity = 1 as num var/infra_luminosity = 0 as num|opendream_unimplemented diff --git a/DMCompiler/DMStandard/Types/Client.dm b/DMCompiler/DMStandard/Types/Client.dm index 1fe990f7ad..b0856ad03d 100644 --- a/DMCompiler/DMStandard/Types/Client.dm +++ b/DMCompiler/DMStandard/Types/Client.dm @@ -88,7 +88,7 @@ proc/MeasureText(text, style, width=0) set opendream_unimplemented = TRUE - proc/Move(loc, dir) + proc/Move(loc, dir as num) mob.Move(loc, dir) proc/North() diff --git a/DMCompiler/DMStandard/Types/World.dm b/DMCompiler/DMStandard/Types/World.dm index d2a62f31b9..61a41d0b72 100644 --- a/DMCompiler/DMStandard/Types/World.dm +++ b/DMCompiler/DMStandard/Types/World.dm @@ -9,15 +9,15 @@ var/mob = /mob as path(/mob) var/name = "OpenDream World" - var/time - var/timezone = 0 - var/timeofday - var/realtime - var/tick_lag = 1 - var/cpu = 0 as opendream_unimplemented - var/fps = 10 + var/time as num + var/timezone = 0 as num + var/timeofday as num + var/realtime as num + var/tick_lag = 1 as num + var/cpu = 0 as opendream_unimplemented|num + var/fps = 10 as num var/tick_usage - var/loop_checks = 0 as opendream_unimplemented + var/loop_checks = 0 as opendream_unimplemented|num var/maxx = null as num|null var/maxy = null as num|null @@ -32,7 +32,7 @@ var/version = 0 as opendream_unimplemented var/address - var/port = 0 as opendream_compiletimereadonly + var/port = 0 as opendream_compiletimereadonly|num var/internet_address = "127.0.0.1" as opendream_unimplemented var/url as opendream_unimplemented var/visibility = 0 as opendream_unimplemented @@ -40,7 +40,7 @@ var/process var/list/params = null - var/sleep_offline = 0 + var/sleep_offline = 0 as num var/system_type diff --git a/DMCompiler/DMStandard/_Standard.dm b/DMCompiler/DMStandard/_Standard.dm index 164b2977f7..865c984ab5 100644 --- a/DMCompiler/DMStandard/_Standard.dm +++ b/DMCompiler/DMStandard/_Standard.dm @@ -75,7 +75,7 @@ proc/range(Dist, Center) as /list|null // NOTE: Not sure if return types have BY proc/ref(Object) as text proc/replacetext(Haystack as text|null, Needle as text|/regex|null, Replacement, Start = 1, End = 0) as text|null proc/replacetextEx(Haystack as text|null, Needle as text|/regex|null, Replacement, Start = 1, End = 0) as text|null -proc/rgb(R, G, B, A, space) as text|null +proc/rgb(R, G, B, A, space) as color|null proc/rgb2num(color, space = COLORSPACE_RGB) as /list proc/roll(ndice = 1 as num|text, sides as num|null) as num proc/round(A as num|null, B as num|null) as num @@ -100,8 +100,8 @@ proc/text2path(T as text|null) as null|path(/datum)|path(/world) // todo: allow proc/time2text(timestamp, format) as text proc/trimtext(Text) as text|null proc/trunc(n as num|null) as num -proc/turn(Dir, Angle) -proc/typesof(Item1) as /list +proc/turn(Dir as null|num|/matrix|icon, Angle as num) as null|num|/matrix|icon +proc/typesof(Item1 as text|path(/datum)|path(/proc)|/list(text|path(/datum)|path(/proc))) as /list(path(/datum)|path(/proc)) proc/uppertext(T as text) as text proc/url_decode(UrlText) as text proc/url_encode(PlainText, format = 0) as text @@ -157,7 +157,7 @@ proc/replacetextEx_char(Haystack as text, Needle, Replacement, Start = 1 as num, //TODO: Consider obstacles var/dist = get_dist(Ref, Trg) - if (dist <= Min) return + if (dist <= Min) return 0 var/step_dir = get_dir(Ref, Trg) as num return step(Ref, step_dir, Speed) @@ -166,7 +166,7 @@ proc/replacetextEx_char(Haystack as text, Needle, Replacement, Start = 1 as num, set opendream_unimplemented = TRUE CRASH("/get_step_to() is not implemented") -/proc/get_steps_to(Ref, Trg, Min=0 as num) as /list +/proc/get_steps_to(Ref, Trg, Min=0 as num) set opendream_unimplemented = TRUE CRASH("/get_steps_to() is not implemented") @@ -208,9 +208,7 @@ proc/step_rand(atom/movable/Ref, Speed=0) proc/jointext(list/List as /list|text, Glue as text|null, Start = 1 as num, End = 0 as num) as text if(islist(List)) return List.Join(Glue, Start, End) - if(istext(List)) - return List - CRASH("jointext was passed a non-list, non-text value") + return List proc/lentext(T) as num return length(T)