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_VehicleSalvageSupportStationComponent.c
Go to the documentation of this file.
1
[
ComponentEditorProps
(
category
:
"GameScripted/SupportStation"
, description:
""
)]
2
class
SCR_VehicleSalvageSupportStationComponentClass
:
SCR_BaseSupportStationComponentClass
3
{
4
}
5
6
class
SCR_VehicleSalvageSupportStationComponent : SCR_BaseSupportStationComponent
7
{
8
[
Attribute
(defvalue:
"0.2"
, uiwidget:
UIWidgets
.SpinBox,
params
:
"0 inf"
,
desc
:
"The refund multiplier for salvging wrecks. 20% of original cost by default."
,
category
:
"General Settings"
)]
9
protected
float
m_fRefundMultiplier;
10
11
//------------------------------------------------------------------------------------------------
12
// Check if the user action is valid
13
override
bool
IsValid
(
IEntity
actionOwner,
IEntity
actionUser,
SCR_BaseUseSupportStationAction
action,
vector
actionPosition, out
ESupportStationReasonInvalid
reasonInvalid, out
int
supplyAmount)
14
{
15
SCR_VehicleSalvageSupportStationUserAction
VehicleSalvageAction =
SCR_VehicleSalvageSupportStationUserAction
.Cast(action);
16
if
(!VehicleSalvageAction)
17
{
18
Debug
.Error2(
"SCR_VehicleSalvageSupportStationComponent"
,
"This user action is not of Vehicle Salvage type."
);
19
return
false
;
20
}
21
22
return
super.IsValid(actionOwner, actionUser, action, actionPosition, reasonInvalid, supplyAmount);
23
}
24
25
//------------------------------------------------------------------------------------------------
26
override
ESupportStationType
GetSupportStationType
()
27
{
28
return
ESupportStationType
.LOAD_WRECK;
29
}
30
31
//------------------------------------------------------------------------------------------------
32
override
bool
HasSupplyGainInsteadOfCost
(
SCR_BaseUseSupportStationAction
action)
33
{
34
return
true
;
35
}
36
37
//------------------------------------------------------------------------------------------------
38
// Get final amount of supplies that will get refunded for salvaging
39
protected
override
int
GetSupplyAmountAction
(
IEntity
actionOwner,
IEntity
actionUser,
SCR_BaseUseSupportStationAction
action)
40
{
41
if
(!
m_ResourceGenerator
)
42
return
0;
43
44
SCR_VehicleSalvageSupportStationUserAction
vehicleSalvageAction =
SCR_VehicleSalvageSupportStationUserAction
.Cast(action);
45
if
(!vehicleSalvageAction)
46
return
0;
47
48
return
vehicleSalvageAction.
GetSupplyCost
() * m_fRefundMultiplier;
49
}
50
51
//------------------------------------------------------------------------------------------------
52
// Check if the vehicle exists and is destroyed, then generate supplies in return for executing the action
53
override
void
OnExecutedServer
(notnull
IEntity
actionOwner, notnull
IEntity
actionUser, notnull
SCR_BaseUseSupportStationAction
action)
54
{
55
Vehicle
vehicle =
Vehicle
.Cast(actionOwner.GetParent());
56
if
(!vehicle)
57
return
;
58
59
SCR_DamageManagerComponent damageManager = vehicle.GetDamageManager();
60
if
(!damageManager || damageManager.GetState() !=
EDamageState
.DESTROYED)
61
return
;
62
63
super.OnExecutedServer(actionOwner, actionUser, action);
64
65
int
supplyAmount =
GetSupplyAmountAction
(actionOwner, actionUser, action);
66
67
delete
vehicle;
68
69
if
(vehicle && !vehicle.IsDeleted())
70
return
;
71
72
OnGenerateSuppliesServer
(supplyAmount);
73
}
74
75
//------------------------------------------------------------------------------------------------
76
override
void
OnExecute
(
IEntity
actionOwner,
IEntity
actionUser,
int
playerId,
SCR_BaseUseSupportStationAction
action)
77
{
78
super.OnExecute(actionOwner, actionUser, playerId, action);
79
80
// Play sound effect
81
SCR_AudioSourceConfiguration audioConfig =
GetOnUseAudioConfig
();
82
if
(!audioConfig)
83
return
;
84
85
PlaySoundEffect
(audioConfig, actionUser, action);
86
}
87
}
ESupportStationReasonInvalid
ESupportStationReasonInvalid
Definition
ESupportStationReasonInvalid.c:4
ESupportStationType
ESupportStationType
Definition
ESupportStationType.c:3
ComponentEditorProps
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
Definition
SCR_AIGroupUtilityComponent.c:12
GetSupplyAmountAction
override int GetSupplyAmountAction(IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action)
Definition
SCR_BaseDamageHealSupportStationComponent.c:158
OnExecute
override void OnExecute(IEntity actionOwner, IEntity actionUser, int playerId, SCR_BaseUseSupportStationAction action)
Definition
SCR_BaseDamageHealSupportStationComponent.c:277
OnExecutedServer
override void OnExecutedServer(notnull IEntity actionOwner, notnull IEntity actionUser, notnull SCR_BaseUseSupportStationAction action)
Definition
SCR_BaseDamageHealSupportStationComponent.c:201
HasSupplyGainInsteadOfCost
bool HasSupplyGainInsteadOfCost(SCR_BaseUseSupportStationAction action)
Definition
SCR_BaseSupportStationComponent.c:505
GetSupportStationType
ESupportStationType GetSupportStationType()
Definition
SCR_BaseSupportStationComponent.c:430
OnGenerateSuppliesServer
bool OnGenerateSuppliesServer(int amount)
Definition
SCR_BaseSupportStationComponent.c:722
PlaySoundEffect
void PlaySoundEffect(SCR_AudioSourceConfiguration audioConfig, notnull IEntity soundOwner, SCR_BaseUseSupportStationAction action)
Definition
SCR_BaseSupportStationComponent.c:235
GetOnUseAudioConfig
SCR_AudioSourceConfiguration GetOnUseAudioConfig()
Definition
SCR_BaseSupportStationComponent.c:52
IsValid
bool IsValid()
Definition
SCR_ItemOutfitFactionComponent.c:144
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
m_ResourceGenerator
SCR_ResourceGenerator m_ResourceGenerator
Definition
SCR_SuppliesTransferWaypoint.c:56
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
Debug
Definition
Debug.c:13
IEntity
Definition
IEntity.c:13
SCR_BaseSupportStationComponentClass
Definition
SCR_BaseSupportStationComponent.c:3
SCR_BaseUseSupportStationAction
Definition
SCR_BaseUseSupportStationAction.c:2
SCR_VehicleSalvageSupportStationComponentClass
Definition
SCR_VehicleSalvageSupportStationComponent.c:3
SCR_VehicleSalvageSupportStationUserAction
Definition
SCR_VehicleSalvageSupportStationUserAction.c:2
SCR_VehicleSalvageSupportStationUserAction::GetSupplyCost
int GetSupplyCost()
Definition
SCR_VehicleSalvageSupportStationUserAction.c:17
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
Vehicle
enum EPhysicsLayerPresets Vehicle
Definition
gameLib.c:24
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EDamageState
EDamageState
Definition
EDamageState.c:13
scripts
Game
Components
SupportStation
SCR_VehicleSalvageSupportStationComponent.c
Generated by
1.17.0