Table of Contents

Interface IFactionController

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

A character's standing toward others, as the rest of the game asks it: alliance level and its colour, the aggression toggle and its lock, setting a standing by template id. Core: implemented by the Factions module's FactionController (a character part); without the module a character has none and every caller treats that as "no relation" (the harm rule allows, AI sees no enemy but the aggressive).

public interface IFactionController : ICharacterBehaviour
Inherited Members

Remarks

The standings themselves (the Faction rows and templates) are the module's: IFactionStandings.

Properties

AggressionEnabled

A player's aggression toggle, as the server last set it: while on, they may harm neutral and allied targets, and anyone may harm them. Off by default; always off for a character that has no toggle.

bool AggressionEnabled { get; }

Property Value

bool

AggressionLockRemaining

Seconds before the aggression toggle may be turned off again (a hit made or taken restarts it).

float AggressionLockRemaining { get; }

Property Value

float

IsAggressive

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

bool IsAggressive { get; }

Property Value

bool

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

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.

GetDisplayedAllianceLevel(IFactionController)

The standing this character's client shows for another: GetAllianceLevel(IFactionController), except that a player whose aggression is on reads as an enemy to everyone but their companions (party, guild), as HarmRule treats them. What the nameplate's colour and mark both follow.

FactionAllianceLevel GetDisplayedAllianceLevel(IFactionController otherFactionController)

Parameters

otherFactionController IFactionController

Returns

FactionAllianceLevel

GetStandingAllianceLevel(IFactionController)

The standing between the two as it is, without the aggression toggle: GetAllianceLevel(IFactionController) reads any pair where either side's aggression is on as Enemy (so hostile effects reach neutrals), and that widening is for HOSTILE reach only. Beneficial targeting (a heal or cleanse that reaches neutral players) reads this, so turning aggression on does not stop a player healing the neutral player beside them.

FactionAllianceLevel GetStandingAllianceLevel(IFactionController otherFactionController)

Parameters

otherFactionController IFactionController

Returns

FactionAllianceLevel

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.

TrySetAggression(bool, out float)

Server: sets the aggression toggle when the rules allow it. False, with the seconds left, when turning it off is still locked.

bool TrySetAggression(bool enabled, out float lockedSeconds)

Parameters

enabled bool
lockedSeconds float

Returns

bool