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

+97
View File
@@ -0,0 +1,97 @@
// Arithmetic and precedence
assert((3 + 2) == 5);
assert((10 - 4) == 6);
assert((6 * 7) == 42);
assert((10 / 4) == 2.5);
assert((7 % 3) == 1);
assert((-7 % 3) == -1);
assert((7.5 % 2) == 1.5);
assert((2 + 3 * 4) == 14);
assert(((2 + 3) * 4) == 20);
assert((10 - 2 - 3) == 5);
assert((100 / 10 / 5) == 2);
assert((1.5 + 2.25) == 3.75);
assert((0.5 * 4) == 2);
assert(-5 + 5 == 0);
var n = 5;
assert(-n == -5);
assert(-(-n) == 5);
assert((n - -3) == 8);
// Bitwise
assert((5 & 3) == 1);
assert((5 | 3) == 7);
assert((5 ^ 3) == 6);
assert(~5 == -6);
assert(~0 == -1);
assert((1 << 4) == 16);
assert((256 >> 4) == 16);
assert((-8 >> 1) == -4);
assert((1 << 32) == 0);
assert((255 & 15) == 15);
assert((1 | 2 | 4 | 8) == 15);
assert((6 & 3 | 8) == 10);
// Comparison
assert(1 < 2);
assert(!(2 < 1));
assert(2 > 1);
assert(2 <= 2);
assert(2 >= 2);
assert(!(2 < 2));
assert(-1 < 0);
assert(1 != 2);
assert(!(1 != 1));
assert(1 == 1);
assert(1.0 == 1);
assert(0.5 < 0.75);
// Compound assignment
var x = 10;
x += 5;
assert(x == 15);
x -= 3;
assert(x == 12);
x *= 2;
assert(x == 24);
x /= 4;
assert(x == 6);
x %= 4;
assert(x == 2);
x <<= 3;
assert(x == 16);
x >>= 2;
assert(x == 4);
x |= 3;
assert(x == 7);
x &= 5;
assert(x == 5);
x ^= 1;
assert(x == 4);
// Increment and decrement, prefix and postfix
var i = 0;
assert(i++ == 0);
assert(i == 1);
assert(++i == 2);
assert(i == 2);
assert(i-- == 2);
assert(i == 1);
assert(--i == 0);
// Increment of elements and members
var arr = [1, 2, 3];
arr[1]++;
assert(arr[1] == 3);
--arr[0];
assert(arr[0] == 0);
var s = {count: 5};
s.count++;
assert(s.count == 6);
s["count"] += 4;
assert(s.count == 10);
// Large and small values stay numbers
assert(1000000 + 1 == 1000001);
assert(0 == -0);
assert(0.25 * 4 == 1);