@zylem/behaviors 0.8.9 → 0.8.11

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 (168) hide show
  1. package/dist/acrobatics-2d.d.ts +25 -0
  2. package/dist/acrobatics-2d.js +37 -0
  3. package/dist/action-rpg.d.ts +21 -0
  4. package/dist/action-rpg.js +39 -0
  5. package/dist/adventure-tools.d.ts +22 -0
  6. package/dist/adventure-tools.js +39 -0
  7. package/dist/behavior-descriptor-NS_qnzzp.d.ts +4527 -0
  8. package/dist/behavior-metadata-Drm1zxI2.d.ts +13 -0
  9. package/dist/catalog.d.ts +2143 -0
  10. package/dist/catalog.js +9 -0
  11. package/dist/chunk-2BE5BW7D.js +130 -0
  12. package/dist/{chunk-CTSYM56P.js → chunk-2QCCLHJC.js} +10 -6
  13. package/dist/chunk-2UGT4MIF.js +94 -0
  14. package/dist/chunk-3J3ISPFQ.js +99 -0
  15. package/dist/chunk-3LBGEWT6.js +124 -0
  16. package/dist/{chunk-UUMH3DC3.js → chunk-3QBNWT7B.js} +5 -1
  17. package/dist/chunk-3T44EDXU.js +114 -0
  18. package/dist/chunk-5AJJ44QK.js +129 -0
  19. package/dist/{chunk-YDLO5M7S.js → chunk-5SMXQ6AU.js} +1 -0
  20. package/dist/chunk-5VJIP535.js +71 -0
  21. package/dist/chunk-6DTIJB7B.js +166 -0
  22. package/dist/chunk-73MHJY6R.js +78 -0
  23. package/dist/chunk-73YASAYS.js +137 -0
  24. package/dist/{chunk-LLDLVVG4.js → chunk-7HGDADLB.js} +25 -9
  25. package/dist/chunk-7IOQEXYR.js +92 -0
  26. package/dist/{chunk-OU2SW4U5.js → chunk-APAM55J3.js} +10 -6
  27. package/dist/chunk-BLTBZJPG.js +126 -0
  28. package/dist/chunk-BN6QZDR5.js +90 -0
  29. package/dist/chunk-BR33KT4Z.js +3186 -0
  30. package/dist/chunk-C5AYL42A.js +138 -0
  31. package/dist/{chunk-OBF6BIA2.js → chunk-CBQSC6W3.js} +2 -2
  32. package/dist/chunk-DDLZLJ7W.js +8 -0
  33. package/dist/chunk-DRIXFB4C.js +132 -0
  34. package/dist/{chunk-7CE6OHLW.js → chunk-DTLUKSX2.js} +6 -2
  35. package/dist/{chunk-TK3AXXXI.js → chunk-EMEA45JQ.js} +10 -6
  36. package/dist/chunk-EQFLPRF7.js +130 -0
  37. package/dist/{chunk-M25QJBDN.js → chunk-GNRMH7D3.js} +18 -6
  38. package/dist/chunk-GYEKT5AY.js +102 -0
  39. package/dist/{chunk-SHZZ2QRV.js → chunk-HCWLIPXP.js} +5 -1
  40. package/dist/{chunk-WHKPWIQO.js → chunk-HMVEQB2T.js} +1 -0
  41. package/dist/chunk-HQ2UFI3S.js +116 -0
  42. package/dist/chunk-I52PC5IU.js +128 -0
  43. package/dist/{chunk-CB3C7CRD.js → chunk-IAIJG2PB.js} +10 -6
  44. package/dist/{chunk-NDJO56BB.js → chunk-IJILTFEL.js} +5 -1
  45. package/dist/{chunk-7GGR26YA.js → chunk-IRNU4JGV.js} +10 -6
  46. package/dist/chunk-IRPBFVAK.js +141 -0
  47. package/dist/chunk-JFBR4FNX.js +140 -0
  48. package/dist/{chunk-ERS6SNA5.js → chunk-K34N2CBL.js} +5 -1
  49. package/dist/chunk-LMMF7KXF.js +178 -0
  50. package/dist/chunk-LWGJ3QQZ.js +107 -0
  51. package/dist/chunk-MPNGQLHZ.js +132 -0
  52. package/dist/chunk-OH5LJAEJ.js +135 -0
  53. package/dist/{chunk-57GLKGEX.js → chunk-P6TMZSWF.js} +32 -7
  54. package/dist/chunk-PDHHOVVQ.js +126 -0
  55. package/dist/{chunk-7TIIRJKF.js → chunk-RUBKGAPS.js} +5 -1
  56. package/dist/chunk-S44ZHYE6.js +1912 -0
  57. package/dist/chunk-SFMJNAW3.js +128 -0
  58. package/dist/{chunk-E2MOFIDH.js → chunk-SKKVOH6D.js} +13 -7
  59. package/dist/{chunk-RR3XNDKG.js → chunk-T2LAQQDS.js} +1 -1
  60. package/dist/chunk-TSYXRRS4.js +125 -0
  61. package/dist/chunk-TZHO6P22.js +150 -0
  62. package/dist/chunk-V26L6MY6.js +127 -0
  63. package/dist/chunk-V4M46BF6.js +105 -0
  64. package/dist/chunk-VSFWETXS.js +127 -0
  65. package/dist/chunk-VU4LTE2X.js +147 -0
  66. package/dist/chunk-WF6HC5U3.js +8 -0
  67. package/dist/chunk-WG5NCDS4.js +99 -0
  68. package/dist/{chunk-7LHXAEOZ.js → chunk-WUYHS6JZ.js} +6 -2
  69. package/dist/chunk-XNRY6NOC.js +120 -0
  70. package/dist/{chunk-55CFXXZH.js → chunk-XT47QZQ6.js} +32 -7
  71. package/dist/chunk-Y5CCNMJI.js +58 -0
  72. package/dist/chunk-YVVB6YMG.js +133 -0
  73. package/dist/chunk-ZZXTGVGN.js +131 -0
  74. package/dist/combat-ai.d.ts +21 -0
  75. package/dist/combat-ai.js +41 -0
  76. package/dist/{components--RTwuT4S.d.ts → components-ClmBORMP.d.ts} +1 -1
  77. package/dist/cooldown.d.ts +2 -8
  78. package/dist/cooldown.js +3 -2
  79. package/dist/coordinators/boundary-ricochet-3d.d.ts +3 -2
  80. package/dist/coordinators/boundary-ricochet-3d.js +2 -2
  81. package/dist/coordinators/boundary-ricochet.d.ts +3 -2
  82. package/dist/coordinators/boundary-ricochet.js +2 -2
  83. package/dist/coordinators/multidirectional-space-shooter.d.ts +3 -2
  84. package/dist/coordinators/multidirectional-space-shooter.js +2 -2
  85. package/dist/coordinators/top-down-shooter.d.ts +3 -2
  86. package/dist/coordinators/top-down-shooter.js +2 -2
  87. package/dist/core.d.ts +387 -26
  88. package/dist/core.js +1583 -6
  89. package/dist/destructible-3d.d.ts +3 -2
  90. package/dist/destructible-3d.js +3 -2
  91. package/dist/destructible-prebake.d.ts +1 -1
  92. package/dist/environmental-locomotion.d.ts +23 -0
  93. package/dist/environmental-locomotion.js +35 -0
  94. package/dist/first-person.d.ts +3 -2
  95. package/dist/first-person.js +25 -4
  96. package/dist/golf-racket.d.ts +21 -0
  97. package/dist/golf-racket.js +37 -0
  98. package/dist/index.d.ts +28 -6
  99. package/dist/index.js +766 -82
  100. package/dist/jumper-2d.d.ts +2 -1
  101. package/dist/jumper-2d.js +25 -4
  102. package/dist/jumper-3d.d.ts +2 -1
  103. package/dist/jumper-3d.js +25 -4
  104. package/dist/lane-defense.d.ts +21 -0
  105. package/dist/lane-defense.js +39 -0
  106. package/dist/life-simulation.d.ts +21 -0
  107. package/dist/life-simulation.js +39 -0
  108. package/dist/matching-pinball.d.ts +21 -0
  109. package/dist/matching-pinball.js +39 -0
  110. package/dist/melee-combat.d.ts +22 -0
  111. package/dist/melee-combat.js +45 -0
  112. package/dist/{moveable-CFOHmblC.d.ts → moveable-CXK2wEZL.d.ts} +2 -2
  113. package/dist/particle-emitter/presets.d.ts +1 -1
  114. package/dist/particle-emitter.d.ts +5 -4
  115. package/dist/particle-emitter.js +3 -2
  116. package/dist/{payload-BQzu-oY_.d.ts → payload-WEzfgjSL.d.ts} +1 -1
  117. package/dist/platformer-2d.d.ts +2 -1
  118. package/dist/platformer-2d.js +25 -4
  119. package/dist/platformer-3d.d.ts +2 -1
  120. package/dist/platformer-3d.js +25 -4
  121. package/dist/racing-vehicles.d.ts +21 -0
  122. package/dist/racing-vehicles.js +37 -0
  123. package/dist/rhythm-performance.d.ts +21 -0
  124. package/dist/rhythm-performance.js +39 -0
  125. package/dist/ricochet-2d.d.ts +2 -1
  126. package/dist/ricochet-2d.js +25 -4
  127. package/dist/ricochet-3d.d.ts +2 -1
  128. package/dist/ricochet-3d.js +25 -4
  129. package/dist/runtime-2d.d.ts +2 -1
  130. package/dist/runtime-2d.js +10 -1
  131. package/dist/screen-visibility.d.ts +2 -1
  132. package/dist/screen-visibility.js +3 -2
  133. package/dist/screen-wrap.d.ts +2 -7
  134. package/dist/screen-wrap.js +4 -3
  135. package/dist/shooter-2d.d.ts +3 -2
  136. package/dist/shooter-2d.js +3 -2
  137. package/dist/skate-snowboard.d.ts +21 -0
  138. package/dist/skate-snowboard.js +37 -0
  139. package/dist/{spark-C4Tp-52_.d.ts → spark-VoQoemz_.d.ts} +1 -1
  140. package/dist/spatial-puzzles.d.ts +21 -0
  141. package/dist/spatial-puzzles.js +35 -0
  142. package/dist/squad-rts.d.ts +21 -0
  143. package/dist/squad-rts.js +39 -0
  144. package/dist/stealth-city.d.ts +21 -0
  145. package/dist/stealth-city.js +41 -0
  146. package/dist/survival-resources.d.ts +21 -0
  147. package/dist/survival-resources.js +37 -0
  148. package/dist/tactical-grid.d.ts +21 -0
  149. package/dist/tactical-grid.js +39 -0
  150. package/dist/thruster.d.ts +2 -1
  151. package/dist/thruster.js +4 -3
  152. package/dist/top-down-movement.d.ts +2 -1
  153. package/dist/top-down-movement.js +24 -3
  154. package/dist/turn-based-rpg.d.ts +21 -0
  155. package/dist/turn-based-rpg.js +39 -0
  156. package/dist/{vector-DjhLUrak.d.ts → vector-s7GbCrVn.d.ts} +1 -1
  157. package/dist/weapon-systems.d.ts +22 -0
  158. package/dist/weapon-systems.js +45 -0
  159. package/dist/world-boundary-2d.d.ts +2 -1
  160. package/dist/world-boundary-2d.js +25 -4
  161. package/dist/world-boundary-3d.d.ts +2 -1
  162. package/dist/world-boundary-3d.js +26 -5
  163. package/package.json +90 -5
  164. package/dist/behavior-system-DkFAwLb_.d.ts +0 -914
  165. package/dist/chunk-GZ3DQIIZ.js +0 -888
  166. package/dist/{chunk-OSPQFWQF.js → chunk-4K37UL53.js} +3 -3
  167. package/dist/{chunk-DD4U42FG.js → chunk-AQB246W5.js} +3 -3
  168. package/dist/{chunk-UKGBQTHL.js → chunk-CXDNR4R4.js} +3 -3
@@ -0,0 +1,129 @@
1
+ // src/lib/behaviors/matching-pinball/types.ts
2
+ var MATCHING_ABILITIES = [
3
+ "adjacent-panel-swap",
4
+ "simultaneous-match-clear",
5
+ "column-collapse",
6
+ "cascade-chain-credit",
7
+ "rising-stack-pressure",
8
+ "garbage-block-conversion",
9
+ "powered-pinball-flipper",
10
+ "spring-plunger-launch",
11
+ "active-bumper-kick",
12
+ "pinball-mode-objectives"
13
+ ];
14
+ var MATCHING_EVENTS = [
15
+ ...MATCHING_ABILITIES,
16
+ "board-or-clock",
17
+ "bumper-contact"
18
+ ];
19
+ function matchingData(o) {
20
+ return [
21
+ o.width ?? 6,
22
+ o.height ?? 8,
23
+ o.colors ?? 5,
24
+ o.swapMs ?? 100,
25
+ o.clearMs ?? 250,
26
+ o.settleMs ?? 150,
27
+ o.riseMs ?? 2e3,
28
+ o.dangerMs ?? 2e3,
29
+ o.chainWindowMs ?? 1500,
30
+ o.seed ?? 1,
31
+ o.launchReach ?? 1,
32
+ 0,
33
+ 0,
34
+ 0,
35
+ 0,
36
+ 0
37
+ ];
38
+ }
39
+ function matchingOperation(a) {
40
+ switch (a.type) {
41
+ case "swap":
42
+ return { op: 0, data: [a.x, a.y, a.toX, a.toY] };
43
+ case "match":
44
+ return { op: 4, data: [] };
45
+ case "collapse":
46
+ return { op: 8, data: [] };
47
+ case "chain-match":
48
+ return { op: 12, data: [] };
49
+ case "chain-collapse":
50
+ return { op: 13, data: [] };
51
+ case "pressure":
52
+ return { op: 16, data: [] };
53
+ case "pause-rise":
54
+ return { op: 17, data: [a.duration] };
55
+ case "garbage":
56
+ return { op: 20, data: [a.x, a.y, a.width, a.height, a.region] };
57
+ case "garbage-match":
58
+ return { op: 21, data: [] };
59
+ case "flipper":
60
+ return {
61
+ op: 24,
62
+ data: [
63
+ a.pivotX,
64
+ a.pivotY,
65
+ a.pivotZ,
66
+ a.rest,
67
+ a.active,
68
+ a.stiffness,
69
+ a.damping,
70
+ a.maxForce
71
+ ]
72
+ };
73
+ case "flipper-input":
74
+ return { op: 25, data: [a.pressed] };
75
+ case "stage-ball":
76
+ return {
77
+ op: 28,
78
+ data: [a.directionX, a.directionY, a.directionZ, a.maxImpulse]
79
+ };
80
+ case "pull":
81
+ return { op: 29, data: [a.amount] };
82
+ case "launch":
83
+ return { op: 30, data: [] };
84
+ case "cancel-launch":
85
+ return { op: 31, data: [] };
86
+ case "bumper":
87
+ return { op: 32, data: [a.impulse, a.cooldown, a.reward] };
88
+ case "bumper-hit":
89
+ return { op: 33, data: [] };
90
+ case "mode":
91
+ return {
92
+ op: 36,
93
+ data: [
94
+ a.length,
95
+ a.duration,
96
+ a.reward,
97
+ a.target0,
98
+ a.target1,
99
+ a.target2,
100
+ a.target3,
101
+ a.target4,
102
+ a.target5,
103
+ a.target6,
104
+ a.target7
105
+ ]
106
+ };
107
+ case "mode-start":
108
+ return { op: 37, data: [] };
109
+ case "mode-hit":
110
+ return { op: 38, data: [a.row] };
111
+ case "mode-cancel":
112
+ return { op: 39, data: [] };
113
+ case "cell":
114
+ return { op: 40, data: [a.x, a.y, a.color] };
115
+ case "start-board":
116
+ return { op: 41, data: [] };
117
+ case "clock":
118
+ return { op: 42, data: [a.timestamp] };
119
+ case "mode-target":
120
+ return { op: 43, data: [a.row] };
121
+ }
122
+ }
123
+
124
+ export {
125
+ MATCHING_ABILITIES,
126
+ MATCHING_EVENTS,
127
+ matchingData,
128
+ matchingOperation
129
+ };
@@ -2,6 +2,7 @@
2
2
  function defineBehavior(config) {
3
3
  return {
4
4
  key: /* @__PURE__ */ Symbol.for(`zylem:behavior:${config.name}`),
5
+ metadata: config.metadata,
5
6
  defaultOptions: config.defaultOptions,
6
7
  systemFactory: config.systemFactory,
7
8
  createHandle: config.createHandle
@@ -0,0 +1,71 @@
1
+ // src/lib/behaviors/stealth-city/types.ts
2
+ var CITY_ABILITIES = [
3
+ "vision-cone-awareness",
4
+ "last-seen-search",
5
+ "noise-investigation",
6
+ "footprint-trail-following",
7
+ "contextual-disguise",
8
+ "alarm-communication-network",
9
+ "wanted-level-escalation",
10
+ "pursuit-evasion-decay",
11
+ "pedestrian-panic-propagation",
12
+ "traffic-junction-yield"
13
+ ];
14
+ var CITY_INTENTS = [
15
+ "hold",
16
+ "observe",
17
+ "search",
18
+ "investigate",
19
+ "track",
20
+ "flee",
21
+ "wait",
22
+ "drive"
23
+ ];
24
+ var CITY_EVENTS = [
25
+ "none",
26
+ "awareness-changed",
27
+ "search-ended",
28
+ "noise-heard",
29
+ "clue-reached",
30
+ "disguise-changed",
31
+ "report-sent",
32
+ "alert-received",
33
+ "wanted-changed",
34
+ "panic",
35
+ "traffic-changed"
36
+ ];
37
+ var CITY_LINKS = [
38
+ "target",
39
+ "radio",
40
+ "neighbor",
41
+ "junction",
42
+ "observer"
43
+ ];
44
+ function cityData(o) {
45
+ return [
46
+ o.visionRange ?? 20,
47
+ o.coneCosine ?? 0.5,
48
+ o.suspicionRate ?? 1,
49
+ o.suspicionDecay ?? 0.5,
50
+ o.alertThreshold ?? 1,
51
+ o.searchDuration ?? 6,
52
+ o.searchRadius ?? 3,
53
+ o.hearingRange ?? 15,
54
+ o.noiseMemory ?? 3,
55
+ o.trailLifetime ?? 8,
56
+ o.disguiseModifier ?? 0.2,
57
+ o.reportDelay ?? 0.5,
58
+ o.wantedDecay ?? 2,
59
+ o.evasionDelay ?? 3,
60
+ o.panicDuration ?? 3,
61
+ o.trafficSpeed ?? 8
62
+ ];
63
+ }
64
+
65
+ export {
66
+ CITY_ABILITIES,
67
+ CITY_INTENTS,
68
+ CITY_EVENTS,
69
+ CITY_LINKS,
70
+ cityData
71
+ };
@@ -0,0 +1,166 @@
1
+ // src/lib/behaviors/tactical-grid/types.ts
2
+ var TACTICS_ABILITIES = [
3
+ "terrain-movement-budget",
4
+ "min-max-attack-range",
5
+ "terrain-defense-modifier",
6
+ "counterattack-and-follow-up",
7
+ "weapon-advantage-cycle",
8
+ "persistent-unit-loss",
9
+ "progressive-building-capture",
10
+ "fuel-ammunition-resupply",
11
+ "transport-load-unload",
12
+ "commander-power-window"
13
+ ];
14
+ var TACTICS_EVENTS = [...TACTICS_ABILITIES, "host-update"];
15
+ function tacticsData(o) {
16
+ return [
17
+ o.width ?? 6,
18
+ o.height ?? 6,
19
+ o.followUpSpeedThreshold ?? 4,
20
+ o.captureStrength ?? 10,
21
+ o.maximumFuel ?? 100,
22
+ o.maximumAmmo ?? 10,
23
+ 0,
24
+ 0,
25
+ 0,
26
+ 0,
27
+ 0,
28
+ 0,
29
+ 0,
30
+ 0,
31
+ 0,
32
+ 0
33
+ ];
34
+ }
35
+ function tacticsOperation(a) {
36
+ switch (a.type) {
37
+ case "movement-cost":
38
+ return { op: 0, data: [a.unitClass, a.terrain, a.cost] };
39
+ case "reachable":
40
+ return { op: 1, data: [a.row] };
41
+ case "move":
42
+ return { op: 2, data: [a.row, a.x, a.y] };
43
+ case "weapon-range":
44
+ return {
45
+ op: 4,
46
+ data: [a.row, a.minimum, a.maximum, Number(a.lineOfSight)]
47
+ };
48
+ case "range-map":
49
+ return { op: 5, data: [a.row] };
50
+ case "check-range":
51
+ return { op: 6, data: [a.attacker, a.defender] };
52
+ case "terrain-profile":
53
+ return {
54
+ op: 8,
55
+ data: [a.unitClass, a.terrain, a.defense, a.avoid, a.recovery]
56
+ };
57
+ case "terrain-evaluate":
58
+ return { op: 9, data: [a.row, a.raw, a.seed] };
59
+ case "terrain-recover":
60
+ return { op: 10, data: [a.row] };
61
+ case "combat-start":
62
+ return { op: 12, data: [a.attacker, a.defender, a.combatSerial, a.seed] };
63
+ case "combat-next":
64
+ return { op: 13, data: [] };
65
+ case "combat-cancel":
66
+ return { op: 14, data: [] };
67
+ case "weapon-durability":
68
+ return { op: 15, data: [a.row, a.durability] };
69
+ case "advantage-row":
70
+ return {
71
+ op: 16,
72
+ data: [a.attackerWeapon, a.defenderWeapon, a.damage, a.hit]
73
+ };
74
+ case "evaluate-advantage":
75
+ return { op: 17, data: [a.attacker, a.defender] };
76
+ case "defeat":
77
+ return { op: 20, data: [a.row] };
78
+ case "loss-exception":
79
+ return { op: 21, data: [a.row, Number(a.exempt)] };
80
+ case "recover":
81
+ return { op: 22, data: [a.row, a.health] };
82
+ case "capture-building":
83
+ return { op: 24, data: [a.row, a.structure] };
84
+ case "supply-profile":
85
+ return { op: 28, data: [a.row, a.classMask] };
86
+ case "spend-resources":
87
+ return { op: 29, data: [a.row, a.fuel, a.ammo, a.resourceSerial] };
88
+ case "resupply-unit":
89
+ return { op: 30, data: [a.supplier, a.recipient, a.fuel, a.ammo] };
90
+ case "resupply-facility":
91
+ return { op: 31, data: [a.row, a.structure, a.fuel, a.ammo] };
92
+ case "transport-profile":
93
+ return { op: 32, data: [a.row, a.capacity, a.classMask, a.size] };
94
+ case "load":
95
+ return { op: 33, data: [a.carrier, a.cargo] };
96
+ case "unload":
97
+ return { op: 34, data: [a.carrier, a.cargo, a.x, a.y] };
98
+ case "power-profile":
99
+ return {
100
+ op: 36,
101
+ data: [
102
+ a.team,
103
+ a.threshold,
104
+ a.duration,
105
+ a.attack,
106
+ a.defense,
107
+ a.movement
108
+ ]
109
+ };
110
+ case "power-charge":
111
+ return { op: 37, data: [a.team, a.amount, a.chargeSerial] };
112
+ case "power-activate":
113
+ return { op: 38, data: [a.team] };
114
+ case "power-cancel":
115
+ return { op: 39, data: [a.team] };
116
+ case "unit":
117
+ return {
118
+ op: 40,
119
+ data: [
120
+ a.row,
121
+ a.x,
122
+ a.y,
123
+ a.team,
124
+ a.unitClass,
125
+ a.health,
126
+ a.maximumHealth,
127
+ a.movement,
128
+ a.attack,
129
+ a.defense,
130
+ a.speed,
131
+ a.weapon,
132
+ a.minimumRange,
133
+ a.maximumRange,
134
+ a.fuel,
135
+ a.ammo
136
+ ]
137
+ };
138
+ case "tile":
139
+ return { op: 41, data: [a.x, a.y, a.terrain, Number(a.blocked)] };
140
+ case "begin-turn":
141
+ return { op: 42, data: [a.phase, a.team] };
142
+ case "structure":
143
+ return {
144
+ op: 43,
145
+ data: [
146
+ a.row,
147
+ a.x,
148
+ a.y,
149
+ a.owner,
150
+ a.maximumCapture,
151
+ a.fuel,
152
+ a.ammo,
153
+ a.classMask
154
+ ]
155
+ };
156
+ case "host-health":
157
+ return { op: 44, data: [a.row, a.health] };
158
+ }
159
+ }
160
+
161
+ export {
162
+ TACTICS_ABILITIES,
163
+ TACTICS_EVENTS,
164
+ tacticsData,
165
+ tacticsOperation
166
+ };
@@ -0,0 +1,78 @@
1
+ // src/lib/behaviors/combat-ai/types.ts
2
+ var ENCOUNTER_ABILITIES = [
3
+ "squad-flank-assignment",
4
+ "leader-loss-morale",
5
+ "grenade-danger-evasion",
6
+ "cover-peek-cycle",
7
+ "threat-target-selection",
8
+ "tactical-burst-selection",
9
+ "latent-ambush-activation",
10
+ "boss-phase-controller",
11
+ "localized-weak-point-damage",
12
+ "shootable-projectile-interception"
13
+ ];
14
+ var ENCOUNTER_INTENTS = [
15
+ "hold",
16
+ "flank",
17
+ "retreat",
18
+ "evade",
19
+ "hide",
20
+ "peek",
21
+ "attack",
22
+ "reposition",
23
+ "dormant",
24
+ "dead",
25
+ "intercepted",
26
+ "impact"
27
+ ];
28
+ var ENCOUNTER_EVENTS = [
29
+ "none",
30
+ "target-changed",
31
+ "flank-assigned",
32
+ "morale-changed",
33
+ "evasion",
34
+ "cover-changed",
35
+ "fire-request",
36
+ "activated",
37
+ "phase-changed",
38
+ "damage",
39
+ "stagger",
40
+ "intercepted",
41
+ "impact"
42
+ ];
43
+ var ENCOUNTER_LINKS = [
44
+ "candidate",
45
+ "leader",
46
+ "ally",
47
+ "cover",
48
+ "hazard",
49
+ "region"
50
+ ];
51
+ function encounterData(o) {
52
+ return [
53
+ o.health ?? 100,
54
+ o.team ?? 1,
55
+ o.squad ?? 0,
56
+ o.perceptionRange ?? 20,
57
+ o.flankRadius ?? 4,
58
+ o.retreatThreshold ?? 0.4,
59
+ o.leaderPenalty ?? 0.5,
60
+ o.casualtyPenalty ?? 0.2,
61
+ o.dangerHorizon ?? 3,
62
+ o.evadeSpeed ?? 6,
63
+ o.concealDuration ?? 0.7,
64
+ o.attackDuration ?? 0.4,
65
+ o.shotInterval ?? 0.15,
66
+ o.burstPause ?? 0.6,
67
+ o.activationDelay ?? 0.3,
68
+ o.targetHysteresis ?? 2
69
+ ];
70
+ }
71
+
72
+ export {
73
+ ENCOUNTER_ABILITIES,
74
+ ENCOUNTER_INTENTS,
75
+ ENCOUNTER_EVENTS,
76
+ ENCOUNTER_LINKS,
77
+ encounterData
78
+ };
@@ -0,0 +1,137 @@
1
+ import {
2
+ SURVIVAL_ABILITIES
3
+ } from "./chunk-PDHHOVVQ.js";
4
+ import {
5
+ defineBehavior
6
+ } from "./chunk-5SMXQ6AU.js";
7
+ import {
8
+ BUILTIN_BEHAVIORS
9
+ } from "./chunk-S44ZHYE6.js";
10
+
11
+ // src/lib/behaviors/survival-resources/index.ts
12
+ var SurvivalSystem = class {
13
+ constructor(key, abilities, runtime, links) {
14
+ this.key = key;
15
+ this.abilities = abilities;
16
+ this.runtime = runtime;
17
+ this.links = links;
18
+ }
19
+ key;
20
+ abilities;
21
+ runtime;
22
+ links;
23
+ attached = /* @__PURE__ */ new Map();
24
+ update() {
25
+ if (!this.runtime) return;
26
+ const links = [...this.links?.(this.key) ?? []];
27
+ for (const [entity, { slot, ref }] of this.attached) {
28
+ if (!links.some(
29
+ (link) => link.entity === entity && link.ref === ref
30
+ ) || entity.runtimeHandle !== slot)
31
+ this.detach({ entity, ref });
32
+ }
33
+ for (const link of links) {
34
+ const entity = link.entity;
35
+ entity.survivalState ??= null;
36
+ const slot = entity.runtimeHandle;
37
+ if (!Number.isInteger(slot) || slot < 0) continue;
38
+ if (!this.attached.has(entity)) {
39
+ if (!this.runtime.attachSurvival(
40
+ slot,
41
+ this.abilities,
42
+ link.ref.options
43
+ )) {
44
+ throw new Error(
45
+ "Survival attachment requires valid options and an available AI component slot."
46
+ );
47
+ }
48
+ this.attached.set(entity, { slot, ref: link.ref });
49
+ }
50
+ }
51
+ }
52
+ postUpdate() {
53
+ for (const [entity, { slot }] of this.attached)
54
+ entity.survivalState = this.runtime?.querySurvival(slot) ?? null;
55
+ }
56
+ detach(link) {
57
+ const slot = this.attached.get(link.entity)?.slot;
58
+ if (slot !== void 0 && this.runtime && !this.runtime.detachSurvival(slot) && this.runtime.querySurvival(slot))
59
+ throw new Error("Failed to detach survival policy.");
60
+ this.attached.delete(link.entity);
61
+ link.entity.survivalState = null;
62
+ }
63
+ destroy() {
64
+ for (const [entity, { ref }] of this.attached)
65
+ this.detach({ entity, ref });
66
+ }
67
+ };
68
+ function descriptor(name, abilities) {
69
+ return defineBehavior({
70
+ name,
71
+ metadata: BUILTIN_BEHAVIORS[name],
72
+ defaultOptions: {
73
+ followDistance: 1.5,
74
+ columns: 6
75
+ },
76
+ systemFactory: (ctx) => new SurvivalSystem(
77
+ /* @__PURE__ */ Symbol.for(`zylem:behavior:${name}`),
78
+ abilities,
79
+ ctx.wasmStage ?? null,
80
+ ctx.getBehaviorLinks
81
+ )
82
+ });
83
+ }
84
+ var SurvivalResourcesBehavior = descriptor(
85
+ "survival-resources",
86
+ SURVIVAL_ABILITIES
87
+ );
88
+ var EscortFollowWaitBehavior = descriptor("escort-follow-wait", [
89
+ "escort-follow-wait"
90
+ ]);
91
+ var CompanionAbductionObjectiveBehavior = descriptor(
92
+ "companion-abduction-objective",
93
+ ["companion-abduction-objective"]
94
+ );
95
+ var EnvironmentalVaultActionBehavior = descriptor(
96
+ "environmental-vault-action",
97
+ ["environmental-vault-action"]
98
+ );
99
+ var StaggerFinisherOpportunityBehavior = descriptor(
100
+ "stagger-finisher-opportunity",
101
+ ["stagger-finisher-opportunity"]
102
+ );
103
+ var AdaptiveEncounterPressureBehavior = descriptor(
104
+ "adaptive-encounter-pressure",
105
+ ["adaptive-encounter-pressure"]
106
+ );
107
+ var SpatialInventoryPackingBehavior = descriptor(
108
+ "spatial-inventory-packing",
109
+ ["spatial-inventory-packing"]
110
+ );
111
+ var IngredientCombinationBehavior = descriptor(
112
+ "ingredient-combination",
113
+ ["ingredient-combination"]
114
+ );
115
+ var WeaponUpgradeTrackBehavior = descriptor("weapon-upgrade-track", [
116
+ "weapon-upgrade-track"
117
+ ]);
118
+ var EncounterClearLockBehavior = descriptor("encounter-clear-lock", [
119
+ "encounter-clear-lock"
120
+ ]);
121
+ var SavePointCheckpointBehavior = descriptor("save-point-checkpoint", [
122
+ "save-point-checkpoint"
123
+ ]);
124
+
125
+ export {
126
+ SurvivalResourcesBehavior,
127
+ EscortFollowWaitBehavior,
128
+ CompanionAbductionObjectiveBehavior,
129
+ EnvironmentalVaultActionBehavior,
130
+ StaggerFinisherOpportunityBehavior,
131
+ AdaptiveEncounterPressureBehavior,
132
+ SpatialInventoryPackingBehavior,
133
+ IngredientCombinationBehavior,
134
+ WeaponUpgradeTrackBehavior,
135
+ EncounterClearLockBehavior,
136
+ SavePointCheckpointBehavior
137
+ };
@@ -3,18 +3,22 @@ import {
3
3
  computeBounds3DHits,
4
4
  constrainMovementToBounds3D,
5
5
  hasAnyBounds3DHit,
6
- insetBounds3D
7
- } from "./chunk-WHKPWIQO.js";
6
+ insetBounds3D,
7
+ normalizeBounds3DPadding
8
+ } from "./chunk-HMVEQB2T.js";
9
+ import {
10
+ StageBoundaryDim
11
+ } from "./chunk-BR33KT4Z.js";
8
12
  import {
9
13
  SyncStateMachine,
10
14
  import_typescript_fsm
11
- } from "./chunk-OBF6BIA2.js";
12
- import {
13
- StageBoundaryDim
14
- } from "./chunk-GZ3DQIIZ.js";
15
+ } from "./chunk-CBQSC6W3.js";
15
16
  import {
16
17
  defineBehavior
17
- } from "./chunk-YDLO5M7S.js";
18
+ } from "./chunk-5SMXQ6AU.js";
19
+ import {
20
+ BUILTIN_BEHAVIORS
21
+ } from "./chunk-S44ZHYE6.js";
18
22
 
19
23
  // src/lib/behaviors/world-boundary-3d/world-boundary-3d-fsm.ts
20
24
  var WorldBoundary3DState = /* @__PURE__ */ ((WorldBoundary3DState2) => {
@@ -134,6 +138,18 @@ function createWorldBoundary3DHandle(ref) {
134
138
  }
135
139
  };
136
140
  }
141
+ function paddedRuntimeBounds(bounds, padding) {
142
+ const f32 = Math.fround;
143
+ const pad = normalizeBounds3DPadding(padding);
144
+ return {
145
+ left: f32(f32(bounds.left) + f32(pad.x)),
146
+ right: f32(f32(bounds.right) - f32(pad.x)),
147
+ bottom: f32(f32(bounds.bottom) + f32(pad.y)),
148
+ top: f32(f32(bounds.top) - f32(pad.y)),
149
+ back: f32(f32(bounds.back) + f32(pad.z)),
150
+ front: f32(f32(bounds.front) - f32(pad.z))
151
+ };
152
+ }
137
153
  var WorldBoundary3DSystem = class {
138
154
  constructor(wasmStage, getBehaviorLinks) {
139
155
  this.wasmStage = wasmStage;
@@ -159,8 +175,7 @@ var WorldBoundary3DSystem = class {
159
175
  if (query) {
160
176
  boundaryRef.fsm.update(
161
177
  { x: query.clamped[0], y: query.clamped[1], z: query.clamped[2] },
162
- options.boundaries,
163
- options.padding
178
+ paddedRuntimeBounds(options.boundaries, options.padding)
164
179
  );
165
180
  }
166
181
  }
@@ -185,6 +200,7 @@ var WorldBoundary3DSystem = class {
185
200
  };
186
201
  var WorldBoundary3DBehavior = defineBehavior({
187
202
  name: "world-boundary-3d",
203
+ metadata: BUILTIN_BEHAVIORS["world-boundary-3d"],
188
204
  defaultOptions,
189
205
  systemFactory: (ctx) => new WorldBoundary3DSystem(ctx.wasmStage ?? null, ctx.getBehaviorLinks),
190
206
  createHandle: createWorldBoundary3DHandle