@v12-engine/engine 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/dist/abilities/buffs.d.ts +83 -0
- package/dist/abilities/castTold.d.ts +12 -0
- package/dist/abilities/charges.d.ts +28 -0
- package/dist/abilities/dispel.d.ts +9 -0
- package/dist/abilities/effectFields.d.ts +10 -0
- package/dist/abilities/effects/buff.d.ts +8 -0
- package/dist/abilities/effects/core.d.ts +1 -0
- package/dist/abilities/effects/damage.d.ts +1 -0
- package/dist/abilities/effects/heal.d.ts +2 -0
- package/dist/abilities/effects/missile.d.ts +1 -0
- package/dist/abilities/effects/moves.d.ts +11 -0
- package/dist/abilities/effects/passives.d.ts +15 -0
- package/dist/abilities/effects/sight.d.ts +4 -0
- package/dist/abilities/effects/spawn.d.ts +2 -0
- package/dist/abilities/effects/timed.d.ts +4 -0
- package/dist/abilities/effects/trade.d.ts +1 -0
- package/dist/abilities/effects.d.ts +122 -0
- package/dist/abilities/land.d.ts +21 -0
- package/dist/abilities/scaled.d.ts +21 -0
- package/dist/abilities/text.d.ts +113 -0
- package/dist/ai/area.d.ts +53 -0
- package/dist/ai/brain.d.ts +528 -0
- package/dist/ai/budget.d.ts +67 -0
- package/dist/ai/checks.d.ts +115 -0
- package/dist/ai/computer.d.ts +166 -0
- package/dist/ai/defence.d.ts +108 -0
- package/dist/ai/define.d.ts +21 -0
- package/dist/ai/economy.d.ts +129 -0
- package/dist/ai/geometry.d.ts +35 -0
- package/dist/ai/goals.d.ts +360 -0
- package/dist/ai/index.d.ts +38 -0
- package/dist/ai/knowledge.d.ts +418 -0
- package/dist/ai/lanes.d.ts +232 -0
- package/dist/ai/melee/build.d.ts +61 -0
- package/dist/ai/melee/goals.d.ts +299 -0
- package/dist/ai/melee/heroes.d.ts +27 -0
- package/dist/ai/melee/index.d.ts +14 -0
- package/dist/ai/melee/production.d.ts +8 -0
- package/dist/ai/melee/surrender.d.ts +24 -0
- package/dist/ai/micro.d.ts +278 -0
- package/dist/ai/mission.d.ts +195 -0
- package/dist/ai/missionRules.d.ts +18 -0
- package/dist/ai/module.d.ts +116 -0
- package/dist/ai/options.d.ts +61 -0
- package/dist/ai/plans/build.d.ts +280 -0
- package/dist/ai/plans/placement.d.ts +82 -0
- package/dist/ai/plans/plans.d.ts +105 -0
- package/dist/ai/plans/production.d.ts +210 -0
- package/dist/ai/plans/purse.d.ts +73 -0
- package/dist/ai/plans/tech.d.ts +37 -0
- package/dist/ai/profiles.d.ts +204 -0
- package/dist/ai/reach.d.ts +4 -0
- package/dist/ai/report.d.ts +203 -0
- package/dist/ai/roles.d.ts +133 -0
- package/dist/ai/rules.d.ts +288 -0
- package/dist/ai/scouting.d.ts +98 -0
- package/dist/ai/settings.d.ts +73 -0
- package/dist/ai/squads.d.ts +429 -0
- package/dist/ai/strength.d.ts +167 -0
- package/dist/ai/task.d.ts +118 -0
- package/dist/ai/tasks/attack.d.ts +7 -0
- package/dist/ai/tasks/capture.d.ts +21 -0
- package/dist/ai/tasks/creep.d.ts +16 -0
- package/dist/ai/tasks/defend.d.ts +29 -0
- package/dist/ai/tasks/drop.d.ts +34 -0
- package/dist/ai/tasks/escort.d.ts +16 -0
- package/dist/ai/tasks/gather.d.ts +23 -0
- package/dist/ai/tasks/harass.d.ts +7 -0
- package/dist/ai/tasks/hold.d.ts +20 -0
- package/dist/ai/tasks/index.d.ts +32 -0
- package/dist/ai/tasks/move.d.ts +19 -0
- package/dist/ai/tasks/patrol.d.ts +8 -0
- package/dist/ai/tasks/retreat.d.ts +20 -0
- package/dist/ai/tasks/scout.d.ts +29 -0
- package/dist/ai/tasks/shared.d.ts +74 -0
- package/dist/ai/team.d.ts +155 -0
- package/dist/ai/threat.d.ts +91 -0
- package/dist/ai/view.d.ts +366 -0
- package/dist/ai/waves.d.ts +126 -0
- package/dist/ai.js +6239 -0
- package/dist/ai.js.map +1 -0
- package/dist/aiTesting.d.ts +179 -0
- package/dist/areas.d.ts +149 -0
- package/dist/attacks.d.ts +66 -0
- package/dist/attributes.d.ts +66 -0
- package/dist/brain-BvVdUhX8.js +7659 -0
- package/dist/brain-BvVdUhX8.js.map +1 -0
- package/dist/builds-C6LfgvEU.js +460 -0
- package/dist/builds-C6LfgvEU.js.map +1 -0
- package/dist/bytes.d.ts +6 -0
- package/dist/camps.d.ts +95 -0
- package/dist/capture.d.ts +131 -0
- package/dist/cellLayers.d.ts +75 -0
- package/dist/cinematics.d.ts +194 -0
- package/dist/clock.d.ts +32 -0
- package/dist/commands.d.ts +235 -0
- package/dist/components.d.ts +184 -0
- package/dist/computers.d.ts +108 -0
- package/dist/concealment.d.ts +61 -0
- package/dist/coreComponents-syuh2fPG.js +5149 -0
- package/dist/coreComponents-syuh2fPG.js.map +1 -0
- package/dist/coreComponents.d.ts +1 -0
- package/dist/dashing.d.ts +8 -0
- package/dist/debug.d.ts +36 -0
- package/dist/debug.js +3 -0
- package/dist/debugCommands-CzjrSm66.js +14739 -0
- package/dist/debugCommands-CzjrSm66.js.map +1 -0
- package/dist/debugCommands.d.ts +213 -0
- package/dist/debugging.d.ts +10 -0
- package/dist/definitions.d.ts +43 -0
- package/dist/defs.d.ts +1162 -0
- package/dist/denying.d.ts +81 -0
- package/dist/destructibles.d.ts +27 -0
- package/dist/determinism-BCymQwiE.js +518 -0
- package/dist/determinism-BCymQwiE.js.map +1 -0
- package/dist/determinism.d.ts +121 -0
- package/dist/dialog.d.ts +94 -0
- package/dist/effectRefs.d.ts +16 -0
- package/dist/effects.d.ts +80 -0
- package/dist/endings.d.ts +22 -0
- package/dist/engagement.d.ts +108 -0
- package/dist/engineEvents.d.ts +710 -0
- package/dist/entity.d.ts +409 -0
- package/dist/entityIndex.d.ts +50 -0
- package/dist/errors.d.ts +85 -0
- package/dist/events.d.ts +97 -0
- package/dist/exactMath.d.ts +63 -0
- package/dist/features.d.ts +10 -0
- package/dist/fields.d.ts +114 -0
- package/dist/fixture.d.ts +17 -0
- package/dist/fog.d.ts +110 -0
- package/dist/formation.d.ts +111 -0
- package/dist/friendlyFire.d.ts +26 -0
- package/dist/game-DiJEN-Ks.js +5800 -0
- package/dist/game-DiJEN-Ks.js.map +1 -0
- package/dist/game.d.ts +501 -0
- package/dist/gameData.d.ts +325 -0
- package/dist/gameFiles.d.ts +26 -0
- package/dist/gates.d.ts +28 -0
- package/dist/generate.d.ts +403 -0
- package/dist/generateWorker.d.ts +39 -0
- package/dist/grid.d.ts +53 -0
- package/dist/ground.d.ts +127 -0
- package/dist/groundSpeed.d.ts +22 -0
- package/dist/hero.d.ts +177 -0
- package/dist/home.d.ts +14 -0
- package/dist/hooks.d.ts +780 -0
- package/dist/hotReload.d.ts +76 -0
- package/dist/ids.d.ts +26 -0
- package/dist/index.d.ts +227 -0
- package/dist/index.js +4701 -0
- package/dist/index.js.map +1 -0
- package/dist/inspect-D9dWHmZ0.js +491 -0
- package/dist/inspect-D9dWHmZ0.js.map +1 -0
- package/dist/inspect.d.ts +176 -0
- package/dist/inventory.d.ts +18 -0
- package/dist/items.d.ts +91 -0
- package/dist/lanes.d.ts +213 -0
- package/dist/life.d.ts +53 -0
- package/dist/local-Dkovq42k.js +1379 -0
- package/dist/local-Dkovq42k.js.map +1 -0
- package/dist/log.d.ts +140 -0
- package/dist/manaBurn.d.ts +39 -0
- package/dist/map/file.d.ts +114 -0
- package/dist/map/images.d.ts +18 -0
- package/dist/map/look.d.ts +47 -0
- package/dist/map/pathProfile.d.ts +13 -0
- package/dist/map/resize.d.ts +54 -0
- package/dist/map/schema.d.ts +10 -0
- package/dist/map/terrain.d.ts +32 -0
- package/dist/map/types.d.ts +613 -0
- package/dist/map.d.ts +7 -0
- package/dist/mapCheck/cells.d.ts +19 -0
- package/dist/mapCheck/rule.d.ts +30 -0
- package/dist/mapCheck/rules/names.d.ts +3 -0
- package/dist/mapCheck/rules/objects.d.ts +3 -0
- package/dist/mapCheck/rules/paths.d.ts +3 -0
- package/dist/mapCheck/rules/players.d.ts +3 -0
- package/dist/mapCheck/rules/races.d.ts +3 -0
- package/dist/mapCheck/rules/random.d.ts +3 -0
- package/dist/mapCheck/rules/regions.d.ts +3 -0
- package/dist/mapCheck/rules/targets.d.ts +3 -0
- package/dist/mapCheck/rules/walking.d.ts +3 -0
- package/dist/mapCheck.d.ts +23 -0
- package/dist/mapFields.d.ts +364 -0
- package/dist/mapFile.d.ts +23 -0
- package/dist/mapMeasure.d.ts +95 -0
- package/dist/mapMerge.d.ts +19 -0
- package/dist/mapObjectives.d.ts +82 -0
- package/dist/mapObjects.d.ts +1 -0
- package/dist/math.d.ts +44 -0
- package/dist/messages.d.ts +150 -0
- package/dist/missionRules-C-bGxm0Q.js +523 -0
- package/dist/missionRules-C-bGxm0Q.js.map +1 -0
- package/dist/missionRules.d.ts +179 -0
- package/dist/mods.d.ts +146 -0
- package/dist/names.d.ts +93 -0
- package/dist/navigation/agentParams.d.ts +4 -0
- package/dist/navigation/air.d.ts +89 -0
- package/dist/navigation/builds.d.ts +140 -0
- package/dist/navigation/groundAreas.d.ts +23 -0
- package/dist/navigation/navigation.d.ts +127 -0
- package/dist/navigation/recast.d.ts +214 -0
- package/dist/navigation/sidePaths.d.ts +69 -0
- package/dist/navigation/sized.d.ts +1 -0
- package/dist/navigation-worker.js +11 -0
- package/dist/navigation-worker.js.map +1 -0
- package/dist/nearest.d.ts +8 -0
- package/dist/noise.d.ts +12 -0
- package/dist/objectives.d.ts +93 -0
- package/dist/orders/basic.d.ts +96 -0
- package/dist/orders/build.d.ts +91 -0
- package/dist/orders/cast.d.ts +105 -0
- package/dist/orders/facts.d.ts +14 -0
- package/dist/orders/harvest.d.ts +94 -0
- package/dist/orders/idle.d.ts +7 -0
- package/dist/orders/items.d.ts +14 -0
- package/dist/orders/queue.d.ts +24 -0
- package/dist/pack.schema.json +6621 -0
- package/dist/packs/director/index.d.ts +81 -0
- package/dist/packs/heroes/campaign.d.ts +137 -0
- package/dist/packs/heroes/carry.d.ts +59 -0
- package/dist/packs/heroes/commands.d.ts +6 -0
- package/dist/packs/heroes/hire.d.ts +9 -0
- package/dist/packs/heroes/index.d.ts +12 -0
- package/dist/packs/heroes/making.d.ts +16 -0
- package/dist/packs/heroes/respawn.d.ts +42 -0
- package/dist/packs/moba/index.d.ts +34 -0
- package/dist/packs/pack.d.ts +84 -0
- package/dist/packs-g5thvmGn.js +3199 -0
- package/dist/packs-g5thvmGn.js.map +1 -0
- package/dist/packs.d.ts +84 -0
- package/dist/paths.d.ts +51 -0
- package/dist/plain.d.ts +17 -0
- package/dist/player.d.ts +117 -0
- package/dist/portals.d.ts +66 -0
- package/dist/prefabs.d.ts +139 -0
- package/dist/presetBuildings.d.ts +52 -0
- package/dist/presetGround.d.ts +22 -0
- package/dist/profiles-B3NS9jwk.js +335 -0
- package/dist/profiles-B3NS9jwk.js.map +1 -0
- package/dist/races.d.ts +136 -0
- package/dist/randomGroups.d.ts +2 -0
- package/dist/registry.d.ts +464 -0
- package/dist/remains.d.ts +119 -0
- package/dist/replication.d.ts +103 -0
- package/dist/rng.d.ts +17 -0
- package/dist/rules.d.ts +395 -0
- package/dist/rulesCheck.d.ts +37 -0
- package/dist/runes.d.ts +41 -0
- package/dist/save.d.ts +277 -0
- package/dist/scenario.d.ts +56 -0
- package/dist/scheduler.d.ts +67 -0
- package/dist/score.d.ts +306 -0
- package/dist/sequences.d.ts +132 -0
- package/dist/server/doorman.d.ts +21 -0
- package/dist/server/gameServer.d.ts +346 -0
- package/dist/server/index.d.ts +24 -0
- package/dist/server/lobby.d.ts +1 -0
- package/dist/server/log.d.ts +13 -0
- package/dist/server/match.d.ts +24 -0
- package/dist/server/mode.d.ts +168 -0
- package/dist/server/navigation-worker.d.ts +1 -0
- package/dist/server/navigation.d.ts +11 -0
- package/dist/server/ops.d.ts +78 -0
- package/dist/server/packs.d.ts +15 -0
- package/dist/server/ratings.d.ts +62 -0
- package/dist/server/relay.d.ts +34 -0
- package/dist/server/rooms.d.ts +162 -0
- package/dist/server/seat.d.ts +2 -0
- package/dist/server/seatSettings.d.ts +15 -0
- package/dist/server/secret.d.ts +5 -0
- package/dist/server/start.d.ts +54 -0
- package/dist/server/websocket.d.ts +74 -0
- package/dist/server.js +2861 -0
- package/dist/server.js.map +1 -0
- package/dist/session/can.d.ts +20 -0
- package/dist/session/commandReplay.d.ts +92 -0
- package/dist/session/debug.d.ts +65 -0
- package/dist/session/delay.d.ts +15 -0
- package/dist/session/delta.d.ts +98 -0
- package/dist/session/entityState.d.ts +1 -0
- package/dist/session/local.d.ts +214 -0
- package/dist/session/memory.d.ts +27 -0
- package/dist/session/protocol.d.ts +1155 -0
- package/dist/session/remote.d.ts +530 -0
- package/dist/session/replay.d.ts +114 -0
- package/dist/session/seed.d.ts +7 -0
- package/dist/session/share.d.ts +78 -0
- package/dist/session/socket.d.ts +8 -0
- package/dist/session/wire.d.ts +153 -0
- package/dist/session/worker.d.ts +227 -0
- package/dist/shared.d.ts +171 -0
- package/dist/sides.d.ts +75 -0
- package/dist/sight.d.ts +27 -0
- package/dist/simulate-oXBiw1Ff.js +167 -0
- package/dist/simulate-oXBiw1Ff.js.map +1 -0
- package/dist/simulate-worker.d.ts +1 -0
- package/dist/simulate-worker.js +28 -0
- package/dist/simulate-worker.js.map +1 -0
- package/dist/simulate.d.ts +154 -0
- package/dist/smart.d.ts +9 -0
- package/dist/spatial.d.ts +62 -0
- package/dist/spawning.d.ts +33 -0
- package/dist/stances.d.ts +76 -0
- package/dist/start.d.ts +71 -0
- package/dist/stats.d.ts +122 -0
- package/dist/summons.d.ts +63 -0
- package/dist/systems/abilities.d.ts +3 -0
- package/dist/systems/combat.d.ts +71 -0
- package/dist/systems/combatTold.d.ts +14 -0
- package/dist/systems/construction.d.ts +34 -0
- package/dist/systems/economy.d.ts +21 -0
- package/dist/systems/fog.d.ts +19 -0
- package/dist/systems/life.d.ts +3 -0
- package/dist/systems/movement.d.ts +105 -0
- package/dist/systems/orders.d.ts +7 -0
- package/dist/systems/production.d.ts +49 -0
- package/dist/systems/productionQueue.d.ts +40 -0
- package/dist/systems/victory.d.ts +14 -0
- package/dist/talk.d.ts +65 -0
- package/dist/tech.d.ts +62 -0
- package/dist/techTree.d.ts +38 -0
- package/dist/terrain.d.ts +173 -0
- package/dist/terrainSave.d.ts +29 -0
- package/dist/testing.d.ts +58 -0
- package/dist/testing.js +822 -0
- package/dist/testing.js.map +1 -0
- package/dist/tiles.d.ts +34 -0
- package/dist/timers.d.ts +146 -0
- package/dist/tomes.d.ts +48 -0
- package/dist/trade.d.ts +28 -0
- package/dist/transport.d.ts +76 -0
- package/dist/tunables.d.ts +45 -0
- package/dist/upkeep.d.ts +16 -0
- package/dist/veterancy.d.ts +80 -0
- package/dist/walls.d.ts +86 -0
- package/dist/world.d.ts +1118 -0
- package/package.json +80 -5
- package/README.md +0 -3
package/dist/packs.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { AbilityDef, BuffDef, ItemDef, UnitTypeDef, UpgradeDef } from './defs';
|
|
2
|
+
import { type GameData } from './gameData';
|
|
3
|
+
import type { GameModule } from './game';
|
|
4
|
+
import type { ModDef } from './mods';
|
|
5
|
+
import type { RaceDef } from './races';
|
|
6
|
+
import type { RulesInit } from './rules';
|
|
7
|
+
/**
|
|
8
|
+
* A pack of content as its file has it (`packs/<id>/pack.json`): plain data, checked against the pack's schema
|
|
9
|
+
* (`@v12-engine/engine/schemas/pack.schema.json`) as it is read. Its definitions are added to the game's, or put in the place of those of the same id;
|
|
10
|
+
* then its `data` is laid over the whole as a `data.json` is (`withData`), and its `rules` over the game's
|
|
11
|
+
*
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
export interface PackFile {
|
|
15
|
+
/** Letters, digits, dots and dashes: what the game composed of it is called by (`melee+<id>`) */
|
|
16
|
+
id: string;
|
|
17
|
+
/** `major.minor.patch` */
|
|
18
|
+
version: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
/** The game and the packs or mods it is made for, as a mod's (`ModDef.requires`) */
|
|
21
|
+
requires?: string[];
|
|
22
|
+
units?: UnitTypeDef[];
|
|
23
|
+
abilities?: AbilityDef[];
|
|
24
|
+
buffs?: BuffDef[];
|
|
25
|
+
items?: ItemDef[];
|
|
26
|
+
upgrades?: UpgradeDef[];
|
|
27
|
+
races?: RaceDef[];
|
|
28
|
+
/** The rules it changes, as data (`GameBuilder.rules`) */
|
|
29
|
+
rules?: RulesInit;
|
|
30
|
+
/** Values over the definitions, as a `data.json` has them (`GameData`): the editor's Data panel writes here for a pack */
|
|
31
|
+
data?: GameData;
|
|
32
|
+
/** What its units look like, as a `looks.json` has them: the client's to lay over the game's view */
|
|
33
|
+
looks?: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A mod made of a pack (`packFromJson`): the mod, and the pack's file it was made of
|
|
37
|
+
*
|
|
38
|
+
* @beta
|
|
39
|
+
*/
|
|
40
|
+
export interface PackMod extends ModDef {
|
|
41
|
+
readonly pack: PackFile;
|
|
42
|
+
/** The hash of the pack's bytes as they were read: kept with the game's mods, so the game's hash has it */
|
|
43
|
+
readonly hash: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Why a pack's file is not one, where it is first wrong
|
|
47
|
+
*
|
|
48
|
+
* @beta
|
|
49
|
+
*/
|
|
50
|
+
export declare class PackError extends Error {
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Checks a pack's file as it is read (the schema's rules a loader needs: the pack's schema has all of them):
|
|
54
|
+
* its id and version, and that each list is of definitions with an id, once each. Throws `PackError` saying where
|
|
55
|
+
*
|
|
56
|
+
* @beta
|
|
57
|
+
*/
|
|
58
|
+
export declare function checkPack(json: unknown, where?: string): PackFile;
|
|
59
|
+
/**
|
|
60
|
+
* Checks a pack's file against the pack's schema (`@v12-engine/engine/schemas/pack.schema.json`, made of `PackFile`):
|
|
61
|
+
* where it is first wrong, in words with its place (`units[2].stats.health: is a string, not a number`), or nothing
|
|
62
|
+
* for one that is right. A small reader of the schema, as far as it uses JSON Schema: what a page that loads packs
|
|
63
|
+
* fetches with them, so that a game without packs carries none of it
|
|
64
|
+
*
|
|
65
|
+
* @beta
|
|
66
|
+
*/
|
|
67
|
+
export declare function checkPackSchema(json: unknown, schema: object): string | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Makes a mod of a pack's file (its text, or what was parsed of it): checked, then applying its definitions (each
|
|
70
|
+
* list in the order of its ids, a definition the game has put in its place), its `data` over the whole and its
|
|
71
|
+
* `rules`. Its hash, of the text as given, goes with the game's mods
|
|
72
|
+
*
|
|
73
|
+
* @beta
|
|
74
|
+
*/
|
|
75
|
+
export declare function packFromJson(json: string | unknown, where?: string): PackMod;
|
|
76
|
+
/**
|
|
77
|
+
* Whether a game was made with packs, and which: those of the mods its composition kept a hash of, by id and version
|
|
78
|
+
*
|
|
79
|
+
* @beta
|
|
80
|
+
*/
|
|
81
|
+
export declare const packsOf: (game: Pick<GameModule, 'mods'>) => {
|
|
82
|
+
id: string;
|
|
83
|
+
version: string;
|
|
84
|
+
}[];
|
package/dist/paths.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type Vec2 } from './math';
|
|
2
|
+
/**
|
|
3
|
+
* A spot, and the way it faces: where a wave comes in, where a hero stands, where a camera looks from
|
|
4
|
+
*
|
|
5
|
+
* @beta
|
|
6
|
+
*/
|
|
7
|
+
export interface Spot extends Vec2 {
|
|
8
|
+
/** Radians, the way entities face: 0 is along +z */
|
|
9
|
+
facing: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A line on the map, through points in order, with a width: a road, a patrol route, the way a wave walks. What the
|
|
13
|
+
* rules ask of one a game would otherwise write each time: how long it is, where along it something is, how far a
|
|
14
|
+
* point is from it, whether a point is on it
|
|
15
|
+
*
|
|
16
|
+
* @beta
|
|
17
|
+
*/
|
|
18
|
+
export declare class Path {
|
|
19
|
+
/** Its points, in order. Not to be changed: the path works out its length from them once */
|
|
20
|
+
readonly points: readonly Vec2[];
|
|
21
|
+
/** How wide it is: a point is on it when it is no more than half of this from its middle */
|
|
22
|
+
readonly width: number;
|
|
23
|
+
/** How far along the path each of its points is */
|
|
24
|
+
private readonly along;
|
|
25
|
+
constructor(
|
|
26
|
+
/** Its points, in order. Not to be changed: the path works out its length from them once */
|
|
27
|
+
points: readonly Vec2[],
|
|
28
|
+
/** How wide it is: a point is on it when it is no more than half of this from its middle */
|
|
29
|
+
width: number);
|
|
30
|
+
/** How long it is, from its first point to its last */
|
|
31
|
+
get length(): number;
|
|
32
|
+
get start(): Vec2;
|
|
33
|
+
get end(): Vec2;
|
|
34
|
+
/**
|
|
35
|
+
* Where on the path something is that has gone `distance` along it from its start, facing the way it goes. Before
|
|
36
|
+
* the start is the start, past the end the end
|
|
37
|
+
*/
|
|
38
|
+
at(distance: number): Spot;
|
|
39
|
+
/** The nearest point of its middle line to a point, and how far along the path that is */
|
|
40
|
+
nearest(point: Vec2): {
|
|
41
|
+
at: Vec2;
|
|
42
|
+
distance: number;
|
|
43
|
+
along: number;
|
|
44
|
+
};
|
|
45
|
+
/** How far a point is from the middle of the path */
|
|
46
|
+
distanceTo(point: Vec2): number;
|
|
47
|
+
/** Whether a point is on the path: no more than half its width from its middle */
|
|
48
|
+
contains(point: Vec2): boolean;
|
|
49
|
+
/** Whether the middle of a cell of the map is on the path: what it paints, and keeps clear */
|
|
50
|
+
containsCell(cx: number, cz: number): boolean;
|
|
51
|
+
}
|
package/dist/plain.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A copy of a value that is plain data all the way down: numbers, text, lists and plain objects, which is what a
|
|
3
|
+
* file and a wire can carry. Throws when something in it is not (a `Map`, a class, a function), saying where:
|
|
4
|
+
* `what` is whose data it is ("Save", "Map"), `where` the path so far, `advice` what to do about it
|
|
5
|
+
*
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export declare function plain(value: unknown, where: string, what: string, advice?: string): unknown;
|
|
9
|
+
/**
|
|
10
|
+
* The plain data of a value, and the paths of what was left out of it for not being plain (`settings.economy.workersPer`):
|
|
11
|
+
* a plain object's fields each kept or left out, a list as a whole. For what keeps the data of something that may hold
|
|
12
|
+
* code beside it (a computer player's options)
|
|
13
|
+
*/
|
|
14
|
+
export declare function plainParts(value: unknown, where?: string): {
|
|
15
|
+
kept: unknown;
|
|
16
|
+
dropped: string[];
|
|
17
|
+
};
|
package/dist/player.d.ts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { type Component, StateStore } from './components';
|
|
2
|
+
import type { Registry } from './registry';
|
|
3
|
+
import type { Cost, ResourceKind } from './defs';
|
|
4
|
+
import type { PlayerId } from './entity';
|
|
5
|
+
import type { World } from './world';
|
|
6
|
+
/** @beta */
|
|
7
|
+
export interface PlayerInit {
|
|
8
|
+
id: PlayerId;
|
|
9
|
+
name: string;
|
|
10
|
+
/** Players on the same team are allies and share vision */
|
|
11
|
+
team: number;
|
|
12
|
+
/** RGB, 0..1 */
|
|
13
|
+
color: [number, number, number];
|
|
14
|
+
/** What the player starts with, by resource id */
|
|
15
|
+
resources?: Purse;
|
|
16
|
+
/** Neutral players own things like gold mines. Nobody is hostile towards them */
|
|
17
|
+
neutral?: boolean;
|
|
18
|
+
/** The player the creeps belong to: hostile to everyone, and not someone who can win or lose */
|
|
19
|
+
creeps?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The race they play (`GameModule.races`), or `random` for one drawn as the game starts. The game's first when left
|
|
22
|
+
* out, in a game with races; none for the neutral players and the creeps
|
|
23
|
+
*/
|
|
24
|
+
race?: string;
|
|
25
|
+
}
|
|
26
|
+
/** @beta */
|
|
27
|
+
export declare class Player {
|
|
28
|
+
readonly id: PlayerId;
|
|
29
|
+
readonly name: string;
|
|
30
|
+
/** Changed by `world.setTeam`, which the fog and everyone's sight follow */
|
|
31
|
+
team: number;
|
|
32
|
+
readonly color: [number, number, number];
|
|
33
|
+
readonly neutral: boolean;
|
|
34
|
+
readonly creeps: boolean;
|
|
35
|
+
/** The race they play (`raceOf`): changed by `setRace` only. None in a game without races */
|
|
36
|
+
race: string | undefined;
|
|
37
|
+
/** What the player has of each resource, by resource id */
|
|
38
|
+
readonly resources: Purse;
|
|
39
|
+
supplyUsed: number;
|
|
40
|
+
supplyCap: number;
|
|
41
|
+
/** The game's other pools of supply, by name (`GameRules.supply.pools`): what is used and the cap of each */
|
|
42
|
+
supplies: Record<string, {
|
|
43
|
+
used: number;
|
|
44
|
+
cap: number;
|
|
45
|
+
}>;
|
|
46
|
+
/** Has had a building, and with that something to lose */
|
|
47
|
+
established: boolean;
|
|
48
|
+
/** Out of the game */
|
|
49
|
+
defeated: boolean;
|
|
50
|
+
private readonly finished;
|
|
51
|
+
/** Bumped whenever a research finishes. Whatever is worked out from `upgrades` (like the stats of units) can check this to tell whether it still holds */
|
|
52
|
+
upgradesVersion: number;
|
|
53
|
+
/** Upgrades in some production queue right now */
|
|
54
|
+
readonly researching: Set<string>;
|
|
55
|
+
/** State of game modules and mods for this player, see `state` */
|
|
56
|
+
readonly states: StateStore;
|
|
57
|
+
constructor(init: PlayerInit);
|
|
58
|
+
/** Finished research: upgrade id to level. Changed through `setUpgrade` only, which keeps `upgradesVersion` honest */
|
|
59
|
+
get upgrades(): ReadonlyMap<string, number>;
|
|
60
|
+
/** State of a game module or a mod for this player: made from the component's default when first asked for */
|
|
61
|
+
state<T>(key: Component<T, unknown>): T;
|
|
62
|
+
setState<T>(key: Component<T, unknown>, value: T): void;
|
|
63
|
+
setUpgrade(upgrade: string, level: number): void;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Amounts of resources, by resource id: what a player has. A resource left out is none of it
|
|
67
|
+
*
|
|
68
|
+
* @beta
|
|
69
|
+
*/
|
|
70
|
+
export type Purse = Record<ResourceKind, number>;
|
|
71
|
+
/**
|
|
72
|
+
* The resource a purse is short of for a cost, or undefined when it can afford it
|
|
73
|
+
*
|
|
74
|
+
* @beta
|
|
75
|
+
*/
|
|
76
|
+
export declare function shortOf(purse: Readonly<Purse>, cost: Cost | undefined): ResourceKind | undefined;
|
|
77
|
+
/** @beta */
|
|
78
|
+
export declare function pay(purse: Purse, cost: Cost | undefined): void;
|
|
79
|
+
/**
|
|
80
|
+
* Gives back what something cost, or a part of it
|
|
81
|
+
*
|
|
82
|
+
* @beta
|
|
83
|
+
*/
|
|
84
|
+
export declare function refund(purse: Purse, cost: Cost | undefined, part?: number): void;
|
|
85
|
+
/**
|
|
86
|
+
* Adds an amount of a resource
|
|
87
|
+
*
|
|
88
|
+
* @beta
|
|
89
|
+
*/
|
|
90
|
+
export declare function earn(purse: Purse, kind: ResourceKind, amount: number): void;
|
|
91
|
+
/**
|
|
92
|
+
* What a player pays for, as `resourcesSpent` says it: a unit, an upgrade, a structure, a morph, a revive (production),
|
|
93
|
+
* an item, a hire, a repair, a trade at a market (`exchange`), or a game's own word
|
|
94
|
+
*
|
|
95
|
+
* @beta
|
|
96
|
+
*/
|
|
97
|
+
export type SpentOn = 'unit' | 'upgrade' | 'structure' | 'morph' | 'revive' | 'item' | 'hire' | 'repair' | 'trade' | (string & {});
|
|
98
|
+
/**
|
|
99
|
+
* Has a player pay a cost, and says so (`resourcesSpent`, what the score counts as spent): `on` what, and its id. For a
|
|
100
|
+
* game's own purchases too, so that they count as the engine's do. The purse is not checked: `shortOf` first
|
|
101
|
+
*
|
|
102
|
+
* @beta
|
|
103
|
+
*/
|
|
104
|
+
export declare function spend(world: World, player: PlayerId, cost: Cost | undefined, on: SpentOn, id?: string): void;
|
|
105
|
+
/**
|
|
106
|
+
* Gives a player back what something cost, or a part of it (`refund`), and says so (`resourcesSpent` with `refund`):
|
|
107
|
+
* what the score takes off what was spent
|
|
108
|
+
*
|
|
109
|
+
* @beta
|
|
110
|
+
*/
|
|
111
|
+
export declare function giveBack(world: World, player: PlayerId, cost: Cost | undefined, part: number, on: SpentOn, id?: string): void;
|
|
112
|
+
/**
|
|
113
|
+
* What a cost asks of the game's money, see `Registry.currency`. Shops deal in that alone
|
|
114
|
+
*
|
|
115
|
+
* @beta
|
|
116
|
+
*/
|
|
117
|
+
export declare function currencyOf(registry: Registry, cost: Cost | undefined): number;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type Entity } from './entity';
|
|
2
|
+
import { type Vec2 } from './math';
|
|
3
|
+
import type { GamePack } from './packs/pack';
|
|
4
|
+
import type { World } from './world';
|
|
5
|
+
/**
|
|
6
|
+
* The portals pack's id
|
|
7
|
+
*
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export declare const PORTALS = "core.portals";
|
|
11
|
+
/**
|
|
12
|
+
* Where a waygate leads: a point of the map by its name (as the editor's field keeps it), or a place. A waygate without
|
|
13
|
+
* it, or with `null`, is shut
|
|
14
|
+
*
|
|
15
|
+
* @beta
|
|
16
|
+
*/
|
|
17
|
+
export declare const waygate: import("./components").Component<string | Vec2 | null, string | Vec2 | null>;
|
|
18
|
+
/**
|
|
19
|
+
* A unit went through a waygate, or a town portal: told to everyone who sees either end, for a sound and a flash
|
|
20
|
+
*
|
|
21
|
+
* @beta
|
|
22
|
+
*/
|
|
23
|
+
export declare const portalUsed: import("./events").EventKey<{
|
|
24
|
+
entity: number;
|
|
25
|
+
from: Vec2;
|
|
26
|
+
to: Vec2;
|
|
27
|
+
gate?: number;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Where a waygate leads, or nothing for one that is shut or leads to a point the map does not have
|
|
31
|
+
*
|
|
32
|
+
* @beta
|
|
33
|
+
*/
|
|
34
|
+
export declare function waygateTarget(world: World, gate: Entity): Vec2 | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Says where a waygate leads (a point of the map by its name, or a place), or shuts it (`null`): what the editor's
|
|
37
|
+
* "Leads to" field says of a placed one, in code. Any building can be made a waygate so
|
|
38
|
+
*
|
|
39
|
+
* @beta
|
|
40
|
+
*/
|
|
41
|
+
export declare function setWaygate(gate: Entity, to: string | Vec2 | null): void;
|
|
42
|
+
/**
|
|
43
|
+
* Puts a unit somewhere at once, on the nearest ground it can stand on: what a waygate and a town portal do, for a game's
|
|
44
|
+
* own rules. Told to everyone (`portalUsed`)
|
|
45
|
+
*
|
|
46
|
+
* @beta
|
|
47
|
+
*/
|
|
48
|
+
export declare function portal(world: World, entity: Entity, to: Vec2, gate?: Entity): void;
|
|
49
|
+
/**
|
|
50
|
+
* Takes a unit and as many as `count` of its owner's units within `radius` of it, nearest first, to its side's home
|
|
51
|
+
* nearest `near` (`homeOf`), spread around it: what the `townPortal` effect does, in code. Gives back who went, none
|
|
52
|
+
* when the side has no home
|
|
53
|
+
*
|
|
54
|
+
* @beta
|
|
55
|
+
*/
|
|
56
|
+
export declare function townPortal(world: World, caster: Entity, near: Vec2, radius?: number, count?: number): Entity[];
|
|
57
|
+
/**
|
|
58
|
+
* Portals, as in classic RTS games: waygates (`UnitTypeDef.waygate`), which a unit told to (a right-click, as any building is
|
|
59
|
+
* walked up to) walks into and comes out of where the gate leads (the "Leads to" field of a placed one, a point of the
|
|
60
|
+
* map; `setWaygate` in code), and the `townPortal` effect (`EffectTypes.townPortal`), which takes the caster and its
|
|
61
|
+
* units around it to its side's home nearest where it was aimed (`homeOf`: the map's `home.<team>` point, or the
|
|
62
|
+
* nearest of its buildings). `portal` and `townPortal` do them in code
|
|
63
|
+
*
|
|
64
|
+
* @beta
|
|
65
|
+
*/
|
|
66
|
+
export declare function withPortals(): GamePack;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { type Camp } from './camps';
|
|
2
|
+
import { type AreaShape } from './areas';
|
|
3
|
+
import type { Entity, PlayerId } from './entity';
|
|
4
|
+
import { type Vec2 } from './math';
|
|
5
|
+
import type { World } from './world';
|
|
6
|
+
/** A unit or a building of a prefab, where it stands around the prefab's middle *
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export interface PrefabObject {
|
|
10
|
+
type: string;
|
|
11
|
+
/**
|
|
12
|
+
* Whose: the player the prefab is spawned for (`'owner'`, the default), neutral, the creeps, or a player of the
|
|
13
|
+
* map's by id (a file's objects say the id they had; one that is a player's becomes `'owner'` as the file is read)
|
|
14
|
+
*/
|
|
15
|
+
owner?: 'owner' | 'neutral' | 'creeps' | PlayerId;
|
|
16
|
+
x: number;
|
|
17
|
+
z: number;
|
|
18
|
+
/** Radians, the way entities face */
|
|
19
|
+
facing?: number;
|
|
20
|
+
scale?: number;
|
|
21
|
+
look?: string;
|
|
22
|
+
/** A name of its own, for the rules to find it by: made free where it is taken (a number added) */
|
|
23
|
+
name?: string;
|
|
24
|
+
/** 0..1 of its health, less than whole */
|
|
25
|
+
health?: number;
|
|
26
|
+
/** Structures: as a construction site */
|
|
27
|
+
underConstruction?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** A camp of creeps of a prefab *
|
|
30
|
+
* @beta
|
|
31
|
+
*/
|
|
32
|
+
export interface PrefabCamp {
|
|
33
|
+
x: number;
|
|
34
|
+
z: number;
|
|
35
|
+
units: string[];
|
|
36
|
+
name?: string;
|
|
37
|
+
}
|
|
38
|
+
/** An area the rules watch, of a prefab: its id gets the spawn's own suffix, so that two of one prefab are two areas *
|
|
39
|
+
* @beta
|
|
40
|
+
*/
|
|
41
|
+
export interface PrefabArea {
|
|
42
|
+
id: string;
|
|
43
|
+
shape: AreaShape;
|
|
44
|
+
}
|
|
45
|
+
/** A prefab inside a prefab: spawned with it, its middle where it says from the outer one's, turned and sized with it *
|
|
46
|
+
* @beta
|
|
47
|
+
*/
|
|
48
|
+
export interface PrefabInside {
|
|
49
|
+
/** The prefab's id */
|
|
50
|
+
prefab: string;
|
|
51
|
+
x: number;
|
|
52
|
+
z: number;
|
|
53
|
+
/** Radians, the way facings turn: on top of the outer prefab's turn */
|
|
54
|
+
facing?: number;
|
|
55
|
+
scale?: number;
|
|
56
|
+
}
|
|
57
|
+
/** What a prefab is made of, around its middle (0, 0) *
|
|
58
|
+
* @beta
|
|
59
|
+
*/
|
|
60
|
+
export interface PrefabContents {
|
|
61
|
+
objects?: PrefabObject[];
|
|
62
|
+
camps?: PrefabCamp[];
|
|
63
|
+
areas?: PrefabArea[];
|
|
64
|
+
/** Prefabs inside it, spawned with it (a prefab that holds itself, at any depth, is not spawned past the first) */
|
|
65
|
+
prefabs?: PrefabInside[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A prefab of a game's own: what `world.spawnPrefab` puts down as one. Its contents as data, or made for the place
|
|
69
|
+
* and the world (a camp the stronger the farther from the starts)
|
|
70
|
+
*
|
|
71
|
+
* @beta
|
|
72
|
+
*/
|
|
73
|
+
export interface PrefabDef {
|
|
74
|
+
/** Shared by every game: give it a prefix of the game's (`'td.fortress'`) */
|
|
75
|
+
id: string;
|
|
76
|
+
name?: string;
|
|
77
|
+
contents: PrefabContents | ((at: Vec2, world: World) => PrefabContents);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Typed help for writing a prefab
|
|
81
|
+
*
|
|
82
|
+
* @beta
|
|
83
|
+
*/
|
|
84
|
+
export declare const definePrefab: (def: PrefabDef) => PrefabDef;
|
|
85
|
+
/** How a prefab is spawned: where its middle goes, for whom, turned and sized *
|
|
86
|
+
* @beta
|
|
87
|
+
*/
|
|
88
|
+
export interface SpawnPrefabOptions {
|
|
89
|
+
at: Vec2;
|
|
90
|
+
/** The player the prefab's `'owner'` objects are spawned for: neutral when left out */
|
|
91
|
+
owner?: PlayerId;
|
|
92
|
+
/** Radians, the way facings turn: the prefab turned around its middle */
|
|
93
|
+
facing?: number;
|
|
94
|
+
scale?: number;
|
|
95
|
+
/** Parts left out, by their index in the prefab's lists: a gate without its towers */
|
|
96
|
+
without?: {
|
|
97
|
+
objects?: number[];
|
|
98
|
+
camps?: number[];
|
|
99
|
+
areas?: number[];
|
|
100
|
+
prefabs?: number[];
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/** What a prefab spawned became *
|
|
104
|
+
* @beta
|
|
105
|
+
*/
|
|
106
|
+
export interface SpawnedPrefab {
|
|
107
|
+
entities: Entity[];
|
|
108
|
+
camps: Camp[];
|
|
109
|
+
/** The ids of the areas added */
|
|
110
|
+
areas: string[];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A prefab put down in the world as one: its objects spawned (`world.spawn`, for the owner given or as each says),
|
|
114
|
+
* its camps (`spawnCamp`: a world with camps seats the creeps, `PlayerInit.creeps`), its areas added under ids of
|
|
115
|
+
* their own; turned and sized around its middle as asked
|
|
116
|
+
*
|
|
117
|
+
* @beta
|
|
118
|
+
*/
|
|
119
|
+
export declare function spawnPrefab(world: World, prefab: PrefabDef | string, options: SpawnPrefabOptions): SpawnedPrefab;
|
|
120
|
+
/**
|
|
121
|
+
* The id a part of a prefab inside another has in the outer one's copy, as the editor and `prefabsFrom` number it:
|
|
122
|
+
* made from the inner prefab's id there and the part's id in it (itself one of these, a level down), the same each
|
|
123
|
+
* time it is read; below zero, where a prefab's own parts (the map's ids they had) never are
|
|
124
|
+
*
|
|
125
|
+
* @beta
|
|
126
|
+
*/
|
|
127
|
+
export declare function nestedPartId(nested: number, id: number): number;
|
|
128
|
+
/**
|
|
129
|
+
* The prefabs a designer made in the editor (`prefabs/<name>.prefab.json` of the game's folder), as prefabs of the
|
|
130
|
+
* game's, by their file names: `prefabsFrom(import.meta.glob('./prefabs/*.prefab.json', { eager: true }))`, or any
|
|
131
|
+
* record of name to file. An object of a player's becomes the owner's; scenery, points and paths are left out. A
|
|
132
|
+
* variant is read through its source and a prefab with prefabs inside through those, as the editor places them, from
|
|
133
|
+
* the files given
|
|
134
|
+
*
|
|
135
|
+
* @beta
|
|
136
|
+
*/
|
|
137
|
+
export declare function prefabsFrom(files: Record<string, unknown>, options?: {
|
|
138
|
+
prefix?: string;
|
|
139
|
+
}): PrefabDef[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { AbilityDef, UnitTypeDef } from './defs';
|
|
2
|
+
/**
|
|
3
|
+
* A fountain: a building that keeps the game's aura on who is around it (`aura`, the id of a passive ability with an
|
|
4
|
+
* `aura` effect: a fountain of health's regeneration, a fountain of mana's). It cannot be hurt; a map puts it down
|
|
5
|
+
* for the neutral player, so the aura says `affects: 'all'` to reach everyone (the neutral player is nobody's ally).
|
|
6
|
+
* What is given over the fountain's own goes over it: `presetFountain('healingWaters', { id: 'fountainOfHealth' })`
|
|
7
|
+
*
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export declare function presetFountain(aura: string, over?: Partial<UnitTypeDef>): UnitTypeDef;
|
|
11
|
+
/**
|
|
12
|
+
* One trade of a marketplace (`presetMarket`): `amount` of `sell` for `rate` of `buy` for each one sold
|
|
13
|
+
*
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
export interface MarketRate {
|
|
17
|
+
/** The resource traded away, by id */
|
|
18
|
+
sell: string;
|
|
19
|
+
/** The resource traded for, by id */
|
|
20
|
+
buy: string;
|
|
21
|
+
/** How much of `buy` comes for each one of `sell`: 0.5 is 100 lumber for 50 gold */
|
|
22
|
+
rate: number;
|
|
23
|
+
/** How much is sold at a time: 100 when left out */
|
|
24
|
+
amount?: number;
|
|
25
|
+
/** The ability's id: `sell-<sell>-for-<buy>` when left out */
|
|
26
|
+
id?: string;
|
|
27
|
+
/** The ability's name: `Sell <sell> for <buy>` when left out */
|
|
28
|
+
name?: string;
|
|
29
|
+
/** The key the ability's button is pressed with */
|
|
30
|
+
hotkey?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* What `presetMarket` is given: the trades, and the seconds between two of each (none when left out)
|
|
34
|
+
*
|
|
35
|
+
* @beta
|
|
36
|
+
*/
|
|
37
|
+
export interface PresetMarketOptions {
|
|
38
|
+
/** The trades, an ability each, in the order of the buttons */
|
|
39
|
+
rates: readonly MarketRate[];
|
|
40
|
+
/** Seconds between two trades of each: none when left out */
|
|
41
|
+
cooldown?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A marketplace's abilities: one for each trade (`MarketRate`), cast at once (`target: 'none'`), with an `exchange`
|
|
45
|
+
* effect that trades the caster's owner's resources at its rate. A building of the game's lists their ids in its
|
|
46
|
+
* `abilities` (`abilities: market.map((ability) => ability.id)`), the abilities go in the rules' `abilities`. With
|
|
47
|
+
* less than the amount to sell, the player is told and nothing goes. The computer player does not cast them in a
|
|
48
|
+
* fight (their `ai` says not now); its brain's `spells` may
|
|
49
|
+
*
|
|
50
|
+
* @beta
|
|
51
|
+
*/
|
|
52
|
+
export declare function presetMarket(options: PresetMarketOptions): AbilityDef[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type CellLayerDef } from './cellLayers';
|
|
2
|
+
import { type TileDef } from './tiles';
|
|
3
|
+
/**
|
|
4
|
+
* Ready-made grounds a game takes or leaves, beside its own: the tiles of an RTS's ground (grass, dark grass, dirt,
|
|
5
|
+
* road, sand, rock, snow), which the client draws with its `TILE_LOOKS`, and the blight a race spoils ground with,
|
|
6
|
+
* which the client draws with its `blightLook`. They say only what there is; what they do is the game's
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The tiles of an RTS's ground, by the ids the client's `TILE_LOOKS` has looks for: `tiles: presetTiles` in the rules,
|
|
10
|
+
* `tiles: TILE_LOOKS` in the view. A game adds its own beside them, or takes some (`presetTiles.filter(...)`)
|
|
11
|
+
*
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
export declare const presetTiles: readonly TileDef[];
|
|
15
|
+
/**
|
|
16
|
+
* Blight: ground spoiled, a layer of cells a map's maker paints and the rules spread (`world.setCells('blight', …)`),
|
|
17
|
+
* drawn by the client's `blightLook`. What it does (who builds on it, who heals on it) is the game's: melee's
|
|
18
|
+
* undead in the example
|
|
19
|
+
*
|
|
20
|
+
* @beta
|
|
21
|
+
*/
|
|
22
|
+
export declare const presetBlight: CellLayerDef;
|