Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SupplySystem.c
Go to the documentation of this file.
2{
3 override static void InitInfo(WorldSystemInfo outInfo)
4 {
5 super.InitInfo(outInfo);
6 outInfo.AddPoint(ESystemPoint.FixedFrame);
7 }
8
9 [Attribute()]
12
13 //------------------------------------------------------------------------------------------------
14 void ActivateEffects(EResourcePlayerInteractionType interactionType, SCR_ResourceComponent resourceComponentFrom, SCR_ResourceComponent resourceComponentTo, EResourceType resourceType, float resourceValue)
15 {
16 Rpc_ActivateEffects(interactionType, Replication.FindItemId(resourceComponentFrom), Replication.FindItemId(resourceComponentTo), resourceType, resourceValue);
17 Rpc(Rpc_ActivateEffects, interactionType, Replication.FindItemId(resourceComponentFrom), Replication.FindItemId(resourceComponentTo), resourceType, resourceValue);
18 }
19
20 //------------------------------------------------------------------------------------------------
21 [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
22 protected void Rpc_ActivateEffects(EResourcePlayerInteractionType interactionType, RplId rplIdResourceComponentFrom, RplId rplIdResourceComponentTo, EResourceType resourceType, float resourceValue)
23 {
24 if (!m_SupplyEffects)
25 return;
26
27 SCR_ResourceComponent resourceComponentFrom = SCR_ResourceComponent.Cast(Replication.FindItem(rplIdResourceComponentFrom));
28 if (!resourceComponentFrom)
29 return;
30
31 SCR_ResourceComponent resourceComponentTo = SCR_ResourceComponent.Cast(Replication.FindItem(rplIdResourceComponentTo));
32 if (resourceComponentTo)
33 m_SupplyEffects.ActivateEffect(interactionType, resourceComponentFrom, resourceComponentTo, resourceType, resourceValue);
34 }
35
36 //------------------------------------------------------------------------------------------------
37 override event protected void OnStarted()
38 {
39 super.OnStarted();
40
41 if (m_sSupplyEffectsConfig.GetPath().IsEmpty())
42 return;
43
45 if (!holder || !holder.IsValid())
46 return;
47
48 BaseContainer container = holder.GetResource().ToBaseContainer();
49 if (!container)
50 return;
51
52 m_SupplyEffects = SCR_SupplyEffectsConfig.Cast(BaseContainerTools.CreateInstanceFromContainer(container));
53 }
54}
Main replication API.
Definition Replication.c:14
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
Replication item identifier.
Definition RplId.c:14
void Rpc_ActivateEffects(EResourcePlayerInteractionType interactionType, RplId rplIdResourceComponentFrom, RplId rplIdResourceComponentTo, EResourceType resourceType, float resourceValue)
ResourceName m_sSupplyEffectsConfig
void ActivateEffects(EResourcePlayerInteractionType interactionType, SCR_ResourceComponent resourceComponentFrom, SCR_ResourceComponent resourceComponentTo, EResourceType resourceType, float resourceValue)
ref SCR_SupplyEffectsConfig m_SupplyEffects
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
Structure holding world system meta-information required by the engine.
WorldSystemPoint ESystemPoint
Definition gameLib.c:7
SCR_FieldOfViewSettings Attribute
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
Definition EnNetwork.c:95
RplRcver
Definition RplRcver.c:59
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
Definition RplChannel.c:14