6 class SCR_ResupplySupportStationComponent : SCR_BaseSupportStationComponent
8 [
Attribute(SCR_EArsenalSupplyCostType.DEFAULT.ToString(),
desc:
"Cost type of items. If it is not DEFAULT than it will try to get the diffrent supply cost if the item has it assigned" , uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(SCR_EArsenalSupplyCostType),
category:
"Resupply Support Station")]
9 protected SCR_EArsenalSupplyCostType m_eSupplyCostType;
11 [
Attribute(
"1",
desc:
"Fallback item supply cost. If for some reason the item that was supplied had no cost or could not be found then the fallback cost is used",
category:
"Resupply Support Station",
params:
"1 inf 1")]
20 super.DelayedInit(owner);
28 Print(
"'SCR_ResupplySupportStationComponent' needs a entity catalog manager!", LogLevel.ERROR);
35 Print(
"'SCR_ResupplySupportStationComponent' does not support range. Make sure m_fRange is set to -1", LogLevel.ERROR);
39 return super.InitValidSetup();
47 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!");
51 return super.IsValid(actionOwner, actionUser, action, actionPosition, reasonInvalid, supplyCost);
71 Print(
"'SCR_ResupplySupportStationComponent' could not find SCR_EntityCatalogEntry for '" + resupplyAction.GetItemToResupply() +
"' so will use fallback cost!", LogLevel.WARNING);
79 Print(
"'SCR_ResupplySupportStationComponent' could not find SCR_ArsenalItem '" + resupplyAction.GetItemToResupply() +
"' so will use fallback cost!", LogLevel.WARNING);
91 SCR_InventoryStorageManagerComponent inventoryManager = resupplyAction.GetTargetInventory();
92 if (!inventoryManager)
102 map<ResourceName, int> itemsToResupply =
new map<ResourceName, int>;
103 itemsToResupply.Insert(resupplyAction.GetItemToResupply(), 1);
104 inventoryManager.ResupplyMagazines(itemsToResupply);
106 super.OnExecutedServer(actionOwner, actionUser, action);
117 if (!actionUser || !actionOwner)
122 SCR_InventoryStorageManagerComponent targetInventory = resupplyAction.GetTargetInventory();
123 if (!targetInventory)
127 if (targetInventory.GetOwner() == actionUser)
138 playerId = SCR_PossessingManagerComponent.GetPlayerIdFromControlledEntity(actionUser);
140 SCR_NotificationsComponent.SendLocal(resupplyAction.GetNotificationOnUse());
155 playerId = SCR_PossessingManagerComponent.GetPlayerIdFromControlledEntity(actionOwner);
160 FindEntityIds(actionOwner, actionUser, ownerId, userId, playerId);
161 SCR_NotificationsComponent.SendLocal(resupplyAction.GetNotificationOnUse(), userId);