Allow script arrays to hold any value type, add script engine tests, archive old rpg code

Remove the per-array type category so arrays can mix types like structs.
Add 13 passing and 125 expected-failure duskscript test fixtures with a
table-driven runner. Also includes the in-progress entity/physics and
archive moves from the working tree.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
YourWishesandClaude Sonnet 5.5 committed 2026-10-14 23:25:26 -05:00
1 parent 5c259e46e2
commit f6b884bf7f
710 files changed
+6172 -27594

No files matched your search

+70
View File
@@ -0,0 +1,70 @@
const LIMIT = 10;
const NAME = "dusk";
const FLAG = true;
const NOTHING = null;
const RATIO = 2.5;
assert(LIMIT == 10);
assert(NAME == "dusk");
assert(FLAG);
assert(isnull(NOTHING));
assert(RATIO * 2 == 5);
assert(LIMIT + 1 == 11);
assert(NAME + "!" == "dusk!");
assert(len(NAME) == 4);
var total = 0;
for(var i = 0; i < LIMIT; i++) total += 1;
assert(total == LIMIT);
// Constant arrays and structs can be read
const LIST = [1, "two", [3, 4], {five: 5}];
assert(len(LIST) == 4);
assert(LIST[0] == 1);
assert(LIST[1] == "two");
assert(LIST[2][1] == 4);
assert(LIST[3].five == 5);
const CONFIG = {name: "cfg", nested: {depth: 2, items: [10, 20]}, on: true};
assert(CONFIG.name == "cfg");
assert(CONFIG.nested.depth == 2);
assert(CONFIG.nested.items[1] == 20);
assert(CONFIG["nested"]["items"][0] == 10);
assert(CONFIG.on);
assert(isundefined(CONFIG.missing));
foreach(var item : LIST) assert(!isundefined(item));
assert(join(map(CONFIG.nested.items, function(v) { return v; }), ",") == "10,20");
assert(indexof(LIST, 1) == 0);
// Constant functions
function helper(n) {
return n + LIMIT;
}
assert(helper(1) == 11);
// Copies of constants can be changed, the constant itself stays as it was
var copy = clone(LIST);
push(copy, "extra");
copy[0] = "changed";
assert(len(copy) == 5 && copy[0] == "changed");
assert(len(LIST) == 4 && LIST[0] == 1);
var deep = deepclone(CONFIG);
deep.name = "other";
deep.nested.items[0] = 99;
assert(CONFIG.name == "cfg");
assert(CONFIG.nested.items[0] == 10);
assert(deep.nested.items[0] == 99);
var fromConst = LIMIT;
fromConst++;
assert(fromConst == 11);
assert(LIMIT == 10);
// A constant in a function that is called more than once
function useName() {
return NAME + "?";
}
assert(useName() == "dusk?");
assert(useName() == "dusk?");
// A constant built from other constants
const DOUBLE = LIMIT * 2;
assert(DOUBLE == 20);
const GREETING = NAME + " " + "engine";
assert(GREETING == "dusk engine");