RegionObject class

class app.engine.objects.region.RegionObject

A region object in the game. Not the same as a Region Prefab, which is the unchanging Region you created in the level editor.

Inherits from the Region Prefab to access Region’s helper functions like area and center.

nid

The unique identifier for the region object.

Type:

NID

region_type

The type of region (Event, Formation, etc.).

Type:

RegionType

position

The position of the region object. Defaults to None.

Type:

Pos

size

The size of the region object in tiles. Defaults to [1, 1].

Type:

Tuple[int, int]

sub_nid

Extra data for the region object. Defaults to None.

Type:

str

condition

The condition for the region object to be enabled. Defaults to ‘True’.

Type:

str

time_left

The number of turns left for the region object. Defaults to None, which means it is permanent.

Type:

Optional[int]

only_once

Flag indicating if the region object triggers only once. Defaults to False.

Type:

bool

interrupt_move

Flag indicating if the region object interrupts movement. Defaults to False. Set to True for things like an FE Mine or for Free Roam events

Type:

bool

RegionPrefab class

The RegionObject also has access to these functions of its parent class:

class app.events.regions.Region

A region prefab that has not been instantiated as a Region Object yet

nid

The unique identifier for the region object.

Type:

NID

region_type

The type of region (Event, Formation, etc.).

Type:

RegionType

position

The position of the region object. Defaults to None.

Type:

Pos

size

The size of the region object in tiles. Defaults to [1, 1].

Type:

Tuple[int, int]

sub_nid

Extra data for the region object. Defaults to None.

Type:

str

condition

The condition for the region object to be enabled. Defaults to ‘True’.

Type:

str

time_left

The number of turns left for the region object. Defaults to None, which means it is permanent.

Type:

Optional[int]

only_once

Flag indicating if the region object triggers only once. Defaults to False.

Type:

bool

interrupt_move

Flag indicating if the region object interrupts movement. Defaults to False. Set to True for things like an FE Mine or for Free Roam events

Type:

bool

property area: int

Calculate the area of the region.

Returns:

The area of the region (width x height tiles).

Return type:

int

property center: Tuple[int, int]

Calculate the center position of the region.

Returns:

The center position of the region.

Return type:

Pos

contains(pos: Tuple[int, int]) bool

Check if the given position is within the region.

Parameters:

pos (Pos) – The position to check.

Returns:

True if the position is within the region, False otherwise.

Return type:

bool

get_all_positions() List[Tuple[int, int]]

Get all positions covered by the region.

Returns:

A list of all positions covered by the region.

Return type:

List[Pos]