Abilities

Abilities are assigned to Units. An Ability MUST have at least one AbilityCommand, but can have multiple commands.

The cooldown of an Ability should always be longer than it’s cast time. If the cooldown is shorter than the cast time, then the ability is "always castable" and the cooldown is not required at all. An exception is an Autocast Ability that should be "chain-autocast".

Types of abilities:

diagram

Inventory

The inventory ability defines an inventory. Assign the inventory ability to a unit for the unit to have that inventory. If a unit has at least one inventory ability, it can receive Items. A unit can have multiple inventories. A common usecase for multiple inventories is to separate a unit’s equipment from it’s back-bag by using 2 inventory abilities.

An Inventory is a list of slots and every slot has an "Equip" boolean flag that determines if an item in that slot should be regarded as "equipped".

Instant

This is called "instant" because the player does not need to select a target for the ability. However, an instant ability can still have a cast time.

The target of an instant ability is always the casting unit.

Target

Targeted abilities require the user to select a target. A target can either be a Unit or a point. How does the system find out if the target should be a unit or a point?

  • A range of zero on a targeted Ability does not make much sense.

  • Targeted Abilities consult their first Effect:

Interactable

An interactable ability is an ability that a unit "offers" to another unit. It is assigned to the unit that will execute it. However, the owning Unit will not trigger the execution of the ability itself. It will execute it, paying the Cast Cost, but the triggering Unit will be a different one.

There can only be one Interactable ability on a unit.

An example usecase for Interactable Abilities is the "charcoal kiln" in Valheim. If you approach this building, it gives you the option to press "E" and thereby transfer wood from your inventory to the building. In this case the building is the owner of the interactable ability.

Train

Train is NYI.

Use a Train Ability to train (build) a unit. Train Abilities carry an array of TrainingInfo classes. This is because one train ability can trigger more than one training. E.g. a Barracks can train more than one type of unit.

Research

Research is NYI.

A Research ability is a train ability targeted at Upgrades.