Interface IFactionController
Interface for faction controllers, providing access and management for all faction relationships and reputation values. Used to read, modify, and synchronize faction standings for a character.
public interface IFactionController : ICharacterBehaviour
- Inherited Members
Fields
OnUpdateFaction
Event invoked when a faction is updated (standing changes). Parameters: character, updated faction.
public static Action<ICharacter, Faction> OnUpdateFaction
Field Value
Properties
Allied
Dictionary of allied factions (positive standing), keyed by template ID.
Dictionary<int, Faction> Allied { get; }
Property Value
Factions
Dictionary of all factions and their standing values, keyed by template ID.
Dictionary<int, Faction> Factions { get; }
Property Value
Hostile
Dictionary of hostile factions (negative standing), keyed by template ID.
Dictionary<int, Faction> Hostile { get; }
Property Value
IsAggressive
Gets or sets whether the character is aggressive (treats others as enemies).
bool IsAggressive { get; set; }
Property Value
Neutral
Dictionary of neutral factions (zero standing), keyed by template ID.
Dictionary<int, Faction> Neutral { get; }
Property Value
OnFactionChangeTriggers
Triggers invoked when a faction standing changes for this character.
List<Trigger> OnFactionChangeTriggers { get; }
Property Value
RaceTemplate
The race template associated with this character, used for initial faction setup.
RaceTemplate RaceTemplate { get; }
Property Value
Methods
Add(FactionTemplate, int)
Adds an amount to the value of a specific faction.
void Add(FactionTemplate template, int amount = 1)
Parameters
templateFactionTemplateFaction template to adjust.
amountintAmount to add (default 1).
AdjustFaction(IFactionController, float, float)
Adjusts faction standings based on another controller's allied/hostile groups and specified percentages.
void AdjustFaction(IFactionController defenderFactionController, float alliedPercentToSubtract, float hostilePercentToAdd)
Parameters
defenderFactionControllerIFactionControllerThe other faction controller to compare against.
alliedPercentToSubtractfloatPercentage of allied standing to subtract.
hostilePercentToAddfloatPercentage of hostile standing to add.
CopyFrom(IFactionController)
Copies all faction data from another faction controller.
void CopyFrom(IFactionController factionController)
Parameters
factionControllerIFactionControllerThe source faction controller to copy from.
GetAllianceLevel(IFactionController)
Gets the alliance level (Ally, Neutral, Enemy) between this character and another faction controller.
FactionAllianceLevel GetAllianceLevel(IFactionController otherFactionController)
Parameters
otherFactionControllerIFactionControllerThe other faction controller to compare against.
Returns
- FactionAllianceLevel
Alliance level (Ally, Neutral, Enemy).
GetAllianceLevelColor(IFactionController)
Gets the color representing the alliance level between this character and another faction controller.
Color GetAllianceLevelColor(IFactionController otherFactionController)
Parameters
otherFactionControllerIFactionControllerThe other faction controller to compare against.
Returns
- Color
Color representing the alliance level.
SetFaction(int, int, bool)
Sets the value for a specific faction by template ID. Optionally skips event notification.
void SetFaction(int templateID, int value, bool skipEvent = false)