M&B: Bannerlord 1.2.12
The horns sound, the ravens gather.
Loading...
Searching...
No Matches
TaleWorlds.CampaignSystem.Settlements.Settlement Class Referencesealed

Common class for villages and towns.

Inherits TaleWorlds.ObjectSystem.MBObjectBase, TaleWorlds.CampaignSystem.Map.ILocatable< T >, TaleWorlds.CampaignSystem.Map.IMapPoint, TaleWorlds.CampaignSystem.ITrackableCampaignObject, TaleWorlds.CampaignSystem.Siege.ISiegeEventSide, TaleWorlds.CampaignSystem.Map.IMapEntity, and TaleWorlds.CampaignSystem.IRandomOwner.

Public Types

enum  SiegeState {
  OnTheWalls ,
  InTheLordsHall ,
  Invalid
}
 

Public Member Functions

void SetWallSectionHitPointsRatioAtIndex (int index, float hitPointsRatio)
 
Vec3 GetLogicalPosition ()
 
void SetGarrisonWagePaymentLimit (int limit)
 
IEnumerable< PartyBaseGetInvolvedPartiesForEventType (MapEvent.BattleTypes mapEventType=MapEvent.BattleTypes.Siege)
 
PartyBase GetNextInvolvedPartyForEventType (ref int partyIndex, MapEvent.BattleTypes mapEventType=MapEvent.BattleTypes.Siege)
 
bool HasInvolvedPartyForEventType (PartyBase party, MapEvent.BattleTypes mapEventType=MapEvent.BattleTypes.Siege)
 
bool IsUnderRebellionAttack ()
 
 Settlement ()
 Initializes a new instance of the Settlement class.
 
 Settlement (TextObject name, LocationComplex locationComplex, PartyTemplateObject pt)
 Initializes a new instance of the Settlement class.
 
float GetSettlementValueForEnemyHero (Hero hero)
 
float GetValue (Hero hero=null, bool countAlsoBoundedSettlements=true)
 
override TextObject GetName ()
 This function is not same with get property of Name. It overrides the function in MBObjectBase class. It is used in encyclopedia etc.
 
float GetSettlementValueForFaction (IFaction faction)
 
override string ToString ()
 
override void Deserialize (MBObjectManager objectManager, XmlNode node)
 
void OnFinishLoadState ()
 
void OnGameInitialized ()
 
void OnGameCreated ()
 
void OnSessionStart ()
 
void OnPlayerEncounterFinish ()
 
Vec3 GetPosition ()
 
float GetTrackDistanceToMainAgent ()
 
bool CheckTracked (BasicCharacterObject basicCharacter)
 
void SetNextSiegeState ()
 
void ResetSiegeState ()
 
void AddGarrisonParty (bool addInitialGarrison=false)
 
void SetSiegeStrategy (SiegeStrategy strategy)
 
void InitializeSiegeEventSide ()
 
void OnTroopsKilledOnSide (int killCount)
 
void AddSiegeEngineMissile (SiegeEvent.SiegeEngineMissile missile)
 
void RemoveDeprecatedMissiles ()
 
void GetAttackTarget (ISiegeEventSide siegeEventSide, SiegeEngineType siegeEngine, int siegeEngineSlot, out SiegeBombardTargets targetType, out int targetIndex)
 
void FinalizeSiegeEvent ()
 
void OnPartyInteraction (MobileParty mobileParty)
 
void GetMountAndHarnessVisualIdsForPartyIcon (out string mountStringId, out string harnessStringId)
 
void SetSettlementComponent (SettlementComponent settlementComponent)
 
- Public Member Functions inherited from TaleWorlds.ObjectSystem.MBObjectBase
 MBObjectBase ()
 
 MBObjectBase (MBObjectBase other)
 
 MBObjectBase (string stringId)
 
void AfterInitialized ()
 
virtual void AfterRegister ()
 
virtual void Initialize ()
 
override int GetHashCode ()
 
void PreAfterLoadInternal ()
 
void AfterLoadInternal ()
 
void OnRegistered ()
 
void OnUnregistered ()
 

Static Public Member Functions

static Settlement Find (string idString)
 
static Settlement FindFirst (Func< Settlement, bool > predicate)
 
static IEnumerable< SettlementFindAll (Func< Settlement, bool > predicate)
 
static LocatableSearchData< SettlementStartFindingLocatablesAroundPosition (Vec2 position, float radius)
 
static Settlement FindNextLocatable (ref LocatableSearchData< Settlement > data)
 

Public Attributes

int NumberOfLordPartiesTargeting
 
int CanBeClaimed
 
float ClaimValue
 
Hero ClaimedBy
 
bool HasVisited
 
float LastVisitTimeOfOwner
 
CultureObject Culture
 
Town Town
 
Village Village
 
Hideout Hideout
 
MilitiaPartyComponent MilitiaPartyComponent
 
readonly ItemRoster Stash
 

Protected Member Functions

override void AfterLoad ()
 
- Protected Member Functions inherited from TaleWorlds.ObjectSystem.MBObjectBase
virtual void OnBeforeLoad ()
 
virtual void PreAfterLoad ()
 

Properties

PartyBase Party [get]
 
int NumberOfLordPartiesAt [get]
 
int BribePaid [get, set]
 
SiegeEvent SiegeEvent [get, set]
 
bool IsActive [get, set]
 
Hero Owner [get]
 
bool IsVisible [get, set]
 
bool IsInspected [get, set]
 
int WallSectionCount [get]
 
float NumberOfEnemiesSpottedAround [get, set]
 
float NumberOfAlliesSpottedAround [get, set]
 
int RandomValue [get]
 
Vec2 GetPosition2D [get]
 
float Militia [get, set]
 
MBReadOnlyList< float > SettlementWallSectionHitPointsRatioList [get]
 
float SettlementTotalWallHitPoints [get]
 
float MaxHitPointsOfOneWallSection [get]
 
float SettlementHitPoints [get]
 
float MaxWallHitPoints [get]
 
MBReadOnlyList< MobilePartyParties [get]
 
MBReadOnlyList< HeroHeroesWithoutParty [get]
 
MBReadOnlyList< HeroNotables [get]
 
SettlementComponent SettlementComponent [get]
 
Vec2 GatePosition [get]
 
Vec2 Position2D [get]
 
PathFaceRecord CurrentNavigationFace [get]
 
IFaction MapFaction [get]
 
TextObject Name [get, set]
 
TextObject EncyclopediaText [get]
 
string EncyclopediaLink [get]
 
TextObject EncyclopediaLinkWithName [get]
 
int GarrisonWagePaymentLimit [get]
 
ItemRoster ItemRoster [get]
 
MBReadOnlyList< VillageBoundVillages [get]
 
MobileParty LastAttackerParty [get, set]
 
CampaignTime LastThreatTime [get]
 
SiegeEvent.SiegeEnginesContainer SiegeEngines [get]
 
MBReadOnlyList< SiegeEvent.SiegeEngineMissileSiegeEngineMissiles [get]
 
BattleSideEnum BattleSide [get]
 
int NumberOfTroopsKilledOnSide [get]
 
SiegeStrategy SiegeStrategy [get]
 
List< AlleyAlleys [get]
 
bool IsTown [get]
 
bool IsCastle [get]
 
bool IsFortification [get]
 
bool IsVillage [get]
 
bool IsHideout [get]
 
bool IsStarving [get]
 
bool IsRaided [get]
 
bool InRebelliousState [get]
 
bool IsUnderRaid [get]
 
bool IsUnderSiege [get]
 
LocationComplex LocationComplex [get]
 
static Settlement CurrentSettlement [get]
 
static MBReadOnlyList< SettlementAll [get]
 
static Settlement GetFirst [get]
 
SiegeState CurrentSiegeState [get]
 
Clan OwnerClan [get]
 
bool IsAlerted [get]
 
- Properties inherited from TaleWorlds.ObjectSystem.MBObjectBase
string StringId [get, set]
 
MBGUID Id [get, set]
 
bool IsInitialized [get]
 
bool IsReady [get, set]
 
- Properties inherited from TaleWorlds.CampaignSystem.Map.IMapPoint
- Properties inherited from TaleWorlds.CampaignSystem.Siege.ISiegeEventSide
- Properties inherited from TaleWorlds.CampaignSystem.Map.IMapEntity
- Properties inherited from TaleWorlds.CampaignSystem.IRandomOwner

Member Enumeration Documentation

◆ SiegeState

Enumerator
OnTheWalls 
InTheLordsHall 
Invalid 

Constructor & Destructor Documentation

◆ Settlement() [1/2]

TaleWorlds.CampaignSystem.Settlements.Settlement.Settlement ( )

◆ Settlement() [2/2]

TaleWorlds.CampaignSystem.Settlements.Settlement.Settlement ( TextObject name,
LocationComplex locationComplex,
PartyTemplateObject pt )

Member Function Documentation

◆ SetWallSectionHitPointsRatioAtIndex()

void TaleWorlds.CampaignSystem.Settlements.Settlement.SetWallSectionHitPointsRatioAtIndex ( int index,
float hitPointsRatio )

◆ GetLogicalPosition()

Vec3 TaleWorlds.CampaignSystem.Settlements.Settlement.GetLogicalPosition ( )

◆ SetGarrisonWagePaymentLimit()

void TaleWorlds.CampaignSystem.Settlements.Settlement.SetGarrisonWagePaymentLimit ( int limit)

◆ GetInvolvedPartiesForEventType()

IEnumerable< PartyBase > TaleWorlds.CampaignSystem.Settlements.Settlement.GetInvolvedPartiesForEventType ( MapEvent.BattleTypes mapEventType = MapEvent::BattleTypes::Siege)

◆ GetNextInvolvedPartyForEventType()

PartyBase TaleWorlds.CampaignSystem.Settlements.Settlement.GetNextInvolvedPartyForEventType ( ref int partyIndex,
MapEvent.BattleTypes mapEventType = MapEvent::BattleTypes::Siege )

◆ HasInvolvedPartyForEventType()

bool TaleWorlds.CampaignSystem.Settlements.Settlement.HasInvolvedPartyForEventType ( PartyBase party,
MapEvent.BattleTypes mapEventType = MapEvent::BattleTypes::Siege )

◆ IsUnderRebellionAttack()

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsUnderRebellionAttack ( )

◆ GetSettlementValueForEnemyHero()

float TaleWorlds.CampaignSystem.Settlements.Settlement.GetSettlementValueForEnemyHero ( Hero hero)

◆ GetValue()

float TaleWorlds.CampaignSystem.Settlements.Settlement.GetValue ( Hero hero = null,
bool countAlsoBoundedSettlements = true )

◆ GetName()

override TextObject TaleWorlds.CampaignSystem.Settlements.Settlement.GetName ( )
virtual

◆ GetSettlementValueForFaction()

float TaleWorlds.CampaignSystem.Settlements.Settlement.GetSettlementValueForFaction ( IFaction faction)

◆ ToString()

override string TaleWorlds.CampaignSystem.Settlements.Settlement.ToString ( )

◆ Deserialize()

override void TaleWorlds.CampaignSystem.Settlements.Settlement.Deserialize ( MBObjectManager objectManager,
XmlNode node )
virtual

◆ OnFinishLoadState()

void TaleWorlds.CampaignSystem.Settlements.Settlement.OnFinishLoadState ( )

◆ OnGameInitialized()

void TaleWorlds.CampaignSystem.Settlements.Settlement.OnGameInitialized ( )

◆ OnGameCreated()

void TaleWorlds.CampaignSystem.Settlements.Settlement.OnGameCreated ( )

◆ OnSessionStart()

void TaleWorlds.CampaignSystem.Settlements.Settlement.OnSessionStart ( )

◆ Find()

static Settlement TaleWorlds.CampaignSystem.Settlements.Settlement.Find ( string idString)
static

◆ FindFirst()

static Settlement TaleWorlds.CampaignSystem.Settlements.Settlement.FindFirst ( Func< Settlement, bool > predicate)
static

◆ FindAll()

static IEnumerable< Settlement > TaleWorlds.CampaignSystem.Settlements.Settlement.FindAll ( Func< Settlement, bool > predicate)
static

◆ StartFindingLocatablesAroundPosition()

static LocatableSearchData< Settlement > TaleWorlds.CampaignSystem.Settlements.Settlement.StartFindingLocatablesAroundPosition ( Vec2 position,
float radius )
static

◆ FindNextLocatable()

static Settlement TaleWorlds.CampaignSystem.Settlements.Settlement.FindNextLocatable ( ref LocatableSearchData< Settlement > data)
static

◆ OnPlayerEncounterFinish()

void TaleWorlds.CampaignSystem.Settlements.Settlement.OnPlayerEncounterFinish ( )

◆ GetPosition()

Vec3 TaleWorlds.CampaignSystem.Settlements.Settlement.GetPosition ( )

◆ GetTrackDistanceToMainAgent()

float TaleWorlds.CampaignSystem.Settlements.Settlement.GetTrackDistanceToMainAgent ( )

◆ CheckTracked()

bool TaleWorlds.CampaignSystem.Settlements.Settlement.CheckTracked ( BasicCharacterObject basicCharacter)

◆ SetNextSiegeState()

void TaleWorlds.CampaignSystem.Settlements.Settlement.SetNextSiegeState ( )

◆ ResetSiegeState()

void TaleWorlds.CampaignSystem.Settlements.Settlement.ResetSiegeState ( )

◆ AddGarrisonParty()

void TaleWorlds.CampaignSystem.Settlements.Settlement.AddGarrisonParty ( bool addInitialGarrison = false)

◆ AfterLoad()

override void TaleWorlds.CampaignSystem.Settlements.Settlement.AfterLoad ( )
protectedvirtual

◆ SetSiegeStrategy()

void TaleWorlds.CampaignSystem.Settlements.Settlement.SetSiegeStrategy ( SiegeStrategy strategy)

◆ InitializeSiegeEventSide()

void TaleWorlds.CampaignSystem.Settlements.Settlement.InitializeSiegeEventSide ( )

◆ OnTroopsKilledOnSide()

void TaleWorlds.CampaignSystem.Settlements.Settlement.OnTroopsKilledOnSide ( int killCount)

◆ AddSiegeEngineMissile()

void TaleWorlds.CampaignSystem.Settlements.Settlement.AddSiegeEngineMissile ( SiegeEvent.SiegeEngineMissile missile)

◆ RemoveDeprecatedMissiles()

void TaleWorlds.CampaignSystem.Settlements.Settlement.RemoveDeprecatedMissiles ( )

◆ GetAttackTarget()

void TaleWorlds.CampaignSystem.Settlements.Settlement.GetAttackTarget ( ISiegeEventSide siegeEventSide,
SiegeEngineType siegeEngine,
int siegeEngineSlot,
out SiegeBombardTargets targetType,
out int targetIndex )

◆ FinalizeSiegeEvent()

void TaleWorlds.CampaignSystem.Settlements.Settlement.FinalizeSiegeEvent ( )

◆ OnPartyInteraction()

void TaleWorlds.CampaignSystem.Settlements.Settlement.OnPartyInteraction ( MobileParty mobileParty)

◆ GetMountAndHarnessVisualIdsForPartyIcon()

void TaleWorlds.CampaignSystem.Settlements.Settlement.GetMountAndHarnessVisualIdsForPartyIcon ( out string mountStringId,
out string harnessStringId )

◆ SetSettlementComponent()

void TaleWorlds.CampaignSystem.Settlements.Settlement.SetSettlementComponent ( SettlementComponent settlementComponent)

Member Data Documentation

◆ NumberOfLordPartiesTargeting

int TaleWorlds.CampaignSystem.Settlements.Settlement.NumberOfLordPartiesTargeting

◆ CanBeClaimed

int TaleWorlds.CampaignSystem.Settlements.Settlement.CanBeClaimed

◆ ClaimValue

float TaleWorlds.CampaignSystem.Settlements.Settlement.ClaimValue

◆ ClaimedBy

Hero TaleWorlds.CampaignSystem.Settlements.Settlement.ClaimedBy

◆ HasVisited

bool TaleWorlds.CampaignSystem.Settlements.Settlement.HasVisited

◆ LastVisitTimeOfOwner

float TaleWorlds.CampaignSystem.Settlements.Settlement.LastVisitTimeOfOwner

◆ Culture

CultureObject TaleWorlds.CampaignSystem.Settlements.Settlement.Culture

◆ Town

Town TaleWorlds.CampaignSystem.Settlements.Settlement.Town

◆ Village

Village TaleWorlds.CampaignSystem.Settlements.Settlement.Village

◆ Hideout

Hideout TaleWorlds.CampaignSystem.Settlements.Settlement.Hideout

◆ MilitiaPartyComponent

MilitiaPartyComponent TaleWorlds.CampaignSystem.Settlements.Settlement.MilitiaPartyComponent

◆ Stash

readonly ItemRoster TaleWorlds.CampaignSystem.Settlements.Settlement.Stash

Property Documentation

◆ Party

PartyBase TaleWorlds.CampaignSystem.Settlements.Settlement.Party
get

◆ NumberOfLordPartiesAt

int TaleWorlds.CampaignSystem.Settlements.Settlement.NumberOfLordPartiesAt
get

◆ BribePaid

int TaleWorlds.CampaignSystem.Settlements.Settlement.BribePaid
getset

◆ SiegeEvent

SiegeEvent TaleWorlds.CampaignSystem.Settlements.Settlement.SiegeEvent
getset

◆ IsActive

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsActive
getset

◆ Owner

Hero TaleWorlds.CampaignSystem.Settlements.Settlement.Owner
get

◆ IsVisible

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsVisible
getset

◆ IsInspected

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsInspected
getset

◆ WallSectionCount

int TaleWorlds.CampaignSystem.Settlements.Settlement.WallSectionCount
get

◆ NumberOfEnemiesSpottedAround

float TaleWorlds.CampaignSystem.Settlements.Settlement.NumberOfEnemiesSpottedAround
getset

◆ NumberOfAlliesSpottedAround

float TaleWorlds.CampaignSystem.Settlements.Settlement.NumberOfAlliesSpottedAround
getset

◆ RandomValue

int TaleWorlds.CampaignSystem.Settlements.Settlement.RandomValue
get

◆ GetPosition2D

Vec2 TaleWorlds.CampaignSystem.Settlements.Settlement.GetPosition2D
get

◆ Militia

float TaleWorlds.CampaignSystem.Settlements.Settlement.Militia
getset

◆ SettlementWallSectionHitPointsRatioList

MBReadOnlyList<float> TaleWorlds.CampaignSystem.Settlements.Settlement.SettlementWallSectionHitPointsRatioList
get

◆ SettlementTotalWallHitPoints

float TaleWorlds.CampaignSystem.Settlements.Settlement.SettlementTotalWallHitPoints
get

◆ MaxHitPointsOfOneWallSection

float TaleWorlds.CampaignSystem.Settlements.Settlement.MaxHitPointsOfOneWallSection
get

◆ SettlementHitPoints

float TaleWorlds.CampaignSystem.Settlements.Settlement.SettlementHitPoints
get

◆ MaxWallHitPoints

float TaleWorlds.CampaignSystem.Settlements.Settlement.MaxWallHitPoints
get

◆ Parties

MBReadOnlyList<MobileParty> TaleWorlds.CampaignSystem.Settlements.Settlement.Parties
get

◆ HeroesWithoutParty

MBReadOnlyList<Hero> TaleWorlds.CampaignSystem.Settlements.Settlement.HeroesWithoutParty
get

◆ Notables

MBReadOnlyList<Hero> TaleWorlds.CampaignSystem.Settlements.Settlement.Notables
get

◆ SettlementComponent

SettlementComponent TaleWorlds.CampaignSystem.Settlements.Settlement.SettlementComponent
get

◆ GatePosition

Vec2 TaleWorlds.CampaignSystem.Settlements.Settlement.GatePosition
get

◆ Position2D

Vec2 TaleWorlds.CampaignSystem.Settlements.Settlement.Position2D
get

◆ CurrentNavigationFace

PathFaceRecord TaleWorlds.CampaignSystem.Settlements.Settlement.CurrentNavigationFace
get

◆ MapFaction

IFaction TaleWorlds.CampaignSystem.Settlements.Settlement.MapFaction
get

◆ Name

TextObject TaleWorlds.CampaignSystem.Settlements.Settlement.Name
getset

◆ EncyclopediaText

TextObject TaleWorlds.CampaignSystem.Settlements.Settlement.EncyclopediaText
get

◆ EncyclopediaLink

string TaleWorlds.CampaignSystem.Settlements.Settlement.EncyclopediaLink
get

◆ EncyclopediaLinkWithName

TextObject TaleWorlds.CampaignSystem.Settlements.Settlement.EncyclopediaLinkWithName
get

◆ GarrisonWagePaymentLimit

int TaleWorlds.CampaignSystem.Settlements.Settlement.GarrisonWagePaymentLimit
get

◆ ItemRoster

ItemRoster TaleWorlds.CampaignSystem.Settlements.Settlement.ItemRoster
get

◆ BoundVillages

MBReadOnlyList<Village> TaleWorlds.CampaignSystem.Settlements.Settlement.BoundVillages
get

◆ LastAttackerParty

MobileParty TaleWorlds.CampaignSystem.Settlements.Settlement.LastAttackerParty
getset

◆ LastThreatTime

CampaignTime TaleWorlds.CampaignSystem.Settlements.Settlement.LastThreatTime
get

◆ SiegeEngines

SiegeEvent.SiegeEnginesContainer TaleWorlds.CampaignSystem.Settlements.Settlement.SiegeEngines
get

◆ SiegeEngineMissiles

MBReadOnlyList<SiegeEvent.SiegeEngineMissile> TaleWorlds.CampaignSystem.Settlements.Settlement.SiegeEngineMissiles
get

◆ BattleSide

BattleSideEnum TaleWorlds.CampaignSystem.Settlements.Settlement.BattleSide
get

◆ NumberOfTroopsKilledOnSide

int TaleWorlds.CampaignSystem.Settlements.Settlement.NumberOfTroopsKilledOnSide
get

◆ SiegeStrategy

SiegeStrategy TaleWorlds.CampaignSystem.Settlements.Settlement.SiegeStrategy
get

◆ Alleys

List<Alley> TaleWorlds.CampaignSystem.Settlements.Settlement.Alleys
get

◆ IsTown

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsTown
get

◆ IsCastle

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsCastle
get

◆ IsFortification

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsFortification
get

◆ IsVillage

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsVillage
get

◆ IsHideout

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsHideout
get

◆ IsStarving

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsStarving
get

◆ IsRaided

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsRaided
get

◆ InRebelliousState

bool TaleWorlds.CampaignSystem.Settlements.Settlement.InRebelliousState
get

◆ IsUnderRaid

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsUnderRaid
get

◆ IsUnderSiege

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsUnderSiege
get

◆ LocationComplex

LocationComplex TaleWorlds.CampaignSystem.Settlements.Settlement.LocationComplex
get

◆ CurrentSettlement

Settlement TaleWorlds.CampaignSystem.Settlements.Settlement.CurrentSettlement
staticget

◆ All

MBReadOnlyList<Settlement> TaleWorlds.CampaignSystem.Settlements.Settlement.All
staticget

◆ GetFirst

Settlement TaleWorlds.CampaignSystem.Settlements.Settlement.GetFirst
staticget

◆ CurrentSiegeState

SiegeState TaleWorlds.CampaignSystem.Settlements.Settlement.CurrentSiegeState
get

◆ OwnerClan

Clan TaleWorlds.CampaignSystem.Settlements.Settlement.OwnerClan
get

◆ IsAlerted

bool TaleWorlds.CampaignSystem.Settlements.Settlement.IsAlerted
get