4 [
Attribute(
"2",
desc:
"Type of the arsenal item. An arsenal will only spawn items of types that it allows to be spawned. The item will not show up if it is not allowed. Eg: FieldDressing = HEAL", uiwidget:
UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(
SCR_EArsenalItemType))]
7 [
Attribute(
"2",
desc:
"Item mode of arsenal, set this to what the behaviour is for the item. EG: FieldDressing = CONSUMABLE as it is used up or M16 with attachments = WEAPON_VARIANTS as it is not a default M16. Check other items in the faction config to see how it works.", uiwidget:
UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(
SCR_EArsenalItemMode))]
13 [
Attribute(
"10",
desc:
"Supply cost of item when using the resupply action and/or taking them from the arsenal inventory. Note in overwrite arsenal config this value is ignored and still taken from catalog.\n\nAny weapon should have their base cost as the attachment cost will be calculated by the system on init and on refund (Supports Item mode WEAPON and WEAPON_VARIANTS only to save performance)",
params:
"0 inf 1")]
16 [
Attribute(
desc:
"Display data for SCR_ArsenalDisplayComponent. If Arsenal item has display data of the correct type for the entity with SCR_ArsenalDisplayComponent then it can be displayed on said entity")]
19 [
Attribute(
desc:
"Depending on the settings of the arsenal component arsenal items can have an alternative supply cost. So it will take the cost of the alternative rather than the default cost. \n\nIf an Arsenal is not cost type default and the arsenal item does not have that cost type defined than it will still use the default cost.\n\nIf multiple entries have the same value than the last in the array will be used")]
22 [
Attribute(SCR_ECharacterRank.PRIVATE.ToString(),
desc:
"Player must meet or exceed this rank in order to purchase this item", uiwidget:
UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(SCR_ECharacterRank))]
25 [
Attribute(
"1",
desc:
"When true, buying the item consumes player's military allocated supplies. The cost is equal to supply cost of the item.")]
83 if (displayData.GetDisplayType() == displayType)
111 int GetSupplyCost(SCR_EArsenalSupplyCostType supplyCostType,
bool addAdditionalCosts =
true)
115 if (addAdditionalCosts)
122 additionalCost +=
data.GetSupplyCost(supplyCostType);
130 additionalCost +=
data.GetSupplyCost(supplyCostType);
137 SCR_ArsenalAlternativeCostData alternativeCost;
139 return alternativeCost.m_iSupplyCost + additionalCost;
150 if (addAdditionalCosts)
157 additionalCost +=
data.GetSupplyCost(supplyCostType,
false);
165 additionalCost +=
data.GetSupplyRefundAmount(supplyCostType);
172 SCR_ArsenalAlternativeCostData alternativeCost;
174 return alternativeCost.GetRefundAmount() + additionalCost;
188 if (addAdditionalCosts)
195 additionalCost +=
data.GetSupplyCost(supplyCostType);
203 if (!
data.GetUseMilitarySupplyAllocation())
206 additionalCost +=
data.GetSupplyCost(supplyCostType);
213 SCR_ArsenalAlternativeCostData alternativeCost;
215 return alternativeCost.m_iSupplyCost + additionalCost;
242 if (
data.m_eAlternativeCostType == SCR_EArsenalSupplyCostType.DEFAULT)
276 array<IEntityComponentSource> componentSources = {};
277 array<SCR_BaseEntityCatalogData> entityDataList = {};
287 bool attachmentEnabled;
293 attachSlot = attachmentSource.GetObject(
"AttachmentSlot");
298 attachSlot.Get(
"Enabled", attachmentEnabled);
299 if (!attachmentEnabled)
303 attachSlot.Get(
"Prefab", attachmentPrefab);
304 if (attachmentPrefab.IsEmpty())
309 if (!attachmentEntry)
313 Print(
"Catalog Entry Arsenal Item: '" +
WidgetManager.Translate(entry.GetEntityName()) +
"' has an attachment which is not in the same catalog thus cannot get the supply cost of. Attachment: '" + attachmentPrefab +
"'",
LogLevel.VERBOSE);
329 arsenalCosts.Insert(arsenalData);
337 if (!nonArsenalCosts)
338 nonArsenalCosts = {};
340 nonArsenalCosts.Insert(nonArsenalData);
347 Print(
"Catalog Entry Arsenal Item: '" +
WidgetManager.Translate(entry.GetEntityName()) +
"' has an attachment which has no 'SCR_ArsenalItem' nor 'SCR_NonArsenalItemCostCatalogData' data in the catalog, thus it cannot get the supply cost from it. Attachment: '" + attachmentPrefab +
"'",
LogLevel.VERBOSE);
359 muzzleSource.Get(
"MagazineTemplate", ammoPrefab);
360 if (ammoPrefab.IsEmpty())
362 muzzleSource.Get(
"AmmoTemplate", ammoPrefab);
363 if (ammoPrefab.IsEmpty())
381 arsenalCosts.Insert(arsenalData);
388 if (!nonArsenalCosts)
389 nonArsenalCosts = {};
391 nonArsenalCosts.Insert(nonArsenalData);
401class SCR_ArsenalAlternativeCostData
403 [
Attribute(SCR_EArsenalSupplyCostType.GADGET_ARSENAL.ToString(),
desc:
"Cost type if system searches for the cost. Do not use DEFAULT as this will be ignored", uiwidget:
UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(SCR_EArsenalSupplyCostType))]
404 SCR_EArsenalSupplyCostType m_eAlternativeCostType;
410 int GetRefundAmount()
419 [
Attribute(
"1",
desc:
"Alternative supply refund amount. Supply refundmultiplier is still added to it",
params:
"0 inf")]
SCR_ArsenalItem SCR_BaseEntityCatalogData BaseContainerCustomEnumWithValue(SCR_EArsenalSupplyCostType, "m_eAlternativeCostType", "m_iSupplyCost", "1", "%1 - Supply cost: %2")
SCR_ArsenalItem SCR_BaseEntityCatalogData BaseContainerProps()
Get all prefabs that have the spawner data
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_ValuableIntelArsenalRefundEffect SCR_WeightedListArsenalRefundEffect BaseContainerCustomCheckIntTitleField("m_bEnabled", "Valuable Intel - Add XP", "(Disabled) Valuable Intel - Add XP", 1)
Adds ability to attach an object to a slot.
Object holding reference to resource. In destructor release the resource.
override int GetRefundAmount()
int m_iSupplyRefundAmount
SCR_EArsenalItemType GetItemType()
int GetSupplyRefundAmount(SCR_EArsenalSupplyCostType supplyCostType, bool addAdditionalCosts=true)
override void PostInitData(notnull SCR_EntityCatalogEntry entry)
bool m_bUseMilitarySupplyAllocation
SCR_EntityCatalogEntry m_EntryParent
ref map< SCR_EArsenalSupplyCostType, ref SCR_ArsenalAlternativeCostData > m_mArsenalAlternativeCostData
int GetRefundAmountValue()
SCR_EArsenalItemType m_eItemType
bool GetUseMilitarySupplyAllocation()
SCR_EArsenalItemMode m_eItemMode
SCR_ArsenalItemDisplayData GetDisplayDataOfType(EArsenalItemDisplayType displayType)
ref array< SCR_ArsenalItem > m_aAdditionalCosts
ref array< ref SCR_ArsenalItemDisplayData > m_aArsenalDisplayData
ref array< SCR_NonArsenalItemCostCatalogData > m_aNonArsenalAdditionalCosts
int GetSupplyCost(SCR_EArsenalSupplyCostType supplyCostType, bool addAdditionalCosts=true)
ref Resource m_ItemResource
SCR_ECharacterRank GetRequiredRank()
ResourceName GetItemResourceName()
ref array< ref SCR_ArsenalAlternativeCostData > m_aArsenalAlternativeCostData
Resource GetItemResource()
override void InitData(notnull SCR_EntityCatalogEntry entry)
SCR_EArsenalGameModeType GetArsenalGameModeTypes()
int GetMilitarySupplyAllocationCost(SCR_EArsenalSupplyCostType supplyCostType, bool addAdditionalCosts=true)
static void AddAdditionalCosts(notnull SCR_EntityCatalogEntry entry, Resource resource, inout array< SCR_ArsenalItem > arsenalCosts, inout array< SCR_NonArsenalItemCostCatalogData > nonArsenalCosts)
SCR_EArsenalGameModeType m_eArsenalGameModeTypes
SCR_EArsenalItemMode GetItemMode()
SCR_ECharacterRank m_eRequiredRank
Get list of entity Data of all types Ignores Disabled Elements param[out] Array of enabled entity Data list return List size *int GetEntityDataList(notnull out array< SCR_BaseEntityCatalogData > entityDataList)
SCR_EntityCatalogEntry GetEntryWithPrefab(ResourceName prefabToFind)
Base Used for items and attachments which should not be shown in the arsenal but should have a cost t...
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute