7 [
RplProp(onRplName:
"MilitarySupplyAllocationReplicated", condition:
RplCondition.OwnerOnly)]
8 protected int m_iPlayerMilitarySupplyAllocation;
10 [
RplProp(onRplName:
"AvailableAllocatedSuppliesReplicated", condition:
RplCondition.OwnerOnly)]
51 DiagMenu.RegisterMenu(
SCR_DebugMenuID.DEBUGUI_CAMPAIGN_MILITARY_SUPPLY_ALLOCATION,
"Military Supply Allocation",
"Conflict");
52 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_CAMPAIGN_MILITARY_SUPPLY_ALLOCATION_DEBUG,
"",
"Enable MSA debug",
"Military Supply Allocation");
60 SCR_ArsenalManagerComponent arsenalManagerComponent;
61 SCR_ArsenalManagerComponent.GetArsenalManager(arsenalManagerComponent);
63 if (!arsenalManagerComponent)
70 m_bIsEnabled = arsenalManagerComponent.IsMilitarySupplyAllocationEnabled();
111 return m_iPlayerMilitarySupplyAllocation;
157 if (amount == m_iPlayerMilitarySupplyAllocation)
160 int availableAllocatedSuppliesToAdd = amount - m_iPlayerMilitarySupplyAllocation;
162 m_iPlayerMilitarySupplyAllocation = amount;
192 if (!playerXPHandlerComponent)
218 if (!playerCharacter)
262 if (!playerXPHandler)
283 if (!playerXPHandler)
336 protected void OnRankChanged(SCR_ECharacterRank prevRank, SCR_ECharacterRank newRank,
IEntity owner,
bool silent)
352 if (playerRank == SCR_ECharacterRank.INVALID)
355 if (!playerXPHandlerComponent)
385 SCR_EntityCatalogManagerComponent entityCatalogManager = SCR_EntityCatalogManagerComponent.GetInstance();
386 if (!entityCatalogManager)
389 IEntity resourcesOwner = resourceComponent.GetOwner();
397 SCR_ChimeraCharacter buyer = SCR_ChimeraCharacter.Cast(playerController.GetControlledEntity());
408 SCR_ArsenalManagerComponent arsenalManager;
409 if (!SCR_ArsenalManagerComponent.GetArsenalManager(arsenalManager))
412 int msarCost = arsenalManager.GetItemMilitarySupplyAllocationCost(
resourceName, arsenalComponent,
true);
423 return rpl && rpl.IsProxy();
458 if (!controlledEntity)
487 if (!controlledEntity)
531 SCR_ArsenalManagerComponent arsenalManagerComponent;
532 SCR_ArsenalManagerComponent.GetArsenalManager(arsenalManagerComponent);
534 if (arsenalManagerComponent)
546 if (!DiagMenu.GetBool(
SCR_DebugMenuID.DEBUGUI_CAMPAIGN_MILITARY_SUPPLY_ALLOCATION_DEBUG))
551 DbgUI.Text(
"Military Supply Allocation is disabled.");
555 DbgUI.Begin(
"SCR_PlayerSupplyAllocationComponent");
ArmaReforgerScripted GetGame()
ResourceName resourceName
SCR_BaseGameMode GetGameMode()
SCR_CacheNoteComponentClass ScriptComponentClass RplProp()] protected ref array< string > m_aLines
void OnPlayerKilled(notnull SCR_InstigatorContextData instigatorContextData)
void SCR_CharacterRankComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void OnRankChanged(SCR_ECharacterRank prevRank, SCR_ECharacterRank newRank, bool silent)
void SCR_FactionManager(IEntitySource src, IEntity parent)
SCR_FastTravelComponentClass m_PlayerController
int GetAvailableAllocatedSuppliesReplenishmentTimer()
void ReplenishAvailableAllocatedSupplies()
If player's Available Allocated Supplies are below the threshold value it gets replenished to thresho...
void OnEnabled(bool enable)
ref ScriptInvokerInt m_MilitarySupplyAllocationChanged
void SetPlayerMilitarySupplyAllocation(int amount)
int GetPlayerAvailableAllocatedSupplies()
void OnPlayerDeleted(int playerId, IEntity player)
int m_iPlayerAvailableAllocatedSupplies
bool HasPlayerEnoughAvailableAllocatedSupplies(int amount)
void AvailableAllocatedSuppliesReplicated()
ScriptInvokerInt GetOnMilitarySupplyAllocationChanged()
int GetPlayerMilitarySupplyAllocation()
void OnArsenalRequestItem(notnull SCR_ResourceComponent resourceComponent, ResourceName resourceName, IEntity requesterEntity, notnull BaseInventoryStorageComponent inventoryStorageComponent, EResourceType resourceType, int itemCost)
ref SCR_MilitarySupplyAllocationConfig m_MilitarySupplyAllocationConfig
void MilitarySupplyAllocationReplicated()
void OnCharacterPossessed(IEntity character)
void OnMilitarySupplyAllocationEnabledChanged(bool enable)
void SetSupplyAllocationValuesByRank(SCR_ECharacterRank playerRank=SCR_ECharacterRank.INVALID)
void SetSupplyAllocationOnReconnect(int amount)
ScriptInvokerInt GetOnAvailableAllocatedSuppliesChanged()
ref ScriptInvokerInt m_AvailableAllocatedSuppliesChanged
float m_fAvailableAllocatedSuppliesReplenishmentTimer
void AddPlayerAvailableAllocatedSupplies(int amount)
ScriptInvokerBase< OnPlayerXPChangedMethod > OnPlayerXPChanged
ScriptInvokerBase< ScriptInvokerIntMethod > ScriptInvokerInt
enum EVehicleType IEntity
void DisconnectFromDiagSystem(IEntity owner)
proto external int ClearEventMask(notnull IEntity owner, int mask)
proto external int SetEventMask(notnull IEntity owner, int mask)
proto external GenericComponent FindComponent(typename typeName)
void ConnectToDiagSystem(IEntity owner)
proto external Managed FindComponent(typename typeName)
SCR_Faction GetAssignedFaction()
static SCR_ArsenalComponent FindArsenalComponent(notnull IEntity entity, bool getFromSlotted=true)
bool IsArsenalUsingSupplies()
ScriptInvokerBase< SCR_BaseGameMode_OnPlayerDisconnected > GetOnPlayerDisconnected()
ScriptInvokerBase< SCR_BaseGameMode_PlayerIdAndEntity > GetOnPlayerDeleted()
ScriptInvokerBase< SCR_BaseGameMode_PlayerId > GetOnPlayerConnected()
ScriptInvokerBase< SCR_BaseGameMode_OnControllableDestroyed > GetOnPlayerKilled()
IEntity GetVictimEntity()
int GetPlayerXP()
Getter for player XP.
OnPlayerXPChanged GetOnPlayerXPChanged()
SCR_ECharacterRank GetPlayerRankByXP()
SCR_ECharacterRank GetRankByXP(int XP)
static OnArsenalItemRequestedInvoker GetOnArsenalItemRequested()
void EOnFrame(IEntity owner, float timeSlice)
void EOnDiag(IEntity owner, float timeSlice)
proto external GenericEntity GetOwner()
Get owner entity.
EntityEvent
Various entity events.
override void OnPlayerDisconnected(int playerId, KickCauseCode cause, int timeout)
void OnPlayerConnected(int playerId)
RplCondition
Conditional replication rule. Fine grained selection of receivers.