@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/hero.d.ts
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { Cost } from './defs';
|
|
2
|
+
import { type Entity, type PlayerId } from './entity';
|
|
3
|
+
import type { Vec2 } from './math';
|
|
4
|
+
import type { World } from './world';
|
|
5
|
+
import type { EntityState, LearnableInfo, XpInfo } from './session/protocol';
|
|
6
|
+
import type { GamePack } from './packs/pack';
|
|
7
|
+
import type { HeroSummary } from './session/protocol';
|
|
8
|
+
/**
|
|
9
|
+
* The id of the heroes pack (`withHeroes`): `hasPack(game, HEROES)`
|
|
10
|
+
*
|
|
11
|
+
* @beta
|
|
12
|
+
*/
|
|
13
|
+
export declare const HEROES = "core.heroes";
|
|
14
|
+
/**
|
|
15
|
+
* The numbers and formulas of heroes, the heroes pack's (`withHeroes(rules)`): how many heroes a player may
|
|
16
|
+
* have, how much experience a level takes, what bringing one back costs. The classic RTS numbers for
|
|
17
|
+
* those left out
|
|
18
|
+
*
|
|
19
|
+
* @beta
|
|
20
|
+
*/
|
|
21
|
+
export interface HeroRules {
|
|
22
|
+
/** Heroes a player can have at once, fallen ones and ones being trained included */
|
|
23
|
+
maxHeroes: number;
|
|
24
|
+
/** The level heroes stop at, unless their type says otherwise (`HeroDef.maxLevel`) */
|
|
25
|
+
maxHeroLevel: number;
|
|
26
|
+
/** Heroes this close to a kill get a share of the experience */
|
|
27
|
+
xpRange: number;
|
|
28
|
+
/** Experience needed in total to be of a level. Level 1 must need none */
|
|
29
|
+
xpForLevel(level: number): number;
|
|
30
|
+
/** Experience a kill is worth, for units whose type does not say (`UnitTypeDef.xp`) */
|
|
31
|
+
killXp(world: World, dead: Entity): number;
|
|
32
|
+
/** What it costs to bring a fallen hero back, in the game's money, and how long it takes in seconds */
|
|
33
|
+
revive(world: World, hero: Entity): {
|
|
34
|
+
cost: Cost;
|
|
35
|
+
time: number;
|
|
36
|
+
};
|
|
37
|
+
/** Ability points a hero gets for reaching a level. One, when left out */
|
|
38
|
+
pointsForLevel(level: number): number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The heroes pack, as `withHeroes` makes it: its rules beside its parts
|
|
42
|
+
*
|
|
43
|
+
* @beta
|
|
44
|
+
*/
|
|
45
|
+
export interface HeroesPack extends GamePack {
|
|
46
|
+
/** What the game says of heroes, over the engine's (`defaultHeroRules`): what the pack was made with (`GameRules.heroes`) */
|
|
47
|
+
options: Partial<HeroRules>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* What a hero has earned: its level, its experience, the points it has to put into abilities (`heroState`)
|
|
51
|
+
*
|
|
52
|
+
* @beta
|
|
53
|
+
*/
|
|
54
|
+
export interface HeroState {
|
|
55
|
+
level: number;
|
|
56
|
+
/** Experience in total */
|
|
57
|
+
xp: number;
|
|
58
|
+
/** Points that can be put into abilities */
|
|
59
|
+
points: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* What a player is told of a hero (`heroState`): its level, to everyone who sees it; its experience to its side, and to
|
|
63
|
+
* everyone where the rules share it (`GameRules.hud.shareXp`); the points it has to spend and what it can learn, to its
|
|
64
|
+
* side
|
|
65
|
+
*
|
|
66
|
+
* @beta
|
|
67
|
+
*/
|
|
68
|
+
export interface HeroSent {
|
|
69
|
+
level: number;
|
|
70
|
+
/** Its experience: its side's, and everyone's where the rules share it */
|
|
71
|
+
xp?: XpInfo;
|
|
72
|
+
/** Points it has to put into abilities: its side's */
|
|
73
|
+
points?: number;
|
|
74
|
+
/** The abilities it can put points into, how far and whether now: its side's */
|
|
75
|
+
learnable?: LearnableInfo[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* A hero: what it has earned (`HeroState`). Set as a unit of a type that says it is one (`UnitTypeDef.hero`) is made,
|
|
79
|
+
* filed by owner (`world.index.with(heroState, player)`, `heroesOf`). What is a hero is what has it: a fallen hero stays
|
|
80
|
+
* in the world's entities, out of the world, to be brought back
|
|
81
|
+
*
|
|
82
|
+
* @beta
|
|
83
|
+
*/
|
|
84
|
+
export declare const heroState: import("./components").Component<HeroState, HeroSent>;
|
|
85
|
+
/**
|
|
86
|
+
* What a hero has earned: none for what is no hero (`heroState`)
|
|
87
|
+
*
|
|
88
|
+
* @beta
|
|
89
|
+
*/
|
|
90
|
+
export declare const heroOf: (entity: Entity) => HeroState | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* What a player was told of a hero in their snapshot (`heroState`): its level to everyone, its experience, points and
|
|
93
|
+
* what it can learn to its side. None for what is no hero
|
|
94
|
+
*
|
|
95
|
+
* @beta
|
|
96
|
+
*/
|
|
97
|
+
export declare const heroOfState: (state: EntityState) => HeroSent | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* The level a hero stops at
|
|
100
|
+
*
|
|
101
|
+
* @beta
|
|
102
|
+
*/
|
|
103
|
+
export declare const maxLevelOf: (world: World, entity: Entity) => number;
|
|
104
|
+
/**
|
|
105
|
+
* Gives a hero experience: `from` what was killed, when that is where it comes from. The `beforeXp` hook has its say
|
|
106
|
+
*
|
|
107
|
+
* @beta
|
|
108
|
+
*/
|
|
109
|
+
export declare function grantXp(world: World, entity: Entity, amount: number, from?: Entity): void;
|
|
110
|
+
/**
|
|
111
|
+
* Puts a hero at a level as if it had got there: the points to spend, the stats that grew, the experience of that
|
|
112
|
+
* level. No message, no event and no `beforeXp`: for a hero that starts a map at that level, not one that earns it.
|
|
113
|
+
* Never down
|
|
114
|
+
*
|
|
115
|
+
* @beta
|
|
116
|
+
*/
|
|
117
|
+
export declare function setHeroLevel(world: World, entity: Entity, level: number): void;
|
|
118
|
+
/**
|
|
119
|
+
* Experience a kill is worth
|
|
120
|
+
*
|
|
121
|
+
* @beta
|
|
122
|
+
*/
|
|
123
|
+
export declare function xpWorth(world: World, entity: Entity): number;
|
|
124
|
+
/**
|
|
125
|
+
* Hero level needed to put the next point into an ability
|
|
126
|
+
*
|
|
127
|
+
* @beta
|
|
128
|
+
*/
|
|
129
|
+
export declare function levelNeeded(world: World, hero: Entity, ability: string): number;
|
|
130
|
+
/**
|
|
131
|
+
* Whether a hero may put a point into an ability now: by points, levels and its learning, and the `canLearn` hook
|
|
132
|
+
*
|
|
133
|
+
* @beta
|
|
134
|
+
*/
|
|
135
|
+
export declare function canLearn(world: World, hero: Entity, ability: string): boolean;
|
|
136
|
+
/** @beta */
|
|
137
|
+
export declare function learn(world: World, hero: Entity, ability: string): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Heroes a player has, fallen ones included
|
|
140
|
+
*
|
|
141
|
+
* @beta
|
|
142
|
+
*/
|
|
143
|
+
export declare function heroesOf(world: World, player: number): Entity[];
|
|
144
|
+
/**
|
|
145
|
+
* What it costs to bring a hero back, in the game's money, and how long it takes
|
|
146
|
+
*
|
|
147
|
+
* @beta
|
|
148
|
+
*/
|
|
149
|
+
export declare function reviveCost(world: World, hero: Entity): {
|
|
150
|
+
cost: Cost;
|
|
151
|
+
time: number;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Puts a fallen hero back into the world
|
|
155
|
+
*
|
|
156
|
+
* @beta
|
|
157
|
+
*/
|
|
158
|
+
export declare function reviveHero(world: World, hero: Entity, at: Vec2): void;
|
|
159
|
+
/**
|
|
160
|
+
* How long until a fallen hero comes back by itself, in seconds: none for one that is not waiting
|
|
161
|
+
*
|
|
162
|
+
* @beta
|
|
163
|
+
*/
|
|
164
|
+
export declare function respawnIn(world: World, hero: Entity): number | undefined;
|
|
165
|
+
/** A hero back, to those who see it */
|
|
166
|
+
export declare const toldRevived: import("./replication").ReplicatedEvent;
|
|
167
|
+
/** A hero's new level, to those who see it */
|
|
168
|
+
export declare const toldLevelUp: import("./replication").ReplicatedEvent;
|
|
169
|
+
/** Experience gained: its side's alone, an enemy sees a bar move, not why */
|
|
170
|
+
export declare const toldXp: import("./replication").ReplicatedEvent;
|
|
171
|
+
/**
|
|
172
|
+
* A player's heroes, as their portraits show them (`PlayerState.own.heroes`): their level, health and mana, and how far
|
|
173
|
+
* a fallen one is through being brought back, at an altar or by itself
|
|
174
|
+
*
|
|
175
|
+
* @beta
|
|
176
|
+
*/
|
|
177
|
+
export declare function heroSummaries(world: World, player: PlayerId): HeroSummary[];
|
package/dist/home.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A side's home (`homeOf`): where its heroes come back (`withRespawn`) and are recalled to (an ability's `teleport` to
|
|
3
|
+
* `home`). Of nothing but the world, so that an ability's effects and the heroes' respawn each read it alone
|
|
4
|
+
*/
|
|
5
|
+
import type { PlayerId } from './entity';
|
|
6
|
+
import { type Vec2 } from './math';
|
|
7
|
+
import type { World } from './world';
|
|
8
|
+
/**
|
|
9
|
+
* A side's home, where its heroes come back and are recalled to: the map's point named `home.<team>` (`home.1`), or
|
|
10
|
+
* else the structure of the player's side nearest `near` (its core, its hall), or else nothing
|
|
11
|
+
*
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
export declare function homeOf(world: World, player: PlayerId, near?: Vec2): Vec2 | undefined;
|