Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BaseItemSupportStationComponent.c
Go to the documentation of this file.
5
6class SCR_BaseItemSupportStationComponent : SCR_BaseSupportStationComponent
7{
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;
10
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")]
13
14 protected SCR_EntityCatalogManagerComponent m_EntityCatalogManager;
15
16 //------------------------------------------------------------------------------------------------
17 protected override void DelayedInit(IEntity owner)
18 {
19 m_EntityCatalogManager = SCR_EntityCatalogManagerComponent.GetInstance();
20 super.DelayedInit(owner);
21 }
22
23 //------------------------------------------------------------------------------------------------
24 SCR_EArsenalSupplyCostType GetArsenalSupplyCostType()
25 {
26 return m_eSupplyCostType;
27 }
28
29 //------------------------------------------------------------------------------------------------
30 protected override bool InitValidSetup()
31 {
33 {
34 Print("'SCR_BaseResupplySupportStationComponent' needs a entity catalog manager!", LogLevel.ERROR);
35 return false;
36 }
37
38 return super.InitValidSetup();
39 }
40
41 //------------------------------------------------------------------------------------------------
42 protected override int GetSupplyAmountAction(IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action)
43 {
44 if (!AreSuppliesEnabled())
45 return 0;
46
48 if (!itemHolder)
49 return 0;
50
51 SCR_EntityCatalogEntry catalogEntry = m_EntityCatalogManager.GetEntryWithPrefabFromAnyCatalog(EEntityCatalogType.ITEM, itemHolder.GetItemPrefab(), GetFaction());
52 if (!catalogEntry)
53 {
54 Print("'SCR_BaseResupplySupportStationComponent' could not find SCR_EntityCatalogEntry for '" + itemHolder.GetItemPrefab() + "' so will use fallback cost!", LogLevel.WARNING);
56 }
57
58 //~ Could not find arsenal data use fallback cost
60 if (!arsenalData)
61 {
62 Print("'SCR_BaseResupplySupportStationComponent' could not find SCR_ArsenalItem '" + itemHolder.GetItemPrefab() + "' so will use fallback cost!", LogLevel.WARNING);
64 }
65
66 return Math.ClampInt(arsenalData.GetSupplyCost(m_eSupplyCostType) + m_iBaseSupplyCostOnUse, 0, int.MAX);
67 }
68}
EEntityCatalogType
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
override int GetSupplyAmountAction(IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action)
SCR_EntityCatalogManagerComponent m_EntityCatalogManager
override bool InitValidSetup()
SCR_EArsenalSupplyCostType GetArsenalSupplyCostType()
SCR_CampaignFaction GetFaction()
override void DelayedInit()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Math.c:13
int GetSupplyCost(SCR_EArsenalSupplyCostType supplyCostType, bool addAdditionalCosts=true)
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)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute
@ MAX