Skip to content

RequirementLevel ​

Inherits: Requirement < Resource

Requires the entity to be at or above a level, and optionally at or below another (a level range: a buff that only works up to level 60)

Properties ​

intrequired_level1
intmax_level0
boolfollow_item_levelfalse
intitem_level_offset0

Methods ​

intrequired_for( context: Dictionary )
boolcheck_in_context( entity: Entity, context: Dictionary )
Stringget_failure_message_in_context( entity: Entity, context: Dictionary )
Stringget_summary_in_context( context: Dictionary )
boolcheck( entity: Entity )
Stringget_failure_message( entity: Entity )
Stringget_summary()
Array[Dictionary]validate()
voidconnect_to_entity_signals( entity: Entity )
voiddisconnect_from_entity_signals( entity: Entity )

Property descriptions ​

int required_level = 1 ​

Minimum level required

int max_level = 0 ​

Maximum level (0 = no limit)

bool follow_item_level = false ​

On an item: the level needed is the item level of the item (an item generated at level 30 needs level 30) instead of the number above. Does nothing on other things

int item_level_offset = 0 ​

With "follow item level": how many levels under the item level the entity may be (2: an item of level 30 needs level 28). 0 = the item level itself

Method descriptions ​

int required_for( context: Dictionary ) ​

The level this requirement asks for, given what it guards ({"item_level": int} on an item)

bool check_in_context( entity: Entity, context: Dictionary ) ​

Is the entity inside the level range?

String get_failure_message_in_context( entity: Entity, context: Dictionary ) ​

The reason shown when the level is too low or too high.

String get_summary_in_context( context: Dictionary ) ​

The text of the requirement for the tooltip (the level or the range).

bool check( entity: Entity ) ​

Does the entity meet the requirement?

String get_failure_message( entity: Entity ) ​

The reason shown when the entity does not meet the requirement.

String get_summary() ​

A short text about the requirement and its settings.

Array[Dictionary] validate() ​

A maximum level below the required level can never be met

void connect_to_entity_signals( entity: Entity ) ​

Connect to entity level change signals

void disconnect_from_entity_signals( entity: Entity ) ​

Disconnect from entity level change signals