5class SCR_HoldCampaignMilitaryBaseTaskEntity : SCR_CampaignMilitaryBaseTaskEntity
12 [
Attribute(
"300",
UIWidgets.EditBox,
"The time [s] it takes to finish a task when no combat is going on in the zone and at least one enemy character was killed",
"0 inf")]
15 [
Attribute(
"600",
UIWidgets.EditBox,
"The time [s] it takes to automatically cancel a task when no enemy has been killed in the zone",
"0 inf")]
31 IEntity victimEntity = instigatorContextData.GetVictimEntity();
46 #ifdef HOLD_TASK_DEBUG
47 Print(
"Hold task, somebody was killed in the zone - reset combat timer");
54 IEntity killerEntity = instigatorContextData.GetKillerEntity();
61 if (!ownerFactionKeys || !ownerFactionKeys.Contains(killerFaction.GetFactionKey()))
69 int killerId = instigatorContextData.GetKillerPlayerID();
73 AIControlComponent aiControlComponent = AIControlComponent.Cast(killerEntity.
FindComponent(AIControlComponent));
74 if (!aiControlComponent)
77 AIAgent agent = aiControlComponent.GetAIAgent();
93 group = groupManager.GetPlayerGroup(killerId);
105 #ifdef HOLD_TASK_DEBUG
106 Print(
"Hold task, enemy was killed in the zone");
116 #ifdef HOLD_TASK_DEBUG
117 PrintFormat(
"Hold task, base captured, task canceled");
138 #ifdef HOLD_TASK_DEBUG
139 PrintFormat(
"Hold task, finish remaining time %1", finishTimestamp.DiffSeconds(currentTime));
142 if (currentTime.Less(finishTimestamp))
145 #ifdef HOLD_TASK_DEBUG
157 #ifdef HOLD_TASK_DEBUG
158 PrintFormat(
"Hold task, cancel remaining time %1", cancelTimestamp.DiffSeconds(currentTime));
161 if (currentTime.Less(cancelTimestamp))
164 #ifdef HOLD_TASK_DEBUG
176 SCR_XPHandlerComponent comp = SCR_XPHandlerComponent.Cast(
GetGame().
GetGameMode().FindComponent(SCR_XPHandlerComponent));
182 if (!assigneePlayerIDs)
185 foreach (
int playerID : assigneePlayerIDs)
187 comp.AwardXP(playerID,
SCR_EXPRewards.HOLD_TASK_COMPLETED, 1.0,
false);
197 super.SetTaskState(state);
203 super.EOnInit(owner);
ArmaReforgerScripted GetGame()
override void SetTaskState(SCR_ETaskState state)
SCR_AttackTaskEntityClass PERIODICAL_CHECK_INTERVAL
SCR_BaseGameMode GetGameMode()
void OnTargetBaseCaptured(SCR_MilitaryBaseComponent base, Faction faction)
RplComponent m_RplComponent
SCR_CampaignMilitaryBaseComponent m_MilitaryBase
SCR_CampaignMilitaryBaseComponent GetMilitaryBase()
SCR_ECharacterDeathStatusRelations
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
float m_fNoCombatFinishTime
WorldTimestamp m_TaskStartedTimestamp
WorldTimestamp m_LastCombatTimestamp
float m_fAreaRadiusAroundBaseSq
void ~SCR_HoldCampaignMilitaryBaseTaskEntity()
float m_fAreaRadiusAroundBase
bool m_bWasEnemyKilledInZone
void OnControllableDestroyed(IEntity entity, IEntity killerEntity, Instigator instigator, notnull SCR_InstigatorContextData instigatorContextData)
array< int > GetTaskAssigneePlayerIDs()
array< string > GetOwnerFactionKeys()
bool IsTaskAssignedTo(SCR_TaskExecutor executor, out SCR_TaskExecutor match=null)
SCR_TaskSystem m_TaskSystem
proto external Managed FindComponent(typename typeName)
proto external vector GetOrigin()
ScriptInvokerBase< SCR_BaseGameMode_OnControllableDestroyed > GetOnControllableDestroyed()
static Faction GetEntityFaction(notnull IEntity entity)
override void EOnInit(IEntity owner)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
SCR_FieldOfViewSettings Attribute