Table of Contents

Interface IFactionController

Namespace
FishMMO.Shared.Core
Assembly
FishMMO.Shared.dll

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

Action<ICharacter, Faction>

Properties

Allied

Dictionary of allied factions (positive standing), keyed by template ID.

Dictionary<int, Faction> Allied { get; }

Property Value

Dictionary<int, Faction>

Factions

Dictionary of all factions and their standing values, keyed by template ID.

Dictionary<int, Faction> Factions { get; }

Property Value

Dictionary<int, Faction>

Hostile

Dictionary of hostile factions (negative standing), keyed by template ID.

Dictionary<int, Faction> Hostile { get; }

Property Value

Dictionary<int, Faction>

IsAggressive

Gets or sets whether the character is aggressive (treats others as enemies).

bool IsAggressive { get; set; }

Property Value

bool

Neutral

Dictionary of neutral factions (zero standing), keyed by template ID.

Dictionary<int, Faction> Neutral { get; }

Property Value

Dictionary<int, Faction>

OnFactionChangeTriggers

Triggers invoked when a faction standing changes for this character.

List<Trigger> OnFactionChangeTriggers { get; }

Property Value

List<Trigger>

RaceTemplate

The race template associated with this character, used for initial faction setup.

RaceTemplate RaceTemplate { get; }

Property Value

RaceTemplate

Methods

Add(FactionTemplate, int)

Adds an amount to the value of a specific faction.

void Add(FactionTemplate template, int amount = 1)

Parameters

template FactionTemplate

Faction template to adjust.

amount int

Amount 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

defenderFactionController IFactionController

The other faction controller to compare against.

alliedPercentToSubtract float

Percentage of allied standing to subtract.

hostilePercentToAdd float

Percentage of hostile standing to add.

CopyFrom(IFactionController)

Copies all faction data from another faction controller.

void CopyFrom(IFactionController factionController)

Parameters

factionController IFactionController

The 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

otherFactionController IFactionController

The 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

otherFactionController IFactionController

The 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)

Parameters

templateID int

Template ID of the faction.

value int

New value to set.

skipEvent bool

If true, skips event notification.