Skip to content

PlayerClassDefinition ​

Inherits: DatabaseResource < Resource

PlayerClassDefinition defines the template and progression for player character classes This is a class archetype (like "Warrior", "Mage") not tied to specific entity models

Properties ​

ColorcolorColor.WHITE
Dictionarystarter_equipment{}
Array[LevelReward]level_rewards[]
Array[int]locked_equipment_slots[]
Array[int]skill_trees[]
Array[ActionBarLayoutEntry]action_bar_layout[]
StatsDatastats_data
intbasic_attack_data
Array[int]active_abilities_data
Array[int]passive_abilities_data
intbehavior_script
intcombat_script
booltemplatefalse
inttemplate_id0
TemplateBaselinetemplate_baseline
Array[int]template_fixed_stats[]

Methods ​

Stringget_class_name()
boolis_template()
Stringget_display_name()
boolset_level_reward( level: int, reward: LevelReward )
LevelRewardget_level_reward( level: int )
boolhas_level_reward( level: int )
boolremove_level_reward( level: int )
StatsDataget_base_stats()
ActiveAbilityDefinitionget_base_basic_attack()
Array[ActiveAbilityDefinition]get_base_active_abilities()
Array[PassiveAbilityDefinition]get_base_passive_abilities()
voidset_starter_equipment( equipment: Dictionary )
Dictionaryget_starter_equipment()
voidadd_locked_equipment_slot( slot_id: int )
boolremove_locked_equipment_slot( slot_id: int )
boolis_equipment_slot_locked( slot_id: int )
Array[int]get_locked_equipment_slot_ids()
Array[EquipmentSlotDefinition]get_locked_equipment_slots()
voidclear_locked_equipment_slots()
voidadd_skill_tree( tree_id: int )
boolremove_skill_tree( tree_id: int )
Array[SkillTree]get_skill_trees()
ModularBehaviorScriptget_behavior_script()
ModularCombatScriptget_combat_script()
boolis_valid()

Property descriptions ​

Color color = Color.WHITE ​

Theme color for this class used in UI

Starting Equipment

Dictionary starter_equipment = ​

Starting equipment mapped by slot_key (e.g., "MainHand:0") -> item_id

Progression

Array[LevelReward] level_rewards = [] ​

Level rewards array (index = level - 1, so level_rewards[0] = level 1 rewards)

Array[int] locked_equipment_slots = [] ​

Equipment slots that start locked for this class

Array[int] skill_trees = [] ​

Skill trees available to this class

Action Bar

Array[ActionBarLayoutEntry] action_bar_layout = [] ​

The planned action bar of the class: the ability that belongs on each slot and whether the player may change it. An ability that is not known yet waits on its slot and goes there when it is learned. Slots that are not listed are free for the player

Combat Stats

StatsData stats_data ​

Stats configuration including health, resources, and combat stats

Ability Definitions

int basic_attack_data ​

Primary attack ability definition used for auto-attacks

Array[int] active_abilities_data ​

Collection of active ability definitions this class starts with

Array[int] passive_abilities_data ​

Collection of passive ability definitions this class starts with

AI Scripts

int behavior_script ​

Behavior Script - optional

int combat_script ​

Combat Script - optional

bool template = false ​

True when this class is a template: other classes follow it and it is not offered to the player.

Template

int template_id = 0 ​

The template this class follows (an id of the player_class_template database type), 0 = none. A class that follows a template has the changes of the template (stats, pools, immunities, growth and abilities) added when they are made, see EntityTemplates

TemplateBaseline template_baseline ​

What the template was when this class last looked at it (the difference to the template now is what is added)

Array[int] template_fixed_stats = [] ​

Stats whose base value does not follow the template

Method descriptions ​

String get_class_name() ​

Get class name

bool is_template() ​

Check if this PlayerClassDefinition is a template

String get_display_name() ​

Get display name appropriate for templates vs classes

bool set_level_reward( level: int, reward: LevelReward ) ​

Set level reward for specific level

LevelReward get_level_reward( level: int ) ​

Get level reward for specific level

bool has_level_reward( level: int ) ​

Check if has level reward

bool remove_level_reward( level: int ) ​

Remove level reward

StatsData get_base_stats() ​

Get base stats

ActiveAbilityDefinition get_base_basic_attack() ​

Get basic attack resource

Array[ActiveAbilityDefinition] get_base_active_abilities() ​

Get active abilities as resources

Array[PassiveAbilityDefinition] get_base_passive_abilities() ​

Get passive abilities as resources

void set_starter_equipment( equipment: Dictionary ) ​

Set starter equipment

Dictionary get_starter_equipment() ​

Get starter equipment

void add_locked_equipment_slot( slot_id: int ) ​

Add locked equipment slot by ID

bool remove_locked_equipment_slot( slot_id: int ) ​

Remove locked equipment slot by ID

bool is_equipment_slot_locked( slot_id: int ) ​

Check if equipment slot is locked (by ID)

Array[int] get_locked_equipment_slot_ids() ​

Get locked equipment slot IDs

Array[EquipmentSlotDefinition] get_locked_equipment_slots() ​

Get locked equipment slots as resources

void clear_locked_equipment_slots() ​

Clear locked equipment slots

void add_skill_tree( tree_id: int ) ​

Add skill tree by ID

bool remove_skill_tree( tree_id: int ) ​

Remove skill tree by ID

Array[SkillTree] get_skill_trees() ​

Get all skill tree resources

ModularBehaviorScript get_behavior_script() ​

Get behavior script resource

ModularCombatScript get_combat_script() ​

Get combat script resource

bool is_valid() ​

Validates that all required class configuration is present