RuleSettings beta
Interface of @v12-engine/engine
export interface RuleSettingsThe numbers and formulas of a kind of game that are not about any one unit: the supply cap, what selling gives back, how a hit is mitigated. In groups, each about one thing: supply, production, the economy, combat, movement, the fog, talk, the camps, heroes, what the HUD is told, the score. A game module changes the ones it wants (Rules.settings: any of a group, the rest of it the engine's) and a pack the ones it brings (GamePack.settings).
Read them from world.settings in the simulation, and from session.registry.settings on a player's screen.
Members
camps
camps: CampSettings;Creeps' camps (camps.ts, CampSettings): how far from its centre a camp fights (leash), how long a creep chases without a blow (chaseTime), how long after the last blow the camp goes home (resetAfter), whether all of it answers a hit at once (helpAtOnce), whether creeps sleep at home at night until attacked (sleep), and the seconds after a camp is cleared that it comes back (respawn; never when left out). What makes creeps keep to them, sleep and come back is the heroes pack's (heroesPack). See docs/creeps.md
combat
combat: CombatSettings;How a hit lands and how much of it is felt, and who fights whom (CombatSettings)
economy
economy: EconomySettings;What is paid back, paid for and given away (EconomySettings)
fog
fog: FogSettings;What is seen and kept of what was (FogSettings)
heroes
heroes: HeroSettings;Heroes' numbers (HeroSettings): how many a player may have, the experience a level takes, what bringing one back costs. The heroes pack's to change (heroesPack(rules)); the classic RTS numbers when left out
hud
hud: HudSharing;What of a unit the players who see it are told beyond what they always are (its health, mana, level, buffs and their stacks), for the plates over it to show (indicators-plan U3): the seconds left of its buffs, its abilities, a hero's experience. Nothing more than that when left out
items
items: ItemSettings;What a hero may carry and how what it carries works (ItemSettings): the limits of groups of items (one pair of boots), unique passives counted once, the game's own rule of what may be carried
mayCommand
mayCommand(world: World, player: PlayerId, entity: Entity): boolean;Whether a player may command an entity: its owner, and whoever the owner shares control with (world.sides.shareControl, a force's sharedControl), when left out. What every command is checked against, and what decides whose units a player is told the own state of (orders, the queue, the bag)
movement
movement: MovementSettings;How units find their way among each other (MovementSettings)
production
production: ProductionSettings;What buildings make and how they go up (ProductionSettings)
score
score?: ScoreSettings;What the game counts of its players for its score (a classic RTS score screen): kills, losses, damage, healing, resources, its own (ScoreSettings, presetScore(), defineStat). Counted by the rules as the game goes, kept in saves, told to the players as it says. Nothing is counted when left out
shop
shop: ShopSettings;Shops (ShopSettings): the seconds within which a purchase is taken back
supply
supply: SupplySettings;What armies cost in supply, and how much a player may have (SupplySettings)
talk
talk: TalkSettings;Pings, chat and pauses (TalkSettings)