FactionDefinition ​
Inherits: DatabaseResource < Resource
Enhanced faction definition with reputation levels and relationships
Properties ​
Color | faction_color | Color.WHITE |
Array[ReputationLevel] | reputation_levels | [] |
Dictionary | faction_relationships | {} |
bool | is_builtin | false |
Array[int] | skill_trees | [] |
Variables ​
Dictionary | runtime_reputation | {} |
Methods ​
bool | add_reputation( other_faction_id: int, amount: int ) |
bool | set_reputation( other_faction_id: int, amount: int ) |
int | get_reputation( other_faction_id: int ) |
ReputationLevel | get_standing_level( other_faction_id: int ) |
String | get_standing_name( other_faction_id: int ) |
ReputationLevel | get_reputation_level_for_value( reputation: int ) |
ReputationLevel | get_reputation_level_by_name( level_name: String ) |
void | add_reputation_level( level: ReputationLevel ) |
bool | remove_reputation_level( level_name: String ) |
Array[String] | get_reputation_level_names() |
ReputationLevel | get_highest_reputation_level() |
ReputationLevel | get_lowest_reputation_level() |
void | set_relationship_with_faction( other_faction_id: int, standing_name: String ) |
String | get_relationship_with_faction( other_faction_id: int ) |
bool | remove_relationship_with_faction( other_faction_id: int ) |
bool | is_hostile_to( other_faction_id: int ) |
bool | is_friendly_to( other_faction_id: int ) |
bool | is_neutral_to( other_faction_id: int ) |
bool | can_target_as_enemy( other_faction_id: int ) |
void | clear_runtime_reputation() |
void | set_runtime_reputation( reputation_data: Dictionary ) |
Dictionary | get_runtime_reputation() |
int | get_id() |
Signals ​
standing_changed( other_faction_id: int, old_standing: String, new_standing: String ) ​
Emitted when this faction's standing with another faction changes
Property descriptions ​
Color faction_color = Color.WHITE ​
Primary color associated with this faction
Array[ReputationLevel] reputation_levels = [] ​
Reputation levels for this faction (sorted by min_reputation)
Dictionary faction_relationships = ​
Predefined relationships with other factions (faction_id -> standing_name like "Hostile", "Friendly")
bool is_builtin = false ​
Whether this faction is a built-in system faction
Array[int] skill_trees = [] ​
Skill trees of this faction (ids of the skill_tree type). They open once the party has met the faction (it has a standing with it) and spend the points of the faction pools (SkillPointPool.scope)
Variable descriptions ​
Dictionary runtime_reputation = ​
Runtime reputation values with other factions (faction_id -> reputation_value)
Method descriptions ​
bool add_reputation( other_faction_id: int, amount: int ) ​
Add reputation with another faction
bool set_reputation( other_faction_id: int, amount: int ) ​
Set reputation with another faction
int get_reputation( other_faction_id: int ) ​
Get reputation with another faction
ReputationLevel get_standing_level( other_faction_id: int ) ​
Get current standing level with another faction
String get_standing_name( other_faction_id: int ) ​
Get standing name with another faction
ReputationLevel get_reputation_level_for_value( reputation: int ) ​
Get reputation level that contains a specific reputation value
ReputationLevel get_reputation_level_by_name( level_name: String ) ​
Get reputation level by name
void add_reputation_level( level: ReputationLevel ) ​
Add a new reputation level (maintains sorting)
bool remove_reputation_level( level_name: String ) ​
Remove reputation level by name
Array[String] get_reputation_level_names() ​
Get all reputation level names
ReputationLevel get_highest_reputation_level() ​
Get the highest reputation level
ReputationLevel get_lowest_reputation_level() ​
Get the lowest reputation level
void set_relationship_with_faction( other_faction_id: int, standing_name: String ) ​
Set relationship with another faction
String get_relationship_with_faction( other_faction_id: int ) ​
Get relationship with another faction
bool remove_relationship_with_faction( other_faction_id: int ) ​
Remove relationship with another faction
bool is_hostile_to( other_faction_id: int ) ​
Check if this faction is hostile to another faction
bool is_friendly_to( other_faction_id: int ) ​
Check if this faction is friendly to another faction
bool is_neutral_to( other_faction_id: int ) ​
Check if this faction is neutral to another faction
bool can_target_as_enemy( other_faction_id: int ) ​
Check if this faction can target another as an enemy
void clear_runtime_reputation() ​
Clear runtime reputation (for new game)
void set_runtime_reputation( reputation_data: Dictionary ) ​
Initialize runtime reputation from save data
Dictionary get_runtime_reputation() ​
Get runtime reputation for saving
int get_id() ​
Get ID from filename or use faction_id