Items

Items are rules in the simulation: a unit carries up to six, buys and sells them at shops, and an item can give flat bonuses and an active ability. The six item sockets already exist in the in-game interface. The rules behind them are built; the editor page and the network orders are not.

What a map defines

An optional file objects/items.toml holds the items and the shops. A map without the file has no items, and nothing about the map format changes.

Field of an item Meaning
id, name, tooltip, icon Identity and words. No icon shows a glyph.
cost Gold to buy. sell_percent (default 50) is paid back when sold.
stats Flat bonuses while carried: health, mana, damage, armor, magic_resist.
ability The active use: the id of an ability of the map, so its effects, mana, cooldown, cast time and bolt all come from that ability.
charges 0 is permanent. Otherwise each accepted use spends one, and the item is gone at 0.

A shop is a building of the map: [[shop]] names the building definition, the item ids it sells and its range (default 640 distance units). An unknown field, such as a misspelt stat, is an error that names the file.

The rules

  • A unit has six slots.
  • Buy: the buyer is alive, the shop is a finished building on its side that lists the item and is in range, and the buyer has a free slot and the gold. Otherwise nothing changes.
  • Sell: near any shop of its side; you get the sell percentage back.
  • Move: swaps two slots.
  • Use: casts the item's ability through the normal cast path, so cooldown, mana and cast time are the ability's. A charge is spent only when the cast is accepted.
  • Passive bonuses are added when the item enters a slot and removed exactly when it leaves.
  • Scripts get OnItemBought, OnItemSold and OnItemUsed.

All four actions are commands, so they work the same in a game over a network once the online order messages exist.

Not built yet

  • The online messages for buying, selling, moving and using (the network session adds them).
  • Items on the ground, drops on a hero's death and pickup; shop stock and restock timers.
  • The pink ward as a consumable item.
  • The editor page for items and shops, and a shop panel in the game.
  • Combining recipes stay a script's job.