Inherits:Perk
Section:perk
Priority:0
PerkPerk grants units perk-related functions such as attaching perks.
Unit-specific settings are written in the “perk” section.
{ "perk": { "options": { "apply": [String, ...], } } }
Type:Array of String
The names of the perks to be applied to the unit. The perks must already exist in the system.
Type:Undefined
Registers the perk with the system. A perk cannot be attached unless it is registered. The perk's global initialization process is executed when registered.
Parameter | Type | Description |
---|---|---|
perk | Perk | The perk to register. |
Undefined.
Type:Object
Target:Instance
This object holds the perks attached to this unit. Each item has the following keys:
Parameter | Type | Description |
---|---|---|
object | Perk | The perk attached. |
Type:Undefined
Target:Unit
Attaches the perk passed in the argument to the unit. If the perk depends on other perks, dependent perks are attached first. The attached perk is added to the perks in unit's inventory. When attaching, each park's init() method is called and the unit is upgraded. If the specified perk is already attached, nothing is done.
Parameter | Type | Description |
---|---|---|
perk | Perk | The perk to attach. |
options | Object | Options. Passed to the init() method of the attaching perk. |
Undefined.
Type:Undefined
Target:Unit
Attaches all the perks depending on the settings using the attachl spell. The order of attaching is based on the priority number of each perk, the lower the number the earlier.
Parameter | Type | Description |
---|---|---|
options | Object | Options. Has the following keys: |
“settings” | Object | The unit settings. |
Undefined.