@v12-engine/engine 0.1.1 → 0.4.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/dist/abilities/amounts.d.ts +28 -0
- package/dist/abilities/amounts.js +74 -0
- package/dist/abilities/amounts.js.map +1 -0
- package/dist/abilities/buffs.d.ts +106 -6
- package/dist/abilities/buffs.js +443 -0
- package/dist/abilities/buffs.js.map +1 -0
- package/dist/abilities/castTold.d.ts +2 -0
- package/dist/abilities/castTold.js +66 -0
- package/dist/abilities/castTold.js.map +1 -0
- package/dist/abilities/chance.d.ts +38 -0
- package/dist/abilities/chance.js +77 -0
- package/dist/abilities/chance.js.map +1 -0
- package/dist/abilities/charges.d.ts +18 -0
- package/dist/abilities/charges.js +101 -0
- package/dist/abilities/charges.js.map +1 -0
- package/dist/abilities/control.d.ts +28 -0
- package/dist/abilities/control.js +113 -0
- package/dist/abilities/control.js.map +1 -0
- package/dist/abilities/dispel.js +51 -0
- package/dist/abilities/dispel.js.map +1 -0
- package/dist/abilities/effectFields.d.ts +1 -1
- package/dist/abilities/effectFields.js +676 -0
- package/dist/abilities/effectFields.js.map +1 -0
- package/dist/abilities/effectIndex.d.ts +27 -0
- package/dist/abilities/effectIndex.js +64 -0
- package/dist/abilities/effectIndex.js.map +1 -0
- package/dist/abilities/effects/buff.d.ts +9 -3
- package/dist/abilities/effects/buff.js +84 -0
- package/dist/abilities/effects/buff.js.map +1 -0
- package/dist/abilities/effects/conditions.d.ts +2 -0
- package/dist/abilities/effects/conditions.js +41 -0
- package/dist/abilities/effects/conditions.js.map +1 -0
- package/dist/abilities/effects/core.js +54 -0
- package/dist/abilities/effects/core.js.map +1 -0
- package/dist/abilities/effects/damage.d.ts +1 -1
- package/dist/abilities/effects/damage.js +43 -0
- package/dist/abilities/effects/damage.js.map +1 -0
- package/dist/abilities/effects/heal.d.ts +2 -2
- package/dist/abilities/effects/heal.js +51 -0
- package/dist/abilities/effects/heal.js.map +1 -0
- package/dist/abilities/effects/missile.d.ts +13 -1
- package/dist/abilities/effects/missile.js +104 -0
- package/dist/abilities/effects/missile.js.map +1 -0
- package/dist/abilities/effects/morph.d.ts +5 -0
- package/dist/abilities/effects/morph.js +43 -0
- package/dist/abilities/effects/morph.js.map +1 -0
- package/dist/abilities/effects/moves.d.ts +16 -4
- package/dist/abilities/effects/moves.js +212 -0
- package/dist/abilities/effects/moves.js.map +1 -0
- package/dist/abilities/effects/passives.d.ts +19 -9
- package/dist/abilities/effects/passives.js +131 -0
- package/dist/abilities/effects/passives.js.map +1 -0
- package/dist/abilities/effects/proxy.d.ts +5 -0
- package/dist/abilities/effects/proxy.js +60 -0
- package/dist/abilities/effects/proxy.js.map +1 -0
- package/dist/abilities/effects/sight.d.ts +2 -2
- package/dist/abilities/effects/sight.js +39 -0
- package/dist/abilities/effects/sight.js.map +1 -0
- package/dist/abilities/effects/spawn.d.ts +5 -2
- package/dist/abilities/effects/spawn.js +40 -0
- package/dist/abilities/effects/spawn.js.map +1 -0
- package/dist/abilities/effects/timed.d.ts +2 -2
- package/dist/abilities/effects/timed.js +96 -0
- package/dist/abilities/effects/timed.js.map +1 -0
- package/dist/abilities/effects/trade.d.ts +1 -1
- package/dist/abilities/effects/trade.js +25 -0
- package/dist/abilities/effects/trade.js.map +1 -0
- package/dist/abilities/effects.d.ts +97 -23
- package/dist/abilities/effects.js +860 -0
- package/dist/abilities/effects.js.map +1 -0
- package/dist/abilities/land.d.ts +38 -4
- package/dist/abilities/land.js +189 -0
- package/dist/abilities/land.js.map +1 -0
- package/dist/abilities/recast.d.ts +45 -0
- package/dist/abilities/recast.js +118 -0
- package/dist/abilities/recast.js.map +1 -0
- package/dist/abilities/scaled.js +40 -0
- package/dist/abilities/scaled.js.map +1 -0
- package/dist/abilities/screen.d.ts +6 -0
- package/dist/abilities/screen.js +83 -0
- package/dist/abilities/screen.js.map +1 -0
- package/dist/abilities/shapes.d.ts +66 -0
- package/dist/abilities/shapes.js +122 -0
- package/dist/abilities/shapes.js.map +1 -0
- package/dist/abilities/text.d.ts +14 -2
- package/dist/abilities/text.js +204 -0
- package/dist/abilities/text.js.map +1 -0
- package/dist/abilities/triggers.d.ts +98 -0
- package/dist/abilities/triggers.js +351 -0
- package/dist/abilities/triggers.js.map +1 -0
- package/dist/abilityChanges.d.ts +131 -0
- package/dist/abilityChanges.js +345 -0
- package/dist/abilityChanges.js.map +1 -0
- package/dist/ai/area.d.ts +4 -1
- package/dist/ai/brain.d.ts +4 -1
- package/dist/ai/brain.js +844 -0
- package/dist/ai/brain.js.map +1 -0
- package/dist/ai/budget.js +74 -0
- package/dist/ai/budget.js.map +1 -0
- package/dist/ai/checks.d.ts +9 -1
- package/dist/ai/checks.js +242 -0
- package/dist/ai/checks.js.map +1 -0
- package/dist/ai/computer.d.ts +11 -4
- package/dist/ai/computer.js +251 -0
- package/dist/ai/computer.js.map +1 -0
- package/dist/ai/defence.d.ts +4 -0
- package/dist/ai/defence.js +430 -0
- package/dist/ai/defence.js.map +1 -0
- package/dist/ai/define.d.ts +3 -2
- package/dist/ai/define.js +31 -0
- package/dist/ai/define.js.map +1 -0
- package/dist/ai/economy.d.ts +10 -7
- package/dist/ai/economy.js +780 -0
- package/dist/ai/economy.js.map +1 -0
- package/dist/ai/geometry.js +38 -0
- package/dist/ai/geometry.js.map +1 -0
- package/dist/ai/goals.d.ts +1 -0
- package/dist/ai/goals.js +560 -0
- package/dist/ai/goals.js.map +1 -0
- package/dist/ai/knowledge.d.ts +72 -7
- package/dist/ai/knowledge.js +804 -0
- package/dist/ai/knowledge.js.map +1 -0
- package/dist/ai/lanes.d.ts +10 -2
- package/dist/ai/lanes.js +715 -0
- package/dist/ai/lanes.js.map +1 -0
- package/dist/ai/melee/build.js +264 -0
- package/dist/ai/melee/build.js.map +1 -0
- package/dist/ai/melee/goals.d.ts +7 -0
- package/dist/ai/melee/goals.js +720 -0
- package/dist/ai/melee/goals.js.map +1 -0
- package/dist/ai/melee/heroes.js +68 -0
- package/dist/ai/melee/heroes.js.map +1 -0
- package/dist/ai/melee/index.d.ts +1 -1
- package/dist/ai/melee/index.js +51 -0
- package/dist/ai/melee/index.js.map +1 -0
- package/dist/ai/melee/production.js +29 -0
- package/dist/ai/melee/production.js.map +1 -0
- package/dist/ai/melee/surrender.js +64 -0
- package/dist/ai/melee/surrender.js.map +1 -0
- package/dist/ai/micro.d.ts +9 -0
- package/dist/ai/micro.js +1316 -0
- package/dist/ai/micro.js.map +1 -0
- package/dist/ai/mission.d.ts +9 -2
- package/dist/ai/mission.js +538 -0
- package/dist/ai/mission.js.map +1 -0
- package/dist/ai/missionRules.d.ts +1 -1
- package/dist/ai/missionRules.js +26 -0
- package/dist/ai/missionRules.js.map +1 -0
- package/dist/ai/module.d.ts +6 -2
- package/dist/ai/module.js +37 -0
- package/dist/ai/module.js.map +1 -0
- package/dist/ai/options.d.ts +3 -3
- package/dist/ai/plans/build.d.ts +20 -1
- package/dist/ai/plans/build.js +608 -0
- package/dist/ai/plans/build.js.map +1 -0
- package/dist/ai/plans/placement.d.ts +4 -1
- package/dist/ai/plans/placement.js +295 -0
- package/dist/ai/plans/placement.js.map +1 -0
- package/dist/ai/plans/plans.d.ts +9 -0
- package/dist/ai/plans/plans.js +110 -0
- package/dist/ai/plans/plans.js.map +1 -0
- package/dist/ai/plans/production.d.ts +14 -2
- package/dist/ai/plans/production.js +434 -0
- package/dist/ai/plans/production.js.map +1 -0
- package/dist/ai/plans/purse.d.ts +6 -3
- package/dist/ai/plans/purse.js +139 -0
- package/dist/ai/plans/purse.js.map +1 -0
- package/dist/ai/plans/tech.d.ts +6 -0
- package/dist/ai/plans/tech.js +122 -0
- package/dist/ai/plans/tech.js.map +1 -0
- package/dist/ai/profiles.d.ts +4 -4
- package/dist/{profiles-B3NS9jwk.js → ai/profiles.js} +3 -98
- package/dist/ai/profiles.js.map +1 -0
- package/dist/ai/reach.js +54 -0
- package/dist/ai/reach.js.map +1 -0
- package/dist/ai/report.d.ts +8 -0
- package/dist/ai/report.js +87 -0
- package/dist/ai/report.js.map +1 -0
- package/dist/ai/roles.d.ts +4 -0
- package/dist/ai/roles.js +207 -0
- package/dist/ai/roles.js.map +1 -0
- package/dist/ai/rules.d.ts +8 -2
- package/dist/ai/rules.js +416 -0
- package/dist/ai/rules.js.map +1 -0
- package/dist/ai/scouting.d.ts +6 -0
- package/dist/ai/scouting.js +324 -0
- package/dist/ai/scouting.js.map +1 -0
- package/dist/ai/settings.js +99 -0
- package/dist/ai/settings.js.map +1 -0
- package/dist/ai/squads.d.ts +21 -2
- package/dist/ai/squads.js +916 -0
- package/dist/ai/squads.js.map +1 -0
- package/dist/ai/strength.js +320 -0
- package/dist/ai/strength.js.map +1 -0
- package/dist/ai/task.d.ts +3 -1
- package/dist/ai/task.js +17 -0
- package/dist/ai/task.js.map +1 -0
- package/dist/ai/tasks/attack.js +24 -0
- package/dist/ai/tasks/attack.js.map +1 -0
- package/dist/ai/tasks/capture.d.ts +3 -3
- package/dist/ai/tasks/capture.js +37 -0
- package/dist/ai/tasks/capture.js.map +1 -0
- package/dist/ai/tasks/creep.js +29 -0
- package/dist/ai/tasks/creep.js.map +1 -0
- package/dist/ai/tasks/defend.js +61 -0
- package/dist/ai/tasks/defend.js.map +1 -0
- package/dist/ai/tasks/drop.js +81 -0
- package/dist/ai/tasks/drop.js.map +1 -0
- package/dist/ai/tasks/escort.js +59 -0
- package/dist/ai/tasks/escort.js.map +1 -0
- package/dist/ai/tasks/gather.js +48 -0
- package/dist/ai/tasks/gather.js.map +1 -0
- package/dist/ai/tasks/harass.js +39 -0
- package/dist/ai/tasks/harass.js.map +1 -0
- package/dist/ai/tasks/hold.js +32 -0
- package/dist/ai/tasks/hold.js.map +1 -0
- package/dist/ai/tasks/index.js +34 -0
- package/dist/ai/tasks/index.js.map +1 -0
- package/dist/ai/tasks/move.js +26 -0
- package/dist/ai/tasks/move.js.map +1 -0
- package/dist/ai/tasks/patrol.js +59 -0
- package/dist/ai/tasks/patrol.js.map +1 -0
- package/dist/ai/tasks/retreat.js +28 -0
- package/dist/ai/tasks/retreat.js.map +1 -0
- package/dist/ai/tasks/scout.js +73 -0
- package/dist/ai/tasks/scout.js.map +1 -0
- package/dist/ai/tasks/shared.d.ts +1 -1
- package/dist/ai/tasks/shared.js +137 -0
- package/dist/ai/tasks/shared.js.map +1 -0
- package/dist/ai/team.d.ts +18 -1
- package/dist/ai/team.js +492 -0
- package/dist/ai/team.js.map +1 -0
- package/dist/ai/threat.d.ts +6 -0
- package/dist/ai/threat.js +206 -0
- package/dist/ai/threat.js.map +1 -0
- package/dist/ai/view.d.ts +21 -7
- package/dist/ai/view.js +677 -0
- package/dist/ai/view.js.map +1 -0
- package/dist/ai/waves.d.ts +6 -0
- package/dist/ai/waves.js +410 -0
- package/dist/ai/waves.js.map +1 -0
- package/dist/ai.js +54 -6239
- package/dist/aiTesting.d.ts +6 -3
- package/dist/aiTesting.js +229 -0
- package/dist/aiTesting.js.map +1 -0
- package/dist/areas.d.ts +4 -1
- package/dist/areas.js +295 -0
- package/dist/areas.js.map +1 -0
- package/dist/attacks.d.ts +3 -3
- package/dist/attacks.js +127 -0
- package/dist/attacks.js.map +1 -0
- package/dist/burning.d.ts +267 -0
- package/dist/burning.js +795 -0
- package/dist/burning.js.map +1 -0
- package/dist/bytes.js +21 -0
- package/dist/bytes.js.map +1 -0
- package/dist/callings.d.ts +71 -0
- package/dist/callings.js +157 -0
- package/dist/callings.js.map +1 -0
- package/dist/cameraOrders.d.ts +78 -0
- package/dist/cameraOrders.js +114 -0
- package/dist/cameraOrders.js.map +1 -0
- package/dist/camps.d.ts +70 -4
- package/dist/camps.js +501 -0
- package/dist/camps.js.map +1 -0
- package/dist/capture.d.ts +15 -3
- package/dist/capture.js +304 -0
- package/dist/capture.js.map +1 -0
- package/dist/cellLayers.d.ts +78 -13
- package/dist/cellLayers.js +275 -0
- package/dist/cellLayers.js.map +1 -0
- package/dist/cellPatches.d.ts +24 -0
- package/dist/cellPatches.js +73 -0
- package/dist/cellPatches.js.map +1 -0
- package/dist/cinematics.d.ts +10 -5
- package/dist/cinematics.js +161 -0
- package/dist/cinematics.js.map +1 -0
- package/dist/clock.d.ts +2 -2
- package/dist/clock.js +78 -0
- package/dist/clock.js.map +1 -0
- package/dist/commands.d.ts +36 -4
- package/dist/commands.js +636 -0
- package/dist/commands.js.map +1 -0
- package/dist/components.d.ts +31 -10
- package/dist/components.js +74 -0
- package/dist/components.js.map +1 -0
- package/dist/computers.d.ts +4 -4
- package/dist/computers.js +194 -0
- package/dist/computers.js.map +1 -0
- package/dist/concealment.d.ts +25 -2
- package/dist/concealment.js +409 -0
- package/dist/concealment.js.map +1 -0
- package/dist/coreComponents.js +130 -0
- package/dist/coreComponents.js.map +1 -0
- package/dist/createGame.d.ts +306 -0
- package/dist/createGame.js +405 -0
- package/dist/createGame.js.map +1 -0
- package/dist/dashing.d.ts +18 -2
- package/dist/dashing.js +41 -0
- package/dist/dashing.js.map +1 -0
- package/dist/debug.d.ts +8 -0
- package/dist/debug.js +5 -3
- package/dist/debug2.js +76 -0
- package/dist/debug2.js.map +1 -0
- package/dist/debugCommands.d.ts +6 -6
- package/dist/debugCommands.js +537 -0
- package/dist/debugCommands.js.map +1 -0
- package/dist/debugging.d.ts +1 -0
- package/dist/defaultSets.d.ts +183 -0
- package/dist/defaultSets.js +216 -0
- package/dist/defaultSets.js.map +1 -0
- package/dist/definitions.d.ts +6 -0
- package/dist/definitions.js +78 -0
- package/dist/definitions.js.map +1 -0
- package/dist/defs.d.ts +1895 -165
- package/dist/defs.js +380 -0
- package/dist/defs.js.map +1 -0
- package/dist/denying.d.ts +4 -4
- package/dist/denying.js +106 -0
- package/dist/denying.js.map +1 -0
- package/dist/destructibles.d.ts +2 -2
- package/dist/destructibles.js +36 -0
- package/dist/destructibles.js.map +1 -0
- package/dist/determinism.d.ts +4 -4
- package/dist/determinism.js +247 -0
- package/dist/determinism.js.map +1 -0
- package/dist/dialog.d.ts +17 -2
- package/dist/dialog.js +108 -0
- package/dist/dialog.js.map +1 -0
- package/dist/effectRefs.js +28 -0
- package/dist/effectRefs.js.map +1 -0
- package/dist/effects.d.ts +27 -11
- package/dist/effects.js +110 -0
- package/dist/effects.js.map +1 -0
- package/dist/endings.d.ts +1 -1
- package/dist/endings.js +78 -0
- package/dist/endings.js.map +1 -0
- package/dist/engagement.d.ts +40 -6
- package/dist/engagement.js +530 -0
- package/dist/engagement.js.map +1 -0
- package/dist/engineEvents.d.ts +72 -9
- package/dist/engineEvents.js +520 -0
- package/dist/engineEvents.js.map +1 -0
- package/dist/entity.d.ts +275 -26
- package/dist/entity.js +441 -0
- package/dist/entity.js.map +1 -0
- package/dist/entityIndex.d.ts +10 -3
- package/dist/entityIndex.js +149 -0
- package/dist/entityIndex.js.map +1 -0
- package/dist/errors.d.ts +6 -2
- package/dist/errors.js +59 -0
- package/dist/errors.js.map +1 -0
- package/dist/events.d.ts +11 -5
- package/dist/events.js +158 -0
- package/dist/events.js.map +1 -0
- package/dist/exactMath.js +273 -0
- package/dist/exactMath.js.map +1 -0
- package/dist/features.d.ts +1 -1
- package/dist/features.js +127 -0
- package/dist/features.js.map +1 -0
- package/dist/fields.d.ts +25 -5
- package/dist/fields.js +140 -0
- package/dist/fields.js.map +1 -0
- package/dist/fixture.d.ts +3 -3
- package/dist/fixture.js +512 -0
- package/dist/fixture.js.map +1 -0
- package/dist/fog.d.ts +26 -3
- package/dist/fog.js +333 -0
- package/dist/fog.js.map +1 -0
- package/dist/foliage.d.ts +476 -0
- package/dist/foliage.js +1478 -0
- package/dist/foliage.js.map +1 -0
- package/dist/foliageDebug.d.ts +57 -0
- package/dist/foliageDebug.js +172 -0
- package/dist/foliageDebug.js.map +1 -0
- package/dist/foliageRegrowth.d.ts +20 -0
- package/dist/foliageRegrowth.js +332 -0
- package/dist/foliageRegrowth.js.map +1 -0
- package/dist/formState.d.ts +67 -0
- package/dist/formState.js +65 -0
- package/dist/formState.js.map +1 -0
- package/dist/formation.d.ts +46 -8
- package/dist/formation.js +297 -0
- package/dist/formation.js.map +1 -0
- package/dist/forms.d.ts +58 -0
- package/dist/forms.js +146 -0
- package/dist/forms.js.map +1 -0
- package/dist/friendlyFire.d.ts +2 -2
- package/dist/friendlyFire.js +37 -0
- package/dist/friendlyFire.js.map +1 -0
- package/dist/game.d.ts +141 -48
- package/dist/game.js +834 -0
- package/dist/game.js.map +1 -0
- package/dist/gameData.d.ts +96 -22
- package/dist/gameData.js +1690 -0
- package/dist/gameData.js.map +1 -0
- package/dist/gameFiles.d.ts +3 -3
- package/dist/gameFiles.js +14 -0
- package/dist/gameFiles.js.map +1 -0
- package/dist/gates.js +92 -0
- package/dist/gates.js.map +1 -0
- package/dist/generate.d.ts +28 -1
- package/dist/generate.js +1062 -0
- package/dist/generate.js.map +1 -0
- package/dist/generateWorker.d.ts +7 -3
- package/dist/generateWorker.js +86 -0
- package/dist/generateWorker.js.map +1 -0
- package/dist/grid.d.ts +9 -0
- package/dist/grid.js +102 -0
- package/dist/grid.js.map +1 -0
- package/dist/ground.d.ts +17 -1
- package/dist/ground.js +375 -0
- package/dist/ground.js.map +1 -0
- package/dist/groundObjects.d.ts +70 -0
- package/dist/groundObjects.js +371 -0
- package/dist/groundObjects.js.map +1 -0
- package/dist/groundSpeed.d.ts +20 -3
- package/dist/groundSpeed.js +117 -0
- package/dist/groundSpeed.js.map +1 -0
- package/dist/hero.d.ts +126 -10
- package/dist/hero.js +432 -0
- package/dist/hero.js.map +1 -0
- package/dist/holds.d.ts +94 -0
- package/dist/holds.js +305 -0
- package/dist/holds.js.map +1 -0
- package/dist/home.d.ts +1 -1
- package/dist/home.js +30 -0
- package/dist/home.js.map +1 -0
- package/dist/hooks.d.ts +339 -57
- package/dist/hooks.js +105 -0
- package/dist/hooks.js.map +1 -0
- package/dist/hotReload.d.ts +6 -5
- package/dist/hotReload.js +145 -0
- package/dist/hotReload.js.map +1 -0
- package/dist/ids.d.ts +3 -3
- package/dist/ids.js +30 -0
- package/dist/ids.js.map +1 -0
- package/dist/idsFile.d.ts +36 -0
- package/dist/idsFile.js +134 -0
- package/dist/idsFile.js.map +1 -0
- package/dist/index.d.ts +105 -68
- package/dist/index.js +194 -4701
- package/dist/inspect.d.ts +29 -2
- package/dist/{inspect-D9dWHmZ0.js → inspect.js} +21 -12
- package/dist/inspect.js.map +1 -0
- package/dist/inventory.d.ts +14 -1
- package/dist/inventory.js +84 -0
- package/dist/inventory.js.map +1 -0
- package/dist/items.d.ts +136 -8
- package/dist/items.js +585 -0
- package/dist/items.js.map +1 -0
- package/dist/lanes.d.ts +12 -3
- package/dist/lanes.js +496 -0
- package/dist/lanes.js.map +1 -0
- package/dist/life.d.ts +6 -2
- package/dist/life.js +287 -0
- package/dist/life.js.map +1 -0
- package/dist/log.d.ts +26 -3
- package/dist/log.js +192 -0
- package/dist/log.js.map +1 -0
- package/dist/manaBurn.d.ts +2 -2
- package/dist/manaBurn.js +75 -0
- package/dist/manaBurn.js.map +1 -0
- package/dist/map/file.d.ts +56 -3
- package/dist/map/file.js +264 -0
- package/dist/map/file.js.map +1 -0
- package/dist/map/images.js +61 -0
- package/dist/map/images.js.map +1 -0
- package/dist/map/look.d.ts +1 -1
- package/dist/map/look.js +30 -0
- package/dist/map/look.js.map +1 -0
- package/dist/map/pathProfile.js +183 -0
- package/dist/map/pathProfile.js.map +1 -0
- package/dist/map/resize.d.ts +4 -0
- package/dist/map/resize.js +136 -0
- package/dist/map/resize.js.map +1 -0
- package/dist/map/schema.js +257 -0
- package/dist/map/schema.js.map +1 -0
- package/dist/map/terrain.js +214 -0
- package/dist/map/terrain.js.map +1 -0
- package/dist/map/types.d.ts +92 -13
- package/dist/map/types.js +251 -0
- package/dist/map/types.js.map +1 -0
- package/dist/mapCheck/cells.js +94 -0
- package/dist/mapCheck/cells.js.map +1 -0
- package/dist/mapCheck/rules/foliage.d.ts +9 -0
- package/dist/mapCheck/rules/foliage.js +83 -0
- package/dist/mapCheck/rules/foliage.js.map +1 -0
- package/dist/mapCheck/rules/names.js +39 -0
- package/dist/mapCheck/rules/names.js.map +1 -0
- package/dist/mapCheck/rules/objects.d.ts +1 -1
- package/dist/mapCheck/rules/objects.js +56 -0
- package/dist/mapCheck/rules/objects.js.map +1 -0
- package/dist/mapCheck/rules/paths.js +32 -0
- package/dist/mapCheck/rules/paths.js.map +1 -0
- package/dist/mapCheck/rules/players.js +20 -0
- package/dist/mapCheck/rules/players.js.map +1 -0
- package/dist/mapCheck/rules/races.js +56 -0
- package/dist/mapCheck/rules/races.js.map +1 -0
- package/dist/mapCheck/rules/random.js +47 -0
- package/dist/mapCheck/rules/random.js.map +1 -0
- package/dist/mapCheck/rules/regions.js +30 -0
- package/dist/mapCheck/rules/regions.js.map +1 -0
- package/dist/mapCheck/rules/targets.js +31 -0
- package/dist/mapCheck/rules/targets.js.map +1 -0
- package/dist/mapCheck/rules/walking.js +45 -0
- package/dist/mapCheck/rules/walking.js.map +1 -0
- package/dist/mapCheck.d.ts +2 -2
- package/dist/mapCheck.js +63 -0
- package/dist/mapCheck.js.map +1 -0
- package/dist/mapFields.d.ts +25 -2
- package/dist/mapFields.js +134 -0
- package/dist/mapFields.js.map +1 -0
- package/dist/mapFile.js +176 -0
- package/dist/mapFile.js.map +1 -0
- package/dist/mapMeasure.d.ts +8 -0
- package/dist/mapMeasure.js +283 -0
- package/dist/mapMeasure.js.map +1 -0
- package/dist/mapMerge.d.ts +1 -0
- package/dist/mapMerge.js +172 -0
- package/dist/mapMerge.js.map +1 -0
- package/dist/mapObjectives.js +138 -0
- package/dist/mapObjectives.js.map +1 -0
- package/dist/mapObjects.js +80 -0
- package/dist/mapObjects.js.map +1 -0
- package/dist/math.d.ts +37 -7
- package/dist/math.js +155 -0
- package/dist/math.js.map +1 -0
- package/dist/messages.d.ts +71 -4
- package/dist/messages.js +29 -0
- package/dist/messages.js.map +1 -0
- package/dist/missionRules.d.ts +10 -2
- package/dist/{missionRules-C-bGxm0Q.js → missionRules.js} +30 -150
- package/dist/missionRules.js.map +1 -0
- package/dist/mods.d.ts +39 -20
- package/dist/mods.js +271 -0
- package/dist/mods.js.map +1 -0
- package/dist/moves.d.ts +87 -0
- package/dist/moves.js +539 -0
- package/dist/moves.js.map +1 -0
- package/dist/names.d.ts +7 -0
- package/dist/names.js +122 -0
- package/dist/names.js.map +1 -0
- package/dist/navigation/agentParams.js +14 -0
- package/dist/navigation/agentParams.js.map +1 -0
- package/dist/navigation/air.d.ts +7 -3
- package/dist/navigation/air.js +401 -0
- package/dist/navigation/air.js.map +1 -0
- package/dist/navigation/builds.d.ts +34 -2
- package/dist/navigation/builds.js +287 -0
- package/dist/navigation/builds.js.map +1 -0
- package/dist/navigation/groundAreas.d.ts +59 -1
- package/dist/navigation/groundAreas.js +407 -0
- package/dist/navigation/groundAreas.js.map +1 -0
- package/dist/navigation/navigation.d.ts +98 -9
- package/dist/navigation/recast.d.ts +194 -18
- package/dist/navigation/recast.js +1379 -0
- package/dist/navigation/recast.js.map +1 -0
- package/dist/navigation/sidePaths.d.ts +8 -3
- package/dist/navigation/sidePaths.js +241 -0
- package/dist/navigation/sidePaths.js.map +1 -0
- package/dist/navigation/sized.js +243 -0
- package/dist/navigation/sized.js.map +1 -0
- package/dist/nearest.js +32 -0
- package/dist/nearest.js.map +1 -0
- package/dist/noise.js +59 -0
- package/dist/noise.js.map +1 -0
- package/dist/objectives.d.ts +12 -3
- package/dist/objectives.js +144 -0
- package/dist/objectives.js.map +1 -0
- package/dist/orders/basic.d.ts +5 -5
- package/dist/orders/basic.js +417 -0
- package/dist/orders/basic.js.map +1 -0
- package/dist/orders/build.js +278 -0
- package/dist/orders/build.js.map +1 -0
- package/dist/orders/cast.d.ts +13 -3
- package/dist/orders/cast.js +558 -0
- package/dist/orders/cast.js.map +1 -0
- package/dist/orders/facts.js +16 -0
- package/dist/orders/facts.js.map +1 -0
- package/dist/orders/harvest.d.ts +21 -5
- package/dist/orders/harvest.js +540 -0
- package/dist/orders/harvest.js.map +1 -0
- package/dist/orders/idle.d.ts +3 -1
- package/dist/orders/idle.js +234 -0
- package/dist/orders/idle.js.map +1 -0
- package/dist/orders/items.js +92 -0
- package/dist/orders/items.js.map +1 -0
- package/dist/orders/queue.js +108 -0
- package/dist/orders/queue.js.map +1 -0
- package/dist/orders/waiting.d.ts +39 -0
- package/dist/orders/waiting.js +149 -0
- package/dist/orders/waiting.js.map +1 -0
- package/dist/pack.schema.js +13 -0
- package/dist/pack.schema.js.map +1 -0
- package/dist/pack.schema.json +7622 -841
- package/dist/packs/director/index.d.ts +13 -5
- package/dist/packs/director/index.js +204 -0
- package/dist/packs/director/index.js.map +1 -0
- package/dist/packs/heroes/campaign.d.ts +3 -2
- package/dist/packs/heroes/campaign.js +241 -0
- package/dist/packs/heroes/campaign.js.map +1 -0
- package/dist/packs/heroes/carry.d.ts +6 -0
- package/dist/packs/heroes/carry.js +112 -0
- package/dist/packs/heroes/carry.js.map +1 -0
- package/dist/packs/heroes/commands.js +115 -0
- package/dist/packs/heroes/commands.js.map +1 -0
- package/dist/packs/heroes/fallen.d.ts +43 -0
- package/dist/packs/heroes/fallen.js +61 -0
- package/dist/packs/heroes/fallen.js.map +1 -0
- package/dist/packs/heroes/hire.js +60 -0
- package/dist/packs/heroes/hire.js.map +1 -0
- package/dist/packs/heroes/index.d.ts +7 -6
- package/dist/packs/heroes/index.js +130 -0
- package/dist/packs/heroes/index.js.map +1 -0
- package/dist/packs/heroes/loop.d.ts +95 -0
- package/dist/packs/heroes/loop.js +250 -0
- package/dist/packs/heroes/loop.js.map +1 -0
- package/dist/packs/heroes/making.d.ts +6 -3
- package/dist/packs/heroes/making.js +55 -0
- package/dist/packs/heroes/making.js.map +1 -0
- package/dist/packs/heroes/respawn.d.ts +3 -3
- package/dist/packs/heroes/respawn.js +87 -0
- package/dist/packs/heroes/respawn.js.map +1 -0
- package/dist/packs/heroes/sets.d.ts +32 -0
- package/dist/packs/heroes/sets.js +51 -0
- package/dist/packs/heroes/sets.js.map +1 -0
- package/dist/packs/heroes/spells.d.ts +16 -0
- package/dist/packs/heroes/spells.js +269 -0
- package/dist/packs/heroes/spells.js.map +1 -0
- package/dist/packs/items/defaults.d.ts +43 -0
- package/dist/packs/items/defaults.js +1504 -0
- package/dist/packs/items/defaults.js.map +1 -0
- package/dist/packs/items/index.d.ts +27 -0
- package/dist/packs/items/index.js +214 -0
- package/dist/packs/items/index.js.map +1 -0
- package/dist/packs/moba/index.d.ts +3 -3
- package/dist/packs/moba/index.js +174 -0
- package/dist/packs/moba/index.js.map +1 -0
- package/dist/packs/pack.d.ts +15 -15
- package/dist/packs/pack.js +14 -0
- package/dist/packs/pack.js.map +1 -0
- package/dist/packs.d.ts +15 -7
- package/dist/packs.js +222 -0
- package/dist/packs.js.map +1 -0
- package/dist/paths.d.ts +2 -0
- package/dist/paths.js +109 -0
- package/dist/paths.js.map +1 -0
- package/dist/plain.js +57 -0
- package/dist/plain.js.map +1 -0
- package/dist/player.d.ts +33 -10
- package/dist/player.js +159 -0
- package/dist/player.js.map +1 -0
- package/dist/portals.d.ts +1 -1
- package/dist/portals.js +194 -0
- package/dist/portals.js.map +1 -0
- package/dist/prefabs.d.ts +25 -2
- package/dist/prefabs.js +239 -0
- package/dist/prefabs.js.map +1 -0
- package/dist/presetBuildings.js +58 -0
- package/dist/presetBuildings.js.map +1 -0
- package/dist/presetFoliage.d.ts +27 -0
- package/dist/presetFoliage.js +98 -0
- package/dist/presetFoliage.js.map +1 -0
- package/dist/presetGround.js +65 -0
- package/dist/presetGround.js.map +1 -0
- package/dist/proxies.d.ts +12 -0
- package/dist/proxies.js +79 -0
- package/dist/proxies.js.map +1 -0
- package/dist/query.d.ts +56 -0
- package/dist/query.js +88 -0
- package/dist/query.js.map +1 -0
- package/dist/races.d.ts +15 -14
- package/dist/races.js +172 -0
- package/dist/races.js.map +1 -0
- package/dist/randomGroups.js +91 -0
- package/dist/randomGroups.js.map +1 -0
- package/dist/registry.d.ts +117 -53
- package/dist/registry.js +323 -0
- package/dist/registry.js.map +1 -0
- package/dist/remains.d.ts +11 -9
- package/dist/remains.js +188 -0
- package/dist/remains.js.map +1 -0
- package/dist/replication.d.ts +12 -7
- package/dist/replication.js +100 -0
- package/dist/replication.js.map +1 -0
- package/dist/rng.d.ts +2 -0
- package/dist/rng.js +40 -0
- package/dist/rng.js.map +1 -0
- package/dist/rules.d.ts +186 -99
- package/dist/rules.js +179 -0
- package/dist/rules.js.map +1 -0
- package/dist/rulesCheck.d.ts +5 -4
- package/dist/rulesCheck.js +693 -0
- package/dist/rulesCheck.js.map +1 -0
- package/dist/runes.d.ts +2 -2
- package/dist/runes.js +80 -0
- package/dist/runes.js.map +1 -0
- package/dist/save.d.ts +37 -12
- package/dist/save.js +532 -0
- package/dist/save.js.map +1 -0
- package/dist/scenario.d.ts +2 -2
- package/dist/scenario.js +99 -0
- package/dist/scenario.js.map +1 -0
- package/dist/scheduler.d.ts +3 -0
- package/dist/scheduler.js +156 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/score.d.ts +19 -19
- package/dist/score.js +709 -0
- package/dist/score.js.map +1 -0
- package/dist/sequences.d.ts +10 -6
- package/dist/sequences.js +206 -0
- package/dist/sequences.js.map +1 -0
- package/dist/server/doorman.js +154 -0
- package/dist/server/doorman.js.map +1 -0
- package/dist/server/gameServer.d.ts +16 -1
- package/dist/server/gameServer.js +643 -0
- package/dist/server/gameServer.js.map +1 -0
- package/dist/server/index.d.ts +1 -1
- package/dist/server/lobby.js +199 -0
- package/dist/server/lobby.js.map +1 -0
- package/dist/server/log.js +18 -0
- package/dist/server/log.js.map +1 -0
- package/dist/server/match.js +267 -0
- package/dist/server/match.js.map +1 -0
- package/dist/server/mode.d.ts +18 -9
- package/dist/server/mode.js +220 -0
- package/dist/server/mode.js.map +1 -0
- package/dist/{navigation-worker.js → server/navigation-worker.js} +1 -1
- package/dist/server/navigation-worker.js.map +1 -0
- package/dist/server/navigation.js +39 -0
- package/dist/server/navigation.js.map +1 -0
- package/dist/server/ops.d.ts +4 -0
- package/dist/server/ops.js +137 -0
- package/dist/server/ops.js.map +1 -0
- package/dist/server/packs.d.ts +3 -3
- package/dist/server/packs.js +32 -0
- package/dist/server/packs.js.map +1 -0
- package/dist/server/ratings.d.ts +5 -0
- package/dist/server/ratings.js +104 -0
- package/dist/server/ratings.js.map +1 -0
- package/dist/server/relay.d.ts +12 -2
- package/dist/server/relay.js +144 -0
- package/dist/server/relay.js.map +1 -0
- package/dist/server/rooms.d.ts +9 -2
- package/dist/server/rooms.js +442 -0
- package/dist/server/rooms.js.map +1 -0
- package/dist/server/seat.js +116 -0
- package/dist/server/seat.js.map +1 -0
- package/dist/server/seatSettings.d.ts +3 -3
- package/dist/server/seatSettings.js +63 -0
- package/dist/server/seatSettings.js.map +1 -0
- package/dist/server/secret.js +13 -0
- package/dist/server/secret.js.map +1 -0
- package/dist/server/start.d.ts +13 -6
- package/dist/server/start.js +76 -0
- package/dist/server/start.js.map +1 -0
- package/dist/server/websocket.d.ts +9 -1
- package/dist/server/websocket.js +306 -0
- package/dist/server/websocket.js.map +1 -0
- package/dist/server.js +15 -2861
- package/dist/session/can.js +26 -0
- package/dist/session/can.js.map +1 -0
- package/dist/session/commandReplay.d.ts +8 -2
- package/dist/session/commandReplay.js +293 -0
- package/dist/session/commandReplay.js.map +1 -0
- package/dist/session/debug.js +151 -0
- package/dist/session/debug.js.map +1 -0
- package/dist/session/delay.js +62 -0
- package/dist/session/delay.js.map +1 -0
- package/dist/session/delta.d.ts +14 -1
- package/dist/session/delta.js +407 -0
- package/dist/session/delta.js.map +1 -0
- package/dist/session/entityState.js +415 -0
- package/dist/session/entityState.js.map +1 -0
- package/dist/session/local.d.ts +47 -5
- package/dist/session/local.js +670 -0
- package/dist/session/local.js.map +1 -0
- package/dist/session/memory.d.ts +20 -2
- package/dist/session/memory.js +131 -0
- package/dist/session/memory.js.map +1 -0
- package/dist/session/protocol.d.ts +325 -31
- package/dist/session/protocol.js +55 -0
- package/dist/session/protocol.js.map +1 -0
- package/dist/session/remote.d.ts +74 -12
- package/dist/session/remote.js +1394 -0
- package/dist/session/remote.js.map +1 -0
- package/dist/session/replay.d.ts +11 -2
- package/dist/session/replay.js +160 -0
- package/dist/session/replay.js.map +1 -0
- package/dist/session/seed.js +12 -0
- package/dist/session/seed.js.map +1 -0
- package/dist/session/share.d.ts +5 -1
- package/dist/session/share.js +94 -0
- package/dist/session/share.js.map +1 -0
- package/dist/session/socket.d.ts +1 -1
- package/dist/session/socket.js +29 -0
- package/dist/session/socket.js.map +1 -0
- package/dist/session/wire.d.ts +5 -0
- package/dist/session/wire.js +84 -0
- package/dist/session/wire.js.map +1 -0
- package/dist/session/worker.d.ts +77 -12
- package/dist/session/worker.js +499 -0
- package/dist/session/worker.js.map +1 -0
- package/dist/shared.d.ts +31 -5
- package/dist/shared.js +166 -0
- package/dist/shared.js.map +1 -0
- package/dist/sides.d.ts +9 -3
- package/dist/sides.js +149 -0
- package/dist/sides.js.map +1 -0
- package/dist/sight.js +85 -0
- package/dist/sight.js.map +1 -0
- package/dist/simulate-worker.js +1 -1
- package/dist/simulate.d.ts +12 -8
- package/dist/{simulate-oXBiw1Ff.js → simulate.js} +10 -11
- package/dist/simulate.js.map +1 -0
- package/dist/smart.js +77 -0
- package/dist/smart.js.map +1 -0
- package/dist/spatial.d.ts +32 -16
- package/dist/spatial.js +234 -0
- package/dist/spatial.js.map +1 -0
- package/dist/spawning.d.ts +1 -0
- package/dist/spawning.js +224 -0
- package/dist/spawning.js.map +1 -0
- package/dist/stances.d.ts +6 -3
- package/dist/stances.js +169 -0
- package/dist/stances.js.map +1 -0
- package/dist/start.d.ts +10 -10
- package/dist/start.js +75 -0
- package/dist/start.js.map +1 -0
- package/dist/stats.d.ts +42 -16
- package/dist/stats.js +290 -0
- package/dist/stats.js.map +1 -0
- package/dist/summoned.d.ts +52 -0
- package/dist/summoned.js +38 -0
- package/dist/summoned.js.map +1 -0
- package/dist/summons.d.ts +10 -13
- package/dist/summons.js +271 -0
- package/dist/summons.js.map +1 -0
- package/dist/systems/abilities.js +224 -0
- package/dist/systems/abilities.js.map +1 -0
- package/dist/systems/combat.d.ts +35 -1
- package/dist/systems/combat.js +677 -0
- package/dist/systems/combat.js.map +1 -0
- package/dist/systems/combatTold.d.ts +3 -1
- package/dist/systems/combatTold.js +85 -0
- package/dist/systems/combatTold.js.map +1 -0
- package/dist/systems/construction.js +80 -0
- package/dist/systems/construction.js.map +1 -0
- package/dist/systems/economy.d.ts +0 -6
- package/dist/systems/economy.js +128 -0
- package/dist/systems/economy.js.map +1 -0
- package/dist/systems/fog.d.ts +1 -1
- package/dist/systems/fog.js +120 -0
- package/dist/systems/fog.js.map +1 -0
- package/dist/systems/life.js +32 -0
- package/dist/systems/life.js.map +1 -0
- package/dist/systems/movement.d.ts +24 -12
- package/dist/systems/movement.js +1247 -0
- package/dist/systems/movement.js.map +1 -0
- package/dist/systems/orders.js +64 -0
- package/dist/systems/orders.js.map +1 -0
- package/dist/systems/production.js +322 -0
- package/dist/systems/production.js.map +1 -0
- package/dist/systems/productionQueue.js +120 -0
- package/dist/systems/productionQueue.js.map +1 -0
- package/dist/systems/victory.d.ts +1 -1
- package/dist/systems/victory.js +56 -0
- package/dist/systems/victory.js.map +1 -0
- package/dist/talk.d.ts +6 -6
- package/dist/talk.js +153 -0
- package/dist/talk.js.map +1 -0
- package/dist/targeting.d.ts +142 -0
- package/dist/targeting.js +49 -0
- package/dist/targeting.js.map +1 -0
- package/dist/tech.d.ts +20 -3
- package/dist/tech.js +239 -0
- package/dist/tech.js.map +1 -0
- package/dist/techTree.d.ts +7 -0
- package/dist/techTree.js +90 -0
- package/dist/techTree.js.map +1 -0
- package/dist/terrain.d.ts +59 -7
- package/dist/terrain.js +389 -0
- package/dist/terrain.js.map +1 -0
- package/dist/terrainSave.d.ts +6 -0
- package/dist/terrainSave.js +74 -0
- package/dist/terrainSave.js.map +1 -0
- package/dist/testing.d.ts +8 -7
- package/dist/testing.js +13 -739
- package/dist/testing.js.map +1 -1
- package/dist/tiles.d.ts +1 -1
- package/dist/tiles.js +43 -0
- package/dist/tiles.js.map +1 -0
- package/dist/timers.d.ts +29 -4
- package/dist/timers.js +242 -0
- package/dist/timers.js.map +1 -0
- package/dist/tomes.d.ts +4 -4
- package/dist/tomes.js +94 -0
- package/dist/tomes.js.map +1 -0
- package/dist/trade.js +103 -0
- package/dist/trade.js.map +1 -0
- package/dist/transport.d.ts +6 -1
- package/dist/transport.js +281 -0
- package/dist/transport.js.map +1 -0
- package/dist/tunables.d.ts +10 -3
- package/dist/tunables.js +56 -0
- package/dist/tunables.js.map +1 -0
- package/dist/unitResources.d.ts +67 -0
- package/dist/unitResources.js +266 -0
- package/dist/unitResources.js.map +1 -0
- package/dist/upkeep.d.ts +6 -1
- package/dist/upkeep.js +26 -0
- package/dist/upkeep.js.map +1 -0
- package/dist/veterancy.d.ts +8 -3
- package/dist/veterancy.js +131 -0
- package/dist/veterancy.js.map +1 -0
- package/dist/vision.d.ts +36 -0
- package/dist/vision.js +133 -0
- package/dist/vision.js.map +1 -0
- package/dist/walls.d.ts +1 -1
- package/dist/walls.js +278 -0
- package/dist/walls.js.map +1 -0
- package/dist/world.d.ts +606 -88
- package/dist/world.js +1263 -0
- package/dist/world.js.map +1 -0
- package/package.json +2 -2
- package/dist/ai.js.map +0 -1
- package/dist/attributes.d.ts +0 -66
- package/dist/brain-BvVdUhX8.js +0 -7659
- package/dist/brain-BvVdUhX8.js.map +0 -1
- package/dist/builds-C6LfgvEU.js +0 -460
- package/dist/builds-C6LfgvEU.js.map +0 -1
- package/dist/coreComponents-syuh2fPG.js +0 -5149
- package/dist/coreComponents-syuh2fPG.js.map +0 -1
- package/dist/debugCommands-CzjrSm66.js +0 -14739
- package/dist/debugCommands-CzjrSm66.js.map +0 -1
- package/dist/determinism-BCymQwiE.js +0 -518
- package/dist/determinism-BCymQwiE.js.map +0 -1
- package/dist/game-DiJEN-Ks.js +0 -5800
- package/dist/game-DiJEN-Ks.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/inspect-D9dWHmZ0.js.map +0 -1
- package/dist/local-Dkovq42k.js +0 -1379
- package/dist/local-Dkovq42k.js.map +0 -1
- package/dist/missionRules-C-bGxm0Q.js.map +0 -1
- package/dist/navigation-worker.js.map +0 -1
- package/dist/packs-g5thvmGn.js +0 -3199
- package/dist/packs-g5thvmGn.js.map +0 -1
- package/dist/profiles-B3NS9jwk.js.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/simulate-oXBiw1Ff.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gameData.js","names":[],"sources":["../src/gameData.ts"],"sourcesContent":["import { type CallingDef, callingsOf, withCallings } from './callings'\nimport { type DataCellLayer, dataCellLayersProblem, layCellLayerData } from './cellLayers'\nimport type { AiProfile } from './ai/profiles'\nimport { dispelEffects } from './abilities/dispel'\nimport type { EffectType } from './abilities/effects'\nimport { coreEffects } from './abilities/effects/core'\nimport { COMMON_EFFECT_FIELDS } from './abilities/effectFields'\nimport { defineComponent } from './components'\nimport { dataDefaults, dataDefaultsProblem, type DataSetChoice } from './defaultSets'\nimport type { Definitions } from './definitions'\nimport {\n\ttype AbilityDef,\n\ttype BuffDef,\n\tCORE_STAT_KEYS,\n\ttype ItemDef,\n\ttype ResourceDef,\n\ttype TagDef,\n\ttype UnitTypeDef,\n\ttype UpgradeDef,\n\ttype UpkeepTier\n} from './defs'\nimport { defineEngineEvent } from './events'\nimport { hasPack } from './packs/pack'\nimport { type Check, Invalid, string } from './fields'\nimport type { Rules } from './game'\nimport { rootLogger } from './log'\nimport type { RaceDef } from './races'\nimport type { Registry } from './registry'\nimport { replicateEvent } from './replication'\nimport { summonEffects } from './summons'\n\n/*\n * The game's data in the editor (S61): the numbers and words of a game's definitions (a unit's health, an ability's\n * cooldown) changed in the editor's Data panel, tried at once in a game played there, and kept in the game's\n * `data.json`, which the game reads over what its code says (`layData`). The code stays where a definition is made\n * and what it does; which of its fields can be changed there is the game's to say (`Rules.editable`): a\n * definition has no schema of its own to read.\n */\n\n/**\n * The kinds of definition a game's data is kept for, by the field of the game module they are listed in\n *\n * @beta\n */\nexport const DATA_KINDS = ['units', 'abilities', 'buffs', 'items', 'upgrades', 'races'] as const\n/**\n * The kind of definition a game's data is kept for: one of `DATA_KINDS` (`units`, `abilities`, `buffs`, `items`, `upgrades`, `races`)\n *\n * @beta\n */\nexport type DataKind = (typeof DATA_KINDS)[number]\n\n/**\n * What a definition of each kind must have besides its id and its name, as the type says (`UnitTypeDef.radius`...),\n * with what one made of nothing starts as (`NEW_DEFINITION`: the Data panel's New, from empty). A unit type is a unit\n * unless its `kind` says otherwise\n *\n * @beta\n */\nexport const REQUIRED_FIELDS: Readonly<Record<DataKind, Readonly<DataValues>>> = {\n\tunits: { kind: 'unit', radius: 0.5, stats: { health: 100 }, sight: 8 },\n\tabilities: { target: 'none', effects: [] },\n\tbuffs: {},\n\titems: { cost: {} },\n\tupgrades: { cost: {}, researchTime: 30, effects: [] },\n\traces: {}\n}\n\n/**\n * What a definition in a `data.json` says to be one of its own, made of nothing, where the game has none by its id\n * (`{ \"new\": true, \"name\": \"Peon\", \"stats\": { \"health\": 220 } }`): what its kind must have (`REQUIRED_FIELDS`), its\n * name its id until it says, with what else is said over it. A unit type's `kind` is taken from it too\n *\n * @beta\n */\nexport const NEW_DEFINITION = 'new'\n\n/**\n * A definition made of nothing, by an id: what its kind must have (`REQUIRED_FIELDS`), named by its id\n *\n * @beta\n */\nexport function blankDefinition<K extends DataKind>(kind: K, id: string, unitKind?: string): DataDefs[K] {\n\tconst required = structuredClone(REQUIRED_FIELDS[kind]) as Record<string, unknown>\n\tif (kind === 'units' && unitKind) required.kind = unitKind\n\treturn { id, name: id, ...required } as unknown as DataDefs[K]\n}\n\n/** The kinds of thing a unit type made of nothing may be (`UnitTypeDef.kind`) */\nconst UNIT_KINDS = ['unit', 'building', 'resource']\n\n/**\n * A definition of each kind\n *\n * @beta\n */\nexport interface DataDefs {\n\t/** The unit types of the game, each a `UnitTypeDef` */\n\tunits: UnitTypeDef\n\t/** The abilities of the game, each an `AbilityDef` */\n\tabilities: AbilityDef\n\t/** The buffs of the game, each a `BuffDef` */\n\tbuffs: BuffDef\n\t/** The items of the game, each an `ItemDef` */\n\titems: ItemDef\n\t/** The upgrades of the game, each an `UpgradeDef` */\n\tupgrades: UpgradeDef\n\t/** The races of the game, each a `RaceDef` */\n\traces: RaceDef\n}\n\n/**\n * What a field of the data can hold: a number, words, yes or no\n *\n * @beta\n */\nexport type DataValue = number | string | boolean\n\n/**\n * What a field can be set to: one of those, a list of words (ids: the abilities of a unit, what a building trains), or a\n * list of things whole (the effects of an ability: a `rows` field)\n *\n * @beta\n */\nexport type FieldValue = DataValue | string[] | DataValues[]\n\n/**\n * What a definition in a `data.json` is a copy of, when the game has none by its id: `{ \"copyOf\": \"footman\", \"name\":\n * \"Champion\" }` is a footman by another name. The copy is the definition it names, with what else is said over it,\n * and knows what it is a copy of (`basedOn`)\n *\n * @beta\n */\nexport const COPY_OF = 'copyOf'\n\n/**\n * Values of a definition, as its own fields nest them: `{ stats: { health: 420 }, cost: { gold: 135 } }`. What a\n * `data.json` keeps of each definition, and what `world.redefine` is given. A list of things by place (a unit's attacks)\n * is written as a list or as its places (`{ attacks: { 0: { damagePoint: 0.5 } } }`), each over the thing there. A list\n * of things changed whole (an ability's effects, the units a race's start adds: a `rows` field) written as places goes\n * over the things there, and written as a list is the list: those things, in that order, each in full\n *\n * @beta\n */\nexport interface DataValues {\n\t/** A field of the definition by name: a value, a list of values, or nested values (a `stats` group, a list of `effects`) */\n\t[field: string]: DataValue | DataValue[] | DataValues | DataValues[]\n}\n\n/**\n * The values of a game's definitions, by kind and id: what its `data.json` holds. `removed` takes definitions of the\n * game's out, by kind (the Data panel's Delete): what still names one is the rules' check's to say (`checkRules`)\n *\n * @beta\n */\nexport type GameData = Partial<Record<DataKind, Record<string, DataValues>>> & {\n\tremoved?: Partial<Record<DataKind, string[]>>\n\t/**\n\t * How the game's computers play each race (campaign plan AR4), by race id: each a whole profile, in the place of the\n\t * code's (`Rules.ai.races`). What the editor's Data panel writes of a race's AI\n\t */\n\tai?: { races?: Record<string, AiProfile> }\n\t/** The rules as data (campaign plan RC7), laid over the game's (`DataRules`): what the Data panel's Rules writes */\n\trules?: DataRules\n\t/**\n\t * What the game takes of the default sets it took in code (`useDefaults`), by set id, over what its code chose: all\n\t * of a set, none, only some ids or all but some (`DataSetChoice`): `{ \"items\": { \"except\": [\"sightWard\"] } }`. Laid\n\t * first, so the rest of the file changes what it took\n\t */\n\tdefaults?: Record<string, DataSetChoice>\n\t/**\n\t * The tags named and given a look (`TagDef`), by tag (items-and-spells plan, phase 9): each over the code's `TagDef`\n\t * of that tag, or one of its own. What the Data panel's Tags writes: `{ \"lifesteal\": { \"color\": \"#c04040\", \"filter\": true } }`\n\t */\n\ttags?: Record<string, DataTag>\n\t/**\n\t * The callings heroes may have (`CallingDef`), by id: each over the game's calling of that id (its name, line, icon,\n\t * colour), or one of its own. What the Data panel's Callings writes: `{ \"vanguard\": { \"name\": \"Bulwark\" } }`. A calling\n\t * of the default set is left out with `defaults.callings`\n\t */\n\tcallings?: Record<string, DataCalling>\n\t/**\n\t * The values of the game's layers of cells (`CellLayerDef.values`), by layer: each over the code's value of the same\n\t * number, or one of its own (`DataCellLayer`). What the editor writes of a style of grass made or changed there, its\n\t * name and what it is to the rules (`FoliageStyleDef`): in the game's `data.json` for every map, in a map's\n\t * definitions (`GameMap.definitions`) for that map alone\n\t */\n\tcellLayers?: Record<string, DataCellLayer>\n}\n\n/**\n * What a `data.json` says of a tag (`GameData.tags`): a `TagDef` without its id, over the code's of the same tag\n *\n * @beta\n */\nexport type DataTag = Omit<TagDef, 'id'>\n\n/**\n * What a `data.json` says of a calling (`GameData.callings`): a `CallingDef` without its id, any of it, over the game's\n * of the same id. One of its own is named by its id where it says no name\n *\n * @beta\n */\nexport type DataCalling = Partial<Omit<CallingDef, 'id'>>\n\n/** The fields a tag and a calling of a `data.json` may say, and what each holds */\nconst TAG_FIELDS: Readonly<Record<string, 'string' | 'boolean'>> = { name: 'string', description: 'string', icon: 'string', color: 'string', filter: 'boolean' }\nconst CALLING_FIELDS: Readonly<Record<string, 'string' | 'boolean'>> = { name: 'string', description: 'string', icon: 'string', color: 'string' }\n\n/**\n * Why what a `data.json` says of its tags or callings (`GameData.tags`, `callings`) is not right, where it first is\n * not: nothing when it is\n *\n * @beta\n */\nexport function dataEntriesProblem(section: 'tags' | 'callings', said: unknown): string | undefined {\n\tif (!isRecord(said)) return `${section} is no object by id`\n\tconst known = section === 'tags' ? TAG_FIELDS : CALLING_FIELDS\n\tfor (const [id, entry] of Object.entries(said)) {\n\t\tif (!isRecord(entry)) return `${section}.${id} is no object`\n\t\tfor (const [field, value] of Object.entries(entry)) {\n\t\t\tif (!(field in known)) return `${section}.${id}.${field} is nothing a ${section === 'tags' ? 'tag' : 'calling'} says (${Object.keys(known).join(', ')})`\n\t\t\tif (typeof value !== known[field]) return `${section}.${id}.${field} is no ${known[field] === 'string' ? 'word' : 'yes or no'}`\n\t\t}\n\t}\n\treturn undefined\n}\n\n/** Definitions with what a `data.json` says by id laid over them, field by field; one it says of an id they have not, added */\nfunction layEntries<D extends { id: string }>(list: readonly D[], said: Record<string, object>, made: (id: string) => D): D[] {\n\tconst out = list.map((def) => (said[def.id] ? { ...def, ...said[def.id] } : def))\n\tfor (const [id, entry] of Object.entries(said)) if (!list.some((def) => def.id === id)) out.push({ ...made(id), ...entry })\n\treturn out\n}\n\n/**\n * The rules a `data.json` may say (campaign plan RC7), each over the game's: the supply's and\n * the heroes' numbers, the resources and the upkeep's tiers whole (in place of `Rules.resources`, `upkeep`)\n *\n * @beta\n */\nexport interface DataRules {\n\t/** The supply numbers: `max` is the most supply a player can have, `pools` names the extra supply pools by id with their own `max` */\n\tsupply?: { max?: number; pools?: Record<string, { name: string; max: number }> }\n\t/**\n\t * The hero rules: `maxHeroes` a player may have, `maxHeroLevel` a hero can reach, `xpRange` the distance within which\n\t * units share experience, `assistTime` the seconds within which harm or help makes an assist (0 for none), and\n\t * `buybackCooldown` the seconds a hero bought back waits to be again\n\t */\n\theroes?: { maxHeroes?: number; maxHeroLevel?: number; xpRange?: number; assistTime?: number; buybackCooldown?: number }\n\t/** The resource kinds of the game whole, in place of `Rules.resources` */\n\tresources?: ResourceDef[]\n\t/** The upkeep tiers whole, in place of `Rules.upkeep` */\n\tupkeep?: UpkeepTier[]\n}\n\n/**\n * Why rules said as data are not, where they are first wrong: nothing for rules that are\n *\n * @beta\n */\nexport function dataRulesProblem(rules: unknown): string | undefined {\n\tif (!isRecord(rules)) return 'rules is no object'\n\tconst known = new Set(['supply', 'heroes', 'resources', 'upkeep'])\n\tconst other = Object.keys(rules).find((key) => !known.has(key))\n\tif (other) return `rules.${other} is nothing the rules say as data`\n\tconst number = (value: unknown) => typeof value === 'number' && Number.isFinite(value)\n\tfor (const part of ['supply', 'heroes'] as const) {\n\t\tconst said = rules[part]\n\t\tif (said === undefined) continue\n\t\tif (!isRecord(said)) return `rules.${part} is no object`\n\t\tfor (const [key, value] of Object.entries(said)) if (key !== 'pools' && !number(value)) return `rules.${part}.${key} is no number`\n\t}\n\tfor (const part of ['resources', 'upkeep'] as const) {\n\t\tconst said = rules[part]\n\t\tif (said !== undefined && (!Array.isArray(said) || !said.every(isRecord))) return `rules.${part} is no list`\n\t}\n\treturn undefined\n}\n\n/** The game with the rules a `data.json` says laid over its own */\nfunction withDataRules(game: Rules, rules: DataRules): Rules {\n\tconst out: Rules = { ...game }\n\tconst own = game.settings ?? {}\n\tconst next: Record<string, unknown> = { ...own }\n\tif (rules.supply) next.supply = { ...own.supply, ...rules.supply }\n\tif (rules.heroes) next.heroes = { ...own.heroes, ...rules.heroes }\n\tif (rules.supply || rules.heroes) out.settings = next as Rules['settings']\n\tif (rules.resources) out.resources = rules.resources\n\tif (rules.upkeep) out.upkeep = rules.upkeep\n\treturn out\n}\n\n/**\n * A field of a definition the editor may change, and how it shows it\n *\n * @beta\n */\nexport interface EditableField {\n\t/** Where it is in the definition, by its fields: `stats.health`, `cost.gold`, `bounty.0` (a place in a list) */\n\tpath: string\n\t/** What it is called in the editor: the last part of its path, when left out */\n\tname?: string\n\t/**\n\t * What it holds. What the definition has there now, when left out (a number where it has nothing). A `list` is of\n\t * words, in order: ids of the kind `of` says, when it says. An `id` is one id of the kind `of` says (the hall a race\n\t * starts with), picked from what the game has of that kind. `rows` is a list of things, each with fields of its own\n\t * (`effects.0.amount`), added, taken out and put in another order whole: an ability's effects. An `either` is a value\n\t * of more than one kind: yes or no, one of the words of `options` (`origin.caster`: true, false or `otherwise`), or a\n\t * number as well where `orNumber` says (a missile's `pierce`: true, false or how many it goes through)\n\t */\n\tkind?: 'number' | 'integer' | 'text' | 'boolean' | 'choice' | 'either' | 'list' | 'id' | 'rows'\n\t/** Of a `list` or an `id`: the kind of definition its words are ids of (`abilities` for a unit's abilities) */\n\tof?: DataKind\n\t/**\n\t * Of a `list`: one id or a list of them (a building's `upgradesTo`). Shown as a list either way; a list of one is\n\t * kept as the one id\n\t */\n\tone?: boolean\n\t/** Of a `number` or `integer` field, or the number of an `either`: the least it can be set to in the editor */\n\tmin?: number\n\t/** Of a `number` or `integer` field, or the number of an `either`: the most it can be set to in the editor */\n\tmax?: number\n\t/** Of a `number` field, or the number of an `either`: the size of one step of the editor's input */\n\tstep?: number\n\t/** What a `choice` can be; the words an `either` can be besides yes and no */\n\toptions?: readonly string[]\n\t/** Of an `either`: it may be a number besides, any (`number`) or a whole one (`integer`). Not a number when left out */\n\torNumber?: 'number' | 'integer'\n\t/** Of `rows` of effects: the types a row can be, those the game has (`defineEffect`). A row of no type when left out */\n\ttypes?: readonly string[]\n\t/** The heading it is shown under: the first part of its path, when left out (`stats`, `cost`) */\n\tgroup?: string\n\t/** A line about it, shown when the pointer is over it */\n\thint?: string\n}\n\n/**\n * A field as the editor shows it: everything said\n *\n * @beta\n */\nexport interface DataField extends EditableField {\n\t/** The field's path in the definition (`stats.health`, `cost.gold`), as `data.json` nests it */\n\tname: string\n\t/** How the field is edited, `EditableField.kind` with the guess made when the game did not say */\n\tkind: NonNullable<EditableField['kind']>\n\t/** The heading the field is shown under in the editor, the first part of its path when `EditableField.group` is not said */\n\tgroup: string\n}\n\n/**\n * Which fields of a kind of definition can be changed: `all` of them (every number, word and yes or no in the\n * definition, as it has them, but its id and kind), some (their paths, or fields said in full), or none (nothing, or\n * an empty list). A function says it for each definition, as it is now: null for none\n *\n * @beta\n */\nexport type EditableFields<D = unknown> =\n\t'all' | readonly (string | EditableField)[] | ((def: D) => 'all' | readonly (string | EditableField)[] | null)\n\n/**\n * What of a game's data the editor can change, by kind (`Rules.editable`). `all` for every field of every definition\n *\n * @beta\n */\nexport type EditableData = 'all' | { [K in DataKind]?: EditableFields<DataDefs[K]> }\n\n/** Fields that are never changed from the editor: what a definition is known by, what kind of thing it is and of */\nconst FIXED = new Set(['id', 'kind', 'basedOn', NEW_DEFINITION])\n\n/**\n * The lists of ids of each kind of definition, and what they are ids of: what `all` makes editable as lists, and the\n * kind a list field names when the game does not say. Those `always` are there to fill in though a definition has none\n */\nconst LISTS: Partial<Record<DataKind, Record<string, { of: DataKind; one?: true; always?: (def: Record<string, unknown>) => boolean }>>> = {\n\tunits: {\n\t\tabilities: { of: 'abilities', always: () => true },\n\t\trequires: { of: 'units', always: () => true },\n\t\tprovides: { of: 'units' },\n\t\tbuilds: { of: 'units', always: (def) => def.kind === 'unit' && !!def.harvester },\n\t\ttrains: { of: 'units', always: (def) => def.kind === 'building' },\n\t\tresearches: { of: 'upgrades', always: (def) => def.kind === 'building' },\n\t\tsells: { of: 'items' },\n\t\thires: { of: 'units' },\n\t\t// one type, or several (GP6)\n\t\tupgradesTo: { of: 'units', one: true },\n\t\t'hero.learns': { of: 'abilities' },\n\t\t'hero.spells': { of: 'abilities' },\n\t\t// the abilities that alone may target it (LB7), offered though it has none\n\t\ttargetableBy: { of: 'abilities', always: () => true },\n\t\t// a hero's forms (LB6): what it learns in each and what of its own each keeps, offered for every form it has\n\t\t'hero.forms.*.learns': { of: 'abilities', always: () => true },\n\t\t'hero.forms.*.keeps': { of: 'abilities', always: () => true }\n\t},\n\titems: { from: { of: 'items' } },\n\t// what an ability may be made into for good (AB16)\n\tabilities: { upgrades: { of: 'abilities' } }\n}\n\n/** The lists of things whose fields are changed by place (`attacks.1.acquisitionRange`), and only by place: a unit's attacks */\nconst BY_PLACE: Partial<Record<DataKind, readonly string[]>> = { units: ['attacks', 'pools.*.thresholds'] }\n\n/** Whether a path is that of a list by place, one with a `*` for any one part of it standing for it (`pools.*.thresholds`) */\nconst isByPlace = (byPlace: readonly string[], path: string): boolean => byPlace.some((list) => byPath({ [list]: true }, path))\n\n/** A list of things changed whole as well as by place (`ROWS`): what its things are, and when it is offered though a definition has none */\ninterface RowsSpec {\n\t/** Its things are effects (`EffectDef`): each of a type the game has, with the fields the type reads */\n\teffects?: true\n\t/** The fields of each of its things, by their path in it, for things of no type */\n\trow?: (game: Pick<Rules, 'stats'> | null | undefined) => readonly EditableField[]\n\t/** Offered empty where the definition has no list there, when this says */\n\twhen?: (def: Record<string, unknown>) => boolean\n\thint?: string\n}\n\n/**\n * The lists of things changed whole in the editor (campaign plan RC2), each thing a row: added, taken out, put in\n * another order, its fields by place (`effects.0.amount`). The effects of abilities, of buffs, the changes of an\n * upgrade, the units a race's start adds. Offered where every thing in them is data (no function among them)\n */\nconst ROWS: Partial<Record<DataKind, Record<string, RowsSpec>>> = {\n\tabilities: {\n\t\teffects: { effects: true, when: (def) => def.target !== 'passive', hint: 'What it does, in order' },\n\t\tpassive: { effects: true, when: (def) => def.target === 'passive', hint: 'What it does all the time' },\n\t\t// what a recast does (AB8), where it says what (its own effects otherwise)\n\t\t'recast.effects': { effects: true, when: (def) => isRecord(def.recast), hint: 'What a recast does: the ability’s own effects when it has none' },\n\t\t// what a hold let go early does (AB15), where it has a tap\n\t\t'hold.tap.effects': {\n\t\t\teffects: true,\n\t\t\twhen: (def) => isRecord(def.hold) && isRecord(def.hold.tap),\n\t\t\thint: 'What it does let go before its tap’s seconds, in place of its own effects'\n\t\t}\n\t},\n\tbuffs: {\n\t\tonApply: { effects: true, when: () => true, hint: 'What happens as it is put on, in the name of who put it there' },\n\t\t'onTick.effects': { effects: true, when: (def) => isRecord(def.onTick), hint: 'What happens every so often while it lasts' },\n\t\tpassive: { effects: true, when: () => true, hint: 'What the carrier’s attacks, hurts, casts and kills set off while it carries it (onHit, onDamaged…)' },\n\t\tonCarrierDeath: { effects: true, when: () => true, hint: 'What happens where its carrier dies carrying it, in the name of who put it on' },\n\t\tonMaxStacks: { effects: true, when: (def) => def.maxStacks !== undefined, hint: 'What happens to its carrier as it comes to its most stacks' }\n\t},\n\tupgrades: {\n\t\teffects: {\n\t\t\trow: (game) => [\n\t\t\t\t{ path: 'units', kind: 'list', of: 'units', hint: 'The unit types that benefit: every one of the player’s when left out' },\n\t\t\t\t...[...CORE_STAT_KEYS, ...(game?.stats ?? []).map((stat) => stat.id)].map((stat): EditableField => ({\n\t\t\t\t\tpath: `stats.${stat}`,\n\t\t\t\t\tkind: 'number',\n\t\t\t\t\thint: `What a level adds to ${stat}`\n\t\t\t\t}))\n\t\t\t],\n\t\t\thint: 'What each level changes'\n\t\t}\n\t},\n\traces: {\n\t\t'startingBase.units': {\n\t\t\trow: () => [\n\t\t\t\t{ path: 'type', kind: 'id', of: 'units', hint: 'The unit type' },\n\t\t\t\t{ path: 'count', kind: 'integer', min: 1, hint: 'How many' }\n\t\t\t],\n\t\t\twhen: (def) => isRecord(def.startingBase) && typeof def.startingBase.spawn !== 'function',\n\t\t\thint: 'What else it starts with, by unit type'\n\t\t}\n\t}\n}\n\n/** How deep lists of things go in a thing of a list (a missile's effects in an ability's): deeper ones stay the code's */\nconst MAX_ROWS_DEPTH = 2\n\n/**\n * The fields that are one id of a kind of definition, by path (a `*` for a place in a list), and what they are ids of:\n * what `all` makes an `id` field, picked in the editor from what the game has. A race's start as data (`StartingBaseData`)\n */\nconst IDS: Partial<Record<DataKind, Record<string, DataKind>>> = {\n\traces: { 'startingBase.hall': 'units', 'startingBase.workers.type': 'units', 'startingBase.onMine': 'units' },\n\t// whose level an ability of a hero's form starts at (`HeroForm.levels`), where it is one of the hero's own\n\t// and the abilities of a ground object (AB13): a trap's, a thing used's, a barrel's\n\tunits: {\n\t\t'hero.forms.*.levels.*': 'abilities',\n\t\t// a hero's innate (items-and-spells phase 4): one ability, had for no point\n\t\t'hero.innate': 'abilities',\n\t\t'trigger.ability': 'abilities',\n\t\t'use.ability': 'abilities',\n\t\t'burst.ability': 'abilities',\n\t\t// the buffs at a pool's thresholds (AB14)\n\t\t'pools.*.thresholds.*.buff': 'buffs'\n\t},\n\t// the buff whose stacks grow an ability's costs (AB14)\n\tabilities: { 'costGrowth.buff': 'buffs', 'hold.buff': 'buffs' },\n\t// the shield a buff's overheal puts on\n\tbuffs: { 'overheal.buff': 'buffs' }\n}\n\n/**\n * A field offered though a definition has nothing there (`FILLED_IN`): where `when` says, and only in a game with its\n * pack on where it names one. A `<pool>` in its path is each pool a unit of the game has (`UnitTypeDef.pools`), a\n * `<calling>` each calling of the game's (`callingsOf`)\n */\ninterface FilledIn extends EditableField {\n\twhen: (def: Record<string, unknown>) => boolean\n\t/** The pack whose field it is, by id (`GamePack.id`): its literal, so that this file pulls none of a pack's code in */\n\tpack?: string\n}\n\n/** The ids of the engine's opt-in packs whose fields the Data panel offers (`resourcesPack`, …), as `GamePack.id` has them */\nconst RESOURCES_PACK = 'core.resources'\nconst HOLDS_PACK = 'core.holds'\nconst CHANGES_PACK = 'core.abilityChanges'\nconst GROUND_PACK = 'core.groundObjects'\nconst VISION_PACK = 'core.vision'\nconst HEROES_PACK = 'core.heroes'\nconst BURNING_PACK = 'burning'\n\n/** The pools the units of a game have (`UnitTypeDef.pools`), by id, in order: what a `<pool>` in a field's path stands for */\nfunction poolsOf(game: { units?: readonly UnitTypeDef[] } | null | undefined): string[] {\n\treturn [...new Set((game?.units ?? []).flatMap((def) => (isRecord(def.pools) ? Object.keys(def.pools) : [])))].sort()\n}\n\n/**\n * Fields offered though a definition has nothing there, for `all`, where `when` says: a copy of a race says what it\n * keeps of the original's code (`RaceDef.inherits`), kept unless it says otherwise\n */\nconst FILLED_IN: Partial<Record<DataKind, FilledIn[]>> = {\n\t// what a hero's form does with the cooldowns going in and out (LB10), for each form it has; nothing picked is the default\n\tunits: [\n\t\t// words of the game's for what it is (AB6): what effects, targets and conditions go by\n\t\t{ path: 'tags', kind: 'list', hint: 'Words of the game’s for what it is (undead, mechanical, ward): what effects and abilities may go by', when: () => true },\n\t\t// vision (AB18)\n\t\t{ path: 'trueSight', kind: 'number', min: 0, hint: 'Finds invisible and camouflaged enemies this near, for its team: a Sentry Ward', when: () => true, pack: VISION_PACK },\n\t\t// unit resources (AB14): a pool of the game's it has too, and what its attacks cost\n\t\t{ path: 'pools.<pool>.max', kind: 'number', min: 0, hint: 'The most of this pool it holds: it has the pool once this is set', when: () => true, pack: RESOURCES_PACK },\n\t\t...(\n\t\t\t[\n\t\t\t\t['start', 'What of it it starts with: its max when left out'],\n\t\t\t\t['regen', 'What comes back each second'],\n\t\t\t\t['decay', 'What goes each second once idle'],\n\t\t\t\t['idle', 'Seconds without gaining before it decays'],\n\t\t\t\t['moving', 'What comes for each cell walked'],\n\t\t\t\t['reload', 'Seconds to fill it again once it is empty']\n\t\t\t] as const\n\t\t).map(([part, hint]): FilledIn => ({ path: `pools.*.${part}`, kind: 'number', min: 0, hint, when: () => true, pack: RESOURCES_PACK })),\n\t\t{ path: 'pools.*.name', kind: 'text', hint: 'What it is called on the screen', when: () => true, pack: RESOURCES_PACK },\n\t\t{ path: 'pools.*.color', kind: 'text', hint: 'The colour of its bar (#e0a030)', when: () => true, pack: RESOURCES_PACK },\n\t\t// the backswing (items-and-spells plan, phases 8 and 9: the Attack tab's marker), offered though an attack says none\n\t\t{\n\t\t\tpath: 'attacks.*.recovery',\n\t\t\tkind: 'number',\n\t\t\tmin: 0,\n\t\t\thint: 'Seconds it is held after the blow, the backswing, shortened by attack speed as the swing is: none when left out',\n\t\t\twhen: (def) => Array.isArray(def.attacks)\n\t\t},\n\t\t{\n\t\t\tpath: 'attacks.*.cleave.part',\n\t\t\tkind: 'number',\n\t\t\tmin: 0,\n\t\t\thint: 'A blow from up close strikes the enemies round its target too: this part of its damage each',\n\t\t\twhen: (def) => Array.isArray(def.attacks)\n\t\t},\n\t\t{ path: 'attacks.*.cleave.radius', kind: 'number', min: 0, hint: 'How far round the target the cleave reaches', when: (def) => Array.isArray(def.attacks) },\n\t\t{\n\t\t\tpath: 'attacks.*.cleave.angle',\n\t\t\tkind: 'number',\n\t\t\tmin: 0,\n\t\t\tmax: 6.2832,\n\t\t\thint: 'How wide a cone from the attacker through the target, in radians: all round when left out',\n\t\t\twhen: (def) => Array.isArray(def.attacks)\n\t\t},\n\t\t{ path: 'attackCost.<pool>', kind: 'number', min: 0, hint: 'What each attack costs of this pool: it does not attack with less', when: (def) => Array.isArray(def.attacks), pack: RESOURCES_PACK },\n\t\t// ground objects (AB13): a trap, a thing used, a wall of wind, a barrel\n\t\t{ path: 'trigger.ability', kind: 'id', of: 'abilities', hint: 'A trap: this ability goes off in its maker’s name as one it is for comes near', when: () => true, pack: GROUND_PACK },\n\t\t{ path: 'trigger.radius', kind: 'number', min: 0, hint: 'How near sets it off', when: (def) => isRecord(def.trigger), pack: GROUND_PACK },\n\t\t{ path: 'trigger.by', options: ['enemies', 'allies', 'all', 'maker'], hint: 'Who sets it off: enemies when left out', when: (def) => isRecord(def.trigger), pack: GROUND_PACK },\n\t\t{ path: 'trigger.arm', kind: 'number', min: 0, hint: 'Seconds before it is armed', when: (def) => isRecord(def.trigger), pack: GROUND_PACK },\n\t\t{ path: 'trigger.times', kind: 'integer', min: 1, hint: 'How many times it goes off before it is gone: once when left out', when: (def) => isRecord(def.trigger), pack: GROUND_PACK },\n\t\t{ path: 'use.ability', kind: 'id', of: 'abilities', hint: 'Right-clicked, it is walked up to and used: this ability goes off (a lantern, a portal)', when: () => true, pack: GROUND_PACK },\n\t\t{ path: 'use.by', options: ['allies', 'enemies', 'all'], hint: 'Who may use it: allies when left out', when: (def) => isRecord(def.use), pack: GROUND_PACK },\n\t\t{ path: 'use.range', kind: 'number', min: 0, hint: 'How near one must come to use it', when: (def) => isRecord(def.use), pack: GROUND_PACK },\n\t\t{ path: 'use.times', kind: 'integer', min: 1, hint: 'How many times it may be used', when: (def) => isRecord(def.use), pack: GROUND_PACK },\n\t\t{ path: 'blocksMissiles', options: ['enemies', 'all'], hint: 'Stops the missiles of its enemies, or everyone’s: a wall of wind', when: () => true, pack: GROUND_PACK },\n\t\t{ path: 'burst.ability', kind: 'id', of: 'abilities', hint: 'This ability goes off where it dies, in its maker’s name: a barrel', when: () => true, pack: GROUND_PACK },\n\t\t{ path: 'burst.chain', kind: 'number', min: 0, hint: 'Those of its type and owner this near die too, and go off in turn', when: (def) => isRecord(def.burst), pack: GROUND_PACK },\n\t\t// how it burns (GR20's burning pack): offered for what burns, or may, of a game with the pack\n\t\t{ path: 'burns.seconds', kind: 'number', min: 0, hint: 'Seconds it burns before it is burnt down: 20 when left out', when: (def) => def.burns !== false, pack: BURNING_PACK },\n\t\t{\n\t\t\tpath: 'burns.leaves',\n\t\t\tkind: 'text',\n\t\t\thint: 'What is left once it has burnt down: felled (it comes down), nothing (it burns away), or a unit type put in its place (a charred stump)',\n\t\t\twhen: (def) => def.burns !== false,\n\t\t\tpack: BURNING_PACK\n\t\t},\n\t\t{ path: 'burns.wood', kind: 'boolean', hint: 'What it leaves keeps the wood it had left', when: (def) => def.burns !== false, pack: BURNING_PACK },\n\t\t{ path: 'burns.how', kind: 'text', hint: 'What kind of burning it is, for its look and its death: burnt when left out', when: (def) => def.burns !== false, pack: BURNING_PACK },\n\t\t// a hero's callings (items-and-spells phase 4): a strength, 1 to 3, for each calling of the game's\n\t\t{\n\t\t\tpath: 'hero.callings.<calling>',\n\t\t\tkind: 'integer',\n\t\t\tmin: 1,\n\t\t\tmax: 3,\n\t\t\thint: 'How strong it is in this calling, 1 to 3: what the shop suggests, the tooltips and the computer players go by. None: not one of its callings',\n\t\t\twhen: (def) => isRecord(def.hero),\n\t\t\tpack: HEROES_PACK\n\t\t},\n\t\t{\n\t\t\tpath: 'hero.innate',\n\t\t\tkind: 'id',\n\t\t\tof: 'abilities',\n\t\t\thint: 'Its innate: an ability it has from level 1 for no point, its level growing with the hero’s',\n\t\t\twhen: (def) => isRecord(def.hero)\n\t\t},\n\t\t{\n\t\t\tpath: 'hero.forms.*.cooldowns',\n\t\t\thint: 'Its cooldowns going in and out of the form. Left alone, what is put away runs down by the time away; keep: as left; reset: ready; shared: one with the form’s ability that takes its place',\n\t\t\twhen: () => true\n\t\t}\n\t],\n\t// uses an ability holds (GP5), offered though it has none, for what is cast\n\tabilities: [\n\t\t// a window to cast it again (AB8), offered though it has none, for what is cast\n\t\t{ path: 'recast.window', kind: 'number', min: 0, hint: 'Seconds after it is cast that it may be cast again', when: (def) => def.target !== 'passive' },\n\t\t{ path: 'recast.count', kind: 'integer', min: 1, hint: 'How many times it may be cast again in the window (once when left out)', when: (def) => isRecord(def.recast) },\n\t\t{\n\t\t\tpath: 'recast.cooldown',\n\t\t\thint: 'When the cooldown starts: after the last recast or the window’s end (when left out), or at the first cast',\n\t\t\twhen: (def) => isRecord(def.recast)\n\t\t},\n\t\t{ path: 'recast.mark', kind: 'id', of: 'buffs', hint: 'A recast goes to the unit carrying this buff from the caster (Sonic Wave’s mark)', when: (def) => isRecord(def.recast) },\n\t\t{ path: 'recast.range', kind: 'number', min: 0, hint: 'How far a recast reaches: the ability’s range when left out', when: (def) => isRecord(def.recast) },\n\t\t{ path: 'recast.manaCost', kind: 'number', min: 0, hint: 'Mana a recast costs: none when left out', when: (def) => isRecord(def.recast) },\n\t\t// only what has one of these tags (AB6), for one cast on a unit\n\t\t{\n\t\t\tpath: 'targets.tags',\n\t\t\tkind: 'list',\n\t\t\thint: 'Only what has one of these tags of its type (undead, mechanical): everything it may target when left out',\n\t\t\twhen: (def) => def.target === 'unit'\n\t\t},\n\t\t// its wind-up (the Attack tab's cast), offered though it has none\n\t\t{ path: 'castTime', kind: 'number', min: 0, hint: 'Seconds from the order to its going off, the caster winding up: at once when left out', when: (def) => def.target !== 'passive' },\n\t\t// a hero's ultimate (LB6), offered though it says nothing\n\t\t{\n\t\t\tpath: 'ultimate',\n\t\t\tkind: 'boolean',\n\t\t\thint: 'A hero’s ultimate: first learned at level 6 unless its required level says otherwise',\n\t\t\twhen: () => true\n\t\t},\n\t\t{\n\t\t\tpath: 'charges.count',\n\t\t\tkind: 'integer',\n\t\t\tmin: 1,\n\t\t\thint: 'Uses it holds, for one used so many times before it waits: its cooldown is then between two uses',\n\t\t\twhen: (def) => def.target !== 'passive'\n\t\t},\n\t\t{\n\t\t\tpath: 'charges.refill',\n\t\t\tkind: 'number',\n\t\t\tmin: 0,\n\t\t\thint: 'Seconds until a use is back, while it holds fewer than it can',\n\t\t\twhen: (def) => def.target !== 'passive'\n\t\t},\n\t\t// how a recast is aimed (AB8)\n\t\t{ path: 'recast.target', kind: 'text', hint: 'How a recast is aimed (none, unit, point, direction, vector): as the ability is when left out', when: (def) => isRecord(def.recast) },\n\t\t// a tether that breaks (AB15), on a channel\n\t\t{ path: 'channel.leash', kind: 'number', min: 0, hint: 'The channel breaks as its target gets farther than this, dies or hides: a tether', when: (def) => isRecord(def.channel) },\n\t\t// the holds pack's (AB15)\n\t\t{ path: 'channel.aimed', kind: 'boolean', hint: 'Aimed as it goes: the caster’s pointer moves where it goes off', when: (def) => isRecord(def.channel), pack: HOLDS_PACK },\n\t\t{ path: 'channel.walks', kind: 'boolean', hint: 'Kept up as the caster walks', when: (def) => isRecord(def.channel), pack: HOLDS_PACK },\n\t\t...(\n\t\t\t[\n\t\t\t\t['hold.max', 'Seconds held for it to be full: held to charge, let go to cast'],\n\t\t\t\t['hold.upTo', 'Seconds held after which it goes off by itself: as it is full when left out'],\n\t\t\t\t['hold.range.from', 'How far it reaches let go at once'],\n\t\t\t\t['hold.range.to', 'How far it reaches let go full'],\n\t\t\t\t['hold.scale', 'What its amounts come to full, times what they are let go at once (1.5: half again)']\n\t\t\t] as const\n\t\t).map(\n\t\t\t([path, hint]): FilledIn => ({\n\t\t\t\tpath,\n\t\t\t\tkind: 'number',\n\t\t\t\tmin: 0,\n\t\t\t\thint,\n\t\t\t\twhen: (def) => ['none', 'point', 'direction'].includes(String(def.target ?? 'none')) && !def.channel,\n\t\t\t\tpack: HOLDS_PACK\n\t\t\t})\n\t\t),\n\t\t{ path: 'hold.buff', kind: 'id', of: 'buffs', hint: 'A buff on the caster while it holds: a slow', when: (def) => isRecord(def.hold), pack: HOLDS_PACK },\n\t\t{\n\t\t\tpath: 'hold.tap.under',\n\t\t\tkind: 'number',\n\t\t\tmin: 0,\n\t\t\thint: 'Let go before so many seconds, it does its tap’s effects in place of its own (Pyke’s stab, not his hook)',\n\t\t\twhen: (def) => isRecord(def.hold),\n\t\t\tpack: HOLDS_PACK\n\t\t},\n\t\t// the resources pack's (AB14): by each pool of the game's\n\t\t{ path: 'cost.<pool>', kind: 'number', min: 0, hint: 'What it costs of the caster’s pool: not ready with less', when: (def) => def.target !== 'passive', pack: RESOURCES_PACK },\n\t\t{ path: 'gain.<pool>', kind: 'number', min: 0, hint: 'What it gives the caster’s pool as it goes off', when: (def) => def.target !== 'passive', pack: RESOURCES_PACK },\n\t\t{ path: 'costGrowth.buff', kind: 'id', of: 'buffs', hint: 'Its costs grow with the stacks of this buff of the caster’s', when: (def) => def.target !== 'passive', pack: RESOURCES_PACK },\n\t\t{\n\t\t\tpath: 'costGrowth.per',\n\t\t\tkind: 'number',\n\t\t\tmin: 0,\n\t\t\thint: 'How much more for each stack: 1, twice with one stack, three times with two',\n\t\t\twhen: (def) => def.target !== 'passive',\n\t\t\tpack: RESOURCES_PACK\n\t\t},\n\t\t// the ability changes pack's (AB16)\n\t\t{ path: 'upgrades', kind: 'list', of: 'abilities', hint: 'What it may be made into for good, chosen once', when: () => true, pack: CHANGES_PACK }\n\t],\n\t// what takes a buff off before its time (AB7), offered though it says nothing\n\tbuffs: [\n\t\t{ path: 'breaksOn', kind: 'list', hint: 'What takes it off before its time: damage (its carrier hurt), attack (its attack lands), cast', when: () => true },\n\t\t// crowd control that takes orders (AB5)\n\t\t{\n\t\t\tpath: 'control',\n\t\t\thint: 'It takes its carrier’s orders while it lasts: fear (away from who put it on), charm (to them), taunt (attacks them)',\n\t\t\twhen: (def) => typeof def.control !== 'function'\n\t\t},\n\t\t{ path: 'suppress', kind: 'boolean', hint: 'Held like a stun, but tenacity does not shorten it and a cleanse does not take it off', when: () => true },\n\t\t{ path: 'grounded', kind: 'boolean', hint: 'Its carrier cannot dash or blink of its own', when: () => true },\n\t\t{ path: 'unstoppable', kind: 'boolean', hint: 'Nothing that holds a unit up (stun, root, silence, fear, a throw…) does anything to its carrier', when: () => true },\n\t\t// vision (AB18), read in a game with the vision pack\n\t\t{ path: 'revealed', kind: 'boolean', hint: 'Its carrier is seen by the team of whoever put it on, wherever it stands (with the vision pack)', when: () => true, pack: VISION_PACK },\n\t\t{\n\t\t\tpath: 'camouflage',\n\t\t\tkind: 'number',\n\t\t\tmin: 0,\n\t\t\thint: 'Its carrier is seen by its enemies only from this near, unless something finds it (with the vision pack)',\n\t\t\twhen: (def) => typeof def.camouflage !== 'function',\n\t\t\tpack: VISION_PACK\n\t\t},\n\t\t{ path: 'trueSight', kind: 'number', min: 0, hint: 'Its carrier finds invisible and camouflaged enemies this near (with the vision pack)', when: () => true, pack: VISION_PACK },\n\t\t// out of harm's and out of reach, and a floor to its health (AB9)\n\t\t{ path: 'invulnerable', kind: 'boolean', hint: 'Its carrier takes no damage, and no enemy’s ability is cast on it', when: (def) => typeof def.invulnerable !== 'function' },\n\t\t{\n\t\t\tpath: 'untargetable',\n\t\t\tkind: 'boolean',\n\t\t\thint: 'Nothing of anyone else’s reaches its carrier: no ability cast on it, no attack, no area, no missile',\n\t\t\twhen: (def) => typeof def.untargetable !== 'function'\n\t\t},\n\t\t{ path: 'minHealth', kind: 'number', min: 0, hint: 'The least health damage leaves its carrier with (1: it cannot die of it)', when: (def) => typeof def.minHealth !== 'function' },\n\t\t// what it burns each second (AB14), of mana and of each pool of the game's\n\t\t{ path: 'drain.mana', kind: 'number', min: 0, hint: 'Mana it takes of its carrier each second: off when there is not enough', when: () => true, pack: RESOURCES_PACK },\n\t\t{ path: 'drain.<pool>', kind: 'number', min: 0, hint: 'What it takes of its carrier’s pool each second: off when there is not enough', when: () => true, pack: RESOURCES_PACK },\n\t\t// words to find it by, walking through units, a cleave, overheal, health for mana (items-and-spells phases 2 and 4)\n\t\t{ path: 'tags', kind: 'list', hint: 'Words of the game’s for what it is (fire, slow, anti-heal): what a search and code find it by', when: () => true },\n\t\t{ path: 'phasing', kind: 'boolean', hint: 'Its carrier walks through other units and they through it; walls and buildings still stop it', when: (def) => typeof def.phasing !== 'function' },\n\t\t{ path: 'cleave.part', kind: 'number', min: 0, hint: 'Its carrier’s blows from up close strike the enemies round the target too, this part of the damage each', when: () => true },\n\t\t{ path: 'cleave.radius', kind: 'number', min: 0, hint: 'How far round the target the cleave reaches', when: (def) => isRecord(def.cleave) },\n\t\t{ path: 'cleave.angle', kind: 'number', min: 0, max: 6.2832, hint: 'How wide a cone from the attacker through the target, in radians: all round when left out', when: (def) => isRecord(def.cleave) },\n\t\t{ path: 'overheal.buff', kind: 'id', of: 'buffs', hint: 'Healing past full health its carrier gives (or gets) becomes a shield: this buff, on whoever was healed', when: () => true },\n\t\t{ path: 'overheal.part', kind: 'number', min: 0, hint: 'The part of what spilled over the shield holds: all of it when left out', when: (def) => isRecord(def.overheal) },\n\t\t{ path: 'overheal.most', kind: 'number', min: 0, hint: 'The most the shield holds, a part of the healed one’s max health: a third when left out', when: (def) => isRecord(def.overheal) },\n\t\t{ path: 'overheal.of', options: ['given', 'taken'], hint: 'Of the healing its carrier gives (given, when left out), or gets (taken)', when: (def) => isRecord(def.overheal) },\n\t\t{\n\t\t\tpath: 'paysWithHealth',\n\t\t\tkind: 'either',\n\t\t\torNumber: 'number',\n\t\t\tmin: 0,\n\t\t\thint: 'Its carrier pays for its abilities with health, not mana: this much health a point of mana (1 when on)',\n\t\t\twhen: () => true\n\t\t}\n\t],\n\t// what an item table draws by (GP3), offered though an item says neither\n\titems: [\n\t\t{ path: 'level', kind: 'integer', min: 1, hint: 'How good it is: what an item table draws by (a level)', when: () => true },\n\t\t{ path: 'class', kind: 'text', hint: 'Its kind of item, a word of the game’s: what an item table draws by (a class)', when: () => true },\n\t\t// the item rules (items-and-spells phase 5)\n\t\t{\n\t\t\tpath: 'tier',\n\t\t\tkind: 'text',\n\t\t\thint: 'Where it goes in a shop: consumable, starter, basic, intermediate, legendary, relic (found, not sold), or a tier of the game’s',\n\t\t\twhen: () => true\n\t\t},\n\t\t{ path: 'tags', kind: 'list', hint: 'Words of the game’s for what it is (attack, lifesteal, early): what a search (#lifesteal) and a shop’s filters go by', when: () => true },\n\t\t{ path: 'suits', kind: 'list', hint: 'The callings of heroes it is meant for (vanguard, ranger): what a shop suggests, never a lock', when: () => true },\n\t\t{ path: 'unique', kind: 'text', hint: 'A name for its passive: two carried, of it or of items sharing the name, work once', when: () => true },\n\t\t{ path: 'group', kind: 'text', hint: 'A group a hero carries only so many of (boots: one pair)', when: () => true },\n\t\t{ path: 'groupLimit', kind: 'integer', min: 1, hint: 'How many of its group one hero may carry: the game’s limit of the group, or 1, when left out', when: (def) => def.group !== undefined },\n\t\t{ path: 'stack', kind: 'integer', min: 1, hint: 'How many go in one slot, their charges added (a stack of potions)', when: (def) => def.charges !== undefined },\n\t\t{ path: 'refill.shop', kind: 'boolean', hint: 'Its charges all come back at a shop', when: (def) => def.charges !== undefined },\n\t\t{ path: 'refill.every', kind: 'number', min: 0, hint: 'Seconds for one of its charges to come back, wherever it is', when: (def) => def.charges !== undefined },\n\t\t{ path: 'sellRate', kind: 'number', min: 0, max: 1, step: 0.05, hint: 'The part of its price a shop gives back: the game’s when left out', when: () => true }\n\t],\n\traces: [\n\t\t{\n\t\t\tpath: 'inherits.hooks',\n\t\t\tkind: 'boolean',\n\t\t\thint: \"Keeps the hooks of the race this is a copy of: how it gathers, where it builds. Off, it plays by the game's rules alone\",\n\t\t\twhen: (def) => !!def.basedOn\n\t\t},\n\t\t{\n\t\t\tpath: 'inherits.onStart',\n\t\t\tkind: 'boolean',\n\t\t\thint: 'Keeps the onStart of the race this is a copy of: what its players begin with that is not a unit (a ground of its own)',\n\t\t\twhen: (def) => !!def.basedOn\n\t\t}\n\t]\n}\n\n/** The words a path is one of (a `choice`), by kind and path, `*` for any one part of it */\nconst CHOICES: Partial<Record<DataKind, Record<string, readonly string[]>>> = {\n\tunits: {\n\t\t'hero.forms.*.cooldowns': ['keep', 'reset', 'shared'],\n\t\t'trigger.by': ['enemies', 'allies', 'all', 'maker'],\n\t\t'use.by': ['allies', 'enemies', 'all'],\n\t\tblocksMissiles: ['enemies', 'all']\n\t},\n\tbuffs: { control: ['fear', 'charm', 'taunt'], 'overheal.of': ['given', 'taken'] },\n\tabilities: { 'recast.cooldown': ['after', 'first'] }\n}\n\n/** The kind of definition a path is an id of, as `IDS` says, or undefined */\nfunction idKindOf(kind: DataKind, path: string): DataKind | undefined {\n\treturn byPath(IDS[kind], path)\n}\n\n/**\n * What a table by path says of a path: by the path itself, or by one with a `*` for any one part of it (a place in a\n * list, a form of a hero's: `hero.forms.*.keeps`)\n */\nfunction byPath<T>(table: Record<string, T> | undefined, path: string): T | undefined {\n\tif (!table) return undefined\n\tif (path in table) return table[path]\n\tconst parts = path.split('.')\n\tfor (const [key, value] of Object.entries(table)) {\n\t\tif (!key.includes('*')) continue\n\t\tconst keys = key.split('.')\n\t\tif (keys.length === parts.length && keys.every((each, i) => each === '*' || each === parts[i])) return value\n\t}\n\treturn undefined\n}\n\n/** The paths a path with a `*` stands for in a definition: one for each key of what is there (`hero.forms.bear.keeps`) */\nfunction expandedPaths(def: unknown, path: string): string[] {\n\tconst star = path.indexOf('.*')\n\tif (star < 0) return [path]\n\tconst head = path.slice(0, star)\n\tconst there = valueAt(def, head)\n\t// a list by place (a unit's attacks) is each of its places\n\tconst keys = Array.isArray(there) ? there.map((_, index) => String(index)) : isRecord(there) ? Object.keys(there) : []\n\treturn keys.flatMap((key) => expandedPaths(def, `${head}.${key}${path.slice(star + 2)}`))\n}\n\n/** The list by place a path is in, and the place: `attacks.1.acquisitionRange` is in `attacks` at 1 */\nfunction placeOf(kind: DataKind, path: string): { list: string; place: number } | undefined {\n\tconst parts = path.split('.')\n\tfor (const general of BY_PLACE[kind] ?? []) {\n\t\tconst keys = general.split('.')\n\t\tif (parts.length <= keys.length || !keys.every((each, i) => each === '*' || each === parts[i])) continue\n\t\tconst place = Number(parts[keys.length])\n\t\tif (Number.isInteger(place)) return { list: parts.slice(0, keys.length).join('.'), place }\n\t}\n\treturn undefined\n}\n\nconst isWords = (value: unknown): value is string[] => Array.isArray(value) && value.every((each) => typeof each === 'string')\nconst MAX_DEPTH = 4\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null && !Array.isArray(value)\nconst isValue = (value: unknown): value is DataValue =>\n\ttypeof value === 'boolean' || typeof value === 'string' || (typeof value === 'number' && Number.isFinite(value))\n\n/**\n * What is at a path of a definition, or undefined\n *\n * @beta\n */\nexport function valueAt(def: unknown, path: string): unknown {\n\tlet at: unknown = def\n\tfor (const part of path.split('.')) {\n\t\tif (typeof at !== 'object' || at === null) return undefined\n\t\tat = (at as Record<string, unknown>)[part]\n\t}\n\treturn at\n}\n\n/**\n * Values with one field set, nested as the path says: `nested('stats.health', 420)` is `{ stats: { health: 420 } }`\n *\n * @beta\n */\nexport function nested(path: string, value: FieldValue): DataValues {\n\tconst parts = path.split('.')\n\tlet out: DataValues = { [parts.pop()!]: value }\n\twhile (parts.length) out = { [parts.pop()!]: out }\n\treturn out\n}\n\n/**\n * Every number, word and yes or no of a definition, by path, and its lists of ids as lists: what `all` makes editable.\n * A list of numbers (a bounty's two ends) is by place, and so are the things of a list `byPlace` names (a unit's\n * attacks); another list of things (drops) or of lists stays the code's\n */\nfunction leaves(def: unknown, lists: Record<string, unknown> = {}, prefix = '', depth = 0, byPlace: readonly string[] = []): string[] {\n\tif (depth > MAX_DEPTH) return []\n\tconst out: string[] = []\n\tconst entries = Array.isArray(def) ? def.map((value, i) => [String(i), value] as const) : Object.entries(def as object)\n\tfor (const [key, value] of entries) {\n\t\tif (depth === 0 && FIXED.has(key)) continue\n\t\tconst path = prefix ? `${prefix}.${key}` : key\n\t\tif (isValue(value)) out.push(path)\n\t\telse if (byPath(lists, path) && isWords(value)) out.push(path)\n\t\telse if (\n\t\t\tArray.isArray(value) ? value.every((each) => typeof each === 'number') || (isByPlace(byPlace, path) && value.every(isRecord)) : isRecord(value)\n\t\t)\n\t\t\tout.push(...leaves(value, lists, path, depth + 1, byPlace))\n\t}\n\treturn out\n}\n\nconst kindOf = (value: unknown): DataField['kind'] => (typeof value === 'boolean' ? 'boolean' : typeof value === 'string' ? 'text' : 'number')\n\nfunction fieldOf(kind: DataKind, def: unknown, field: string | EditableField): DataField {\n\tconst said = typeof field === 'string' ? { path: field } : field\n\t// the words a path is one of, where the data has it already and nothing says so (`hero.forms.bear.cooldowns`)\n\tconst options = said.options ?? byPath(CHOICES[kind], said.path)\n\tconst given = options ? { ...said, options } : said\n\tconst parts = given.path.split('.')\n\tconst list = byPath(LISTS[kind], given.path)\n\tconst value = valueAt(def, given.path)\n\tconst listed =\n\t\tgiven.kind === 'list' ||\n\t\t(given.kind === undefined && (isWords(value) || (value === undefined && !!list) || (!!list?.one && typeof value === 'string')))\n\tconst idOf = (given.kind === 'id' || given.kind === undefined) && typeof value !== 'number' ? idKindOf(kind, given.path) : undefined\n\tconst place = placeOf(kind, given.path)\n\t// a hero's form, under a heading of its own: `form bear`, its `learns`, `keeps`, `levels maul`\n\tconst form = kind === 'units' && parts.length > 3 && parts[0] === 'hero' && parts[1] === 'forms'\n\treturn {\n\t\t...given,\n\t\t// a field of a thing in a list by place is named by what is left of its path: `type`, `count`\n\t\tname:\n\t\t\tgiven.name ??\n\t\t\t(place ? given.path.slice(`${place.list}.${place.place}.`.length) : form ? parts.slice(3).join(' ') : parts[parts.length - 1]),\n\t\tkind: given.kind ?? (given.options ? 'choice' : listed ? 'list' : idOf ? 'id' : kindOf(value)),\n\t\t// a thing of a list by place under its own heading: `attacks 2`, `start units 1`\n\t\tgroup:\n\t\t\tgiven.group ??\n\t\t\t(place\n\t\t\t\t? `${place.list.split('.').join(' ')} ${place.place + 1}`\n\t\t\t\t: form\n\t\t\t\t\t? `form ${parts[2]}`\n\t\t\t\t\t: parts.length > 1\n\t\t\t\t\t\t? parts[0]\n\t\t\t\t\t\t: listed\n\t\t\t\t\t\t\t? 'lists'\n\t\t\t\t\t\t\t: ''),\n\t\t...(listed && (given.of ?? list?.of) && { of: given.of ?? list!.of }),\n\t\t...(listed && (given.one ?? list?.one) && { one: true }),\n\t\t...(!listed && (given.of ?? idOf) && { of: given.of ?? idOf })\n\t}\n}\n\n/** Whether a value is data all through, no function anywhere in it: as a list must be to be changed whole and kept in a file */\nconst isData = (value: unknown, depth = 0): boolean =>\n\tdepth <= 8 &&\n\t(value === undefined ||\n\t\tisValue(value) ||\n\t\t(Array.isArray(value) && value.every((each) => isData(each, depth + 1))) ||\n\t\t(isRecord(value) && Object.values(value).every((each) => isData(each, depth + 1))))\n\n/** The game a definition's fields are worked out for: what it lets be changed, its kinds of effect and its stats */\ntype FieldsGame = Pick<Rules, 'editable' | 'effects' | 'stats'> & Partial<Pick<Rules, 'packs'>>\n\n/** The kinds of effect a game has, by type: the engine's, its packs' and its own (`Rules.effects`), one of its own over the engine's of its type */\nfunction effectTypesByType(game: (Pick<Rules, 'effects'> & Partial<Pick<Rules, 'packs'>>) | null | undefined): Map<string, EffectType> {\n\tconst kinds = new Map<string, EffectType>()\n\tfor (const kind of [...coreEffects, ...summonEffects, ...dispelEffects, ...(game?.packs ?? []).flatMap((pack) => pack.effects ?? []), ...(game?.effects ?? [])])\n\t\tkinds.set(kind.type, kind)\n\treturn kinds\n}\n\n/**\n * The fields an effect of a type has, by their path in it: those its type reads (`defineEffect`'s `fields`), then those\n * every effect may have (`EffectCommon`). Only those every effect may have, for a type the game has not\n *\n * @beta\n */\nexport function effectFields(game: (Pick<Rules, 'effects'> & Partial<Pick<Rules, 'packs'>>) | null | undefined, type: string): EditableField[] {\n\treturn [...(effectTypesByType(game).get(type)?.fields ?? []), ...Object.values(COMMON_EFFECT_FIELDS).flat()]\n}\n\n/**\n * The types of effect a game has (`defineEffect`): the engine's and its own, in order of their names\n *\n * @beta\n */\nexport function effectTypesOf(game: (Pick<Rules, 'effects'> & Partial<Pick<Rules, 'packs'>>) | null | undefined): string[] {\n\treturn [...effectTypesByType(game).keys()].sort()\n}\n\n/**\n * A list of things changed whole (`ROWS`), and the fields of each of its things by place under a heading of its own\n * (`effects 1`): its type for an effect, then what it has, then what its type or the list says it may have. The lists\n * inside a thing (a missile's effects) the same, a few deep\n */\nfunction rowsFields(\n\tgame: FieldsGame | null | undefined,\n\tspec: RowsSpec,\n\tpath: string,\n\theading: string,\n\trows: readonly unknown[],\n\tdepth = 0\n): DataField[] {\n\tconst types = spec.effects ? effectTypesOf(game) : undefined\n\tconst out: DataField[] = [\n\t\t{ path, name: path.split('.').pop()!, kind: 'rows', group: heading, ...(types && { types }), ...(spec.hint && { hint: spec.hint }) }\n\t]\n\trows.forEach((row, place) => {\n\t\tif (!isRecord(row)) return\n\t\tconst at = `${path}.${place}`\n\t\tconst group = `${heading} ${place + 1}`\n\t\tconst declared = spec.effects ? effectFields(game, String(row.type)) : (spec.row?.(game) ?? [])\n\t\tconst lists = Object.fromEntries(declared.filter((field) => field.kind === 'list').map((field) => [field.path, field]))\n\t\tconst own = (field: EditableField, value: unknown): DataField => ({\n\t\t\t...field,\n\t\t\tpath: `${at}.${field.path}`,\n\t\t\tname: field.name ?? field.path,\n\t\t\tkind: field.kind ?? (field.options ? 'choice' : isWords(value) ? 'list' : kindOf(value)),\n\t\t\tgroup: field.group ?? group\n\t\t})\n\t\t// its type, picked in the editor among the game's: words in the file, so that one the game has not is the rules' check's to say (`checkRules`)\n\t\tif (spec.effects) out.push({ path: `${at}.type`, name: 'type', kind: 'text', group, hint: 'What kind of effect it is' })\n\t\tconst present = leaves(row, lists).filter((each) => !spec.effects || each !== 'type')\n\t\tfor (const each of present) out.push(own(declared.find((field) => field.path === each) ?? { path: each }, valueAt(row, each)))\n\t\tfor (const field of declared) {\n\t\t\tconst value = valueAt(row, field.path)\n\t\t\tif (field.kind !== 'rows') {\n\t\t\t\t// one number for every level where it has one by level (`Scaled`): its levels are fields by place as well\n\t\t\t\tconst byLevel = (field.kind === 'number' || field.kind === 'integer') && Array.isArray(value)\n\t\t\t\tif (value === undefined || byLevel) out.push(own(field, undefined))\n\t\t\t} else if (depth < MAX_ROWS_DEPTH && (value === undefined || (Array.isArray(value) && isData(value))))\n\t\t\t\tout.push(\n\t\t\t\t\t...rowsFields(\n\t\t\t\t\t\tgame,\n\t\t\t\t\t\t{ effects: true, hint: field.hint },\n\t\t\t\t\t\t`${at}.${field.path}`,\n\t\t\t\t\t\t`${group} ${field.path}`,\n\t\t\t\t\t\t(value as unknown[]) ?? [],\n\t\t\t\t\t\tdepth + 1\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t}\n\t})\n\treturn out\n}\n\n/** The lists of things changed whole of a definition (`ROWS`), with their things' fields: those it has, all data, and those offered empty */\nfunction allRows(game: FieldsGame | null | undefined, kind: DataKind, def: unknown): DataField[] {\n\treturn Object.entries(ROWS[kind] ?? {}).flatMap(([path, spec]) => {\n\t\tconst rows = valueAt(def, path)\n\t\tconst offered = rows === undefined ? !!spec.when?.(def as Record<string, unknown>) : Array.isArray(rows) && isData(rows)\n\t\treturn offered ? rowsFields(game, spec, path, path.split('.').join(' '), (rows as unknown[]) ?? []) : []\n\t})\n}\n\n/**\n * An upgrade's requirements by level (`UpgradeDef.requires`, a list for each): a list of ids for each of its levels,\n * those it has and up to its last\n */\nfunction levelLists(def: UpgradeDef): DataField[] {\n\tconst levels = Math.max(def.maxLevel ?? 1, def.requires?.length ?? 0)\n\treturn Array.from({ length: Math.min(levels, MAX_LIST) }, (_, level) => ({\n\t\tpath: `requires.${level}`,\n\t\tname: `level ${level + 1}`,\n\t\tkind: 'list' as const,\n\t\tof: 'units' as const,\n\t\tgroup: 'requires',\n\t\thint: `The buildings needed for level ${level + 1}: all of them`\n\t}))\n}\n\n/**\n * The fields of a definition the editor may change, as the game says (`Rules.editable`), each with what it\n * holds and the heading it goes under. None for a game that says nothing of that kind\n *\n * @beta\n */\nexport function editableFields<K extends DataKind>(\n\tgame: (Pick<Rules, 'editable'> & Partial<Pick<Rules, 'effects' | 'stats' | 'packs' | 'units'>>) | null | undefined,\n\tkind: K,\n\tdef: DataDefs[K]\n): DataField[] {\n\tconst editable = game?.editable\n\tif (!editable) return []\n\tlet said: EditableFields<DataDefs[K]> | undefined | null = editable === 'all' ? 'all' : (editable[kind] as EditableFields<DataDefs[K]> | undefined)\n\tif (typeof said === 'function') said = said(def)\n\tif (!said) return []\n\tif (said === 'all') {\n\t\tconst lists: NonNullable<(typeof LISTS)[DataKind]> = LISTS[kind] ?? {}\n\t\tconst paths = leaves(def, lists, '', 0, BY_PLACE[kind])\n\t\t// the lists a definition of its kind is filled in with though it has none yet: abilities for a unit with none\n\t\tfor (const [general, list] of Object.entries(lists))\n\t\t\tfor (const path of expandedPaths(def, general))\n\t\t\t\tif (!paths.includes(path) && valueAt(def, path) === undefined && list.always?.(def as unknown as Record<string, unknown>)) paths.push(path)\n\t\tconst fields = paths.map((path) => fieldOf(kind, def, path))\n\t\t// and those offered though the definition has nothing there, where they apply\n\t\tfor (const { when, pack, ...field } of FILLED_IN[kind] ?? []) {\n\t\t\tif (pack && !hasPack(game, pack)) continue\n\t\t\tconst general = field.path.includes('<pool>')\n\t\t\t\t? poolsOf(game).map((pool) => field.path.replace('<pool>', pool))\n\t\t\t\t: field.path.includes('<calling>')\n\t\t\t\t\t? callingsOf({ packs: game?.packs }).map((calling) => field.path.replace('<calling>', calling.id))\n\t\t\t\t\t: [field.path]\n\t\t\tfor (const path of general.flatMap((each) => expandedPaths(def, each)))\n\t\t\t\tif (!paths.includes(path) && !fields.some((each) => each.path === path) && when(def as unknown as Record<string, unknown>))\n\t\t\t\t\tfields.push(fieldOf(kind, def, { ...field, path }))\n\t\t}\n\t\t// the lists of things changed whole, and an upgrade's requirements by level\n\t\tfields.push(...allRows(game, kind, def))\n\t\tif (kind === 'upgrades') fields.push(...levelLists(def as UpgradeDef))\n\t\treturn fields\n\t}\n\treturn said.flatMap((field) => {\n\t\tconst path = typeof field === 'string' ? field : field.path\n\t\tconst spec = ROWS[kind]?.[path]\n\t\tif (!spec) return [fieldOf(kind, def, field)]\n\t\tconst rows = valueAt(def, path)\n\t\tif (rows !== undefined && !(Array.isArray(rows) && isData(rows))) return []\n\t\treturn rowsFields(game, spec, path, path.split('.').join(' '), (rows as unknown[]) ?? [])\n\t})\n}\n\n/** How many words a list field holds at most, and how long each is */\nconst MAX_LIST = 64\nconst MAX_WORD = 100\n\n/** Whether something is values as a data file has them: numbers, words, yes or no, lists of them and of things, a few deep */\nfunction isValues(value: unknown, depth = 0): value is DataValues {\n\treturn isRecord(value) && depth <= 6 && Object.entries(value).every(([key, each]) => /^[\\w$]+$/.test(key) && isEntry(each, depth + 1))\n}\nconst isEntry = (value: unknown, depth: number): boolean =>\n\t(isValue(value) && (typeof value !== 'string' || value.length <= 200)) ||\n\t(Array.isArray(value) && value.length <= MAX_LIST && value.every((each) => isEntry(each, depth + 1))) ||\n\tisValues(value, depth)\n\n/** Whether something is a list of things as a `rows` field takes it whole */\nconst isRows = (value: unknown): value is DataValues[] => Array.isArray(value) && value.length <= MAX_LIST && value.every((row) => isValues(row))\n\n/**\n * A value as a field takes it, or the reason it does not\n *\n * @beta\n */\nexport function fitValue(field: DataField, value: unknown): { value: FieldValue } | { error: string } {\n\tswitch (field.kind) {\n\t\tcase 'rows':\n\t\t\treturn isRows(value) && (!field.types || value.every((row) => typeof row.type === 'string'))\n\t\t\t\t? { value: value.map((row) => ({ ...row })) }\n\t\t\t\t: { error: `${field.path} is a list of things${field.types ? ', each of a type' : ''}` }\n\t\tcase 'list': {\n\t\t\t// one id where it may be one (`one`): as given, or a list of one\n\t\t\tconst words = field.one && typeof value === 'string' ? [value] : value\n\t\t\treturn isWords(words) && words.length <= MAX_LIST && words.every((each) => each.length <= MAX_WORD)\n\t\t\t\t? { value: field.one && words.length === 1 ? words[0] : [...words] }\n\t\t\t\t: { error: `${field.path} is a list of words` }\n\t\t}\n\t\tcase 'boolean':\n\t\t\treturn typeof value === 'boolean' ? { value } : { error: `${field.path} is yes or no` }\n\t\tcase 'text':\n\t\t\treturn typeof value === 'string' ? { value } : { error: `${field.path} is words` }\n\t\tcase 'id':\n\t\t\treturn typeof value === 'string' && value.length <= MAX_WORD\n\t\t\t\t? { value }\n\t\t\t\t: { error: `${field.path} is an id${field.of ? ` of the ${field.of}` : ''}` }\n\t\tcase 'choice':\n\t\t\treturn typeof value === 'string' && (!field.options || field.options.includes(value))\n\t\t\t\t? { value }\n\t\t\t\t: { error: `${field.path} is one of ${(field.options ?? []).join(', ')}` }\n\t\tcase 'either':\n\t\t\tif (typeof value === 'boolean' || (typeof value === 'string' && field.options?.includes(value))) return { value }\n\t\t\tif (field.orNumber && typeof value === 'number' && Number.isFinite(value)) return { value: fitNumber(field, field.orNumber, value) }\n\t\t\treturn { error: `${field.path} is ${['yes or no', ...(field.options ?? []), ...(field.orNumber ? ['a number'] : [])].join(', ')}` }\n\t\tdefault:\n\t\t\treturn typeof value === 'number' && Number.isFinite(value)\n\t\t\t\t? { value: fitNumber(field, field.kind, value) }\n\t\t\t\t: { error: `${field.path} is a number` }\n\t}\n}\n\n/** A number within a field's ends, whole where it is an integer */\nfunction fitNumber(field: DataField, kind: string, value: number): number {\n\tlet set = kind === 'integer' ? Math.round(value) : value\n\tif (field.min !== undefined) set = Math.max(set, field.min)\n\tif (field.max !== undefined) set = Math.min(set, field.max)\n\treturn set\n}\n\n/** Whether a list in the data is one of things by place (a unit's attacks) or of numbers (a bounty's two ends): walked by place, as a record of indices is */\nconst byPlace = (value: unknown): value is unknown[] =>\n\tArray.isArray(value) && value.length > 0 && (value.every(isRecord) || value.every((each) => typeof each === 'number'))\n\n/**\n * Every path of values, with what is there: a list of things or numbers by place (`attacks.0.damagePoint`), a list of\n * words whole, and a list of things whole where `whole` says (a `rows` field's)\n */\nfunction pathsOf(values: DataValues, whole: (path: string) => boolean = () => false, prefix = ''): { path: string; value: unknown }[] {\n\treturn Object.entries(values).flatMap(([key, value]) => {\n\t\tconst path = prefix ? `${prefix}.${key}` : key\n\t\treturn isRecord(value) || (byPlace(value) && !whole(path)) ? pathsOf(value as DataValues, whole, path) : [{ path, value }]\n\t})\n}\n\n/** Whether a record is one of places in a list: every key a whole number */\nconst places = (value: Record<string, unknown>): boolean => Object.keys(value).length > 0 && Object.keys(value).every((key) => /^\\d+$/.test(key))\n\n/**\n * A definition with values over it: a copy, the parts the values go into copied too, the rest (its functions, its\n * lists of things) shared with the one it was made from. Values by place (`{ attacks: { 0: { damagePoint: 0.5 } } }`)\n * go into the list there, or make one where there is none. Nothing of the definition given is changed\n *\n * @beta\n */\nexport function layValues<D>(def: D, values: DataValues): D {\n\tconst over = (into: unknown, from: DataValues): unknown => {\n\t\tconst copy: Record<string, unknown> = Array.isArray(into) ? ([...into] as unknown as Record<string, unknown>) : { ...(into as object) }\n\t\tfor (const [key, value] of Object.entries(from)) {\n\t\t\tif (!isRecord(value)) {\n\t\t\t\tcopy[key] = value\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst there = copy[key]\n\t\t\tconst inner = isRecord(there) || Array.isArray(there) ? there : places(value) ? [] : {}\n\t\t\tcopy[key] = over(inner, value as DataValues)\n\t\t}\n\t\treturn copy\n\t}\n\treturn over(def, values) as D\n}\n\n/**\n * Values merged: what `b` says over what `a` says, at any depth. Places said over a list go into it (`{ 0: { amount:\n * 50 } }` over a list of effects); a list said is the list\n *\n * @beta\n */\nexport function mergeValues(a: DataValues, b: DataValues): DataValues {\n\tconst out: DataValues = { ...a }\n\tfor (const [key, value] of Object.entries(b)) {\n\t\tconst before = out[key]\n\t\tif (isRecord(value) && isRecord(before)) out[key] = mergeValues(before as DataValues, value as DataValues)\n\t\telse if (isRecord(value) && Array.isArray(before) && places(value)) {\n\t\t\tconst list: unknown[] = [...before]\n\t\t\tfor (const [place, each] of Object.entries(value))\n\t\t\t\tlist[Number(place)] =\n\t\t\t\t\tisRecord(each) && isRecord(list[Number(place)]) ? mergeValues(list[Number(place)] as DataValues, each as DataValues) : each\n\t\t\tout[key] = list as DataValues[]\n\t\t} else out[key] = value\n\t}\n\treturn out\n}\n\n/**\n * Only the values of the fields that can be changed, each as its field takes it. What is not is left out and said:\n * a field the game no longer lets be changed, a value of another kind\n *\n * @beta\n */\nexport function editableValues(fields: readonly DataField[], values: DataValues, said: (why: string) => void = () => {}): DataValues {\n\tlet out: DataValues = {}\n\tconst rows = new Set(fields.filter((field) => field.kind === 'rows').map((field) => field.path))\n\tfor (const { path, value } of pathsOf(values, (path) => rows.has(path))) {\n\t\tconst field = fields.find((each) => each.path === path)\n\t\tif (!field) {\n\t\t\tsaid(`${path} cannot be changed from the data`)\n\t\t\tcontinue\n\t\t}\n\t\tconst fit = fitValue(field, value)\n\t\tif ('error' in fit) said(fit.error)\n\t\telse out = mergeValues(out, nested(path, fit.value))\n\t}\n\treturn out\n}\n\n/**\n * The game with what its `data.json` says over what its code says: `export default layData(game, dataFile)`. Only\n * the fields the game lets be changed (`Rules.editable`) are taken, and of the kind each holds; anything else in\n * the file is left out, and said in the log. The game given is not changed\n *\n * @beta\n */\nexport function layData(game: Rules, file: unknown): Rules {\n\tif (!isRecord(file)) return game\n\tconst warn = (why: string) => rootLogger.warn('game', `${game.id}'s data.json: ${why}`)\n\t// what it takes of the default sets, first: the definitions the rest of it changes are among them\n\tif (file.defaults !== undefined) {\n\t\tconst wrong = dataDefaultsProblem(file.defaults, game)\n\t\tif (wrong) warn(wrong)\n\t\telse game = dataDefaults(game, file.defaults as Record<string, DataSetChoice>)\n\t}\n\tlet out: Rules = { ...game }\n\t// tags named and given a look, and the callings: over the game's, by id\n\tif (file.tags !== undefined) {\n\t\tconst wrong = dataEntriesProblem('tags', file.tags)\n\t\tif (wrong) warn(wrong)\n\t\telse out.tags = layEntries(out.tags ?? [], file.tags as Record<string, DataTag>, (id) => ({ id }))\n\t}\n\tif (file.callings !== undefined) {\n\t\tconst wrong = dataEntriesProblem('callings', file.callings)\n\t\tif (wrong) warn(wrong)\n\t\telse out = withCallings(out, layEntries(callingsOf(out), file.callings as Record<string, DataCalling>, (id) => ({ id, name: id })))\n\t}\n\t// the values of the layers of cells (a style of grass, its name and rules): over the game's, by number\n\tif (file.cellLayers !== undefined) {\n\t\tconst wrong = dataCellLayersProblem(file.cellLayers)\n\t\tif (wrong) warn(wrong)\n\t\telse {\n\t\t\tconst said = file.cellLayers as Record<string, DataCellLayer>\n\t\t\tif (out.cellLayers) out.cellLayers = layCellLayerData(out.cellLayers, said)\n\t\t\tfor (const layer of Object.keys(said)) if (!out.cellLayers?.some((def) => def.id === layer)) warn(`cellLayers: the game has no layer of cells \"${layer}\"`)\n\t\t}\n\t}\n\tfor (const kind of DATA_KINDS) {\n\t\tconst values = file[kind]\n\t\tif (values === undefined) continue\n\t\tconst defs = game[kind] as { id: string }[] | undefined\n\t\tif (!isRecord(values) || !defs) {\n\t\t\twarn(`there are no ${kind} to set`)\n\t\t\tcontinue\n\t\t}\n\t\tconst seen = new Set(Object.keys(values))\n\t\t/** What is said of a definition as its fields take it, what it is a copy of (or that it is new) left out */\n\t\tconst over = (def: { id: string }, own: Record<string, unknown>) => {\n\t\t\tconst { [COPY_OF]: _, [NEW_DEFINITION]: isNew, ...rest } = own\n\t\t\t// a unit type made of nothing says its kind, which is taken as it is made\n\t\t\tif (isNew === true) delete rest.kind\n\t\t\tconst fields = editableFields(game, kind, def as never)\n\t\t\treturn layValues(\n\t\t\t\tdef,\n\t\t\t\teditableValues(fields, rest as DataValues, (why) => warn(`${kind}.${def.id}: ${why}`))\n\t\t\t)\n\t\t}\n\t\tconst made = defs.map((def) => {\n\t\t\tconst own = values[def.id]\n\t\t\tif (!isRecord(own)) return def\n\t\t\tseen.delete(def.id)\n\t\t\treturn over(def, own)\n\t\t})\n\t\t// definitions of its own made of nothing\n\t\tfor (const id of seen) {\n\t\t\tconst own = values[id]\n\t\t\tif (!isRecord(own) || own[NEW_DEFINITION] !== true) continue\n\t\t\tmade.push(over(blankDefinition(kind, id, unitKindOf(own.kind)), own))\n\t\t\tseen.delete(id)\n\t\t}\n\t\t// copies, of the game's or of copies before them: as many rounds as it takes, each making those it can\n\t\tfor (let progress = true; progress;) {\n\t\t\tprogress = false\n\t\t\tfor (const id of seen) {\n\t\t\t\tconst own = values[id]\n\t\t\t\tconst from = isRecord(own) ? own[COPY_OF] : undefined\n\t\t\t\tconst base = typeof from === 'string' ? made.find((def) => def.id === from) : undefined\n\t\t\t\tif (!base) continue\n\t\t\t\tmade.push(over({ ...base, id, basedOn: from as string } as { id: string }, own as Record<string, unknown>))\n\t\t\t\tseen.delete(id)\n\t\t\t\tprogress = true\n\t\t\t}\n\t\t}\n\t\t;(out as unknown as Record<string, unknown>)[kind] = made\n\t\tfor (const id of seen) {\n\t\t\tconst from = isRecord(values[id]) ? (values[id] as Record<string, unknown>)[COPY_OF] : undefined\n\t\t\twarn(typeof from === 'string' ? `${kind}.${id} is a copy of \"${from}\", which the game has not` : `the game has no ${kind} \"${id}\"`)\n\t\t}\n\t}\n\t// how the computers play each race: the file's profile of a race in the place of the code's\n\tconst ai = file.ai\n\tif (ai !== undefined) {\n\t\tconst races = isRecord(ai) ? ai.races : undefined\n\t\tif (!isRecord(ai) || (races !== undefined && !isRecord(races))) warn('ai is no { races: { <race>: <profile> } }')\n\t\telse if (isRecord(races)) {\n\t\t\tconst own = { ...game.ai?.races }\n\t\t\tfor (const [race, profile] of Object.entries(races)) {\n\t\t\t\tif (!isRecord(profile)) {\n\t\t\t\t\twarn(`ai.races.${race} is no profile`)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (!(out.races ?? []).some((def) => def.id === race)) warn(`ai.races: the game has no race \"${race}\"`)\n\t\t\t\town[race] = profile as AiProfile\n\t\t\t}\n\t\t\tout.ai = { ...game.ai, races: own }\n\t\t}\n\t}\n\t// the rules as data, over the game's\n\tif (file.rules !== undefined) {\n\t\tconst wrong = dataRulesProblem(file.rules)\n\t\tif (wrong) warn(wrong)\n\t\telse Object.assign(out, withDataRules(out, file.rules as DataRules))\n\t}\n\t// the definitions taken out, after the copies of them are made\n\tconst removed = file.removed\n\tif (isRecord(removed)) {\n\t\tfor (const [kind, ids] of Object.entries(removed)) {\n\t\t\tconst list = (out as unknown as Record<string, { id: string }[] | undefined>)[kind]\n\t\t\tif (!DATA_KINDS.includes(kind as DataKind) || !list || !isWords(ids)) {\n\t\t\t\twarn(`removed.${kind} is no list of ${kind} of the game`)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor (const id of ids) if (!list.some((def) => def.id === id)) warn(`removed.${kind}: the game has no ${kind} \"${id}\"`)\n\t\t\t;(out as unknown as Record<string, unknown>)[kind] = list.filter((def) => !ids.includes(def.id))\n\t\t}\n\t}\n\treturn out\n}\n\n/** The kind of thing a unit type made of nothing is, as its data says: a unit when it says none the game knows */\nconst unitKindOf = (said: unknown): string | undefined => (typeof said === 'string' && UNIT_KINDS.includes(said) ? said : undefined)\n\n/**\n * What a world's definitions were changed to while it runs (`world.redefine`), by kind and id: kept with the world\n * and in its save, so that a load has them again\n *\n * @beta\n */\nexport const redefinitions = defineComponent<GameData>({ id: 'core.redefinitions', default: () => ({}) })\n\n/**\n * A definition changed while the game runs: what it is now\n *\n * @beta\n */\nexport const definitionChanged = defineEngineEvent<{ kind: DataKind; id: string; values?: DataValues }>({ id: 'core.definitionChanged' })\n\n/**\n * Puts a definition with values over it into the registry, in the place of the one there: what is made of it from\n * then on is made of the new one. False for a definition the game does not have\n *\n * @beta\n */\nexport function redefineIn(registry: Registry, kind: DataKind, id: string, values: DataValues): boolean {\n\t// a copy of another, by an id the game has nothing by: made, and the rest of what is said put over it\n\tconst copyOf = values[COPY_OF]\n\tif (typeof copyOf === 'string' && !definitionIn(registry, kind, id)) {\n\t\tif (!copyDefinition(registry, kind, copyOf, id)) return false\n\t\tconst { [COPY_OF]: _, ...rest } = values\n\t\treturn Object.keys(rest).length ? redefineIn(registry, kind, id, rest) : true\n\t}\n\t// one of its own made of nothing, the same\n\tif (values[NEW_DEFINITION] === true && !definitionIn(registry, kind, id)) {\n\t\tif (!id) return false\n\t\t;(registry.kinds[kind] as Definitions<DataDefs[DataKind]>).define(blankDefinition(kind, id, unitKindOf(values.kind)))\n\t\tconst { [NEW_DEFINITION]: _, kind: __, ...rest } = values\n\t\treturn Object.keys(rest).length ? redefineIn(registry, kind, id, rest) : true\n\t}\n\tif (COPY_OF in values || NEW_DEFINITION in values) {\n\t\tconst { [COPY_OF]: _, [NEW_DEFINITION]: __, ...rest } = values\n\t\tvalues = rest\n\t}\n\tconst defs = registry.kinds[kind] as Definitions<DataDefs[DataKind]>\n\tconst def = defs.find(id)\n\tif (!def) return false\n\tdefs.define(layValues(def, values))\n\treturn true\n}\n\n/**\n * A new definition, a copy of one the registry has, by an id it has nothing by: what it is drawn as is the one it is\n * a copy of (`basedOn`) until the game gives it a look of its own. False for one it does not have, or an id it has\n *\n * @beta\n */\nexport function copyDefinition(registry: Registry, kind: DataKind, from: string, id: string): boolean {\n\tconst base = definitionIn(registry, kind, from)\n\tif (!base || definitionIn(registry, kind, id) || !id) return false\n\tconst copy = { ...base, id, basedOn: from }\n\t;(registry.kinds[kind] as Definitions<DataDefs[DataKind]>).define(copy as DataDefs[DataKind])\n\treturn true\n}\n\n/**\n * Takes a definition out of the registry (the Data panel's Delete): what is made of it from then on is not. False for\n * one it has not. Not for a world that runs: its units of the type are there\n *\n * @beta\n */\nexport function removeDefinition(registry: Registry, kind: DataKind, id: string): boolean {\n\treturn (registry.kinds[kind] as Definitions<DataDefs[DataKind]>).remove(id)\n}\n\n/**\n * The definition of a kind and id in the registry, as it is now, or undefined\n *\n * @beta\n */\nexport function definitionIn<K extends DataKind>(registry: Registry, kind: K, id: string): DataDefs[K] | undefined {\n\treturn (registry.kinds[kind] as Definitions<DataDefs[K]>).find(id)\n}\n\n/**\n * Every definition of a kind the registry has\n *\n * @beta\n */\nexport function definitionsIn<K extends DataKind>(registry: Registry, kind: K): DataDefs[K][] {\n\treturn (registry.kinds[kind] as Definitions<DataDefs[K]>).all()\n}\n\n/** Puts what a save kept of the definitions changed while it ran back into the registry: before its entities are made */\nexport function restoreRedefinitions(registry: Registry, kept: unknown): void {\n\tif (!isRecord(kept)) return\n\tfor (const kind of DATA_KINDS) {\n\t\tconst byId = kept[kind]\n\t\tif (!isRecord(byId)) continue\n\t\tfor (const [id, values] of Object.entries(byId)) if (isRecord(values)) redefineIn(registry, kind, id, values as DataValues)\n\t}\n}\n\n/** A path into a definition: names and places, joined by dots */\n/** A path into a definition, as the Data panel names a field: `stats.health` */\nexport const pathCheck: Check<string> = (value, path) => {\n\tconst text = string(value, path)\n\tif (!/^[A-Za-z_$][\\w$]*(\\.[\\w$]+)*$/.test(text)) throw new Invalid(`${path} is a path like stats.health`)\n\treturn text\n}\n\n/** A value of a field the Data panel may set: a number, words, yes or no, a list of words, or a list of things whole */\nexport const valueCheck: Check<FieldValue> = (value, path) => {\n\tif (isValue(value) && (typeof value !== 'string' || value.length <= 200)) return value\n\tif (isWords(value) && value.length <= MAX_LIST && value.every((each) => each.length <= MAX_WORD)) return value\n\tif (isRows(value)) return value\n\tthrow new Invalid(`${path} is a number, words, yes or no, a list of words, or a list of things`)\n}\n\n/** A definition changed while the game runs (`world.redefine`): to everyone, whose screens read the definitions */\nexport const toldRedefined = replicateEvent(definitionChanged, 'redefined', ({ kind, id, values }) =>\n\tvalues ? { type: 'redefined', kind, definition: id, values: structuredClone(values) } : undefined\n)\n"],"mappings":";;;;;;;;;;;;;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C,OAAO,SAAS;CAC7D,IAAI,QAAQ,KAAK,MAAM,OAAO,UAAU,YAAY,MAAM,UAAU,MAAM,OAAO;CACjF,IAAI,QAAQ,KAAK,KAAK,MAAM,UAAU,YAAY,MAAM,OAAO,SAAS,KAAK,UAAU,QAAQ,GAAG,OAAO;CACzG,IAAI,OAAO,KAAK,GAAG,OAAO;CAC1B,MAAM,IAAI,QAAQ,GAAG,KAAK,qEAAqE;AAChG;;AAGA,IAAa,gBAAgB,eAAe,mBAAmB,cAAc,EAAE,MAAM,IAAI,aACxF,SAAS;CAAE,MAAM;CAAa;CAAM,YAAY;CAAI,QAAQ,gBAAgB,MAAM;AAAE,IAAI,KAAA,CACzF"}
|
package/dist/gameFiles.d.ts
CHANGED
|
@@ -18,9 +18,9 @@ export interface GameFileDef<T> {
|
|
|
18
18
|
read(data: unknown): T;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* A file of the game's own data, for `
|
|
21
|
+
* A file of the game's own data, for `Rules.files`: `defineGameFile({ id: 'waves.json', data: wavesFile, read: readWaves })`, read by
|
|
22
22
|
* the rules with `world.registry.file(waves)`
|
|
23
23
|
*
|
|
24
|
-
* @
|
|
24
|
+
* @public
|
|
25
25
|
*/
|
|
26
|
-
export declare function defineGameFile<T>(
|
|
26
|
+
export declare function defineGameFile<T>(def: GameFileDef<T>): GameFileDef<T>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/gameFiles.ts
|
|
2
|
+
/**
|
|
3
|
+
* A file of the game's own data, for `Rules.files`: `defineGameFile({ id: 'waves.json', data: wavesFile, read: readWaves })`, read by
|
|
4
|
+
* the rules with `world.registry.file(waves)`
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
function defineGameFile(def) {
|
|
9
|
+
return def;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { defineGameFile };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=gameFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gameFiles.js","names":[],"sources":["../src/gameFiles.ts"],"sourcesContent":["/**\n * A file of a game's own data that its rules read as they run and a panel edits (`defineGameFile`): a campaign's waves,\n * a tower defence's paths. Each world's registry holds what it was read as (`registry.file`), so two games on one page\n * or two rooms of a server each play their own, and the editor's panel changes the one its game plays\n * (`registry.setFile`); the file itself is the game's, written by the editor and taken again as code is (`hotRules`)\n */\n\n/**\n * A file of the game's own data, and how it is read\n *\n * @beta\n */\nexport interface GameFileDef<T> {\n\t/** Unique in the game: the file's name, as the editor writes it (`waves.json`) */\n\treadonly id: string\n\t/** What the file says, as the game was built with it (an imported JSON file) */\n\treadonly data: unknown\n\t/** What the rules read of it: checked, with what is not of its shape left out */\n\tread(data: unknown): T\n}\n\n/**\n * A file of the game's own data, for `Rules.files`: `defineGameFile({ id: 'waves.json', data: wavesFile, read: readWaves })`, read by\n * the rules with `world.registry.file(waves)`\n *\n * @public\n */\nexport function defineGameFile<T>(def: GameFileDef<T>): GameFileDef<T> {\n\treturn def\n}\n"],"mappings":";;;;;;;AA2BA,SAAgB,eAAkB,KAAqC;CACtE,OAAO;AACR"}
|
package/dist/gates.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { defineComponent } from "./components.js";
|
|
2
|
+
import { defineEngineEvent } from "./events.js";
|
|
3
|
+
import { mapInfo } from "./names.js";
|
|
4
|
+
//#region src/gates.ts
|
|
5
|
+
/**
|
|
6
|
+
* Which gates of the map are open, by name: kept with the world and in its save
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
var gateStates = defineComponent({
|
|
11
|
+
id: "core.gates",
|
|
12
|
+
default: () => ({})
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* A gate opened or shut while the game runs: every screen hears it, to draw it open or shut
|
|
16
|
+
*
|
|
17
|
+
* @beta
|
|
18
|
+
*/
|
|
19
|
+
var gateChanged = defineEngineEvent({
|
|
20
|
+
id: "core.gateChanged",
|
|
21
|
+
replicate: "everyone"
|
|
22
|
+
});
|
|
23
|
+
/** Obstacles of gates are kept apart from those of buildings, which go by entity id */
|
|
24
|
+
var GATE_KEYS = 1e9;
|
|
25
|
+
var gatesOf = (world) => world.map.doodads.filter((doodad) => doodad.gate && doodad.name && doodad.radius);
|
|
26
|
+
/** What a shut gate keeps nothing from walking through: the square around it, as far as it reaches */
|
|
27
|
+
function shut(world, gate) {
|
|
28
|
+
if (!world.nav.addObstacle(GATE_KEYS + gate.id, {
|
|
29
|
+
x: gate.x,
|
|
30
|
+
z: gate.z,
|
|
31
|
+
hw: gate.radius,
|
|
32
|
+
hd: gate.radius
|
|
33
|
+
})) world.log.warn("navigation", `There is no room for another obstacle: the gate ${gate.name} does not block the way`, { gate: gate.id });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Puts the gates of the map in the world as they are: shut ones in the way of what walks. When the world is made from
|
|
37
|
+
* the map, and again when it is loaded from a save, which keeps which are open but not the obstacles
|
|
38
|
+
*/
|
|
39
|
+
function setUpGates(world) {
|
|
40
|
+
const gates = gatesOf(world);
|
|
41
|
+
if (!gates.length) return;
|
|
42
|
+
const states = world.state(gateStates);
|
|
43
|
+
for (const gate of gates) {
|
|
44
|
+
const open = states[gate.name] ?? gate.open ?? false;
|
|
45
|
+
states[gate.name] = open;
|
|
46
|
+
if (!open) shut(world, gate);
|
|
47
|
+
}
|
|
48
|
+
world.setState(gateStates, states);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Whether a gate of the map is open, by its name. Nothing for a name that is no gate
|
|
52
|
+
*
|
|
53
|
+
* @beta
|
|
54
|
+
*/
|
|
55
|
+
function isGateOpen(world, name) {
|
|
56
|
+
return world.state(gateStates)[name];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Opens or shuts a gate of the map by its name, while the game runs: what walks goes through it or around, and every
|
|
60
|
+
* screen draws it so (`gateChanged`). False when the map has no gate by that name
|
|
61
|
+
*
|
|
62
|
+
* @beta
|
|
63
|
+
*/
|
|
64
|
+
function setGate(world, name, open) {
|
|
65
|
+
const gate = gatesOf(world).find((doodad) => doodad.name === name);
|
|
66
|
+
if (!gate) return false;
|
|
67
|
+
const states = world.state(gateStates);
|
|
68
|
+
if (states[name] === open) return true;
|
|
69
|
+
world.setState(gateStates, {
|
|
70
|
+
...states,
|
|
71
|
+
[name]: open
|
|
72
|
+
});
|
|
73
|
+
if (open) world.nav.removeObstacle(GATE_KEYS + gate.id);
|
|
74
|
+
else shut(world, gate);
|
|
75
|
+
const info = world.state(mapInfo);
|
|
76
|
+
world.setState(mapInfo, {
|
|
77
|
+
...info,
|
|
78
|
+
doodads: (info.doodads ?? []).map((doodad) => doodad.id === gate.id ? {
|
|
79
|
+
...doodad,
|
|
80
|
+
open
|
|
81
|
+
} : doodad)
|
|
82
|
+
});
|
|
83
|
+
world.events.emit(gateChanged, {
|
|
84
|
+
name,
|
|
85
|
+
open
|
|
86
|
+
});
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { gateChanged, gateStates, isGateOpen, setGate, setUpGates };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=gates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gates.js","names":[],"sources":["../src/gates.ts"],"sourcesContent":["import { defineComponent } from './components'\nimport { defineEngineEvent } from './events'\nimport type { MapDoodad } from './map'\nimport { mapInfo } from './names'\nimport type { World } from './world'\n\n/**\n * Which gates of the map are open, by name: kept with the world and in its save\n *\n * @internal\n */\nexport const gateStates = defineComponent<Record<string, boolean>>({ id: 'core.gates', default: () => ({}) })\n\n/**\n * A gate opened or shut while the game runs: every screen hears it, to draw it open or shut\n *\n * @beta\n */\nexport const gateChanged = defineEngineEvent<{ name: string; open: boolean }>({ id: 'core.gateChanged', replicate: 'everyone' })\n\n/** Obstacles of gates are kept apart from those of buildings, which go by entity id */\nconst GATE_KEYS = 1_000_000_000\n\nconst gatesOf = (world: World): MapDoodad[] => world.map.doodads.filter((doodad) => doodad.gate && doodad.name && doodad.radius)\n\n/** What a shut gate keeps nothing from walking through: the square around it, as far as it reaches */\nfunction shut(world: World, gate: MapDoodad): void {\n\tif (!world.nav.addObstacle(GATE_KEYS + gate.id, { x: gate.x, z: gate.z, hw: gate.radius!, hd: gate.radius! }))\n\t\tworld.log.warn('navigation', `There is no room for another obstacle: the gate ${gate.name} does not block the way`, { gate: gate.id })\n}\n\n/**\n * Puts the gates of the map in the world as they are: shut ones in the way of what walks. When the world is made from\n * the map, and again when it is loaded from a save, which keeps which are open but not the obstacles\n */\nexport function setUpGates(world: World): void {\n\tconst gates = gatesOf(world)\n\t// a world without gates keeps nothing of them\n\tif (!gates.length) return\n\tconst states = world.state(gateStates)\n\tfor (const gate of gates) {\n\t\tconst open = states[gate.name!] ?? gate.open ?? false\n\t\tstates[gate.name!] = open\n\t\tif (!open) shut(world, gate)\n\t}\n\tworld.setState(gateStates, states)\n}\n\n/**\n * Whether a gate of the map is open, by its name. Nothing for a name that is no gate\n *\n * @beta\n */\nexport function isGateOpen(world: World, name: string): boolean | undefined {\n\treturn world.state(gateStates)[name]\n}\n\n/**\n * Opens or shuts a gate of the map by its name, while the game runs: what walks goes through it or around, and every\n * screen draws it so (`gateChanged`). False when the map has no gate by that name\n *\n * @beta\n */\nexport function setGate(world: World, name: string, open: boolean): boolean {\n\tconst gate = gatesOf(world).find((doodad) => doodad.name === name)\n\tif (!gate) return false\n\tconst states = world.state(gateStates)\n\tif (states[name] === open) return true\n\tworld.setState(gateStates, { ...states, [name]: open })\n\tif (open) world.nav.removeObstacle(GATE_KEYS + gate.id)\n\telse shut(world, gate)\n\t// the map as screens that join later are given it\n\tconst info = world.state(mapInfo)\n\tworld.setState(mapInfo, { ...info, doodads: (info.doodads ?? []).map((doodad) => (doodad.id === gate.id ? { ...doodad, open } : doodad)) })\n\tworld.events.emit(gateChanged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,GAAG;GAAS,OAAO;CAAK,CAAC;CACtD,IAAI,MAAM,MAAM,IAAI,eAAe,YAAY,KAAK,EAAE;MACjD,KAAK,OAAO,IAAI;CAErB,MAAM,OAAO,MAAM,MAAM,OAAO;CAChC,MAAM,SAAS,SAAS;EAAE,GAAG;EAAM,UAAU,KAAK,WAAW,CAAC,EAAA,CAAG,KAAK,WAAY,OAAO,OAAO,KAAK,KAAK;GAAE,GAAG;GAAQ;EAAK,IAAI,MAAO;CAAE,CAAC;CAC1I,MAAM,OAAO,KAAK,aAAa;EAAE;EAAM;CAAK,CAAC;CAC7C,OAAO;AACR"}
|
package/dist/generate.d.ts
CHANGED
|
@@ -19,10 +19,15 @@ export type MapSymmetry = 'none' | 'x' | 'z' | 'both' | 'half' | 'quarter';
|
|
|
19
19
|
* @beta
|
|
20
20
|
*/
|
|
21
21
|
export interface GeneratorOptions {
|
|
22
|
+
/** The seed that makes the map: the same seed and options make the same map */
|
|
22
23
|
seed: number;
|
|
24
|
+
/** The map's width in cells */
|
|
23
25
|
width: number;
|
|
26
|
+
/** The map's depth in cells */
|
|
24
27
|
depth: number;
|
|
28
|
+
/** How many players the map has starts for */
|
|
25
29
|
players: number;
|
|
30
|
+
/** How the map is mirrored or turned so each player's side is alike: `none` when left out */
|
|
26
31
|
symmetry?: MapSymmetry;
|
|
27
32
|
/** The map's name: "Generated <seed>" when left out */
|
|
28
33
|
name?: string;
|
|
@@ -36,15 +41,23 @@ export interface GeneratorOptions {
|
|
|
36
41
|
* @beta
|
|
37
42
|
*/
|
|
38
43
|
export interface GeneratorParamDef {
|
|
44
|
+
/** The id the pass or parameter is kept by, in `GeneratorOptions.params` for a parameter */
|
|
39
45
|
id: string;
|
|
46
|
+
/** The name shown in the editor's dialog and the page's form */
|
|
40
47
|
name: string;
|
|
48
|
+
/** A line about it shown beside it in the form */
|
|
41
49
|
description?: string;
|
|
42
50
|
/** A number on a slider (the default), a switch, or one of `choices` */
|
|
43
51
|
kind?: 'number' | 'boolean' | 'choice';
|
|
52
|
+
/** The value used when the options do not say: a number, a string for a `choice` or a boolean for a switch */
|
|
44
53
|
default: number | string | boolean;
|
|
54
|
+
/** Of a `number`: the least the slider goes to */
|
|
45
55
|
min?: number;
|
|
56
|
+
/** Of a `number`: the most the slider goes to */
|
|
46
57
|
max?: number;
|
|
58
|
+
/** Of a `number`: the size of one step of the slider */
|
|
47
59
|
step?: number;
|
|
60
|
+
/** Of a `choice`: the values it can be, each with the label shown for it */
|
|
48
61
|
choices?: {
|
|
49
62
|
value: string;
|
|
50
63
|
label: string;
|
|
@@ -56,9 +69,13 @@ export interface GeneratorParamDef {
|
|
|
56
69
|
* @beta
|
|
57
70
|
*/
|
|
58
71
|
export interface GeneratorMark {
|
|
72
|
+
/** The kind of thing marked, a name the passes agree on (`start`, `camp`), read by `GeneratorContext.free` */
|
|
59
73
|
kind: string;
|
|
74
|
+
/** The mark's centre on the map's x axis, in cells */
|
|
60
75
|
x: number;
|
|
76
|
+
/** The mark's centre on the map's z axis, in cells */
|
|
61
77
|
z: number;
|
|
78
|
+
/** The radius the mark keeps clear, in cells */
|
|
62
79
|
radius: number;
|
|
63
80
|
}
|
|
64
81
|
/**
|
|
@@ -68,10 +85,13 @@ export interface GeneratorMark {
|
|
|
68
85
|
* @beta
|
|
69
86
|
*/
|
|
70
87
|
export interface GeneratorContext {
|
|
88
|
+
/** The map as the passes before left it; a pass changes it in place */
|
|
71
89
|
map: GameMap;
|
|
72
90
|
/** The seed's numbers: every draw of a pass is one of these, so the same seed makes the same map */
|
|
73
91
|
rng: Rng;
|
|
92
|
+
/** The options the map is made with: seed, size, players, symmetry and parameters */
|
|
74
93
|
options: GeneratorOptions;
|
|
94
|
+
/** The game's registry, which tells what unit types and doodads exist */
|
|
75
95
|
registry: Registry;
|
|
76
96
|
/** A parameter as it is: what the options say, or its default (`MapGenerator.params`), or `fallback` where neither says */
|
|
77
97
|
param<T extends number | string | boolean>(id: string, fallback: T): T;
|
|
@@ -121,18 +141,23 @@ export interface GeneratorContext {
|
|
|
121
141
|
* @beta
|
|
122
142
|
*/
|
|
123
143
|
export interface GeneratorPass {
|
|
144
|
+
/** The id the pass is told apart by */
|
|
124
145
|
id: string;
|
|
146
|
+
/** The name shown for the pass */
|
|
125
147
|
name: string;
|
|
148
|
+
/** Does the pass's work on `ctx.map`, returning nothing */
|
|
126
149
|
run(ctx: GeneratorContext): void;
|
|
127
150
|
}
|
|
128
151
|
/**
|
|
129
|
-
* A game's generator (`
|
|
152
|
+
* A game's generator (`Rules.generator`): its parameters, as the dialog and the page show them, and its passes
|
|
130
153
|
* in order. `generateMap` runs it
|
|
131
154
|
*
|
|
132
155
|
* @beta
|
|
133
156
|
*/
|
|
134
157
|
export interface MapGenerator {
|
|
158
|
+
/** The parameters the generator takes, as the dialog and the page show them */
|
|
135
159
|
params: GeneratorParamDef[];
|
|
160
|
+
/** The passes run in order, each working on the map the passes before made */
|
|
136
161
|
passes: GeneratorPass[];
|
|
137
162
|
/**
|
|
138
163
|
* How many seeds are tried where the map comes out with a problem that keeps it from being played (an error, a start
|
|
@@ -146,7 +171,9 @@ export interface MapGenerator {
|
|
|
146
171
|
* @beta
|
|
147
172
|
*/
|
|
148
173
|
export interface GeneratedWith {
|
|
174
|
+
/** The seed the map came out of */
|
|
149
175
|
seed: number;
|
|
176
|
+
/** The options the map was made with, kept so the same map can be made again */
|
|
150
177
|
options: GeneratorOptions;
|
|
151
178
|
}
|
|
152
179
|
/**
|