The unittype object

From Scenario League Wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Back To TOTPP Functions


id (get)

unittype.id -> integer

Returns the id of the unit type.


name (get)

unittype.name -> string

Returns the name of the unit type.


prereq (get/set)

unittype.prereq -> tech

Returns the prerequisite technology of the unit type, or `nil` if it doesn't have one. Ephemeral.


domain (get/set)

unittype.domain -> integer

Returns the domain of the unit type (0 - Ground, 1 - Air, 2 - Sea). Ephemeral.


attack (get/set)

unittype.attack -> integer

Returns the attack factor of the unit type. Ephemeral.


defense (get/set)

unittype.defense -> integer

Returns the defense factor of the unit type. Ephemeral.


hitpoints (get/set)

unittype.hitpoints -> integer

Returns the number of hit points of the unit type. Ephemeral.


firepower (get/set)

unittype.firepower -> integer

Returns the firepower of the unit type. Ephemeral.


move (get/set)

unittype.move -> integer

Returns the movement rate of the unit type. Ephemeral.


range (get/set)

unittype.range -> integer

Returns the range of the unit type. Ephemeral.


expires (get/set)

unittype.expires -> tech

Returns the tech that renders the unit obsolete, or `nil` if there isn't any. Ephemeral.


cost (get/set)

unittype.cost -> integer

Returns the cost of the unit type. Ephemeral.


hold (get/set)

unittype.hold -> integer

Returns the number of holds of the unit type. Ephemeral.


role (get/set)

unittype.role -> integer

Returns the role of the unit type. Ephemeral.


flags (get/set)

unittype.flags -> integer

Returns the flags of the unit type (bitmask). Ephemeral.


nativeTransport (get/set)

unittype.nativeTransport -> integer

Returns the 'native transport' settings of the unit type (bitmask).


buildTransport (get/set)

unittype.buildTransport -> integer

Returns the 'build transport site' settings of the unit type (bitmask).


useTransport (get/set)

unittype.useTransport -> integer

Returns the 'use transport site' settings of the unit type (bitmask).


canEnter

unittype:canEnter(tile) -> boolean

Alias for `civ.canEnter(unittype, tile)`