Enums table
Section titled “Enums table”A table containing all enums used in the game.
The value of an enum is its own type. string or number cannot be used in place of an enum. Use the values contained in any of the tables for any function that takes an enum as a parameter. You can also use the enums from any function or property that returns one.
The enums table can be accessed as follows:
game.enumsExamples
Section titled “Examples”-- pass an enum as a parameterunit:get_stat(game.enums.Stat.attack, game.enums.Adjective.physical)
-- get an enum from a property and compare it to anotheris_skeleton = unit.family == game.enums.Family.skeletonSubtables
Section titled “Subtables”Adjective
Section titled “Adjective ”Access all the values of the Adjective enum. Can be accessed as follows:
game.enums.AdjectiveAllegiance
Section titled “Allegiance ”Access all the values of the Allegiance enum. Can be accessed as follows:
game.enums.AllegianceCorpseFilter
Section titled “CorpseFilter ”Access all the values of the CorpseFilter enum. Can be accessed as follows:
game.enums.CorpseFilterFamily
Section titled “Family ”Access all the values of the Family enum. Can be accessed as follows:
game.enums.FamilyHealthFilter
Section titled “HealthFilter ”Access all the values of the HealthFilter enum. Can be accessed as follows:
game.enums.HealthFilterAccess all the values of the Stat enum. Can be accessed as follows:
game.enums.StatTargetPriority
Section titled “TargetPriority ”Access all the values of the TargetPriority enum. Can be accessed as follows:
game.enums.TargetPriorityAccess all the values of the Team enum. Can be accessed as follows:
game.enums.TeamAdjective
Section titled “Adjective”An adjective describes a type of damage.
Units may deal specific types of damage, such as physical or poison. Units may also be resistant or particularly vulnerable to certain adjectives.
Values
Section titled “Values ”- physical
- poison
A value of the Adjective enum can be accessed as follows:
game.enums.Adjective.physicalAllegiance
Section titled “Allegiance”An allegiance describes a relationship between two units. Units may be opponent or ally to each other: player's units are ally to each other, but opponent to the enemy's units.
Use the any allegiance when you want to ignore the allegiance of a unit, for example if an attack can hit both opponents and allies.
Values
Section titled “Values ”- any
- opponent
- ally
A value of the Allegiance enum can be accessed as follows:
game.enums.Allegiance.anyCorpseFilter
Section titled “CorpseFilter”Filters based on whether a unit is a corpse (i.e. dead) or not.
Use the any corpse value when you want to ignore whether a unit is a corpse or not, for example if an ability can target both corpses and living units.
Values
Section titled “Values ”- any
- no
- yes
A value of the CorpseFilter enum can be accessed as follows:
game.enums.CorpseFilter.anyFamily
Section titled “Family”The family of a unit.
Families can be used, for example, to implement abilities that only affect units of the same family.
Values
Section titled “Values ”- skeleton
A value of the Family enum can be accessed as follows:
game.enums.Family.skeletonHealthFilter
Section titled “HealthFilter”Filter based on the health of a unit.
Values
Section titled “Values ”- any
Ignores the health of the unit when filtering.
- full
Matches only units in full health.
- damaged
Matches only units with less than full health.
A value of the HealthFilter enum can be accessed as follows:
game.enums.HealthFilter.anyAn attribute of a unit.
Used when retreiving or buffing stats.
Values
Section titled “Values ”- attack
The damage a unit deals.
A value of the Stat enum can be accessed as follows:
game.enums.Stat.attackTargetPriority
Section titled “TargetPriority”A targetting priority, used when selecting a target for an ability.
Values
Section titled “Values ”- closest
A value of the TargetPriority enum can be accessed as follows:
game.enums.TargetPriority.closestA side of the battle. Units can be on either team.
Used when spawning units, and units use it to decide who to target. Targetting is usually determined by the Allegiance: units belonging to the same team are ally, and units belonging to different teams are opponent.
Values
Section titled “Values ”- player
The units belonging to the player.
- enemy
The enemy units.
A value of the Team enum can be accessed as follows:
game.enums.Team.playerProperties
Section titled “Properties ”opponent Read only
Section titled “opponent Read only ”opponent: Team
The opponent team to this.
If this is the player team, then enemy is returned. If this is the enemy team, then player is returned.