Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SupplyVehicleAudioEffect.c
Go to the documentation of this file.
2class SCR_SupplyVehicleAudioEffect : SCR_SupplyEffectBase
3{
4 [Attribute("SOUND_SUPPLIES_VEH_CONTAINER_APPEAR")]
5 protected string m_sSuppliesAppearSound;
6
7 [Attribute("SOUND_SUPPLIES_VEH_CONTAINER_DISAPPEAR")]
8 protected string m_sSuppliesDisappearSound;
9
10 [Attribute("SOUND_SUPPLIES_PARTIAL_LOAD")]
12
13 [Attribute("SOUND_SUPPLIES_PARTIAL_UNLOAD")]
15
16 [Attribute("SOUND_SUPPLIES_VEH_FULL")]
17 protected string m_sSuppliesFullSound;
18
19 //------------------------------------------------------------------------------------------------
20 override void ActivateEffect(EResourcePlayerInteractionType interactionType, SCR_ResourceComponent resourceComponentFrom, SCR_ResourceComponent resourceComponentTo, EResourceType resourceType, float resourceValue)
21 {
22 if (interactionType == EResourcePlayerInteractionType.VEHICLE_LOAD)
23 {
24 SCR_VehicleSoundComponent vehicleSoundComp = SCR_VehicleSoundComponent.Cast(resourceComponentTo.GetOwner().GetRootParent().FindComponent(SCR_VehicleSoundComponent));
25 if (!vehicleSoundComp)
26 return;
27
28 PlaySupplyLoadSound(vehicleSoundComp, resourceComponentTo, resourceType, resourceValue);
29 }
30 else if (interactionType == EResourcePlayerInteractionType.VEHICLE_UNLOAD)
31 {
32 SCR_VehicleSoundComponent vehicleSoundComp = SCR_VehicleSoundComponent.Cast(resourceComponentTo.GetOwner().GetRootParent().FindComponent(SCR_VehicleSoundComponent));
33 if (!vehicleSoundComp)
34 return;
35
36 PlaySupplyUnloadSound(vehicleSoundComp, resourceComponentTo, resourceType, resourceValue);
37 }
38 else if (interactionType == EResourcePlayerInteractionType.INVENTORY_SPLIT)
39 {
40 SCR_VehicleSoundComponent vehicleSoundComp = SCR_VehicleSoundComponent.Cast(resourceComponentFrom.GetOwner().GetRootParent().FindComponent(SCR_VehicleSoundComponent));
41 if (vehicleSoundComp)
42 {
43 PlaySupplyUnloadSound(vehicleSoundComp, resourceComponentFrom, resourceType, resourceValue);
44 }
45 else
46 {
47 vehicleSoundComp = SCR_VehicleSoundComponent.Cast(resourceComponentTo.GetOwner().GetRootParent().FindComponent(SCR_VehicleSoundComponent));
48 if (!vehicleSoundComp)
49 return;
50
51 PlaySupplyLoadSound(vehicleSoundComp, resourceComponentTo, resourceType, resourceValue);
52 }
53 }
54 }
55
56 //------------------------------------------------------------------------------------------------
57 protected void PlaySupplyLoadSound(SCR_VehicleSoundComponent vehicleSoundComp, SCR_ResourceComponent resourceComp, EResourceType resourceType, float resourceValue)
58 {
59 float current, max;
60 SCR_ResourceSystemHelper.GetStoredAndMaxResources(resourceComp, current, max, resourceType);
61
62 if (current - resourceValue == 0)
63 vehicleSoundComp.SoundEvent(m_sSuppliesAppearSound);
64 else if (current == max)
65 vehicleSoundComp.SoundEvent(m_sSuppliesFullSound);
66 else
67 vehicleSoundComp.SoundEvent(m_sSuppliesPartialLoadSound);
68 }
69
70 //------------------------------------------------------------------------------------------------
71 protected void PlaySupplyUnloadSound(SCR_VehicleSoundComponent vehicleSoundComp, SCR_ResourceComponent resourceComp, EResourceType resourceType, float resourceValue)
72 {
73 float current, max;
74 SCR_ResourceSystemHelper.GetStoredAndMaxResources(resourceComp, current, max, resourceType);
75
76 if (current == 0)
77 vehicleSoundComp.SoundEvent(m_sSuppliesDisappearSound);
78 else
79 vehicleSoundComp.SoundEvent(m_sSuppliesPartialUnloadSound);
80 }
81}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void SCR_VehicleSoundComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void PlaySupplyLoadSound(SCR_VehicleSoundComponent vehicleSoundComp, SCR_ResourceComponent resourceComp, EResourceType resourceType, float resourceValue)
void PlaySupplyUnloadSound(SCR_VehicleSoundComponent vehicleSoundComp, SCR_ResourceComponent resourceComp, EResourceType resourceType, float resourceValue)
override void ActivateEffect(EResourcePlayerInteractionType interactionType, SCR_ResourceComponent resourceComponentFrom, SCR_ResourceComponent resourceComponentTo, EResourceType resourceType, float resourceValue)
SCR_FieldOfViewSettings Attribute