@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":"objects.js","names":[],"sources":["../../../src/mapCheck/rules/objects.ts"],"sourcesContent":["import { WATER_DEEP } from '../../terrain'\nimport type { MapRule } from '../rule'\n\n/** What is placed and the camps: of types the game has, on the map, out of deep water (but what sails, or flies) */\nexport const objectRules: MapRule = {\n\tid: 'objects',\n\tcheck(map, registry, say, { terrain, onMap }) {\n\t\tfor (const object of map.objects) {\n\t\t\tif (!registry.units.has(object.type)) {\n\t\t\t\tsay({\n\t\t\t\t\tmessage: `\"${object.type}\" is no unit type of the game: it is left out`,\n\t\t\t\t\tat: object,\n\t\t\t\t\trule: 'unknown-type',\n\t\t\t\t\tabout: { object: object.id }\n\t\t\t\t})\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (!onMap(object)) {\n\t\t\t\tsay({\n\t\t\t\t\tmessage: `${registry.unit(object.type).name} stands off the map`,\n\t\t\t\t\terror: true,\n\t\t\t\t\tat: object,\n\t\t\t\t\trule: 'off-map',\n\t\t\t\t\tabout: { object: object.id }\n\t\t\t\t})\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst def = registry.unit(object.type)\n\t\t\t// what flies is over it and what sails is on it: only what walks is wrong there\n\t\t\tif (!def.flying && !def.naval && terrain.waterAt(object.x, object.z) === WATER_DEEP)\n\t\t\t\tsay({ message: `${def.name} stands in deep water`, at: object, rule: 'deep-water', about: { object: object.id } })\n\t\t}\n\t\tfor (const camp of map.camps) {\n\t\t\tconst strangers = camp.units.filter((type) => !type.startsWith('@') && !registry.units.has(type))\n\t\t\tif (strangers.length)\n\t\t\t\tsay({\n\t\t\t\t\tmessage: `A camp has creeps the game does not have: ${strangers.join(', ')}`,\n\t\t\t\t\tat: camp,\n\t\t\t\t\trule: 'unknown-creeps',\n\t\t\t\t\tabout: { camp: camp.id }\n\t\t\t\t})\n\t\t\tif (!onMap(camp)) say({ message: 'A camp stands off the map', error: true, at: camp, rule: 'off-map', about: { camp: camp.id } })\n\t\t}\n\t}\n}\n"],"mappings":";;;AAIA,IAAa,cAAuB;CACnC,IAAI;CACJ,MAAM,KAAK,UAAU,KAAK,EAAE,SAAS,SAAS;EAC7C,KAAK,MAAM,UAAU,IAAI,SAAS;GACjC,IAAI,CAAC,SAAS,MAAM,IAAI,OAAO,IAAI,GAAG;IACrC,IAAI;KACH,SAAS,IAAI,OAAO,KAAK;KACzB,IAAI;KACJ,MAAM;KACN,OAAO,EAAE,QAAQ,OAAO,GAAG;IAC5B,CAAC;IACD;GACD;GACA,IAAI,CAAC,MAAM,MAAM,GAAG;IACnB,IAAI;KACH,SAAS,GAAG,SAAS,KAAK,OAAO,IAAI,CAAC,CAAC,KAAK;KAC5C,OAAO;KACP,IAAI;KACJ,MAAM;KACN,OAAO,EAAE,QAAQ,OAAO,GAAG;IAC5B,CAAC;IACD;GACD;GACA,MAAM,MAAM,SAAS,KAAK,OAAO,IAAI;GAErC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,SAAS,QAAQ,QAAQ,OAAO,GAAG,OAAO,CAAC,MAAA,GAClE,IAAI;IAAE,SAAS,GAAG,IAAI,KAAK;IAAwB,IAAI;IAAQ,MAAM;IAAc,OAAO,EAAE,QAAQ,OAAO,GAAG;GAAE,CAAC;EACnH;EACA,KAAK,MAAM,QAAQ,IAAI,OAAO;GAC7B,MAAM,YAAY,KAAK,MAAM,QAAQ,SAAS,CAAC,KAAK,WAAW,GAAG,KAAK,CAAC,SAAS,MAAM,IAAI,IAAI,CAAC;GAChG,IAAI,UAAU,QACb,IAAI;IACH,SAAS,6CAA6C,UAAU,KAAK,IAAI;IACzE,IAAI;IACJ,MAAM;IACN,OAAO,EAAE,MAAM,KAAK,GAAG;GACxB,CAAC;GACF,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI;IAAE,SAAS;IAA6B,OAAO;IAAM,IAAI;IAAM,MAAM;IAAW,OAAO,EAAE,MAAM,KAAK,GAAG;GAAE,CAAC;EACjI;CACD;AACD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/mapCheck/rules/paths.ts
|
|
2
|
+
/** Paths on the map: on it, and what they paint and carve there to be had */
|
|
3
|
+
var pathRules = {
|
|
4
|
+
id: "paths",
|
|
5
|
+
check(map, registry, say, { onMap }) {
|
|
6
|
+
for (const path of map.paths) {
|
|
7
|
+
const about = { path: path.id };
|
|
8
|
+
if (path.points.some((point) => !onMap(point))) say({
|
|
9
|
+
message: `The path ${path.name} goes off the map`,
|
|
10
|
+
at: path.points[0],
|
|
11
|
+
rule: "path-off-map",
|
|
12
|
+
about
|
|
13
|
+
});
|
|
14
|
+
for (const tile of [path.paint, path.profile?.ground]) if (tile !== void 0 && !map.tileset.includes(tile) && !registry.tiles.some((def) => def.id === tile)) say({
|
|
15
|
+
message: `The path ${path.name} paints with ${tile}, which neither the map's tiles nor the game's are`,
|
|
16
|
+
at: path.points[0],
|
|
17
|
+
rule: "path-tile-missing",
|
|
18
|
+
about
|
|
19
|
+
});
|
|
20
|
+
if (path.profile && path.points.length < 2) say({
|
|
21
|
+
message: `The path ${path.name} carves its bed with one point: it carves nothing until it has two`,
|
|
22
|
+
at: path.points[0],
|
|
23
|
+
rule: "path-profile-short",
|
|
24
|
+
about
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { pathRules };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","names":[],"sources":["../../../src/mapCheck/rules/paths.ts"],"sourcesContent":["import type { MapRule } from '../rule'\n\n/** Paths on the map: on it, and what they paint and carve there to be had */\nexport const pathRules: MapRule = {\n\tid: 'paths',\n\tcheck(map, registry, say, { onMap }) {\n\t\tfor (const path of map.paths) {\n\t\t\tconst about = { path: path.id }\n\t\t\tif (path.points.some((point) => !onMap(point)))\n\t\t\t\tsay({ message: `The path ${path.name} goes off the map`, at: path.points[0], rule: 'path-off-map', about })\n\t\t\t// a tile neither the map's tileset nor the game has is painted nowhere\n\t\t\tfor (const tile of [path.paint, path.profile?.ground])\n\t\t\t\tif (tile !== undefined && !map.tileset.includes(tile) && !registry.tiles.some((def) => def.id === tile))\n\t\t\t\t\tsay({\n\t\t\t\t\t\tmessage: `The path ${path.name} paints with ${tile}, which neither the map's tiles nor the game's are`,\n\t\t\t\t\t\tat: path.points[0],\n\t\t\t\t\t\trule: 'path-tile-missing',\n\t\t\t\t\t\tabout\n\t\t\t\t\t})\n\t\t\tif (path.profile && path.points.length < 2)\n\t\t\t\tsay({\n\t\t\t\t\tmessage: `The path ${path.name} carves its bed with one point: it carves nothing until it has two`,\n\t\t\t\t\tat: path.points[0],\n\t\t\t\t\trule: 'path-profile-short',\n\t\t\t\t\tabout\n\t\t\t\t})\n\t\t}\n\t}\n}\n"],"mappings":";;AAGA,IAAa,YAAqB;CACjC,IAAI;CACJ,MAAM,KAAK,UAAU,KAAK,EAAE,SAAS;EACpC,KAAK,MAAM,QAAQ,IAAI,OAAO;GAC7B,MAAM,QAAQ,EAAE,MAAM,KAAK,GAAG;GAC9B,IAAI,KAAK,OAAO,MAAM,UAAU,CAAC,MAAM,KAAK,CAAC,GAC5C,IAAI;IAAE,SAAS,YAAY,KAAK,KAAK;IAAoB,IAAI,KAAK,OAAO;IAAI,MAAM;IAAgB;GAAM,CAAC;GAE3G,KAAK,MAAM,QAAQ,CAAC,KAAK,OAAO,KAAK,SAAS,MAAM,GACnD,IAAI,SAAS,KAAA,KAAa,CAAC,IAAI,QAAQ,SAAS,IAAI,KAAK,CAAC,SAAS,MAAM,MAAM,QAAQ,IAAI,OAAO,IAAI,GACrG,IAAI;IACH,SAAS,YAAY,KAAK,KAAK,eAAe,KAAK;IACnD,IAAI,KAAK,OAAO;IAChB,MAAM;IACN;GACD,CAAC;GACH,IAAI,KAAK,WAAW,KAAK,OAAO,SAAS,GACxC,IAAI;IACH,SAAS,YAAY,KAAK,KAAK;IAC/B,IAAI,KAAK,OAAO;IAChB,MAAM;IACN;GACD,CAAC;EACH;CACD;AACD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "../../map/types.js";
|
|
2
|
+
import { maxPlayersOf } from "../../game.js";
|
|
3
|
+
//#region src/mapCheck/rules/players.ts
|
|
4
|
+
/** How many players the map has, against what the game allows */
|
|
5
|
+
var playerRules = {
|
|
6
|
+
id: "players",
|
|
7
|
+
check(map, registry, say, _context) {
|
|
8
|
+
const players = map.players.filter((player) => player.id !== 90 && player.id !== 0).length;
|
|
9
|
+
const most = registry.module ? maxPlayersOf(registry.module) : 32;
|
|
10
|
+
if (players > most) say({
|
|
11
|
+
message: `The map has ${players} players, and the game allows ${most}`,
|
|
12
|
+
error: true,
|
|
13
|
+
rule: "too-many-players"
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { playerRules };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=players.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"players.js","names":[],"sources":["../../../src/mapCheck/rules/players.ts"],"sourcesContent":["import { maxPlayersOf } from '../../game'\nimport { MAP_CREEPS, MAP_NEUTRAL, MAX_MAP_PLAYERS } from '../../map'\nimport type { MapRule } from '../rule'\n\n/** How many players the map has, against what the game allows */\nexport const playerRules: MapRule = {\n\tid: 'players',\n\tcheck(map, registry, say, _context) {\n\t\tconst players = map.players.filter((player) => player.id !== MAP_CREEPS && player.id !== MAP_NEUTRAL).length\n\t\tconst most = registry.module ? maxPlayersOf(registry.module) : MAX_MAP_PLAYERS\n\t\tif (players > most) say({ message: `The map has ${players} players, and the game allows ${most}`, error: true, rule: 'too-many-players' })\n\t}\n}\n"],"mappings":";;;;AAKA,IAAa,cAAuB;CACnC,IAAI;CACJ,MAAM,KAAK,UAAU,KAAK,UAAU;EACnC,MAAM,UAAU,IAAI,QAAQ,QAAQ,WAAW,OAAO,OAAA,MAAqB,OAAO,OAAA,CAAkB,CAAC,CAAC;EACtG,MAAM,OAAO,SAAS,SAAS,aAAa,SAAS,MAAM,IAAA;EAC3D,IAAI,UAAU,MAAM,IAAI;GAAE,SAAS,eAAe,QAAQ,gCAAgC;GAAQ,OAAO;GAAM,MAAM;EAAmB,CAAC;CAC1I;AACD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { availableTo } from "../../shared.js";
|
|
2
|
+
import "../../races.js";
|
|
3
|
+
//#region src/mapCheck/rules/races.ts
|
|
4
|
+
/**
|
|
5
|
+
* What is wrong with the races of a map: a player fixed to a race the game has not got, or the map offering one, are
|
|
6
|
+
* errors (a world is not made from it); what is placed for a player that their race may not have is a warning. What
|
|
7
|
+
* the map offers is for the players it fixes no race for: one fixed to another is as the map means it
|
|
8
|
+
*/
|
|
9
|
+
function raceProblems(map, registry) {
|
|
10
|
+
const problems = [];
|
|
11
|
+
const known = (race) => race === "random" || registry.races.has(race);
|
|
12
|
+
const none = registry.races.size === 0;
|
|
13
|
+
for (const race of map.races ?? []) {
|
|
14
|
+
if (race === "random" || registry.races.has(race)) continue;
|
|
15
|
+
problems.push({
|
|
16
|
+
message: `The map offers the race "${race}", which ${none ? "the game does not have: it has no races" : "is no race of the game"}`,
|
|
17
|
+
error: true,
|
|
18
|
+
rule: "unknown-race"
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
for (const player of map.players) {
|
|
22
|
+
if (player.race === void 0) continue;
|
|
23
|
+
if (!known(player.race)) problems.push({
|
|
24
|
+
message: `${player.name} plays the race "${player.race}", which ${none ? "the game does not have: it has no races" : "is no race of the game"}`,
|
|
25
|
+
error: true,
|
|
26
|
+
at: player.start,
|
|
27
|
+
rule: "unknown-race",
|
|
28
|
+
about: { player: player.id }
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const fixed = new Map(map.players.filter((player) => player.race && player.race !== "random" && registry.races.has(player.race)).map((player) => [player.id, player]));
|
|
32
|
+
for (const object of map.objects) {
|
|
33
|
+
const owner = fixed.get(object.owner);
|
|
34
|
+
if (!owner || !registry.units.has(object.type)) continue;
|
|
35
|
+
const def = registry.unit(object.type);
|
|
36
|
+
if (availableTo(def, owner.race)) continue;
|
|
37
|
+
problems.push({
|
|
38
|
+
message: `${def.name} is ${registry.race(def.race).name}, and ${owner.name} plays ${registry.race(owner.race).name}`,
|
|
39
|
+
at: object,
|
|
40
|
+
rule: "other-race",
|
|
41
|
+
about: { object: object.id }
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return problems;
|
|
45
|
+
}
|
|
46
|
+
/** The races of the map, its players and what is placed for them */
|
|
47
|
+
var raceRules = {
|
|
48
|
+
id: "races",
|
|
49
|
+
check(map, registry, say) {
|
|
50
|
+
for (const problem of raceProblems(map, registry)) say(problem);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { raceRules };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=races.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"races.js","names":[],"sources":["../../../src/mapCheck/rules/races.ts"],"sourcesContent":["import type { GameMap } from '../../map'\nimport type { MapProblem } from '../../mapFields'\nimport { RANDOM_RACE } from '../../races'\nimport type { Registry } from '../../registry'\nimport { availableTo } from '../../shared'\nimport type { MapRule } from '../rule'\n\n/**\n * What is wrong with the races of a map: a player fixed to a race the game has not got, or the map offering one, are\n * errors (a world is not made from it); what is placed for a player that their race may not have is a warning. What\n * the map offers is for the players it fixes no race for: one fixed to another is as the map means it\n */\nfunction raceProblems(map: GameMap, registry: Registry): MapProblem[] {\n\tconst problems: MapProblem[] = []\n\tconst known = (race: string) => race === RANDOM_RACE || registry.races.has(race)\n\tconst none = registry.races.size === 0\n\tfor (const race of map.races ?? []) {\n\t\tif (race === RANDOM_RACE || registry.races.has(race)) continue\n\t\tproblems.push({\n\t\t\tmessage: `The map offers the race \"${race}\", which ${none ? 'the game does not have: it has no races' : 'is no race of the game'}`,\n\t\t\terror: true,\n\t\t\trule: 'unknown-race'\n\t\t})\n\t}\n\tfor (const player of map.players) {\n\t\tif (player.race === undefined) continue\n\t\tif (!known(player.race)) {\n\t\t\tproblems.push({\n\t\t\t\tmessage: `${player.name} plays the race \"${player.race}\", which ${none ? 'the game does not have: it has no races' : 'is no race of the game'}`,\n\t\t\t\terror: true,\n\t\t\t\tat: player.start,\n\t\t\t\trule: 'unknown-race',\n\t\t\t\tabout: { player: player.id }\n\t\t\t})\n\t\t}\n\t}\n\t// what a player whose race is fixed may not have: they could not make it, and it is theirs all the same\n\tconst fixed = new Map(\n\t\tmap.players.filter((player) => player.race && player.race !== RANDOM_RACE && registry.races.has(player.race)).map((player) => [player.id, player])\n\t)\n\tfor (const object of map.objects) {\n\t\tconst owner = fixed.get(object.owner)\n\t\tif (!owner || !registry.units.has(object.type)) continue\n\t\tconst def = registry.unit(object.type)\n\t\tif (availableTo(def, owner.race)) continue\n\t\tproblems.push({\n\t\t\tmessage: `${def.name} is ${registry.race(def.race!).name}, and ${owner.name} plays ${registry.race(owner.race!).name}`,\n\t\t\tat: object,\n\t\t\trule: 'other-race',\n\t\t\tabout: { object: object.id }\n\t\t})\n\t}\n\treturn problems\n}\n\n/** The races of the map, its players and what is placed for them */\nexport const raceRules: MapRule = {\n\tid: 'races',\n\tcheck(map, registry, say) {\n\t\tfor (const problem of raceProblems(map, registry)) say(problem)\n\t}\n}\n"],"mappings":";;;;;;;;AAYA,SAAS,aAAa,KAAc,UAAkC;CACrE,MAAM,WAAyB,CAAC;CAChC,MAAM,SAAS,SAAiB,SAAA,YAAwB,SAAS,MAAM,IAAI,IAAI;CAC/E,MAAM,OAAO,SAAS,MAAM,SAAS;CACrC,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,GAAG;EACnC,IAAI,SAAA,YAAwB,SAAS,MAAM,IAAI,IAAI,GAAG;EACtD,SAAS,KAAK;GACb,SAAS,4BAA4B,KAAK,WAAW,OAAO,4CAA4C;GACxG,OAAO;GACP,MAAM;EACP,CAAC;CACF;CACA,KAAK,MAAM,UAAU,IAAI,SAAS;EACjC,IAAI,OAAO,SAAS,KAAA,GAAW;EAC/B,IAAI,CAAC,MAAM,OAAO,IAAI,GACrB,SAAS,KAAK;GACb,SAAS,GAAG,OAAO,KAAK,mBAAmB,OAAO,KAAK,WAAW,OAAO,4CAA4C;GACrH,OAAO;GACP,IAAI,OAAO;GACX,MAAM;GACN,OAAO,EAAE,QAAQ,OAAO,GAAG;EAC5B,CAAC;CAEH;CAEA,MAAM,QAAQ,IAAI,IACjB,IAAI,QAAQ,QAAQ,WAAW,OAAO,QAAQ,OAAO,SAAA,YAAwB,SAAS,MAAM,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,OAAO,IAAI,MAAM,CAAC,CAClJ;CACA,KAAK,MAAM,UAAU,IAAI,SAAS;EACjC,MAAM,QAAQ,MAAM,IAAI,OAAO,KAAK;EACpC,IAAI,CAAC,SAAS,CAAC,SAAS,MAAM,IAAI,OAAO,IAAI,GAAG;EAChD,MAAM,MAAM,SAAS,KAAK,OAAO,IAAI;EACrC,IAAI,YAAY,KAAK,MAAM,IAAI,GAAG;EAClC,SAAS,KAAK;GACb,SAAS,GAAG,IAAI,KAAK,MAAM,SAAS,KAAK,IAAI,IAAK,CAAC,CAAC,KAAK,QAAQ,MAAM,KAAK,SAAS,SAAS,KAAK,MAAM,IAAK,CAAC,CAAC;GAChH,IAAI;GACJ,MAAM;GACN,OAAO,EAAE,QAAQ,OAAO,GAAG;EAC5B,CAAC;CACF;CACA,OAAO;AACR;;AAGA,IAAa,YAAqB;CACjC,IAAI;CACJ,MAAM,KAAK,UAAU,KAAK;EACzB,KAAK,MAAM,WAAW,aAAa,KAAK,QAAQ,GAAG,IAAI,OAAO;CAC/D;AACD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { groupChoices, tableItems } from "../../randomGroups.js";
|
|
2
|
+
//#region src/mapCheck/rules/random.ts
|
|
3
|
+
/** Random groups and item tables: something to draw from, and by names there are */
|
|
4
|
+
var randomRules = {
|
|
5
|
+
id: "random",
|
|
6
|
+
check(map, registry, say, _context) {
|
|
7
|
+
const groups = new Map((map.randomGroups ?? []).map((group) => [group.name, group]));
|
|
8
|
+
const tables = new Set((map.itemTables ?? []).map((table) => table.name));
|
|
9
|
+
for (const group of groups.values()) if (!groupChoices(group, registry).length) say({
|
|
10
|
+
message: `The random group ${group.name} has nothing of the game to draw from`,
|
|
11
|
+
error: true,
|
|
12
|
+
rule: "empty-random-group"
|
|
13
|
+
});
|
|
14
|
+
for (const table of map.itemTables ?? []) if (!tableItems(table, registry).length) say({
|
|
15
|
+
message: `The item table ${table.name} has nothing of the game to draw from`,
|
|
16
|
+
error: true,
|
|
17
|
+
rule: "empty-item-table"
|
|
18
|
+
});
|
|
19
|
+
for (const object of map.objects) {
|
|
20
|
+
if (object.random && !groups.has(object.random)) say({
|
|
21
|
+
message: `It is drawn from "${object.random}", which is no random group of the map`,
|
|
22
|
+
error: true,
|
|
23
|
+
at: object,
|
|
24
|
+
rule: "unknown-random-group",
|
|
25
|
+
about: { object: object.id }
|
|
26
|
+
});
|
|
27
|
+
if (object.drops && !tables.has(object.drops)) say({
|
|
28
|
+
message: `It drops from "${object.drops}", which is no item table of the map`,
|
|
29
|
+
error: true,
|
|
30
|
+
at: object,
|
|
31
|
+
rule: "unknown-item-table",
|
|
32
|
+
about: { object: object.id }
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
for (const camp of map.camps) for (const unit of camp.units) if (unit.startsWith("@") && !groups.has(unit.slice(1))) say({
|
|
36
|
+
message: `A camp has "${unit}", which is no random group of the map`,
|
|
37
|
+
error: true,
|
|
38
|
+
at: camp,
|
|
39
|
+
rule: "unknown-random-group",
|
|
40
|
+
about: { camp: camp.id }
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { randomRules };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=random.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.js","names":[],"sources":["../../../src/mapCheck/rules/random.ts"],"sourcesContent":["import { groupChoices, tableItems } from '../../randomGroups'\nimport type { MapRule } from '../rule'\n\n/** Random groups and item tables: something to draw from, and by names there are */\nexport const randomRules: MapRule = {\n\tid: 'random',\n\tcheck(map, registry, say, _context) {\n\t\t// random groups and item tables, by the names that are given and that there are\n\t\tconst groups = new Map((map.randomGroups ?? []).map((group) => [group.name, group]))\n\t\tconst tables = new Set((map.itemTables ?? []).map((table) => table.name))\n\t\tfor (const group of groups.values()) {\n\t\t\tif (!groupChoices(group, registry).length)\n\t\t\t\tsay({ message: `The random group ${group.name} has nothing of the game to draw from`, error: true, rule: 'empty-random-group' })\n\t\t}\n\t\tfor (const table of map.itemTables ?? []) {\n\t\t\tif (!tableItems(table, registry).length)\n\t\t\t\tsay({ message: `The item table ${table.name} has nothing of the game to draw from`, error: true, rule: 'empty-item-table' })\n\t\t}\n\t\tfor (const object of map.objects) {\n\t\t\tif (object.random && !groups.has(object.random))\n\t\t\t\tsay({\n\t\t\t\t\tmessage: `It is drawn from \"${object.random}\", which is no random group of the map`,\n\t\t\t\t\terror: true,\n\t\t\t\t\tat: object,\n\t\t\t\t\trule: 'unknown-random-group',\n\t\t\t\t\tabout: { object: object.id }\n\t\t\t\t})\n\t\t\tif (object.drops && !tables.has(object.drops))\n\t\t\t\tsay({\n\t\t\t\t\tmessage: `It drops from \"${object.drops}\", which is no item table of the map`,\n\t\t\t\t\terror: true,\n\t\t\t\t\tat: object,\n\t\t\t\t\trule: 'unknown-item-table',\n\t\t\t\t\tabout: { object: object.id }\n\t\t\t\t})\n\t\t}\n\t\tfor (const camp of map.camps) {\n\t\t\tfor (const unit of camp.units) {\n\t\t\t\tif (unit.startsWith('@') && !groups.has(unit.slice(1)))\n\t\t\t\t\tsay({\n\t\t\t\t\t\tmessage: `A camp has \"${unit}\", which is no random group of the map`,\n\t\t\t\t\t\terror: true,\n\t\t\t\t\t\tat: camp,\n\t\t\t\t\t\trule: 'unknown-random-group',\n\t\t\t\t\t\tabout: { camp: camp.id }\n\t\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}\n"],"mappings":";;;AAIA,IAAa,cAAuB;CACnC,IAAI;CACJ,MAAM,KAAK,UAAU,KAAK,UAAU;EAEnC,MAAM,SAAS,IAAI,KAAK,IAAI,gBAAgB,CAAC,EAAA,CAAG,KAAK,UAAU,CAAC,MAAM,MAAM,KAAK,CAAC,CAAC;EACnF,MAAM,SAAS,IAAI,KAAK,IAAI,cAAc,CAAC,EAAA,CAAG,KAAK,UAAU,MAAM,IAAI,CAAC;EACxE,KAAK,MAAM,SAAS,OAAO,OAAO,GACjC,IAAI,CAAC,aAAa,OAAO,QAAQ,CAAC,CAAC,QAClC,IAAI;GAAE,SAAS,oBAAoB,MAAM,KAAK;GAAwC,OAAO;GAAM,MAAM;EAAqB,CAAC;EAEjI,KAAK,MAAM,SAAS,IAAI,cAAc,CAAC,GACtC,IAAI,CAAC,WAAW,OAAO,QAAQ,CAAC,CAAC,QAChC,IAAI;GAAE,SAAS,kBAAkB,MAAM,KAAK;GAAwC,OAAO;GAAM,MAAM;EAAmB,CAAC;EAE7H,KAAK,MAAM,UAAU,IAAI,SAAS;GACjC,IAAI,OAAO,UAAU,CAAC,OAAO,IAAI,OAAO,MAAM,GAC7C,IAAI;IACH,SAAS,qBAAqB,OAAO,OAAO;IAC5C,OAAO;IACP,IAAI;IACJ,MAAM;IACN,OAAO,EAAE,QAAQ,OAAO,GAAG;GAC5B,CAAC;GACF,IAAI,OAAO,SAAS,CAAC,OAAO,IAAI,OAAO,KAAK,GAC3C,IAAI;IACH,SAAS,kBAAkB,OAAO,MAAM;IACxC,OAAO;IACP,IAAI;IACJ,MAAM;IACN,OAAO,EAAE,QAAQ,OAAO,GAAG;GAC5B,CAAC;EACH;EACA,KAAK,MAAM,QAAQ,IAAI,OACtB,KAAK,MAAM,QAAQ,KAAK,OACvB,IAAI,KAAK,WAAW,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,MAAM,CAAC,CAAC,GACpD,IAAI;GACH,SAAS,eAAe,KAAK;GAC7B,OAAO;GACP,IAAI;GACJ,MAAM;GACN,OAAO,EAAE,MAAM,KAAK,GAAG;EACxB,CAAC;CAGL;AACD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { shapeBounds } from "../../areas.js";
|
|
2
|
+
//#region src/mapCheck/rules/regions.ts
|
|
3
|
+
/** Regions on the map */
|
|
4
|
+
var regionRules = {
|
|
5
|
+
id: "regions",
|
|
6
|
+
check(map, _registry, say, _context) {
|
|
7
|
+
const { width, depth } = map;
|
|
8
|
+
for (const region of map.regions) {
|
|
9
|
+
const { shape } = region;
|
|
10
|
+
const reach = shapeBounds(shape);
|
|
11
|
+
if (reach.x1 <= 0 || reach.z1 <= 0 || reach.x0 >= width || reach.z0 >= depth) say({
|
|
12
|
+
message: `The region ${region.name} is outside the map`,
|
|
13
|
+
error: true,
|
|
14
|
+
at: shape,
|
|
15
|
+
rule: "region-off-map",
|
|
16
|
+
about: { region: region.id }
|
|
17
|
+
});
|
|
18
|
+
else if (reach.x0 < 0 || reach.z0 < 0 || reach.x1 > width || reach.z1 > depth) say({
|
|
19
|
+
message: `The region ${region.name} goes past the edge of the map`,
|
|
20
|
+
at: shape,
|
|
21
|
+
rule: "region-past-edge",
|
|
22
|
+
about: { region: region.id }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { regionRules };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=regions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regions.js","names":[],"sources":["../../../src/mapCheck/rules/regions.ts"],"sourcesContent":["import { shapeBounds } from '#engine/areas'\nimport type { MapRule } from '../rule'\n\n/** Regions on the map */\nexport const regionRules: MapRule = {\n\tid: 'regions',\n\tcheck(map, _registry, say, _context) {\n\t\tconst { width, depth } = map\n\t\tfor (const region of map.regions) {\n\t\t\tconst { shape } = region\n\t\t\tconst reach = shapeBounds(shape)\n\t\t\tif (reach.x1 <= 0 || reach.z1 <= 0 || reach.x0 >= width || reach.z0 >= depth)\n\t\t\t\tsay({\n\t\t\t\t\tmessage: `The region ${region.name} is outside the map`,\n\t\t\t\t\terror: true,\n\t\t\t\t\tat: shape,\n\t\t\t\t\trule: 'region-off-map',\n\t\t\t\t\tabout: { region: region.id }\n\t\t\t\t})\n\t\t\telse if (reach.x0 < 0 || reach.z0 < 0 || reach.x1 > width || reach.z1 > depth)\n\t\t\t\tsay({\n\t\t\t\t\tmessage: `The region ${region.name} goes past the edge of the map`,\n\t\t\t\t\tat: shape,\n\t\t\t\t\trule: 'region-past-edge',\n\t\t\t\t\tabout: { region: region.id }\n\t\t\t\t})\n\t\t}\n\t}\n}\n"],"mappings":";;;AAIA,IAAa,cAAuB;CACnC,IAAI;CACJ,MAAM,KAAK,WAAW,KAAK,UAAU;EACpC,MAAM,EAAE,OAAO,UAAU;EACzB,KAAK,MAAM,UAAU,IAAI,SAAS;GACjC,MAAM,EAAE,UAAU;GAClB,MAAM,QAAQ,YAAY,KAAK;GAC/B,IAAI,MAAM,MAAM,KAAK,MAAM,MAAM,KAAK,MAAM,MAAM,SAAS,MAAM,MAAM,OACtE,IAAI;IACH,SAAS,cAAc,OAAO,KAAK;IACnC,OAAO;IACP,IAAI;IACJ,MAAM;IACN,OAAO,EAAE,QAAQ,OAAO,GAAG;GAC5B,CAAC;QACG,IAAI,MAAM,KAAK,KAAK,MAAM,KAAK,KAAK,MAAM,KAAK,SAAS,MAAM,KAAK,OACvE,IAAI;IACH,SAAS,cAAc,OAAO,KAAK;IACnC,IAAI;IACJ,MAAM;IACN,OAAO,EAAE,QAAQ,OAAO,GAAG;GAC5B,CAAC;EACH;CACD;AACD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TARGET_FIELDS, campFields, mapFields, objectFields, playerFields, regionFields, targetName } from "../../mapFields.js";
|
|
2
|
+
//#region src/mapCheck/rules/targets.ts
|
|
3
|
+
/** A field that names a region, a point or a path the map has not (any more) */
|
|
4
|
+
var targetRules = {
|
|
5
|
+
id: "targets",
|
|
6
|
+
check(map, registry, say, _context) {
|
|
7
|
+
const naming = (fields, data, about, at) => {
|
|
8
|
+
for (const field of fields) {
|
|
9
|
+
const kind = field.kind;
|
|
10
|
+
const id = data?.[field.id];
|
|
11
|
+
if (!TARGET_FIELDS.includes(field.kind) || typeof id !== "number") continue;
|
|
12
|
+
if (targetName(map, kind, id) === void 0) say({
|
|
13
|
+
message: `${field.name} names a ${kind} the map does not have`,
|
|
14
|
+
error: true,
|
|
15
|
+
rule: "missing-target",
|
|
16
|
+
...at && { at },
|
|
17
|
+
...about && { about }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
for (const object of map.objects) naming(objectFields(registry, object.type), object.data, { object: object.id }, object);
|
|
22
|
+
for (const camp of map.camps) naming(campFields(registry), camp.data, { camp: camp.id }, camp);
|
|
23
|
+
for (const region of map.regions) naming(regionFields(registry), region.data, { region: region.id });
|
|
24
|
+
for (const player of map.players) naming(playerFields(registry), player.data, { player: player.id }, player.start);
|
|
25
|
+
naming(mapFields(registry), map.data, void 0);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { targetRules };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=targets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"targets.js","names":[],"sources":["../../../src/mapCheck/rules/targets.ts"],"sourcesContent":["import {\n\tcampFields,\n\ttype MapFieldDef,\n\tmapFields,\n\ttype MapTarget,\n\tobjectFields,\n\tplayerFields,\n\tregionFields,\n\tTARGET_FIELDS,\n\ttargetName\n} from '../../mapFields'\nimport type { Vec2 } from '../../math'\nimport type { MapRule } from '../rule'\n\n/** A field that names a region, a point or a path the map has not (any more) */\nexport const targetRules: MapRule = {\n\tid: 'targets',\n\tcheck(map, registry, say, _context) {\n\t\t// a field that names a region, a point or a path the map has not (any more): taken away, or never there\n\t\tconst naming = (fields: readonly MapFieldDef[], data: Record<string, unknown> | undefined, about: MapTarget | undefined, at?: Vec2) => {\n\t\t\tfor (const field of fields) {\n\t\t\t\tconst kind = field.kind as (typeof TARGET_FIELDS)[number]\n\t\t\t\tconst id = data?.[field.id]\n\t\t\t\tif (!(TARGET_FIELDS as readonly string[]).includes(field.kind) || typeof id !== 'number') continue\n\t\t\t\tif (targetName(map, kind, id) === undefined)\n\t\t\t\t\tsay({\n\t\t\t\t\t\tmessage: `${field.name} names a ${kind} the map does not have`,\n\t\t\t\t\t\terror: true,\n\t\t\t\t\t\trule: 'missing-target',\n\t\t\t\t\t\t...(at && { at }),\n\t\t\t\t\t\t...(about && { about })\n\t\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tfor (const object of map.objects) naming(objectFields(registry, object.type), object.data, { object: object.id }, object)\n\t\tfor (const camp of map.camps) naming(campFields(registry), camp.data, { camp: camp.id }, camp)\n\t\tfor (const region of map.regions) naming(regionFields(registry), region.data, { region: region.id })\n\t\tfor (const player of map.players) naming(playerFields(registry), player.data, { player: player.id }, player.start)\n\t\tnaming(mapFields(registry), map.data, undefined)\n\t}\n}\n"],"mappings":";;;AAeA,IAAa,cAAuB;CACnC,IAAI;CACJ,MAAM,KAAK,UAAU,KAAK,UAAU;EAEnC,MAAM,UAAU,QAAgC,MAA2C,OAA8B,OAAc;GACtI,KAAK,MAAM,SAAS,QAAQ;IAC3B,MAAM,OAAO,MAAM;IACnB,MAAM,KAAK,OAAO,MAAM;IACxB,IAAI,CAAE,cAAoC,SAAS,MAAM,IAAI,KAAK,OAAO,OAAO,UAAU;IAC1F,IAAI,WAAW,KAAK,MAAM,EAAE,MAAM,KAAA,GACjC,IAAI;KACH,SAAS,GAAG,MAAM,KAAK,WAAW,KAAK;KACvC,OAAO;KACP,MAAM;KACN,GAAI,MAAM,EAAE,GAAG;KACf,GAAI,SAAS,EAAE,MAAM;IACtB,CAAC;GACH;EACD;EACA,KAAK,MAAM,UAAU,IAAI,SAAS,OAAO,aAAa,UAAU,OAAO,IAAI,GAAG,OAAO,MAAM,EAAE,QAAQ,OAAO,GAAG,GAAG,MAAM;EACxH,KAAK,MAAM,QAAQ,IAAI,OAAO,OAAO,WAAW,QAAQ,GAAG,KAAK,MAAM,EAAE,MAAM,KAAK,GAAG,GAAG,IAAI;EAC7F,KAAK,MAAM,UAAU,IAAI,SAAS,OAAO,aAAa,QAAQ,GAAG,OAAO,MAAM,EAAE,QAAQ,OAAO,GAAG,CAAC;EACnG,KAAK,MAAM,UAAU,IAAI,SAAS,OAAO,aAAa,QAAQ,GAAG,OAAO,MAAM,EAAE,QAAQ,OAAO,GAAG,GAAG,OAAO,KAAK;EACjH,OAAO,UAAU,QAAQ,GAAG,IAAI,MAAM,KAAA,CAAS;CAChD;AACD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { reachedByDefault } from "../../mapFields.js";
|
|
2
|
+
import { walkingAreas } from "../cells.js";
|
|
3
|
+
//#region src/mapCheck/rules/walking.ts
|
|
4
|
+
/** Who can walk to whom: starts cut off from each other, mines nobody can walk to */
|
|
5
|
+
var walkingRules = {
|
|
6
|
+
id: "walking",
|
|
7
|
+
check(map, registry, say, _context) {
|
|
8
|
+
const starts = map.players.filter((player) => player.start);
|
|
9
|
+
if (starts.length) {
|
|
10
|
+
const { at } = walkingAreas(map, registry);
|
|
11
|
+
const areas = starts.map((player) => at(player.start));
|
|
12
|
+
starts.forEach((player, i) => {
|
|
13
|
+
if (!areas[i]) say({
|
|
14
|
+
message: `${player.name} starts where nothing can walk`,
|
|
15
|
+
error: true,
|
|
16
|
+
at: player.start,
|
|
17
|
+
rule: "start-blocked",
|
|
18
|
+
about: { player: player.id }
|
|
19
|
+
});
|
|
20
|
+
else if (areas.some((other, j) => j !== i && other && other !== areas[i])) say({
|
|
21
|
+
message: `${player.name} cannot walk to every other start: a cliff, water or what is built is in the way`,
|
|
22
|
+
at: player.start,
|
|
23
|
+
rule: "starts-apart",
|
|
24
|
+
about: { player: player.id }
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
const reached = new Set(areas.filter(Boolean));
|
|
28
|
+
for (const object of map.objects) {
|
|
29
|
+
if (!registry.units.has(object.type)) continue;
|
|
30
|
+
const def = registry.unit(object.type);
|
|
31
|
+
if (!(registry.module?.editor?.reach ?? reachedByDefault)(def)) continue;
|
|
32
|
+
if (!reached.has(at(object))) say({
|
|
33
|
+
message: `Nobody can walk to the ${def.name} here`,
|
|
34
|
+
at: object,
|
|
35
|
+
rule: "unreachable",
|
|
36
|
+
about: { object: object.id }
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { walkingRules };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=walking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walking.js","names":[],"sources":["../../../src/mapCheck/rules/walking.ts"],"sourcesContent":["import { reachedByDefault } from '../../mapFields'\nimport { walkingAreas } from '../cells'\nimport type { MapRule } from '../rule'\n\n/** Who can walk to whom: starts cut off from each other, mines nobody can walk to */\nexport const walkingRules: MapRule = {\n\tid: 'walking',\n\tcheck(map, registry, say, _context) {\n\t\t// who can walk to whom: starts that are cut off from each other, mines nobody can walk to\n\t\tconst starts = map.players.filter((player) => player.start)\n\t\tif (starts.length) {\n\t\t\tconst { at } = walkingAreas(map, registry)\n\t\t\tconst areas = starts.map((player) => at(player.start!))\n\t\t\tstarts.forEach((player, i) => {\n\t\t\t\tif (!areas[i])\n\t\t\t\t\tsay({\n\t\t\t\t\t\tmessage: `${player.name} starts where nothing can walk`,\n\t\t\t\t\t\terror: true,\n\t\t\t\t\t\tat: player.start,\n\t\t\t\t\t\trule: 'start-blocked',\n\t\t\t\t\t\tabout: { player: player.id }\n\t\t\t\t\t})\n\t\t\t\telse if (areas.some((other, j) => j !== i && other && other !== areas[i])) {\n\t\t\t\t\tsay({\n\t\t\t\t\t\tmessage: `${player.name} cannot walk to every other start: a cliff, water or what is built is in the way`,\n\t\t\t\t\t\tat: player.start,\n\t\t\t\t\t\trule: 'starts-apart',\n\t\t\t\t\t\tabout: { player: player.id }\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\tconst reached = new Set(areas.filter(Boolean))\n\t\t\tfor (const object of map.objects) {\n\t\t\t\tif (!registry.units.has(object.type)) continue\n\t\t\t\tconst def = registry.unit(object.type)\n\t\t\t\t// what is mined, not what is cut, unless the game says: trees stand where they stand\n\t\t\t\tif (!(registry.module?.editor?.reach ?? reachedByDefault)(def)) continue\n\t\t\t\tif (!reached.has(at(object)))\n\t\t\t\t\tsay({ message: `Nobody can walk to the ${def.name} here`, at: object, rule: 'unreachable', about: { object: object.id } })\n\t\t\t}\n\t\t}\n\t}\n}\n"],"mappings":";;;;AAKA,IAAa,eAAwB;CACpC,IAAI;CACJ,MAAM,KAAK,UAAU,KAAK,UAAU;EAEnC,MAAM,SAAS,IAAI,QAAQ,QAAQ,WAAW,OAAO,KAAK;EAC1D,IAAI,OAAO,QAAQ;GAClB,MAAM,EAAE,OAAO,aAAa,KAAK,QAAQ;GACzC,MAAM,QAAQ,OAAO,KAAK,WAAW,GAAG,OAAO,KAAM,CAAC;GACtD,OAAO,SAAS,QAAQ,MAAM;IAC7B,IAAI,CAAC,MAAM,IACV,IAAI;KACH,SAAS,GAAG,OAAO,KAAK;KACxB,OAAO;KACP,IAAI,OAAO;KACX,MAAM;KACN,OAAO,EAAE,QAAQ,OAAO,GAAG;IAC5B,CAAC;SACG,IAAI,MAAM,MAAM,OAAO,MAAM,MAAM,KAAK,SAAS,UAAU,MAAM,EAAE,GACvE,IAAI;KACH,SAAS,GAAG,OAAO,KAAK;KACxB,IAAI,OAAO;KACX,MAAM;KACN,OAAO,EAAE,QAAQ,OAAO,GAAG;IAC5B,CAAC;GAEH,CAAC;GACD,MAAM,UAAU,IAAI,IAAI,MAAM,OAAO,OAAO,CAAC;GAC7C,KAAK,MAAM,UAAU,IAAI,SAAS;IACjC,IAAI,CAAC,SAAS,MAAM,IAAI,OAAO,IAAI,GAAG;IACtC,MAAM,MAAM,SAAS,KAAK,OAAO,IAAI;IAErC,IAAI,EAAE,SAAS,QAAQ,QAAQ,SAAS,iBAAA,CAAkB,GAAG,GAAG;IAChE,IAAI,CAAC,QAAQ,IAAI,GAAG,MAAM,CAAC,GAC1B,IAAI;KAAE,SAAS,0BAA0B,IAAI,KAAK;KAAQ,IAAI;KAAQ,MAAM;KAAe,OAAO,EAAE,QAAQ,OAAO,GAAG;IAAE,CAAC;GAC3H;EACD;CACD;AACD"}
|
package/dist/mapCheck.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { mapCells } from './mapCheck/cells';
|
|
|
6
6
|
export type { MapCheckContext, MapRule } from './mapCheck/rule';
|
|
7
7
|
/**
|
|
8
8
|
* The engine's checks of a map, in the order they run: players, what is placed, random groups, names, regions, paths,
|
|
9
|
-
* walking, races, the fields that name things
|
|
9
|
+
* walking, races, the fields that name things, the styles of grass painted
|
|
10
10
|
*
|
|
11
11
|
* @beta
|
|
12
12
|
*/
|
|
@@ -18,6 +18,6 @@ export declare const MAP_RULES: readonly MapRule[];
|
|
|
18
18
|
* a game view's own, as the editor runs them); then the game's own (`MapEditorDef.check`). Errors keep it from being
|
|
19
19
|
* played; the rest are warnings. Runs without the editor, for a test that goes over every map of a project
|
|
20
20
|
*
|
|
21
|
-
* @
|
|
21
|
+
* @public
|
|
22
22
|
*/
|
|
23
23
|
export declare function checkMap(map: GameMap, registry: Registry, more?: readonly MapRule[]): MapProblem[];
|
package/dist/mapCheck.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { mapTerrain } from "./map/terrain.js";
|
|
2
|
+
import { playerRules } from "./mapCheck/rules/players.js";
|
|
3
|
+
import { objectRules } from "./mapCheck/rules/objects.js";
|
|
4
|
+
import { randomRules } from "./mapCheck/rules/random.js";
|
|
5
|
+
import { nameRules } from "./mapCheck/rules/names.js";
|
|
6
|
+
import { regionRules } from "./mapCheck/rules/regions.js";
|
|
7
|
+
import { pathRules } from "./mapCheck/rules/paths.js";
|
|
8
|
+
import { mapCells } from "./mapCheck/cells.js";
|
|
9
|
+
import { walkingRules } from "./mapCheck/rules/walking.js";
|
|
10
|
+
import { raceRules } from "./mapCheck/rules/races.js";
|
|
11
|
+
import { targetRules } from "./mapCheck/rules/targets.js";
|
|
12
|
+
import { foliageRules } from "./mapCheck/rules/foliage.js";
|
|
13
|
+
//#region src/mapCheck.ts
|
|
14
|
+
/**
|
|
15
|
+
* The engine's checks of a map, in the order they run: players, what is placed, random groups, names, regions, paths,
|
|
16
|
+
* walking, races, the fields that name things, the styles of grass painted
|
|
17
|
+
*
|
|
18
|
+
* @beta
|
|
19
|
+
*/
|
|
20
|
+
var MAP_RULES = [
|
|
21
|
+
playerRules,
|
|
22
|
+
objectRules,
|
|
23
|
+
randomRules,
|
|
24
|
+
nameRules,
|
|
25
|
+
regionRules,
|
|
26
|
+
pathRules,
|
|
27
|
+
walkingRules,
|
|
28
|
+
raceRules,
|
|
29
|
+
targetRules,
|
|
30
|
+
foliageRules
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* What is wrong with a map, before it is played: what the game does not have, names used twice or named and not
|
|
34
|
+
* there, what stands off the map or in deep water, starts that cannot reach each other on foot, mines nobody can walk
|
|
35
|
+
* to, regions outside the map (`MAP_RULES`); then the checks given (`more`: the client's of what the map looks like,
|
|
36
|
+
* a game view's own, as the editor runs them); then the game's own (`MapEditorDef.check`). Errors keep it from being
|
|
37
|
+
* played; the rest are warnings. Runs without the editor, for a test that goes over every map of a project
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
function checkMap(map, registry, more = []) {
|
|
42
|
+
const problems = [];
|
|
43
|
+
const { width, depth } = map;
|
|
44
|
+
let terrain;
|
|
45
|
+
const context = {
|
|
46
|
+
get terrain() {
|
|
47
|
+
return terrain ??= mapTerrain(map);
|
|
48
|
+
},
|
|
49
|
+
onMap: (p) => p.x >= 0 && p.z >= 0 && p.x <= width && p.z <= depth
|
|
50
|
+
};
|
|
51
|
+
const say = (problem) => void problems.push(problem);
|
|
52
|
+
for (const rule of [...MAP_RULES, ...more]) rule.check(map, registry, say, context);
|
|
53
|
+
const own = (registry.assembly?.check?.(map, registry) ?? []).map((problem) => ({
|
|
54
|
+
rule: "game",
|
|
55
|
+
...problem
|
|
56
|
+
}));
|
|
57
|
+
const silenced = /* @__PURE__ */ new Set([...registry.module?.editor?.silence ?? [], ...map.silence ?? []]);
|
|
58
|
+
return [...problems, ...own].filter((problem) => !problem.rule || !silenced.has(problem.rule));
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { MAP_RULES, checkMap, mapCells };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=mapCheck.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapCheck.js","names":[],"sources":["../src/mapCheck.ts"],"sourcesContent":["/*\n * The checks of a map before it is played (design review E8b): the engine's (`MAP_RULES`, one file each in\n * `mapCheck/rules`), those given beside them (the client's of a map's looks, a game's view's own), then the game's own\n * (`MapEditorDef.check`), less what the map and the game silence\n */\nimport { type GameMap, mapTerrain } from './map'\nimport type { MapProblem } from './mapFields'\nimport type { Vec2 } from './math'\nimport type { Registry } from './registry'\nimport type { Terrain } from './terrain'\nimport type { MapCheckContext, MapRule } from './mapCheck/rule'\nimport { playerRules } from './mapCheck/rules/players'\nimport { objectRules } from './mapCheck/rules/objects'\nimport { randomRules } from './mapCheck/rules/random'\nimport { nameRules } from './mapCheck/rules/names'\nimport { regionRules } from './mapCheck/rules/regions'\nimport { pathRules } from './mapCheck/rules/paths'\nimport { walkingRules } from './mapCheck/rules/walking'\nimport { raceRules } from './mapCheck/rules/races'\nimport { targetRules } from './mapCheck/rules/targets'\nimport { foliageRules } from './mapCheck/rules/foliage'\n\nexport { mapCells } from './mapCheck/cells'\nexport type { MapCheckContext, MapRule } from './mapCheck/rule'\n\n/**\n * The engine's checks of a map, in the order they run: players, what is placed, random groups, names, regions, paths,\n * walking, races, the fields that name things, the styles of grass painted\n *\n * @beta\n */\nexport const MAP_RULES: readonly MapRule[] = [\n\tplayerRules,\n\tobjectRules,\n\trandomRules,\n\tnameRules,\n\tregionRules,\n\tpathRules,\n\twalkingRules,\n\traceRules,\n\ttargetRules,\n\tfoliageRules\n]\n\n/**\n * What is wrong with a map, before it is played: what the game does not have, names used twice or named and not\n * there, what stands off the map or in deep water, starts that cannot reach each other on foot, mines nobody can walk\n * to, regions outside the map (`MAP_RULES`); then the checks given (`more`: the client's of what the map looks like,\n * a game view's own, as the editor runs them); then the game's own (`MapEditorDef.check`). Errors keep it from being\n * played; the rest are warnings. Runs without the editor, for a test that goes over every map of a project\n *\n * @public\n */\nexport function checkMap(map: GameMap, registry: Registry, more: readonly MapRule[] = []): MapProblem[] {\n\tconst problems: MapProblem[] = []\n\tconst { width, depth } = map\n\tlet terrain: Terrain | undefined\n\tconst context: MapCheckContext = {\n\t\tget terrain() {\n\t\t\treturn (terrain ??= mapTerrain(map))\n\t\t},\n\t\tonMap: (p: Vec2) => p.x >= 0 && p.z >= 0 && p.x <= width && p.z <= depth\n\t}\n\tconst say = (problem: MapProblem) => void problems.push(problem)\n\tfor (const rule of [...MAP_RULES, ...more]) rule.check(map, registry, say, context)\n\t// the game's own, each said to be the game's where it names no rule of its own; then what the map and the game silence\n\tconst own = (registry.assembly?.check?.(map, registry) ?? []).map((problem) => ({ rule: 'game', ...problem }))\n\tconst silenced = new Set([...(registry.module?.editor?.silence ?? []), ...(map.silence ?? [])])\n\treturn [...problems, ...own].filter((problem) => !problem.rule || !silenced.has(problem.rule))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+BA,IAAa,YAAgC;CAC5C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;;;;;;AAWA,SAAgB,SAAS,KAAc,UAAoB,OAA2B,CAAC,GAAiB;CACvG,MAAM,WAAyB,CAAC;CAChC,MAAM,EAAE,OAAO,UAAU;CACzB,IAAI;CACJ,MAAM,UAA2B;EAChC,IAAI,UAAU;GACb,OAAQ,YAAY,WAAW,GAAG;EACnC;EACA,QAAQ,MAAY,EAAE,KAAK,KAAK,EAAE,KAAK,KAAK,EAAE,KAAK,SAAS,EAAE,KAAK;CACpE;CACA,MAAM,OAAO,YAAwB,KAAK,SAAS,KAAK,OAAO;CAC/D,KAAK,MAAM,QAAQ,CAAC,GAAG,WAAW,GAAG,IAAI,GAAG,KAAK,MAAM,KAAK,UAAU,KAAK,OAAO;CAElF,MAAM,OAAO,SAAS,UAAU,QAAQ,KAAK,QAAQ,KAAK,CAAC,EAAA,CAAG,KAAK,aAAa;EAAE,MAAM;EAAQ,GAAG;CAAQ,EAAE;CAC7G,MAAM,2BAAW,IAAI,IAAI,CAAC,GAAI,SAAS,QAAQ,QAAQ,WAAW,CAAC,GAAI,GAAI,IAAI,WAAW,CAAC,CAAE,CAAC;CAC9F,OAAO,CAAC,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC,QAAQ,YAAY,CAAC,QAAQ,QAAQ,CAAC,SAAS,IAAI,QAAQ,IAAI,CAAC;AAC9F"}
|
package/dist/mapFields.d.ts
CHANGED
|
@@ -29,12 +29,16 @@ export type MapTarget = {
|
|
|
29
29
|
decal: number;
|
|
30
30
|
} | {
|
|
31
31
|
sound: number;
|
|
32
|
+
} | {
|
|
33
|
+
waterfall: number;
|
|
32
34
|
} | {
|
|
33
35
|
mistArea: number;
|
|
34
36
|
} | {
|
|
35
37
|
weatherArea: number;
|
|
36
38
|
} | {
|
|
37
39
|
cloudPatch: number;
|
|
40
|
+
} | {
|
|
41
|
+
pictureZone: number;
|
|
38
42
|
} | {
|
|
39
43
|
player: number;
|
|
40
44
|
} | {
|
|
@@ -52,7 +56,9 @@ export type MapTarget = {
|
|
|
52
56
|
export interface MapThing {
|
|
53
57
|
/** Its own among the things of its kind */
|
|
54
58
|
id: number;
|
|
59
|
+
/** Where the thing stands on the map's x axis, in cells */
|
|
55
60
|
x: number;
|
|
61
|
+
/** Where the thing stands on the map's z axis, in cells */
|
|
56
62
|
z: number;
|
|
57
63
|
/** The way it faces, in radians. 0 when left out */
|
|
58
64
|
facing?: number;
|
|
@@ -77,6 +83,7 @@ export declare function mapThings(map: {
|
|
|
77
83
|
* @beta
|
|
78
84
|
*/
|
|
79
85
|
export interface MapProblem {
|
|
86
|
+
/** What is wrong, in words, as the editor and the lobby show it */
|
|
80
87
|
message: string;
|
|
81
88
|
/** It cannot be played like this. A warning when left out: it can, but probably should not */
|
|
82
89
|
error?: boolean;
|
|
@@ -206,12 +213,16 @@ export type MapRefTarget = {
|
|
|
206
213
|
decal: number;
|
|
207
214
|
} | {
|
|
208
215
|
sound: number;
|
|
216
|
+
} | {
|
|
217
|
+
waterfall: number;
|
|
209
218
|
} | {
|
|
210
219
|
mistArea: number;
|
|
211
220
|
} | {
|
|
212
221
|
weatherArea: number;
|
|
213
222
|
} | {
|
|
214
223
|
cloudPatch: number;
|
|
224
|
+
} | {
|
|
225
|
+
pictureZone: number;
|
|
215
226
|
} | {
|
|
216
227
|
thing: number;
|
|
217
228
|
kind: string;
|
|
@@ -226,6 +237,7 @@ export interface MapRefUse {
|
|
|
226
237
|
what: string;
|
|
227
238
|
/** Where: the map's name, a group's, a prefab's, a cinematic's id, a wave's */
|
|
228
239
|
where: string;
|
|
240
|
+
/** What on the map the use points at, for the editor to select */
|
|
229
241
|
target?: MapRefTarget;
|
|
230
242
|
}
|
|
231
243
|
/**
|
|
@@ -234,7 +246,9 @@ export interface MapRefUse {
|
|
|
234
246
|
* @beta
|
|
235
247
|
*/
|
|
236
248
|
export interface MapPaletteGroup {
|
|
249
|
+
/** The group's name in the palette */
|
|
237
250
|
name: string;
|
|
251
|
+
/** The unit types in the group */
|
|
238
252
|
types: UnitTypeDef[];
|
|
239
253
|
/**
|
|
240
254
|
* Whose what is put down from it is, by player id (`MAP_CREEPS`, `MAP_NEUTRAL`): the player picked above it when
|
|
@@ -250,9 +264,11 @@ export interface MapPaletteGroup {
|
|
|
250
264
|
* @beta
|
|
251
265
|
*/
|
|
252
266
|
export interface MapEraseKind {
|
|
267
|
+
/** The id of the kind, which `MapEditorDef.erase` lists it by */
|
|
253
268
|
id: string;
|
|
254
269
|
/** What the brush's choice calls it */
|
|
255
270
|
name: string;
|
|
271
|
+
/** Whether a unit type is of this kind: the erase brush takes the objects it says yes to */
|
|
256
272
|
takes: (def: UnitTypeDef) => boolean;
|
|
257
273
|
}
|
|
258
274
|
/**
|
|
@@ -276,7 +292,7 @@ export declare const TARGET_FIELDS: readonly ['region', 'point', 'path'];
|
|
|
276
292
|
* A field of a game's own on what is placed on a map: the wave a spawner sends, whether a gate starts open, what a
|
|
277
293
|
* guard does. The editor shows it in the inspector for what it is a field of, and keeps what it was set to with the
|
|
278
294
|
* object (`MapObject.data`). The engine does nothing with it: the `mapObject` hook hands it to the game as the world
|
|
279
|
-
* is made, which is where the game says what it means. Given in `
|
|
295
|
+
* is made, which is where the game says what it means. Given in `Rules.editor.fields`
|
|
280
296
|
*
|
|
281
297
|
* @beta
|
|
282
298
|
*/
|
|
@@ -292,6 +308,7 @@ export interface MapFieldDef {
|
|
|
292
308
|
* one group two a line, under its name. Alone when left out
|
|
293
309
|
*/
|
|
294
310
|
group?: string;
|
|
311
|
+
/** What sort of value the field holds, which the inspector edits it with (`MapFieldKind`) */
|
|
295
312
|
kind: MapFieldKind;
|
|
296
313
|
/**
|
|
297
314
|
* What it is a field of: objects of these unit types, or of the types a function says yes to (every hero, every
|
|
@@ -303,7 +320,9 @@ export interface MapFieldDef {
|
|
|
303
320
|
default?: unknown;
|
|
304
321
|
/** For a number: the least and the most it can be, and what the arrows step by */
|
|
305
322
|
min?: number;
|
|
323
|
+
/** For a number field: the most it can be */
|
|
306
324
|
max?: number;
|
|
325
|
+
/** For a number field: what the arrows step it by */
|
|
307
326
|
step?: number;
|
|
308
327
|
/** For a choice: what there is to choose from, as data or worked out from the game */
|
|
309
328
|
options?: readonly MapFieldOption[] | ((registry: Registry) => readonly MapFieldOption[]);
|
|
@@ -347,7 +366,11 @@ export declare const regionFields: (registry: Registry) => MapFieldDef[];
|
|
|
347
366
|
* @beta
|
|
348
367
|
*/
|
|
349
368
|
export declare const mapFields: (registry: Registry) => MapFieldDef[];
|
|
350
|
-
/**
|
|
369
|
+
/**
|
|
370
|
+
* The game's fields for players (`for: 'player'`) of a registry, as `MapFieldDef`s
|
|
371
|
+
*
|
|
372
|
+
* @beta
|
|
373
|
+
*/
|
|
351
374
|
export declare const playerFields: (registry: Registry) => MapFieldDef[];
|
|
352
375
|
/**
|
|
353
376
|
* What a choice field can be set to, as values with what each is called
|