M&B: Bannerlord 1.0.0
The horns sound, the ravens gather.
Loading...
Searching...
No Matches
TaleWorlds.MountAndBlade.TacticComponent Class Reference

Small scale tasks or procedures to carry out the larger strategy (which is team ai)

Inherited by TaleWorlds.MountAndBlade.TacticBreachWalls, TaleWorlds.MountAndBlade.TacticCharge, TaleWorlds.MountAndBlade.TacticCoordinatedRetreat, TaleWorlds.MountAndBlade.TacticDefendCastle, TaleWorlds.MountAndBlade.TacticDefensiveEngagement, TaleWorlds.MountAndBlade.TacticDefensiveLine, TaleWorlds.MountAndBlade.TacticDefensiveRing, TaleWorlds.MountAndBlade.TacticFrontalCavalryCharge, TaleWorlds.MountAndBlade.TacticFullScaleAttack, TaleWorlds.MountAndBlade.TacticHoldChokePoint, TaleWorlds.MountAndBlade.TacticPerimeterDefense, TaleWorlds.MountAndBlade.TacticRangedHarrassmentOffensive, TaleWorlds.MountAndBlade.TacticSallyOutDefense, TaleWorlds.MountAndBlade.TacticSallyOutHitAndRun, TaleWorlds.MountAndBlade.TacticSergeantMPBotTactic, and TaleWorlds.MountAndBlade.TacticStop.

Static Public Member Functions

static void SetDefaultBehaviorWeights (Formation f)
 

Static Public Attributes

static readonly int MoveHornSoundIndex
 
static readonly int AttackHornSoundIndex
 
static readonly int RetreatHornSoundIndex
 

Protected Member Functions

 TacticComponent (Team team)
 
List< FormationConsolidateFormations (List< Formation > formationsToBeConsolidated, int neededCount)
 
void SplitFormationClassIntoGivenNumber (Func< Formation, bool > formationClass, int count)
 
virtual bool CheckAndSetAvailableFormationsChanged ()
 
void AssignTacticFormations1121 ()
 Merge and split AI controlled formations to end up with 1 infantry, 1 ranged, 2 cavalry(left and right) and 1 mounted range formation More...
 
virtual void ManageFormationCounts ()
 
void ManageFormationCounts (int infantryCount, int rangedCount, int cavalryCount, int rangedCavalryCount)
 
virtual void StopUsingAllMachines ()
 
virtual void StopUsingAllRangedSiegeWeapons ()
 
void SoundTacticalHorn (int soundCode)
 
bool CheckAndDetermineFormation (ref Formation formation, Func< Formation, bool > isEligible)
 Checks whether a reference to a formation is null or empty, if it is null or empty tries to re-refer it to an eligible formation More...
 

Static Protected Member Functions

static float GetFormationGroupEffectivenessOverOrder (IEnumerable< Formation > formationGroup, OrderType orderType, IOrderable targetObject=null)
 
static float GetFormationEffectivenessOverOrder (Formation formation, OrderType orderType, IOrderable targetObject=null)
 
static float CalculateNotEngagingTacticalAdvantage (TeamQuerySystem team)
 
static List< FormationChooseAndSortByPriority (IEnumerable< Formation > formations, Func< Formation, bool > isEligible, Func< Formation, bool > isPrioritized, Func< Formation, float > score)
 

Protected Attributes

readonly Team team
 
int _AIControlledFormationCount = 0
 
bool IsTacticReapplyNeeded = false
 
Formation _mainInfantry
 
Formation _archers
 
Formation _leftCavalry
 
Formation _rightCavalry
 
Formation _rangedCavalry
 

Properties

IEnumerable< FormationFormations [get]
 
IEnumerable< FormationFormationsIncludingSpecial [get]
 
bool AreFormationsCreated [get]
 

Constructor & Destructor Documentation

◆ TacticComponent()

TaleWorlds.MountAndBlade.TacticComponent.TacticComponent ( Team  team)
protected

Member Function Documentation

◆ GetFormationGroupEffectivenessOverOrder()

static float TaleWorlds.MountAndBlade.TacticComponent.GetFormationGroupEffectivenessOverOrder ( IEnumerable< Formation formationGroup,
OrderType  orderType,
IOrderable  targetObject = null 
)
staticprotected

◆ GetFormationEffectivenessOverOrder()

static float TaleWorlds.MountAndBlade.TacticComponent.GetFormationEffectivenessOverOrder ( Formation  formation,
OrderType  orderType,
IOrderable  targetObject = null 
)
staticprotected

◆ ConsolidateFormations()

List< Formation > TaleWorlds.MountAndBlade.TacticComponent.ConsolidateFormations ( List< Formation formationsToBeConsolidated,
int  neededCount 
)
protected

◆ CalculateNotEngagingTacticalAdvantage()

static float TaleWorlds.MountAndBlade.TacticComponent.CalculateNotEngagingTacticalAdvantage ( TeamQuerySystem  team)
staticprotected

◆ SplitFormationClassIntoGivenNumber()

void TaleWorlds.MountAndBlade.TacticComponent.SplitFormationClassIntoGivenNumber ( Func< Formation, bool >  formationClass,
int  count 
)
protected

◆ CheckAndSetAvailableFormationsChanged()

◆ AssignTacticFormations1121()

void TaleWorlds.MountAndBlade.TacticComponent.AssignTacticFormations1121 ( )
protected

◆ ChooseAndSortByPriority()

static List< Formation > TaleWorlds.MountAndBlade.TacticComponent.ChooseAndSortByPriority ( IEnumerable< Formation formations,
Func< Formation, bool >  isEligible,
Func< Formation, bool >  isPrioritized,
Func< Formation, float >  score 
)
staticprotected
Parameters
formations

Formations that are to be sorted and returned

Parameters
isEligible

Formations not satisfying this condition are excluded from the result

Parameters
isPrioritized

Formations satisfying this condition come before others regardless of score

Parameters
score

Formations are sorted according to their evaluation with this function

Returns

Sorted list

◆ ManageFormationCounts() [1/2]

◆ ManageFormationCounts() [2/2]

void TaleWorlds.MountAndBlade.TacticComponent.ManageFormationCounts ( int  infantryCount,
int  rangedCount,
int  cavalryCount,
int  rangedCavalryCount 
)
protected

◆ StopUsingAllMachines()

virtual void TaleWorlds.MountAndBlade.TacticComponent.StopUsingAllMachines ( )
protectedvirtual

◆ StopUsingAllRangedSiegeWeapons()

virtual void TaleWorlds.MountAndBlade.TacticComponent.StopUsingAllRangedSiegeWeapons ( )
protectedvirtual

◆ SoundTacticalHorn()

void TaleWorlds.MountAndBlade.TacticComponent.SoundTacticalHorn ( int  soundCode)
protected

◆ SetDefaultBehaviorWeights()

static void TaleWorlds.MountAndBlade.TacticComponent.SetDefaultBehaviorWeights ( Formation  f)
static

◆ CheckAndDetermineFormation()

bool TaleWorlds.MountAndBlade.TacticComponent.CheckAndDetermineFormation ( ref Formation  formation,
Func< Formation, bool >  isEligible 
)
protected
Parameters
formation

formation reference to be checked and updated

Parameters
isEligible

function to determine which formations are eligible for given reference

Returns

whether the reference formation is usable or not

Member Data Documentation

◆ MoveHornSoundIndex

readonly int TaleWorlds.MountAndBlade.TacticComponent.MoveHornSoundIndex
static

◆ AttackHornSoundIndex

readonly int TaleWorlds.MountAndBlade.TacticComponent.AttackHornSoundIndex
static

◆ RetreatHornSoundIndex

readonly int TaleWorlds.MountAndBlade.TacticComponent.RetreatHornSoundIndex
static

◆ team

readonly Team TaleWorlds.MountAndBlade.TacticComponent.team
protected

◆ _AIControlledFormationCount

int TaleWorlds.MountAndBlade.TacticComponent._AIControlledFormationCount = 0
protected

◆ IsTacticReapplyNeeded

bool TaleWorlds.MountAndBlade.TacticComponent.IsTacticReapplyNeeded = false
protected

◆ _mainInfantry

Formation TaleWorlds.MountAndBlade.TacticComponent._mainInfantry
protected

◆ _archers

Formation TaleWorlds.MountAndBlade.TacticComponent._archers
protected

◆ _leftCavalry

Formation TaleWorlds.MountAndBlade.TacticComponent._leftCavalry
protected

◆ _rightCavalry

Formation TaleWorlds.MountAndBlade.TacticComponent._rightCavalry
protected

◆ _rangedCavalry

Formation TaleWorlds.MountAndBlade.TacticComponent._rangedCavalry
protected

Property Documentation

◆ Formations

IEnumerable<Formation> TaleWorlds.MountAndBlade.TacticComponent.Formations
getprotected

◆ FormationsIncludingSpecial

IEnumerable<Formation> TaleWorlds.MountAndBlade.TacticComponent.FormationsIncludingSpecial
getprotected

◆ AreFormationsCreated

bool TaleWorlds.MountAndBlade.TacticComponent.AreFormationsCreated
getprotected