@almadar/std 16.108.0 → 16.109.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/behaviors/registry/ui/game/2d/organisms/ui-battle-board.orb +213 -125
  2. package/behaviors/registry/ui/game/2d/organisms/ui-fishing-board.orb +2302 -705
  3. package/behaviors/registry/ui/game/2d/organisms/ui-minigolf-board.orb +7872 -1934
  4. package/behaviors/registry/ui/game/2d/organisms/ui-pinball-board.orb +2739 -3050
  5. package/behaviors/registry/ui/game/2d/organisms/ui-roguelike-board.orb +5204 -2967
  6. package/behaviors/registry/ui/game/2d/organisms/ui-sokoban-board.orb +3330 -1619
  7. package/behaviors/registry/ui/game/2d/organisms/ui-space-shmup-board.orb +4637 -4059
  8. package/behaviors/registry/ui/game/2d/organisms/ui-tanks-board.orb +76 -103
  9. package/behaviors/registry/ui/game/2d/organisms/ui-topdown-dungeon-board.orb +4579 -4356
  10. package/behaviors/registry/ui/game/2d/organisms/ui-uncontrolled-battle-board.orb +1164 -2247
  11. package/behaviors/registry/ui/game/2d/organisms/ui-winter-ski-board.orb +4573 -4553
  12. package/behaviors/registry/ui/game/3d/organisms/ui-arcade-board-3d.orb +379 -2
  13. package/behaviors/registry/ui/game/3d/organisms/ui-brick-sandbox-board-3d.orb +168 -1
  14. package/behaviors/registry/ui/game/3d/organisms/ui-city-board-3d.orb +801 -169
  15. package/behaviors/registry/ui/game/3d/organisms/ui-fantasy-town-board-3d.orb +1666 -702
  16. package/behaviors/registry/ui/game/3d/organisms/ui-game-board-3d.orb +1323 -514
  17. package/behaviors/registry/ui/game/3d/organisms/ui-graveyard-board-3d.orb +1186 -384
  18. package/behaviors/registry/ui/game/3d/organisms/ui-hex-strategy-board-3d.orb +342 -170
  19. package/behaviors/registry/ui/game/3d/organisms/ui-holiday-board-3d.orb +509 -3
  20. package/behaviors/registry/ui/game/3d/organisms/ui-market-board-3d.orb +632 -419
  21. package/behaviors/registry/ui/game/3d/organisms/ui-minigolf-board-3d.orb +503 -145
  22. package/behaviors/registry/ui/game/3d/organisms/ui-nature-survival-board-3d.orb +1157 -134
  23. package/behaviors/registry/ui/game/3d/organisms/ui-pirate-board-3d.orb +1203 -383
  24. package/behaviors/registry/ui/game/3d/organisms/ui-platformer-board-3d.orb +1157 -205
  25. package/behaviors/registry/ui/game/3d/organisms/ui-racing-board-3d.orb +656 -565
  26. package/behaviors/registry/ui/game/3d/organisms/ui-skatepark-board-3d.orb +1205 -137
  27. package/behaviors/registry/ui/game/3d/organisms/ui-space-board-3d.orb +1333 -513
  28. package/behaviors/registry/ui/game/3d/organisms/ui-tower-defense-board-3d.orb +332 -7
  29. package/behaviors/registry/ui/game/3d/organisms/ui-toy-track-board-3d.orb +1202 -287
  30. package/dist/behaviors/behaviors-registry.json +282 -273
  31. package/dist/behaviors/registry/ui/game/2d/organisms/ui-battle-board.orb +213 -125
  32. package/dist/behaviors/registry/ui/game/2d/organisms/ui-fishing-board.orb +2302 -705
  33. package/dist/behaviors/registry/ui/game/2d/organisms/ui-minigolf-board.orb +7872 -1934
  34. package/dist/behaviors/registry/ui/game/2d/organisms/ui-pinball-board.orb +2739 -3050
  35. package/dist/behaviors/registry/ui/game/2d/organisms/ui-roguelike-board.orb +5204 -2967
  36. package/dist/behaviors/registry/ui/game/2d/organisms/ui-sokoban-board.orb +3330 -1619
  37. package/dist/behaviors/registry/ui/game/2d/organisms/ui-space-shmup-board.orb +4637 -4059
  38. package/dist/behaviors/registry/ui/game/2d/organisms/ui-tanks-board.orb +76 -103
  39. package/dist/behaviors/registry/ui/game/2d/organisms/ui-topdown-dungeon-board.orb +4579 -4356
  40. package/dist/behaviors/registry/ui/game/2d/organisms/ui-uncontrolled-battle-board.orb +1164 -2247
  41. package/dist/behaviors/registry/ui/game/2d/organisms/ui-winter-ski-board.orb +4573 -4553
  42. package/dist/behaviors/registry/ui/game/3d/organisms/ui-arcade-board-3d.orb +379 -2
  43. package/dist/behaviors/registry/ui/game/3d/organisms/ui-brick-sandbox-board-3d.orb +168 -1
  44. package/dist/behaviors/registry/ui/game/3d/organisms/ui-city-board-3d.orb +801 -169
  45. package/dist/behaviors/registry/ui/game/3d/organisms/ui-fantasy-town-board-3d.orb +1666 -702
  46. package/dist/behaviors/registry/ui/game/3d/organisms/ui-game-board-3d.orb +1323 -514
  47. package/dist/behaviors/registry/ui/game/3d/organisms/ui-graveyard-board-3d.orb +1186 -384
  48. package/dist/behaviors/registry/ui/game/3d/organisms/ui-hex-strategy-board-3d.orb +342 -170
  49. package/dist/behaviors/registry/ui/game/3d/organisms/ui-holiday-board-3d.orb +509 -3
  50. package/dist/behaviors/registry/ui/game/3d/organisms/ui-market-board-3d.orb +632 -419
  51. package/dist/behaviors/registry/ui/game/3d/organisms/ui-minigolf-board-3d.orb +503 -145
  52. package/dist/behaviors/registry/ui/game/3d/organisms/ui-nature-survival-board-3d.orb +1157 -134
  53. package/dist/behaviors/registry/ui/game/3d/organisms/ui-pirate-board-3d.orb +1203 -383
  54. package/dist/behaviors/registry/ui/game/3d/organisms/ui-platformer-board-3d.orb +1157 -205
  55. package/dist/behaviors/registry/ui/game/3d/organisms/ui-racing-board-3d.orb +656 -565
  56. package/dist/behaviors/registry/ui/game/3d/organisms/ui-skatepark-board-3d.orb +1205 -137
  57. package/dist/behaviors/registry/ui/game/3d/organisms/ui-space-board-3d.orb +1333 -513
  58. package/dist/behaviors/registry/ui/game/3d/organisms/ui-tower-defense-board-3d.orb +332 -7
  59. package/dist/behaviors/registry/ui/game/3d/organisms/ui-toy-track-board-3d.orb +1202 -287
  60. package/dist/behaviors-registry.json +282 -273
  61. package/dist/registry/ui/game/2d/organisms/ui-battle-board.orb +213 -125
  62. package/dist/registry/ui/game/2d/organisms/ui-fishing-board.orb +2302 -705
  63. package/dist/registry/ui/game/2d/organisms/ui-minigolf-board.orb +7872 -1934
  64. package/dist/registry/ui/game/2d/organisms/ui-pinball-board.orb +2739 -3050
  65. package/dist/registry/ui/game/2d/organisms/ui-roguelike-board.orb +5204 -2967
  66. package/dist/registry/ui/game/2d/organisms/ui-sokoban-board.orb +3330 -1619
  67. package/dist/registry/ui/game/2d/organisms/ui-space-shmup-board.orb +4637 -4059
  68. package/dist/registry/ui/game/2d/organisms/ui-tanks-board.orb +76 -103
  69. package/dist/registry/ui/game/2d/organisms/ui-topdown-dungeon-board.orb +4579 -4356
  70. package/dist/registry/ui/game/2d/organisms/ui-uncontrolled-battle-board.orb +1164 -2247
  71. package/dist/registry/ui/game/2d/organisms/ui-winter-ski-board.orb +4573 -4553
  72. package/dist/registry/ui/game/3d/organisms/ui-arcade-board-3d.orb +379 -2
  73. package/dist/registry/ui/game/3d/organisms/ui-brick-sandbox-board-3d.orb +168 -1
  74. package/dist/registry/ui/game/3d/organisms/ui-city-board-3d.orb +801 -169
  75. package/dist/registry/ui/game/3d/organisms/ui-fantasy-town-board-3d.orb +1666 -702
  76. package/dist/registry/ui/game/3d/organisms/ui-game-board-3d.orb +1323 -514
  77. package/dist/registry/ui/game/3d/organisms/ui-graveyard-board-3d.orb +1186 -384
  78. package/dist/registry/ui/game/3d/organisms/ui-hex-strategy-board-3d.orb +342 -170
  79. package/dist/registry/ui/game/3d/organisms/ui-holiday-board-3d.orb +509 -3
  80. package/dist/registry/ui/game/3d/organisms/ui-market-board-3d.orb +632 -419
  81. package/dist/registry/ui/game/3d/organisms/ui-minigolf-board-3d.orb +503 -145
  82. package/dist/registry/ui/game/3d/organisms/ui-nature-survival-board-3d.orb +1157 -134
  83. package/dist/registry/ui/game/3d/organisms/ui-pirate-board-3d.orb +1203 -383
  84. package/dist/registry/ui/game/3d/organisms/ui-platformer-board-3d.orb +1157 -205
  85. package/dist/registry/ui/game/3d/organisms/ui-racing-board-3d.orb +656 -565
  86. package/dist/registry/ui/game/3d/organisms/ui-skatepark-board-3d.orb +1205 -137
  87. package/dist/registry/ui/game/3d/organisms/ui-space-board-3d.orb +1333 -513
  88. package/dist/registry/ui/game/3d/organisms/ui-tower-defense-board-3d.orb +332 -7
  89. package/dist/registry/ui/game/3d/organisms/ui-toy-track-board-3d.orb +1202 -287
  90. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "NatureSurvivalBoard3D — 3D wilderness gather-and-craft board: move a survivor, harvest wood/stone, build a camp to win.",
2
+ "description": "NatureSurvivalBoard3D — gather wood/stone before energy runs out; build a camp to win or run out and lose.",
3
3
  "name": "ui-nature-survival-board-3d",
4
4
  "orbitals": [
5
5
  {
@@ -261,6 +261,51 @@
261
261
  "name": "attackTargets",
262
262
  "type": "array"
263
263
  },
264
+ {
265
+ "default": [],
266
+ "items": {
267
+ "properties": {
268
+ "id": {
269
+ "name": "id",
270
+ "required": true,
271
+ "type": "string"
272
+ },
273
+ "message": {
274
+ "name": "message",
275
+ "required": false,
276
+ "type": "string"
277
+ },
278
+ "ttl": {
279
+ "name": "ttl",
280
+ "required": true,
281
+ "type": "number"
282
+ },
283
+ "type": {
284
+ "name": "type",
285
+ "required": true,
286
+ "type": "string"
287
+ },
288
+ "x": {
289
+ "name": "x",
290
+ "required": true,
291
+ "type": "number"
292
+ },
293
+ "y": {
294
+ "name": "y",
295
+ "required": false,
296
+ "type": "number"
297
+ },
298
+ "z": {
299
+ "name": "z",
300
+ "required": false,
301
+ "type": "number"
302
+ }
303
+ },
304
+ "type": "object"
305
+ },
306
+ "name": "fx",
307
+ "type": "array"
308
+ },
264
309
  {
265
310
  "default": 0.0,
266
311
  "name": "wood",
@@ -287,9 +332,15 @@
287
332
  "type": "string",
288
333
  "values": [
289
334
  "none",
290
- "victory"
335
+ "victory",
336
+ "defeat"
291
337
  ]
292
338
  },
339
+ {
340
+ "default": 40.0,
341
+ "name": "energyLeft",
342
+ "type": "number"
343
+ },
293
344
  {
294
345
  "default": 6.0,
295
346
  "name": "gridWidth",
@@ -1469,6 +1520,13 @@
1469
1520
  "tier": "presentation",
1470
1521
  "type": "[NatureSurvivalBoard3DTilesItem]"
1471
1522
  },
1523
+ "turnBudget": {
1524
+ "default": 40.0,
1525
+ "description": "Energy ticks allowed before defeat if the camp is not yet built",
1526
+ "label": "Turn Budget",
1527
+ "tier": "presentation",
1528
+ "type": "number"
1529
+ },
1472
1530
  "unitScale": {
1473
1531
  "default": 1.0,
1474
1532
  "description": "Unit draw-size multiplier",
@@ -1723,7 +1781,19 @@
1723
1781
  "tier": "domain"
1724
1782
  },
1725
1783
  {
1726
- "description": "Resets the board after victory",
1784
+ "description": "Called when the match ends in victory or defeat",
1785
+ "event": "GAME_END",
1786
+ "payloadSchema": [
1787
+ {
1788
+ "name": "result",
1789
+ "type": "string"
1790
+ }
1791
+ ],
1792
+ "scope": "external",
1793
+ "tier": "domain"
1794
+ },
1795
+ {
1796
+ "description": "Resets the board after victory or defeat",
1727
1797
  "event": "PLAY_AGAIN",
1728
1798
  "payloadSchema": [
1729
1799
  {
@@ -1738,7 +1808,9 @@
1738
1808
  "entityContract": {
1739
1809
  "provides": [
1740
1810
  "attackTargets",
1811
+ "energyLeft",
1741
1812
  "features",
1813
+ "fx",
1742
1814
  "gridHeight",
1743
1815
  "gridWidth",
1744
1816
  "movementRange",
@@ -1830,7 +1902,19 @@
1830
1902
  "tier": "domain"
1831
1903
  },
1832
1904
  {
1833
- "description": "Resets the board after victory",
1905
+ "description": "Called when the match ends in victory or defeat",
1906
+ "key": "GAME_END",
1907
+ "name": "Game End",
1908
+ "payloadSchema": [
1909
+ {
1910
+ "name": "result",
1911
+ "type": "string"
1912
+ }
1913
+ ],
1914
+ "tier": "domain"
1915
+ },
1916
+ {
1917
+ "description": "Resets the board after victory or defeat",
1834
1918
  "key": "PLAY_AGAIN",
1835
1919
  "name": "Play Again",
1836
1920
  "payloadSchema": [
@@ -1879,6 +1963,11 @@
1879
1963
  "@entity.attackTargets",
1880
1964
  []
1881
1965
  ],
1966
+ [
1967
+ "set",
1968
+ "@entity.fx",
1969
+ []
1970
+ ],
1882
1971
  [
1883
1972
  "set",
1884
1973
  "@entity.wood",
@@ -1904,6 +1993,11 @@
1904
1993
  "@entity.result",
1905
1994
  "none"
1906
1995
  ],
1996
+ [
1997
+ "set",
1998
+ "@entity.energyLeft",
1999
+ "@config.turnBudget"
2000
+ ],
1907
2001
  [
1908
2002
  "set",
1909
2003
  "@entity.gridWidth",
@@ -1923,9 +2017,29 @@
1923
2017
  "render-ui",
1924
2018
  "main",
1925
2019
  {
2020
+ "addons": {
2021
+ "children": [
2022
+ {
2023
+ "action": "CANCEL",
2024
+ "label": "Cancel",
2025
+ "type": "button",
2026
+ "variant": "secondary"
2027
+ },
2028
+ {
2029
+ "action": "PLAY_AGAIN",
2030
+ "label": "Restart",
2031
+ "type": "button",
2032
+ "variant": "secondary"
2033
+ }
2034
+ ],
2035
+ "direction": "vertical",
2036
+ "gap": "sm",
2037
+ "type": "stack"
2038
+ },
1926
2039
  "children": [
1927
2040
  {
1928
2041
  "attackTargets": "@entity.attackTargets",
2042
+ "events": "@entity.fx",
1929
2043
  "features": "@entity.features",
1930
2044
  "scale": "@config.scale",
1931
2045
  "selectedUnitId": "@entity.selectedUnitId",
@@ -1950,6 +2064,10 @@
1950
2064
  "label": "Stone",
1951
2065
  "value": "@entity.stone"
1952
2066
  },
2067
+ {
2068
+ "label": "Energy",
2069
+ "value": "@entity.energyLeft"
2070
+ },
1953
2071
  {
1954
2072
  "label": "Result",
1955
2073
  "value": "@entity.result"
@@ -1969,6 +2087,38 @@
1969
2087
  "justify": "between",
1970
2088
  "type": "stack"
1971
2089
  },
2090
+ "overlay": [
2091
+ "if",
2092
+ [
2093
+ "!=",
2094
+ "@entity.result",
2095
+ "none"
2096
+ ],
2097
+ {
2098
+ "align": "center",
2099
+ "children": [
2100
+ {
2101
+ "stats": [
2102
+ {
2103
+ "label": "Result",
2104
+ "value": "@entity.result"
2105
+ }
2106
+ ],
2107
+ "type": "game-hud"
2108
+ },
2109
+ {
2110
+ "action": "PLAY_AGAIN",
2111
+ "label": "Play Again",
2112
+ "type": "button",
2113
+ "variant": "primary"
2114
+ }
2115
+ ],
2116
+ "direction": "vertical",
2117
+ "gap": "md",
2118
+ "type": "stack"
2119
+ },
2120
+ null
2121
+ ],
1972
2122
  "type": "game-shell"
1973
2123
  }
1974
2124
  ]
@@ -2094,9 +2244,29 @@
2094
2244
  "render-ui",
2095
2245
  "main",
2096
2246
  {
2247
+ "addons": {
2248
+ "children": [
2249
+ {
2250
+ "action": "CANCEL",
2251
+ "label": "Cancel",
2252
+ "type": "button",
2253
+ "variant": "secondary"
2254
+ },
2255
+ {
2256
+ "action": "PLAY_AGAIN",
2257
+ "label": "Restart",
2258
+ "type": "button",
2259
+ "variant": "secondary"
2260
+ }
2261
+ ],
2262
+ "direction": "vertical",
2263
+ "gap": "sm",
2264
+ "type": "stack"
2265
+ },
2097
2266
  "children": [
2098
2267
  {
2099
2268
  "attackTargets": "@entity.attackTargets",
2269
+ "events": "@entity.fx",
2100
2270
  "features": "@entity.features",
2101
2271
  "scale": "@config.scale",
2102
2272
  "selectedUnitId": "@entity.selectedUnitId",
@@ -2121,6 +2291,10 @@
2121
2291
  "label": "Stone",
2122
2292
  "value": "@entity.stone"
2123
2293
  },
2294
+ {
2295
+ "label": "Energy",
2296
+ "value": "@entity.energyLeft"
2297
+ },
2124
2298
  {
2125
2299
  "label": "Result",
2126
2300
  "value": "@entity.result"
@@ -2140,6 +2314,38 @@
2140
2314
  "justify": "between",
2141
2315
  "type": "stack"
2142
2316
  },
2317
+ "overlay": [
2318
+ "if",
2319
+ [
2320
+ "!=",
2321
+ "@entity.result",
2322
+ "none"
2323
+ ],
2324
+ {
2325
+ "align": "center",
2326
+ "children": [
2327
+ {
2328
+ "stats": [
2329
+ {
2330
+ "label": "Result",
2331
+ "value": "@entity.result"
2332
+ }
2333
+ ],
2334
+ "type": "game-hud"
2335
+ },
2336
+ {
2337
+ "action": "PLAY_AGAIN",
2338
+ "label": "Play Again",
2339
+ "type": "button",
2340
+ "variant": "primary"
2341
+ }
2342
+ ],
2343
+ "direction": "vertical",
2344
+ "gap": "md",
2345
+ "type": "stack"
2346
+ },
2347
+ null
2348
+ ],
2143
2349
  "type": "game-shell"
2144
2350
  }
2145
2351
  ]
@@ -2172,12 +2378,10 @@
2172
2378
  {
2173
2379
  "effects": [
2174
2380
  [
2175
- "set",
2176
- "@entity.wood",
2381
+ "let",
2177
2382
  [
2178
- "if",
2179
2383
  [
2180
- "==",
2384
+ "hitType",
2181
2385
  [
2182
2386
  "object/get",
2183
2387
  [
@@ -2202,146 +2406,225 @@
2202
2406
  ]
2203
2407
  ],
2204
2408
  "type"
2205
- ],
2206
- "tree"
2207
- ],
2208
- [
2209
- "+",
2210
- "@entity.wood",
2211
- 1.0
2212
- ],
2213
- "@entity.wood"
2214
- ]
2215
- ],
2216
- [
2217
- "set",
2218
- "@entity.stone",
2409
+ ]
2410
+ ]
2411
+ ],
2219
2412
  [
2220
- "if",
2413
+ "do",
2221
2414
  [
2222
- "==",
2415
+ "set",
2416
+ "@entity.wood",
2223
2417
  [
2224
- "object/get",
2418
+ "if",
2225
2419
  [
2226
- "array/find",
2227
- "@entity.features",
2228
- [
2229
- "fn",
2230
- "f",
2231
- [
2232
- "and",
2233
- [
2234
- "==",
2235
- "@f.x",
2236
- "@payload.x"
2237
- ],
2238
- [
2239
- "==",
2240
- "@f.y",
2241
- "@payload.z"
2242
- ]
2243
- ]
2244
- ]
2420
+ "==",
2421
+ "@hitType",
2422
+ "tree"
2245
2423
  ],
2246
- "type"
2247
- ],
2248
- "rock"
2424
+ [
2425
+ "+",
2426
+ "@entity.wood",
2427
+ 1.0
2428
+ ],
2429
+ "@entity.wood"
2430
+ ]
2249
2431
  ],
2250
2432
  [
2251
- "+",
2433
+ "set",
2252
2434
  "@entity.stone",
2253
- 1.0
2254
- ],
2255
- "@entity.stone"
2256
- ]
2257
- ],
2258
- [
2259
- "set",
2260
- "@entity.features",
2261
- [
2262
- "array/filter",
2263
- "@entity.features",
2264
- [
2265
- "fn",
2266
- "f",
2267
2435
  [
2268
- "or",
2436
+ "if",
2437
+ [
2438
+ "==",
2439
+ "@hitType",
2440
+ "rock"
2441
+ ],
2269
2442
  [
2270
- "!=",
2271
- "@f.x",
2272
- "@payload.x"
2443
+ "+",
2444
+ "@entity.stone",
2445
+ 1.0
2273
2446
  ],
2447
+ "@entity.stone"
2448
+ ]
2449
+ ],
2450
+ [
2451
+ "set",
2452
+ "@entity.features",
2453
+ [
2454
+ "array/filter",
2455
+ "@entity.features",
2274
2456
  [
2275
- "!=",
2276
- "@f.y",
2277
- "@payload.z"
2457
+ "fn",
2458
+ "f",
2459
+ [
2460
+ "or",
2461
+ [
2462
+ "!=",
2463
+ "@f.x",
2464
+ "@payload.x"
2465
+ ],
2466
+ [
2467
+ "!=",
2468
+ "@f.y",
2469
+ "@payload.z"
2470
+ ]
2471
+ ]
2278
2472
  ]
2279
2473
  ]
2280
- ]
2281
- ]
2282
- ],
2283
- [
2284
- "set",
2285
- "@entity.selectedUnitId",
2286
- ""
2287
- ],
2288
- [
2289
- "set",
2290
- "@entity.validMoves",
2291
- []
2292
- ],
2293
- [
2294
- "render-ui",
2295
- "main",
2296
- {
2297
- "children": [
2298
- {
2299
- "attackTargets": "@entity.attackTargets",
2300
- "features": "@entity.features",
2301
- "scale": "@config.scale",
2302
- "selectedUnitId": "@entity.selectedUnitId",
2303
- "tileClickEvent": "TILE_CLICK",
2304
- "tiles": "@config.tiles",
2305
- "type": "game-canvas-3d",
2306
- "unitClickEvent": "UNIT_CLICK",
2307
- "unitScale": "@config.unitScale",
2308
- "units": "@entity.units",
2309
- "validMoves": "@entity.validMoves"
2310
- }
2311
2474
  ],
2312
- "hud": {
2313
- "children": [
2475
+ [
2476
+ "set",
2477
+ "@entity.fx",
2478
+ [
2479
+ "array/append",
2480
+ "@entity.fx",
2314
2481
  {
2315
- "stats": [
2316
- {
2317
- "label": "Wood",
2318
- "value": "@entity.wood"
2319
- },
2482
+ "id": [
2483
+ "str/concat",
2484
+ "fx-",
2485
+ [
2486
+ "str/concat",
2487
+ "@payload.x",
2488
+ "@payload.z"
2489
+ ]
2490
+ ],
2491
+ "message": [
2492
+ "if",
2493
+ [
2494
+ "==",
2495
+ "@hitType",
2496
+ "tree"
2497
+ ],
2498
+ "+1 wood",
2499
+ "+1 stone"
2500
+ ],
2501
+ "ttl": 3.0,
2502
+ "type": "pickup",
2503
+ "x": "@payload.x",
2504
+ "z": "@payload.z"
2505
+ }
2506
+ ]
2507
+ ],
2508
+ [
2509
+ "set",
2510
+ "@entity.selectedUnitId",
2511
+ ""
2512
+ ],
2513
+ [
2514
+ "set",
2515
+ "@entity.validMoves",
2516
+ []
2517
+ ],
2518
+ [
2519
+ "render-ui",
2520
+ "main",
2521
+ {
2522
+ "addons": {
2523
+ "children": [
2320
2524
  {
2321
- "label": "Stone",
2322
- "value": "@entity.stone"
2525
+ "action": "CANCEL",
2526
+ "label": "Cancel",
2527
+ "type": "button",
2528
+ "variant": "secondary"
2323
2529
  },
2324
2530
  {
2325
- "label": "Result",
2326
- "value": "@entity.result"
2531
+ "action": "PLAY_AGAIN",
2532
+ "label": "Restart",
2533
+ "type": "button",
2534
+ "variant": "secondary"
2327
2535
  }
2328
2536
  ],
2329
- "type": "game-hud"
2537
+ "direction": "vertical",
2538
+ "gap": "sm",
2539
+ "type": "stack"
2330
2540
  },
2331
- {
2332
- "action": "BUILD_CAMP",
2333
- "label": "Build Camp",
2334
- "type": "button",
2335
- "variant": "primary"
2336
- }
2337
- ],
2338
- "direction": "horizontal",
2339
- "gap": "md",
2340
- "justify": "between",
2341
- "type": "stack"
2342
- },
2343
- "type": "game-shell"
2344
- }
2541
+ "children": [
2542
+ {
2543
+ "attackTargets": "@entity.attackTargets",
2544
+ "events": "@entity.fx",
2545
+ "features": "@entity.features",
2546
+ "scale": "@config.scale",
2547
+ "selectedUnitId": "@entity.selectedUnitId",
2548
+ "tileClickEvent": "TILE_CLICK",
2549
+ "tiles": "@config.tiles",
2550
+ "type": "game-canvas-3d",
2551
+ "unitClickEvent": "UNIT_CLICK",
2552
+ "unitScale": "@config.unitScale",
2553
+ "units": "@entity.units",
2554
+ "validMoves": "@entity.validMoves"
2555
+ }
2556
+ ],
2557
+ "hud": {
2558
+ "children": [
2559
+ {
2560
+ "stats": [
2561
+ {
2562
+ "label": "Wood",
2563
+ "value": "@entity.wood"
2564
+ },
2565
+ {
2566
+ "label": "Stone",
2567
+ "value": "@entity.stone"
2568
+ },
2569
+ {
2570
+ "label": "Energy",
2571
+ "value": "@entity.energyLeft"
2572
+ },
2573
+ {
2574
+ "label": "Result",
2575
+ "value": "@entity.result"
2576
+ }
2577
+ ],
2578
+ "type": "game-hud"
2579
+ },
2580
+ {
2581
+ "action": "BUILD_CAMP",
2582
+ "label": "Build Camp",
2583
+ "type": "button",
2584
+ "variant": "primary"
2585
+ }
2586
+ ],
2587
+ "direction": "horizontal",
2588
+ "gap": "md",
2589
+ "justify": "between",
2590
+ "type": "stack"
2591
+ },
2592
+ "overlay": [
2593
+ "if",
2594
+ [
2595
+ "!=",
2596
+ "@entity.result",
2597
+ "none"
2598
+ ],
2599
+ {
2600
+ "align": "center",
2601
+ "children": [
2602
+ {
2603
+ "stats": [
2604
+ {
2605
+ "label": "Result",
2606
+ "value": "@entity.result"
2607
+ }
2608
+ ],
2609
+ "type": "game-hud"
2610
+ },
2611
+ {
2612
+ "action": "PLAY_AGAIN",
2613
+ "label": "Play Again",
2614
+ "type": "button",
2615
+ "variant": "primary"
2616
+ }
2617
+ ],
2618
+ "direction": "vertical",
2619
+ "gap": "md",
2620
+ "type": "stack"
2621
+ },
2622
+ null
2623
+ ],
2624
+ "type": "game-shell"
2625
+ }
2626
+ ]
2627
+ ]
2345
2628
  ]
2346
2629
  ],
2347
2630
  "event": "TILE_CLICK",
@@ -2459,9 +2742,29 @@
2459
2742
  "render-ui",
2460
2743
  "main",
2461
2744
  {
2745
+ "addons": {
2746
+ "children": [
2747
+ {
2748
+ "action": "CANCEL",
2749
+ "label": "Cancel",
2750
+ "type": "button",
2751
+ "variant": "secondary"
2752
+ },
2753
+ {
2754
+ "action": "PLAY_AGAIN",
2755
+ "label": "Restart",
2756
+ "type": "button",
2757
+ "variant": "secondary"
2758
+ }
2759
+ ],
2760
+ "direction": "vertical",
2761
+ "gap": "sm",
2762
+ "type": "stack"
2763
+ },
2462
2764
  "children": [
2463
2765
  {
2464
2766
  "attackTargets": "@entity.attackTargets",
2767
+ "events": "@entity.fx",
2465
2768
  "features": "@entity.features",
2466
2769
  "scale": "@config.scale",
2467
2770
  "selectedUnitId": "@entity.selectedUnitId",
@@ -2486,6 +2789,10 @@
2486
2789
  "label": "Stone",
2487
2790
  "value": "@entity.stone"
2488
2791
  },
2792
+ {
2793
+ "label": "Energy",
2794
+ "value": "@entity.energyLeft"
2795
+ },
2489
2796
  {
2490
2797
  "label": "Result",
2491
2798
  "value": "@entity.result"
@@ -2505,6 +2812,38 @@
2505
2812
  "justify": "between",
2506
2813
  "type": "stack"
2507
2814
  },
2815
+ "overlay": [
2816
+ "if",
2817
+ [
2818
+ "!=",
2819
+ "@entity.result",
2820
+ "none"
2821
+ ],
2822
+ {
2823
+ "align": "center",
2824
+ "children": [
2825
+ {
2826
+ "stats": [
2827
+ {
2828
+ "label": "Result",
2829
+ "value": "@entity.result"
2830
+ }
2831
+ ],
2832
+ "type": "game-hud"
2833
+ },
2834
+ {
2835
+ "action": "PLAY_AGAIN",
2836
+ "label": "Play Again",
2837
+ "type": "button",
2838
+ "variant": "primary"
2839
+ }
2840
+ ],
2841
+ "direction": "vertical",
2842
+ "gap": "md",
2843
+ "type": "stack"
2844
+ },
2845
+ null
2846
+ ],
2508
2847
  "type": "game-shell"
2509
2848
  }
2510
2849
  ]
@@ -2684,9 +3023,29 @@
2684
3023
  "render-ui",
2685
3024
  "main",
2686
3025
  {
3026
+ "addons": {
3027
+ "children": [
3028
+ {
3029
+ "action": "CANCEL",
3030
+ "label": "Cancel",
3031
+ "type": "button",
3032
+ "variant": "secondary"
3033
+ },
3034
+ {
3035
+ "action": "PLAY_AGAIN",
3036
+ "label": "Restart",
3037
+ "type": "button",
3038
+ "variant": "secondary"
3039
+ }
3040
+ ],
3041
+ "direction": "vertical",
3042
+ "gap": "sm",
3043
+ "type": "stack"
3044
+ },
2687
3045
  "children": [
2688
3046
  {
2689
3047
  "attackTargets": "@entity.attackTargets",
3048
+ "events": "@entity.fx",
2690
3049
  "features": "@entity.features",
2691
3050
  "scale": "@config.scale",
2692
3051
  "selectedUnitId": "@entity.selectedUnitId",
@@ -2711,6 +3070,10 @@
2711
3070
  "label": "Stone",
2712
3071
  "value": "@entity.stone"
2713
3072
  },
3073
+ {
3074
+ "label": "Energy",
3075
+ "value": "@entity.energyLeft"
3076
+ },
2714
3077
  {
2715
3078
  "label": "Result",
2716
3079
  "value": "@entity.result"
@@ -2730,6 +3093,38 @@
2730
3093
  "justify": "between",
2731
3094
  "type": "stack"
2732
3095
  },
3096
+ "overlay": [
3097
+ "if",
3098
+ [
3099
+ "!=",
3100
+ "@entity.result",
3101
+ "none"
3102
+ ],
3103
+ {
3104
+ "align": "center",
3105
+ "children": [
3106
+ {
3107
+ "stats": [
3108
+ {
3109
+ "label": "Result",
3110
+ "value": "@entity.result"
3111
+ }
3112
+ ],
3113
+ "type": "game-hud"
3114
+ },
3115
+ {
3116
+ "action": "PLAY_AGAIN",
3117
+ "label": "Play Again",
3118
+ "type": "button",
3119
+ "variant": "primary"
3120
+ }
3121
+ ],
3122
+ "direction": "vertical",
3123
+ "gap": "md",
3124
+ "type": "stack"
3125
+ },
3126
+ null
3127
+ ],
2733
3128
  "type": "game-shell"
2734
3129
  }
2735
3130
  ]
@@ -2816,13 +3211,49 @@
2816
3211
  "@entity.result",
2817
3212
  "victory"
2818
3213
  ],
3214
+ [
3215
+ "set",
3216
+ "@entity.fx",
3217
+ [
3218
+ "array/append",
3219
+ "@entity.fx",
3220
+ {
3221
+ "id": "fx-camp",
3222
+ "message": "Camp built!",
3223
+ "ttl": 6.0,
3224
+ "type": "win",
3225
+ "x": 0.0,
3226
+ "z": 5.0
3227
+ }
3228
+ ]
3229
+ ],
2819
3230
  [
2820
3231
  "render-ui",
2821
3232
  "main",
2822
3233
  {
3234
+ "addons": {
3235
+ "children": [
3236
+ {
3237
+ "action": "CANCEL",
3238
+ "label": "Cancel",
3239
+ "type": "button",
3240
+ "variant": "secondary"
3241
+ },
3242
+ {
3243
+ "action": "PLAY_AGAIN",
3244
+ "label": "Restart",
3245
+ "type": "button",
3246
+ "variant": "secondary"
3247
+ }
3248
+ ],
3249
+ "direction": "vertical",
3250
+ "gap": "sm",
3251
+ "type": "stack"
3252
+ },
2823
3253
  "children": [
2824
3254
  {
2825
3255
  "attackTargets": "@entity.attackTargets",
3256
+ "events": "@entity.fx",
2826
3257
  "features": "@entity.features",
2827
3258
  "scale": "@config.scale",
2828
3259
  "selectedUnitId": "@entity.selectedUnitId",
@@ -2847,6 +3278,10 @@
2847
3278
  "label": "Stone",
2848
3279
  "value": "@entity.stone"
2849
3280
  },
3281
+ {
3282
+ "label": "Energy",
3283
+ "value": "@entity.energyLeft"
3284
+ },
2850
3285
  {
2851
3286
  "label": "Result",
2852
3287
  "value": "@entity.result"
@@ -2866,6 +3301,38 @@
2866
3301
  "justify": "between",
2867
3302
  "type": "stack"
2868
3303
  },
3304
+ "overlay": [
3305
+ "if",
3306
+ [
3307
+ "!=",
3308
+ "@entity.result",
3309
+ "none"
3310
+ ],
3311
+ {
3312
+ "align": "center",
3313
+ "children": [
3314
+ {
3315
+ "stats": [
3316
+ {
3317
+ "label": "Result",
3318
+ "value": "@entity.result"
3319
+ }
3320
+ ],
3321
+ "type": "game-hud"
3322
+ },
3323
+ {
3324
+ "action": "PLAY_AGAIN",
3325
+ "label": "Play Again",
3326
+ "type": "button",
3327
+ "variant": "primary"
3328
+ }
3329
+ ],
3330
+ "direction": "vertical",
3331
+ "gap": "md",
3332
+ "type": "stack"
3333
+ },
3334
+ null
3335
+ ],
2869
3336
  "type": "game-shell"
2870
3337
  }
2871
3338
  ]
@@ -2887,6 +3354,137 @@
2887
3354
  ],
2888
3355
  "to": "gameover"
2889
3356
  },
3357
+ {
3358
+ "effects": [
3359
+ [
3360
+ "set",
3361
+ "@entity.selectedUnitId",
3362
+ ""
3363
+ ],
3364
+ [
3365
+ "set",
3366
+ "@entity.validMoves",
3367
+ []
3368
+ ],
3369
+ [
3370
+ "render-ui",
3371
+ "main",
3372
+ {
3373
+ "addons": {
3374
+ "children": [
3375
+ {
3376
+ "action": "CANCEL",
3377
+ "label": "Cancel",
3378
+ "type": "button",
3379
+ "variant": "secondary"
3380
+ },
3381
+ {
3382
+ "action": "PLAY_AGAIN",
3383
+ "label": "Restart",
3384
+ "type": "button",
3385
+ "variant": "secondary"
3386
+ }
3387
+ ],
3388
+ "direction": "vertical",
3389
+ "gap": "sm",
3390
+ "type": "stack"
3391
+ },
3392
+ "children": [
3393
+ {
3394
+ "attackTargets": "@entity.attackTargets",
3395
+ "events": "@entity.fx",
3396
+ "features": "@entity.features",
3397
+ "scale": "@config.scale",
3398
+ "selectedUnitId": "@entity.selectedUnitId",
3399
+ "tileClickEvent": "TILE_CLICK",
3400
+ "tiles": "@config.tiles",
3401
+ "type": "game-canvas-3d",
3402
+ "unitClickEvent": "UNIT_CLICK",
3403
+ "unitScale": "@config.unitScale",
3404
+ "units": "@entity.units",
3405
+ "validMoves": "@entity.validMoves"
3406
+ }
3407
+ ],
3408
+ "hud": {
3409
+ "children": [
3410
+ {
3411
+ "stats": [
3412
+ {
3413
+ "label": "Wood",
3414
+ "value": "@entity.wood"
3415
+ },
3416
+ {
3417
+ "label": "Stone",
3418
+ "value": "@entity.stone"
3419
+ },
3420
+ {
3421
+ "label": "Energy",
3422
+ "value": "@entity.energyLeft"
3423
+ },
3424
+ {
3425
+ "label": "Result",
3426
+ "value": "@entity.result"
3427
+ }
3428
+ ],
3429
+ "type": "game-hud"
3430
+ },
3431
+ {
3432
+ "action": "BUILD_CAMP",
3433
+ "label": "Build Camp",
3434
+ "type": "button",
3435
+ "variant": "primary"
3436
+ }
3437
+ ],
3438
+ "direction": "horizontal",
3439
+ "gap": "md",
3440
+ "justify": "between",
3441
+ "type": "stack"
3442
+ },
3443
+ "overlay": [
3444
+ "if",
3445
+ [
3446
+ "!=",
3447
+ "@entity.result",
3448
+ "none"
3449
+ ],
3450
+ {
3451
+ "align": "center",
3452
+ "children": [
3453
+ {
3454
+ "stats": [
3455
+ {
3456
+ "label": "Result",
3457
+ "value": "@entity.result"
3458
+ }
3459
+ ],
3460
+ "type": "game-hud"
3461
+ },
3462
+ {
3463
+ "action": "PLAY_AGAIN",
3464
+ "label": "Play Again",
3465
+ "type": "button",
3466
+ "variant": "primary"
3467
+ }
3468
+ ],
3469
+ "direction": "vertical",
3470
+ "gap": "md",
3471
+ "type": "stack"
3472
+ },
3473
+ null
3474
+ ],
3475
+ "type": "game-shell"
3476
+ }
3477
+ ]
3478
+ ],
3479
+ "event": "GAME_END",
3480
+ "from": "playing",
3481
+ "guard": [
3482
+ "!=",
3483
+ "@entity.result",
3484
+ "none"
3485
+ ],
3486
+ "to": "gameover"
3487
+ },
2890
3488
  {
2891
3489
  "effects": [
2892
3490
  [
@@ -2914,6 +3512,11 @@
2914
3512
  "@entity.attackTargets",
2915
3513
  []
2916
3514
  ],
3515
+ [
3516
+ "set",
3517
+ "@entity.fx",
3518
+ []
3519
+ ],
2917
3520
  [
2918
3521
  "set",
2919
3522
  "@entity.wood",
@@ -2929,13 +3532,38 @@
2929
3532
  "@entity.result",
2930
3533
  "none"
2931
3534
  ],
3535
+ [
3536
+ "set",
3537
+ "@entity.energyLeft",
3538
+ "@config.turnBudget"
3539
+ ],
2932
3540
  [
2933
3541
  "render-ui",
2934
3542
  "main",
2935
3543
  {
3544
+ "addons": {
3545
+ "children": [
3546
+ {
3547
+ "action": "CANCEL",
3548
+ "label": "Cancel",
3549
+ "type": "button",
3550
+ "variant": "secondary"
3551
+ },
3552
+ {
3553
+ "action": "PLAY_AGAIN",
3554
+ "label": "Restart",
3555
+ "type": "button",
3556
+ "variant": "secondary"
3557
+ }
3558
+ ],
3559
+ "direction": "vertical",
3560
+ "gap": "sm",
3561
+ "type": "stack"
3562
+ },
2936
3563
  "children": [
2937
3564
  {
2938
3565
  "attackTargets": "@entity.attackTargets",
3566
+ "events": "@entity.fx",
2939
3567
  "features": "@entity.features",
2940
3568
  "scale": "@config.scale",
2941
3569
  "selectedUnitId": "@entity.selectedUnitId",
@@ -2960,6 +3588,10 @@
2960
3588
  "label": "Stone",
2961
3589
  "value": "@entity.stone"
2962
3590
  },
3591
+ {
3592
+ "label": "Energy",
3593
+ "value": "@entity.energyLeft"
3594
+ },
2963
3595
  {
2964
3596
  "label": "Result",
2965
3597
  "value": "@entity.result"
@@ -2979,6 +3611,38 @@
2979
3611
  "justify": "between",
2980
3612
  "type": "stack"
2981
3613
  },
3614
+ "overlay": [
3615
+ "if",
3616
+ [
3617
+ "!=",
3618
+ "@entity.result",
3619
+ "none"
3620
+ ],
3621
+ {
3622
+ "align": "center",
3623
+ "children": [
3624
+ {
3625
+ "stats": [
3626
+ {
3627
+ "label": "Result",
3628
+ "value": "@entity.result"
3629
+ }
3630
+ ],
3631
+ "type": "game-hud"
3632
+ },
3633
+ {
3634
+ "action": "PLAY_AGAIN",
3635
+ "label": "Play Again",
3636
+ "type": "button",
3637
+ "variant": "primary"
3638
+ }
3639
+ ],
3640
+ "direction": "vertical",
3641
+ "gap": "md",
3642
+ "type": "stack"
3643
+ },
3644
+ null
3645
+ ],
2982
3646
  "type": "game-shell"
2983
3647
  }
2984
3648
  ]
@@ -3127,14 +3791,111 @@
3127
3791
  ]
3128
3792
  ],
3129
3793
  [
3130
- "object/merge",
3131
- "@u",
3132
- {
3133
- "position": {
3134
- "x": "@nx",
3135
- "y": "@ny"
3136
- }
3137
- }
3794
+ "let",
3795
+ [
3796
+ [
3797
+ "valid",
3798
+ [
3799
+ "and",
3800
+ [
3801
+ "==",
3802
+ [
3803
+ "object/get",
3804
+ [
3805
+ "array/find",
3806
+ "@config.tiles",
3807
+ [
3808
+ "fn",
3809
+ "t",
3810
+ [
3811
+ "and",
3812
+ [
3813
+ "==",
3814
+ [
3815
+ "object/get",
3816
+ "t",
3817
+ "x"
3818
+ ],
3819
+ "@nx"
3820
+ ],
3821
+ [
3822
+ "==",
3823
+ [
3824
+ "object/get",
3825
+ "t",
3826
+ "y"
3827
+ ],
3828
+ "@ny"
3829
+ ]
3830
+ ]
3831
+ ]
3832
+ ],
3833
+ "passable"
3834
+ ],
3835
+ true
3836
+ ],
3837
+ [
3838
+ "==",
3839
+ [
3840
+ "array/len",
3841
+ [
3842
+ "array/filter",
3843
+ "@entity.units",
3844
+ [
3845
+ "fn",
3846
+ "o",
3847
+ [
3848
+ "and",
3849
+ [
3850
+ "==",
3851
+ [
3852
+ "object/get",
3853
+ [
3854
+ "object/get",
3855
+ "o",
3856
+ "position"
3857
+ ],
3858
+ "x"
3859
+ ],
3860
+ "@nx"
3861
+ ],
3862
+ [
3863
+ "==",
3864
+ [
3865
+ "object/get",
3866
+ [
3867
+ "object/get",
3868
+ "o",
3869
+ "position"
3870
+ ],
3871
+ "y"
3872
+ ],
3873
+ "@ny"
3874
+ ]
3875
+ ]
3876
+ ]
3877
+ ]
3878
+ ],
3879
+ 0.0
3880
+ ]
3881
+ ]
3882
+ ]
3883
+ ],
3884
+ [
3885
+ "if",
3886
+ "@valid",
3887
+ [
3888
+ "object/merge",
3889
+ "@u",
3890
+ {
3891
+ "position": {
3892
+ "x": "@nx",
3893
+ "y": "@ny"
3894
+ }
3895
+ }
3896
+ ],
3897
+ "@u"
3898
+ ]
3138
3899
  ]
3139
3900
  ],
3140
3901
  "@u"
@@ -3142,13 +3903,76 @@
3142
3903
  ]
3143
3904
  ]
3144
3905
  ],
3906
+ [
3907
+ "set",
3908
+ "@entity.fx",
3909
+ [
3910
+ "array/filter",
3911
+ [
3912
+ "array/map",
3913
+ "@entity.fx",
3914
+ [
3915
+ "fn",
3916
+ "e",
3917
+ [
3918
+ "object/merge",
3919
+ "@e",
3920
+ {
3921
+ "ttl": [
3922
+ "-",
3923
+ [
3924
+ "object/get",
3925
+ "@e",
3926
+ "ttl"
3927
+ ],
3928
+ 1.0
3929
+ ]
3930
+ }
3931
+ ]
3932
+ ]
3933
+ ],
3934
+ [
3935
+ "fn",
3936
+ "e",
3937
+ [
3938
+ ">",
3939
+ [
3940
+ "object/get",
3941
+ "@e",
3942
+ "ttl"
3943
+ ],
3944
+ 0.0
3945
+ ]
3946
+ ]
3947
+ ]
3948
+ ],
3145
3949
  [
3146
3950
  "render-ui",
3147
3951
  "main",
3148
3952
  {
3953
+ "addons": {
3954
+ "children": [
3955
+ {
3956
+ "action": "CANCEL",
3957
+ "label": "Cancel",
3958
+ "type": "button",
3959
+ "variant": "secondary"
3960
+ },
3961
+ {
3962
+ "action": "PLAY_AGAIN",
3963
+ "label": "Restart",
3964
+ "type": "button",
3965
+ "variant": "secondary"
3966
+ }
3967
+ ],
3968
+ "direction": "vertical",
3969
+ "gap": "sm",
3970
+ "type": "stack"
3971
+ },
3149
3972
  "children": [
3150
3973
  {
3151
3974
  "attackTargets": "@entity.attackTargets",
3975
+ "events": "@entity.fx",
3152
3976
  "features": "@entity.features",
3153
3977
  "scale": "@config.scale",
3154
3978
  "selectedUnitId": "@entity.selectedUnitId",
@@ -3173,6 +3997,10 @@
3173
3997
  "label": "Stone",
3174
3998
  "value": "@entity.stone"
3175
3999
  },
4000
+ {
4001
+ "label": "Energy",
4002
+ "value": "@entity.energyLeft"
4003
+ },
3176
4004
  {
3177
4005
  "label": "Result",
3178
4006
  "value": "@entity.result"
@@ -3192,6 +4020,38 @@
3192
4020
  "justify": "between",
3193
4021
  "type": "stack"
3194
4022
  },
4023
+ "overlay": [
4024
+ "if",
4025
+ [
4026
+ "!=",
4027
+ "@entity.result",
4028
+ "none"
4029
+ ],
4030
+ {
4031
+ "align": "center",
4032
+ "children": [
4033
+ {
4034
+ "stats": [
4035
+ {
4036
+ "label": "Result",
4037
+ "value": "@entity.result"
4038
+ }
4039
+ ],
4040
+ "type": "game-hud"
4041
+ },
4042
+ {
4043
+ "action": "PLAY_AGAIN",
4044
+ "label": "Play Again",
4045
+ "type": "button",
4046
+ "variant": "primary"
4047
+ }
4048
+ ],
4049
+ "direction": "vertical",
4050
+ "gap": "md",
4051
+ "type": "stack"
4052
+ },
4053
+ null
4054
+ ],
3195
4055
  "type": "game-shell"
3196
4056
  }
3197
4057
  ]
@@ -3203,6 +4063,169 @@
3203
4063
  ],
3204
4064
  "interval": 1200.0,
3205
4065
  "name": "animalWanderTick"
4066
+ },
4067
+ {
4068
+ "effects": [
4069
+ [
4070
+ "set",
4071
+ "@entity.energyLeft",
4072
+ [
4073
+ "math/max",
4074
+ 0.0,
4075
+ [
4076
+ "-",
4077
+ "@entity.energyLeft",
4078
+ 1.0
4079
+ ]
4080
+ ]
4081
+ ],
4082
+ [
4083
+ "set",
4084
+ "@entity.result",
4085
+ [
4086
+ "if",
4087
+ [
4088
+ "<=",
4089
+ "@entity.energyLeft",
4090
+ 0.0
4091
+ ],
4092
+ "defeat",
4093
+ "@entity.result"
4094
+ ]
4095
+ ],
4096
+ [
4097
+ "if",
4098
+ [
4099
+ "!=",
4100
+ "@entity.result",
4101
+ "none"
4102
+ ],
4103
+ [
4104
+ "emit",
4105
+ "GAME_END",
4106
+ {
4107
+ "result": "@entity.result"
4108
+ }
4109
+ ],
4110
+ null
4111
+ ],
4112
+ [
4113
+ "render-ui",
4114
+ "main",
4115
+ {
4116
+ "addons": {
4117
+ "children": [
4118
+ {
4119
+ "action": "CANCEL",
4120
+ "label": "Cancel",
4121
+ "type": "button",
4122
+ "variant": "secondary"
4123
+ },
4124
+ {
4125
+ "action": "PLAY_AGAIN",
4126
+ "label": "Restart",
4127
+ "type": "button",
4128
+ "variant": "secondary"
4129
+ }
4130
+ ],
4131
+ "direction": "vertical",
4132
+ "gap": "sm",
4133
+ "type": "stack"
4134
+ },
4135
+ "children": [
4136
+ {
4137
+ "attackTargets": "@entity.attackTargets",
4138
+ "events": "@entity.fx",
4139
+ "features": "@entity.features",
4140
+ "scale": "@config.scale",
4141
+ "selectedUnitId": "@entity.selectedUnitId",
4142
+ "tileClickEvent": "TILE_CLICK",
4143
+ "tiles": "@config.tiles",
4144
+ "type": "game-canvas-3d",
4145
+ "unitClickEvent": "UNIT_CLICK",
4146
+ "unitScale": "@config.unitScale",
4147
+ "units": "@entity.units",
4148
+ "validMoves": "@entity.validMoves"
4149
+ }
4150
+ ],
4151
+ "hud": {
4152
+ "children": [
4153
+ {
4154
+ "stats": [
4155
+ {
4156
+ "label": "Wood",
4157
+ "value": "@entity.wood"
4158
+ },
4159
+ {
4160
+ "label": "Stone",
4161
+ "value": "@entity.stone"
4162
+ },
4163
+ {
4164
+ "label": "Energy",
4165
+ "value": "@entity.energyLeft"
4166
+ },
4167
+ {
4168
+ "label": "Result",
4169
+ "value": "@entity.result"
4170
+ }
4171
+ ],
4172
+ "type": "game-hud"
4173
+ },
4174
+ {
4175
+ "action": "BUILD_CAMP",
4176
+ "label": "Build Camp",
4177
+ "type": "button",
4178
+ "variant": "primary"
4179
+ }
4180
+ ],
4181
+ "direction": "horizontal",
4182
+ "gap": "md",
4183
+ "justify": "between",
4184
+ "type": "stack"
4185
+ },
4186
+ "overlay": [
4187
+ "if",
4188
+ [
4189
+ "!=",
4190
+ "@entity.result",
4191
+ "none"
4192
+ ],
4193
+ {
4194
+ "align": "center",
4195
+ "children": [
4196
+ {
4197
+ "stats": [
4198
+ {
4199
+ "label": "Result",
4200
+ "value": "@entity.result"
4201
+ }
4202
+ ],
4203
+ "type": "game-hud"
4204
+ },
4205
+ {
4206
+ "action": "PLAY_AGAIN",
4207
+ "label": "Play Again",
4208
+ "type": "button",
4209
+ "variant": "primary"
4210
+ }
4211
+ ],
4212
+ "direction": "vertical",
4213
+ "gap": "md",
4214
+ "type": "stack"
4215
+ },
4216
+ null
4217
+ ],
4218
+ "type": "game-shell"
4219
+ }
4220
+ ]
4221
+ ],
4222
+ "guard": [
4223
+ "==",
4224
+ "@entity.result",
4225
+ "none"
4226
+ ],
4227
+ "interval": 1500.0,
4228
+ "name": "energyTick"
3206
4229
  }
3207
4230
  ]
3208
4231
  }