@almadar/std 16.145.0 → 16.147.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.
- package/behaviors/lolo/infra/atoms/std-migration-job.lolo +269 -0
- package/behaviors/lolo/infra/atoms/std-mod-queue.lolo +1 -1
- package/behaviors/lolo/ml/atoms/std-data-collector.lolo +56 -0
- package/behaviors/lolo/ml/atoms/std-graph-builder.lolo +90 -0
- package/behaviors/lolo/ml/atoms/std-ml-similarity.lolo +25 -13
- package/behaviors/lolo/ml/atoms/std-tokenizer.lolo +108 -0
- package/behaviors/lolo/ml/atoms/std-weight-validator.lolo +106 -0
- package/behaviors/lolo/ui/core/atoms/std-app-layout.lolo +14 -0
- package/behaviors/lolo/ui/core/atoms/std-billable-hour.lolo +1 -1
- package/behaviors/lolo/ui/core/atoms/std-esign-flow.lolo +3 -3
- package/behaviors/lolo/ui/core/atoms/std-esign-request.lolo +4 -4
- package/behaviors/lolo/ui/core/atoms/std-event-log.lolo +2 -2
- package/behaviors/lolo/ui/core/atoms/std-file-store.lolo +1 -1
- package/behaviors/lolo/ui/core/atoms/std-gallery.lolo +1 -1
- package/behaviors/lolo/ui/core/atoms/std-image-upload-multi.lolo +2 -2
- package/behaviors/lolo/ui/core/atoms/std-import.lolo +132 -0
- package/behaviors/lolo/ui/core/atoms/std-recurrence.lolo +5 -5
- package/behaviors/lolo/ui/core/atoms/std-saved-search.lolo +1 -1
- package/behaviors/lolo/ui/core/atoms/std-signature-capture.lolo +1 -1
- package/behaviors/lolo/ui/core/atoms/std-stats.lolo +1 -1
- package/behaviors/lolo/ui/core/atoms/std-tag-taxonomy.lolo +3 -3
- package/behaviors/lolo/ui/core/molecules/ui-data-grid.lolo +0 -2
- package/behaviors/lolo/ui/core/molecules/ui-data-list.lolo +0 -2
- package/behaviors/lolo/ui/core/molecules/ui-import-preview-tree.lolo +96 -0
- package/behaviors/lolo/ui/core/molecules/ui-import-progress.lolo +49 -0
- package/behaviors/lolo/ui/core/molecules/ui-import-source-picker.lolo +67 -0
- package/behaviors/lolo/ui/core/molecules/ui-table-view.lolo +0 -2
- package/behaviors/lolo/ui/core/organisms/ui-entity-cards.lolo +0 -2
- package/behaviors/lolo/ui/core/organisms/ui-entity-list.lolo +0 -2
- package/behaviors/lolo/ui/core/organisms/ui-entity-table.lolo +0 -2
- package/behaviors/lolo/ui/core/organisms/ui-timeline.lolo +0 -2
- package/behaviors/lolo/ui/game/atoms/std-dungeon-combat.lolo +2 -2
- package/behaviors/lolo/ui/game/molecules/std-worldmap-board-2d.lolo +1 -1
- package/behaviors/lolo/ui/game/organisms/ui-boardgame-board.lolo +2 -2
- package/behaviors/lolo/ui/game/organisms/ui-builder-board.lolo +2 -2
- package/behaviors/lolo/ui/game/organisms/ui-debugger-board.lolo +3 -3
- package/behaviors/lolo/ui/game/organisms/ui-physics-sandbox-board.lolo +3 -3
- package/behaviors/lolo/ui/game/organisms/ui-roguelike-board.lolo +1 -1
- package/behaviors/lolo/ui/game/organisms/ui-sequencer-board.lolo +1 -1
- package/behaviors/lolo/ui/learning/atoms/std-algo-heapsort.lolo +2 -2
- package/behaviors/lolo/ui/learning/atoms/std-algo-mst.lolo +3 -3
- package/behaviors/registry/factory-signatures.json +11531 -2142
- package/behaviors/registry/infra/atoms/std-migration-job.orb +1310 -0
- package/behaviors/registry/infra/atoms/std-mod-queue.orb +5 -5
- package/behaviors/registry/ml/atoms/std-data-collector.orb +324 -0
- package/behaviors/registry/ml/atoms/std-graph-builder.orb +480 -0
- package/behaviors/registry/ml/atoms/std-ml-similarity.orb +127 -72
- package/behaviors/registry/ml/atoms/std-tokenizer.orb +570 -0
- package/behaviors/registry/ml/atoms/std-weight-validator.orb +624 -0
- package/behaviors/registry/ui/core/atoms/std-app-layout.orb +33 -1
- package/behaviors/registry/ui/core/atoms/std-billable-hour.orb +2 -2
- package/behaviors/registry/ui/core/atoms/std-esign-flow.orb +17 -21
- package/behaviors/registry/ui/core/atoms/std-esign-request.orb +7 -13
- package/behaviors/registry/ui/core/atoms/std-event-log.orb +2 -4
- package/behaviors/registry/ui/core/atoms/std-file-store.orb +3 -4
- package/behaviors/registry/ui/core/atoms/std-gallery.orb +11 -20
- package/behaviors/registry/ui/core/atoms/std-image-upload-multi.orb +4 -4
- package/behaviors/registry/ui/core/atoms/std-import.orb +701 -0
- package/behaviors/registry/ui/core/atoms/std-recurrence.orb +5 -10
- package/behaviors/registry/ui/core/atoms/std-saved-search.orb +2 -2
- package/behaviors/registry/ui/core/atoms/std-signature-capture.orb +2 -2
- package/behaviors/registry/ui/core/molecules/ui-data-grid.orb +12 -25
- package/behaviors/registry/ui/core/molecules/ui-data-list.orb +13 -26
- package/behaviors/registry/ui/core/molecules/ui-import-preview-tree.orb +354 -0
- package/behaviors/registry/ui/core/molecules/ui-import-progress.orb +195 -0
- package/behaviors/registry/ui/core/molecules/ui-import-source-picker.orb +279 -0
- package/behaviors/registry/ui/core/molecules/ui-table-view.orb +12 -25
- package/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +0 -13
- package/behaviors/registry/ui/core/organisms/ui-entity-list.orb +8 -21
- package/behaviors/registry/ui/core/organisms/ui-entity-table.orb +0 -13
- package/behaviors/registry/ui/core/organisms/ui-timeline.orb +0 -13
- package/behaviors/registry/ui/game/atoms/std-dungeon-combat.orb +4 -4
- package/behaviors/registry/ui/game/molecules/std-worldmap-board-2d.orb +6 -9
- package/behaviors/registry/ui/game/organisms/ui-boardgame-board.orb +4 -4
- package/behaviors/registry/ui/game/organisms/ui-builder-board.orb +4 -4
- package/behaviors/registry/ui/game/organisms/ui-debugger-board.orb +12 -12
- package/behaviors/registry/ui/game/organisms/ui-physics-sandbox-board.orb +19 -19
- package/behaviors/registry/ui/game/organisms/ui-roguelike-board.orb +1 -1
- package/behaviors/registry/ui/game/organisms/ui-sequencer-board.orb +2 -2
- package/behaviors/registry/ui/learning/atoms/std-algo-heapsort.orb +8 -8
- package/dist/behaviors/behaviors-embeddings.json +568 -496
- package/dist/behaviors/behaviors-registry.json +7518 -3936
- package/dist/behaviors/exports-reader.js +3093 -2581
- package/dist/behaviors/functions/index.d.ts +922 -14
- package/dist/behaviors/functions/index.js +3056 -2582
- package/dist/behaviors/index.d.ts +1 -1
- package/dist/behaviors/index.js +3094 -2582
- package/dist/behaviors/knob-embeddings.json +1 -1
- package/dist/behaviors/query.js +3093 -2581
- package/dist/behaviors/registry/factory-signatures.json +11531 -2142
- package/dist/behaviors/registry/infra/atoms/std-migration-job.orb +1310 -0
- package/dist/behaviors/registry/infra/atoms/std-mod-queue.orb +5 -5
- package/dist/behaviors/registry/ml/atoms/std-data-collector.orb +324 -0
- package/dist/behaviors/registry/ml/atoms/std-graph-builder.orb +480 -0
- package/dist/behaviors/registry/ml/atoms/std-ml-similarity.orb +127 -72
- package/dist/behaviors/registry/ml/atoms/std-tokenizer.orb +570 -0
- package/dist/behaviors/registry/ml/atoms/std-weight-validator.orb +624 -0
- package/dist/behaviors/registry/ui/core/atoms/std-app-layout.orb +33 -1
- package/dist/behaviors/registry/ui/core/atoms/std-billable-hour.orb +2 -2
- package/dist/behaviors/registry/ui/core/atoms/std-esign-flow.orb +17 -21
- package/dist/behaviors/registry/ui/core/atoms/std-esign-request.orb +7 -13
- package/dist/behaviors/registry/ui/core/atoms/std-event-log.orb +2 -4
- package/dist/behaviors/registry/ui/core/atoms/std-file-store.orb +3 -4
- package/dist/behaviors/registry/ui/core/atoms/std-gallery.orb +11 -20
- package/dist/behaviors/registry/ui/core/atoms/std-image-upload-multi.orb +4 -4
- package/dist/behaviors/registry/ui/core/atoms/std-import.orb +701 -0
- package/dist/behaviors/registry/ui/core/atoms/std-recurrence.orb +5 -10
- package/dist/behaviors/registry/ui/core/atoms/std-saved-search.orb +2 -2
- package/dist/behaviors/registry/ui/core/atoms/std-signature-capture.orb +2 -2
- package/dist/behaviors/registry/ui/core/molecules/ui-data-grid.orb +12 -25
- package/dist/behaviors/registry/ui/core/molecules/ui-data-list.orb +13 -26
- package/dist/behaviors/registry/ui/core/molecules/ui-import-preview-tree.orb +354 -0
- package/dist/behaviors/registry/ui/core/molecules/ui-import-progress.orb +195 -0
- package/dist/behaviors/registry/ui/core/molecules/ui-import-source-picker.orb +279 -0
- package/dist/behaviors/registry/ui/core/molecules/ui-table-view.orb +12 -25
- package/dist/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +0 -13
- package/dist/behaviors/registry/ui/core/organisms/ui-entity-list.orb +8 -21
- package/dist/behaviors/registry/ui/core/organisms/ui-entity-table.orb +0 -13
- package/dist/behaviors/registry/ui/core/organisms/ui-timeline.orb +0 -13
- package/dist/behaviors/registry/ui/game/atoms/std-dungeon-combat.orb +4 -4
- package/dist/behaviors/registry/ui/game/molecules/std-worldmap-board-2d.orb +6 -9
- package/dist/behaviors/registry/ui/game/organisms/ui-boardgame-board.orb +4 -4
- package/dist/behaviors/registry/ui/game/organisms/ui-builder-board.orb +4 -4
- package/dist/behaviors/registry/ui/game/organisms/ui-debugger-board.orb +12 -12
- package/dist/behaviors/registry/ui/game/organisms/ui-physics-sandbox-board.orb +19 -19
- package/dist/behaviors/registry/ui/game/organisms/ui-roguelike-board.orb +1 -1
- package/dist/behaviors/registry/ui/game/organisms/ui-sequencer-board.orb +2 -2
- package/dist/behaviors/registry/ui/learning/atoms/std-algo-heapsort.orb +8 -8
- package/dist/behaviors-embeddings.json +568 -496
- package/dist/behaviors-registry.json +7518 -3936
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3094 -2582
- package/dist/knob-embeddings.json +1 -1
- package/dist/registry/factory-signatures.json +11531 -2142
- package/package.json +2 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
app ui-import-source-picker "1.0.0"
|
|
2
|
+
"ImportSourcePicker — UI factory (1:1 with the @almadar/ui import-source-picker pattern)."
|
|
3
|
+
orbital ImportSourcePickerOrbital {
|
|
4
|
+
type ImportSourcePickerSourcesItem = {
|
|
5
|
+
id : string!
|
|
6
|
+
label : string!
|
|
7
|
+
description : string
|
|
8
|
+
icon : icon
|
|
9
|
+
kind : "action" | "file"
|
|
10
|
+
accept : string
|
|
11
|
+
multiple : boolean
|
|
12
|
+
disabled : boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
entity ImportSourcePickerItem [runtime] {
|
|
16
|
+
id : string!
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
trait ImportSourcePickerRender -> @rebindable ImportSourcePickerItem [interaction, instance] {
|
|
20
|
+
initial: idle
|
|
21
|
+
|
|
22
|
+
state idle {
|
|
23
|
+
INIT -> idle
|
|
24
|
+
(render-ui main {
|
|
25
|
+
sources: @config.sources
|
|
26
|
+
onSelect: @config.onSelect
|
|
27
|
+
title: @config.title
|
|
28
|
+
moreSources: @config.moreSources
|
|
29
|
+
className: @config.className
|
|
30
|
+
type: import-source-picker
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
emits {
|
|
35
|
+
@config.onSelect -> external {
|
|
36
|
+
sourceId : string
|
|
37
|
+
}
|
|
38
|
+
@description "Called with the source id when an 'action' option is picked"
|
|
39
|
+
@tier "essential"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
config {
|
|
43
|
+
sources : [ImportSourcePickerSourcesItem] = [{ id: "Id", label: "Label", description: "Description", icon: "circle", kind: action, accept: "Accept", multiple: false, disabled: false }, { id: "Id 2", label: "Label 2", description: "Description 2", icon: "circle", kind: file, accept: "Accept 2", multiple: true, disabled: true }]
|
|
44
|
+
@label "Sources"
|
|
45
|
+
@description "Source options to render"
|
|
46
|
+
@tier "presentation"
|
|
47
|
+
onSelect : string = "SELECT"
|
|
48
|
+
@label "On Select"
|
|
49
|
+
@description "Called with the source id when an 'action' option is picked"
|
|
50
|
+
@tier "presentation"
|
|
51
|
+
title : string
|
|
52
|
+
@label "Title"
|
|
53
|
+
@description "Optional heading above the options"
|
|
54
|
+
@tier "presentation"
|
|
55
|
+
moreSources : node
|
|
56
|
+
@label "More Sources"
|
|
57
|
+
@description "Generic slot for additional sources rendered below the options"
|
|
58
|
+
@tier "presentation"
|
|
59
|
+
className : string
|
|
60
|
+
@label "Class Name"
|
|
61
|
+
@description "Additional CSS classes"
|
|
62
|
+
@tier "presentation"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
page "/import-source-picker" as ImportSourcePickerPage -> ImportSourcePickerRender
|
|
67
|
+
}
|
|
@@ -55,11 +55,11 @@ orbital DungeonCombatOrbital {
|
|
|
55
55
|
(let ((target (array/find @entity.enemies (fn e (== @e.id @payload.targetId)))))
|
|
56
56
|
(let ((newHealth (math/max 0 (- (object/get @target health) @config.attackDamage))))
|
|
57
57
|
(do
|
|
58
|
-
(set @entity.enemies (array/map @entity.enemies (fn e (if (== @e.id @payload.targetId) (object/merge @e { health: @newHealth, animation: (if (<= @newHealth 0) "death" "hit") }) e))))
|
|
58
|
+
(set @entity.enemies (array/map @entity.enemies (fn e (if (== @e.id @payload.targetId) (object/merge @e { health: @newHealth, animation: (if (<= @newHealth 0) "death" "hit") }) @e))))
|
|
59
59
|
(if (<= @newHealth 0)
|
|
60
60
|
(do
|
|
61
61
|
(set @entity.combatScore (+ @entity.combatScore @config.pointsPerKill))
|
|
62
|
-
(emit BURST { particles: (array/map (array/filter @entity.enemies (fn e (== @e.id @payload.targetId))) (fn t { id: (str/concat "fx-kill-" (object/get t id)), type: "explosion", x: (object/get (object/get t position) x), z: (object/get (object/get t position) y), ttl: 5 })) }))
|
|
62
|
+
(emit BURST { particles: (array/map (array/filter @entity.enemies (fn e (== @e.id @payload.targetId))) (fn t { id: (str/concat "fx-kill-" (object/get @t id)), type: "explosion", x: (object/get (object/get @t position) x), z: (object/get (object/get @t position) y), ttl: 5 })) }))
|
|
63
63
|
true))))
|
|
64
64
|
|
|
65
65
|
MONSTER_TICK -> active when @config.running
|
|
@@ -168,7 +168,7 @@ orbital WorldMapBoard2DOrbital {
|
|
|
168
168
|
|
|
169
169
|
HERO_MOVE -> playing when (and (== @entity.result "none") (and (!= @entity.selectedHeroId "") (and (grid/in-bounds { x: ?x, y: ?y } @config.gridWidth @config.gridHeight) (and (<= (grid/manhattan-distance (object/get (array/find @entity.units (fn u (== @u.id @entity.selectedHeroId))) position) { x: ?x, y: ?y }) @config.movementRange) (and (== (object/get (array/find @entity.tiles (fn t (and (== (object/get @t x) ?x) (== (object/get @t y) ?y)))) passable) true) (== (array/len (array/filter @entity.units (fn u (and (== (object/get (object/get @u position) x) ?x) (== (object/get (object/get @u position) y) ?y))))) 0))))))
|
|
170
170
|
(emit MOVE { unitId: @entity.selectedHeroId, x: ?x, y: ?y })
|
|
171
|
-
(if (== (object/get (array/find @config.features (fn f (and (== (object/get f x) ?x) (and (== (object/get f y) ?y) (== (object/get f type) "gold_mine"))))) type) "gold_mine") (emit MINE_HIT { id: "" }) null)
|
|
171
|
+
(if (== (object/get (array/find @config.features (fn f (and (== (object/get @f x) ?x) (and (== (object/get @f y) ?y) (== (object/get @f type) "gold_mine"))))) type) "gold_mine") (emit MINE_HIT { id: "" }) null)
|
|
172
172
|
(set @entity.selectedHeroId "")
|
|
173
173
|
(set @entity.validMoves [])
|
|
174
174
|
|
|
@@ -119,7 +119,7 @@ orbital BoardgameBoardOrbital {
|
|
|
119
119
|
(set @entity.landingIndex (math/min @entity.lastIndex (+ @entity.playerIndex @entity.dice)))
|
|
120
120
|
(set @entity.landingType (object/get (array/nth @config.track @entity.landingIndex) type))
|
|
121
121
|
(set @entity.playerIndex (if (== @entity.landingType "bonus") (math/min @entity.lastIndex (+ @entity.landingIndex 2)) (if (== @entity.landingType "trap") (math/max 0 (- @entity.landingIndex 2)) @entity.landingIndex)))
|
|
122
|
-
(set @entity.pieces (array/map @entity.pieces (fn p (if (== @p.id "you") (object/merge p { position: { x: (object/get (array/nth @config.track @entity.playerIndex) x), y: (object/get (array/nth @config.track @entity.playerIndex) y) }, trackIndex: @entity.playerIndex }) p))))
|
|
122
|
+
(set @entity.pieces (array/map @entity.pieces (fn p (if (== @p.id "you") (object/merge @p { position: { x: (object/get (array/nth @config.track @entity.playerIndex) x), y: (object/get (array/nth @config.track @entity.playerIndex) y) }, trackIndex: @entity.playerIndex }) @p))))
|
|
123
123
|
(if (or (== @entity.landingType "bonus") (== @entity.landingType "trap")) (set @entity.effects (array/append @entity.effects { key: @entity.landingType, x: (object/get (array/nth @config.track @entity.landingIndex) x), y: (object/get (array/nth @config.track @entity.landingIndex) y), ttl: 6 })) true)
|
|
124
124
|
(set @entity.result (if (== @entity.playerIndex @entity.lastIndex) "victory" "none"))
|
|
125
125
|
(if (== @entity.result "victory") (emit GAME_END) true)
|
|
@@ -218,7 +218,7 @@ orbital BoardgameBoardOrbital {
|
|
|
218
218
|
(set @entity.landingIndex (math/min @entity.lastIndex (+ @entity.rivalIndex @entity.dice)))
|
|
219
219
|
(set @entity.landingType (object/get (array/nth @config.track @entity.landingIndex) type))
|
|
220
220
|
(set @entity.rivalIndex (if (== @entity.landingType "bonus") (math/min @entity.lastIndex (+ @entity.landingIndex 2)) (if (== @entity.landingType "trap") (math/max 0 (- @entity.landingIndex 2)) @entity.landingIndex)))
|
|
221
|
-
(set @entity.pieces (array/map @entity.pieces (fn p (if (== @p.id "rival") (object/merge p { position: { x: (object/get (array/nth @config.track @entity.rivalIndex) x), y: (object/get (array/nth @config.track @entity.rivalIndex) y) }, trackIndex: @entity.rivalIndex }) p))))
|
|
221
|
+
(set @entity.pieces (array/map @entity.pieces (fn p (if (== @p.id "rival") (object/merge @p { position: { x: (object/get (array/nth @config.track @entity.rivalIndex) x), y: (object/get (array/nth @config.track @entity.rivalIndex) y) }, trackIndex: @entity.rivalIndex }) @p))))
|
|
222
222
|
(if (or (== @entity.landingType "bonus") (== @entity.landingType "trap")) (set @entity.effects (array/append @entity.effects { key: @entity.landingType, x: (object/get (array/nth @config.track @entity.landingIndex) x), y: (object/get (array/nth @config.track @entity.landingIndex) y), ttl: 6 })) true)
|
|
223
223
|
(set @entity.result (if (== @entity.rivalIndex @entity.lastIndex) "defeat" "none"))
|
|
224
224
|
(if (== @entity.result "defeat") (emit GAME_END) true)
|
|
@@ -100,7 +100,7 @@ orbital BuilderBoardOrbital {
|
|
|
100
100
|
]
|
|
101
101
|
})
|
|
102
102
|
|
|
103
|
-
CHECK -> complete when (== (array/len (array/filter @entity.slots (fn s (!= (object/get s placedComponentId) (object/get s requiredComponentId))))) 0)
|
|
103
|
+
CHECK -> complete when (== (array/len (array/filter @entity.slots (fn s (!= (object/get @s placedComponentId) (object/get @s requiredComponentId))))) 0)
|
|
104
104
|
(set @entity.attempts (+ @entity.attempts 1))
|
|
105
105
|
(set @entity.result "win")
|
|
106
106
|
(render-ui main {
|
|
@@ -112,7 +112,7 @@ orbital BuilderBoardOrbital {
|
|
|
112
112
|
]
|
|
113
113
|
})
|
|
114
114
|
|
|
115
|
-
CHECK -> playing when (> (array/len (array/filter @entity.slots (fn s (!= (object/get s placedComponentId) (object/get s requiredComponentId))))) 0)
|
|
115
|
+
CHECK -> playing when (> (array/len (array/filter @entity.slots (fn s (!= (object/get @s placedComponentId) (object/get @s requiredComponentId))))) 0)
|
|
116
116
|
(set @entity.attempts (+ @entity.attempts 1))
|
|
117
117
|
(render-ui main {
|
|
118
118
|
type: game-shell
|
|
@@ -74,7 +74,7 @@ orbital DebuggerBoardOrbital {
|
|
|
74
74
|
]
|
|
75
75
|
})
|
|
76
76
|
TOGGLE_FLAG -> playing
|
|
77
|
-
(set @entity.lines (array/map @entity.lines (fn l (if (== (object/get l id) ?lineId) (object/merge l { isFlagged: (not (object/get l isFlagged)) }) l))))
|
|
77
|
+
(set @entity.lines (array/map @entity.lines (fn l (if (== (object/get @l id) ?lineId) (object/merge @l { isFlagged: (not (object/get @l isFlagged)) }) @l))))
|
|
78
78
|
(render-ui main {
|
|
79
79
|
type: game-shell
|
|
80
80
|
hud: { type: stack, direction: horizontal, gap: md, justify: between, children: [ { type: game-hud, stats: [ { label: "Attempts", value: @entity.attempts }, { label: "Status", value: @entity.result } ] }, { type: stack, direction: horizontal, gap: sm, children: [ { type: button, action: CHECK, label: "Check", variant: primary }, { type: button, action: PLAY_AGAIN, label: "Reset", variant: secondary } ] } ] }
|
|
@@ -84,7 +84,7 @@ orbital DebuggerBoardOrbital {
|
|
|
84
84
|
]
|
|
85
85
|
})
|
|
86
86
|
|
|
87
|
-
CHECK -> complete when (and (== (array/len (array/filter @entity.lines (fn l (and (object/get l isBug) (not (object/get l isFlagged)))))) 0) (== (array/len (array/filter @entity.lines (fn l (and (not (object/get l isBug)) (object/get l isFlagged))))) 0))
|
|
87
|
+
CHECK -> complete when (and (== (array/len (array/filter @entity.lines (fn l (and (object/get @l isBug) (not (object/get @l isFlagged)))))) 0) (== (array/len (array/filter @entity.lines (fn l (and (not (object/get @l isBug)) (object/get @l isFlagged))))) 0))
|
|
88
88
|
(set @entity.attempts (+ @entity.attempts 1))
|
|
89
89
|
(set @entity.result "win")
|
|
90
90
|
(render-ui main {
|
|
@@ -96,7 +96,7 @@ orbital DebuggerBoardOrbital {
|
|
|
96
96
|
]
|
|
97
97
|
})
|
|
98
98
|
|
|
99
|
-
CHECK -> playing when (or (> (array/len (array/filter @entity.lines (fn l (and (object/get l isBug) (not (object/get l isFlagged)))))) 0) (> (array/len (array/filter @entity.lines (fn l (and (not (object/get l isBug)) (object/get l isFlagged))))) 0))
|
|
99
|
+
CHECK -> playing when (or (> (array/len (array/filter @entity.lines (fn l (and (object/get @l isBug) (not (object/get @l isFlagged)))))) 0) (> (array/len (array/filter @entity.lines (fn l (and (not (object/get @l isBug)) (object/get @l isFlagged))))) 0))
|
|
100
100
|
(set @entity.attempts (+ @entity.attempts 1))
|
|
101
101
|
(render-ui main {
|
|
102
102
|
type: game-shell
|
|
@@ -141,10 +141,10 @@ orbital PhysicsSandboxBoardOrbital {
|
|
|
141
141
|
|
|
142
142
|
ticks {
|
|
143
143
|
gravityTick every 300ms
|
|
144
|
-
(set @entity.blocks (array/map @entity.blocks (fn b (if (== (object/get b settled) true) b (if (or (== (+ (object/get b y) 1) @entity.gridHeight) (array/some @entity.blocks (fn o (and (== (object/get o settled) true) (and (== (object/get o x) (object/get b x)) (== (object/get o y) (+ (object/get b y) 1))))))) (object/merge b { settled: true }) (object/merge b { y: (+ (object/get b y) 1) }))))))
|
|
145
|
-
(let ((clearRow (array/find (array/range 0 @entity.gridHeight) (fn r (== (array/len (array/filter @entity.blocks (fn b (and (== (object/get b settled) true) (== (object/get b y) r))))) @entity.gridWidth)))))
|
|
144
|
+
(set @entity.blocks (array/map @entity.blocks (fn b (if (== (object/get @b settled) true) @b (if (or (== (+ (object/get @b y) 1) @entity.gridHeight) (array/some @entity.blocks (fn o (and (== (object/get @o settled) true) (and (== (object/get @o x) (object/get @b x)) (== (object/get @o y) (+ (object/get @b y) 1))))))) (object/merge @b { settled: true }) (object/merge @b { y: (+ (object/get @b y) 1) }))))))
|
|
145
|
+
(let ((clearRow (array/find (array/range 0 @entity.gridHeight) (fn r (== (array/len (array/filter @entity.blocks (fn b (and (== (object/get @b settled) true) (== (object/get @b y) @r))))) @entity.gridWidth)))))
|
|
146
146
|
(do
|
|
147
|
-
(set @entity.blocks (if (!= @clearRow null) (array/map (array/filter @entity.blocks (fn b (!= (object/get b y) @clearRow))) (fn b (if (< (object/get b y) @clearRow) (object/merge b { y: (+ (object/get b y) 1) }) b))) @entity.blocks))
|
|
147
|
+
(set @entity.blocks (if (!= @clearRow null) (array/map (array/filter @entity.blocks (fn b (!= (object/get @b y) @clearRow))) (fn b (if (< (object/get @b y) @clearRow) (object/merge @b { y: (+ (object/get @b y) 1) }) @b))) @entity.blocks))
|
|
148
148
|
(set @entity.score (if (!= @clearRow null) (+ @entity.score (* 10 @entity.gridWidth)) @entity.score))
|
|
149
149
|
(set @entity.rowsCleared (if (!= @clearRow null) (+ @entity.rowsCleared 1) @entity.rowsCleared))))
|
|
150
150
|
(render-ui main {
|
|
@@ -466,7 +466,7 @@ orbital RoguelikeBoardOrbital {
|
|
|
466
466
|
enemyAiTick every 1s
|
|
467
467
|
when (and (== @entity.phase "enemy_turn") (== @entity.result "none"))
|
|
468
468
|
(set @entity.enemies (array/map @entity.enemies (fn e (if (> @e.hp 0) (let ((ex @e.x) (ey @e.y) (px (object/get @entity.player x)) (py (object/get @entity.player y))) (let ((adjP (and (== (math/abs (- @ex @px)) 1) (== @ey @py))) (adjQ (and (== @ex @px) (== (math/abs (- @ey @py)) 1)))) (if (or @adjP @adjQ) @e (let ((cnx (math/clamp (+ @ex (math/sign (- @px @ex))) 0 (- @entity.gridWidth 1))) (cny (math/clamp (+ @ey (math/sign (- @py @ey))) 0 (- @entity.gridHeight 1)))) (let ((ntile (array/find @entity.tiles (fn t (and (== (object/get @t x) @cnx) (== (object/get @t y) @cny))))) (occupied (array/find @entity.enemies (fn o (and (!= @o.id @e.id) (and (== @o.x @cnx) (== @o.y @cny))))))) (if (and (and (!= @ntile null) (== (object/get @ntile passable) true)) (and (== @occupied null) (or (!= @cnx @px) (!= @cny @py)))) (object/merge @e { x: @cnx, y: @cny }) @e)))))) @e))))
|
|
469
|
-
(set @entity.playerHp (let ((adjEnemies (array/filter @entity.enemies (fn e (and (> @e.hp 0) (or (and (== (math/abs (- @e.x (object/get @entity.player x))) 1) (== @e.y (object/get @entity.player y))) (and (== @e.x (object/get @entity.player x)) (== (math/abs (- @e.y (object/get @entity.player y))) 1)))))))) (let ((dmg (if (== (array/len @adjEnemies) 0) 0 (array/reduce @adjEnemies (fn acc e (+ acc @e.attack)) 0)))) (math/max 0 (- @entity.playerHp @dmg)))))
|
|
469
|
+
(set @entity.playerHp (let ((adjEnemies (array/filter @entity.enemies (fn e (and (> @e.hp 0) (or (and (== (math/abs (- @e.x (object/get @entity.player x))) 1) (== @e.y (object/get @entity.player y))) (and (== @e.x (object/get @entity.player x)) (== (math/abs (- @e.y (object/get @entity.player y))) 1)))))))) (let ((dmg (if (== (array/len @adjEnemies) 0) 0 (array/reduce @adjEnemies (fn acc e (+ @acc @e.attack)) 0)))) (math/max 0 (- @entity.playerHp @dmg)))))
|
|
470
470
|
(set @entity.effects (if (> (array/len (array/filter @entity.enemies (fn e (and (> @e.hp 0) (or (and (== (math/abs (- @e.x (object/get @entity.player x))) 1) (== @e.y (object/get @entity.player y))) (and (== @e.x (object/get @entity.player x)) (== (math/abs (- @e.y (object/get @entity.player y))) 1))))))) 0) (array/append @entity.effects { key: "slash", x: (object/get @entity.player x), y: (object/get @entity.player y), ttl: 4 }) @entity.effects))
|
|
471
471
|
(if (<= @entity.playerHp 0) (do (set @entity.result "lost") (emit GAME_END)) true)
|
|
472
472
|
(set @entity.phase (if (== @entity.result "none") "player_turn" "game_over"))
|
|
@@ -119,7 +119,7 @@ orbital SequencerBoardOrbital {
|
|
|
119
119
|
]
|
|
120
120
|
})
|
|
121
121
|
|
|
122
|
-
CHECK -> complete when (array/some @entity.solutions (fn sol (== (array/map @entity.slots (fn s (object/get s placedActionId))) sol)))
|
|
122
|
+
CHECK -> complete when (array/some @entity.solutions (fn sol (== (array/map @entity.slots (fn s (object/get @s placedActionId))) @sol)))
|
|
123
123
|
(set @entity.attempts (+ @entity.attempts 1))
|
|
124
124
|
(set @entity.result "win")
|
|
125
125
|
(set @entity.currentStep -1)
|
|
@@ -58,9 +58,9 @@ orbital HeapSortEngineOrbital {
|
|
|
58
58
|
(rc (+ (* 2 @entity.root) 2))
|
|
59
59
|
)
|
|
60
60
|
(let (
|
|
61
|
-
(afterL (if (and (< lc @entity.heapSize) (> (object/get (array/nth @entity.bars lc) value) (object/get (array/nth @entity.bars @entity.root) value))) lc @entity.root))
|
|
61
|
+
(afterL (if (and (< @lc @entity.heapSize) (> (object/get (array/nth @entity.bars @lc) value) (object/get (array/nth @entity.bars @entity.root) value))) @lc @entity.root))
|
|
62
62
|
)
|
|
63
|
-
(if (and (< rc @entity.heapSize) (> (object/get (array/nth @entity.bars rc) value) (object/get (array/nth @entity.bars afterL) value))) rc afterL))))
|
|
63
|
+
(if (and (< @rc @entity.heapSize) (> (object/get (array/nth @entity.bars @rc) value) (object/get (array/nth @entity.bars @afterL) value))) @rc @afterL))))
|
|
64
64
|
(set @entity.willSwap (not (== @entity.largest @entity.root)))
|
|
65
65
|
(set @entity.buildMore (and (not @entity.willSwap) (== @entity.phase 0) (>= @entity.origin 1)))
|
|
66
66
|
(set @entity.buildDone (and (not @entity.willSwap) (== @entity.phase 0) (== @entity.origin 0)))
|
|
@@ -76,7 +76,7 @@ orbital MstEngineOrbital {
|
|
|
76
76
|
(let ( (inF (array/includes @entity.inTree (object/get @w from)))
|
|
77
77
|
(inT (array/includes @entity.inTree (object/get @w to))) )
|
|
78
78
|
(or (and @inF (not @inT)) (and (not @inF) @inT)))))
|
|
79
|
-
(fn w (object/get @w w)))))
|
|
79
|
+
(fn w (object/get @w "w")))))
|
|
80
80
|
(set @entity.chosenFrom
|
|
81
81
|
(object/get
|
|
82
82
|
(array/first
|
|
@@ -84,7 +84,7 @@ orbital MstEngineOrbital {
|
|
|
84
84
|
(let ( (inF (array/includes @entity.inTree (object/get @w from)))
|
|
85
85
|
(inT (array/includes @entity.inTree (object/get @w to))) )
|
|
86
86
|
(and (or (and @inF (not @inT)) (and (not @inF) @inT))
|
|
87
|
-
(== (object/get @w w) @entity.minW))))))
|
|
87
|
+
(== (object/get @w "w") @entity.minW))))))
|
|
88
88
|
from))
|
|
89
89
|
(set @entity.chosenTo
|
|
90
90
|
(object/get
|
|
@@ -93,7 +93,7 @@ orbital MstEngineOrbital {
|
|
|
93
93
|
(let ( (inF (array/includes @entity.inTree (object/get @w from)))
|
|
94
94
|
(inT (array/includes @entity.inTree (object/get @w to))) )
|
|
95
95
|
(and (or (and @inF (not @inT)) (and (not @inF) @inT))
|
|
96
|
-
(== (object/get @w w) @entity.minW))))))
|
|
96
|
+
(== (object/get @w "w") @entity.minW))))))
|
|
97
97
|
to))
|
|
98
98
|
(set @entity.treeEdges (array/append @entity.treeEdges { from: @entity.chosenFrom, to: @entity.chosenTo }))
|
|
99
99
|
(set @entity.inTree
|