DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
FireworksBase.c
См. документацию.
1
10
12{
15 protected ref Timer m_TimerEvent;
16 protected int m_RandomSeed;
17
19 {
20 Init();
21 }
22
23 override void EEOnCECreate()
24 {
25 StandUp();
26 }
27
28 protected void Init();
29
30
31
32 override protected void SetActions()
33 {
34 super.SetActions();
35
39 }
40
41 override bool HasFlammableMaterial()
42 {
43 return true;
44 }
45
46 protected float GetMaxAllowedWetness()
47 {
48 return 0.1;
49 }
50
52 {
53 return m_State;
54 }
55
56 protected void SetState(EFireworksState state)
57 {
58 if (state != m_StatePrev && GetGame().IsServer())
59 {
60 m_State = state;
61 SetSynchDirty();
63 m_StatePrev = state;
64 }
65 }
66
67 protected void OnStateChangedServer(EFireworksState currentState);
68 protected void OnStateChangedClient(EFireworksState currentState);
69
70
71 override protected void OnInventoryEnter(Man player)
72 {
73 if (GetState() == EFireworksState.PLACED)
74 {
76 }
77 }
78
79 override protected void OnInventoryExit(Man player)
80 {
81 super.OnInventoryExit(player);
82
83 if (!IsBeingPlaced())
84 StandUp();
85 }
86
87 protected void StandUp()
88 {
89 if (!IsRuined())
90 {
91 SetOrientation(vector.Zero);
92 }
93 }
94
96 override void OnIgnitedThis( EntityAI fire_source)
97 {
99 }
100
101 // Checkes if Torch can be ignited
102 override protected bool CanBeIgnitedBy(EntityAI igniter = NULL)
103 {
104 if (GetWet() >= GetMaxAllowedWetness())
105 {
106 return false;
107 }
108
109 if (MiscGameplayFunctions.IsUnderRoofEx(this, 60))
110 {
111 return false;
112 }
113
114 if ((GetState() <= EFireworksState.PLACED) && vector.Dot(vector.Up,GetDirectionUp()) > 0.95)
115 {
116 return true;
117 }
118 return false;
119 }
120
122 protected void OnEventServer(int type);
123
124 protected float GetEventDelay()
125 {
126 return 0;
127 }
128
129 override protected void OnVariablesSynchronized()
130 {
131 //Print("new state client: " + m_State);
132 super.OnVariablesSynchronized();
133 if (m_State != m_StatePrev)
134 {
137 }
138 }
139
140 #ifdef DEVELOPER
141
142 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
143 {
144 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.ACTIVATE_ENTITY, "Ignite", FadeColors.LIGHT_GREY));
145 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "___________________________", FadeColors.LIGHT_GREY));
146
147 super.GetDebugActions(outputList);
148 }
149
150 override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
151 {
152 if (super.OnAction(action_id, player, ctx))
153 return true;
154 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
155 {
156 if (action_id == EActions.ACTIVATE_ENTITY)
157 {
158 OnIgnitedThis(null);
159 }
160
161 }
162 return false;
163 }
164 #endif
165}
Param4< int, int, string, int > TSelectableActionInfoWithColor
Определения EntityAI.c:97
PlaceObjectActionReciveData ActionReciveData ActionDeployObject()
Определения ActionDeployObject.c:9
ActionLightItemOnFireCB ActionContinuousBaseCB ActionLightItemOnFire()
Определения ActionLightItemOnFire.c:11
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
void SetActions()
Определения AdvancedCommunication.c:213
override void OnVariablesSynchronized()
Определения AnniversaryMusicSource.c:42
int m_StatePrev
Определения ClockBase.c:17
override Widget Init()
Определения DayZGame.c:127
EActions
Определения EActions.c:2
@ DEFAULT
Определения ECrewMemberState.c:3
ref Timer m_TimerEvent
Определения FireworksBase.c:15
void StandUp()
Определения FireworksBase.c:87
void OnStateChangedClient(EFireworksState currentState)
void OnStateChangedServer(EFireworksState currentState)
override void OnIgnitedThis(EntityAI fire_source)
Executed on Server when some item ignited this one.
Определения FireworksBase.c:96
float GetMaxAllowedWetness()
Определения FireworksBase.c:46
EFireworksState
Определения FireworksBase.c:3
@ FIRING
Определения FireworksBase.c:7
@ IGNITED
Определения FireworksBase.c:6
@ PLACED
Определения FireworksBase.c:5
override bool HasFlammableMaterial()
Определения FireworksBase.c:41
void OnEventServer(int type)
Called periodically after the entity gets ignited.
void FireworksBase()
Определения FireworksBase.c:18
float GetEventDelay()
Определения FireworksBase.c:124
bool CanBeIgnitedBy(EntityAI igniter=NULL)
Определения FireworksBase.c:102
int m_RandomSeed
Определения FireworksBase.c:16
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
Определения ItemBase.c:7114
void OnInventoryEnter(Man player)
Event called on item when it is placed in the player(Man) inventory, passes the owner as a parameter.
Определения ItemBase.c:8566
void OnInventoryExit(Man player)
Event called on item when it is removed from the player(Man) inventory, passes the old owner as a par...
Определения ItemBase.c:8579
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
Определения ItemBase.c:7071
override bool IsBeingPlaced()
Определения ItemBase.c:5737
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
Определения ItemBase.c:8781
override float GetWet()
Определения ItemBase.c:8374
enum EObjectTemperatureState m_State
void SetState(bool state)
Определения StaminaHandler.c:32
Определения Building.c:6
Определения DayZPlayerImplement.c:63
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Определения EnConvert.c:271
static const vector Zero
Определения EnConvert.c:110
static const vector Up
Определения EnConvert.c:107
Определения EnConvert.c:106
Serializer ParamsReadContext
Определения gameplay.c:15
proto native CGame GetGame()
const int SAT_DEBUG_ACTION
Определения constants.c:452
@ FINISHED
The video is paused at the end of the video.
Определения EnWidgets.c:527
proto native int GetState()
returns one of STATE_...
Определения StaminaHandler.c:31