M&B: Bannerlord 1.2.7
The horns sound, the ravens gather.
Loading...
Searching...
No Matches
TaleWorlds.CampaignSystem.Actions.ChangeRelationAction Class Reference

ChangeRelationAction class handles the relation changes and its after effects. Effective heroes are chosen in DiplomacyModel.GetHeroesForEffectiveRelation(Hero, Hero, out Hero, out Hero) function. will fire CampaignEvents.HeroRelationChanged event. To bypass its after effects, use Hero.SetPersonalRelation(Hero, int) directly.

Public Types

enum  ChangeRelationDetail {
  Default ,
  Emissary
}
 

Static Public Member Functions

static void ApplyPlayerRelation (Hero gainedRelationWith, int relation, bool affectRelatives=true, bool showQuickNotification=true)
 Handles the relation changes using effective heroes and relation. For base relation change use

See also
Hero.SetPersonalRelation(Hero, int)

. Example Code:

 
static void ApplyRelationChangeBetweenHeroes (Hero hero, Hero gainedRelationWith, int relationChange, bool showQuickNotification=true)
 Handles the relation changes using effective heroes and relation. For base relation change use

See also
Hero.SetPersonalRelation(Hero, int)

.

Parameters
hero
gainedRelationWith
relationChange
showQuickNotification

 
static void ApplyEmissaryRelation (Hero emissary, Hero gainedRelationWith, int relationChange, bool showQuickNotification=true)
 Handles the relation changes using effective heroes and relation. For base relation change use

See also
Hero.SetPersonalRelation(Hero, int)

.

Parameters
emissary
gainedRelationWith
relationChange
showQuickNotification

 

Member Enumeration Documentation

◆ ChangeRelationDetail

Member Function Documentation

◆ ApplyPlayerRelation()

static void TaleWorlds.CampaignSystem.Actions.ChangeRelationAction.ApplyPlayerRelation ( Hero  gainedRelationWith,
int  relation,
bool  affectRelatives = true,
bool  showQuickNotification = true 
)
static
MBInformationManager.AddQuickInformation(notification, 0, null, soundEventPath: soundEventPath);
Definition: Hero.cs:27
void SetPersonalRelation(Hero otherHero, int value)
Definition: Hero.cs:1807
static Hero MainHero
Definition: Hero.cs:1892
Definition: MBInformationManager.cs:10
static void AddQuickInformation(TextObject message, int extraTimeInMs=0, BasicCharacterObject announcerCharacter=null, string soundEventPath="")
Shows a header-banner-notification in Campaign and Multiplayer.
Definition: MBInformationManager.cs:27
Parameters
gainedRelationWith
relation
affectRelatives
showQuickNotification

◆ ApplyRelationChangeBetweenHeroes()

static void TaleWorlds.CampaignSystem.Actions.ChangeRelationAction.ApplyRelationChangeBetweenHeroes ( Hero  hero,
Hero  gainedRelationWith,
int  relationChange,
bool  showQuickNotification = true 
)
static

◆ ApplyEmissaryRelation()

static void TaleWorlds.CampaignSystem.Actions.ChangeRelationAction.ApplyEmissaryRelation ( Hero  emissary,
Hero  gainedRelationWith,
int  relationChange,
bool  showQuickNotification = true 
)
static