Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_NonArsenalItemCostCatalogData.c
Go to the documentation of this file.
1
2[BaseContainerProps(configRoot: true), BaseContainerCustomCheckIntTitleField("m_bEnabled", "Non-Arsenal item cost Data", "DISABLED - Arsenal Data", 1)]
4{
5 [Attribute("10", desc: "Supply cost of the item when the item is sold or is an attachment on an item that is in an arsenal", params: "0 inf 1")]
6 protected int m_iSupplyCost;
7
8 [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")]
9 protected ref array<ref SCR_ArsenalAlternativeCostData> m_aArsenalAlternativeCostData;
10
11 //~ Any attachements on the weapon or additional costs are saved for performance on cost calculation
12 protected ref array<SCR_ArsenalItem> m_aAdditionalCosts;
13 protected ref array<SCR_NonArsenalItemCostCatalogData> m_aNonArsenalAdditionalCosts;
14
16
17 //------------------------------------------------------------------------------------------------
22 int GetSupplyCost(SCR_EArsenalSupplyCostType supplyCostType, bool addAdditionalCosts = true)
23 {
24 int additionalCost;
25
26 if (addAdditionalCosts)
27 {
28 //~ Get the cost of any attachments on the item that are not in arsenal but still have a cost
30 {
32 {
33 additionalCost += data.GetSupplyCost(supplyCostType);
34 }
35 }
36 //~ Get the cost of any attachments on the item that can be in the arsenal
38 {
40 {
41 additionalCost += data.GetSupplyCost(supplyCostType);
42 }
43 }
44 }
45
46 if (supplyCostType != SCR_EArsenalSupplyCostType.DEFAULT && m_mArsenalAlternativeCostData != null)
47 {
48 int returnValue;
49 if (m_mArsenalAlternativeCostData.Find(supplyCostType, returnValue))
50 return returnValue;
51 }
52
53 return m_iSupplyCost + additionalCost;
54 }
55
56 //------------------------------------------------------------------------------------------------
57 override void InitData(notnull SCR_EntityCatalogEntry entry)
58 {
59 //~ Save alternative costs in map and delete the array
60 if (!m_aArsenalAlternativeCostData.IsEmpty())
61 {
63
64 foreach (SCR_ArsenalAlternativeCostData data : m_aArsenalAlternativeCostData)
65 {
66 //~ Ignore default as that is m_iSupplyCost defined in the arsenal item
67 if (data.m_eAlternativeCostType == SCR_EArsenalSupplyCostType.DEFAULT)
68 continue;
69
70 m_mArsenalAlternativeCostData.Insert(data.m_eAlternativeCostType, data.m_iSupplyCost);
71 }
72
73 //~ Delete array
75 }
76 }
77
78 //------------------------------------------------------------------------------------------------
80 override void PostInitData(notnull SCR_EntityCatalogEntry entry)
81 {
82 Resource itemResource = Resource.Load(entry.GetPrefab());
83 if (!itemResource.IsValid())
84 return;
85
87 }
88}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
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)
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
static void AddAdditionalCosts(notnull SCR_EntityCatalogEntry entry, Resource resource, inout array< SCR_ArsenalItem > arsenalCosts, inout array< SCR_NonArsenalItemCostCatalogData > nonArsenalCosts)
Base Used for items and attachments which should not be shown in the arsenal but should have a cost t...
ref array< ref SCR_ArsenalAlternativeCostData > m_aArsenalAlternativeCostData
override void InitData(notnull SCR_EntityCatalogEntry entry)
override void PostInitData(notnull SCR_EntityCatalogEntry entry)
Gets the calculated cost of the attachments and ammo.
ref array< SCR_NonArsenalItemCostCatalogData > m_aNonArsenalAdditionalCosts
ref map< SCR_EArsenalSupplyCostType, int > m_mArsenalAlternativeCostData
int GetSupplyCost(SCR_EArsenalSupplyCostType supplyCostType, bool addAdditionalCosts=true)
Definition Types.c:486
SCR_FieldOfViewSettings Attribute