@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/life.js
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { footprintOf } from "./defs.js";
|
|
2
|
+
import { statsOf } from "./stats.js";
|
|
3
|
+
import { damaged, entityDied, healed } from "./engineEvents.js";
|
|
4
|
+
import { replicateEvent } from "./replication.js";
|
|
5
|
+
import { deposit, fighting } from "./entity.js";
|
|
6
|
+
import { absorb, healthFloor, isInvulnerable, overheal } from "./abilities/buffs.js";
|
|
7
|
+
import { dashing } from "./dashing.js";
|
|
8
|
+
import { cheatDeath } from "./abilities/triggers.js";
|
|
9
|
+
import { clearOrders } from "./orders/queue.js";
|
|
10
|
+
import { hurtWhileChannelling } from "./orders/cast.js";
|
|
11
|
+
import { expose } from "./systems/fog.js";
|
|
12
|
+
//#region src/life.ts
|
|
13
|
+
/**
|
|
14
|
+
* How things are hurt, healed and die in a world (`world.life`): damage through the hooks, armor and shields; healing;
|
|
15
|
+
* death through its hooks, the entity leaving the world, a fallen hero waiting out of it. The world's `damage`, `heal`
|
|
16
|
+
* and `kill` are this
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* How a world's entities are hurt, healed and die
|
|
20
|
+
*
|
|
21
|
+
* @beta
|
|
22
|
+
*/
|
|
23
|
+
var Life = class {
|
|
24
|
+
world;
|
|
25
|
+
/** Who died and is to be taken out of the world at the end of the tick (`World.step`) */
|
|
26
|
+
dead = [];
|
|
27
|
+
constructor(world) {
|
|
28
|
+
this.world = world;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Deals damage. In order:
|
|
32
|
+
* 1. the `beforeDamage` hook, which can change the amount or call it off;
|
|
33
|
+
* 2. armor or magic resist take their part, then the damage is made more or less (`incomingDamage`, `outgoingDamage`:
|
|
34
|
+
* `RuleSettings.combat.damageScale`), and shields take theirs;
|
|
35
|
+
* 3. the rest comes off the target's health, and it dies when nothing is left (see `kill`);
|
|
36
|
+
* 4. the `afterDamage` hook, for what follows from a hit: life steal, effects on hit.
|
|
37
|
+
*/
|
|
38
|
+
damage(target, amount, source, options = {}) {
|
|
39
|
+
if (!target.alive || target.def.invulnerable || target.def.targetableBy || this.dying.has(target)) return;
|
|
40
|
+
if (this.world.cheats.invulnerable && this.world.debugPlayers.has(target.owner)) return;
|
|
41
|
+
if (target.buffs.length && isInvulnerable(this.world, target)) return;
|
|
42
|
+
const attack = options.attack ?? false;
|
|
43
|
+
const crit = options.crit ?? false;
|
|
44
|
+
const { ability, tags } = options;
|
|
45
|
+
let type = options.damageType ?? "physical";
|
|
46
|
+
const { hooks } = this.world;
|
|
47
|
+
if (hooks.has("beforeDamage")) {
|
|
48
|
+
const before = hooks.run("beforeDamage", {
|
|
49
|
+
target,
|
|
50
|
+
source,
|
|
51
|
+
amount,
|
|
52
|
+
type,
|
|
53
|
+
attack,
|
|
54
|
+
crit,
|
|
55
|
+
ability,
|
|
56
|
+
tags,
|
|
57
|
+
cancelled: false
|
|
58
|
+
});
|
|
59
|
+
if (before.cancelled || !target.alive) return;
|
|
60
|
+
amount = before.amount;
|
|
61
|
+
type = before.type;
|
|
62
|
+
}
|
|
63
|
+
const from = source ? statsOf(this.world, source) : void 0;
|
|
64
|
+
const { combat } = this.world.settings;
|
|
65
|
+
const own = statsOf(this.world, target);
|
|
66
|
+
const arrived = Math.max(amount * combat.mitigation(type, own, from) * combat.damageScale(type, own, from), 0);
|
|
67
|
+
let dealt = target.def.uses ? 1 : target.buffs.length ? absorb(target, arrived) : arrived;
|
|
68
|
+
if (target.buffs.length && dealt > 0) {
|
|
69
|
+
const floor = healthFloor(this.world, target);
|
|
70
|
+
if (floor > 0 && target.health - dealt < floor) dealt = Math.max(target.health - floor, 0);
|
|
71
|
+
}
|
|
72
|
+
const taken = Math.min(dealt, target.health);
|
|
73
|
+
target.health -= dealt;
|
|
74
|
+
target.hurtAt = this.world.time;
|
|
75
|
+
if (source && target.get(fighting)) target.get(fighting).lastAttacker = source.id;
|
|
76
|
+
if (dealt > 0 && target.orders.length) hurtWhileChannelling(this.world, target);
|
|
77
|
+
if (source && this.world.areEnemies(source.owner, target.owner)) expose(source, this.world.player(target.owner).team);
|
|
78
|
+
this.world.events.emit(damaged, {
|
|
79
|
+
target,
|
|
80
|
+
source,
|
|
81
|
+
amount: dealt,
|
|
82
|
+
type,
|
|
83
|
+
crit,
|
|
84
|
+
attack,
|
|
85
|
+
ability,
|
|
86
|
+
tags
|
|
87
|
+
});
|
|
88
|
+
if (target.health <= 0) this.die(target, source, attack, "damage", {
|
|
89
|
+
type,
|
|
90
|
+
amount: dealt,
|
|
91
|
+
overkill: Math.max(dealt - taken, 0),
|
|
92
|
+
crit,
|
|
93
|
+
ability,
|
|
94
|
+
tags,
|
|
95
|
+
...options.how && { how: options.how }
|
|
96
|
+
});
|
|
97
|
+
if (hooks.has("afterDamage")) hooks.run("afterDamage", {
|
|
98
|
+
target,
|
|
99
|
+
source,
|
|
100
|
+
dealt,
|
|
101
|
+
taken,
|
|
102
|
+
type,
|
|
103
|
+
attack,
|
|
104
|
+
crit,
|
|
105
|
+
ability,
|
|
106
|
+
tags
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Gives health back, made more or less by what the target gets of it (`incomingHealing`:
|
|
111
|
+
* `RuleSettings.combat.healingScale`), then after the `beforeHeal` hook had its say. Returns how much of it was needed
|
|
112
|
+
*/
|
|
113
|
+
heal(target, amount, source) {
|
|
114
|
+
if (!target.alive || amount <= 0 || this.dying.has(target)) return 0;
|
|
115
|
+
amount *= this.world.settings.combat.healingScale(statsOf(this.world, target), source && statsOf(this.world, source));
|
|
116
|
+
if (amount <= 0) return 0;
|
|
117
|
+
const before = this.world.hooks.run("beforeHeal", {
|
|
118
|
+
target,
|
|
119
|
+
source,
|
|
120
|
+
amount,
|
|
121
|
+
cancelled: false
|
|
122
|
+
});
|
|
123
|
+
if (before.cancelled) return 0;
|
|
124
|
+
amount = before.amount;
|
|
125
|
+
const healed$1 = Math.min(amount, target.maxHealth - target.health);
|
|
126
|
+
if (amount > healed$1 && (target.buffs.length || source?.buffs.length)) overheal(this.world, target, source, amount - Math.max(healed$1, 0));
|
|
127
|
+
if (healed$1 <= 0) return 0;
|
|
128
|
+
target.health += healed$1;
|
|
129
|
+
this.world.events.emit(healed, {
|
|
130
|
+
target,
|
|
131
|
+
source,
|
|
132
|
+
amount: healed$1
|
|
133
|
+
});
|
|
134
|
+
return healed$1;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Kills an entity by the rules, not by damage: felled, cancelled, run out of time. `attack` says that an attack of
|
|
138
|
+
* the killer did it; `reason` why (`DeathReason`: `killed` when left out, or the game's own word, `sold`), for the
|
|
139
|
+
* hooks and the screen
|
|
140
|
+
*/
|
|
141
|
+
kill(entity, killer, attack = false, reason = "killed") {
|
|
142
|
+
this.die(entity, killer, attack, reason);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* How anything dies. In order:
|
|
146
|
+
* 1. the `beforeDeath` hook, which can keep it alive;
|
|
147
|
+
* 2. its orders and production are called off;
|
|
148
|
+
* 3. the `death` hook, while it still stands where it was: experience, loot, bounty;
|
|
149
|
+
* 4. it leaves the world (a fallen hero waits out of it to be brought back);
|
|
150
|
+
* 5. the `afterDeath` hook, for what follows: effects of the killer on a kill.
|
|
151
|
+
*/
|
|
152
|
+
die(entity, killer, attack, reason, cause) {
|
|
153
|
+
if (!entity.alive || this.dying.has(entity)) return;
|
|
154
|
+
if (this.world.hooks.run("beforeDeath", {
|
|
155
|
+
entity,
|
|
156
|
+
killer,
|
|
157
|
+
attack,
|
|
158
|
+
fromDamage: !!cause,
|
|
159
|
+
cause,
|
|
160
|
+
reason,
|
|
161
|
+
cancelled: false
|
|
162
|
+
}).cancelled) return;
|
|
163
|
+
if ((cause || reason === "killed") && cheatDeath(this.world, entity)) return;
|
|
164
|
+
this.dying.add(entity);
|
|
165
|
+
try {
|
|
166
|
+
clearOrders(this.world, entity);
|
|
167
|
+
this.world.leave(entity);
|
|
168
|
+
const death = {
|
|
169
|
+
entity,
|
|
170
|
+
killer,
|
|
171
|
+
attack,
|
|
172
|
+
cause,
|
|
173
|
+
reason,
|
|
174
|
+
...cause?.how && { how: cause.how }
|
|
175
|
+
};
|
|
176
|
+
this.world.hooks.run("death", death);
|
|
177
|
+
this.fall(entity, killer, attack, cause, death);
|
|
178
|
+
} finally {
|
|
179
|
+
this.dying.delete(entity);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/** Who is being killed right now: their `death` hooks are running. They take no damage, no healing, and die once */
|
|
183
|
+
dying = /* @__PURE__ */ new Set();
|
|
184
|
+
/** Whether an entity is being killed right now: alive still, while its `death` hooks run, and past saving */
|
|
185
|
+
isDying(entity) {
|
|
186
|
+
return this.dying.has(entity);
|
|
187
|
+
}
|
|
188
|
+
/** What follows the `death` hooks: the entity is gone from the world, and it is told */
|
|
189
|
+
fall(entity, killer, attack, cause, death) {
|
|
190
|
+
entity.setAlive(false);
|
|
191
|
+
entity.health = 0;
|
|
192
|
+
if (entity.buffs.length) death.carried = entity.buffs.slice();
|
|
193
|
+
entity.clearBuffs();
|
|
194
|
+
entity.remove(dashing);
|
|
195
|
+
this.detach(entity);
|
|
196
|
+
if (!this.world.hooks.has("fallenHero") || !this.world.hooks.run("fallenHero", {
|
|
197
|
+
entity,
|
|
198
|
+
killer,
|
|
199
|
+
stays: false
|
|
200
|
+
}).stays) this.dead.push(entity);
|
|
201
|
+
this.world.events.emit(entityDied, {
|
|
202
|
+
entity,
|
|
203
|
+
killer,
|
|
204
|
+
attack,
|
|
205
|
+
cause,
|
|
206
|
+
how: death.how,
|
|
207
|
+
reason: death.reason
|
|
208
|
+
});
|
|
209
|
+
this.world.hooks.run("afterDeath", death);
|
|
210
|
+
const above = this.world.get(entity.get(deposit)?.under);
|
|
211
|
+
if (above?.alive && !this.isDying(above)) this.kill(above, void 0, false, "removed");
|
|
212
|
+
}
|
|
213
|
+
detach(entity) {
|
|
214
|
+
this.world.nav.removeAgent(entity.id);
|
|
215
|
+
if (entity.isStructure) this.world.spatial.removeStatic(entity);
|
|
216
|
+
if (entity.cell) {
|
|
217
|
+
const fp = footprintOf(entity.def);
|
|
218
|
+
this.world.grid.release(entity.cell.x, entity.cell.z, fp.w, fp.d, entity.id);
|
|
219
|
+
this.world.nav.removeObstacle(entity.id);
|
|
220
|
+
}
|
|
221
|
+
const under = this.world.get(entity.on);
|
|
222
|
+
if (under?.get(deposit) && under.cell) {
|
|
223
|
+
if (under.get(deposit).under === entity.id) under.get(deposit).under = void 0;
|
|
224
|
+
if (under.alive) {
|
|
225
|
+
const fp = footprintOf(under.def);
|
|
226
|
+
this.world.grid.occupy(under.cell.x, under.cell.z, fp.w, fp.d, under.id);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
/** A death, to those who see the dead: who killed it where they see the killer too (`SessionEvent` `death`) */
|
|
232
|
+
var toldDeath = replicateEvent(entityDied, "death", ({ entity, killer, attack, cause, how, reason }, view) => {
|
|
233
|
+
if (!view.knows(entity)) return void 0;
|
|
234
|
+
const seen = killer && killer !== entity && view.knows(killer) ? killer : void 0;
|
|
235
|
+
return {
|
|
236
|
+
type: "death",
|
|
237
|
+
id: entity.id,
|
|
238
|
+
from: seen && {
|
|
239
|
+
x: seen.pos.x,
|
|
240
|
+
z: seen.pos.z
|
|
241
|
+
},
|
|
242
|
+
killer: seen?.id,
|
|
243
|
+
killerType: seen?.def.id,
|
|
244
|
+
attack,
|
|
245
|
+
damageType: cause?.type,
|
|
246
|
+
ability: cause?.ability,
|
|
247
|
+
overkill: cause?.overkill,
|
|
248
|
+
crit: cause?.crit,
|
|
249
|
+
how,
|
|
250
|
+
...reason !== "damage" && { reason },
|
|
251
|
+
...cause?.tags?.length && { tags: [...cause.tags] }
|
|
252
|
+
};
|
|
253
|
+
});
|
|
254
|
+
/** A hit, to those who see who took it: who dealt it where they see them too */
|
|
255
|
+
var toldDamage = replicateEvent(damaged, "damage", ({ target, source, amount, type, attack, crit, ability, tags }, view) => {
|
|
256
|
+
if (!view.knows(target)) return void 0;
|
|
257
|
+
const seen = source && view.knows(source) ? source : void 0;
|
|
258
|
+
return {
|
|
259
|
+
type: "damage",
|
|
260
|
+
id: target.id,
|
|
261
|
+
amount,
|
|
262
|
+
damageType: type,
|
|
263
|
+
source: seen?.id,
|
|
264
|
+
sourceType: seen?.def.id,
|
|
265
|
+
attack,
|
|
266
|
+
crit,
|
|
267
|
+
ability: seen ? ability : void 0,
|
|
268
|
+
tags
|
|
269
|
+
};
|
|
270
|
+
});
|
|
271
|
+
/** Healing, to those who see who was healed */
|
|
272
|
+
var toldHeal = replicateEvent(healed, "heal", ({ target, source, amount }, view) => view.knows(target) ? {
|
|
273
|
+
type: "heal",
|
|
274
|
+
id: target.id,
|
|
275
|
+
amount,
|
|
276
|
+
source: source && view.knows(source) ? source.id : void 0
|
|
277
|
+
} : void 0);
|
|
278
|
+
/** A critical strike's number over who took it */
|
|
279
|
+
var toldCrit = replicateEvent(damaged, "crit", ({ target, amount, crit }, view) => crit && view.knows(target) ? {
|
|
280
|
+
type: "crit",
|
|
281
|
+
id: target.id,
|
|
282
|
+
amount: Math.round(amount)
|
|
283
|
+
} : void 0);
|
|
284
|
+
//#endregion
|
|
285
|
+
export { Life, toldCrit, toldDamage, toldDeath, toldHeal };
|
|
286
|
+
|
|
287
|
+
//# sourceMappingURL=life.js.map
|
package/dist/life.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"life.js","names":["healed","healedEvent"],"sources":["../src/life.ts"],"sourcesContent":["/**\n * How things are hurt, healed and die in a world (`world.life`): damage through the hooks, armor and shields; healing;\n * death through its hooks, the entity leaving the world, a fallen hero waiting out of it. The world's `damage`, `heal`\n * and `kill` are this\n */\nimport { damaged, entityDied, healed as healedEvent } from '#engine/engineEvents'\nimport { dashing } from './dashing'\nimport { absorb, healthFloor, isInvulnerable, overheal } from './abilities/buffs'\nimport { footprintOf } from './defs'\nimport { type BuffInstance, type Entity, fighting, deposit } from './entity'\nimport type { Death } from './hooks'\nimport { hurtWhileChannelling } from './orders/cast'\nimport { cheatDeath } from './abilities/triggers'\nimport { clearOrders } from './orders/queue'\nimport { statsOf } from './stats'\nimport { expose } from './systems/fog'\nimport type { DamageOptions, DeathCause, DeathReason, World } from './world'\nimport { replicateEvent } from './replication'\n\n/**\n * How a world's entities are hurt, healed and die\n *\n * @beta\n */\nexport class Life {\n\t/** Who died and is to be taken out of the world at the end of the tick (`World.step`) */\n\treadonly dead: Entity[] = []\n\n\tconstructor(private readonly world: World) {}\n\n\t/**\n\t * Deals damage. In order:\n\t * 1. the `beforeDamage` hook, which can change the amount or call it off;\n\t * 2. armor or magic resist take their part, then the damage is made more or less (`incomingDamage`, `outgoingDamage`:\n\t * `RuleSettings.combat.damageScale`), and shields take theirs;\n\t * 3. the rest comes off the target's health, and it dies when nothing is left (see `kill`);\n\t * 4. the `afterDamage` hook, for what follows from a hit: life steal, effects on hit.\n\t */\n\tdamage(target: Entity, amount: number, source?: Entity, options: DamageOptions = {}): void {\n\t\t// one already being killed takes no more: its death goes on as it began\n\t\tif (!target.alive || target.def.invulnerable || target.def.targetableBy || this.dying.has(target)) return\n\t\t// the cheat: what those who may use the debug tools own is not hurt\n\t\tif (this.world.cheats.invulnerable && this.world.debugPlayers.has(target.owner)) return\n\t\t// a buff that keeps it from harm (AB9): Divine Shield, a stasis\n\t\tif (target.buffs.length && isInvulnerable(this.world, target)) return\n\t\tconst attack = options.attack ?? false\n\t\tconst crit = options.crit ?? false\n\t\tconst { ability, tags } = options\n\t\tlet type = options.damageType ?? 'physical'\n\t\t// the event made only for a game that hears it: damage is dealt on every hit\n\t\tconst { hooks } = this.world\n\t\tif (hooks.has('beforeDamage')) {\n\t\t\tconst before = hooks.run('beforeDamage', { target, source, amount, type, attack, crit, ability, tags, cancelled: false })\n\t\t\tif (before.cancelled || !target.alive) return\n\t\t\tamount = before.amount\n\t\t\ttype = before.type\n\t\t}\n\t\tconst from = source ? statsOf(this.world, source) : undefined\n\t\tconst { combat } = this.world.settings\n\t\tconst own = statsOf(this.world, target)\n\t\t// armor or magic resist, then what makes it more or less for either side (`incomingDamage`, `outgoingDamage`)\n\t\tconst arrived = Math.max(amount * combat.mitigation(type, own, from) * combat.damageScale(type, own, from), 0)\n\t\t// what counts hits takes one, however hard it is struck\n\t\tlet dealt = target.def.uses ? 1 : target.buffs.length ? absorb(target, arrived) : arrived\n\t\t// a floor a buff keeps its health at (AB9): hurt down to it, never past it\n\t\tif (target.buffs.length && dealt > 0) {\n\t\t\tconst floor = healthFloor(this.world, target)\n\t\t\tif (floor > 0 && target.health - dealt < floor) dealt = Math.max(target.health - floor, 0)\n\t\t}\n\t\tconst taken = Math.min(dealt, target.health)\n\t\ttarget.health -= dealt\n\t\ttarget.hurtAt = this.world.time\n\t\tif (source && target.get(fighting)) target.get(fighting)!.lastAttacker = source.id\n\t\t// a recall, and whatever else is kept up only while unhurt, is broken off\n\t\tif (dealt > 0 && target.orders.length) hurtWhileChannelling(this.world, target)\n\t\tif (source && this.world.areEnemies(source.owner, target.owner)) expose(source, this.world.player(target.owner).team)\n\t\tthis.world.events.emit(damaged, { target, source, amount: dealt, type, crit, attack, ability, tags })\n\t\tif (target.health <= 0)\n\t\t\tthis.die(target, source, attack, 'damage', {\n\t\t\t\ttype,\n\t\t\t\tamount: dealt,\n\t\t\t\toverkill: Math.max(dealt - taken, 0),\n\t\t\t\tcrit,\n\t\t\t\tability,\n\t\t\t\ttags,\n\t\t\t\t...(options.how && { how: options.how })\n\t\t\t})\n\t\tif (hooks.has('afterDamage')) hooks.run('afterDamage', { target, source, dealt, taken, type, attack, crit, ability, tags })\n\t}\n\n\t/**\n\t * Gives health back, made more or less by what the target gets of it (`incomingHealing`:\n\t * `RuleSettings.combat.healingScale`), then after the `beforeHeal` hook had its say. Returns how much of it was needed\n\t */\n\theal(target: Entity, amount: number, source?: Entity): number {\n\t\tif (!target.alive || amount <= 0 || this.dying.has(target)) return 0\n\t\tamount *= this.world.settings.combat.healingScale(statsOf(this.world, target), source && statsOf(this.world, source))\n\t\tif (amount <= 0) return 0\n\t\tconst before = this.world.hooks.run('beforeHeal', { target, source, amount, cancelled: false })\n\t\tif (before.cancelled) return 0\n\t\tamount = before.amount\n\t\tconst healed = Math.min(amount, target.maxHealth - target.health)\n\t\t// what spills over full health, where a buff of the healer's or the healed one's makes it a shield (`BuffDef.overheal`)\n\t\tif (amount > healed && (target.buffs.length || source?.buffs.length)) overheal(this.world, target, source, amount - Math.max(healed, 0))\n\t\tif (healed <= 0) return 0\n\t\ttarget.health += healed\n\t\tthis.world.events.emit(healedEvent, { target, source, amount: healed })\n\t\treturn healed\n\t}\n\n\t/**\n\t * Kills an entity by the rules, not by damage: felled, cancelled, run out of time. `attack` says that an attack of\n\t * the killer did it; `reason` why (`DeathReason`: `killed` when left out, or the game's own word, `sold`), for the\n\t * hooks and the screen\n\t */\n\tkill(entity: Entity, killer?: Entity, attack = false, reason: DeathReason = 'killed'): void {\n\t\tthis.die(entity, killer, attack, reason)\n\t}\n\n\t/**\n\t * How anything dies. In order:\n\t * 1. the `beforeDeath` hook, which can keep it alive;\n\t * 2. its orders and production are called off;\n\t * 3. the `death` hook, while it still stands where it was: experience, loot, bounty;\n\t * 4. it leaves the world (a fallen hero waits out of it to be brought back);\n\t * 5. the `afterDeath` hook, for what follows: effects of the killer on a kill.\n\t */\n\tprivate die(entity: Entity, killer: Entity | undefined, attack: boolean, reason: DeathReason, cause?: DeathCause): void {\n\t\tif (!entity.alive || this.dying.has(entity)) return\n\t\tif (this.world.hooks.run('beforeDeath', { entity, killer, attack, fromDamage: !!cause, cause, reason, cancelled: false }).cancelled) return\n\t\t// a passive that cheats death (`onFatal`, AB9), of a blow or a kill, not of what the rules take away\n\t\tif ((cause || reason === 'killed') && cheatDeath(this.world, entity)) return\n\t\t// from here on it is dying: still alive and where it was for the `death` hooks, but what they do to it, or what\n\t\t// what they do does to it (a blast that kills a neighbour whose own blast comes back), kills it no second time\n\t\tthis.dying.add(entity)\n\t\ttry {\n\t\t\tclearOrders(this.world, entity)\n\t\t\tthis.world.leave(entity)\n\t\t\t// how the blow says it dies, for the `death` hook to keep or change\n\t\t\tconst death: Death = { entity, killer, attack, cause, reason, ...(cause?.how && { how: cause.how }) }\n\t\t\tthis.world.hooks.run('death', death)\n\t\t\tthis.fall(entity, killer, attack, cause, death)\n\t\t} finally {\n\t\t\tthis.dying.delete(entity)\n\t\t}\n\t}\n\n\t/** Who is being killed right now: their `death` hooks are running. They take no damage, no healing, and die once */\n\tprivate readonly dying = new Set<Entity>()\n\n\t/** Whether an entity is being killed right now: alive still, while its `death` hooks run, and past saving */\n\tisDying(entity: Entity): boolean {\n\t\treturn this.dying.has(entity)\n\t}\n\n\t/** What follows the `death` hooks: the entity is gone from the world, and it is told */\n\tprivate fall(entity: Entity, killer: Entity | undefined, attack: boolean, cause: DeathCause | undefined, death: Death): void {\n\t\tentity.setAlive(false)\n\t\tentity.health = 0\n\t\t// what it carried, for what asks it after (an `onKill`'s effects, B44)\n\t\tif (entity.buffs.length) (death as { carried?: readonly BuffInstance[] }).carried = entity.buffs.slice()\n\t\tentity.clearBuffs()\n\t\tentity.remove(dashing)\n\t\tthis.detach(entity)\n\t\t// what stays around, out of the world, until it is brought back: a fallen hero, where the heroes pack is on\n\t\tif (!this.world.hooks.has('fallenHero') || !this.world.hooks.run('fallenHero', { entity, killer, stays: false }).stays) this.dead.push(entity)\n\t\tthis.world.events.emit(entityDied, { entity, killer, attack, cause, how: death.how, reason: death.reason })\n\t\tthis.world.hooks.run('afterDeath', death)\n\t\t// a resource used up takes down what stood on it: there is nothing for it to stand on\n\t\tconst above = this.world.get(entity.get(deposit)?.under)\n\t\tif (above?.alive && !this.isDying(above)) this.kill(above, undefined, false, 'removed')\n\t}\n\n\tprivate detach(entity: Entity): void {\n\t\tthis.world.nav.removeAgent(entity.id)\n\t\tif (entity.isStructure) this.world.spatial.removeStatic(entity)\n\t\tif (entity.cell) {\n\t\t\tconst fp = footprintOf(entity.def)\n\t\t\tthis.world.grid.release(entity.cell.x, entity.cell.z, fp.w, fp.d, entity.id)\n\t\t\tthis.world.nav.removeObstacle(entity.id)\n\t\t}\n\t\t// what stood on a resource: the resource has its ground again, and is free to be built on\n\t\tconst under = this.world.get(entity.on)\n\t\tif (under?.get(deposit) && under.cell) {\n\t\t\tif (under.get(deposit)!.under === entity.id) under.get(deposit)!.under = undefined\n\t\t\tif (under.alive) {\n\t\t\t\tconst fp = footprintOf(under.def)\n\t\t\t\tthis.world.grid.occupy(under.cell.x, under.cell.z, fp.w, fp.d, under.id)\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** A death, to those who see the dead: who killed it where they see the killer too (`SessionEvent` `death`) */\nexport const toldDeath = replicateEvent(entityDied, 'death', ({ entity, killer, attack, cause, how, reason }, view) => {\n\tif (!view.knows(entity)) return undefined\n\tconst seen = killer && killer !== entity && view.knows(killer) ? killer : undefined\n\treturn {\n\t\ttype: 'death',\n\t\tid: entity.id,\n\t\tfrom: seen && { x: seen.pos.x, z: seen.pos.z },\n\t\tkiller: seen?.id,\n\t\tkillerType: seen?.def.id,\n\t\tattack,\n\t\tdamageType: cause?.type,\n\t\tability: cause?.ability,\n\t\toverkill: cause?.overkill,\n\t\tcrit: cause?.crit,\n\t\thow,\n\t\t...(reason !== 'damage' && { reason }),\n\t\t...(cause?.tags?.length && { tags: [...cause.tags] })\n\t}\n})\n\n/** A hit, to those who see who took it: who dealt it where they see them too */\nexport const toldDamage = replicateEvent(damaged, 'damage', ({ target, source, amount, type, attack, crit, ability, tags }, view) => {\n\tif (!view.knows(target)) return undefined\n\tconst seen = source && view.knows(source) ? source : undefined\n\treturn {\n\t\ttype: 'damage',\n\t\tid: target.id,\n\t\tamount,\n\t\tdamageType: type,\n\t\tsource: seen?.id,\n\t\tsourceType: seen?.def.id,\n\t\tattack,\n\t\tcrit,\n\t\tability: seen ? ability : undefined,\n\t\ttags\n\t}\n})\n\n/** Healing, to those who see who was healed */\nexport const toldHeal = replicateEvent(healedEvent, 'heal', ({ target, source, amount }, view) =>\n\tview.knows(target) ? { type: 'heal', id: target.id, amount, source: source && view.knows(source) ? source.id : undefined } : undefined\n)\n\n/** A critical strike's number over who took it */\nexport const toldCrit = replicateEvent(damaged, 'crit', ({ target, amount, crit }, view) =>\n\tcrit && view.knows(target) ? { type: 'crit', id: target.id, amount: Math.round(amount) } : undefined\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAa,OAAb,MAAkB;CAIY;;CAF7B,OAA0B,CAAC;CAE3B,YAAY,OAA+B;EAAd,KAAA,QAAA;CAAe;;;;;;;;;CAU5C,OAAO,QAAgB,QAAgB,QAAiB,UAAyB,CAAC,GAAS;EAE1F,IAAI,CAAC,OAAO,SAAS,OAAO,IAAI,gBAAgB,OAAO,IAAI,gBAAgB,KAAK,MAAM,IAAI,MAAM,GAAG;EAEnG,IAAI,KAAK,MAAM,OAAO,gBAAgB,KAAK,MAAM,aAAa,IAAI,OAAO,KAAK,GAAG;EAEjF,IAAI,OAAO,MAAM,UAAU,eAAe,KAAK,OAAO,MAAM,GAAG;EAC/D,MAAM,SAAS,QAAQ,UAAU;EACjC,MAAM,OAAO,QAAQ,QAAQ;EAC7B,MAAM,EAAE,SAAS,SAAS;EAC1B,IAAI,OAAO,QAAQ,cAAc;EAEjC,MAAM,EAAE,UAAU,KAAK;EACvB,IAAI,MAAM,IAAI,cAAc,GAAG;GAC9B,MAAM,SAAS,MAAM,IAAI,gBAAgB;IAAE;IAAQ;IAAQ;IAAQ;IAAM;IAAQ;IAAM;IA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ACA,YAAY,OAAO;EACnB,SAAS,OAAO;EAChB,UAAU,OAAO;EACjB,MAAM,OAAO;EACb;EACA,GAAI,WAAW,YAAY,EAAE,OAAO;EACpC,GAAI,OAAO,MAAM,UAAU,EAAE,MAAM,CAAC,GAAG,MAAM,IAAI,EAAE;CACpD;AACD,CAAC;;AAGD,IAAa,aAAa,eAAe,SAAS,WAAW,EAAE,QAAQ,QAAQ,QAAQ,MAAM,QAAQ,MAAM,SAAS,QAAQ,SAAS;CACpI,IAAI,CAAC,KAAK,MAAM,MAAM,GAAG,OAAO,KAAA;CAChC,MAAM,OAAO,UAAU,KAAK,MAAM,MAAM,IAAI,SAAS,KAAA;CACrD,OAAO;EACN,MAAM;EACN,IAAI,OAAO;EACX;EACA,YAAY;EACZ,QAAQ,MAAM;EACd,YAAY,MAAM,IAAI;EACtB;EACA;EACA,SAAS,OAAO,UAAU,KAAA;EAC1B;CACD;AACD,CAAC;;AAGD,IAAa,WAAW,eAAeC,QAAa,SAAS,EAAE,QAAQ,QAAQ,UAAU,SACxF,KAAK,MAAM,MAAM,IAAI;CAAE,MAAM;CAAQ,IAAI,OAAO;CAAI;CAAQ,QAAQ,UAAU,KAAK,MAAM,MAAM,IAAI,OAAO,KAAK,KAAA;AAAU,IAAI,KAAA,CAC9H;;AAGA,IAAa,WAAW,eAAe,SAAS,SAAS,EAAE,QAAQ,QAAQ,QAAQ,SAClF,QAAQ,KAAK,MAAM,MAAM,IAAI;CAAE,MAAM;CAAQ,IAAI,OAAO;CAAI,QAAQ,KAAK,MAAM,MAAM;AAAE,IAAI,KAAA,CAC5F"}
|
package/dist/log.d.ts
CHANGED
|
@@ -13,7 +13,11 @@
|
|
|
13
13
|
* @beta
|
|
14
14
|
*/
|
|
15
15
|
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The levels of log entries from least to most important, in the order `Logger.says` ranks them
|
|
18
|
+
*
|
|
19
|
+
* @beta
|
|
20
|
+
*/
|
|
17
21
|
export declare const LOG_LEVELS: readonly LogLevel[];
|
|
18
22
|
/**
|
|
19
23
|
* One thing said. Plain data: it crosses a session, a worker and a file as it is
|
|
@@ -21,14 +25,17 @@ export declare const LOG_LEVELS: readonly LogLevel[];
|
|
|
21
25
|
* @beta
|
|
22
26
|
*/
|
|
23
27
|
export interface LogEntry {
|
|
28
|
+
/** How much the entry matters */
|
|
24
29
|
level: LogLevel;
|
|
25
30
|
/** What part said it: `server`, `game`, `assets`, a mod's own */
|
|
26
31
|
category: string;
|
|
32
|
+
/** What was said, in words */
|
|
27
33
|
message: string;
|
|
28
34
|
/** What it is about, by name: an entity's id, a player, a file, an error (`errorFields`) */
|
|
29
35
|
fields?: Record<string, unknown>;
|
|
30
36
|
/** The game it was said in, and its tick, where it was said in one */
|
|
31
37
|
game?: string;
|
|
38
|
+
/** The tick of the game it was said in, where it was said in a world */
|
|
32
39
|
tick?: number;
|
|
33
40
|
/** When, in milliseconds of the clock (`Date.now`). Never read by the simulation */
|
|
34
41
|
time: number;
|
|
@@ -47,12 +54,17 @@ export type LogSink = (entry: LogEntry) => void;
|
|
|
47
54
|
export type LogContext = () => Partial<Pick<LogEntry, 'game' | 'tick'>> & {
|
|
48
55
|
fields?: Record<string, unknown>;
|
|
49
56
|
};
|
|
50
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* The options a `Logger` is made with
|
|
59
|
+
*
|
|
60
|
+
* @beta
|
|
61
|
+
*/
|
|
51
62
|
export interface LoggerOptions {
|
|
52
63
|
/** The logger this one passes its entries up to. None for one that stands alone */
|
|
53
64
|
parent?: Logger;
|
|
54
65
|
/** The least an entry must matter to be said here: everything when left out */
|
|
55
66
|
level?: LogLevel;
|
|
67
|
+
/** What the logger adds to each entry it passes on: the game, the tick and the fields */
|
|
56
68
|
context?: LogContext;
|
|
57
69
|
}
|
|
58
70
|
/**
|
|
@@ -77,7 +89,11 @@ export declare function logLine(entry: LogEntry): string;
|
|
|
77
89
|
* @beta
|
|
78
90
|
*/
|
|
79
91
|
export declare const consoleSink: LogSink;
|
|
80
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* A logger: it takes entries of a level and above and sends them to its sinks and its parent
|
|
94
|
+
*
|
|
95
|
+
* @beta
|
|
96
|
+
*/
|
|
81
97
|
export declare class Logger {
|
|
82
98
|
/** The least an entry must matter to be said: what is under it is dropped here, and goes no further */
|
|
83
99
|
level: LogLevel;
|
|
@@ -91,10 +107,15 @@ export declare class Logger {
|
|
|
91
107
|
child(options?: Omit<LoggerOptions, 'parent'> | LogContext): Logger;
|
|
92
108
|
/** Whether an entry of this level would be said: for not putting together what nobody will read */
|
|
93
109
|
says(level: LogLevel): boolean;
|
|
110
|
+
/** Says an entry of the level, the category and the message, with its fields when given; dropped when the logger does not say that level */
|
|
94
111
|
log(level: LogLevel, category: string, message: string, fields?: Record<string, unknown>): void;
|
|
112
|
+
/** Says a `debug` entry */
|
|
95
113
|
debug(category: string, message: string, fields?: Record<string, unknown>): void;
|
|
114
|
+
/** Says an `info` entry */
|
|
96
115
|
info(category: string, message: string, fields?: Record<string, unknown>): void;
|
|
116
|
+
/** Says a `warn` entry */
|
|
97
117
|
warn(category: string, message: string, fields?: Record<string, unknown>): void;
|
|
118
|
+
/** Says an `error` entry */
|
|
98
119
|
error(category: string, message: string, fields?: Record<string, unknown>): void;
|
|
99
120
|
/**
|
|
100
121
|
* Takes an entry made elsewhere (a world's, by the client that shows it; a server's, sent to a tool) as if it was
|
|
@@ -125,9 +146,11 @@ export declare const rootConsole: {
|
|
|
125
146
|
* @beta
|
|
126
147
|
*/
|
|
127
148
|
export interface LogRing {
|
|
149
|
+
/** The sink to give to a logger (`Logger.to`) to have the ring keep what it is sent */
|
|
128
150
|
sink: LogSink;
|
|
129
151
|
/** The entries kept, the oldest first */
|
|
130
152
|
entries(): readonly LogEntry[];
|
|
153
|
+
/** Empties the ring of the entries it keeps */
|
|
131
154
|
clear(): void;
|
|
132
155
|
/** Calls back for each entry as it comes. Returns what stops it */
|
|
133
156
|
onEntry(listener: LogSink): () => void;
|
package/dist/log.js
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
//#region src/log.ts
|
|
2
|
+
/**
|
|
3
|
+
* The levels of log entries from least to most important, in the order `Logger.says` ranks them
|
|
4
|
+
*
|
|
5
|
+
* @beta
|
|
6
|
+
*/
|
|
7
|
+
var LOG_LEVELS = [
|
|
8
|
+
"debug",
|
|
9
|
+
"info",
|
|
10
|
+
"warn",
|
|
11
|
+
"error"
|
|
12
|
+
];
|
|
13
|
+
/**
|
|
14
|
+
* An error as plain data, for an entry's fields: what it is called, what it says, and where it was thrown
|
|
15
|
+
*
|
|
16
|
+
* @beta
|
|
17
|
+
*/
|
|
18
|
+
function errorFields(error) {
|
|
19
|
+
if (error instanceof Error) return {
|
|
20
|
+
name: error.name,
|
|
21
|
+
message: error.message,
|
|
22
|
+
...error.stack && { stack: error.stack }
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
name: "Error",
|
|
26
|
+
message: String(error)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* An entry as one line of text: `warn [server] tick 120 of td: a connection took in too slowly {bytes: 12}`
|
|
31
|
+
*
|
|
32
|
+
* @beta
|
|
33
|
+
*/
|
|
34
|
+
function logLine(entry) {
|
|
35
|
+
const where = entry.game !== void 0 ? ` ${entry.tick !== void 0 ? `tick ${entry.tick} of ` : ""}${entry.game}:` : "";
|
|
36
|
+
const fields = entry.fields && Object.keys(entry.fields).length ? ` ${JSON.stringify(entry.fields)}` : "";
|
|
37
|
+
return `${entry.level} [${entry.category}]${where} ${entry.message}${fields}`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Writes entries to the console, each by its level. An error among the fields is shown as the console shows errors
|
|
41
|
+
*
|
|
42
|
+
* @beta
|
|
43
|
+
*/
|
|
44
|
+
var consoleSink = (entry) => {
|
|
45
|
+
const { error, ...fields } = entry.fields ?? {};
|
|
46
|
+
const line = logLine({
|
|
47
|
+
...entry,
|
|
48
|
+
fields
|
|
49
|
+
});
|
|
50
|
+
const write = entry.level === "error" ? console.error : entry.level === "warn" ? console.warn : entry.level === "debug" ? console.debug : console.log;
|
|
51
|
+
const thrown = error && typeof error === "object" && "stack" in error ? error.stack : void 0;
|
|
52
|
+
if (thrown) write(line, `\n${thrown}`);
|
|
53
|
+
else write(line);
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* A logger: it takes entries of a level and above and sends them to its sinks and its parent
|
|
57
|
+
*
|
|
58
|
+
* @beta
|
|
59
|
+
*/
|
|
60
|
+
var Logger = class Logger {
|
|
61
|
+
/** The least an entry must matter to be said: what is under it is dropped here, and goes no further */
|
|
62
|
+
level;
|
|
63
|
+
parent;
|
|
64
|
+
context;
|
|
65
|
+
sinks = /* @__PURE__ */ new Set();
|
|
66
|
+
constructor(options = {}) {
|
|
67
|
+
this.parent = options.parent;
|
|
68
|
+
this.level = options.level ?? "debug";
|
|
69
|
+
this.context = options.context;
|
|
70
|
+
}
|
|
71
|
+
/** Sends this logger's entries, and those of every logger under it, to a sink. Returns what stops it */
|
|
72
|
+
to(sink) {
|
|
73
|
+
this.sinks.add(sink);
|
|
74
|
+
return () => this.sinks.delete(sink);
|
|
75
|
+
}
|
|
76
|
+
/** A logger under this one: its entries carry what `context` adds, and are passed up here */
|
|
77
|
+
child(options = {}) {
|
|
78
|
+
return new Logger({
|
|
79
|
+
parent: this,
|
|
80
|
+
...typeof options === "function" ? { context: options } : options
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/** Whether an entry of this level would be said: for not putting together what nobody will read */
|
|
84
|
+
says(level) {
|
|
85
|
+
return LOG_LEVELS.indexOf(level) >= LOG_LEVELS.indexOf(this.level);
|
|
86
|
+
}
|
|
87
|
+
/** Says an entry of the level, the category and the message, with its fields when given; dropped when the logger does not say that level */
|
|
88
|
+
log(level, category, message, fields) {
|
|
89
|
+
if (!this.says(level)) return;
|
|
90
|
+
this.pass({
|
|
91
|
+
level,
|
|
92
|
+
category,
|
|
93
|
+
message,
|
|
94
|
+
...fields && { fields },
|
|
95
|
+
time: Date.now()
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/** Says a `debug` entry */
|
|
99
|
+
debug(category, message, fields) {
|
|
100
|
+
this.log("debug", category, message, fields);
|
|
101
|
+
}
|
|
102
|
+
/** Says an `info` entry */
|
|
103
|
+
info(category, message, fields) {
|
|
104
|
+
this.log("info", category, message, fields);
|
|
105
|
+
}
|
|
106
|
+
/** Says a `warn` entry */
|
|
107
|
+
warn(category, message, fields) {
|
|
108
|
+
this.log("warn", category, message, fields);
|
|
109
|
+
}
|
|
110
|
+
/** Says an `error` entry */
|
|
111
|
+
error(category, message, fields) {
|
|
112
|
+
this.log("error", category, message, fields);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Takes an entry made elsewhere (a world's, by the client that shows it; a server's, sent to a tool) as if it was
|
|
116
|
+
* said here: to this logger's sinks, and up. What it already says of its game and its tick is kept
|
|
117
|
+
*/
|
|
118
|
+
pass(entry) {
|
|
119
|
+
if (!this.says(entry.level)) return;
|
|
120
|
+
const added = this.context?.();
|
|
121
|
+
const full = added ? {
|
|
122
|
+
...entry,
|
|
123
|
+
...entry.game === void 0 && added.game !== void 0 && { game: added.game },
|
|
124
|
+
...entry.tick === void 0 && added.tick !== void 0 && { tick: added.tick },
|
|
125
|
+
...added.fields && { fields: {
|
|
126
|
+
...added.fields,
|
|
127
|
+
...entry.fields
|
|
128
|
+
} }
|
|
129
|
+
} : entry;
|
|
130
|
+
for (const sink of this.sinks) try {
|
|
131
|
+
sink(full);
|
|
132
|
+
} catch {
|
|
133
|
+
this.sinks.delete(sink);
|
|
134
|
+
}
|
|
135
|
+
this.parent?.pass(full);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* The logger everything is under when nothing else is said: a world's, a server's, the client's. It writes to the
|
|
140
|
+
* console (`rootConsole.stop()` ends that, for a page or a server that keeps its log elsewhere), from `info` up
|
|
141
|
+
*
|
|
142
|
+
* @beta
|
|
143
|
+
*/
|
|
144
|
+
var rootLogger = new Logger({ level: "info" });
|
|
145
|
+
/**
|
|
146
|
+
* The root logger's writing to the console: stopped and started again
|
|
147
|
+
*
|
|
148
|
+
* @beta
|
|
149
|
+
*/
|
|
150
|
+
var rootConsole = (() => {
|
|
151
|
+
let stop = rootLogger.to(consoleSink);
|
|
152
|
+
return {
|
|
153
|
+
get on() {
|
|
154
|
+
return stop !== null;
|
|
155
|
+
},
|
|
156
|
+
stop() {
|
|
157
|
+
stop?.();
|
|
158
|
+
stop = null;
|
|
159
|
+
},
|
|
160
|
+
start() {
|
|
161
|
+
stop ??= rootLogger.to(consoleSink);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
})();
|
|
165
|
+
/**
|
|
166
|
+
* Keeps the last `size` entries (500 when left out) of whatever its sink is given
|
|
167
|
+
*
|
|
168
|
+
* @beta
|
|
169
|
+
*/
|
|
170
|
+
function createLogRing(size = 500) {
|
|
171
|
+
let kept = [];
|
|
172
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
173
|
+
return {
|
|
174
|
+
sink(entry) {
|
|
175
|
+
kept.push(entry);
|
|
176
|
+
if (kept.length > size) kept = kept.slice(kept.length - size);
|
|
177
|
+
for (const listener of listeners) listener(entry);
|
|
178
|
+
},
|
|
179
|
+
entries: () => kept,
|
|
180
|
+
clear() {
|
|
181
|
+
kept = [];
|
|
182
|
+
},
|
|
183
|
+
onEntry(listener) {
|
|
184
|
+
listeners.add(listener);
|
|
185
|
+
return () => listeners.delete(listener);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
export { LOG_LEVELS, Logger, consoleSink, createLogRing, errorFields, logLine, rootConsole, rootLogger };
|
|
191
|
+
|
|
192
|
+
//# sourceMappingURL=log.js.map
|
package/dist/log.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.js","names":[],"sources":["../src/log.ts"],"sourcesContent":["/**\n * The log: what the engine, a server, the client and a game say about what they do, as entries of plain data that go\n * to whoever asked for them (a sink). A world has its own (`world.log`), whose entries say which game and which tick\n * they are from; every logger passes its entries up to the one it was made under, so that a sink at the top\n * (`rootLogger.to`, or a server's own) sees all of them.\n *\n * The log says, and nothing else: it reads nothing of the simulation's chances, changes nothing in a world, and is\n * not kept in a save. Two runs of a game are the same whether anyone listens or not.\n */\n\n/**\n * How much an entry matters: `debug` for whoever looks closely, `error` for what went wrong\n *\n * @beta\n */\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error'\n\n/**\n * The levels of log entries from least to most important, in the order `Logger.says` ranks them\n *\n * @beta\n */\nexport const LOG_LEVELS: readonly LogLevel[] = ['debug', 'info', 'warn', 'error']\n\n/**\n * One thing said. Plain data: it crosses a session, a worker and a file as it is\n *\n * @beta\n */\nexport interface LogEntry {\n\t/** How much the entry matters */\n\tlevel: LogLevel\n\t/** What part said it: `server`, `game`, `assets`, a mod's own */\n\tcategory: string\n\t/** What was said, in words */\n\tmessage: string\n\t/** What it is about, by name: an entity's id, a player, a file, an error (`errorFields`) */\n\tfields?: Record<string, unknown>\n\t/** The game it was said in, and its tick, where it was said in one */\n\tgame?: string\n\t/** The tick of the game it was said in, where it was said in a world */\n\ttick?: number\n\t/** When, in milliseconds of the clock (`Date.now`). Never read by the simulation */\n\ttime: number\n}\n\n/**\n * Where entries go: the console, a file, a panel, a service\n *\n * @beta\n */\nexport type LogSink = (entry: LogEntry) => void\n\n/**\n * What a logger adds to each of its entries: the game and the tick of a world, the fields of a part\n *\n * @beta\n */\nexport type LogContext = () => Partial<Pick<LogEntry, 'game' | 'tick'>> & { fields?: Record<string, unknown> }\n\n/**\n * The options a `Logger` is made with\n *\n * @beta\n */\nexport interface LoggerOptions {\n\t/** The logger this one passes its entries up to. None for one that stands alone */\n\tparent?: Logger\n\t/** The least an entry must matter to be said here: everything when left out */\n\tlevel?: LogLevel\n\t/** What the logger adds to each entry it passes on: the game, the tick and the fields */\n\tcontext?: LogContext\n}\n\n/**\n * An error as plain data, for an entry's fields: what it is called, what it says, and where it was thrown\n *\n * @beta\n */\nexport function errorFields(error: unknown): { name: string; message: string; stack?: string } {\n\tif (error instanceof Error) return { name: error.name, message: error.message, ...(error.stack && { stack: error.stack }) }\n\treturn { name: 'Error', message: String(error) }\n}\n\n/**\n * An entry as one line of text: `warn [server] tick 120 of td: a connection took in too slowly {bytes: 12}`\n *\n * @beta\n */\nexport function logLine(entry: LogEntry): string {\n\tconst where = entry.game !== undefined ? ` ${entry.tick !== undefined ? `tick ${entry.tick} of ` : ''}${entry.game}:` : ''\n\tconst fields = entry.fields && Object.keys(entry.fields).length ? ` ${JSON.stringify(entry.fields)}` : ''\n\treturn `${entry.level} [${entry.category}]${where} ${entry.message}${fields}`\n}\n\n/**\n * Writes entries to the console, each by its level. An error among the fields is shown as the console shows errors\n *\n * @beta\n */\nexport const consoleSink: LogSink = (entry) => {\n\tconst { error, ...fields } = entry.fields ?? {}\n\tconst line = logLine({ ...entry, fields })\n\tconst write =\n\t\tentry.level === 'error' ? console.error : entry.level === 'warn' ? console.warn : entry.level === 'debug' ? console.debug : console.log\n\tconst thrown = error && typeof error === 'object' && 'stack' in error ? (error as { stack?: string }).stack : undefined\n\tif (thrown) write(line, `\\n${thrown}`)\n\telse write(line)\n}\n\n/**\n * A logger: it takes entries of a level and above and sends them to its sinks and its parent\n *\n * @beta\n */\nexport class Logger {\n\t/** The least an entry must matter to be said: what is under it is dropped here, and goes no further */\n\tlevel: LogLevel\n\tprivate readonly parent?: Logger\n\tprivate readonly context?: LogContext\n\tprivate readonly sinks = new Set<LogSink>()\n\n\tconstructor(options: LoggerOptions = {}) {\n\t\tthis.parent = options.parent\n\t\tthis.level = options.level ?? 'debug'\n\t\tthis.context = options.context\n\t}\n\n\t/** Sends this logger's entries, and those of every logger under it, to a sink. Returns what stops it */\n\tto(sink: LogSink): () => void {\n\t\tthis.sinks.add(sink)\n\t\treturn () => this.sinks.delete(sink)\n\t}\n\n\t/** A logger under this one: its entries carry what `context` adds, and are passed up here */\n\tchild(options: Omit<LoggerOptions, 'parent'> | LogContext = {}): Logger {\n\t\treturn new Logger({ parent: this, ...(typeof options === 'function' ? { context: options } : options) })\n\t}\n\n\t/** Whether an entry of this level would be said: for not putting together what nobody will read */\n\tsays(level: LogLevel): boolean {\n\t\treturn LOG_LEVELS.indexOf(level) >= LOG_LEVELS.indexOf(this.level)\n\t}\n\n\t/** Says an entry of the level, the category and the message, with its fields when given; dropped when the logger does not say that level */\n\tlog(level: LogLevel, category: string, message: string, fields?: Record<string, unknown>): void {\n\t\tif (!this.says(level)) return\n\t\tthis.pass({ level, category, message, ...(fields && { fields }), time: Date.now() })\n\t}\n\n\t/** Says a `debug` entry */\n\tdebug(category: string, message: string, fields?: Record<string, unknown>): void {\n\t\tthis.log('debug', category, message, fields)\n\t}\n\t/** Says an `info` entry */\n\tinfo(category: string, message: string, fields?: Record<string, unknown>): void {\n\t\tthis.log('info', category, message, fields)\n\t}\n\t/** Says a `warn` entry */\n\twarn(category: string, message: string, fields?: Record<string, unknown>): void {\n\t\tthis.log('warn', category, message, fields)\n\t}\n\t/** Says an `error` entry */\n\terror(category: string, message: string, fields?: Record<string, unknown>): void {\n\t\tthis.log('error', category, message, fields)\n\t}\n\n\t/**\n\t * Takes an entry made elsewhere (a world's, by the client that shows it; a server's, sent to a tool) as if it was\n\t * said here: to this logger's sinks, and up. What it already says of its game and its tick is kept\n\t */\n\tpass(entry: LogEntry): void {\n\t\tif (!this.says(entry.level)) return\n\t\tconst added = this.context?.()\n\t\tconst full: LogEntry = added\n\t\t\t? {\n\t\t\t\t\t...entry,\n\t\t\t\t\t...(entry.game === undefined && added.game !== undefined && { game: added.game }),\n\t\t\t\t\t...(entry.tick === undefined && added.tick !== undefined && { tick: added.tick }),\n\t\t\t\t\t...(added.fields && { fields: { ...added.fields, ...entry.fields } })\n\t\t\t\t}\n\t\t\t: entry\n\t\t// a sink that throws is not a reason for what was being done to stop: the log is never the cause of a failure\n\t\tfor (const sink of this.sinks) {\n\t\t\ttry {\n\t\t\t\tsink(full)\n\t\t\t} catch {\n\t\t\t\tthis.sinks.delete(sink)\n\t\t\t}\n\t\t}\n\t\tthis.parent?.pass(full)\n\t}\n}\n\n/**\n * The logger everything is under when nothing else is said: a world's, a server's, the client's. It writes to the\n * console (`rootConsole.stop()` ends that, for a page or a server that keeps its log elsewhere), from `info` up\n *\n * @beta\n */\nexport const rootLogger = new Logger({ level: 'info' })\n\n/**\n * The root logger's writing to the console: stopped and started again\n *\n * @beta\n */\nexport const rootConsole = (() => {\n\tlet stop: (() => void) | null = rootLogger.to(consoleSink)\n\treturn {\n\t\tget on(): boolean {\n\t\t\treturn stop !== null\n\t\t},\n\t\tstop(): void {\n\t\t\tstop?.()\n\t\t\tstop = null\n\t\t},\n\t\tstart(): void {\n\t\t\tstop ??= rootLogger.to(consoleSink)\n\t\t}\n\t}\n})()\n\n/**\n * The last entries, kept: what a console panel shows, and what goes with a report of a crash\n *\n * @beta\n */\nexport interface LogRing {\n\t/** The sink to give to a logger (`Logger.to`) to have the ring keep what it is sent */\n\tsink: LogSink\n\t/** The entries kept, the oldest first */\n\tentries(): readonly LogEntry[]\n\t/** Empties the ring of the entries it keeps */\n\tclear(): void\n\t/** Calls back for each entry as it comes. Returns what stops it */\n\tonEntry(listener: LogSink): () => void\n}\n\n/**\n * Keeps the last `size` entries (500 when left out) of whatever its sink is given\n *\n * @beta\n */\nexport function createLogRing(size = 500): LogRing {\n\tlet kept: LogEntry[] = []\n\tconst listeners = new Set<LogSink>()\n\treturn {\n\t\tsink(entry) {\n\t\t\tkept.push(entry)\n\t\t\tif (kept.length > size) kept = kept.slice(kept.length - size)\n\t\t\tfor (const listener of listeners) listener(entry)\n\t\t},\n\t\tentries: () => kept,\n\t\tclear() {\n\t\t\tkept = []\n\t\t},\n\t\tonE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KAAA,KAAa,EAAE,MAAM,MAAM,KAAK;GAC/E,GAAI,MAAM,UAAU,EAAE,QAAQ;IAAE,GAAG,MAAM;IAAQ,GAAG,MAAM;GAAO,EAAE;EACpE,IACC;EAEH,KAAK,MAAM,QAAQ,KAAK,OACvB,IAAI;GACH,KAAK,IAAI;EACV,QAAQ;GACP,KAAK,MAAM,OAAO,IAAI;EACvB;EAED,KAAK,QAAQ,KAAK,IAAI;CACvB;AACD;;;;;;;AAQA,IAAa,aAAa,IAAI,OAAO,EAAE,OAAO,OAAO,CAAC;;;;;;AAOtD,IAAa,qBAAqB;CACjC,IAAI,OAA4B,WAAW,GAAG,WAAW;CACzD,OAAO;EACN,IAAI,KAAc;GACjB,OAAO,SAAS;EACjB;EACA,OAAa;GACZ,OAAO;GACP,OAAO;EACR;EACA,QAAc;GACb,SAAS,WAAW,GAAG,WAAW;EACnC;CACD;AACD,EAAA,CAAG;;;;;;AAuBH,SAAgB,cAAc,OAAO,KAAc;CAClD,IAAI,OAAmB,CAAC;CACxB,MAAM,4BAAY,IAAI,IAAa;CACnC,OAAO;EACN,KAAK,OAAO;GACX,KAAK,KAAK,KAAK;GACf,IAAI,KAAK,SAAS,MAAM,OAAO,KAAK,MAAM,KAAK,SAAS,IAAI;GAC5D,KAAK,MAAM,YAAY,WAAW,SAAS,KAAK;EACjD;EACA,eAAe;EACf,QAAQ;GACP,OAAO,CAAC;EACT;EACA,QAAQ,UAAU;GACjB,UAAU,IAAI,QAAQ;GACtB,aAAa,UAAU,OAAO,QAAQ;EACvC;CACD;AACD"}
|
package/dist/manaBurn.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DamageType } from './defs';
|
|
2
2
|
import type { Entity } from './entity';
|
|
3
3
|
import type { GamePack } from './packs/pack';
|
|
4
4
|
import type { World } from './world';
|
|
@@ -36,4 +36,4 @@ export declare function burnMana(world: World, target: Entity, amount: number, s
|
|
|
36
36
|
*
|
|
37
37
|
* @beta
|
|
38
38
|
*/
|
|
39
|
-
export declare function
|
|
39
|
+
export declare function manaBurnPack(): GamePack;
|