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_LoadCasualtySupportStationComponent.c
Go to the documentation of this file.
1
[
ComponentEditorProps
(
category
:
"GameScripted/SupportStation"
, description:
""
)]
2
class
SCR_LoadCasualtySupportStationComponentClass
:
SCR_BaseSupportStationComponentClass
3
{
4
}
5
6
class
SCR_LoadCasualtySupportStationComponent : SCR_BaseSupportStationComponent
7
{
8
protected
SCR_BaseCompartmentManagerComponent
m_CompartmentManager
;
9
protected
IEntity
m_CompartmentManagerOwner
;
10
11
//------------------------------------------------------------------------------------------------
12
protected
override
void
DelayedInit
(
IEntity
owner)
13
{
14
if
(!owner)
15
return
;
16
17
super.DelayedInit(owner);
18
19
m_CompartmentManager
= SCR_BaseCompartmentManagerComponent.Cast(owner.
FindComponent
(SCR_BaseCompartmentManagerComponent));
20
if
(!
m_CompartmentManager
)
21
{
22
IEntity
parent = owner.
GetParent
();
23
if
(parent)
24
{
25
m_CompartmentManager
= SCR_BaseCompartmentManagerComponent.Cast(parent.
FindComponent
(SCR_BaseCompartmentManagerComponent));
26
if
(
m_CompartmentManager
)
27
m_CompartmentManagerOwner
= parent;
28
}
29
}
30
else
31
{
32
m_CompartmentManagerOwner
= owner;
33
}
34
35
//~ Could not find compartment manager
36
if
(!
m_CompartmentManager
)
37
{
38
Print
(
"'SCR_LoadCasualtySupportStationComponent': '"
+
GetOwner
().
GetName
() +
"' has no CompartmentManager!"
,
LogLevel
.ERROR);
39
return
;
40
}
41
}
42
43
//------------------------------------------------------------------------------------------------
44
override
bool
IsValid
(
IEntity
actionOwner,
IEntity
actionUser,
SCR_BaseUseSupportStationAction
action,
vector
actionPosition, out
ESupportStationReasonInvalid
reasonInvalid, out
int
supplyAmount)
45
{
46
if
(!super.IsValid(actionOwner, actionUser, action, actionPosition, reasonInvalid, supplyAmount))
47
return
false
;
48
49
//~ Has no fuel to provide so not valid
50
if
(!
m_CompartmentManager
|| !
m_CompartmentManager
.GetFirstFreeCompartmentOfType(
SCR_PatientCompartmentSlot
))
51
{
52
reasonInvalid =
ESupportStationReasonInvalid
.LOAD_CASUALTY_NO_SPACE;
53
return
false
;
54
}
55
56
return
true
;
57
}
58
59
//------------------------------------------------------------------------------------------------
60
override
ESupportStationType
GetSupportStationType
()
61
{
62
return
ESupportStationType
.LOAD_CASUALTY;
63
}
64
65
//------------------------------------------------------------------------------------------------
66
override
void
OnExecutedServer
(notnull
IEntity
actionOwner, notnull
IEntity
actionUser, notnull
SCR_BaseUseSupportStationAction
action)
67
{
68
ChimeraCharacter
char
=
ChimeraCharacter
.Cast(actionOwner);
69
if
(!
char
)
70
return
;
71
72
SCR_CompartmentAccessComponent
accessComp =
SCR_CompartmentAccessComponent
.Cast(
char
.GetCompartmentAccessComponent());
73
if
(!accessComp)
74
return
;
75
76
//~ Load casualty in vehicle
77
if
(
m_CompartmentManager
)
78
{
79
BaseCompartmentSlot
compartmentSlot =
m_CompartmentManager
.GetFirstFreeCompartmentOfType(
SCR_PatientCompartmentSlot
);
80
if
(compartmentSlot)
81
{
82
//~ Successfully moved the character
83
ChimeraWorld
world =
GetGame
().GetWorld();
84
if
(accessComp.
MoveInVehicle
(
m_CompartmentManagerOwner
,
ECompartmentType
.CARGO, world.IsGameTimePaused(), compartmentSlot))
85
super.OnExecutedServer(actionOwner, actionUser, action);
86
}
87
}
88
}
89
}
ECompartmentType
ECompartmentType
Definition
ECompartmentType.c:8
ESupportStationReasonInvalid
ESupportStationReasonInvalid
Definition
ESupportStationReasonInvalid.c:4
ESupportStationType
ESupportStationType
Definition
ESupportStationType.c:3
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
ComponentEditorProps
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
Definition
SCR_AIGroupUtilityComponent.c:12
OnExecutedServer
override void OnExecutedServer(notnull IEntity actionOwner, notnull IEntity actionUser, notnull SCR_BaseUseSupportStationAction action)
Definition
SCR_BaseDamageHealSupportStationComponent.c:201
GetSupportStationType
ESupportStationType GetSupportStationType()
Definition
SCR_BaseSupportStationComponent.c:430
DelayedInit
override void DelayedInit()
Definition
SCR_CharacterIdentityBioGroupConfig.c:270
IsValid
bool IsValid()
Definition
SCR_ItemOutfitFactionComponent.c:144
m_CompartmentManagerOwner
IEntity m_CompartmentManagerOwner
Definition
SCR_LoadCasualtySupportStationComponent.c:9
GetName
string GetName()
Definition
SCR_NotificationSenderComponent.c:15
m_CompartmentManager
SCR_BaseCompartmentManagerComponent m_CompartmentManager
Definition
SCR_VehicleDamageManagerComponent.c:311
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
BaseCompartmentSlot
Definition
BaseCompartmentSlot.c:2
ChimeraCharacter
Definition
ChimeraCharacter.c:13
ChimeraWorld
Definition
ChimeraWorld.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
IEntity::GetParent
proto external IEntity GetParent()
SCR_BaseSupportStationComponentClass
Definition
SCR_BaseSupportStationComponent.c:3
SCR_BaseUseSupportStationAction
Definition
SCR_BaseUseSupportStationAction.c:2
SCR_CompartmentAccessComponent
Definition
SCR_CompartmentAccessComponent.c:16
SCR_CompartmentAccessComponent::MoveInVehicle
bool MoveInVehicle(IEntity vehicle, ECompartmentType compartmentType, bool performWhenPaused=false, BaseCompartmentSlot customSlot=null)
Definition
SCR_CompartmentAccessComponent.c:257
SCR_LoadCasualtySupportStationComponentClass
Definition
SCR_LoadCasualtySupportStationComponent.c:3
SCR_PatientCompartmentSlot
Definition
SCR_PatientCompartmentSlot.c:2
vector
Definition
vector.c:13
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
scripts
Game
Components
SupportStation
SCR_LoadCasualtySupportStationComponent.c
Generated by
1.17.0