Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PlayerSupplyAllocationComponent.c File Reference

Go to the source code of this file.

Classes

class  SCR_PlayerSupplyAllocationComponentClass

Functions

SCR_PlayerSupplyAllocationComponentClass ScriptComponentClass RplProp (onRplName:"MilitarySupplyAllocationReplicated", condition:RplCondition.OwnerOnly)] protected int m_iPlayerMilitarySupplyAllocation
override void OnPostInit (IEntity owner)
 Editable Mine.
bool SetUpConfigData ()
ScriptInvokerInt GetOnAvailableAllocatedSuppliesChanged ()
ScriptInvokerInt GetOnMilitarySupplyAllocationChanged ()
void AvailableAllocatedSuppliesReplicated ()
void MilitarySupplyAllocationReplicated ()
int GetPlayerMilitarySupplyAllocation ()
int GetPlayerAvailableAllocatedSupplies ()
float GetAvailableAllocatedSuppliesReplenishmentTimer ()
void AddPlayerAvailableAllocatedSupplies (int amount)
void SetPlayerMilitarySupplyAllocation (int amount)
bool HasPlayerEnoughAvailableAllocatedSupplies (int amount)
void SetSupplyAllocationOnReconnect (int amount)
void ReplenishAvailableAllocatedSupplies ()
 If player's Available Allocated Supplies are below the threshold value it gets replenished to threshold value.
void OnPlayerDisconnected (int playerId, KickCauseCode cause, int timeout)
void OnCharacterPossessed (IEntity character)
void OnPlayerConnected (int playerId)
void OnPlayerXPChanged (int playerId, int currentXP, int XPToAdd, SCR_EXPRewards rewardId)
void OnPlayerKilled (SCR_InstigatorContextData investigatorContextData)
void OnPlayerDeleted (int playerId, IEntity player)
void OnPlayerLost ()
void OnRankChanged (SCR_ECharacterRank prevRank, SCR_ECharacterRank newRank, IEntity owner, bool silent)
void SetSupplyAllocationValuesByRank (SCR_ECharacterRank playerRank=SCR_ECharacterRank.INVALID)
void OnArsenalRequestItem (notnull SCR_ResourceComponent resourceComponent, ResourceName resourceName, IEntity requesterEntity, notnull BaseInventoryStorageComponent inventoryStorageComponent, EResourceType resourceType, int itemCost)
bool IsProxy ()
void OnMilitarySupplyAllocationEnabledChanged (bool enable)
void OnEnabled (bool enable)
override void EOnFrame (IEntity owner, float timeSlice)
override void OnDelete (IEntity owner)

Variables

int m_iPlayerAvailableAllocatedSupplies
ref ScriptInvokerInt m_AvailableAllocatedSuppliesChanged
ref ScriptInvokerInt m_MilitarySupplyAllocationChanged
SCR_PlayerController m_PlayerController
ref SCR_MilitarySupplyAllocationConfig m_MilitarySupplyAllocationConfig
float m_fAvailableAllocatedSuppliesReplenishmentTimer = -1
bool m_bIsEnabled

Function Documentation

◆ AddPlayerAvailableAllocatedSupplies()

void AddPlayerAvailableAllocatedSupplies ( int amount)
protected

Adds param[in] amount to player Available Allocated Supplies New Available Allocated Supplies value is clamped so it does not go below 0 ar above Military Supply Allocation value

Parameters
[in]amount

Definition at line 130 of file SCR_PlayerSupplyAllocationComponent.c.

◆ AvailableAllocatedSuppliesReplicated()

void AvailableAllocatedSuppliesReplicated ( )
protected

Definition at line 95 of file SCR_PlayerSupplyAllocationComponent.c.

◆ EOnFrame()

override void EOnFrame ( IEntity owner,
float timeSlice )
protected

Definition at line 499 of file SCR_PlayerSupplyAllocationComponent.c.

◆ GetAvailableAllocatedSuppliesReplenishmentTimer()

float GetAvailableAllocatedSuppliesReplenishmentTimer ( )
protected

Definition at line 121 of file SCR_PlayerSupplyAllocationComponent.c.

◆ GetOnAvailableAllocatedSuppliesChanged()

ScriptInvokerInt GetOnAvailableAllocatedSuppliesChanged ( )
protected

Definition at line 77 of file SCR_PlayerSupplyAllocationComponent.c.

◆ GetOnMilitarySupplyAllocationChanged()

ScriptInvokerInt GetOnMilitarySupplyAllocationChanged ( )
protected

Definition at line 86 of file SCR_PlayerSupplyAllocationComponent.c.

◆ GetPlayerAvailableAllocatedSupplies()

int GetPlayerAvailableAllocatedSupplies ( )
protected

Definition at line 115 of file SCR_PlayerSupplyAllocationComponent.c.

◆ GetPlayerMilitarySupplyAllocation()

int GetPlayerMilitarySupplyAllocation ( )
protected

Definition at line 109 of file SCR_PlayerSupplyAllocationComponent.c.

◆ HasPlayerEnoughAvailableAllocatedSupplies()

bool HasPlayerEnoughAvailableAllocatedSupplies ( int amount)
protected
Parameters
[in]amount
Returns
true if player has at least the same amount of Available Allocated Supplies as param[in] amount

Definition at line 173 of file SCR_PlayerSupplyAllocationComponent.c.

◆ MilitarySupplyAllocationReplicated()

void MilitarySupplyAllocationReplicated ( )
protected

Definition at line 102 of file SCR_PlayerSupplyAllocationComponent.c.

◆ OnArsenalRequestItem()

void OnArsenalRequestItem ( notnull SCR_ResourceComponent resourceComponent,
ResourceName resourceName,
IEntity requesterEntity,
notnull BaseInventoryStorageComponent inventoryStorageComponent,
EResourceType resourceType,
int itemCost )
protected

Adjust player Available Allocated Supplies value after requesting an item from arsenal

Parameters
[in]resourceComponent
[in]resourceName
[in]inventoryStorageComponent
[in]resourceType
[in]itemCost

Definition at line 376 of file SCR_PlayerSupplyAllocationComponent.c.

◆ OnCharacterPossessed()

void OnCharacterPossessed ( IEntity character)
protected

Is called when player spawns or gets control of his character after reconnect Sets up the events for supply allocation changes based on rank

Parameters
[in]possessedcharacter

Definition at line 232 of file SCR_PlayerSupplyAllocationComponent.c.

◆ OnDelete()

override void OnDelete ( IEntity owner)
protected

Definition at line 507 of file SCR_PlayerSupplyAllocationComponent.c.

◆ OnEnabled()

void OnEnabled ( bool enable)
protected

Sets up the component if case Military Supply Allocation by Rank has been enabled or disabled

Parameters
[in]ifMilitary Supply Allocation by Rank is enabled or disabled

Definition at line 439 of file SCR_PlayerSupplyAllocationComponent.c.

◆ OnMilitarySupplyAllocationEnabledChanged()

void OnMilitarySupplyAllocationEnabledChanged ( bool enable)
protected

Definition at line 427 of file SCR_PlayerSupplyAllocationComponent.c.

◆ OnPlayerConnected()

void OnPlayerConnected ( int playerId)
protected

Subscribes to player XP changed invoker

Parameters
[in]playerId

Called after a player is connected. Server-only.

Parameters
[in]playerIdPlayerId of connected player.
[in]playerId

Definition at line 256 of file SCR_PlayerSupplyAllocationComponent.c.

◆ OnPlayerDeleted()

void OnPlayerDeleted ( int playerId,
IEntity player )
protected

Called after a player gets deleted.

Parameters
[in]playerIdPlayer ID
[in]playerPlayer entity

Definition at line 303 of file SCR_PlayerSupplyAllocationComponent.c.

◆ OnPlayerDisconnected()

void OnPlayerDisconnected ( int playerId,
KickCauseCode cause,
int timeout )
protected

Unsubscribes the rank changed invoker

Parameters
[in]playerId
[in]kickcause
[in]timeout

Called after a player is disconnected.

Parameters
[in]playerIdPlayerId of disconnected player.
[in]causeReason player disconnected
[in]timeoutTimeout for when players are allowed to connect again. -1 means Ban without an assigned timeout

What happens when a player disconnects.

Parameters
[in]playerIDis a unique player identifier that defines which player has disconnected.
[in]cause
[in]timeout

Definition at line 208 of file SCR_PlayerSupplyAllocationComponent.c.

◆ OnPlayerKilled()

void OnPlayerKilled ( SCR_InstigatorContextData investigatorContextData)
protected

Definition at line 295 of file SCR_PlayerSupplyAllocationComponent.c.

◆ OnPlayerLost()

void OnPlayerLost ( )
protected

Reset Available Allocated Supplies value to value of Military Supply Allocation Stops Available Allocated Supplies replenishment timer

Definition at line 312 of file SCR_PlayerSupplyAllocationComponent.c.

◆ OnPlayerXPChanged()

void OnPlayerXPChanged ( int playerId,
int currentXP,
int XPToAdd,
SCR_EXPRewards rewardId )
protected

Updates Military Supply Allocation values based on player rank in an event of a unspawned player getting XP

Parameters
[in]playerId
[in]currentXP
[in]XPToAdd
[in]rewardId

Definition at line 274 of file SCR_PlayerSupplyAllocationComponent.c.

◆ OnRankChanged()

void OnRankChanged ( SCR_ECharacterRank prevRank,
SCR_ECharacterRank newRank,
IEntity owner,
bool silent )
protected

Player rank changed - set the Supply Allocation values according to new rank

Parameters
[in]prevRank
[in]newRank
[in]owner
[in]silent

Definition at line 336 of file SCR_PlayerSupplyAllocationComponent.c.

◆ ReplenishAvailableAllocatedSupplies()

void ReplenishAvailableAllocatedSupplies ( )
protected

If player's Available Allocated Supplies are below the threshold value it gets replenished to threshold value.

Definition at line 189 of file SCR_PlayerSupplyAllocationComponent.c.

◆ RplProp()

SCR_PlayerSupplyAllocationComponentClass ScriptComponentClass RplProp ( onRplName:"MilitarySupplyAllocationReplicated" ,
condition:RplCondition. OwnerOnly )

◆ SetPlayerMilitarySupplyAllocation()

void SetPlayerMilitarySupplyAllocation ( int amount)
protected

Sets Military Supply Allocation to new value Adds the difference between old and new Military Supply Allocation value to the current Available Allocated Supplies value

Parameters
[in]amount

Definition at line 152 of file SCR_PlayerSupplyAllocationComponent.c.

◆ SetSupplyAllocationOnReconnect()

void SetSupplyAllocationOnReconnect ( int amount)
protected

Definition at line 179 of file SCR_PlayerSupplyAllocationComponent.c.

◆ SetSupplyAllocationValuesByRank()

void SetSupplyAllocationValuesByRank ( SCR_ECharacterRank playerRank = SCR_ECharacterRank.INVALID)
protected

Sets new Military Supply Allocation value corresponding to player rank

Parameters
[in]playerRank

Definition at line 347 of file SCR_PlayerSupplyAllocationComponent.c.

◆ SetUpConfigData()

bool SetUpConfigData ( )
protected
Returns
Whether config is set up correctly

Definition at line 58 of file SCR_PlayerSupplyAllocationComponent.c.

Variable Documentation

◆ m_AvailableAllocatedSuppliesChanged

ref ScriptInvokerInt m_AvailableAllocatedSuppliesChanged
protected

Definition at line 13 of file SCR_PlayerSupplyAllocationComponent.c.

◆ m_bIsEnabled

bool m_bIsEnabled
protected

Definition at line 23 of file SCR_PlayerSupplyAllocationComponent.c.

◆ m_fAvailableAllocatedSuppliesReplenishmentTimer

float m_fAvailableAllocatedSuppliesReplenishmentTimer = -1
protected

Definition at line 21 of file SCR_PlayerSupplyAllocationComponent.c.

◆ m_iPlayerAvailableAllocatedSupplies

int m_iPlayerAvailableAllocatedSupplies
protected

Definition at line 11 of file SCR_PlayerSupplyAllocationComponent.c.

◆ m_MilitarySupplyAllocationChanged

ref ScriptInvokerInt m_MilitarySupplyAllocationChanged
protected

Definition at line 15 of file SCR_PlayerSupplyAllocationComponent.c.

◆ m_MilitarySupplyAllocationConfig

ref SCR_MilitarySupplyAllocationConfig m_MilitarySupplyAllocationConfig
protected

Definition at line 19 of file SCR_PlayerSupplyAllocationComponent.c.

◆ m_PlayerController

SCR_PlayerController m_PlayerController
protected

Definition at line 17 of file SCR_PlayerSupplyAllocationComponent.c.