@zylem/behaviors 0.8.10 → 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 (159) 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-VNQLMRWC.js → chunk-2QCCLHJC.js} +9 -5
  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-NZM5YQBW.js → chunk-7HGDADLB.js} +8 -4
  25. package/dist/chunk-7IOQEXYR.js +92 -0
  26. package/dist/{chunk-G5S5U6WI.js → chunk-APAM55J3.js} +9 -5
  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-DDLZLJ7W.js +8 -0
  32. package/dist/chunk-DRIXFB4C.js +132 -0
  33. package/dist/{chunk-U2BSZJ3S.js → chunk-DTLUKSX2.js} +5 -1
  34. package/dist/{chunk-VB4GYWTE.js → chunk-EMEA45JQ.js} +9 -5
  35. package/dist/chunk-EQFLPRF7.js +130 -0
  36. package/dist/{chunk-X45KOKUF.js → chunk-GNRMH7D3.js} +8 -4
  37. package/dist/chunk-GYEKT5AY.js +102 -0
  38. package/dist/{chunk-SHZZ2QRV.js → chunk-HCWLIPXP.js} +5 -1
  39. package/dist/chunk-HQ2UFI3S.js +116 -0
  40. package/dist/chunk-I52PC5IU.js +128 -0
  41. package/dist/{chunk-T7ST62OT.js → chunk-IAIJG2PB.js} +9 -5
  42. package/dist/{chunk-NDJO56BB.js → chunk-IJILTFEL.js} +5 -1
  43. package/dist/{chunk-6RIS4MGM.js → chunk-IRNU4JGV.js} +9 -5
  44. package/dist/chunk-IRPBFVAK.js +141 -0
  45. package/dist/chunk-JFBR4FNX.js +140 -0
  46. package/dist/{chunk-ERS6SNA5.js → chunk-K34N2CBL.js} +5 -1
  47. package/dist/chunk-LMMF7KXF.js +178 -0
  48. package/dist/chunk-LWGJ3QQZ.js +107 -0
  49. package/dist/chunk-MPNGQLHZ.js +132 -0
  50. package/dist/chunk-OH5LJAEJ.js +135 -0
  51. package/dist/{chunk-HZMC4LGW.js → chunk-P6TMZSWF.js} +10 -6
  52. package/dist/chunk-PDHHOVVQ.js +126 -0
  53. package/dist/{chunk-7TIIRJKF.js → chunk-RUBKGAPS.js} +5 -1
  54. package/dist/chunk-S44ZHYE6.js +1912 -0
  55. package/dist/chunk-SFMJNAW3.js +128 -0
  56. package/dist/{chunk-IU7Y3L7Y.js → chunk-SKKVOH6D.js} +5 -1
  57. package/dist/chunk-TSYXRRS4.js +125 -0
  58. package/dist/chunk-TZHO6P22.js +150 -0
  59. package/dist/chunk-V26L6MY6.js +127 -0
  60. package/dist/chunk-V4M46BF6.js +105 -0
  61. package/dist/chunk-VSFWETXS.js +127 -0
  62. package/dist/chunk-VU4LTE2X.js +147 -0
  63. package/dist/chunk-WF6HC5U3.js +8 -0
  64. package/dist/chunk-WG5NCDS4.js +99 -0
  65. package/dist/{chunk-7LHXAEOZ.js → chunk-WUYHS6JZ.js} +6 -2
  66. package/dist/chunk-XNRY6NOC.js +120 -0
  67. package/dist/{chunk-57JGBNCS.js → chunk-XT47QZQ6.js} +10 -6
  68. package/dist/chunk-Y5CCNMJI.js +58 -0
  69. package/dist/chunk-YVVB6YMG.js +133 -0
  70. package/dist/chunk-ZZXTGVGN.js +131 -0
  71. package/dist/combat-ai.d.ts +21 -0
  72. package/dist/combat-ai.js +41 -0
  73. package/dist/{components-tct075-p.d.ts → components-ClmBORMP.d.ts} +1 -1
  74. package/dist/cooldown.d.ts +2 -8
  75. package/dist/cooldown.js +3 -2
  76. package/dist/coordinators/boundary-ricochet-3d.d.ts +3 -2
  77. package/dist/coordinators/boundary-ricochet.d.ts +3 -2
  78. package/dist/coordinators/boundary-ricochet.js +2 -2
  79. package/dist/coordinators/multidirectional-space-shooter.d.ts +2 -1
  80. package/dist/coordinators/multidirectional-space-shooter.js +2 -2
  81. package/dist/coordinators/top-down-shooter.d.ts +2 -1
  82. package/dist/coordinators/top-down-shooter.js +2 -2
  83. package/dist/core.d.ts +386 -25
  84. package/dist/core.js +1583 -6
  85. package/dist/destructible-3d.d.ts +2 -1
  86. package/dist/destructible-3d.js +3 -2
  87. package/dist/environmental-locomotion.d.ts +23 -0
  88. package/dist/environmental-locomotion.js +35 -0
  89. package/dist/first-person.d.ts +2 -1
  90. package/dist/first-person.js +24 -3
  91. package/dist/golf-racket.d.ts +21 -0
  92. package/dist/golf-racket.js +37 -0
  93. package/dist/index.d.ts +25 -3
  94. package/dist/index.js +763 -79
  95. package/dist/jumper-2d.d.ts +2 -1
  96. package/dist/jumper-2d.js +24 -3
  97. package/dist/jumper-3d.d.ts +2 -1
  98. package/dist/jumper-3d.js +24 -3
  99. package/dist/lane-defense.d.ts +21 -0
  100. package/dist/lane-defense.js +39 -0
  101. package/dist/life-simulation.d.ts +21 -0
  102. package/dist/life-simulation.js +39 -0
  103. package/dist/matching-pinball.d.ts +21 -0
  104. package/dist/matching-pinball.js +39 -0
  105. package/dist/melee-combat.d.ts +22 -0
  106. package/dist/melee-combat.js +45 -0
  107. package/dist/{moveable-tkFsn7mE.d.ts → moveable-CXK2wEZL.d.ts} +1 -1
  108. package/dist/particle-emitter.d.ts +2 -1
  109. package/dist/particle-emitter.js +3 -2
  110. package/dist/platformer-2d.d.ts +2 -1
  111. package/dist/platformer-2d.js +24 -3
  112. package/dist/platformer-3d.d.ts +2 -1
  113. package/dist/platformer-3d.js +24 -3
  114. package/dist/racing-vehicles.d.ts +21 -0
  115. package/dist/racing-vehicles.js +37 -0
  116. package/dist/rhythm-performance.d.ts +21 -0
  117. package/dist/rhythm-performance.js +39 -0
  118. package/dist/ricochet-2d.d.ts +2 -1
  119. package/dist/ricochet-2d.js +24 -3
  120. package/dist/ricochet-3d.d.ts +2 -1
  121. package/dist/ricochet-3d.js +24 -3
  122. package/dist/runtime-2d.d.ts +2 -1
  123. package/dist/runtime-2d.js +10 -1
  124. package/dist/screen-visibility.d.ts +2 -1
  125. package/dist/screen-visibility.js +3 -2
  126. package/dist/screen-wrap.d.ts +2 -7
  127. package/dist/screen-wrap.js +3 -2
  128. package/dist/shooter-2d.d.ts +2 -1
  129. package/dist/shooter-2d.js +3 -2
  130. package/dist/skate-snowboard.d.ts +21 -0
  131. package/dist/skate-snowboard.js +37 -0
  132. package/dist/spatial-puzzles.d.ts +21 -0
  133. package/dist/spatial-puzzles.js +35 -0
  134. package/dist/squad-rts.d.ts +21 -0
  135. package/dist/squad-rts.js +39 -0
  136. package/dist/stealth-city.d.ts +21 -0
  137. package/dist/stealth-city.js +41 -0
  138. package/dist/survival-resources.d.ts +21 -0
  139. package/dist/survival-resources.js +37 -0
  140. package/dist/tactical-grid.d.ts +21 -0
  141. package/dist/tactical-grid.js +39 -0
  142. package/dist/thruster.d.ts +2 -1
  143. package/dist/thruster.js +3 -2
  144. package/dist/top-down-movement.d.ts +2 -1
  145. package/dist/top-down-movement.js +24 -3
  146. package/dist/turn-based-rpg.d.ts +21 -0
  147. package/dist/turn-based-rpg.js +39 -0
  148. package/dist/weapon-systems.d.ts +22 -0
  149. package/dist/weapon-systems.js +45 -0
  150. package/dist/world-boundary-2d.d.ts +2 -1
  151. package/dist/world-boundary-2d.js +24 -3
  152. package/dist/world-boundary-3d.d.ts +2 -1
  153. package/dist/world-boundary-3d.js +24 -3
  154. package/package.json +87 -3
  155. package/dist/behavior-descriptor-Dr8qmQ20.d.ts +0 -914
  156. package/dist/chunk-GZ3DQIIZ.js +0 -888
  157. package/dist/{chunk-OSPQFWQF.js → chunk-4K37UL53.js} +3 -3
  158. package/dist/{chunk-DD4U42FG.js → chunk-AQB246W5.js} +3 -3
  159. package/dist/{chunk-UKGBQTHL.js → chunk-CXDNR4R4.js} +3 -3
@@ -0,0 +1,128 @@
1
+ // src/lib/behaviors/lane-defense/types.ts
2
+ var DEFENSE_ABILITIES = [
3
+ "lane-target-acquisition",
4
+ "blocker-chew-transition",
5
+ "layered-breakaway-armor",
6
+ "arming-proximity-mine",
7
+ "periodic-resource-production",
8
+ "budgeted-wave-scheduler",
9
+ "single-use-obstacle-vault",
10
+ "burrow-to-backline",
11
+ "costed-grid-deployment",
12
+ "last-chance-lane-sweeper"
13
+ ];
14
+ var DEFENSE_EVENTS = [
15
+ ...DEFENSE_ABILITIES,
16
+ "host-update",
17
+ "armor-break",
18
+ "body-damage",
19
+ "target-damage",
20
+ "mine-detonated",
21
+ "resource-requested",
22
+ "spawn-requested",
23
+ "wave-complete",
24
+ "vault-ended",
25
+ "burrow-emerged",
26
+ "sweep-ended"
27
+ ];
28
+ function defenseData(o) {
29
+ return [
30
+ o.lane ?? 0,
31
+ o.direction ?? 1,
32
+ o.speed ?? 2,
33
+ o.reach ?? 1.2,
34
+ o.resources ?? 0,
35
+ o.health ?? 100,
36
+ 0,
37
+ 0,
38
+ 0,
39
+ 0,
40
+ 0,
41
+ 0,
42
+ 0,
43
+ 0,
44
+ 0,
45
+ 0
46
+ ];
47
+ }
48
+ function defenseOperation(a) {
49
+ switch (a.type) {
50
+ case "targeting-start":
51
+ return { op: 0, data: [a.range, a.damage, a.interval] };
52
+ case "targeting-stop":
53
+ return { op: 1, data: [] };
54
+ case "advance":
55
+ return { op: 4, data: [a.damage, a.interval] };
56
+ case "halt":
57
+ return { op: 5, data: [] };
58
+ case "armor-layer":
59
+ return { op: 8, data: [a.layer, a.health, a.damageMask] };
60
+ case "damage":
61
+ return { op: 9, data: [a.damageSerial, a.amount, a.damageMask] };
62
+ case "mine-prepare":
63
+ return { op: 12, data: [a.delay, a.radius, a.damage] };
64
+ case "production-start":
65
+ return { op: 16, data: [a.interval, a.value, a.capacity] };
66
+ case "resource-bind":
67
+ return { op: 17, data: [a.receipt] };
68
+ case "resource-collect":
69
+ return { op: 18, data: [a.receipt] };
70
+ case "resource-expire":
71
+ return { op: 19, data: [a.receipt] };
72
+ case "wave-start":
73
+ return {
74
+ op: 20,
75
+ data: [
76
+ a.waveSerial,
77
+ a.budget,
78
+ a.cost,
79
+ a.laneMask,
80
+ a.interval,
81
+ a.activeLimit
82
+ ]
83
+ };
84
+ case "spawn-confirm":
85
+ return { op: 21, data: [a.receipt] };
86
+ case "spawn-retire":
87
+ return { op: 22, data: [a.receipt] };
88
+ case "spawn-cancel":
89
+ return { op: 23, data: [a.receipt] };
90
+ case "vault":
91
+ return {
92
+ op: 24,
93
+ data: [a.row, a.landingDistance, a.height, a.duration, a.postSpeed]
94
+ };
95
+ case "burrow":
96
+ return { op: 28, data: [a.destinationX, a.emergeDelay] };
97
+ case "tile":
98
+ return { op: 32, data: [a.row, a.terrainMask, a.x, a.y, a.z] };
99
+ case "card":
100
+ return { op: 33, data: [a.row, a.cost, a.cooldown, a.terrainMask] };
101
+ case "deployment-request":
102
+ return { op: 34, data: [a.tile, a.card] };
103
+ case "deployment-confirm":
104
+ return { op: 35, data: [a.receipt, 1] };
105
+ case "deployment-cancel":
106
+ return { op: 35, data: [a.receipt, 0] };
107
+ case "sweeper-arm":
108
+ return {
109
+ op: 36,
110
+ data: [a.destinationX, a.speed, a.triggerRadius, a.hitRadius]
111
+ };
112
+ case "target":
113
+ return { op: 40, data: [a.row, a.kind, a.lane, a.health, a.flags] };
114
+ case "target-health":
115
+ return { op: 41, data: [a.row, a.health] };
116
+ case "credit":
117
+ return { op: 42, data: [a.creditSerial, a.amount] };
118
+ case "interrupt":
119
+ return { op: 43, data: [] };
120
+ }
121
+ }
122
+
123
+ export {
124
+ DEFENSE_ABILITIES,
125
+ DEFENSE_EVENTS,
126
+ defenseData,
127
+ defenseOperation
128
+ };
@@ -8,7 +8,10 @@ import {
8
8
  } from "./chunk-CBQSC6W3.js";
9
9
  import {
10
10
  defineBehavior
11
- } from "./chunk-YDLO5M7S.js";
11
+ } from "./chunk-5SMXQ6AU.js";
12
+ import {
13
+ BUILTIN_BEHAVIORS
14
+ } from "./chunk-S44ZHYE6.js";
12
15
 
13
16
  // src/lib/behaviors/thruster/thruster-fsm.ts
14
17
  var ThrusterState = /* @__PURE__ */ ((ThrusterState2) => {
@@ -144,6 +147,7 @@ var ThrusterBehaviorSystem = class {
144
147
  };
145
148
  var ThrusterBehavior = defineBehavior({
146
149
  name: "thruster",
150
+ metadata: BUILTIN_BEHAVIORS["thruster"],
147
151
  defaultOptions,
148
152
  systemFactory: (ctx) => new ThrusterBehaviorSystem(ctx.wasmStage ?? null, ctx.getBehaviorLinks)
149
153
  });
@@ -0,0 +1,125 @@
1
+ // src/lib/behaviors/squad-rts/types.ts
2
+ var SQUAD_ABILITIES = [
3
+ "whistle-recall",
4
+ "squad-formation-follow",
5
+ "thrown-worker-deployment",
6
+ "cooperative-object-transport",
7
+ "cooperative-construction-work",
8
+ "surface-latch-attack",
9
+ "species-hazard-affinity",
10
+ "growth-stage-mobility",
11
+ "delivered-resource-conversion",
12
+ "day-end-unit-recall"
13
+ ];
14
+ var SQUAD_EVENTS = [
15
+ ...SQUAD_ABILITIES,
16
+ "host-update",
17
+ "worker-landed",
18
+ "task-complete",
19
+ "latch-hit",
20
+ "worker-lost",
21
+ "day-resolved"
22
+ ];
23
+ function squadData(o) {
24
+ return [
25
+ o.speed ?? 2,
26
+ o.reach ?? 1.5,
27
+ o.separation ?? 0.7,
28
+ o.gravity ?? 9.8,
29
+ o.attackInterval ?? 0.5,
30
+ 0,
31
+ 0,
32
+ 0,
33
+ 0,
34
+ 0,
35
+ 0,
36
+ 0,
37
+ 0,
38
+ 0,
39
+ 0,
40
+ 0
41
+ ];
42
+ }
43
+ function squadOperation(a) {
44
+ switch (a.type) {
45
+ case "whistle-start":
46
+ return { op: 0, data: [a.maximumRadius, a.rate, a.duration] };
47
+ case "whistle-stop":
48
+ return { op: 1, data: [] };
49
+ case "formation-slot":
50
+ return { op: 4, data: [a.row, a.x, a.y, a.z] };
51
+ case "follow":
52
+ return { op: 5, data: [a.row] };
53
+ case "dismiss":
54
+ return { op: 6, data: [a.row] };
55
+ case "throw":
56
+ return { op: 8, data: [a.row, a.x, a.y, a.z, a.duration, a.landingTask] };
57
+ case "assign-carrier":
58
+ return { op: 12, data: [a.row, a.task] };
59
+ case "payload-route":
60
+ return { op: 13, data: [a.task, a.x, a.y, a.z, a.speed] };
61
+ case "release-carrier":
62
+ return { op: 14, data: [a.row] };
63
+ case "assign-work":
64
+ return { op: 16, data: [a.row, a.task] };
65
+ case "stop-work":
66
+ return { op: 17, data: [a.row] };
67
+ case "latch":
68
+ return { op: 20, data: [a.row, a.task, a.x, a.y, a.z] };
69
+ case "shake":
70
+ return { op: 21, data: [a.task, a.speciesMask] };
71
+ case "unlatch":
72
+ return { op: 22, data: [a.row] };
73
+ case "affinity":
74
+ return {
75
+ op: 24,
76
+ data: [a.species, a.immuneMask, a.rescueMask, a.panicDuration]
77
+ };
78
+ case "expose":
79
+ return { op: 25, data: [a.row, a.hazard] };
80
+ case "rescue":
81
+ return { op: 26, data: [a.rescuer, a.victim] };
82
+ case "growth-profile":
83
+ return { op: 28, data: [a.stage, a.speed, a.work] };
84
+ case "grow":
85
+ return { op: 29, data: [a.row, a.stage, a.growthReceipt] };
86
+ case "base-profile":
87
+ return { op: 32, data: [a.task, a.populationCapacity, a.activeLimit] };
88
+ case "deliver":
89
+ return { op: 33, data: [a.payload, a.base, a.deliverySerial] };
90
+ case "deploy":
91
+ return { op: 34, data: [a.base, a.count, a.spawnSerial] };
92
+ case "retire":
93
+ return { op: 35, data: [a.base, a.count, a.spawnSerial] };
94
+ case "day-start":
95
+ return { op: 36, data: [a.daySerial, a.duration, a.base, a.safeRadius] };
96
+ case "protect":
97
+ return { op: 37, data: [a.row, Number(a.protected)] };
98
+ case "worker":
99
+ return {
100
+ op: 40,
101
+ data: [
102
+ a.row,
103
+ a.species,
104
+ a.growth,
105
+ a.workRate,
106
+ a.strength,
107
+ a.damage,
108
+ Number(a.recallable)
109
+ ]
110
+ };
111
+ case "task":
112
+ return { op: 41, data: [a.row, a.kind, a.required, a.capacity, a.value] };
113
+ case "release-worker":
114
+ return { op: 42, data: [a.row] };
115
+ case "target-health":
116
+ return { op: 43, data: [a.task, a.health] };
117
+ }
118
+ }
119
+
120
+ export {
121
+ SQUAD_ABILITIES,
122
+ SQUAD_EVENTS,
123
+ squadData,
124
+ squadOperation
125
+ };
@@ -0,0 +1,150 @@
1
+ // src/lib/behaviors/life-simulation/types.ts
2
+ var LIFE_ABILITIES = [
3
+ "crop-growth-stages",
4
+ "soil-moisture-cycle",
5
+ "seasonal-crop-eligibility",
6
+ "exertion-and-fatigue",
7
+ "livestock-daily-care",
8
+ "calendar-npc-routine",
9
+ "relationship-event-memory",
10
+ "fishing-bite-and-hook",
11
+ "harvestable-fruit-regrowth",
12
+ "room-furniture-placement"
13
+ ];
14
+ var LIFE_EVENTS = [
15
+ ...LIFE_ABILITIES,
16
+ "calendar-or-plot",
17
+ "fishing-lost"
18
+ ];
19
+ function lifeData(o) {
20
+ return [
21
+ o.day ?? 0,
22
+ o.seasonLength ?? 30,
23
+ o.stamina ?? 100,
24
+ o.reach ?? 5,
25
+ o.roomWidth ?? 8,
26
+ o.roomHeight ?? 8,
27
+ 0,
28
+ 0,
29
+ 0,
30
+ 0,
31
+ 0,
32
+ 0,
33
+ 0,
34
+ 0,
35
+ 0,
36
+ 0
37
+ ];
38
+ }
39
+ function lifeOperation(a) {
40
+ switch (a.type) {
41
+ case "calendar-time":
42
+ return { op: 44, data: [a.minute] };
43
+ case "plant":
44
+ return { op: 0, data: [a.row] };
45
+ case "harvest-crop":
46
+ return { op: 1, data: [a.row] };
47
+ case "clear-crop":
48
+ return { op: 2, data: [a.row] };
49
+ case "water":
50
+ return { op: 4, data: [a.row, a.amount] };
51
+ case "season-plant":
52
+ return { op: 8, data: [a.row] };
53
+ case "season-clear":
54
+ return { op: 9, data: [a.row] };
55
+ case "work":
56
+ return { op: 12, data: [a.cost, a.fatiguePerMissing] };
57
+ case "recover":
58
+ return { op: 13, data: [a.stamina, a.fatigue] };
59
+ case "sleep":
60
+ return { op: 14, data: [] };
61
+ case "animal":
62
+ return { op: 16, data: [a.row, a.health, a.affection] };
63
+ case "care":
64
+ return { op: 17, data: [a.row, a.flags] };
65
+ case "collect-product":
66
+ return { op: 18, data: [a.row] };
67
+ case "schedule":
68
+ return {
69
+ op: 20,
70
+ data: [
71
+ a.row,
72
+ a.start,
73
+ a.end,
74
+ a.weekdays,
75
+ a.seasons,
76
+ a.activity,
77
+ a.x,
78
+ a.y,
79
+ a.z,
80
+ a.priority
81
+ ]
82
+ };
83
+ case "time":
84
+ return { op: 21, data: [a.minute] };
85
+ case "routine-override":
86
+ return { op: 22, data: [a.activity, a.x, a.y, a.z, a.until] };
87
+ case "routine-resume":
88
+ return { op: 23, data: [] };
89
+ case "person":
90
+ return { op: 24, data: [a.row, a.score] };
91
+ case "interaction":
92
+ return { op: 25, data: [a.row, a.eventSerial, a.kind, a.delta] };
93
+ case "water-habitat":
94
+ return {
95
+ op: 28,
96
+ data: [a.species, a.seasons, a.start, a.end, a.delay, a.window]
97
+ };
98
+ case "cast":
99
+ return { op: 29, data: [a.x, a.y, a.z, a.timestamp, a.species] };
100
+ case "reel":
101
+ return { op: 30, data: [a.timestamp] };
102
+ case "fish-time":
103
+ return { op: 31, data: [a.timestamp] };
104
+ case "tree":
105
+ return { op: 32, data: [a.row, a.capacity, a.regrowDays] };
106
+ case "harvest-fruit":
107
+ return { op: 33, data: [a.row] };
108
+ case "fruit-confirm":
109
+ return { op: 34, data: [a.row, a.receipt] };
110
+ case "fruit-discard":
111
+ return { op: 35, data: [a.row, a.receipt] };
112
+ case "furniture":
113
+ return { op: 36, data: [a.row, a.width, a.height, a.score, a.style] };
114
+ case "place":
115
+ return { op: 37, data: [a.row, a.x, a.y, a.rotation] };
116
+ case "remove":
117
+ return { op: 38, data: [a.row] };
118
+ case "room-block":
119
+ return { op: 39, data: [a.x, a.y, a.blocked] };
120
+ case "day":
121
+ return { op: 40, data: [a.day, a.rain] };
122
+ case "plot":
123
+ return {
124
+ op: 41,
125
+ data: [
126
+ a.row,
127
+ a.seasons,
128
+ a.stage0Days,
129
+ a.stage1Days,
130
+ a.stage2Days,
131
+ a.moistureRequired,
132
+ a.capacity,
133
+ a.decay,
134
+ a.moisture,
135
+ a.regrowDays
136
+ ]
137
+ };
138
+ case "seed-plot":
139
+ return { op: 42, data: [a.row] };
140
+ case "clear-plot":
141
+ return { op: 43, data: [a.row] };
142
+ }
143
+ }
144
+
145
+ export {
146
+ LIFE_ABILITIES,
147
+ LIFE_EVENTS,
148
+ lifeData,
149
+ lifeOperation
150
+ };
@@ -0,0 +1,127 @@
1
+ import {
2
+ RHYTHM_ABILITIES
3
+ } from "./chunk-LWGJ3QQZ.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/rhythm-performance/index.ts
12
+ var RhythmSystem = 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((link) => link.entity === entity && link.ref === ref) || entity.runtimeHandle !== slot)
29
+ this.detach({ entity, ref });
30
+ }
31
+ for (const link of links) {
32
+ const entity = link.entity;
33
+ entity.rhythmState ??= null;
34
+ const slot = entity.runtimeHandle;
35
+ if (!Number.isInteger(slot) || slot < 0) continue;
36
+ if (!this.attached.has(entity)) {
37
+ if (!this.runtime.attachRhythm(slot, this.abilities, link.ref.options)) {
38
+ throw new Error(
39
+ "Rhythm attachment requires valid options and an available rhythm component slot."
40
+ );
41
+ }
42
+ this.attached.set(entity, { slot, ref: link.ref });
43
+ }
44
+ }
45
+ }
46
+ postUpdate() {
47
+ for (const [entity, { slot }] of this.attached)
48
+ entity.rhythmState = this.runtime?.queryRhythm(slot) ?? null;
49
+ }
50
+ detach(link) {
51
+ const slot = this.attached.get(link.entity)?.slot;
52
+ if (slot !== void 0 && this.runtime && !this.runtime.detachRhythm(slot) && this.runtime.queryRhythm(slot))
53
+ throw new Error("Failed to detach rhythm policy.");
54
+ this.attached.delete(link.entity);
55
+ link.entity.rhythmState = null;
56
+ }
57
+ destroy() {
58
+ for (const [entity, { ref }] of this.attached) this.detach({ entity, ref });
59
+ }
60
+ };
61
+ function descriptor(name, abilities) {
62
+ return defineBehavior({
63
+ name,
64
+ metadata: BUILTIN_BEHAVIORS[name],
65
+ defaultOptions: {},
66
+ systemFactory: (ctx) => new RhythmSystem(
67
+ /* @__PURE__ */ Symbol.for(`zylem:behavior:${name}`),
68
+ abilities,
69
+ ctx.wasmStage ?? null,
70
+ ctx.getBehaviorLinks
71
+ )
72
+ });
73
+ }
74
+ var RhythmPerformanceBehavior = descriptor(
75
+ "rhythm-performance",
76
+ RHYTHM_ABILITIES
77
+ );
78
+ var TimestampedRhythmJudgmentBehavior = descriptor(
79
+ "timestamped-rhythm-judgment",
80
+ ["timestamped-rhythm-judgment"]
81
+ );
82
+ var HoldReleaseRhythmBehavior = descriptor("hold-release-rhythm", [
83
+ "hold-release-rhythm"
84
+ ]);
85
+ var CallAndResponsePatternBehavior = descriptor(
86
+ "call-and-response-pattern",
87
+ ["call-and-response-pattern"]
88
+ );
89
+ var TempoMapChartPlayerBehavior = descriptor(
90
+ "tempo-map-chart-player",
91
+ ["tempo-map-chart-player"]
92
+ );
93
+ var FretChordStrumBehavior = descriptor("fret-chord-strum", [
94
+ "fret-chord-strum"
95
+ ]);
96
+ var HammerOnPullOffChainBehavior = descriptor(
97
+ "hammer-on-pull-off-chain",
98
+ ["hammer-on-pull-off-chain"]
99
+ );
100
+ var SustainNoteTrackingBehavior = descriptor("sustain-note-tracking", [
101
+ "sustain-note-tracking"
102
+ ]);
103
+ var PhraseEarnedScorePowerBehavior = descriptor(
104
+ "phrase-earned-score-power",
105
+ ["phrase-earned-score-power"]
106
+ );
107
+ var RhythmSceneRemixBehavior = descriptor("rhythm-scene-remix", [
108
+ "rhythm-scene-remix"
109
+ ]);
110
+ var PerformanceFailureMeterBehavior = descriptor(
111
+ "performance-failure-meter",
112
+ ["performance-failure-meter"]
113
+ );
114
+
115
+ export {
116
+ RhythmPerformanceBehavior,
117
+ TimestampedRhythmJudgmentBehavior,
118
+ HoldReleaseRhythmBehavior,
119
+ CallAndResponsePatternBehavior,
120
+ TempoMapChartPlayerBehavior,
121
+ FretChordStrumBehavior,
122
+ HammerOnPullOffChainBehavior,
123
+ SustainNoteTrackingBehavior,
124
+ PhraseEarnedScorePowerBehavior,
125
+ RhythmSceneRemixBehavior,
126
+ PerformanceFailureMeterBehavior
127
+ };
@@ -0,0 +1,105 @@
1
+ // src/lib/behaviors/melee-combat/types.ts
2
+ var COMBAT_ABILITIES = [
3
+ "attack-phase-hitboxes",
4
+ "damage-scaled-knockback",
5
+ "combat-hitstop",
6
+ "depleting-shield",
7
+ "timed-perfect-guard",
8
+ "grab-hold-throw",
9
+ "air-dodge-recovery",
10
+ "directional-influence",
11
+ "impact-tech-window",
12
+ "grounded-attack-chain"
13
+ ];
14
+ var COMBAT_PHASES = [
15
+ "idle",
16
+ "startup",
17
+ "active",
18
+ "recovery",
19
+ "stunned",
20
+ "guarding",
21
+ "captured",
22
+ "holding",
23
+ "dodging",
24
+ "recovering",
25
+ "shield-break"
26
+ ];
27
+ var COMBAT_EVENTS = [
28
+ "none",
29
+ "hit",
30
+ "shield",
31
+ "perfect-guard",
32
+ "evaded",
33
+ "shield-break",
34
+ "launch",
35
+ "grab",
36
+ "throw",
37
+ "release",
38
+ "air-dodge",
39
+ "floor-tech",
40
+ "wall-tech",
41
+ "failed-tech"
42
+ ];
43
+ function combatData(o) {
44
+ return [
45
+ o.speed ?? 5,
46
+ o.gravity ?? 18,
47
+ o.weight ?? 100,
48
+ o.shieldCapacity ?? 30,
49
+ o.shieldDrain ?? 4,
50
+ o.shieldRegen ?? 8,
51
+ o.perfectWindow ?? 0.08,
52
+ o.grabDuration ?? 2,
53
+ o.dodgeDuration ?? 0.12,
54
+ o.dodgeRecovery ?? 0.3,
55
+ o.maxInfluenceAngle ?? 0.3,
56
+ o.techWindow ?? 0.15,
57
+ o.techLockout ?? 0.5,
58
+ o.inputBuffer ?? 0.15,
59
+ o.jumpSpeed ?? 8,
60
+ o.shieldBreakStun ?? 1
61
+ ];
62
+ }
63
+ function combatHitData(o) {
64
+ return [
65
+ o.damage ?? 8,
66
+ o.baseKnockback ?? 4,
67
+ o.growth ?? 10,
68
+ o.angle ?? 0.45,
69
+ o.direction ?? 1,
70
+ o.hitstop ?? 0.06,
71
+ o.hitstun ?? 0.35
72
+ ];
73
+ }
74
+ function combatAttackData(o) {
75
+ const startup = o.startup ?? 0.08, active = o.active ?? 0.08, recovery = o.recovery ?? 0.24;
76
+ return [
77
+ startup,
78
+ active,
79
+ recovery,
80
+ o.damage ?? 8,
81
+ o.baseKnockback ?? 4,
82
+ o.growth ?? 10,
83
+ o.angle ?? 0.45,
84
+ o.reach ?? 1,
85
+ ...o.halfExtents ?? [0.5, 0.5, 0.4],
86
+ o.hitstop ?? 0.06,
87
+ o.hitstun ?? 0.35,
88
+ o.chainOpen ?? startup + active,
89
+ o.chainClose ?? startup + active + recovery,
90
+ 0
91
+ ];
92
+ }
93
+ function combatButtons(i) {
94
+ return (i.attack ? 1 : 0) | (i.guard ? 2 : 0) | (i.grab ? 4 : 0) | (i.throw ? 8 : 0) | (i.dodge ? 16 : 0) | (i.tech ? 32 : 0) | (i.jump ? 64 : 0);
95
+ }
96
+
97
+ export {
98
+ COMBAT_ABILITIES,
99
+ COMBAT_PHASES,
100
+ COMBAT_EVENTS,
101
+ combatData,
102
+ combatHitData,
103
+ combatAttackData,
104
+ combatButtons
105
+ };