24 BaseGameMode gameMode =
GetGame().GetGameMode();
28 RplComponent rplComp = RplComponent.Cast(gameMode.FindComponent(RplComponent));
29 if (rplComp.IsMaster())
40 if (supportStationManager)
68 SCR_MineInventoryItemComponent.GetOnMinePlaced().Insert(
MinePlaced);
78 SCR_ChimeraCharacter chimeraPlayer = SCR_ChimeraCharacter.Cast(player);
83 if (!characterController)
92 SCR_ChimeraCharacter chimeraPlayer = SCR_ChimeraCharacter.Cast(player);
97 if (!characterController)
110 SCR_MineInventoryItemComponent.GetOnMinePlaced().Remove(
MinePlaced);
115 if (supportStationManager)
129 if (instigator.GetInstigatorType() !=
InstigatorType.INSTIGATOR_PLAYER)
132 const int killerId = instigator.GetInstigatorPlayerID();
159 Print(
"Player with id " + killerId +
" Unlocked - Last one standing",
LogLevel.DEBUG);
170 Print(
"Player with id " + killerId +
" Unlocked - Night stalker",
LogLevel.DEBUG);
176 if (!playerEntity || !killerEntity)
185 Print(
"Player with id " + killerId +
" Unlocked - DEADEYE",
LogLevel.DEBUG);
197 array<int> players = {};
198 GetGame().GetPlayerManager().GetPlayers(players);
200 SCR_GameModeCombatOpsManager combatOps = SCR_GameModeCombatOpsManager.Cast(
GetGame().
GetGameMode().FindComponent(SCR_GameModeCombatOpsManager));
203 if (!combatOps && !conflict)
210 array<SCR_Task> activeTasks = {};
211 array<SCR_Task> finishedTasks = {};
213 taskSystem.GetTasksByState(finishedTasks,
SCR_ETaskState.COMPLETED);
219 bool foundIntel, cleanSweep;
225 if (
task.GetTaskName().Contains(
"Intel"))
232 if (activeTasks.IsEmpty())
235 if (finishedTasks.Count() > activeTasks.Count())
237 foreach(
int player: players)
253 if (
task.GetTaskName().Contains(
"Intel"))
255 foreach(
int player: players)
264 else if (conflict && conflict.IsTutorial())
267 if (finishedTasks.Count() >= activeTasks.Count())
269 foreach(
int player: players)
283 if (!item || !actionCompleted)
289 SCR_ConsumableItemComponent consumableComp = SCR_ConsumableItemComponent.Cast(item.
FindComponent(SCR_ConsumableItemComponent));
311 IEntity userCharacter = consumableComp.GetCharacterOwner();
317 IEntity targetCharacter = consumableComp.GetTargetCharacter();
321 if (!targetCharacter)
327 if (userCharacter == targetCharacter)
333 int userPlayerId =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(userCharacter);
334 if (userPlayerId == 0)
340 int targetPlayerId =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(targetCharacter);
341 if (targetPlayerId == 0)
357 int userPlayerId =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(userCharacter);
358 if (userPlayerId == 0)
367 int targetPlayerId =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(targetCharacter);
368 if (targetPlayerId == 0)
381 Print(
"Player with id " + userPlayerId +
" used a saline solution!",
LogLevel.DEBUG);
396 if (actionTarget == actionUser)
402 int userPlayerId =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(actionUser);
403 if (userPlayerId == 0)
409 int targetPlayerId =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(actionTarget);
410 if (targetPlayerId == 0)
424 switch (instrumentType)
438 PlayerController playerController =
GetGame().GetPlayerManager().GetPlayerController(playerId);
439 if (!playerController)
442 SCR_AchievementsHandler handler = SCR_AchievementsHandler.Cast(playerController.FindComponent(SCR_AchievementsHandler));
446 handler.UnlockAchievement(achievementId);
452 PlayerController playerController =
GetGame().GetPlayerManager().GetPlayerController(playerId);
453 if (!playerController)
456 SCR_AchievementsHandler handler = SCR_AchievementsHandler.Cast(playerController.FindComponent(SCR_AchievementsHandler));
460 handler.IncrementAchievementProgress(achievementStatId);
467 Print(
"Player with id " + playerId +
" flushed a toilet!",
LogLevel.DEBUG);
479 protected void RankedUp(SCR_ECharacterRank prevRank, SCR_ECharacterRank newRank,
IEntity playerEntity,
bool silent)
482 if (newRank != SCR_ECharacterRank.MAJOR || prevRank > newRank)
485 int playerId =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(playerEntity);
489 Print(
"Player with id " + playerId +
" ranked up to major!",
LogLevel.DEBUG);
494 protected void SuppliesDelivered(
int playerId,
int suppliesDelivered,
int totalSuppliesDelivered)
497 const int TARGET_AMOUNT = 5000;
499 if (totalSuppliesDelivered < TARGET_AMOUNT)
502 Print(
"Player with id " + playerId +
" delivered lots of supplies!",
LogLevel.DEBUG);
510 Print(
"Player with id " + playerId +
" cleanswept combat ops!",
LogLevel.DEBUG);
518 Print(
"Player with id " + playerId +
" has secured the intel!",
LogLevel.DEBUG);
526 Print(
"Player with id " + playerId +
" has cleanswept the tutorial!",
LogLevel.DEBUG);
534 Print(
"Player with id " + playerId +
" placed a mine!",
LogLevel.DEBUG);
542 Print(
"Player with id " + playerId +
" played a Piano!",
LogLevel.DEBUG);
550 Print(
"Player with id " + playerId +
" played an Organ!",
LogLevel.DEBUG);
558 if (!refundedEntity || !playerEntity)
562 if (!factionComponent)
568 int playerId =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(playerEntity);
570 Print(
"Player with id " + playerId +
" refunded a civilian vehicle!",
LogLevel.DEBUG);
578 int playerId =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(playerEntity);
579 Print(
"Player with id " + playerId +
" extinguished a fire!",
LogLevel.DEBUG);
596 Print(
"Player with id " + playerId +
" reconfigured a radio relay!",
LogLevel.DEBUG);
ArmaReforgerScripted GetGame()
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_BaseGameMode GetGameMode()
void SCR_CharacterRankComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
SCR_EConsumableType
Type of consumable gadget.
SCR_ECharacterDeathStatusRelations
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
void SCR_Task(IEntitySource src, IEntity parent)
void SCR_VehicleDamageManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
proto external Managed FindComponent(typename typeName)
proto external vector GetOrigin()
static ScriptInvokerBase< OnBaseCapturedDelegate > GetOnBaseCaptured()
Takes care of Campaign-specific server <> client communication and requests.
static ScriptInvokerInt3 GetOnSuppliesDelivered()
ref OnItemUseEndedInvoker m_OnItemUseEndedInvoker
override void OnPlayerKilled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator instigator, notnull SCR_InstigatorContextData instigatorContextData)
void OnSupportStationUsed(SCR_BaseSupportStationComponent supportStation, ESupportStationType supportStationType, IEntity actionTarget, IEntity actionUser, SCR_BaseUseSupportStationAction action)
void ToiletFlushed(int playerId)
void VehicleDestroyed(int playerId)
const float DEADEYE_RANGE
void RankedUp(SCR_ECharacterRank prevRank, SCR_ECharacterRank newRank, IEntity playerEntity, bool silent)
void SecureIntelCombatOps(int playerId)
const int DEADEYE_KILL_COUNT
const int NIGHT_STALKER_KILL_COUNT
void OnBaseCaptured(SCR_CampaignMilitaryBaseComponent base, int playerId)
void PianoPlayed(int playerId)
SCR_GameModeCampaign m_Conflict
override void OnGameModeEnd()
override void AddInvokers(IEntity player)
void OnFireExtinguished(IEntity playerEntity)
void OnItemUsed(IEntity item, bool actionCompleted, ItemUseParameters animParams)
void OnHealItemUsed(SCR_EConsumableType consumType, IEntity userCharacter, IEntity targetCharacter)
void MinePlaced(int playerId)
override void InitModule()
void SuppliesDelivered(int playerId, int suppliesDelivered, int totalSuppliesDelivered)
void UnlockAchievement(int playerId, AchievementId achievementId)
void InstrumentPlayed(int playerId, SCR_EInstrumentType instrumentType)
ref map< int, int > m_mNightStalkerKillCounter
void OrganPlayed(int playerId)
ref map< int, int > m_mLastOneStandingKillCounter
const int LAST_ONE_STANDING_KILL_COUNT
const FactionKey FACTION_CIVILIAN
void OnEntityRefundPerformed(IEntity refundedEntity, IEntity playerEntity)
void IncrementAchievementProgress(int playerId, AchievementStatId achievementStatId)
void ~SCR_DataCollectorAchievementsModule()
const float DEADEYE_RANGE_SQ
ref map< int, int > m_mDeadeyeKillCounter
void CleanSweepCombatOps(int playerId)
TimeAndWeatherManagerEntity m_TimeManager
void CleanSweepTutorial(int playerId)
override void RemoveInvokers(IEntity player)
static ScriptInvokerInt GetOnToiletFlushed()
static ScriptInvokerInt2 GetOnInstrumentPlayed()
static ScriptInvokerEntity2 GetOnRefundPerformed()
ScriptInvokerBase< SupportStation_OnSupportStationExecuted > GetOnSupportStationExecutedSuccessfully()
static SCR_SupportStationManagerComponent GetInstance()
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.