GamePack beta
Interface of @v12-engine/engine
export interface GamePackA part of the rules a game opts into (Rules.packs): commands, orders, systems, hooks and the state it keeps, which a game without it pays nothing for. The engine's heroes, camps and shops are one (heroesPack). A game's own lists come after a pack's, so a command, an order, a hook or a system of the same id or name takes its place; withoutCommands, withoutOrders, withoutSystems and withoutHooks take one of a pack's out as they do the engine's
Members
check
check?(map: GameMap, registry: Registry): MapProblem[];What it finds wrong with a map in the editor, beside what the game finds (MapEditorDef.check)
commands
commands?: CommandDef[];Commands it takes, beside the engine's (defineCommand)
components
components?: Component<any>[];The state it keeps on entities, players and the world (defineComponent)
effects
effects?: EffectType[];Kinds of ability effects it brings (defineEffect), beside the engine's: one of the game's of the same type takes its place
events
events?: EventKey<any>[];The events it tells of (defineEvent), listed as a game's are
hooks
hooks?: HookDef[];Its handlers of hooks, after the engine's and before the game's (defineHook)
id
id: string;Unique among a game's packs: how a game, a mod or the editor asks whether it is on (hasPack)
listeners
listeners?: ListenerDef[];How it reacts to events (defineListener)
options
options?: unknown;What it was made with, as plain data: what a game's hash names it by, beside its id (gameHash), so that one pack made two ways is two games
orders
orders?: OrderBehavior[];Orders its units can be given, beside the engine's
replications
replications?: ReplicatedEvent[];How events of the world of its own are told to the players (replicateEvent), after the engine's
report
report?(world: World, player: PlayerId): Record<string, unknown>;What it adds to the game's report of a player at the end (Rules.report), beside the game's own
requires
requires?: string[];The packs it is made to go with, by id: a game with it and without one of them is refused
settings
settings?(settings: Readonly<RuleSettings>): RuleSettingsInit;The rules it changes: handed the game's as they come out (the engine's, the game's over them, the packs' before it), it gives what it lays over them. A function of them, so that what it says can be made of what was there (the lanes' supply: none for a minion, the game's own for the rest)
snapshotFields
snapshotFields?: SnapshotField[];Parts of the players' snapshots of its own (SnapshotField), after the engine's
statFields
statFields?: StatField[];What it adds to a unit's stats, kept up to date as the engine keeps the rest (StatField)
stats
stats?: StatDef[];The stats it brings, next to the engine's and the game's own (StatDef, as Rules.stats)
systems
systems?: SystemDef[];Systems, run with the engine's in the phase each says (see System)
timers
timers?: TimerDef[];What it sets to go off later (defineTimer): listed, so that a save finds them by id
victory
victory?: SystemDef | null;How a game with it is won, where the game says nothing of its own (Rules.victory): the last pack's that says