Table of Contents

Class PlayerEncounter

Namespace
TaleWorlds.CampaignSystem.Encounters
Assembly
TaleWorlds.CampaignSystem.dll
public class PlayerEncounter
Inheritance
PlayerEncounter
Inherited Members

Fields

BattleSimulation

public BattleSimulation BattleSimulation

Field Value

BattleSimulation

EncounteredPartySurrendered

[SaveableField(0)]
public static bool EncounteredPartySurrendered

Field Value

bool

FirstInit

[SaveableField(1)]
public bool FirstInit

Field Value

bool

ForceRaid

[SaveableField(10)]
public bool ForceRaid

Field Value

bool

ForceSallyOut

[SaveableField(11)]
public bool ForceSallyOut

Field Value

bool

ForceSupplies

[SaveableField(33)]
public bool ForceSupplies

Field Value

bool

ForceVolunteers

[SaveableField(32)]
public bool ForceVolunteers

Field Value

bool

IsEnemy

[SaveableField(5)]
public bool IsEnemy

Field Value

bool

JoiningRadius

public const float JoiningRadius = 3

Field Value

float

PartiesStrengthRatioBeforePlayerJoin

[SaveableField(9)]
public float PartiesStrengthRatioBeforePlayerJoin

Field Value

float

PlayerPartyInitialStrength

[SaveableField(7)]
public float PlayerPartyInitialStrength

Field Value

float

Properties

Battle

public static MapEvent Battle { get; }

Property Value

MapEvent

BattleChallenge

public static bool BattleChallenge { get; set; }

Property Value

bool

BattleState

public static BattleState BattleState { get; }

Property Value

BattleState

CampaignBattleResult

public static CampaignBattleResult CampaignBattleResult { get; set; }

Property Value

CampaignBattleResult

Current

public static PlayerEncounter Current { get; }

Property Value

PlayerEncounter

CurrentBattleSimulation

public static BattleSimulation CurrentBattleSimulation { get; }

Property Value

BattleSimulation

EncounterSettlement

public static Settlement EncounterSettlement { get; }

Property Value

Settlement

EncounterSettlementAux

[SaveableProperty(28)]
public Settlement EncounterSettlementAux { get; }

Property Value

Settlement

EncounterState

public PlayerEncounterState EncounterState { get; }

Property Value

PlayerEncounterState

EncounteredBattle

public static MapEvent EncounteredBattle { get; }

Property Value

MapEvent

EncounteredMobileParty

public static MobileParty EncounteredMobileParty { get; }

Property Value

MobileParty

EncounteredParty

public static PartyBase EncounteredParty { get; }

Property Value

PartyBase

EnemySurrender

public static bool EnemySurrender { get; set; }

Property Value

bool

InsideSettlement

public static bool InsideSettlement { get; }

Property Value

bool

IsActive

public static bool IsActive { get; }

Property Value

bool

IsJoinedBattle

[SaveableProperty(6)]
public bool IsJoinedBattle { get; }

Property Value

bool

IsPlayerWaiting

[SaveableProperty(50)]
public bool IsPlayerWaiting { get; set; }

Property Value

bool

LeaveEncounter

public static bool LeaveEncounter { get; set; }

Property Value

bool

LocationEncounter

public static LocationEncounter LocationEncounter { get; set; }

Property Value

LocationEncounter

MeetingDone

public static bool MeetingDone { get; }

Property Value

bool

OpponentSide

[SaveableProperty(2)]
public BattleSideEnum OpponentSide { get; }

Property Value

BattleSideEnum

PlayerIsAttacker

public static bool PlayerIsAttacker { get; }

Property Value

bool

PlayerIsDefender

public static bool PlayerIsDefender { get; }

Property Value

bool

PlayerSide

[SaveableProperty(3)]
public BattleSideEnum PlayerSide { get; }

Property Value

BattleSideEnum

PlayerSurrender

public static bool PlayerSurrender { get; set; }

Property Value

bool

RosterToReceiveLootItems

public ItemRoster RosterToReceiveLootItems { get; }

Property Value

ItemRoster

RosterToReceiveLootMembers

public TroopRoster RosterToReceiveLootMembers { get; }

Property Value

TroopRoster

RosterToReceiveLootPrisoners

public TroopRoster RosterToReceiveLootPrisoners { get; }

Property Value

TroopRoster

WinningSide

public static BattleSideEnum WinningSide { get; }

Property Value

BattleSideEnum

Methods

AutoGeneratedInstanceCollectObjects(List<object>)

protected virtual void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)

Parameters

collectedObjects List<object>

CheckIfBattleShouldContinueAfterBattleMission()

public bool CheckIfBattleShouldContinueAfterBattleMission()

Returns

bool

CheckIfLeadingAvaliable()

public static bool CheckIfLeadingAvaliable()

Returns

bool

DoMeeting()

public static void DoMeeting()

EndBattleByCheat(bool)

public static void EndBattleByCheat(bool playerWon)

Parameters

playerWon bool

EnterSettlement()

public static void EnterSettlement()

FinalizeBattle()

public void FinalizeBattle()

FindAllNpcPartiesWhoWillJoinEvent(ref List<MobileParty>, ref List<MobileParty>)

public void FindAllNpcPartiesWhoWillJoinEvent(ref List<MobileParty> partiesToJoinPlayerSide, ref List<MobileParty> partiesToJoinEnemySide)

Parameters

partiesToJoinPlayerSide List<MobileParty>
partiesToJoinEnemySide List<MobileParty>

FindNonAttachedNpcPartiesWhoWillJoinEvent(ref List<MobileParty>, ref List<MobileParty>)

public void FindNonAttachedNpcPartiesWhoWillJoinEvent(ref List<MobileParty> partiesToJoinPlayerSide, ref List<MobileParty> partiesToJoinEnemySide)

Parameters

partiesToJoinPlayerSide List<MobileParty>
partiesToJoinEnemySide List<MobileParty>

Finish(bool)

public static void Finish(bool forcePlayerOutFromSettlement = true)

Parameters

forcePlayerOutFromSettlement bool

FinishRaid()

public void FinishRaid()

GetBattleRewards(out float, out float, out float, out float, out float, ref ExplainedNumber, ref ExplainedNumber, ref ExplainedNumber)

public static void GetBattleRewards(out float renownChange, out float influenceChange, out float moraleChange, out float goldChange, out float playerEarnedLootPercentage, ref ExplainedNumber renownExplainedNumber, ref ExplainedNumber influenceExplainedNumber, ref ExplainedNumber moraleExplainedNumber)

Parameters

renownChange float
influenceChange float
moraleChange float
goldChange float
playerEarnedLootPercentage float
renownExplainedNumber ExplainedNumber
influenceExplainedNumber ExplainedNumber
moraleExplainedNumber ExplainedNumber

GetBattleSceneForMapPatch(MapPatchData)

public static string GetBattleSceneForMapPatch(MapPatchData mapPatch)

Parameters

mapPatch MapPatchData

Returns

string

GetConversationSceneForMapPosition(Vec2)

public static string GetConversationSceneForMapPosition(Vec2 position2D)

Parameters

position2D Vec2

Returns

string

GetLeadingHero()

public static Hero GetLeadingHero()

Returns

Hero

GetPlayerStrengthRatioInEncounter()

public float GetPlayerStrengthRatioInEncounter()

Returns

float

Init()

public static void Init()

InitSimulation(FlattenedTroopRoster, FlattenedTroopRoster)

public static void InitSimulation(FlattenedTroopRoster selectedTroopsForPlayerSide, FlattenedTroopRoster selectedTroopsForOtherSide)

Parameters

selectedTroopsForPlayerSide FlattenedTroopRoster
selectedTroopsForOtherSide FlattenedTroopRoster

InterruptEncounter(string)

public void InterruptEncounter(string encounterInterrupedType)

Parameters

encounterInterrupedType string

JoinBattle(BattleSideEnum)

public static void JoinBattle(BattleSideEnum side)

Parameters

side BattleSideEnum

LeaveBattle()

public static void LeaveBattle()

LeaveSettlement()

public static void LeaveSettlement()

OnLoad()

public void OnLoad()

ProtectPlayerSide(float)

public static void ProtectPlayerSide(float hoursToProtect = 1)

Parameters

hoursToProtect float

RemoveRandomTroops(int, TroopRoster)

public void RemoveRandomTroops(int num, TroopRoster sacrifiedTroops)

Parameters

num int
sacrifiedTroops TroopRoster

RestartPlayerEncounter(PartyBase, PartyBase, bool)

public static void RestartPlayerEncounter(PartyBase defenderParty, PartyBase attackerParty, bool forcePlayerOutFromSettlement = true)

Parameters

defenderParty PartyBase
attackerParty PartyBase
forcePlayerOutFromSettlement bool

SacrificeTroops(int, out TroopRoster, out ItemRoster)

public static void SacrificeTroops(int num, out TroopRoster losses, out ItemRoster lostBaggage)

Parameters

num int
losses TroopRoster
lostBaggage ItemRoster

SetIsSallyOutAmbush(bool)

public void SetIsSallyOutAmbush(bool value)

Parameters

value bool

SetMeetingDone()

public static void SetMeetingDone()

SetPlayerSiegeContinueWithDefenderPullBack()

public static void SetPlayerSiegeContinueWithDefenderPullBack()

SetPlayerSiegeInterruptedByEnemyDefection()

public void SetPlayerSiegeInterruptedByEnemyDefection()

SetPlayerVictorious()

public static void SetPlayerVictorious()

SetupFields(PartyBase, PartyBase)

public void SetupFields(PartyBase attackerParty, PartyBase defenderParty)

Parameters

attackerParty PartyBase
defenderParty PartyBase

Start()

public static void Start()

StartAttackMission()

public static void StartAttackMission()

StartBattle()

public static MapEvent StartBattle()

Returns

MapEvent

StartCombatMissionWithDialogueInTownCenter(CharacterObject)

public static void StartCombatMissionWithDialogueInTownCenter(CharacterObject characterToTalkTo)

Parameters

characterToTalkTo CharacterObject

StartHostileAction()

public static void StartHostileAction()

StartSiegeAmbushMission()

public static void StartSiegeAmbushMission()

StartVillageBattleMission()

public static void StartVillageBattleMission()

Update()

public static void Update()

This page was last modified at 09/01/2024 16:12:00 +00:00 (UTC).