Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_SupplyVehicleAudioEffect.c
Go to the documentation of this file.
1
[
BaseContainerProps
()]
2
class
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"
)]
11
protected
string
m_sSuppliesPartialLoadSound
;
12
13
[
Attribute
(
"SOUND_SUPPLIES_PARTIAL_UNLOAD"
)]
14
protected
string
m_sSuppliesPartialUnloadSound
;
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
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
EResourceType
EResourceType
Definition
SCR_ResourceContainer.c:2
EResourcePlayerInteractionType
EResourcePlayerInteractionType
Definition
SCR_ResourcePlayerControllerInventoryComponent.c:2
SCR_VehicleSoundComponent
void SCR_VehicleSoundComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_VehicleSoundComponent.c:71
SCR_ResourceSystemHelper
Definition
SCR_ResourceSystemHelper.c:2
SCR_SupplyVehicleAudioEffect
Definition
SCR_SupplyVehicleAudioEffect.c:3
SCR_SupplyVehicleAudioEffect::PlaySupplyLoadSound
void PlaySupplyLoadSound(SCR_VehicleSoundComponent vehicleSoundComp, SCR_ResourceComponent resourceComp, EResourceType resourceType, float resourceValue)
Definition
SCR_SupplyVehicleAudioEffect.c:57
SCR_SupplyVehicleAudioEffect::m_sSuppliesPartialLoadSound
string m_sSuppliesPartialLoadSound
Definition
SCR_SupplyVehicleAudioEffect.c:11
SCR_SupplyVehicleAudioEffect::PlaySupplyUnloadSound
void PlaySupplyUnloadSound(SCR_VehicleSoundComponent vehicleSoundComp, SCR_ResourceComponent resourceComp, EResourceType resourceType, float resourceValue)
Definition
SCR_SupplyVehicleAudioEffect.c:71
SCR_SupplyVehicleAudioEffect::ActivateEffect
override void ActivateEffect(EResourcePlayerInteractionType interactionType, SCR_ResourceComponent resourceComponentFrom, SCR_ResourceComponent resourceComponentTo, EResourceType resourceType, float resourceValue)
Definition
SCR_SupplyVehicleAudioEffect.c:20
SCR_SupplyVehicleAudioEffect::m_sSuppliesPartialUnloadSound
string m_sSuppliesPartialUnloadSound
Definition
SCR_SupplyVehicleAudioEffect.c:14
SCR_SupplyVehicleAudioEffect::m_sSuppliesAppearSound
string m_sSuppliesAppearSound
Definition
SCR_SupplyVehicleAudioEffect.c:5
SCR_SupplyVehicleAudioEffect::m_sSuppliesFullSound
string m_sSuppliesFullSound
Definition
SCR_SupplyVehicleAudioEffect.c:17
SCR_SupplyVehicleAudioEffect::m_sSuppliesDisappearSound
string m_sSuppliesDisappearSound
Definition
SCR_SupplyVehicleAudioEffect.c:8
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Sandbox
Resources
Supplies
Effects
SCR_SupplyVehicleAudioEffect.c
Generated by
1.17.0