10 super.AddInvokers(player);
16 if (!compartmentAccessComponent)
22 EventHandlerManagerComponent eventHandlerManager = EventHandlerManagerComponent.Cast(player.
FindComponent(EventHandlerManagerComponent));
23 if (!eventHandlerManager)
26 eventHandlerManager.RegisterScriptHandler(
"OnProjectileShot",
this,
OnWeaponFired);
27 eventHandlerManager.RegisterScriptHandler(
"OnGrenadeThrown",
this,
OnGrenadeThrown);
49 if (weapon.GetWeaponType() ==
EWeaponType.WT_SMOKEGRENADE)
58 super.RemoveInvokers(player);
64 if (!compartmentAccessComponent)
70 EventHandlerManagerComponent eventHandlerManager = EventHandlerManagerComponent.Cast(player.
FindComponent(EventHandlerManagerComponent));
71 if (!eventHandlerManager)
74 eventHandlerManager.RemoveScriptHandler(
"OnProjectileShot",
this,
OnWeaponFired);
75 eventHandlerManager.RemoveScriptHandler(
"OnGrenadeThrown",
this,
OnGrenadeThrown);
85 if (!compartment || !compartment.GetOccupant() || compartment.GetType() ==
ECompartmentType.TURRET)
90 int playerID = playerManager.GetPlayerIdFromControlledEntity(compartment.GetOccupant());
103 if (!compartment.GetOccupant())
108 int playerID = playerManager.GetPlayerIdFromControlledEntity(compartment.GetOccupant());
119 super.OnPlayerDisconnected(playerID, controlledEntity);
127 super.OnPlayerSpawned(playerID, controlledEntity);
135 super.OnControlledEntityChanged(from, to);
139 int playerID =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(to);
144 int playerID =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(from);
152 super.OnAIKilled(AIEntity, killerEntity, instigator, instigatorContextData);
156 if (instigator.GetInstigatorType() !=
InstigatorType.INSTIGATOR_PLAYER)
163 int killerId = instigator.GetInstigatorPlayerID();
172 if (!instigatorContextData.IsEnemyKillPunished(SCR_EDisguisedKillingPunishment.WARCRIME))
182 if (instigatorContextData.DoesPlayerKillCountAsTeamKill())
192 super.OnPlayerKilled(playerId, playerEntity, killerEntity, instigator, instigatorContextData);
199 if (instigator.GetInstigatorType() !=
InstigatorType.INSTIGATOR_PLAYER)
206 int killerId = instigator.GetInstigatorPlayerID();
220 if (!instigatorContextData.IsEnemyKillPunished(SCR_EDisguisedKillingPunishment.WARCRIME))
230 if (instigatorContextData.DoesPlayerKillCountAsTeamKill(possessedKillsCount:
true))
240 if (!instigatorContextData.IsEnemyKillPunished(SCR_EDisguisedKillingPunishment.WARCRIME))
250 if (instigatorContextData.DoesPlayerKillCountAsTeamKill())
298 override void CreateVisualization()
300 super.CreateVisualization();
304 CreateEntry(
"Deaths: ", 0, SCR_EShootingModuleStats.DEATHS);
305 CreateEntry(
"Player Kills: ", 0, SCR_EShootingModuleStats.PLAYERKILLS);
306 CreateEntry(
"AI Kills: ", 0, SCR_EShootingModuleStats.AIKILLS);
307 CreateEntry(
"Friendly Player Kills: ", 0, SCR_EShootingModuleStats.FRIENDLYPLAYERKILLS);
308 CreateEntry(
"Friendly AI Kills: ", 0, SCR_EShootingModuleStats.FRIENDLYAIKILLS);
309 CreateEntry(
"Bullets Shot: ", 0, SCR_EShootingModuleStats.BULLETSSHOT);
310 CreateEntry(
"Grenades Thrown: ", 0, SCR_EShootingModuleStats.GRENADESTHROWN);
316enum SCR_EShootingModuleStats
ArmaReforgerScripted GetGame()
SCR_DataCollectorComponent GetDataCollector()
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_ECharacterControlType
What kind of controller the character or (in some cases vehicle) has, eg: AI, Player,...
SCR_ECharacterDeathStatusRelations
proto external Managed FindComponent(typename typeName)
ScriptInvoker GetOnCompartmentEntered(bool createNew=true)
ScriptInvoker GetOnCompartmentLeft(bool createNew=true)
void OnControlledEntityChanged(IEntity from, IEntity to)
ref map< int, TextWidget > m_StatsVisualization
void OnCompartmentEntered(IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
void OnCompartmentLeft(IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
ref map< int, IEntity > m_mTrackedPossibleShooters
override void OnAIKilled(IEntity AIEntity, IEntity killerEntity, notnull Instigator instigator, notnull SCR_InstigatorContextData instigatorContextData)
override void AddInvokers(IEntity player)
override void OnPlayerDisconnected(int playerID, IEntity controlledEntity=null)
void OnGrenadeThrown(int playerID, BaseWeaponComponent weapon, IEntity entity)
override void Update(float timeTick)
override void OnPlayerKilled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator instigator, notnull SCR_InstigatorContextData instigatorContextData)
void OnWeaponFired(int playerID, BaseWeaponComponent weapon, IEntity entity)
override void RemoveInvokers(IEntity player)
override void OnPlayerSpawned(int playerID, IEntity controlledEntity)
void AddStat(SCR_EDataStats stat, float amount=1, bool temp=true)
float GetStat(SCR_EDataStats stat, bool newStat=true)
static SCR_PlayerData GetPlayerData(int playerID)