@v12-engine/engine 0.0.0-stage → 0.1.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.
Files changed (341) hide show
  1. package/LICENSE +21 -0
  2. package/dist/abilities/buffs.d.ts +83 -0
  3. package/dist/abilities/castTold.d.ts +12 -0
  4. package/dist/abilities/charges.d.ts +28 -0
  5. package/dist/abilities/dispel.d.ts +9 -0
  6. package/dist/abilities/effectFields.d.ts +10 -0
  7. package/dist/abilities/effects/buff.d.ts +8 -0
  8. package/dist/abilities/effects/core.d.ts +1 -0
  9. package/dist/abilities/effects/damage.d.ts +1 -0
  10. package/dist/abilities/effects/heal.d.ts +2 -0
  11. package/dist/abilities/effects/missile.d.ts +1 -0
  12. package/dist/abilities/effects/moves.d.ts +11 -0
  13. package/dist/abilities/effects/passives.d.ts +15 -0
  14. package/dist/abilities/effects/sight.d.ts +4 -0
  15. package/dist/abilities/effects/spawn.d.ts +2 -0
  16. package/dist/abilities/effects/timed.d.ts +4 -0
  17. package/dist/abilities/effects/trade.d.ts +1 -0
  18. package/dist/abilities/effects.d.ts +122 -0
  19. package/dist/abilities/land.d.ts +21 -0
  20. package/dist/abilities/scaled.d.ts +21 -0
  21. package/dist/abilities/text.d.ts +113 -0
  22. package/dist/ai/area.d.ts +53 -0
  23. package/dist/ai/brain.d.ts +528 -0
  24. package/dist/ai/budget.d.ts +67 -0
  25. package/dist/ai/checks.d.ts +115 -0
  26. package/dist/ai/computer.d.ts +166 -0
  27. package/dist/ai/defence.d.ts +108 -0
  28. package/dist/ai/define.d.ts +21 -0
  29. package/dist/ai/economy.d.ts +129 -0
  30. package/dist/ai/geometry.d.ts +35 -0
  31. package/dist/ai/goals.d.ts +360 -0
  32. package/dist/ai/index.d.ts +38 -0
  33. package/dist/ai/knowledge.d.ts +418 -0
  34. package/dist/ai/lanes.d.ts +232 -0
  35. package/dist/ai/melee/build.d.ts +61 -0
  36. package/dist/ai/melee/goals.d.ts +299 -0
  37. package/dist/ai/melee/heroes.d.ts +27 -0
  38. package/dist/ai/melee/index.d.ts +14 -0
  39. package/dist/ai/melee/production.d.ts +8 -0
  40. package/dist/ai/melee/surrender.d.ts +24 -0
  41. package/dist/ai/micro.d.ts +278 -0
  42. package/dist/ai/mission.d.ts +195 -0
  43. package/dist/ai/missionRules.d.ts +18 -0
  44. package/dist/ai/module.d.ts +116 -0
  45. package/dist/ai/options.d.ts +61 -0
  46. package/dist/ai/plans/build.d.ts +280 -0
  47. package/dist/ai/plans/placement.d.ts +82 -0
  48. package/dist/ai/plans/plans.d.ts +105 -0
  49. package/dist/ai/plans/production.d.ts +210 -0
  50. package/dist/ai/plans/purse.d.ts +73 -0
  51. package/dist/ai/plans/tech.d.ts +37 -0
  52. package/dist/ai/profiles.d.ts +204 -0
  53. package/dist/ai/reach.d.ts +4 -0
  54. package/dist/ai/report.d.ts +203 -0
  55. package/dist/ai/roles.d.ts +133 -0
  56. package/dist/ai/rules.d.ts +288 -0
  57. package/dist/ai/scouting.d.ts +98 -0
  58. package/dist/ai/settings.d.ts +73 -0
  59. package/dist/ai/squads.d.ts +429 -0
  60. package/dist/ai/strength.d.ts +167 -0
  61. package/dist/ai/task.d.ts +118 -0
  62. package/dist/ai/tasks/attack.d.ts +7 -0
  63. package/dist/ai/tasks/capture.d.ts +21 -0
  64. package/dist/ai/tasks/creep.d.ts +16 -0
  65. package/dist/ai/tasks/defend.d.ts +29 -0
  66. package/dist/ai/tasks/drop.d.ts +34 -0
  67. package/dist/ai/tasks/escort.d.ts +16 -0
  68. package/dist/ai/tasks/gather.d.ts +23 -0
  69. package/dist/ai/tasks/harass.d.ts +7 -0
  70. package/dist/ai/tasks/hold.d.ts +20 -0
  71. package/dist/ai/tasks/index.d.ts +32 -0
  72. package/dist/ai/tasks/move.d.ts +19 -0
  73. package/dist/ai/tasks/patrol.d.ts +8 -0
  74. package/dist/ai/tasks/retreat.d.ts +20 -0
  75. package/dist/ai/tasks/scout.d.ts +29 -0
  76. package/dist/ai/tasks/shared.d.ts +74 -0
  77. package/dist/ai/team.d.ts +155 -0
  78. package/dist/ai/threat.d.ts +91 -0
  79. package/dist/ai/view.d.ts +366 -0
  80. package/dist/ai/waves.d.ts +126 -0
  81. package/dist/ai.js +6239 -0
  82. package/dist/ai.js.map +1 -0
  83. package/dist/aiTesting.d.ts +179 -0
  84. package/dist/areas.d.ts +149 -0
  85. package/dist/attacks.d.ts +66 -0
  86. package/dist/attributes.d.ts +66 -0
  87. package/dist/brain-BvVdUhX8.js +7659 -0
  88. package/dist/brain-BvVdUhX8.js.map +1 -0
  89. package/dist/builds-C6LfgvEU.js +460 -0
  90. package/dist/builds-C6LfgvEU.js.map +1 -0
  91. package/dist/bytes.d.ts +6 -0
  92. package/dist/camps.d.ts +95 -0
  93. package/dist/capture.d.ts +131 -0
  94. package/dist/cellLayers.d.ts +75 -0
  95. package/dist/cinematics.d.ts +194 -0
  96. package/dist/clock.d.ts +32 -0
  97. package/dist/commands.d.ts +235 -0
  98. package/dist/components.d.ts +184 -0
  99. package/dist/computers.d.ts +108 -0
  100. package/dist/concealment.d.ts +61 -0
  101. package/dist/coreComponents-syuh2fPG.js +5149 -0
  102. package/dist/coreComponents-syuh2fPG.js.map +1 -0
  103. package/dist/coreComponents.d.ts +1 -0
  104. package/dist/dashing.d.ts +8 -0
  105. package/dist/debug.d.ts +36 -0
  106. package/dist/debug.js +3 -0
  107. package/dist/debugCommands-CzjrSm66.js +14739 -0
  108. package/dist/debugCommands-CzjrSm66.js.map +1 -0
  109. package/dist/debugCommands.d.ts +213 -0
  110. package/dist/debugging.d.ts +10 -0
  111. package/dist/definitions.d.ts +43 -0
  112. package/dist/defs.d.ts +1162 -0
  113. package/dist/denying.d.ts +81 -0
  114. package/dist/destructibles.d.ts +27 -0
  115. package/dist/determinism-BCymQwiE.js +518 -0
  116. package/dist/determinism-BCymQwiE.js.map +1 -0
  117. package/dist/determinism.d.ts +121 -0
  118. package/dist/dialog.d.ts +94 -0
  119. package/dist/effectRefs.d.ts +16 -0
  120. package/dist/effects.d.ts +80 -0
  121. package/dist/endings.d.ts +22 -0
  122. package/dist/engagement.d.ts +108 -0
  123. package/dist/engineEvents.d.ts +710 -0
  124. package/dist/entity.d.ts +409 -0
  125. package/dist/entityIndex.d.ts +50 -0
  126. package/dist/errors.d.ts +85 -0
  127. package/dist/events.d.ts +97 -0
  128. package/dist/exactMath.d.ts +63 -0
  129. package/dist/features.d.ts +10 -0
  130. package/dist/fields.d.ts +114 -0
  131. package/dist/fixture.d.ts +17 -0
  132. package/dist/fog.d.ts +110 -0
  133. package/dist/formation.d.ts +111 -0
  134. package/dist/friendlyFire.d.ts +26 -0
  135. package/dist/game-DiJEN-Ks.js +5800 -0
  136. package/dist/game-DiJEN-Ks.js.map +1 -0
  137. package/dist/game.d.ts +501 -0
  138. package/dist/gameData.d.ts +325 -0
  139. package/dist/gameFiles.d.ts +26 -0
  140. package/dist/gates.d.ts +28 -0
  141. package/dist/generate.d.ts +403 -0
  142. package/dist/generateWorker.d.ts +39 -0
  143. package/dist/grid.d.ts +53 -0
  144. package/dist/ground.d.ts +127 -0
  145. package/dist/groundSpeed.d.ts +22 -0
  146. package/dist/hero.d.ts +177 -0
  147. package/dist/home.d.ts +14 -0
  148. package/dist/hooks.d.ts +780 -0
  149. package/dist/hotReload.d.ts +76 -0
  150. package/dist/ids.d.ts +26 -0
  151. package/dist/index.d.ts +227 -0
  152. package/dist/index.js +4701 -0
  153. package/dist/index.js.map +1 -0
  154. package/dist/inspect-D9dWHmZ0.js +491 -0
  155. package/dist/inspect-D9dWHmZ0.js.map +1 -0
  156. package/dist/inspect.d.ts +176 -0
  157. package/dist/inventory.d.ts +18 -0
  158. package/dist/items.d.ts +91 -0
  159. package/dist/lanes.d.ts +213 -0
  160. package/dist/life.d.ts +53 -0
  161. package/dist/local-Dkovq42k.js +1379 -0
  162. package/dist/local-Dkovq42k.js.map +1 -0
  163. package/dist/log.d.ts +140 -0
  164. package/dist/manaBurn.d.ts +39 -0
  165. package/dist/map/file.d.ts +114 -0
  166. package/dist/map/images.d.ts +18 -0
  167. package/dist/map/look.d.ts +47 -0
  168. package/dist/map/pathProfile.d.ts +13 -0
  169. package/dist/map/resize.d.ts +54 -0
  170. package/dist/map/schema.d.ts +10 -0
  171. package/dist/map/terrain.d.ts +32 -0
  172. package/dist/map/types.d.ts +613 -0
  173. package/dist/map.d.ts +7 -0
  174. package/dist/mapCheck/cells.d.ts +19 -0
  175. package/dist/mapCheck/rule.d.ts +30 -0
  176. package/dist/mapCheck/rules/names.d.ts +3 -0
  177. package/dist/mapCheck/rules/objects.d.ts +3 -0
  178. package/dist/mapCheck/rules/paths.d.ts +3 -0
  179. package/dist/mapCheck/rules/players.d.ts +3 -0
  180. package/dist/mapCheck/rules/races.d.ts +3 -0
  181. package/dist/mapCheck/rules/random.d.ts +3 -0
  182. package/dist/mapCheck/rules/regions.d.ts +3 -0
  183. package/dist/mapCheck/rules/targets.d.ts +3 -0
  184. package/dist/mapCheck/rules/walking.d.ts +3 -0
  185. package/dist/mapCheck.d.ts +23 -0
  186. package/dist/mapFields.d.ts +364 -0
  187. package/dist/mapFile.d.ts +23 -0
  188. package/dist/mapMeasure.d.ts +95 -0
  189. package/dist/mapMerge.d.ts +19 -0
  190. package/dist/mapObjectives.d.ts +82 -0
  191. package/dist/mapObjects.d.ts +1 -0
  192. package/dist/math.d.ts +44 -0
  193. package/dist/messages.d.ts +150 -0
  194. package/dist/missionRules-C-bGxm0Q.js +523 -0
  195. package/dist/missionRules-C-bGxm0Q.js.map +1 -0
  196. package/dist/missionRules.d.ts +179 -0
  197. package/dist/mods.d.ts +146 -0
  198. package/dist/names.d.ts +93 -0
  199. package/dist/navigation/agentParams.d.ts +4 -0
  200. package/dist/navigation/air.d.ts +89 -0
  201. package/dist/navigation/builds.d.ts +140 -0
  202. package/dist/navigation/groundAreas.d.ts +23 -0
  203. package/dist/navigation/navigation.d.ts +127 -0
  204. package/dist/navigation/recast.d.ts +214 -0
  205. package/dist/navigation/sidePaths.d.ts +69 -0
  206. package/dist/navigation/sized.d.ts +1 -0
  207. package/dist/navigation-worker.js +11 -0
  208. package/dist/navigation-worker.js.map +1 -0
  209. package/dist/nearest.d.ts +8 -0
  210. package/dist/noise.d.ts +12 -0
  211. package/dist/objectives.d.ts +93 -0
  212. package/dist/orders/basic.d.ts +96 -0
  213. package/dist/orders/build.d.ts +91 -0
  214. package/dist/orders/cast.d.ts +105 -0
  215. package/dist/orders/facts.d.ts +14 -0
  216. package/dist/orders/harvest.d.ts +94 -0
  217. package/dist/orders/idle.d.ts +7 -0
  218. package/dist/orders/items.d.ts +14 -0
  219. package/dist/orders/queue.d.ts +24 -0
  220. package/dist/pack.schema.json +6621 -0
  221. package/dist/packs/director/index.d.ts +81 -0
  222. package/dist/packs/heroes/campaign.d.ts +137 -0
  223. package/dist/packs/heroes/carry.d.ts +59 -0
  224. package/dist/packs/heroes/commands.d.ts +6 -0
  225. package/dist/packs/heroes/hire.d.ts +9 -0
  226. package/dist/packs/heroes/index.d.ts +12 -0
  227. package/dist/packs/heroes/making.d.ts +16 -0
  228. package/dist/packs/heroes/respawn.d.ts +42 -0
  229. package/dist/packs/moba/index.d.ts +34 -0
  230. package/dist/packs/pack.d.ts +84 -0
  231. package/dist/packs-g5thvmGn.js +3199 -0
  232. package/dist/packs-g5thvmGn.js.map +1 -0
  233. package/dist/packs.d.ts +84 -0
  234. package/dist/paths.d.ts +51 -0
  235. package/dist/plain.d.ts +17 -0
  236. package/dist/player.d.ts +117 -0
  237. package/dist/portals.d.ts +66 -0
  238. package/dist/prefabs.d.ts +139 -0
  239. package/dist/presetBuildings.d.ts +52 -0
  240. package/dist/presetGround.d.ts +22 -0
  241. package/dist/profiles-B3NS9jwk.js +335 -0
  242. package/dist/profiles-B3NS9jwk.js.map +1 -0
  243. package/dist/races.d.ts +136 -0
  244. package/dist/randomGroups.d.ts +2 -0
  245. package/dist/registry.d.ts +464 -0
  246. package/dist/remains.d.ts +119 -0
  247. package/dist/replication.d.ts +103 -0
  248. package/dist/rng.d.ts +17 -0
  249. package/dist/rules.d.ts +395 -0
  250. package/dist/rulesCheck.d.ts +37 -0
  251. package/dist/runes.d.ts +41 -0
  252. package/dist/save.d.ts +277 -0
  253. package/dist/scenario.d.ts +56 -0
  254. package/dist/scheduler.d.ts +67 -0
  255. package/dist/score.d.ts +306 -0
  256. package/dist/sequences.d.ts +132 -0
  257. package/dist/server/doorman.d.ts +21 -0
  258. package/dist/server/gameServer.d.ts +346 -0
  259. package/dist/server/index.d.ts +24 -0
  260. package/dist/server/lobby.d.ts +1 -0
  261. package/dist/server/log.d.ts +13 -0
  262. package/dist/server/match.d.ts +24 -0
  263. package/dist/server/mode.d.ts +168 -0
  264. package/dist/server/navigation-worker.d.ts +1 -0
  265. package/dist/server/navigation.d.ts +11 -0
  266. package/dist/server/ops.d.ts +78 -0
  267. package/dist/server/packs.d.ts +15 -0
  268. package/dist/server/ratings.d.ts +62 -0
  269. package/dist/server/relay.d.ts +34 -0
  270. package/dist/server/rooms.d.ts +162 -0
  271. package/dist/server/seat.d.ts +2 -0
  272. package/dist/server/seatSettings.d.ts +15 -0
  273. package/dist/server/secret.d.ts +5 -0
  274. package/dist/server/start.d.ts +54 -0
  275. package/dist/server/websocket.d.ts +74 -0
  276. package/dist/server.js +2861 -0
  277. package/dist/server.js.map +1 -0
  278. package/dist/session/can.d.ts +20 -0
  279. package/dist/session/commandReplay.d.ts +92 -0
  280. package/dist/session/debug.d.ts +65 -0
  281. package/dist/session/delay.d.ts +15 -0
  282. package/dist/session/delta.d.ts +98 -0
  283. package/dist/session/entityState.d.ts +1 -0
  284. package/dist/session/local.d.ts +214 -0
  285. package/dist/session/memory.d.ts +27 -0
  286. package/dist/session/protocol.d.ts +1155 -0
  287. package/dist/session/remote.d.ts +530 -0
  288. package/dist/session/replay.d.ts +114 -0
  289. package/dist/session/seed.d.ts +7 -0
  290. package/dist/session/share.d.ts +78 -0
  291. package/dist/session/socket.d.ts +8 -0
  292. package/dist/session/wire.d.ts +153 -0
  293. package/dist/session/worker.d.ts +227 -0
  294. package/dist/shared.d.ts +171 -0
  295. package/dist/sides.d.ts +75 -0
  296. package/dist/sight.d.ts +27 -0
  297. package/dist/simulate-oXBiw1Ff.js +167 -0
  298. package/dist/simulate-oXBiw1Ff.js.map +1 -0
  299. package/dist/simulate-worker.d.ts +1 -0
  300. package/dist/simulate-worker.js +28 -0
  301. package/dist/simulate-worker.js.map +1 -0
  302. package/dist/simulate.d.ts +154 -0
  303. package/dist/smart.d.ts +9 -0
  304. package/dist/spatial.d.ts +62 -0
  305. package/dist/spawning.d.ts +33 -0
  306. package/dist/stances.d.ts +76 -0
  307. package/dist/start.d.ts +71 -0
  308. package/dist/stats.d.ts +122 -0
  309. package/dist/summons.d.ts +63 -0
  310. package/dist/systems/abilities.d.ts +3 -0
  311. package/dist/systems/combat.d.ts +71 -0
  312. package/dist/systems/combatTold.d.ts +14 -0
  313. package/dist/systems/construction.d.ts +34 -0
  314. package/dist/systems/economy.d.ts +21 -0
  315. package/dist/systems/fog.d.ts +19 -0
  316. package/dist/systems/life.d.ts +3 -0
  317. package/dist/systems/movement.d.ts +105 -0
  318. package/dist/systems/orders.d.ts +7 -0
  319. package/dist/systems/production.d.ts +49 -0
  320. package/dist/systems/productionQueue.d.ts +40 -0
  321. package/dist/systems/victory.d.ts +14 -0
  322. package/dist/talk.d.ts +65 -0
  323. package/dist/tech.d.ts +62 -0
  324. package/dist/techTree.d.ts +38 -0
  325. package/dist/terrain.d.ts +173 -0
  326. package/dist/terrainSave.d.ts +29 -0
  327. package/dist/testing.d.ts +58 -0
  328. package/dist/testing.js +822 -0
  329. package/dist/testing.js.map +1 -0
  330. package/dist/tiles.d.ts +34 -0
  331. package/dist/timers.d.ts +146 -0
  332. package/dist/tomes.d.ts +48 -0
  333. package/dist/trade.d.ts +28 -0
  334. package/dist/transport.d.ts +76 -0
  335. package/dist/tunables.d.ts +45 -0
  336. package/dist/upkeep.d.ts +16 -0
  337. package/dist/veterancy.d.ts +80 -0
  338. package/dist/walls.d.ts +86 -0
  339. package/dist/world.d.ts +1118 -0
  340. package/package.json +80 -5
  341. package/README.md +0 -3
package/dist/defs.d.ts ADDED
@@ -0,0 +1,1162 @@
1
+ import type { AbilityAiView } from './ai/micro';
2
+ import type { AiHints } from './ai/roles';
3
+ import type { AbilityTextContext, AbilityValueDef, TextSegment } from './abilities/text';
4
+ import type { EntityState } from './session/protocol';
5
+ /**
6
+ * Static game data. Everything a game module (melee, custom map, mod) defines about
7
+ * its units lives in plain objects like these, the engine never hardcodes a unit.
8
+ */
9
+ import type { GameRules } from './rules';
10
+ import type { AbilityState, BuffInstance, Entity } from './entity';
11
+ import type { Vec2 } from './math';
12
+ import type { World } from './world';
13
+ /**
14
+ * A value that can grow with the level of an ability: one number, or one per level
15
+ *
16
+ * @beta
17
+ */
18
+ export type Scaled = number | number[];
19
+ /**
20
+ * The value at a level. Levels past the end of the list get the last one
21
+ *
22
+ * @beta
23
+ */
24
+ export declare function at(value: Scaled | undefined, level: number, fallback?: number): number;
25
+ /**
26
+ * The stats the engine reads: what a unit has of health, mana and their regeneration, how it moves, sees and attacks,
27
+ * and its armor and magic resist (the two kinds of damage there are besides true). Levels, items, buffs and research
28
+ * change them. A game adds stats of its own with `GameModule.stats`, a pack its own (`GamePack.stats`: the MOBA
29
+ * stats of `withMobaStats`).
30
+ *
31
+ * @beta
32
+ */
33
+ export interface CoreStats {
34
+ /** What a basic attack deals, before the armor of the target */
35
+ attackDamage: number;
36
+ /** Attacks per second */
37
+ attackSpeed: number;
38
+ /** Measured between the edges of attacker and target */
39
+ attackRange: number;
40
+ health: number;
41
+ /** Against physical damage: 100 of it halve what arrives */
42
+ armor: number;
43
+ /** The same against magic damage */
44
+ magicResist: number;
45
+ /** Per second */
46
+ healthRegen: number;
47
+ mana: number;
48
+ /** Per second */
49
+ manaRegen: number;
50
+ /** Units per second. Who has none cannot move */
51
+ moveSpeed: number;
52
+ /** How far it sees. At night the unit type says how far that is */
53
+ sight: number;
54
+ }
55
+ /**
56
+ * All of a unit's stats: the engine's, and the game's own by their ids
57
+ *
58
+ * @beta
59
+ */
60
+ export type Stats = CoreStats & Record<string, number>;
61
+ /**
62
+ * A stat: one of the engine's (`CoreStatKey`), or one a game defined. Checked when the game is built
63
+ *
64
+ * @beta
65
+ */
66
+ export type StatKey = string;
67
+ /**
68
+ * A stat of a game's own, next to the engine's
69
+ *
70
+ * @beta
71
+ */
72
+ export interface StatDef {
73
+ id: string;
74
+ name: string;
75
+ /** Shown when the pointer is over it */
76
+ description?: string;
77
+ /** What every unit has of it unless its type says. 0 when left out */
78
+ default?: number;
79
+ /** It never goes below or above these, whatever changes it */
80
+ min?: number;
81
+ max?: number;
82
+ /** How it is shown: a whole number, a decimal, or a part of one as a percentage. A whole number when left out */
83
+ format?: 'number' | 'decimal' | 'percent';
84
+ }
85
+ /** @beta */
86
+ export declare const noStats: () => CoreStats;
87
+ /**
88
+ * How the days go by. Hours run from 0 to 24
89
+ *
90
+ * @beta
91
+ */
92
+ export interface DayCycle {
93
+ /** Seconds a whole day and night take */
94
+ length: number;
95
+ /** Hour of the day the game starts at */
96
+ start: number;
97
+ /** Hour the sun comes up */
98
+ dawn: number;
99
+ /** Hour it goes down */
100
+ dusk: number;
101
+ }
102
+ /**
103
+ * Hour of the day after so many seconds of play. Noon in a game without days
104
+ *
105
+ * @beta
106
+ */
107
+ export declare function hourOf(day: DayCycle | null, seconds: number): number;
108
+ /** @beta */
109
+ export declare const isNight: (day: DayCycle | null, hour: number) => boolean;
110
+ /**
111
+ * Something that changes stats: `stats` is added, `percent` makes them bigger or smaller by a part of what
112
+ * they are with everything added. Parts from different places add up: two times +10% are +20%.
113
+ *
114
+ * @beta
115
+ */
116
+ export interface StatChange {
117
+ stats?: Partial<Stats>;
118
+ percent?: Partial<Stats>;
119
+ }
120
+ /**
121
+ * A change that grows with the level of the ability it comes from
122
+ *
123
+ * @beta
124
+ */
125
+ export interface ScaledStatChange {
126
+ stats?: Partial<Record<StatKey, Scaled>>;
127
+ percent?: Partial<Record<StatKey, Scaled>>;
128
+ }
129
+ /**
130
+ * Physical damage is held off by armor, magic damage by magic resist, true damage by nothing
131
+ *
132
+ * @beta
133
+ */
134
+ export type DamageType = 'physical' | 'magic' | 'true';
135
+ /**
136
+ * What makes a unit a hero: it gains levels, grows with them and learns abilities
137
+ *
138
+ * @beta
139
+ */
140
+ export interface HeroDef {
141
+ /** What every level after the first adds */
142
+ growth: StatChange;
143
+ /** Abilities the hero can put points into */
144
+ learns: string[];
145
+ /** Abilities it has from the start and does not learn: the two spells every hero brings along. No mana, and nothing shortens their cooldown */
146
+ spells?: string[];
147
+ /** The level it stops at. 10 when left out */
148
+ maxLevel?: number;
149
+ /** A buff whose stacks are shown next to its health and mana, as so many points out of as many as it can have */
150
+ meter?: string;
151
+ /**
152
+ * Its primary attribute, in a game with the attributes pack (`withAttributes`): each point of it adds to its attack
153
+ * as well. `AttributesOptions.primaryOf` says it in code
154
+ */
155
+ primary?: 'strength' | 'agility' | 'intelligence';
156
+ }
157
+ /** @beta */
158
+ export type EntityKind = 'unit' | 'building' | 'resource';
159
+ /**
160
+ * Where something is: on the ground, or above it
161
+ *
162
+ * @beta
163
+ */
164
+ export type Layer = 'ground' | 'air';
165
+ /**
166
+ * The stats an attack reads how hard, how fast and how far it hits from (`AttackDef.stats`): the unit's
167
+ * `attackDamage`, `attackSpeed` and `attackRange` for what is left out
168
+ *
169
+ * @beta
170
+ */
171
+ export interface AttackStats {
172
+ /** What a hit deals, before the armour of the target. `attackDamage` when left out */
173
+ damage?: StatKey;
174
+ /** Hits a second. `attackSpeed` when left out */
175
+ speed?: StatKey;
176
+ /** How far it reaches, between the edges. `attackRange` when left out */
177
+ range?: StatKey;
178
+ }
179
+ /**
180
+ * One of the ways a unit attacks (`UnitTypeDef.attacks`): what it hits, how its blow lands. How hard, how fast and how
181
+ * far are stats: the unit's `attackDamage`, `attackSpeed` and `attackRange`, or stats of the game's own that the attack
182
+ * names (`stats`: a second weapon's)
183
+ *
184
+ * @beta
185
+ */
186
+ export interface AttackDef {
187
+ /**
188
+ * The stats its numbers are, by id: a stat of the game's (`GameModule.stats`) for a weapon whose damage, speed or
189
+ * range is not the unit's first's. What changes those stats (research, items, buffs) changes this attack alone
190
+ */
191
+ stats?: AttackStats;
192
+ /** Physical when left out */
193
+ damageType?: DamageType;
194
+ /** Seconds from the start of the swing until damage lands (or the projectile leaves), at the attack speed the unit starts with */
195
+ damagePoint: number;
196
+ /** Enemies closer than this are attacked automatically */
197
+ acquisitionRange: number;
198
+ /**
199
+ * How near is too near, edge to edge: what is closer than this the attack does not hit (a siege weapon's dead zone).
200
+ * Another of the unit's attacks takes over there where one reaches (`GameRules.combat.pickAttack`); with none, a unit
201
+ * told to attack steps back out of it first, and one left to itself does not pick what is that near. None when left out
202
+ */
203
+ minRange?: number;
204
+ /**
205
+ * Fires as the unit walks (a horse archer, a tank's turret): told to move, it hits what it passes within the attack's
206
+ * range without stopping or turning to it, at the attack's speed. Every other order fights as any attack does
207
+ * (it stops to). Not when left out
208
+ */
209
+ onTheMove?: boolean;
210
+ /** Set for ranged attacks */
211
+ projectileSpeed?: number;
212
+ /**
213
+ * What this attack can hit: kinds of things, and where they are. Everything on the ground when left out.
214
+ * What flies is only hit by attacks that name `air`, and an attack that names `air` alone does not hit the ground
215
+ */
216
+ targets?: (EntityKind | Layer)[];
217
+ /**
218
+ * Radius around the point of impact in which everyone is hit, friends too: in full in the inner half, by half further out.
219
+ * Shots of such an attack land where they were aimed, they do not follow their target
220
+ */
221
+ splash?: number;
222
+ /** Can be told to attack a spot on the ground */
223
+ ground?: boolean;
224
+ /** Brings down what is `fellable` in the area it hits */
225
+ fells?: boolean;
226
+ /**
227
+ * How what this attack kills dies, for the screen (`'shot'`, `'crushed'`, `'burnt'`): the death's `how`, which the
228
+ * view shows its way (`UnitLook.death`). A word, or one decided for each blow. The `death` hook has the last say
229
+ */
230
+ how?: string | ((hit: {
231
+ attacker: Entity;
232
+ target?: Entity;
233
+ damage: number;
234
+ type: DamageType;
235
+ crit: boolean;
236
+ tags?: readonly string[];
237
+ }) => string | undefined);
238
+ /**
239
+ * The attack's type against the target's armour type, by the game's damage table (`GameRules.combat.damageTable`): `pierce`,
240
+ * `siege`… Left out, the attack is multiplied by nothing
241
+ */
242
+ attackType?: string;
243
+ }
244
+ /**
245
+ * The id of a resource, as its game module defines it (`ResourceDef`)
246
+ *
247
+ * @beta
248
+ */
249
+ export type ResourceKind = string;
250
+ /**
251
+ * Something players have amounts of and pay with, like gold, lumber or crystals. A game module lists its own
252
+ *
253
+ * @beta
254
+ */
255
+ export interface ResourceDef {
256
+ id: ResourceKind;
257
+ name: string;
258
+ /** What every player starts a game with. Nothing when left out */
259
+ start?: number;
260
+ /** What workers gather of it is cut by the upkeep of the army, see `UpkeepTier` */
261
+ upkeep?: boolean;
262
+ }
263
+ /**
264
+ * What something costs: an amount of each resource it takes, by resource id. What is left out costs nothing
265
+ *
266
+ * @beta
267
+ */
268
+ export type Cost = Record<ResourceKind, number>;
269
+ /** @beta */
270
+ export interface UnitTypeDef {
271
+ id: string;
272
+ name: string;
273
+ /**
274
+ * The definition this one is a copy of, made from the data (`copyOf` in a `data.json`, the editor's Copy as new):
275
+ * what it is drawn, heard and pictured as where the game gives it no look of its own
276
+ */
277
+ basedOn?: string;
278
+ kind: EntityKind;
279
+ /** Collision radius */
280
+ radius: number;
281
+ /** Size in grid cells. Required for buildings and resources */
282
+ footprint?: {
283
+ w: number;
284
+ d: number;
285
+ };
286
+ /** What it starts with. What is left out is 0, a critical strike is worth 175% */
287
+ stats: Partial<Stats> & {
288
+ health: number;
289
+ };
290
+ /** Mana it comes into the world with. All of it when left out */
291
+ initialMana?: number;
292
+ /** Vision radius by day */
293
+ sight: number;
294
+ /** Vision radius at night. A part of the one by day when left out */
295
+ sightNight?: number;
296
+ /** Flies: over cliffs, trees and buildings, out of reach of whatever cannot hit the air */
297
+ flying?: boolean;
298
+ /**
299
+ * Goes on deep water and nowhere else: a boat. Sent onto land, it goes to the water nearest where it was sent. On
300
+ * the ground, as far as what can hit it goes
301
+ */
302
+ naval?: boolean;
303
+ /**
304
+ * A waygate, in a game with the portals pack (`withPortals`): a unit told to it walks in and is at once where it
305
+ * leads (its `waygate` field, a point of the map; `setWaygate` in code)
306
+ */
307
+ waygate?: boolean;
308
+ /**
309
+ * Rocks, a barricade, a gate to break down, in a game with the destructibles pack (`withDestructibles`): it stands in
310
+ * the way as any building does until it is brought down, and any unit whose attack reaches it attacks it when told
311
+ * to, never of its own accord
312
+ */
313
+ destructible?: boolean;
314
+ /**
315
+ * Carries others: a boat, a wagon. Units of its side get in by being told to (right-clicking it), are out of the
316
+ * world while in, and get out on the land nearest it (the `unload` order). It takes `capacity` of them, of the
317
+ * kinds `takes` says (every unit that walks when left out). What it carries dies with it
318
+ */
319
+ /**
320
+ * Carries others: a boat, or a building they go into (a garrison). `takes` says who may get in; `armed`, for a
321
+ * building with an attack, is the attack damage each one inside adds, and it attacks only while someone is inside,
322
+ * as an orc burrow does. What a building holds comes out when it falls; what a boat holds goes down with it
323
+ */
324
+ transport?: {
325
+ capacity: number;
326
+ takes?: (def: UnitTypeDef) => boolean;
327
+ /** Attack damage each one inside adds; or in code, all of what they add, by who is inside (none for nobody) */
328
+ armed?: number | ((world: World, building: Entity, inside: Entity[]) => number);
329
+ };
330
+ /** Radians per second */
331
+ turnRate?: number;
332
+ /**
333
+ * How it attacks, as the classic RTS two weapons: against each target the first that reaches it (its `targets`), or
334
+ * the one the game picks (`GameRules.combat.pickAttack`). It swings one at a time: a hit's cooldown is that attack's,
335
+ * whichever swings next. None for what does not attack
336
+ */
337
+ attacks?: AttackDef[];
338
+ hero?: HeroDef;
339
+ /** How dangerous it is, for creeps. Shown to the player, and added up per camp */
340
+ level?: number;
341
+ /** Gold for whoever kills it, rolled between the two */
342
+ bounty?: [min: number, max: number];
343
+ /**
344
+ * Whether it leaves a corpse when it dies, for spells to use (see `raiseDead`). Units do, unless this says no:
345
+ * machines, spirits. Decided for each death in code: false for none, true or seconds for one (how long it lies)
346
+ */
347
+ corpse?: boolean | ((world: World, entity: Entity) => boolean | number);
348
+ /**
349
+ * Immune to spells: abilities do not touch it, of friends or enemies, unless they say they get through
350
+ * (`piercesImmunity`). Decided in code whenever it is asked: while it stands on holy ground. The player's screen only
351
+ * knows the plain `true` of it, to grey out a target; the simulation goes by the code
352
+ */
353
+ spellImmune?: boolean | ((world: World, entity: Entity) => boolean);
354
+ /** Experience heroes get for killing it. Follows from its cost when left out */
355
+ xp?: number;
356
+ /** Building types the player has to have before this can be built or trained */
357
+ requires?: string[];
358
+ /**
359
+ * The race it is of (`GameModule.races`): only its players may build or train it. Everyone's when left out: creeps,
360
+ * what is shared. What a player may have is the game's to change (the `available` hook)
361
+ */
362
+ race?: string;
363
+ /** Building types this one counts as, for requirements. A keep is a town hall too */
364
+ provides?: string[];
365
+ /**
366
+ * Type this building can be upgraded into, where it stands; or the types, for one that may become one of several (a
367
+ * keep that turns into a castle or a citadel, `upgradesOf`). The first is what an upgrade is into where none is named
368
+ */
369
+ upgradesTo?: string | string[];
370
+ /** Slots for items. Heroes have six */
371
+ inventory?: number;
372
+ /** Items this building sells */
373
+ sells?: string[];
374
+ /**
375
+ * Units it hires out to whoever has one of theirs there, by type: a tavern's heroes, a dock's boats. Their cost,
376
+ * and a hero only once (see `hire`). Neutral, it hires to everyone
377
+ */
378
+ hires?: string[];
379
+ /**
380
+ * What it may leave behind when it dies, each with its chance from 0 to 1. Or code: the items it leaves, decided as
381
+ * it dies (one random level-3 item; more for a stronger killer)
382
+ */
383
+ drops?: {
384
+ item: string;
385
+ chance: number;
386
+ }[] | ((world: World, entity: Entity, killer?: Entity) => string[]);
387
+ /** Brings fallen heroes back */
388
+ revives?: boolean;
389
+ /** Ids of the abilities the unit has */
390
+ abilities?: string[];
391
+ cost?: Cost;
392
+ /** Supply (food) it takes up for as long as it lives, and while it is being trained */
393
+ supply?: number;
394
+ /** What it takes of the game's other pools of supply, by name (`GameRules.supply.pools`): `{ command: 1 }` */
395
+ supplies?: Record<string, number>;
396
+ /** Seconds to build or train */
397
+ buildTime?: number;
398
+ supplyProvided?: number;
399
+ /** What it provides of the game's other pools of supply, by name (`GameRules.supply.pools`), once it stands finished */
400
+ suppliesProvided?: Record<string, number>;
401
+ harvester?: {
402
+ capacity: number;
403
+ gatherTime: number;
404
+ /**
405
+ * The kinds of resource it gathers: all of them when left out. The undead's acolytes gold and nothing else, ghouls
406
+ * lumber. The `canHarvest` hook has the last word (`canHarvest`)
407
+ */
408
+ kinds?: ResourceKind[];
409
+ };
410
+ /** Building types this unit can construct */
411
+ builds?: string[];
412
+ /** Unit types this building can train */
413
+ trains?: string[];
414
+ /** Upgrades that can be researched here */
415
+ researches?: string[];
416
+ /** Accepts harvested resources: all of them, or only the ones listed */
417
+ dropOff?: boolean | ResourceKind[];
418
+ /**
419
+ * Goes up on a resource of this kind, over it, of the same footprint: the undead's cursed gold mine. The resource is
420
+ * its owner's alone from then on (`canHarvest`); one that takes what is gathered there (`dropOff`) has its owner's
421
+ * workers gather at it from around it, handing in where they stand, as many at once as `gatherers` says. It goes
422
+ * down with the resource, which stands again where it is destroyed
423
+ */
424
+ builtOn?: ResourceKind;
425
+ /** Workers that gather at once at it, when it stands on a resource (`builtOn`): 5 when left out */
426
+ gatherers?: number;
427
+ /**
428
+ * Goes up on its own once it is put down, as the undead summon theirs: the builder is free at once, and nobody
429
+ * helps (`GameRules.production.buildRate` of one builder, all the way). The same as `construction: 'self'`
430
+ */
431
+ buildsItself?: boolean;
432
+ /**
433
+ * How it goes up once it is put down: with builders at it (`builder`, the more the faster, as `buildRate` says), on
434
+ * its own with the builder free at once (`self`, the undead's), or whole at once (`instant`: a wall piece, a
435
+ * ward). `builder` when left out (`self` with `buildsItself`)
436
+ *
437
+ * @beta
438
+ */
439
+ construction?: 'builder' | 'self' | 'instant';
440
+ /**
441
+ * How fast it goes up with so many builders at it, 1 being one builder's: the game's rule (`GameRules.production.buildRate`) for
442
+ * every type when left out
443
+ *
444
+ * @beta
445
+ */
446
+ buildRate?: (builders: number, world: World, structure: Entity) => number;
447
+ resource?: {
448
+ kind: ResourceKind;
449
+ amount: number;
450
+ /** Workers that fit inside at once, for resources that are entered */
451
+ slots: number;
452
+ /** Workers go inside to gather, like into a gold mine, instead of working on it from next to it */
453
+ entered?: boolean;
454
+ /** Seconds a load takes, when that is not what the worker usually needs */
455
+ gatherTime?: number;
456
+ };
457
+ /** Key used in the command card when building or training this type */
458
+ hotkey?: string;
459
+ /** Higher values are picked first when acquiring targets */
460
+ threat?: number;
461
+ invulnerable?: boolean;
462
+ /** Takes damage like anything else but never dies of it: it is left with a little health, like something to practise on */
463
+ undying?: boolean;
464
+ /** Seconds after it was last hurt that it is whole again, all at once */
465
+ recovers?: number;
466
+ /** Nobody picks a fight with it on their own: it is only attacked when someone is told to */
467
+ ignored?: boolean;
468
+ /** Destroyed by attacks that fell, like a tree by a catapult, whatever else it withstands */
469
+ fellable?: boolean;
470
+ /**
471
+ * A piece of wall (`withWalls`): it joins with the pieces of its family beside it, and its shape (`single`, `end`,
472
+ * `straight`, `corner`, `tee`, `cross`) is its look. A gate (`gate`) joins as a piece does, turned along its line,
473
+ * and its owner opens and shuts it for everyone (`wallGateCommand`): its look `open` or `shut`. Pieces join by their
474
+ * footprints, so a gate wider than a cell sits in a line of pieces of one: one of a cell lets nobody through, the
475
+ * ground about a wall being kept off by the radius of what walks (a gatehouse of 3 by 3 lets through what is 1 wide) @beta
476
+ */
477
+ wall?: {
478
+ family: string;
479
+ gate?: boolean;
480
+ };
481
+ /** Seconds it lasts before it is gone by itself, like a ward */
482
+ lifetime?: number;
483
+ /** Enemies cannot see it, `after` seconds after it came into the world, unless something reveals it to them */
484
+ invisible?: {
485
+ after?: number;
486
+ };
487
+ /** Goes down after this many attacks and spells, whatever they deal: its health counts hits */
488
+ hits?: number;
489
+ /**
490
+ * What the computer player takes it for (`AiHints`): its roles (`worker`, `hall`, `soldier`...), the game's words
491
+ * about it, what it answers. Declared where what the kit infers from the rest of the definition is wrong or cannot
492
+ * be known; inferred otherwise (`inferRoles` in `@v12-engine/engine/ai`)
493
+ */
494
+ ai?: AiHints;
495
+ /** Its armour type, the column of the game's damage table (`GameRules.combat.damageTable`): `light`, `heavy`, `fortified`… */
496
+ armourType?: string;
497
+ }
498
+ /**
499
+ * How an ability is aimed
500
+ *
501
+ * @beta
502
+ */
503
+ export type AbilityTarget = 'none' | 'unit' | 'point' | 'direction' | 'passive';
504
+ /**
505
+ * What every effect may say, whatever its type: who of what it reaches it applies to (`effectTargets`)
506
+ *
507
+ * @beta
508
+ */
509
+ export interface EffectCommon {
510
+ /** Only hits what carries this buff */
511
+ ifBuff?: string;
512
+ /** Only hits heroes */
513
+ only?: 'heroes';
514
+ /** Only hits these kinds of things. Everything but resources when left out */
515
+ kinds?: EntityKind[];
516
+ /** Where what it hits has to be: on the ground, in the air. Both when left out */
517
+ layers?: Layer[];
518
+ /** Makes the effect hit everything around the point of impact. Required for auras, and the size of a missile */
519
+ radius?: Scaled;
520
+ /** Who an effect with a radius applies to. Follows from the kind of effect when left out */
521
+ affects?: 'enemies' | 'allies' | 'all';
522
+ /** Applies to the caster, wherever the ability was aimed */
523
+ on?: 'caster';
524
+ }
525
+ /**
526
+ * The fields the engine's effects read, by name: each type of effect has those of them it reads (`EffectTypes`, a
527
+ * `Pick` of these), and a game's own type picks of them or says its own
528
+ *
529
+ * @beta
530
+ */
531
+ export interface EffectFields {
532
+ /** For `teleport`: where to, however far: the caster's side's home (`homeOf`), where it was aimed, or by its target */
533
+ to?: 'home' | 'point' | 'target';
534
+ amount?: Scaled;
535
+ /** Id of the buff to put on the targets */
536
+ buff?: string;
537
+ /** Unit type, for effects that bring one into the world */
538
+ unit?: string;
539
+ /** For `onHit`: only while the attacker carries this buff */
540
+ whileBuff?: string;
541
+ /** For `charged`: what happens when the ability is not charged */
542
+ otherwise?: EffectDef[];
543
+ /** For missiles: buildings and trees in its way stop it, without anything happening to them */
544
+ blocked?: boolean;
545
+ /** For `onKill`: only when it was an attack of the carrier that killed */
546
+ attack?: boolean;
547
+ /** For `refresh`: the ability that is ready again, when it is not the one the effect belongs to */
548
+ ability?: string;
549
+ /** For `dash`: how high the caster rises on the way, which makes it a leap. For whoever draws it */
550
+ leap?: number;
551
+ /**
552
+ * For a leap: how much higher than where it takes off the ground on its way may stand. What stands higher
553
+ * is a wall to it: it comes down in front of it. Over anything when left out
554
+ */
555
+ climb?: number;
556
+ /** Seconds the buff lasts, when that is different from its usual duration */
557
+ duration?: Scaled;
558
+ /**
559
+ * What the stats of the caster add to the amount: `{ abilityPower: 0.6 }` adds 60% of its ability power.
560
+ * `level` is for every level of the hero past the first
561
+ */
562
+ scaling?: Scaling;
563
+ /** For damage. Magic when left out */
564
+ damageType?: DamageType;
565
+ /** For damage: how what it kills dies, for the screen, over the ability's own `how` */
566
+ how?: string;
567
+ /** For missiles: seconds they take shape where they were cast before they set off. The caster is free to go */
568
+ delay?: Scaled;
569
+ /** For missiles: how fast they travel, in units per second, and how far */
570
+ speed?: number;
571
+ distance?: Scaled;
572
+ /** For missiles: how many are sent, spread over an angle in radians. What one of them hit the others pass by */
573
+ count?: Scaled;
574
+ spread?: number;
575
+ /** For missiles: flies after the unit the ability was cast on, and only hits that one */
576
+ homing?: boolean;
577
+ /** For missiles: flies to the spot the ability was aimed at and stops there, `distance` away at the most */
578
+ toPoint?: boolean;
579
+ /** For missiles: how far the team of the caster sees around it */
580
+ sight?: number;
581
+ /**
582
+ * What happens to what is hit. For missiles: everything they pass through. For `onHit`: the target of an attack.
583
+ * For `dash`: what is around where it ends. For `after`: what is there when the time is up. For `zone`: what is inside, over and over
584
+ */
585
+ effects?: EffectDef[];
586
+ /** For missiles that were not stopped, and for zones: what happens where and when they end */
587
+ onEnd?: EffectDef[];
588
+ /**
589
+ * For `after`: the name its arrival goes by for whoever draws it and plays its sound, where one ability sets off
590
+ * several that do not look alike: the last of a barrage. The ability's own when left out
591
+ */
592
+ impact?: string;
593
+ /** For missiles: goes on after it hit something. False for the ones that are used up by the first thing in their way */
594
+ pierce?: boolean;
595
+ /**
596
+ * For missiles: thrown, not shot. It goes `height` up in the middle of its way and comes down at its end, `time`
597
+ * seconds after it set off however far that is (`speed` otherwise). It flies over everything, and what is within
598
+ * its `radius` where it comes down is what it hits
599
+ */
600
+ arc?: {
601
+ height: number;
602
+ time?: number;
603
+ };
604
+ /**
605
+ * For missiles: where it would be done (it reached its target, was used up by what it hit, came down, or came to
606
+ * the end of its way) it springs on to the nearest thing it may hit within `range` that it has not hit yet, and
607
+ * flies after that one, `count` times. Every spring takes `falloff` of the amounts off what it does (0.25: a
608
+ * quarter less each time). Its `onEnd` is where it is done for good
609
+ */
610
+ bounce?: {
611
+ count: Scaled;
612
+ range: number;
613
+ falloff?: number;
614
+ };
615
+ /** For `buff`: adds one to how many of it the target carries instead of renewing it, up to what the buff allows */
616
+ stack?: boolean;
617
+ /** For `exchange`: the resource the caster's owner trades away, by id */
618
+ sell?: string;
619
+ /** For `exchange`: the resource the caster's owner trades for, by id */
620
+ buy?: string;
621
+ /** For `exchange`: how much of `buy` comes for each one of `sell` (0.5: 100 lumber for 50 gold) */
622
+ rate?: number;
623
+ }
624
+ /**
625
+ * The types of effect there are, each with the fields it reads: the engine's, and a game's own, added by declaration
626
+ * merging as it defines them (`declare module '@v12-engine/engine' { interface EffectTypes { arrowStun: { ... } } }`,
627
+ * with `defineEffect`)
628
+ *
629
+ * @beta
630
+ */
631
+ export interface EffectTypes {
632
+ /** Hurts what it reaches: `amount`, with what of the caster's stats adds to it (`scaling`), of a type (magic when left out) */
633
+ damage: Pick<EffectFields, 'amount' | 'scaling' | 'damageType' | 'how'>;
634
+ /** Heals what it reaches, more for the caster's heal and shield power */
635
+ heal: Pick<EffectFields, 'amount' | 'scaling'>;
636
+ /** Gives mana to what it reaches */
637
+ mana: Pick<EffectFields, 'amount' | 'scaling'>;
638
+ /** Puts a buff on what it reaches: for its own time or `duration`, one more of it with `stack` */
639
+ buff: {
640
+ buff: string;
641
+ } & Pick<EffectFields, 'duration' | 'stack'>;
642
+ /** Sends a missile: how fast, how far, how many, and what it does to what it passes through and where it ends */
643
+ missile: Pick<EffectFields, 'speed' | 'distance' | 'count' | 'spread' | 'homing' | 'toPoint' | 'delay' | 'sight' | 'blocked' | 'pierce' | 'arc' | 'bounce' | 'effects' | 'onEnd'>;
644
+ /** A passive's buff on what is around the carrier, kept up by the ability system */
645
+ aura: {
646
+ buff: string;
647
+ };
648
+ /** Brings a unit of the caster's into the world where it landed, for `duration` seconds or for good */
649
+ spawn: {
650
+ unit: string;
651
+ } & Pick<EffectFields, 'duration'>;
652
+ /** Puts a buff on the caster for as long as it likes, or takes it off */
653
+ toggle: {
654
+ buff: string;
655
+ };
656
+ /** The caster's team sees the spot for a while */
657
+ reveal: Pick<EffectFields, 'duration'>;
658
+ /** A passive's: `effects` happen to the target of every attack of the carrier, while it carries `whileBuff` */
659
+ onHit: Pick<EffectFields, 'whileBuff' | 'effects'>;
660
+ /** The caster is ready to strike again at once */
661
+ resetAttack: object;
662
+ /** The caster is elsewhere at once, `distance` away at the most */
663
+ blink: Pick<EffectFields, 'distance'>;
664
+ /** The caster is elsewhere at once, however far (`to`) */
665
+ teleport: Pick<EffectFields, 'to'>;
666
+ /** The caster rushes to the spot (a leap with `leap`), and `effects` happen around where it ends */
667
+ dash: Pick<EffectFields, 'distance' | 'leap' | 'climb' | 'speed' | 'effects' | 'buff'>;
668
+ /** Throws what it reaches `distance` away from the caster */
669
+ knockback: Pick<EffectFields, 'distance' | 'speed' | 'leap'>;
670
+ /** An ability of the caster is ready again: `ability`, or the one the effect belongs to */
671
+ refresh: Pick<EffectFields, 'ability'>;
672
+ /** A passive's: `effects` happen around whoever the carrier kills (by an attack, with `attack`) */
673
+ onKill: Pick<EffectFields, 'attack' | 'effects'>;
674
+ /** A passive's: `effects` happen to the carrier whenever it casts */
675
+ onCast: Pick<EffectFields, 'effects'>;
676
+ /** `effects` when the ability went off charged, `otherwise` when it did not */
677
+ charged: Pick<EffectFields, 'effects' | 'otherwise'>;
678
+ /** `effects` happen at the spot, `delay` seconds from now */
679
+ after: Pick<EffectFields, 'delay' | 'effects' | 'impact'>;
680
+ /** For `duration` seconds `effects` happen to what is at the spot, over and over, and `onEnd` at the end */
681
+ zone: Pick<EffectFields, 'duration' | 'effects' | 'onEnd'>;
682
+ /** Finds what is invisible around the spot: the caster's team sees it for `duration` seconds */
683
+ detect: Pick<EffectFields, 'duration'>;
684
+ /** Raises `count` of the corpses around the spot as units of `unit`, for `duration` seconds or for good */
685
+ raiseDead: {
686
+ unit: string;
687
+ } & Pick<EffectFields, 'duration' | 'count'>;
688
+ /**
689
+ * Makes `count` copies of the target, for `duration` seconds: they deal `dealt` of its damage (a third when left out)
690
+ * and take `taken` times what they are dealt (twice when left out)
691
+ */
692
+ illusion: Pick<EffectFields, 'count' | 'duration'> & {
693
+ dealt?: number;
694
+ taken?: number;
695
+ };
696
+ /** Takes the buffs off what it reaches, and hurts what is summoned by `amount` */
697
+ dispel: Pick<EffectFields, 'amount'>;
698
+ /**
699
+ * Trades `amount` of a resource of the caster's owner (`sell`) for another (`buy`), `rate` of it for each one sold:
700
+ * a marketplace's (`presetMarket`, `exchange` in code). Nothing of it with less than `amount` to sell
701
+ */
702
+ exchange: {
703
+ sell: string;
704
+ buy: string;
705
+ rate: number;
706
+ amount: Scaled;
707
+ };
708
+ /**
709
+ * A tome's, in a game with the tomes pack (`withTomes`): what it reaches gains `gain` for good (a point of strength),
710
+ * a hero `xp` experience and `levels` levels
711
+ */
712
+ tome: {
713
+ gain?: StatChange;
714
+ xp?: number;
715
+ levels?: number;
716
+ };
717
+ /**
718
+ * Mana burn, in a game with its pack (`withManaBurn`): takes `amount` of the mana of what it reaches, and hurts it by
719
+ * as much as it took, times `ratio` (1 when left out), magic damage unless `damageType` says
720
+ */
721
+ manaBurn: Pick<EffectFields, 'amount' | 'scaling' | 'damageType'> & {
722
+ ratio?: number;
723
+ };
724
+ /**
725
+ * A town portal, in a game with the portals pack (`withPortals`): the caster and as many as `count` (12 when left out)
726
+ * of its own units within `radius` (7) of it are at once at its side's home nearest where it was aimed (`homeOf`)
727
+ */
728
+ townPortal: Pick<EffectFields, 'count'>;
729
+ }
730
+ /**
731
+ * One thing an ability does: its `type`, which picks the handler and says which fields it has (`EffectTypes`)
732
+ *
733
+ * @beta
734
+ */
735
+ export type EffectDef = {
736
+ [K in keyof EffectTypes]: {
737
+ type: K;
738
+ } & EffectCommon & EffectTypes[K];
739
+ }[keyof EffectTypes];
740
+ /**
741
+ * An effect seen as any type may be, every field of the engine's by its name: for what reads effects of every type
742
+ * alike (an ability's tooltip numbers, the rules' check of what they name). A handler reads its own type's
743
+ * (`EffectOf`)
744
+ *
745
+ * @beta
746
+ */
747
+ export type AnyEffect = {
748
+ type: keyof EffectTypes;
749
+ } & EffectCommon & Partial<EffectFields>;
750
+ /**
751
+ * An effect as any type may be (`AnyEffect`), its fields by name
752
+ *
753
+ * @beta
754
+ */
755
+ export declare const anyEffect: (effect: EffectDef) => AnyEffect;
756
+ /**
757
+ * An effect of one type
758
+ *
759
+ * @beta
760
+ */
761
+ export type EffectOf<K extends keyof EffectTypes> = {
762
+ type: K;
763
+ } & EffectCommon & EffectTypes[K];
764
+ /**
765
+ * The ground an ability covers: what the player aims with, and what is shown when it goes off
766
+ *
767
+ * @beta
768
+ */
769
+ export type AimShape = {
770
+ shape: 'circle';
771
+ radius: number;
772
+ } | {
773
+ shape: 'line';
774
+ length: number;
775
+ width: number;
776
+ }
777
+ /** A fan from the caster: `angle` is how wide it opens, in radians */
778
+ | {
779
+ shape: 'cone';
780
+ length: number;
781
+ angle: number;
782
+ };
783
+ /** @beta */
784
+ export interface AbilityDef {
785
+ id: string;
786
+ name: string;
787
+ /**
788
+ * How what its damage kills dies, for the screen (`'burnt'`, `'frozen'`, `'blasted'`): the death's `how`, which the
789
+ * view shows its way. A word, or one decided for each blow: by its level, its caster, what it hit. An effect's own
790
+ * (`EffectDef.how`) goes over it; the `death` hook has the last say
791
+ */
792
+ how?: string | ((hit: {
793
+ caster: Entity;
794
+ target: Entity;
795
+ level: number;
796
+ amount: number;
797
+ }) => string | undefined);
798
+ /**
799
+ * The definition this one is a copy of, made from the data (`copyOf` in a `data.json`, the editor's Copy as new):
800
+ * what it is drawn, heard and pictured as where the game gives it no look of its own
801
+ */
802
+ basedOn?: string;
803
+ /**
804
+ * What it does, in words: a template with values in braces, worked out for the caster as it is now ("Deals {damage}
805
+ * magic damage" shows "Deals 80 (50 + 60% ability power) magic damage"). The values are its own (`values`), or found
806
+ * in its effects: `damage`, `heal`, `shield`, `amount`, `duration`, `radius`, `range`, `cooldown`, `charges`, `refill`,
807
+ * `mana`, `count`, `distance` (see `abilityValues`)
808
+ */
809
+ description?: string;
810
+ /** Values of its own to put in its description, by name: an amount and what of the caster scales it, or worked out in code */
811
+ values?: Record<string, AbilityValueDef>;
812
+ /** What it does, said in code instead of `description`: words with `{values}` in them, or words and values already put together */
813
+ describe?: (context: AbilityTextContext) => string | TextSegment[];
814
+ hotkey?: string;
815
+ /**
816
+ * none: happens at once. unit, point: needs a target, and the caster walks into range of it.
817
+ * direction: goes off from where the caster stands, towards where it was aimed. passive: always on, cannot be cast
818
+ */
819
+ target: AbilityTarget;
820
+ /** What may be targeted, for abilities cast on a unit */
821
+ targets?: {
822
+ allies?: boolean;
823
+ enemies?: boolean;
824
+ self?: boolean;
825
+ kinds?: EntityKind[];
826
+ layers?: Layer[];
827
+ heroes?: boolean;
828
+ };
829
+ manaCost?: Scaled;
830
+ /** Health it costs, as a part of all the caster can have. It cannot be cast with less than that left */
831
+ healthCost?: Scaled;
832
+ /** Seconds before it can be used again */
833
+ cooldown?: Scaled;
834
+ /**
835
+ * Uses it holds, for one used so many times before it waits: `count` of them at the most, one more back every
836
+ * `refill` seconds while it holds fewer (shortened as the cooldown is). Each use spends one; with none left it is not
837
+ * ready. Its `cooldown`, where it has one, is then the time between two uses. Full when it is learned
838
+ */
839
+ charges?: {
840
+ count: Scaled;
841
+ refill: Scaled;
842
+ };
843
+ /** How far away the target may be */
844
+ range?: Scaled;
845
+ /** The target may be as far away as the caster's attacks reach, and `range` farther */
846
+ attackRange?: boolean;
847
+ /**
848
+ * What kind of thing it is, for those who can keep out of its way: a buff that `avoids` one of these
849
+ * lets nothing of the ability happen to who carries it. `ground` is for what comes out of the ground or along it
850
+ */
851
+ tags?: string[];
852
+ /** Levels a hero can put into it. 3 when left out */
853
+ maxLevel?: number;
854
+ /** Hero level needed for the first level of the ability. Ultimates ask for 6 */
855
+ requiresLevel?: number;
856
+ /** Hero levels between two levels of the ability. 2 when left out */
857
+ levelStep?: number;
858
+ /**
859
+ * Seconds between starting to cast and the effect. The caster stands still for as long and cannot be
860
+ * called away: what it is told to do in the meantime, it does right after. None when left out
861
+ */
862
+ castTime?: number;
863
+ /** Gets through a unit's immunity to spells (see `UnitTypeDef.spellImmune`), as an ultimate may. Or for the targets its function says */
864
+ piercesImmunity?: boolean | ((world: World, target: Entity) => boolean);
865
+ /** The ground it covers, when that is not what its effects say: see `aimOf` */
866
+ aim?: {
867
+ shape: 'circle';
868
+ radius: Scaled;
869
+ } | {
870
+ shape: 'line';
871
+ length: Scaled;
872
+ width: Scaled;
873
+ } | {
874
+ shape: 'cone';
875
+ length: Scaled;
876
+ angle: number;
877
+ };
878
+ /** Units use it on their own when they have nothing else to do. The player can switch this off */
879
+ autocast?: boolean;
880
+ /**
881
+ * A buff of the caster that charges the ability when it has as many stacks as it can: the ability shows it, its
882
+ * `charged` effects do their other thing, and casting it takes the buff away
883
+ */
884
+ charge?: string;
885
+ effects: EffectDef[];
886
+ /** What an ability that is cast does all the time besides, once it is learned: buffs, auras, `onHit` */
887
+ passive?: EffectDef[];
888
+ /**
889
+ * Autocast in code, for any kind of ability: where to use it now, or nothing. Asked when the unit has nothing to
890
+ * do, the ability is switched to autocast, ready and paid for. Without it, only abilities cast on a unit autocast,
891
+ * on the worst-off target their core effects would do good to
892
+ */
893
+ autoAim?: (world: World, caster: Entity, state: AbilityState) => {
894
+ target?: number;
895
+ point?: Vec2;
896
+ } | null | undefined;
897
+ /**
898
+ * How a computer player uses it, from what it sees (see `AiView`): where, or `null` for not now. What the engine
899
+ * works out from its core effects when it gives nothing; an ability of the game's own effects has to say
900
+ */
901
+ ai?: (view: AbilityAiView, caster: EntityState, level: number) => {
902
+ point: Vec2;
903
+ target?: number;
904
+ } | null | undefined;
905
+ /** How far away the target may be, in code: the range on high ground, say. `range` is what the screen shows */
906
+ rangeOf?: (world: World, caster: Entity, level: number) => number;
907
+ /** Seconds of the wind-up, in code: shortened by haste, say. `castTime` when left out */
908
+ castTimeOf?: (world: World, caster: Entity, level: number) => number;
909
+ /**
910
+ * Kept up once it went off: the caster stands, for `duration` seconds, doing it every `every` seconds (effects, or
911
+ * code), until it is done or interrupted (another order, a stun), when `interrupted` runs. An ice storm
912
+ */
913
+ channel?: {
914
+ duration: number | ((world: World, caster: Entity, level: number) => number);
915
+ every?: number;
916
+ effects?: EffectDef[];
917
+ run?: (world: World, caster: Entity, level: number, target: Entity | undefined, point: Vec2) => void;
918
+ interrupted?: (world: World, caster: Entity, level: number) => void;
919
+ /** What it does once kept up to the end, and only then: a recall's teleport home */
920
+ finished?: EffectDef[];
921
+ /** Broken off when the caster is hurt, as a recall is: any damage, from anyone */
922
+ breaksOnDamage?: boolean;
923
+ };
924
+ }
925
+ /**
926
+ * What the stats of the caster add to an amount. `level` is for every level of a hero past the first,
927
+ * `bonusAttackDamage` for the attack damage it has on top of what its type and its levels give it
928
+ *
929
+ * @beta
930
+ */
931
+ export type Scaling = Partial<Record<StatKey | 'level' | 'bonusAttackDamage', Scaled>>;
932
+ /**
933
+ * Something lasting on a unit that changes what it can do
934
+ *
935
+ * @beta
936
+ */
937
+ export interface BuffDef extends ScaledStatChange {
938
+ id: string;
939
+ name: string;
940
+ /**
941
+ * The definition this one is a copy of, made from the data (`copyOf` in a `data.json`, the editor's Copy as new):
942
+ * what it is drawn, heard and pictured as where the game gives it no look of its own
943
+ */
944
+ basedOn?: string;
945
+ description?: string;
946
+ /** Seconds. Lasts until removed when left out */
947
+ duration?: number;
948
+ /** A debuff: by default it goes on enemies */
949
+ harmful?: boolean;
950
+ /** The unit cannot do anything. A function says so for one carrier, one moment */
951
+ stun?: boolean | BuffCheck;
952
+ /** Thrown into the air for as long as it lasts. Comes with a stun, the rest is for the eye */
953
+ airborne?: boolean;
954
+ /** Knocked down: it lies on the ground for as long as it lasts, and gets up at the end. For the eye, like `airborne` */
955
+ down?: boolean;
956
+ /** Brings what flies down: it counts as being on the ground, for whatever is aimed at it */
957
+ grounds?: boolean;
958
+ /**
959
+ * Its carrier is invisible to enemies for as long as it lasts, unless they find it (`detect`): a Wind Walk. A function
960
+ * says so for one carrier, one moment
961
+ */
962
+ invisible?: boolean | BuffCheck;
963
+ /** The unit cannot move from the spot. It can still fight and cast. A function says so for one carrier, one moment */
964
+ root?: boolean | BuffCheck;
965
+ /**
966
+ * The unit cannot use its abilities. What it carries and the spells every hero has still work. A function says
967
+ * which abilities it keeps it from (`(ability) => ability.tags?.includes('fire')`): the screen asks it too
968
+ */
969
+ silence?: boolean | ((ability: AbilityDef) => boolean);
970
+ /** Damage it takes in place of the unit, for as long as the buff lasts and there is something left of it */
971
+ shield?: Scaled;
972
+ /** What the stats of whoever gave the shield add to it */
973
+ shieldScaling?: Scaling;
974
+ /** The shield is as good as new once the unit has not been hurt for this many seconds */
975
+ recharge?: number;
976
+ /** Tags of abilities that do nothing to who carries it, for as long as it does: `ground` for someone up in the air */
977
+ avoids?: string[];
978
+ /** Who carries it does not attack while it lasts: burrowed, or disarmed. Or while its function says */
979
+ disarm?: boolean | BuffCheck;
980
+ /** Who carries it is immune to spells while it lasts, as an avatar is (see `UnitTypeDef.spellImmune`). Or while its function says */
981
+ spellImmune?: boolean | BuffCheck;
982
+ /**
983
+ * Whether a dispel takes it off (see the effect `dispel`). Yes when left out: no for what nothing should end early.
984
+ * Decided in code for each dispel: by who dispels it (`by`), its level
985
+ */
986
+ dispellable?: boolean | ((world: World, carrier: Entity, instance: BuffInstance, by: Entity) => boolean);
987
+ /** How many of it one unit can carry at most. What puts it on says whether it adds one (`stack`) */
988
+ maxStacks?: number;
989
+ /** What happens around who carried it when its time is up, in the name of who put it there. Not when it is taken off */
990
+ onEnd?: EffectDef[];
991
+ /** Its stats count once for every stack it has (`stacks`), rather than once: "each stack, -5% move speed" */
992
+ perStack?: boolean;
993
+ /**
994
+ * Stats of its own, worked out in code, on top of what it declares: "+2 armor for each ally near". Asked when the
995
+ * carrier's stats are added up, which is only when something they come from changed: what this depends on beyond
996
+ * the buff (allies near, the time) calls `invalidateStats` when it changes
997
+ */
998
+ change?: (world: World, carrier: Entity, instance: BuffInstance) => StatChange | undefined;
999
+ /**
1000
+ * What happens when it is put on a unit that has it already. `strongest` (the default): the higher level wins,
1001
+ * the longer among equals. `refresh`: the time starts over, the level the new one's. `perSource`: one of it for
1002
+ * every unit that puts it on, each of its own (two poisons from two casters). `independent`: a new one every time.
1003
+ * A function decides from the one there and the one coming: `replace` it, `renew` its time, `add` another, or `keep`
1004
+ */
1005
+ stacking?: 'strongest' | 'refresh' | 'perSource' | 'independent' | ((existing: BuffInstance, incoming: IncomingBuff) => 'replace' | 'renew' | 'add' | 'keep');
1006
+ /** What happens as it is put on: effects in the name of who put it there (while they live), or code */
1007
+ onApply?: EffectDef[] | BuffHandler;
1008
+ /** What happens every `every` seconds while it lasts: effects in the name of who put it there (while they live), or code, which runs whoever is left */
1009
+ onTick?: {
1010
+ every: number;
1011
+ effects?: EffectDef[];
1012
+ run?: BuffHandler;
1013
+ };
1014
+ /** Code run when it comes off, run out (`expired`) or taken off. Not for the buffs of something that dies */
1015
+ onRemove?: (world: World, carrier: Entity, instance: BuffInstance, expired: boolean) => void;
1016
+ }
1017
+ /** Whether a buff does what it says (stuns, roots) to one carrier, at this moment */
1018
+ export type BuffCheck = (world: World, carrier: Entity, instance: BuffInstance) => boolean;
1019
+ /** Code a buff runs on its carrier: as it is put on, or every so often */
1020
+ export type BuffHandler = (world: World, carrier: Entity, instance: BuffInstance) => void;
1021
+ /** A buff about to be put on, as a `stacking` function sees it */
1022
+ export interface IncomingBuff {
1023
+ level: number;
1024
+ /** Seconds */
1025
+ duration: number;
1026
+ /** Who puts it on, by id: 0 for nobody */
1027
+ source: number;
1028
+ }
1029
+ /**
1030
+ * Where an item is in a shop. The client's tiers, or a game's own (`GameView.shopTiers`)
1031
+ *
1032
+ * @beta
1033
+ */
1034
+ export type ItemTier = 'consumable' | 'starter' | 'basic' | 'epic' | 'legendary' | (string & {});
1035
+ /** @beta */
1036
+ export interface ItemDef {
1037
+ id: string;
1038
+ name: string;
1039
+ /** How good it is, 1 and up (campaign plan GP3): what an item table draws by (`{ level: 3 }`) */
1040
+ level?: number;
1041
+ /** Its kind of item, a word of the game's (`permanent`, `charged`, `powerup`): what an item table draws by too */
1042
+ class?: string;
1043
+ /**
1044
+ * The definition this one is a copy of, made from the data (`copyOf` in a `data.json`, the editor's Copy as new):
1045
+ * what it is drawn, heard and pictured as where the game gives it no look of its own
1046
+ */
1047
+ basedOn?: string;
1048
+ description?: string;
1049
+ cost: Cost;
1050
+ /** Uses before it is gone. Items without charges stay */
1051
+ charges?: number;
1052
+ /** Id of the ability the item gives: using the item casts it, without mana */
1053
+ ability?: string;
1054
+ /** Id of an ability whose passive part works for whoever carries the item */
1055
+ passive?: string;
1056
+ /** Items it is made of. Those the buyer carries are used up and taken off the price, which is for all of it */
1057
+ from?: string[];
1058
+ /** Where it goes in a shop: consumable, starter, basic, epic, legendary */
1059
+ tier?: ItemTier;
1060
+ /** Applies for as long as the item is carried */
1061
+ bonus?: StatChange;
1062
+ /** How many a shop has at most, and the seconds it takes to get one back. As many as anyone wants when left out */
1063
+ stock?: {
1064
+ max: number;
1065
+ restock: number;
1066
+ };
1067
+ hotkey?: string;
1068
+ /**
1069
+ * Used as it is picked up, by walking over it or by the order, and never carried: a rune, a tome. Its ability is cast by
1070
+ * whoever picked it. In a game with the runes pack (`withRunes`, whose `powerUp` says it in code)
1071
+ */
1072
+ powerUp?: boolean;
1073
+ }
1074
+ /**
1075
+ * A big army is paid for with income: past a certain supply, less arrives of what workers gather of the resources with `upkeep`
1076
+ *
1077
+ * @beta
1078
+ */
1079
+ export interface UpkeepTier {
1080
+ /** Applies when the player uses more supply than this */
1081
+ above: number;
1082
+ name: string;
1083
+ /** Part of what is gathered that still arrives, 0..1 */
1084
+ income: number;
1085
+ }
1086
+ /**
1087
+ * What a level of research changes
1088
+ *
1089
+ * @beta
1090
+ */
1091
+ export interface UpgradeEffect extends StatChange {
1092
+ /** Unit types that benefit, or a function of the type. Everything the player owns when left out */
1093
+ units?: string[] | ((def: UnitTypeDef) => boolean);
1094
+ }
1095
+ /**
1096
+ * Research that improves a player's units for the rest of the game
1097
+ *
1098
+ * @beta
1099
+ */
1100
+ export interface UpgradeDef {
1101
+ id: string;
1102
+ name: string;
1103
+ /**
1104
+ * The definition this one is a copy of, made from the data (`copyOf` in a `data.json`, the editor's Copy as new):
1105
+ * what it is drawn, heard and pictured as where the game gives it no look of its own
1106
+ */
1107
+ basedOn?: string;
1108
+ description?: string;
1109
+ /** Paid for every level */
1110
+ cost: Cost;
1111
+ /** Seconds per level */
1112
+ researchTime: number;
1113
+ maxLevel?: number;
1114
+ /** Building types needed, one list per level. Levels past the end of the list need nothing */
1115
+ requires?: string[][];
1116
+ /** The race it is of (`GameModule.races`): only its players may research it. Everyone's when left out */
1117
+ race?: string;
1118
+ hotkey?: string;
1119
+ effects: UpgradeEffect[];
1120
+ /**
1121
+ * What it does besides stats, in code, to each unit of the player's: as a level is researched (to the units there
1122
+ * are), and as a unit comes into the world while the player has it. Gives an ability, lets a unit hit what flies.
1123
+ * Run again for every level: what it does is up to it to not do twice
1124
+ */
1125
+ apply?: (world: World, entity: Entity, level: number) => void;
1126
+ }
1127
+ /**
1128
+ * The types a building can be upgraded into (`UnitTypeDef.upgradesTo`), as a list: one for most, none for one that
1129
+ * turns into nothing
1130
+ *
1131
+ * @beta
1132
+ */
1133
+ export declare const upgradesOf: (def: Pick<UnitTypeDef, 'upgradesTo'>) => readonly string[];
1134
+ /** @beta */
1135
+ export declare const footprintOf: (def: UnitTypeDef) => {
1136
+ w: number;
1137
+ d: number;
1138
+ };
1139
+ /**
1140
+ * What base stats are worked out under: the rules of a game, and what its own stats start at. A `Registry` is one
1141
+ *
1142
+ * @beta
1143
+ */
1144
+ export interface StatSource {
1145
+ readonly rules: Readonly<GameRules>;
1146
+ /** Every stat of the game at 0, its own at their default */
1147
+ readonly statDefaults: Readonly<Stats>;
1148
+ }
1149
+ /**
1150
+ * The stats a unit type starts with, all of them, in a game: `world.registry`, or `session.registry` on a player's
1151
+ * screen. By day unless it says otherwise
1152
+ *
1153
+ * @beta
1154
+ */
1155
+ export declare function baseStats(def: UnitTypeDef, game: StatSource, night?: boolean): Readonly<Stats>;
1156
+ /**
1157
+ * The ground an ability covers at a level: a line for what it sends on its way, a circle for what hits an area.
1158
+ * Undefined for abilities that are about one unit, or about nothing in particular.
1159
+ *
1160
+ * @beta
1161
+ */
1162
+ export declare function aimOf(ability: AbilityDef, level: number): AimShape | undefined;