@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
package/dist/moves.js
ADDED
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
import { atan2, cos, hypot, sin } from "./exactMath.js";
|
|
2
|
+
import { dist } from "./math.js";
|
|
3
|
+
import { anyEffect, at } from "./defs.js";
|
|
4
|
+
import { defineComponent } from "./components.js";
|
|
5
|
+
import { moving } from "./entity.js";
|
|
6
|
+
import { effectOrigin, land } from "./abilities/land.js";
|
|
7
|
+
import { isUnstoppable } from "./abilities/buffs.js";
|
|
8
|
+
import { defineHook } from "./hooks.js";
|
|
9
|
+
import { effectRef, resolveEffect } from "./effectRefs.js";
|
|
10
|
+
import { dashing } from "./dashing.js";
|
|
11
|
+
import { valueOf } from "./abilities/amounts.js";
|
|
12
|
+
import { effectHeading } from "./abilities/shapes.js";
|
|
13
|
+
import { defineEffect, effectTargets, startDash } from "./abilities/effects.js";
|
|
14
|
+
import { dashEffect, screenOf } from "./abilities/effects/moves.js";
|
|
15
|
+
//#region src/moves.ts
|
|
16
|
+
/**
|
|
17
|
+
* The moves pack's id
|
|
18
|
+
*
|
|
19
|
+
* @beta
|
|
20
|
+
*/
|
|
21
|
+
var MOVES = "core.moves";
|
|
22
|
+
var refsOf = (saved) => ({ abilities: [saved.ability] });
|
|
23
|
+
/**
|
|
24
|
+
* Who is being moved by the moves pack's `dash` or `knockback`, and how (`Moved`): on while the rush lasts
|
|
25
|
+
*
|
|
26
|
+
* @beta
|
|
27
|
+
*/
|
|
28
|
+
var movedBy = /* @__PURE__ */ defineComponent({
|
|
29
|
+
id: "core.moved",
|
|
30
|
+
index: true,
|
|
31
|
+
refs: refsOf,
|
|
32
|
+
save: (value, world) => ({
|
|
33
|
+
...value,
|
|
34
|
+
effect: effectRef(world.registry, value.ability, value.effect)
|
|
35
|
+
}),
|
|
36
|
+
load: (saved, registry) => {
|
|
37
|
+
const value = saved;
|
|
38
|
+
return {
|
|
39
|
+
...value,
|
|
40
|
+
effect: resolveEffect(registry, value.ability, value.effect)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Who rides another (`attach`, `Riding`), out of the world while it does
|
|
46
|
+
*
|
|
47
|
+
* @beta
|
|
48
|
+
*/
|
|
49
|
+
var riding = /* @__PURE__ */ defineComponent({
|
|
50
|
+
id: "core.riding",
|
|
51
|
+
index: true,
|
|
52
|
+
refs: refsOf,
|
|
53
|
+
save: (value, world) => ({
|
|
54
|
+
...value,
|
|
55
|
+
...value.onEnd && { onEnd: effectRef(world.registry, value.ability, value.onEnd) }
|
|
56
|
+
}),
|
|
57
|
+
load: (saved, registry) => {
|
|
58
|
+
const value = saved;
|
|
59
|
+
return {
|
|
60
|
+
...value,
|
|
61
|
+
...value.onEnd && { onEnd: resolveEffect(registry, value.ability, value.onEnd) }
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
/** Nothing moves it that it does not want to (`BuffDef.unstoppable`) */
|
|
66
|
+
var unmoved = (world, entity) => entity.buffs.length > 0 && isUnstoppable(world, entity);
|
|
67
|
+
/** What may be thrown or traded: a unit that walks, on no rush already, not unstoppable */
|
|
68
|
+
var movable = (world, entity) => entity.isUnit && !!entity.get(moving) && !entity.get(dashing) && !entity.hidden && !unmoved(world, entity);
|
|
69
|
+
/** The height of the ground's level under a place: what stands higher is a wall to what set off there */
|
|
70
|
+
var levelAt = (world, point) => {
|
|
71
|
+
const { terrain } = world;
|
|
72
|
+
const x = Math.floor(point.x);
|
|
73
|
+
const z = Math.floor(point.z);
|
|
74
|
+
return x < 0 || z < 0 || x >= terrain.width || z >= terrain.depth ? Infinity : terrain.levels[z * terrain.width + x];
|
|
75
|
+
};
|
|
76
|
+
var near = [];
|
|
77
|
+
/**
|
|
78
|
+
* Whether a unit moved to a place would be at a wall: off the play area, on ground nothing walks, on a level above where
|
|
79
|
+
* it set off, or at a building or a tree. As a missile's `onWall` sees one
|
|
80
|
+
*/
|
|
81
|
+
function wallAt(world, entity, point, floor) {
|
|
82
|
+
const { terrain } = world;
|
|
83
|
+
const x = Math.floor(point.x);
|
|
84
|
+
const z = Math.floor(point.z);
|
|
85
|
+
if (x < 0 || z < 0 || x >= terrain.width || z >= terrain.depth || !terrain.inPlay(x, z)) return true;
|
|
86
|
+
const cell = z * terrain.width + x;
|
|
87
|
+
if (terrain.blocked[cell] === 2 || terrain.levels[cell] > floor) return true;
|
|
88
|
+
const radius = entity.def.radius;
|
|
89
|
+
for (const other of world.spatial.query(point.x, point.z, radius + 2, near)) if (other !== entity && other.alive && !other.hidden && other.def.kind !== "unit" && hypot(other.pos.x - point.x, other.pos.z - point.z) - other.def.radius <= radius) return true;
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
/** The Data panel's fields of what one moved meets, of a `dash` and a `knockback` */
|
|
93
|
+
var MET = [
|
|
94
|
+
{
|
|
95
|
+
path: "collide",
|
|
96
|
+
kind: "rows",
|
|
97
|
+
hint: "What happens to each enemy the one moved meets on its way, once each, in the caster’s name"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
path: "stops",
|
|
101
|
+
kind: "boolean",
|
|
102
|
+
hint: "The one moved stops at the first one it meets"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
path: "onWall",
|
|
106
|
+
kind: "rows",
|
|
107
|
+
hint: "The one moved stops at a wall (a cliff, ground nothing walks, a building, a tree), and this happens to it there"
|
|
108
|
+
}
|
|
109
|
+
];
|
|
110
|
+
/** How finely the way of one moved is looked over for a wall */
|
|
111
|
+
var WALL_STEP = .25;
|
|
112
|
+
/**
|
|
113
|
+
* A `dash` that can go to a unit (`to: 'target'`: after it to its edge, or `through` it) and see to what it meets
|
|
114
|
+
* (`collide`, `stops`) and walls (`onWall`). Otherwise the engine's own
|
|
115
|
+
*/
|
|
116
|
+
var packDash = /* @__PURE__ */ defineEffect({
|
|
117
|
+
type: "dash",
|
|
118
|
+
run: (context, effect) => {
|
|
119
|
+
const { world, caster, target, ability, level } = context;
|
|
120
|
+
const unit = effect.to === "target" && target && target !== caster && target.alive && !target.hidden ? target : void 0;
|
|
121
|
+
let point = context.point;
|
|
122
|
+
if (unit) {
|
|
123
|
+
const dx = unit.pos.x - caster.pos.x;
|
|
124
|
+
const dz = unit.pos.z - caster.pos.z;
|
|
125
|
+
const gap = hypot(dx, dz);
|
|
126
|
+
const ux = gap > .01 ? dx / gap : sin(caster.facing);
|
|
127
|
+
const uz = gap > .01 ? dz / gap : cos(caster.facing);
|
|
128
|
+
const past = effect.through ?? -(caster.def.radius + unit.def.radius);
|
|
129
|
+
point = {
|
|
130
|
+
x: unit.pos.x + ux * past,
|
|
131
|
+
z: unit.pos.z + uz * past
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
dashEffect.run(point === context.point ? context : {
|
|
135
|
+
...context,
|
|
136
|
+
point
|
|
137
|
+
}, effect);
|
|
138
|
+
const rush = caster.get(dashing);
|
|
139
|
+
if (!rush || rush.pulled) return;
|
|
140
|
+
if (unit) rush.target = unit.id;
|
|
141
|
+
const chase = unit && effect.through === void 0 ? unit.id : void 0;
|
|
142
|
+
if (chase || effect.collide?.length || effect.onWall?.length) caster.set(movedBy, {
|
|
143
|
+
by: caster.id,
|
|
144
|
+
ability: ability.id,
|
|
145
|
+
level,
|
|
146
|
+
effect,
|
|
147
|
+
...chase && { chase },
|
|
148
|
+
floor: levelAt(world, caster.pos)
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
fields: [
|
|
152
|
+
"distance",
|
|
153
|
+
"leap",
|
|
154
|
+
"climb",
|
|
155
|
+
"speed",
|
|
156
|
+
"effects",
|
|
157
|
+
"buff",
|
|
158
|
+
{
|
|
159
|
+
path: "to",
|
|
160
|
+
options: ["point", "target"],
|
|
161
|
+
hint: "Where it rushes: where it was aimed, or to the unit it was cast on, after it as it moves"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
path: "through",
|
|
165
|
+
kind: "number",
|
|
166
|
+
hint: "Of a rush to a unit: it goes on through it, this far past its middle"
|
|
167
|
+
},
|
|
168
|
+
...MET
|
|
169
|
+
]
|
|
170
|
+
});
|
|
171
|
+
/** Throws what it reaches `distance` the way `direction` says, and sees to what the thrown meet (`collide`, `onWall`) */
|
|
172
|
+
var packKnockback = /* @__PURE__ */ defineEffect({
|
|
173
|
+
type: "knockback",
|
|
174
|
+
run: (context, effect) => {
|
|
175
|
+
const { world, caster, ability, level } = context;
|
|
176
|
+
const far = at(effect.distance, level, 4);
|
|
177
|
+
const from = effectOrigin(context);
|
|
178
|
+
const way = effect.direction ?? "away";
|
|
179
|
+
const heading = way === "aim" ? effectHeading(context) : 0;
|
|
180
|
+
const edge = from === caster.pos ? caster.def.radius : context.origin && "pos" in context.origin ? context.origin.def.radius : 0;
|
|
181
|
+
const sees = !!(effect.collide?.length || effect.onWall?.length);
|
|
182
|
+
for (const entity of effectTargets(context, effect, "enemies")) {
|
|
183
|
+
if (entity === caster || !movable(world, entity)) continue;
|
|
184
|
+
const dx = entity.pos.x - from.x;
|
|
185
|
+
const dz = entity.pos.z - from.z;
|
|
186
|
+
const gap = hypot(dx, dz) || 1;
|
|
187
|
+
let to;
|
|
188
|
+
if (way === "aim") to = {
|
|
189
|
+
x: entity.pos.x + sin(heading) * far,
|
|
190
|
+
z: entity.pos.z + cos(heading) * far
|
|
191
|
+
};
|
|
192
|
+
else if (way === "over") to = {
|
|
193
|
+
x: from.x - dx / gap * far,
|
|
194
|
+
z: from.z - dz / gap * far
|
|
195
|
+
};
|
|
196
|
+
else if (way === "towards") {
|
|
197
|
+
const step = Math.min(far, Math.max(gap - edge - entity.def.radius, 0));
|
|
198
|
+
to = {
|
|
199
|
+
x: entity.pos.x - dx / gap * step,
|
|
200
|
+
z: entity.pos.z - dz / gap * step
|
|
201
|
+
};
|
|
202
|
+
} else to = {
|
|
203
|
+
x: entity.pos.x + dx / gap * far,
|
|
204
|
+
z: entity.pos.z + dz / gap * far
|
|
205
|
+
};
|
|
206
|
+
const spot = (entity.flying ? world.air : world.nav).closestPoint(to, 4) ?? to;
|
|
207
|
+
const floor = levelAt(world, entity.pos);
|
|
208
|
+
startDash(world, entity, {
|
|
209
|
+
x: spot.x,
|
|
210
|
+
z: spot.z,
|
|
211
|
+
speed: effect.speed ?? 22,
|
|
212
|
+
ability: ability.id,
|
|
213
|
+
level,
|
|
214
|
+
...screenOf(ability, effect),
|
|
215
|
+
effects: [],
|
|
216
|
+
height: effect.leap
|
|
217
|
+
});
|
|
218
|
+
if (sees) entity.set(movedBy, {
|
|
219
|
+
by: caster.id,
|
|
220
|
+
ability: ability.id,
|
|
221
|
+
level,
|
|
222
|
+
effect,
|
|
223
|
+
floor
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
fields: [
|
|
228
|
+
"distance",
|
|
229
|
+
"speed",
|
|
230
|
+
"leap",
|
|
231
|
+
{
|
|
232
|
+
path: "direction",
|
|
233
|
+
options: [
|
|
234
|
+
"away",
|
|
235
|
+
"aim",
|
|
236
|
+
"over",
|
|
237
|
+
"towards"
|
|
238
|
+
],
|
|
239
|
+
hint: "Which way it throws: away from the caster, the way it aimed, over it, or towards it"
|
|
240
|
+
},
|
|
241
|
+
...MET
|
|
242
|
+
]
|
|
243
|
+
});
|
|
244
|
+
/** The caster and the unit it was cast on trade places */
|
|
245
|
+
var swapEffect = /* @__PURE__ */ defineEffect({
|
|
246
|
+
type: "swap",
|
|
247
|
+
run: (context, effect) => {
|
|
248
|
+
const { world, caster } = context;
|
|
249
|
+
if (!caster.isUnit || !caster.get(moving) || caster.get(dashing) || caster.hidden) return;
|
|
250
|
+
for (const other of effectTargets(context, effect, "enemies")) {
|
|
251
|
+
if (other === caster || !movable(world, other)) continue;
|
|
252
|
+
const mine = {
|
|
253
|
+
x: caster.pos.x,
|
|
254
|
+
z: caster.pos.z
|
|
255
|
+
};
|
|
256
|
+
const theirs = {
|
|
257
|
+
x: other.pos.x,
|
|
258
|
+
z: other.pos.z
|
|
259
|
+
};
|
|
260
|
+
for (const [entity, to] of [[caster, theirs], [other, mine]]) {
|
|
261
|
+
world.place(entity, to);
|
|
262
|
+
entity.prevPos.x = to.x;
|
|
263
|
+
entity.prevPos.z = to.z;
|
|
264
|
+
}
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
/** One unit rides another: or, cast again by who cast it while it holds, the rider is let go */
|
|
270
|
+
var attachEffect = /* @__PURE__ */ defineEffect({
|
|
271
|
+
type: "attach",
|
|
272
|
+
run: (context, effect) => {
|
|
273
|
+
const { world, caster, target, ability, level, point } = context;
|
|
274
|
+
const held = ridingOf(world, caster, ability.id);
|
|
275
|
+
if (held) {
|
|
276
|
+
letGo(world, held, point);
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
if (!target || target === caster) return;
|
|
280
|
+
const [rider, host] = effect.rider === "target" ? [target, caster] : [caster, target];
|
|
281
|
+
if (!host.isUnit || !host.alive || host.hidden || host.has(riding) || rider.has(riding) || !movable(world, rider)) return;
|
|
282
|
+
const left = effect.duration === void 0 ? void 0 : valueOf(context, effect.duration);
|
|
283
|
+
world.setHidden(rider, true);
|
|
284
|
+
rider.set(riding, {
|
|
285
|
+
host: host.id,
|
|
286
|
+
caster: caster.id,
|
|
287
|
+
ability: ability.id,
|
|
288
|
+
level,
|
|
289
|
+
...left !== void 0 && { left },
|
|
290
|
+
...effect.onEnd && { onEnd: effect.onEnd }
|
|
291
|
+
});
|
|
292
|
+
},
|
|
293
|
+
fields: [
|
|
294
|
+
{
|
|
295
|
+
path: "rider",
|
|
296
|
+
options: ["caster", "target"],
|
|
297
|
+
hint: "Who rides: the caster on the unit it was cast on, or that unit on the caster"
|
|
298
|
+
},
|
|
299
|
+
"duration",
|
|
300
|
+
"onEnd"
|
|
301
|
+
]
|
|
302
|
+
});
|
|
303
|
+
/** Whoever rides by an ability of a caster's, cast by it */
|
|
304
|
+
function ridingOf(world, caster, ability) {
|
|
305
|
+
for (const rider of world.index.with(riding)) {
|
|
306
|
+
const ride = rider.get(riding);
|
|
307
|
+
if (ride && ride.caster === caster.id && ride.ability === ability) return rider;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Lets a rider go (`attach`): it is back in the world where its host is (or where it was), the ability's cooldown starts,
|
|
312
|
+
* and `onEnd` happens in its name at `point` (where it is when left out), its host the target. False for one that rides
|
|
313
|
+
* nobody
|
|
314
|
+
*
|
|
315
|
+
* @beta
|
|
316
|
+
*/
|
|
317
|
+
function letGo(world, rider, point) {
|
|
318
|
+
const ride = rider.get(riding);
|
|
319
|
+
if (!ride) return false;
|
|
320
|
+
rider.remove(riding);
|
|
321
|
+
const host = world.get(ride.host);
|
|
322
|
+
world.setHidden(rider, false, host?.alive ? host.pos : rider.pos);
|
|
323
|
+
const state = world.get(ride.caster)?.abilities.find((each) => each.id === ride.ability);
|
|
324
|
+
if (state && ride.held !== void 0) state.cooldown = Math.max(state.cooldown, ride.held);
|
|
325
|
+
if (!rider.alive || !ride.onEnd || !world.registry.abilities.has(ride.ability)) return true;
|
|
326
|
+
const ability = world.registry.ability(ride.ability);
|
|
327
|
+
const at = point ? {
|
|
328
|
+
x: point.x,
|
|
329
|
+
z: point.z
|
|
330
|
+
} : {
|
|
331
|
+
x: rider.pos.x,
|
|
332
|
+
z: rider.pos.z
|
|
333
|
+
};
|
|
334
|
+
land({
|
|
335
|
+
world,
|
|
336
|
+
caster: rider,
|
|
337
|
+
ability,
|
|
338
|
+
level: ride.level,
|
|
339
|
+
point: at,
|
|
340
|
+
target: host?.alive && !host.hidden ? host : void 0
|
|
341
|
+
}, ride.onEnd);
|
|
342
|
+
return true;
|
|
343
|
+
}
|
|
344
|
+
/** Of a step from `a` to `b`, how far along (0 to 1) it comes nearest to `p`, and how near */
|
|
345
|
+
function nearest(a, b, p) {
|
|
346
|
+
const dx = b.x - a.x;
|
|
347
|
+
const dz = b.z - a.z;
|
|
348
|
+
const length = dx * dx + dz * dz;
|
|
349
|
+
const t = length > 0 ? Math.max(0, Math.min(1, ((p.x - a.x) * dx + (p.z - a.z) * dz) / length)) : 0;
|
|
350
|
+
return {
|
|
351
|
+
t,
|
|
352
|
+
gap: hypot(a.x + dx * t - p.x, a.z + dz * t - p.z)
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Before the rushes move: one after a unit goes for its edge where it is now; the step each is about to take is looked
|
|
357
|
+
* over for a wall (it stops before it, `onWall`) and for who it meets (`collide`, once each; the first it meets stops it
|
|
358
|
+
* with `stops`)
|
|
359
|
+
*/
|
|
360
|
+
var movesSystem = {
|
|
361
|
+
name: "moves",
|
|
362
|
+
phase: "decide",
|
|
363
|
+
before: ["abilities"],
|
|
364
|
+
update(world, dt) {
|
|
365
|
+
for (const entity of [...world.index.with(movedBy)]) {
|
|
366
|
+
const move = entity.get(movedBy);
|
|
367
|
+
const rush = entity.get(dashing);
|
|
368
|
+
if (!move) continue;
|
|
369
|
+
if (!rush || !entity.alive) {
|
|
370
|
+
entity.remove(movedBy);
|
|
371
|
+
continue;
|
|
372
|
+
}
|
|
373
|
+
if (move.chase) {
|
|
374
|
+
const after = world.get(move.chase);
|
|
375
|
+
if (after?.alive && !after.hidden) {
|
|
376
|
+
const gap = dist(entity.pos, after.pos);
|
|
377
|
+
const edge = entity.def.radius + after.def.radius;
|
|
378
|
+
const t = gap > edge ? (gap - edge) / gap : 0;
|
|
379
|
+
rush.x = entity.pos.x + (after.pos.x - entity.pos.x) * t;
|
|
380
|
+
rush.z = entity.pos.z + (after.pos.z - entity.pos.z) * t;
|
|
381
|
+
} else delete move.chase;
|
|
382
|
+
}
|
|
383
|
+
const gap = dist(entity.pos, rush);
|
|
384
|
+
if (gap < 1e-6) continue;
|
|
385
|
+
const step = Math.min(rush.speed * dt, gap);
|
|
386
|
+
const from = {
|
|
387
|
+
x: entity.pos.x,
|
|
388
|
+
z: entity.pos.z
|
|
389
|
+
};
|
|
390
|
+
const heading = atan2(rush.x - from.x, rush.z - from.z);
|
|
391
|
+
let to = {
|
|
392
|
+
x: from.x + (rush.x - from.x) / gap * step,
|
|
393
|
+
z: from.z + (rush.z - from.z) / gap * step
|
|
394
|
+
};
|
|
395
|
+
const effect = anyEffect(move.effect);
|
|
396
|
+
const by = world.get(move.by);
|
|
397
|
+
const ability = world.registry.abilities.has(move.ability) ? world.registry.ability(move.ability) : void 0;
|
|
398
|
+
const context = by?.alive && ability ? {
|
|
399
|
+
world,
|
|
400
|
+
caster: by,
|
|
401
|
+
ability,
|
|
402
|
+
level: move.level
|
|
403
|
+
} : void 0;
|
|
404
|
+
let wall = false;
|
|
405
|
+
if (effect.onWall?.length && !entity.flying) {
|
|
406
|
+
const steps = Math.max(1, Math.ceil(step / WALL_STEP));
|
|
407
|
+
for (let i = 1; i <= steps; i++) {
|
|
408
|
+
if (!wallAt(world, entity, {
|
|
409
|
+
x: from.x + (to.x - from.x) * i / steps,
|
|
410
|
+
z: from.z + (to.z - from.z) * i / steps
|
|
411
|
+
}, move.floor)) continue;
|
|
412
|
+
wall = true;
|
|
413
|
+
to = {
|
|
414
|
+
x: from.x + (to.x - from.x) * (i - 1) / steps,
|
|
415
|
+
z: from.z + (to.z - from.z) * (i - 1) / steps
|
|
416
|
+
};
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
if (effect.collide?.length && context) {
|
|
421
|
+
const reach = dist(from, to) / 2 + entity.def.radius + 2;
|
|
422
|
+
const met = [];
|
|
423
|
+
for (const other of world.spatial.query((from.x + to.x) / 2, (from.z + to.z) / 2, reach, near)) {
|
|
424
|
+
if (other === entity || other === by || !other.alive || other.hidden || !other.isUnit || move.met?.includes(other.id)) continue;
|
|
425
|
+
if (!world.areEnemies(by.owner, other.owner)) continue;
|
|
426
|
+
const { t, gap: apart } = nearest(from, to, other.pos);
|
|
427
|
+
if (apart <= entity.def.radius + other.def.radius) met.push({
|
|
428
|
+
other,
|
|
429
|
+
t
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
met.sort((a, b) => a.t - b.t || a.other.id - b.other.id);
|
|
433
|
+
for (const { other, t } of met) {
|
|
434
|
+
move.met = [...move.met ?? [], other.id];
|
|
435
|
+
land({
|
|
436
|
+
...context,
|
|
437
|
+
target: other,
|
|
438
|
+
point: {
|
|
439
|
+
x: other.pos.x,
|
|
440
|
+
z: other.pos.z
|
|
441
|
+
},
|
|
442
|
+
origin: entity
|
|
443
|
+
}, effect.collide);
|
|
444
|
+
if (effect.stops) {
|
|
445
|
+
to = {
|
|
446
|
+
x: from.x + (to.x - from.x) * t,
|
|
447
|
+
z: from.z + (to.z - from.z) * t
|
|
448
|
+
};
|
|
449
|
+
wall = false;
|
|
450
|
+
rush.x = to.x;
|
|
451
|
+
rush.z = to.z;
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
if (wall) {
|
|
457
|
+
rush.x = to.x;
|
|
458
|
+
rush.z = to.z;
|
|
459
|
+
entity.remove(movedBy);
|
|
460
|
+
if (context) land({
|
|
461
|
+
...context,
|
|
462
|
+
target: entity,
|
|
463
|
+
point: {
|
|
464
|
+
x: to.x,
|
|
465
|
+
z: to.z
|
|
466
|
+
},
|
|
467
|
+
heading
|
|
468
|
+
}, effect.onWall);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
/** Riders go where their hosts go; let go as their time is up, or their host is gone */
|
|
474
|
+
var ridersSystem = {
|
|
475
|
+
name: "riders",
|
|
476
|
+
phase: "move",
|
|
477
|
+
after: ["movement"],
|
|
478
|
+
update(world, dt) {
|
|
479
|
+
for (const rider of [...world.index.with(riding)]) {
|
|
480
|
+
const ride = rider.get(riding);
|
|
481
|
+
if (!ride) continue;
|
|
482
|
+
const host = world.get(ride.host);
|
|
483
|
+
if (!rider.alive || !host?.alive || host.hidden) {
|
|
484
|
+
letGo(world, rider);
|
|
485
|
+
continue;
|
|
486
|
+
}
|
|
487
|
+
if (ride.held === void 0) {
|
|
488
|
+
const state = world.get(ride.caster)?.abilities.find((each) => each.id === ride.ability);
|
|
489
|
+
ride.held = state?.cooldown ?? 0;
|
|
490
|
+
if (state) state.cooldown = 0;
|
|
491
|
+
}
|
|
492
|
+
world.place(rider, host.pos);
|
|
493
|
+
if (ride.left === void 0) continue;
|
|
494
|
+
ride.left -= dt;
|
|
495
|
+
if (ride.left <= 0) letGo(world, rider);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
/**
|
|
500
|
+
* Moves, as in a MOBA: what a game with it (`Rules.packs`) gets beside the engine's `blink`, `dash`, `knockback` and
|
|
501
|
+
* `pull`. A `dash` to the unit it was cast on (`to: 'target'`: after it as it moves, to its edge, or `through` it), a
|
|
502
|
+
* `knockback` that throws the way it is told (`direction`: `away`, `aim`, `over`, `towards`); for both, what happens to
|
|
503
|
+
* each the one moved meets on its way (`collide`, `stops`) and where it meets a wall (`onWall`). The `swap` effect (two
|
|
504
|
+
* units trade places) and `attach` (one rides another, out of the world, until it is let go: its time, its host gone,
|
|
505
|
+
* the ability cast again; `letGo` in code)
|
|
506
|
+
*
|
|
507
|
+
* @beta
|
|
508
|
+
*/
|
|
509
|
+
function movesPack() {
|
|
510
|
+
const recast = defineHook({
|
|
511
|
+
hook: "beforeOrder",
|
|
512
|
+
id: "moves",
|
|
513
|
+
run(world, event) {
|
|
514
|
+
const { order, entity } = event;
|
|
515
|
+
const init = order.init;
|
|
516
|
+
if (order.type !== "cast" || !init.ability) return;
|
|
517
|
+
const rider = ridingOf(world, entity, init.ability);
|
|
518
|
+
if (!rider) return;
|
|
519
|
+
event.rejected = true;
|
|
520
|
+
letGo(world, rider, init.point ?? (init.target === void 0 ? void 0 : world.get(init.target)?.pos));
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
return {
|
|
524
|
+
id: MOVES,
|
|
525
|
+
components: [movedBy, riding],
|
|
526
|
+
effects: [
|
|
527
|
+
packDash,
|
|
528
|
+
packKnockback,
|
|
529
|
+
swapEffect,
|
|
530
|
+
attachEffect
|
|
531
|
+
],
|
|
532
|
+
systems: [movesSystem, ridersSystem],
|
|
533
|
+
hooks: [recast]
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
//#endregion
|
|
537
|
+
export { MOVES, letGo, movedBy, movesPack, riding };
|
|
538
|
+
|
|
539
|
+
//# sourceMappingURL=moves.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moves.js","names":[],"sources":["../src/moves.ts"],"sourcesContent":["import { effectRef, type EffectRef, resolveEffect } from './effectRefs'\nimport { valueOf } from './abilities/amounts'\nimport { isUnstoppable } from './abilities/buffs'\nimport { defineEffect, effectTargets, startDash } from './abilities/effects'\nimport { dashEffect, screenOf } from './abilities/effects/moves'\nimport { effectOrigin, land } from './abilities/land'\nimport { effectHeading } from './abilities/shapes'\nimport { defineComponent } from './components'\nimport { dashing } from './dashing'\nimport { anyEffect, at, type EffectDef } from './defs'\nimport { type Entity, type EntityId, moving } from './entity'\nimport { atan2, cos, hypot, sin } from './exactMath'\nimport { defineHook } from './hooks'\nimport { dist, type Vec2 } from './math'\nimport type { EditableField } from './gameData'\nimport type { GamePack } from './packs/pack'\nimport type { System } from './registry'\nimport type { World } from './world'\n\n/*\n * Moves, an opt-in pack (E2E-PLAN AB12): a dash to a unit (after it, or through it), a knockback that throws the way it\n * is told, what the one moved meets on its way and at a wall, two units trading places, and one riding another. A game\n * without it keeps the engine's `dash` and `knockback`, and pays nothing for these\n */\n\n/**\n * The moves pack's id\n *\n * @beta\n */\nexport const MOVES = 'core.moves'\n\n/**\n * Someone moved by a `dash` or a `knockback` of the moves pack while it rushes (`dashing`): in whose name (`by`), by\n * which effect, after whom (`chase`), whom it met already (`met`) and the ground it set off from (`floor`), above which\n * is a wall to it\n *\n * @beta\n */\nexport interface Moved {\n\t/** In whose name what it meets and the wall happen: who dashed, or who threw it */\n\tby: EntityId\n\t/** The ability that moved it */\n\tability: string\n\t/** The level it was cast at */\n\tlevel: number\n\t/** The `dash` or `knockback` that moved it, whose `collide`, `stops` and `onWall` it goes by */\n\teffect: EffectDef\n\t/** The unit it rushes after, to its edge (`to: 'target'`) */\n\tchase?: EntityId\n\t/** Whom it met already, each once */\n\tmet?: EntityId[]\n\t/** The level of the ground it set off from: higher ground is a wall to it */\n\tfloor: number\n}\n\n/**\n * One unit riding another (`attach`): its `host`, who cast it (`caster`), the ability and level, the seconds `left` (until\n * it is let go otherwise when left out), the cooldown put off until it is let go (`held`) and what happens then (`onEnd`)\n *\n * @beta\n */\nexport interface Riding {\n\t/** Whom it rides */\n\thost: EntityId\n\t/** Who cast it: whose casting the ability again lets it go */\n\tcaster: EntityId\n\t/** The ability it rides by */\n\tability: string\n\t/** The level it was cast at */\n\tlevel: number\n\t/** Seconds until it is let go, when it has a `duration` */\n\tleft?: number\n\t/** The ability's cooldown, put off until it is let go */\n\theld?: number\n\t/** What happens as it is let go, in its name */\n\tonEnd?: EffectDef[]\n}\n\nconst refsOf = (saved: unknown) => ({ abilities: [(saved as { ability: string }).ability] })\n\n/**\n * Who is being moved by the moves pack's `dash` or `knockback`, and how (`Moved`): on while the rush lasts\n *\n * @beta\n */\nexport const movedBy = /* @__PURE__ */ defineComponent<Moved>({\n\tid: 'core.moved',\n\tindex: true,\n\trefs: refsOf,\n\tsave: (value, world) => ({ ...value, effect: effectRef(world.registry, value.ability, value.effect) }),\n\tload: (saved, registry) => {\n\t\tconst value = saved as Moved & { effect: EffectRef }\n\t\treturn { ...value, effect: resolveEffect(registry, value.ability, value.effect) }\n\t}\n})\n\n/**\n * Who rides another (`attach`, `Riding`), out of the world while it does\n *\n * @beta\n */\nexport const riding = /* @__PURE__ */ defineComponent<Riding>({\n\tid: 'core.riding',\n\tindex: true,\n\trefs: refsOf,\n\tsave: (value, world) => ({ ...value, ...(value.onEnd && { onEnd: effectRef(world.registry, value.ability, value.onEnd) }) }),\n\tload: (saved, registry) => {\n\t\tconst value = saved as Riding & { onEnd?: EffectRef }\n\t\treturn { ...value, ...(value.onEnd && { onEnd: resolveEffect(registry, value.ability, value.onEnd) }) }\n\t}\n})\n\n/** Nothing moves it that it does not want to (`BuffDef.unstoppable`) */\nconst unmoved = (world: World, entity: Entity): boolean => entity.buffs.length > 0 && isUnstoppable(world, entity)\n\n/** What may be thrown or traded: a unit that walks, on no rush already, not unstoppable */\nconst movable = (world: World, entity: Entity): boolean =>\n\tentity.isUnit && !!entity.get(moving) && !entity.get(dashing) && !entity.hidden && !unmoved(world, entity)\n\n/** The height of the ground's level under a place: what stands higher is a wall to what set off there */\nconst levelAt = (world: World, point: Vec2): number => {\n\tconst { terrain } = world\n\tconst x = Math.floor(point.x)\n\tconst z = Math.floor(point.z)\n\treturn x < 0 || z < 0 || x >= terrain.width || z >= terrain.depth ? Infinity : terrain.levels[z * terrain.width + x]\n}\n\nconst near: Entity[] = []\n\n/**\n * Whether a unit moved to a place would be at a wall: off the play area, on ground nothing walks, on a level above where\n * it set off, or at a building or a tree. As a missile's `onWall` sees one\n */\nfunction wallAt(world: World, entity: Entity, point: Vec2, floor: number): boolean {\n\tconst { terrain } = world\n\tconst x = Math.floor(point.x)\n\tconst z = Math.floor(point.z)\n\tif (x < 0 || z < 0 || x >= terrain.width || z >= terrain.depth || !terrain.inPlay(x, z)) return true\n\tconst cell = z * terrain.width + x\n\tif (terrain.blocked[cell] === 2 || terrain.levels[cell] > floor) return true\n\tconst radius = entity.def.radius\n\tfor (const other of world.spatial.query(point.x, point.z, radius + 2, near))\n\t\tif (other !== entity && other.alive && !other.hidden && other.def.kind !== 'unit' && hypot(other.pos.x - point.x, other.pos.z - point.z) - other.def.radius <= radius)\n\t\t\treturn true\n\treturn false\n}\n\n/** The Data panel's fields of what one moved meets, of a `dash` and a `knockback` */\nconst MET: readonly EditableField[] = [\n\t{ path: 'collide', kind: 'rows', hint: 'What happens to each enemy the one moved meets on its way, once each, in the caster’s name' },\n\t{ path: 'stops', kind: 'boolean', hint: 'The one moved stops at the first one it meets' },\n\t{ path: 'onWall', kind: 'rows', hint: 'The one moved stops at a wall (a cliff, ground nothing walks, a building, a tree), and this happens to it there' }\n]\n\n/** How finely the way of one moved is looked over for a wall */\nconst WALL_STEP = 0.25\n\n/**\n * A `dash` that can go to a unit (`to: 'target'`: after it to its edge, or `through` it) and see to what it meets\n * (`collide`, `stops`) and walls (`onWall`). Otherwise the engine's own\n */\nconst packDash = /* @__PURE__ */ defineEffect({\n\ttype: 'dash',\n\trun: (context, effect) => {\n\t\tconst { world, caster, target, ability, level } = context\n\t\tconst unit = effect.to === 'target' && target && target !== caster && target.alive && !target.hidden ? target : undefined\n\t\tlet point = context.point\n\t\tif (unit) {\n\t\t\tconst dx = unit.pos.x - caster.pos.x\n\t\t\tconst dz = unit.pos.z - caster.pos.z\n\t\t\tconst gap = hypot(dx, dz)\n\t\t\tconst ux = gap > 0.01 ? dx / gap : sin(caster.facing)\n\t\t\tconst uz = gap > 0.01 ? dz / gap : cos(caster.facing)\n\t\t\tconst past = effect.through ?? -(caster.def.radius + unit.def.radius)\n\t\t\tpoint = { x: unit.pos.x + ux * past, z: unit.pos.z + uz * past }\n\t\t}\n\t\tdashEffect.run(point === context.point ? context : { ...context, point }, effect)\n\t\tconst rush = caster.get(dashing)\n\t\tif (!rush || rush.pulled) return\n\t\tif (unit) rush.target = unit.id\n\t\tconst chase = unit && effect.through === undefined ? unit.id : undefined\n\t\tif (chase || effect.collide?.length || effect.onWall?.length)\n\t\t\tcaster.set(movedBy, { by: caster.id, ability: ability.id, level, effect, ...(chase && { chase }), floor: levelAt(world, caster.pos) })\n\t},\n\tfields: [\n\t\t'distance',\n\t\t'leap',\n\t\t'climb',\n\t\t'speed',\n\t\t'effects',\n\t\t'buff',\n\t\t{ path: 'to', options: ['point', 'target'], hint: 'Where it rushes: where it was aimed, or to the unit it was cast on, after it as it moves' },\n\t\t{ path: 'through', kind: 'number', hint: 'Of a rush to a unit: it goes on through it, this far past its middle' },\n\t\t...MET\n\t]\n})\n\n/** Throws what it reaches `distance` the way `direction` says, and sees to what the thrown meet (`collide`, `onWall`) */\nconst packKnockback = /* @__PURE__ */ defineEffect({\n\ttype: 'knockback',\n\trun: (context, effect) => {\n\t\tconst { world, caster, ability, level } = context\n\t\tconst far = at(effect.distance, level, 4)\n\t\tconst from = effectOrigin(context)\n\t\tconst way = effect.direction ?? 'away'\n\t\tconst heading = way === 'aim' ? effectHeading(context) : 0\n\t\t// to the edge of what it goes off from, where that is a unit\n\t\tconst edge = from === caster.pos ? caster.def.radius : context.origin && 'pos' in context.origin ? (context.origin as Entity).def.radius : 0\n\t\tconst sees = !!(effect.collide?.length || effect.onWall?.length)\n\t\tfor (const entity of effectTargets(context, effect, 'enemies')) {\n\t\t\tif (entity === caster || !movable(world, entity)) continue\n\t\t\tconst dx = entity.pos.x - from.x\n\t\t\tconst dz = entity.pos.z - from.z\n\t\t\tconst gap = hypot(dx, dz) || 1\n\t\t\tlet to: Vec2\n\t\t\tif (way === 'aim') to = { x: entity.pos.x + sin(heading) * far, z: entity.pos.z + cos(heading) * far }\n\t\t\telse if (way === 'over') to = { x: from.x - (dx / gap) * far, z: from.z - (dz / gap) * far }\n\t\t\telse if (way === 'towards') {\n\t\t\t\tconst step = Math.min(far, Math.max(gap - edge - entity.def.radius, 0))\n\t\t\t\tto = { x: entity.pos.x - (dx / gap) * step, z: entity.pos.z - (dz / gap) * step }\n\t\t\t} else to = { x: entity.pos.x + (dx / gap) * far, z: entity.pos.z + (dz / gap) * far }\n\t\t\tconst spot = (entity.flying ? world.air : world.nav).closestPoint(to, 4) ?? to\n\t\t\tconst floor = levelAt(world, entity.pos)\n\t\t\tstartDash(world, entity, {\n\t\t\t\tx: spot.x,\n\t\t\t\tz: spot.z,\n\t\t\t\tspeed: effect.speed ?? 22,\n\t\t\t\tability: ability.id,\n\t\t\t\tlevel,\n\t\t\t\t...screenOf(ability, effect),\n\t\t\t\teffects: [],\n\t\t\t\theight: effect.leap\n\t\t\t})\n\t\t\tif (sees) entity.set(movedBy, { by: caster.id, ability: ability.id, level, effect, floor })\n\t\t}\n\t},\n\tfields: [\n\t\t'distance',\n\t\t'speed',\n\t\t'leap',\n\t\t{ path: 'direction', options: ['away', 'aim', 'over', 'towards'], hint: 'Which way it throws: away from the caster, the way it aimed, over it, or towards it' },\n\t\t...MET\n\t]\n})\n\n/** The caster and the unit it was cast on trade places */\nconst swapEffect = /* @__PURE__ */ defineEffect({\n\ttype: 'swap',\n\trun: (context, effect) => {\n\t\tconst { world, caster } = context\n\t\tif (!caster.isUnit || !caster.get(moving) || caster.get(dashing) || caster.hidden) return\n\t\tfor (const other of effectTargets(context, effect, 'enemies')) {\n\t\t\tif (other === caster || !movable(world, other)) continue\n\t\t\tconst mine = { x: caster.pos.x, z: caster.pos.z }\n\t\t\tconst theirs = { x: other.pos.x, z: other.pos.z }\n\t\t\tfor (const [entity, to] of [\n\t\t\t\t[caster, theirs],\n\t\t\t\t[other, mine]\n\t\t\t] as const) {\n\t\t\t\tworld.place(entity, to)\n\t\t\t\tentity.prevPos.x = to.x\n\t\t\t\tentity.prevPos.z = to.z\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n})\n\n/** One unit rides another: or, cast again by who cast it while it holds, the rider is let go */\nconst attachEffect = /* @__PURE__ */ defineEffect({\n\ttype: 'attach',\n\trun: (context, effect) => {\n\t\tconst { world, caster, target, ability, level, point } = context\n\t\tconst held = ridingOf(world, caster, ability.id)\n\t\tif (held) {\n\t\t\tletGo(world, held, point)\n\t\t\treturn\n\t\t}\n\t\tif (!target || target === caster) return\n\t\tconst [rider, host] = effect.rider === 'target' ? [target, caster] : [caster, target]\n\t\tif (!host.isUnit || !host.alive || host.hidden || host.has(riding) || rider.has(riding) || !movable(world, rider)) return\n\t\tconst left = effect.duration === undefined ? undefined : valueOf(context, effect.duration)\n\t\tworld.setHidden(rider, true)\n\t\trider.set(riding, { host: host.id, caster: caster.id, ability: ability.id, level, ...(left !== undefined && { left }), ...(effect.onEnd && { onEnd: effect.onEnd }) })\n\t},\n\tfields: [\n\t\t{ path: 'rider', options: ['caster', 'target'], hint: 'Who rides: the caster on the unit it was cast on, or that unit on the caster' },\n\t\t'duration',\n\t\t'onEnd'\n\t]\n})\n\n/** Whoever rides by an ability of a caster's, cast by it */\nfunction ridingOf(world: World, caster: Entity, ability: string): Entity | undefined {\n\tfor (const rider of world.index.with(riding)) {\n\t\tconst ride = rider.get(riding)\n\t\tif (ride && ride.caster === caster.id && ride.ability === ability) return rider\n\t}\n\treturn undefined\n}\n\n/**\n * Lets a rider go (`attach`): it is back in the world where its host is (or where it was), the ability's cooldown starts,\n * and `onEnd` happens in its name at `point` (where it is when left out), its host the target. False for one that rides\n * nobody\n *\n * @beta\n */\nexport function letGo(world: World, rider: Entity, point?: Vec2): boolean {\n\tconst ride = rider.get(riding)\n\tif (!ride) return false\n\trider.remove(riding)\n\tconst host = world.get(ride.host)\n\tworld.setHidden(rider, false, host?.alive ? host.pos : rider.pos)\n\tconst caster = world.get(ride.caster)\n\tconst state = caster?.abilities.find((each) => each.id === ride.ability)\n\tif (state && ride.held !== undefined) state.cooldown = Math.max(state.cooldown, ride.held)\n\tif (!rider.alive || !ride.onEnd || !world.registry.abilities.has(ride.ability)) return true\n\tconst ability = world.registry.ability(ride.ability)\n\tconst at = point ? { x: point.x, z: point.z } : { x: rider.pos.x, z: rider.pos.z }\n\tland({ world, caster: rider, ability, level: ride.level, point: at, target: host?.alive && !host.hidden ? host : undefined }, ride.onEnd)\n\treturn true\n}\n\n/** Of a step from `a` to `b`, how far along (0 to 1) it comes nearest to `p`, and how near */\nfunction nearest(a: Vec2, b: Vec2, p: Vec2): { t: number; gap: number } {\n\tconst dx = b.x - a.x\n\tconst dz = b.z - a.z\n\tconst length = dx * dx + dz * dz\n\tconst t = length > 0 ? Math.max(0, Math.min(1, ((p.x - a.x) * dx + (p.z - a.z) * dz) / length)) : 0\n\treturn { t, gap: hypot(a.x + dx * t - p.x, a.z + dz * t - p.z) }\n}\n\n/**\n * Before the rushes move: one after a unit goes for its edge where it is now; the step each is about to take is looked\n * over for a wall (it stops before it, `onWall`) and for who it meets (`collide`, once each; the first it meets stops it\n * with `stops`)\n */\nconst movesSystem: System = {\n\tname: 'moves',\n\tphase: 'decide',\n\tbefore: ['abilities'],\n\tupdate(world, dt) {\n\t\tfor (const entity of [...world.index.with(movedBy)]) {\n\t\t\tconst move = entity.get(movedBy)\n\t\t\tconst rush = entity.get(dashing)\n\t\t\tif (!move) continue\n\t\t\tif (!rush || !entity.alive) {\n\t\t\t\tentity.remove(movedBy)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (move.chase) {\n\t\t\t\tconst after = world.get(move.chase)\n\t\t\t\tif (after?.alive && !after.hidden) {\n\t\t\t\t\tconst gap = dist(entity.pos, after.pos)\n\t\t\t\t\tconst edge = entity.def.radius + after.def.radius\n\t\t\t\t\tconst t = gap > edge ? (gap - edge) / gap : 0\n\t\t\t\t\trush.x = entity.pos.x + (after.pos.x - entity.pos.x) * t\n\t\t\t\t\trush.z = entity.pos.z + (after.pos.z - entity.pos.z) * t\n\t\t\t\t} else delete move.chase\n\t\t\t}\n\t\t\tconst gap = dist(entity.pos, rush)\n\t\t\tif (gap < 1e-6) continue\n\t\t\tconst step = Math.min(rush.speed * dt, gap)\n\t\t\tconst from = { x: entity.pos.x, z: entity.pos.z }\n\t\t\tconst heading = atan2(rush.x - from.x, rush.z - from.z)\n\t\t\tlet to = { x: from.x + ((rush.x - from.x) / gap) * step, z: from.z + ((rush.z - from.z) / gap) * step }\n\t\t\tconst effect = anyEffect(move.effect)\n\t\t\tconst by = world.get(move.by)\n\t\t\tconst ability = world.registry.abilities.has(move.ability) ? world.registry.ability(move.ability) : undefined\n\t\t\tconst context = by?.alive && ability ? { world, caster: by, ability, level: move.level } : undefined\n\t\t\t// a wall on the way: it stops in front of it\n\t\t\tlet wall = false\n\t\t\tif (effect.onWall?.length && !entity.flying) {\n\t\t\t\tconst steps = Math.max(1, Math.ceil(step / WALL_STEP))\n\t\t\t\tfor (let i = 1; i <= steps; i++) {\n\t\t\t\t\tconst point = { x: from.x + ((to.x - from.x) * i) / steps, z: from.z + ((to.z - from.z) * i) / steps }\n\t\t\t\t\tif (!wallAt(world, entity, point, move.floor)) continue\n\t\t\t\t\twall = true\n\t\t\t\t\tto = { x: from.x + ((to.x - from.x) * (i - 1)) / steps, z: from.z + ((to.z - from.z) * (i - 1)) / steps }\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\t// who it meets on the way, nearest first\n\t\t\tif (effect.collide?.length && context) {\n\t\t\t\tconst reach = dist(from, to) / 2 + entity.def.radius + 2\n\t\t\t\tconst met: { other: Entity; t: number }[] = []\n\t\t\t\tfor (const other of world.spatial.query((from.x + to.x) / 2, (from.z + to.z) / 2, reach, near)) {\n\t\t\t\t\tif (other === entity || other === by || !other.alive || other.hidden || !other.isUnit || move.met?.includes(other.id)) continue\n\t\t\t\t\tif (!world.areEnemies(by!.owner, other.owner)) continue\n\t\t\t\t\tconst { t, gap: apart } = nearest(from, to, other.pos)\n\t\t\t\t\tif (apart <= entity.def.radius + other.def.radius) met.push({ other, t })\n\t\t\t\t}\n\t\t\t\tmet.sort((a, b) => a.t - b.t || a.other.id - b.other.id)\n\t\t\t\tfor (const { other, t } of met) {\n\t\t\t\t\tmove.met = [...(move.met ?? []), other.id]\n\t\t\t\t\tland({ ...context, target: other, point: { x: other.pos.x, z: other.pos.z }, origin: entity }, effect.collide)\n\t\t\t\t\tif (effect.stops) {\n\t\t\t\t\t\tto = { x: from.x + (to.x - from.x) * t, z: from.z + (to.z - from.z) * t }\n\t\t\t\t\t\twall = false\n\t\t\t\t\t\trush.x = to.x\n\t\t\t\t\t\trush.z = to.z\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (wall) {\n\t\t\t\trush.x = to.x\n\t\t\t\trush.z = to.z\n\t\t\t\tentity.remove(movedBy)\n\t\t\t\tif (context)\n\t\t\t\t\tland({ ...context, target: entity, point: { x: to.x, z: to.z }, heading }, effect.onWall)\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Riders go where their hosts go; let go as their time is up, or their host is gone */\nconst ridersSystem: System = {\n\tname: 'riders',\n\tphase: 'move',\n\tafter: ['movement'],\n\tupdate(world, dt) {\n\t\tfor (const rider of [...world.index.with(riding)]) {\n\t\t\tconst ride = rider.get(riding)\n\t\t\tif (!ride) continue\n\t\t\tconst host = world.get(ride.host)\n\t\t\tif (!rider.alive || !host?.alive || host.hidden) {\n\t\t\t\tletGo(world, rider)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// the cooldown waits for it to be let go\n\t\t\tif (ride.held === undefined) {\n\t\t\t\tconst state = world.get(ride.caster)?.abilities.find((each) => each.id === ride.ability)\n\t\t\t\tride.held = state?.cooldown ?? 0\n\t\t\t\tif (state) state.cooldown = 0\n\t\t\t}\n\t\t\tworld.place(rider, host.pos)\n\t\t\tif (ride.left === undefined) continue\n\t\t\tride.left -= dt\n\t\t\tif (ride.left <= 0) letGo(world, rider)\n\t\t}\n\t}\n}\n\n/**\n * Moves, as in a MOBA: what a game with it (`Rules.packs`) gets beside the engine's `blink`, `dash`, `knockback` and\n * `pull`. A `dash` to the unit it was cast on (`to: 'target'`: after it as it moves, to its edge, or `through` it), a\n * `knockback` that throws the way it is told (`direction`: `away`, `aim`, `over`, `towards`); for both, what happens to\n * each the one moved meets on its way (`collide`, `stops`) and where it meets a wall (`onWall`). The `swap` effect (two\n * units trade places) and `attach` (one rides another, out of the world, until it is let go: its time, its host gone,\n * the ability cast again; `letGo` in code)\n *\n * @beta\n */\nexport function movesPack(): GamePack {\n\t// cast again by who cast it, while one rides by it: let go, at once, where the recast aimed\n\tconst recast = defineHook({\n\t\thook: 'beforeOrder',\n\t\tid: 'moves',\n\t\trun(world, event) {\n\t\t\tconst { order, entity } = event\n\t\t\tconst init = order.init as { ability?: string; point?: Vec2; target?: EntityId }\n\t\t\tif (order.type !== 'cast' || !init.ability) return\n\t\t\tconst rider = ridingOf(world, entity, init.ability)\n\t\t\tif (!rider) return\n\t\t\tevent.rejected = true\n\t\t\tconst aimed = init.point ?? (init.target === undefined ? undefined : world.get(init.target)?.pos)\n\t\t\tletGo(world, rider, aimed)\n\t\t}\n\t})\n\treturn {\n\t\tid: MOVES,\n\t\tcomponents: [movedBy, riding],\n\t\teffects: [packDash, packKnockback, swapEffect, attachEffect],\n\t\tsystems: [movesSystem, ridersSystem],\n\t\thooks: [recast]\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8BA,IAAa,QAAQ;AAiDrB,IAAM,UAAU,WAAoB,EAAE,WAAW,CAAE,MAA8B,OAAO,EAAE;;;;;;AAO1F,IAAa,UAA0B,gCAAuB;CAC7D,IAAI;CACJ,OAAO;CACP,MAAM;CACN,OAAO,OAAO,WAAW;EAAE,GAAG;EAAO,QAAQ,UAAU,MAAM,UAAU,MAAM,SAAS,MAAM,MAAM;CAAE;CACpG,OAAO,OAAO,aAAa;EAC1B,MAAM,QAAQ;EACd,OAAO;GAAE,GAAG;GAAO,QAAQ,cAAc,UAAU,MAAM,SAAS,MAAM,MAAM;EAAE;CACjF;AACD,CAAC;;;;;;AAOD,IAAa,SAAyB,gCAAwB;CAC7D,IAAI;CACJ,OAAO;CACP,MAAM;CACN,OAAO,OAAO,WAAW;EAAE,GAAG;EAAO,GAAI,MAAM,SAAS,EAAE,OAAO,UAAU,MAAM,UAAU,MAAM,SAAS,MAAM,KAAK,EAAE;CAAG;CAC1H,OAAO,OAAO,aAAa;EAC1B,MAAM,QAAQ;EACd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IACpE;EAC1B;CACD,CAAC;CACD,OAAO;EACN,IAAI;EACJ,YAAY,CAAC,SAAS,MAAM;EAC5B,SAAS;GAAC;GAAU;GAAe;GAAY;EAAY;EAC3D,SAAS,CAAC,aAAa,YAAY;EACnC,OAAO,CAAC,MAAM;CACf;AACD"}
|
package/dist/names.d.ts
CHANGED
|
@@ -14,9 +14,13 @@ export declare const names: import("./components").Component<Record<string, numb
|
|
|
14
14
|
* @beta
|
|
15
15
|
*/
|
|
16
16
|
export interface MapInfo {
|
|
17
|
+
/** The map's name (`GameMap.name`) */
|
|
17
18
|
name: string;
|
|
19
|
+
/** What the game kept with the map (`GameMap.data`), plain data the engine never looks inside */
|
|
18
20
|
data: Record<string, unknown>;
|
|
21
|
+
/** The map's named points, as `world.map.point(name)` finds them */
|
|
19
22
|
points: MapPoint[];
|
|
23
|
+
/** The map's named paths, as `world.map.path(name)` finds them */
|
|
20
24
|
paths: MapPath[];
|
|
21
25
|
/** What the map looks like, for the screens (`GameSession.environment`) */
|
|
22
26
|
environment?: MapEnvironment;
|
|
@@ -41,8 +45,11 @@ export interface MapInfo {
|
|
|
41
45
|
* @beta
|
|
42
46
|
*/
|
|
43
47
|
export interface MapPlayerInfo {
|
|
48
|
+
/** The player's id */
|
|
44
49
|
id: number;
|
|
50
|
+
/** Who plays the player: a person, the computer or nobody; the game's to say when left out */
|
|
45
51
|
controller?: MapPlayer['controller'];
|
|
52
|
+
/** The game's own fields for the player (`MapPlayer.data`), with the defaults of those not set */
|
|
46
53
|
data: Record<string, unknown>;
|
|
47
54
|
}
|
|
48
55
|
export declare const mapInfo: import("./components").Component<MapInfo, MapInfo>;
|