Skip to content

SetBonusDefinition ​

Inherits: DatabaseResource < Resource

Clean set bonus system with ID-based lazy loading to prevent circular dependencies

Properties ​

Dictionaryset_bonus_effects{}
Array[int]set_item_ids[]

Methods ​

Dictionaryget_set_bonus_effects()
Effectget_effect_for_piece_count( piece_count: int )
boolhas_bonus_at_count( piece_count: int )
Array[int]get_bonus_piece_counts()
voidset_bonus_effect( piece_count: int, effect: Effect )
voidset_bonus_effect_id( piece_count: int, effect_id: int )
boolremove_bonus_effect( piece_count: int )
voidclear_bonus_effects()
intget_max_bonus_count()
Array[ItemDefinitionEquipment]get_set_items()
voidadd_set_item( equipment: ItemDefinitionEquipment, auto_link: bool = true )
boolremove_set_item( equipment: ItemDefinitionEquipment, auto_unlink: bool = true )
boolcontains_item( equipment: ItemDefinitionEquipment )
intget_set_size()
voidclear_set_items( auto_unlink: bool = true )
intcount_equipped_set_pieces( entity: Entity )
Array[Effect]get_active_set_bonus_effects( entity: Entity )
boolhas_set_bonus_active( entity: Entity, piece_count: int )
Dictionaryget_set_completion_info( entity: Entity )
Array[Dictionary]validate()
boolis_valid()
Array[Dictionary]validate_and_fix_relationships( auto_fix: bool = false )

Property descriptions ​

Set Bonuses

Dictionary set_bonus_effects = ​

Dictionary mapping piece count to effect IDs: {2: 12345, 4: 67890, 6: 54321}

Set Composition

Array[int] set_item_ids = [] ​

Equipment piece IDs that are part of this set (prevents circular loading)

Method descriptions ​

Dictionary get_set_bonus_effects() ​

Get set bonus effects dictionary (returns IDs)

Effect get_effect_for_piece_count( piece_count: int ) ​

Get effect for specific piece count (lazy loaded from ID)

bool has_bonus_at_count( piece_count: int ) ​

Check if there's a bonus at this piece count

Array[int] get_bonus_piece_counts() ​

Get all piece counts that have bonuses

void set_bonus_effect( piece_count: int, effect: Effect ) ​

Set bonus effect for specific piece count (stores ID)

void set_bonus_effect_id( piece_count: int, effect_id: int ) ​

Set bonus effect by ID directly

bool remove_bonus_effect( piece_count: int ) ​

Remove bonus effect for specific piece count

void clear_bonus_effects() ​

Clear all bonus effects

int get_max_bonus_count() ​

Get maximum piece count with bonus

Array[ItemDefinitionEquipment] get_set_items() ​

Get all equipment definitions that are part of this set (lazy loaded)

void add_set_item( equipment: ItemDefinitionEquipment, auto_link: bool = true ) ​

Add an equipment piece to the set with bidirectional linking

bool remove_set_item( equipment: ItemDefinitionEquipment, auto_unlink: bool = true ) ​

Remove an equipment piece from the set with bidirectional unlinking

bool contains_item( equipment: ItemDefinitionEquipment ) ​

Check if an equipment piece is part of this set

int get_set_size() ​

Get the total number of items in this set

void clear_set_items( auto_unlink: bool = true ) ​

Clear all items from the set with bidirectional unlinking

int count_equipped_set_pieces( entity: Entity ) ​

Count how many pieces of this set an entity has equipped

Array[Effect] get_active_set_bonus_effects( entity: Entity ) ​

Get all active set bonus effects for an entity

bool has_set_bonus_active( entity: Entity, piece_count: int ) ​

Check if entity has specific set bonus active

Dictionary get_set_completion_info( entity: Entity ) ​

Get set completion info for an entity

Array[Dictionary] validate() ​

Validate set configuration

bool is_valid() ​

Is it free of errors?

Array[Dictionary] validate_and_fix_relationships( auto_fix: bool = false ) ​

Validate and optionally fix relationship consistency