6class SCR_ResupplySupportStationComponent : SCR_BaseItemSupportStationComponent
14 Print(
"'SCR_ResupplySupportStationComponent' does not support range. Make sure m_fRange is set to -1",
LogLevel.ERROR);
18 return super.InitValidSetup();
32 Debug.Error2(
"SCR_ResupplySupportStationComponent",
"'IsValid' fails as the resupply support station is executed with a non SCR_BaseResupplySupportStationAction action! This is will break the support station!");
36 return super.IsValid(actionOwner, actionUser, action, actionPosition, reasonInvalid, supplyAmount);
44 SCR_InventoryStorageManagerComponent inventoryManager = resupplyAction.
GetTargetInventory();
45 if (!inventoryManager)
56 if (SCR_ArsenalManagerComponent.IsMilitarySupplyAllocationEnabled())
60 itemsToResupply.Insert(resupplyAction.GetItemPrefab(), 1);
61 inventoryManager.ResupplyMagazines(itemsToResupply);
63 super.OnExecutedServer(actionOwner, actionUser, action);
74 if (!actionUser || !actionOwner)
79 SCR_InventoryStorageManagerComponent targetInventory = resupplyAction.
GetTargetInventory();
84 if (targetInventory.GetOwner() == actionUser)
95 playerId = SCR_PossessingManagerComponent.GetPlayerIdFromControlledEntity(actionUser);
112 playerId = SCR_PossessingManagerComponent.GetPlayerIdFromControlledEntity(actionOwner);
117 FindEntityIds(actionOwner, actionUser, ownerId, userId, playerId);
137 int playerId = playerManager.GetPlayerIdFromControlledEntity(actionUser);
141 if (playerFaction && playerFaction !=
GetFaction())
145 if (!playerController)
148 SCR_PlayerSupplyAllocationComponent playerSupplyAllocationComponent = SCR_PlayerSupplyAllocationComponent.Cast(playerController.FindComponent(SCR_PlayerSupplyAllocationComponent));
149 if (!playerSupplyAllocationComponent)
152 playerSupplyAllocationComponent.AddPlayerAvailableAllocatedSupplies(-1 * amount);
160 if (!SCR_ArsenalManagerComponent.IsMilitarySupplyAllocationEnabled())
ESupportStationReasonInvalid
ArmaReforgerScripted GetGame()
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
override int GetSupplyAmountAction(IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action)
override void OnExecute(IEntity actionOwner, IEntity actionUser, int playerId, SCR_BaseUseSupportStationAction action)
override void OnExecutedServer(notnull IEntity actionOwner, notnull IEntity actionUser, notnull SCR_BaseUseSupportStationAction action)
SCR_EntityCatalogManagerComponent m_EntityCatalogManager
override bool InitValidSetup()
bool GetSendNotificationOnUse()
bool AreSuppliesEnabled()
void PlayCharacterVoiceEvent(IEntity character)
ESupportStationType GetSupportStationType()
int m_iBaseSupplyCostOnUse
bool OnConsumeSuppliesServer(int amount)
void FindEntityIds(IEntity owner, IEntity user, out RplId ownerId, out RplId userId, out int playerId)
void OnSuccessfullyExecuted(IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action)
void PlaySoundEffect(SCR_AudioSourceConfiguration audioConfig, notnull IEntity soundOwner, SCR_BaseUseSupportStationAction action)
SCR_AudioSourceConfiguration GetOnUseAudioConfig()
SCR_CampaignFaction GetFaction()
void SCR_FactionManager(IEntitySource src, IEntity parent)
void OnConsumeMilitarySupplyAllocationServer(IEntity actionUser, int amount)
int GetMilitarySupplyAllocationCostOfAction(SCR_BaseUseSupportStationAction action)
Replication item identifier.
bool GetUseMilitarySupplyAllocation()
int GetSupplyCost(SCR_EArsenalSupplyCostType supplyCostType, bool addAdditionalCosts=true)
ResourceName GetItemPrefab()
ENotification GetNotificationOnUse()
SCR_InventoryStorageManagerComponent GetTargetInventory()
Get prefab entity Data of type Ignores disabled Data s param dataType class of Data type you with to obtain return Entity Data of given type Null if not found *SCR_BaseEntityCatalogData GetEntityDataOfType(typename dataType)
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.