Skip to content

ItemDefinitionEquipment ​

Inherits: ItemDefinition < DatabaseResource < Resource

Inherited by: ItemDefinitionAmmo, ItemDefinitionBag, ItemDefinitionEquipmentWeapon

Equipment items that can be worn by characters to provide stat bonuses and visual changes

Properties ​

Dictionarystat_bonuses{}
intequipment_type
intarmor_class
intdurability_override0
Dictionarymodular_mesh_data{}
Array[int]equipment_effects[]
inton_use_ability_id0
Array[int]socket_definitions[]
intfull_sockets_effect0
intset_bonus_definition0
floatbudget_multiplier1.0
boolrandomize_statsfalse
AffixPoolModestat_affix_modeAffixPoolMode.ANY_THAT_FIT
Array[int]stat_affix_ids[]
boolrandomize_effectsfalse
AffixPoolModeeffect_affix_modeAffixPoolMode.ANY_THAT_FIT
Array[int]effect_affix_ids[]
Dictionaryequipment_effect_costs{}

Methods ​

boolneeds_generation()
Array[int]get_socket_definitions()
intget_socket_count()
boolhas_sockets()
SocketDefinitionget_socket_definition( index: int )
voidadd_socket( socket_def: SocketDefinition )
boolremove_socket( socket_def: SocketDefinition )
boolremove_socket_at_index( index: int )
voidclear_sockets()
Effectget_full_sockets_effect()
voidset_full_sockets_effect( effect: Effect )
boolhas_full_socket_bonus()
Dictionarycreate_mesh_assignment( mesh_path: String, material_overrides: Array[Material] = [], scale: float = 1.0 )
Array[String]get_defined_tags()
voidset_body_part_mesh( tag: String, body_part: GeneralSkeleton.BodySlot, mesh_path: String, material_overrides: Array[Material] = [], scale: float = 1.0 )
voidset_attachment_mesh( tag: String, attachment_point: GeneralSkeleton.AttachmentSlot, mesh_path: String, material_overrides: Array[Material] = [], scale: float = 1.0 )
Dictionaryget_body_part_mesh_assignment( tag: String, body_part: GeneralSkeleton.BodySlot )
Dictionaryget_attachment_mesh_assignment( tag: String, attachment_point: GeneralSkeleton.AttachmentSlot )
Array[GeneralSkeleton.BodySlot]get_assigned_body_parts( tag: String )
Array[GeneralSkeleton.AttachmentSlot]get_assigned_attachment_points( tag: String )
boolhas_body_part_mesh( tag: String, body_part: GeneralSkeleton.BodySlot )
boolhas_attachment_mesh( tag: String, attachment_point: GeneralSkeleton.AttachmentSlot )
boolhas_mesh_assignments()
boolhas_mesh_assignments_for_tag( tag: String )
intget_total_mesh_count()
intget_mesh_count_for_tag( tag: String )
EquipmentTypeDefinitionget_equipment_type()
ArmorClassDefinitionget_armor_class()
boolis_weapon()
boolaffects_body_part( body_part: GeneralSkeleton.BodySlot )
booluses_attachment_point( attachment_point: GeneralSkeleton.AttachmentSlot )
Dictionaryget_affected_mesh_slots()
voidclear_all_mesh_assignments()
voidclear_mesh_assignments_for_tag( tag: String )
voidclear_body_part_mesh( tag: String, body_part: GeneralSkeleton.BodySlot )
voidclear_attachment_mesh( tag: String, attachment_point: GeneralSkeleton.AttachmentSlot )
boolcan_use( user: Entity, item_instance: ItemInstance = null )
boolexecute_use( user: Entity, item_instance: ItemInstance )
Stringget_use_action_name( item_instance: ItemInstance )
Array[Effect]get_equipment_effects()
Dictionaryget_effective_stat_bonuses( item_instance: ItemInstance )
Array[Effect]get_effective_equipment_effects( item_instance: ItemInstance )
boolbelongs_to_set()
SetBonusDefinitionget_set_bonus_definition()
voidset_set_bonus_definition( set_def: SetBonusDefinition )
Stringget_set_name()
boolis_set_bonus_active_for_entity( entity: Entity, piece_count: int )
Stringget_set_bonus_description( entity: Entity = null )
Array[ItemDefinitionEquipment]get_set_siblings()
Dictionaryget_set_completion_with_this_item( entity: Entity )
Array[int]would_complete_set_bonus( entity: Entity )
Array[int]would_break_set_bonus( entity: Entity )

Enumerations ​

enum AffixPoolMode ​

Which affixes a randomized list of the item can pick from

  • ANY_THAT_FIT = 0 - Every affix whose conditions the item meets (equipment type, item level, quality)
  • ONLY_THESE = 1 - Only the affixes listed on the item

Property descriptions ​

Stat Modifications

Dictionary stat_bonuses = ​

Unified stat bonuses - Dictionary mapping stat_id (int) to bonus value (float) Example: {1: 10.0, 5: 5.5} means stat ID 1 gets +10, stat ID 5 gets +5.5

Equipment Properties

int equipment_type ​

Equipment type and mesh slot compatibility

int armor_class ​

Armor classification: "Plate", "Leather", "Cloth"

Durability

int durability_override = 0 ​

The durability of this item (0 = what the equipment slot it is worn in gives, -1 = it never wears, a number = its own). Used when the project uses durability

Visual Properties - Modular Mesh Data

Dictionary modular_mesh_data = ​

Nested mesh data structure keyed by modular equipment type tag Structure: modular_mesh_data[tag_string] = { "body_part_meshes": {}, "attachment_meshes": {} }

Effects and Abilities

Array[int] equipment_effects = [] ​

Effects granted while equipped

int on_use_ability_id = 0 ​

Optional ability that can be activated when equipped

Socket System

Array[int] socket_definitions = [] ​

Available sockets for this equipment

int full_sockets_effect = 0 ​

Bonus effect when all sockets are filled

Set Bonus

int set_bonus_definition = 0 ​

Set this equipment belongs to

Generation

float budget_multiplier = 1.0 ​

Multiplies the stat budget of this item (a two-handed axe 1.5). The stats and effects written on the item are paid from the budget first

bool randomize_stats = false ​

Bonus stats are rolled when the item is generated: affixes are picked from the pool below, how many by its quality. The stats above stay (they count toward the budget)

AffixPoolMode stat_affix_mode = AffixPoolMode.ANY_THAT_FIT ​

Where the stat affixes come from

Array[int] stat_affix_ids = [] ​

ONLY_THESE: the stat affixes (Affix ids) this item can roll

bool randomize_effects = false ​

Effects are rolled when the item is generated: effect affixes are picked from the pool below, how many by its quality. The effects above stay

AffixPoolMode effect_affix_mode = AffixPoolMode.ANY_THAT_FIT ​

Where the effect affixes come from

Array[int] effect_affix_ids = [] ​

ONLY_THESE: the effect affixes (Affix ids) this item can roll

Dictionary equipment_effect_costs = ​

What each authored effect costs from the budget: effect id -> cost (an effect without an entry is free)

Method descriptions ​

bool needs_generation() ​

Is the item generated when it is given (it rolls something or scales with its item level)?

Array[int] get_socket_definitions() ​

Get socket definitions for this equipment

int get_socket_count() ​

Get total number of sockets

bool has_sockets() ​

Check if this equipment has sockets

SocketDefinition get_socket_definition( index: int ) ​

Get socket definition by index

void add_socket( socket_def: SocketDefinition ) ​

Add a socket definition

bool remove_socket( socket_def: SocketDefinition ) ​

Remove a socket definition

bool remove_socket_at_index( index: int ) ​

Remove socket by index

void clear_sockets() ​

Clear all sockets

Effect get_full_sockets_effect() ​

Get full sockets effect

void set_full_sockets_effect( effect: Effect ) ​

Set full sockets effect

bool has_full_socket_bonus() ​

Check if this equipment has a full socket bonus

Dictionary create_mesh_assignment( mesh_path: String, material_overrides: Array[Material] = [], scale: float = 1.0 ) ​

Makes the record of a mesh of the item: its path, material overrides and scale.

Array[String] get_defined_tags() ​

Get all tags that have mesh data defined

void set_body_part_mesh( tag: String, body_part: GeneralSkeleton.BodySlot, mesh_path: String, material_overrides: Array[Material] = [], scale: float = 1.0 ) ​

Set body part mesh for a specific tag

void set_attachment_mesh( tag: String, attachment_point: GeneralSkeleton.AttachmentSlot, mesh_path: String, material_overrides: Array[Material] = [], scale: float = 1.0 ) ​

Set attachment mesh for a specific tag

Dictionary get_body_part_mesh_assignment( tag: String, body_part: GeneralSkeleton.BodySlot ) ​

Get body part mesh assignment for a specific tag

Dictionary get_attachment_mesh_assignment( tag: String, attachment_point: GeneralSkeleton.AttachmentSlot ) ​

Get attachment mesh assignment for a specific tag

Array[GeneralSkeleton.BodySlot] get_assigned_body_parts( tag: String ) ​

Get all assigned body parts for a specific tag

Array[GeneralSkeleton.AttachmentSlot] get_assigned_attachment_points( tag: String ) ​

Get all assigned attachment points for a specific tag

bool has_body_part_mesh( tag: String, body_part: GeneralSkeleton.BodySlot ) ​

Check if a body part mesh is assigned for a specific tag

bool has_attachment_mesh( tag: String, attachment_point: GeneralSkeleton.AttachmentSlot ) ​

Check if an attachment mesh is assigned for a specific tag

bool has_mesh_assignments() ​

Check if any mesh assignments exist (across all tags)

bool has_mesh_assignments_for_tag( tag: String ) ​

Check if any mesh assignments exist for a specific tag

int get_total_mesh_count() ​

Get total mesh count across all tags

int get_mesh_count_for_tag( tag: String ) ​

Get mesh count for a specific tag

EquipmentTypeDefinition get_equipment_type() ​

The equipment type of the item (a weapon type counts too), or null.

ArmorClassDefinition get_armor_class() ​

The armor class of the item, or null.

bool is_weapon() ​

Is the item a weapon?

bool affects_body_part( body_part: GeneralSkeleton.BodySlot ) ​

Does the item change this part of the body of the model?

bool uses_attachment_point( attachment_point: GeneralSkeleton.AttachmentSlot ) ​

Does the item use this attachment point of the model?

Dictionary get_affected_mesh_slots() ​

The slots of the model the item changes.

void clear_all_mesh_assignments() ​

Clear all mesh assignments across all tags

void clear_mesh_assignments_for_tag( tag: String ) ​

Clear all mesh assignments for a specific tag

void clear_body_part_mesh( tag: String, body_part: GeneralSkeleton.BodySlot ) ​

Clear body part mesh for a specific tag

void clear_attachment_mesh( tag: String, attachment_point: GeneralSkeleton.AttachmentSlot ) ​

Clear attachment mesh for a specific tag

bool can_use( user: Entity, item_instance: ItemInstance = null ) ​

Check if equipment can be used (equipped)

bool execute_use( user: Entity, item_instance: ItemInstance ) ​

Execute equipment usage - either equip or use on-use ability

String get_use_action_name( item_instance: ItemInstance ) ​

Get display name for equipment action based on current state

Array[Effect] get_equipment_effects() ​

The effects the item gives while worn.

Dictionary get_effective_stat_bonuses( item_instance: ItemInstance ) ​

Get effective stat bonuses including instance modifications and socket bonuses

Array[Effect] get_effective_equipment_effects( item_instance: ItemInstance ) ​

Get effective equipment effects including instance modifications

bool belongs_to_set() ​

Check if this equipment belongs to a set

SetBonusDefinition get_set_bonus_definition() ​

Get the set bonus definition

void set_set_bonus_definition( set_def: SetBonusDefinition ) ​

Set the set bonus definition with bidirectional linking

String get_set_name() ​

Get set name for display

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

Check if entity has set bonus active at specific piece count

String get_set_bonus_description( entity: Entity = null ) ​

Get set bonus description for this equipment

Array[ItemDefinitionEquipment] get_set_siblings() ​

Get all other items in the same set (excluding this item)

Dictionary get_set_completion_with_this_item( entity: Entity ) ​

Get set completion info when this item would be equipped by an entity

Array[int] would_complete_set_bonus( entity: Entity ) ​

Check if equipping this item would complete a set bonus threshold

Array[int] would_break_set_bonus( entity: Entity ) ​

Check if unequipping this item would break a set bonus threshold