DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
FryingPan.c
См. документацию.
2{
3 // Cooking data
5 protected bool m_CookingIsDone;
6 protected bool m_CookingIsEmpty;
7 protected bool m_CookingIsBurned;
8
9 // Particles
12
18
19 void FryingPan()
20 {
21 RegisterNetSyncVariableInt( "m_CookingMethod", CookingMethodType.NONE, CookingMethodType.COUNT );
22 RegisterNetSyncVariableBool( "m_CookingIsDone" );
23 RegisterNetSyncVariableBool( "m_CookingIsEmpty" );
24 RegisterNetSyncVariableBool( "m_CookingIsBurned" );
25 }
26 void ~FryingPan() {}
27
28 override bool IsContainer()
29 {
30 return true;
31 }
32
33 override bool IsCookware()
34 {
35 return true;
36 }
37
38 override bool CanHaveTemperature()
39 {
40 return true;
41 }
42
44 {
45 return 1.0;
46 }
47
48 override bool CanPutInCargo( EntityAI parent )
49 {
50 if ( !super.CanPutInCargo( parent ) )
51 return false;
52
53 if ( parent && IsCargoException4x3( parent ) )
54 return false;
55
56 //is 'parent' somewhere in cargo?
57 if (parent && !parent.GetInventory().AreChildrenAccessible())
58 return false;
59
60 return true;
61 }
62
63 override bool CanReceiveItemIntoCargo( EntityAI item )
64 {
65 if ( !super.CanReceiveItemIntoCargo( item ) )
66 return false;
67
68 if ( IsCargoException4x3( item ) )
69 return false;
70
71 //is 'this' somewhere in cargo?
72 if (!GetInventory().AreChildrenAccessible())
73 return false;
74
75 //can 'this' be attached to the item (->assumed smaller size than item)?
76 int slotId;
77 for (int i = 0; i < GetInventory().GetSlotIdCount(); i++)
78 {
79 slotId = GetInventory().GetSlotId(i);
80 if (item.GetInventory().HasAttachmentSlot(slotId))
81 {
82 //Print("CanReceiveItemIntoCargo | item " + item + " matches in slot name: " + InventorySlots.GetSlotName(slotId) + " of " + this);
83 return false;
84 }
85 }
86
87 return true;
88 }
89
90 override bool CanLoadItemIntoCargo( EntityAI item )
91 {
92 if ( !super.CanLoadItemIntoCargo( item ) )
93 return false;
94
95 if ( IsCargoException4x3( item ) )
96 return false;
97
98 //can 'this' be attached to the item (->assumed smaller size than item)?
99 int slotId;
100 for (int i = 0; i < GetInventory().GetSlotIdCount(); i++)
101 {
102 slotId = GetInventory().GetSlotId(i);
103 if (item.GetInventory().HasAttachmentSlot(slotId))
104 {
105 //Print("CanLoadItemIntoCargo | item " + item + " matches in slot name: " + InventorySlots.GetSlotName(slotId) + " of " + this);
106 return false;
107 }
108 }
109
110 return true;
111 }
112
113 override void SetActions()
114 {
115 super.SetActions();
116
121 }
122
123 override void EEDelete( EntityAI parent )
124 {
125 super.EEDelete( parent );
126
127 //remove audio visuals
129 }
130
132 {
133 if ( GetGame() && GetGame().IsServer() )
134 {
135 SetSynchDirty();
136 }
137 }
138
140 {
141 super.OnVariablesSynchronized();
142
143 //refresh audio visuals
145 {
147 }
148 else
149 {
151 }
152 }
153
155 {
157
158 Synchronize();
159 }
160
161 override void RefreshAudioVisualsOnClient( CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned )
162 {
163 m_CookingMethod = cooking_method;
164 m_CookingIsDone = is_done;
165 m_CookingIsEmpty = is_empty;
166 m_CookingIsBurned = is_burned;
167
168 Synchronize();
169 }
170
171 void RefreshAudioVisuals( CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned )
172 {
173 int particleId;
174
175 //if at least one of the food items is burned
176 if (is_burned)
177 {
178 particleId = PARTICLE_BURNING_DONE;
179 }
180 //proper cooking methods
181 else
182 {
183 if (cooking_method == CookingMethodType.BAKING)
184 {
185 if (is_done)
186 particleId = PARTICLE_BAKING_DONE;
187 else
188 particleId = PARTICLE_BAKING_START;
189 }
190 else if (cooking_method == CookingMethodType.DRYING)
191 {
192 if (is_done)
193 particleId = PARTICLE_DRYING_DONE;
194 else
195 particleId = PARTICLE_DRYING_START;
196 }
197 }
198
199 ParticleCookingStart(particleId);
200 }
201
203 {
205 }
206
208 {
210 {
211 //stop previous particles
213
214 //create new
215 if ( GetGame() && ( !GetGame().IsDedicatedServer() ) )
216 {
217 vector local_pos = MiscGameplayFunctions.GetSteamPosition( GetHierarchyParent() );
218 //TODO set steam position to pot (proxy) memory point (new hierarchy needed)
219 //m_ParticleCooking = Particle.Create( particle_id, this, local_pos );
220 m_ParticleCooking = ParticleManager.GetInstance().PlayInWorld( particle_id, local_pos );
222 }
223 }
224 }
226 {
227 if ( m_ParticleCooking && GetGame() && ( !GetGame().IsDedicatedServer() ) )
228 {
229 m_ParticleCooking.Stop();
230 m_ParticleCooking = NULL;
232 }
233 }
234
236 // DEPRECATED STUFF
237 // Sounds
238 protected SoundOnVehicle m_SoundCooking;
240 protected string m_SoundPlaying = "";
241
242 const string SOUND_BAKING_START = "Baking_SoundSet";
243 const string SOUND_BAKING_DONE = "Baking_Done_SoundSet";
244 const string SOUND_DRYING_START = "Drying_SoundSet";
245 const string SOUND_DRYING_DONE = "Drying_Done_SoundSet";
246 const string SOUND_BURNING_DONE = "Food_Burning_SoundSet";
247
248 protected void SoundCookingStart(string sound_name);
249 protected void SoundCookingStop();
250}
AttachActionData ActionData ActionAttach()
Определения ActionAttach.c:9
void ActionDetach()
Определения ActionDetach.c:10
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
CookingMethodType
Определения Cooking.c:2
bool IsCargoException4x3(EntityAI item)
Определения ItemBase.c:9419
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Определения ParticleManager.c:88
int particle_id
Определения SmokeSimulation.c:28
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
Определения Building.c:6
const string SOUND_DRYING_START
DEPRECATED.
Определения FryingPan.c:244
void ~FryingPan()
Определения FryingPan.c:26
override void SetActions()
Определения FryingPan.c:113
bool m_CookingIsEmpty
Определения FryingPan.c:6
override bool CanHaveTemperature()
Определения FryingPan.c:38
override void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
Определения FryingPan.c:161
void Synchronize()
Определения FryingPan.c:131
int m_ParticlePlaying
Определения FryingPan.c:11
override void RemoveAudioVisualsOnClient()
Определения FryingPan.c:154
int PARTICLE_DRYING_DONE
Определения FryingPan.c:16
const string SOUND_DRYING_DONE
DEPRECATED.
Определения FryingPan.c:245
void ParticleCookingStop()
Определения FryingPan.c:225
override bool IsContainer()
Определения FryingPan.c:28
const string SOUND_BAKING_START
DEPRECATED.
Определения FryingPan.c:242
override bool CanLoadItemIntoCargo(EntityAI item)
Определения FryingPan.c:90
void RemoveAudioVisuals()
Определения FryingPan.c:202
Particle m_ParticleCooking
Определения FryingPan.c:10
int PARTICLE_BAKING_START
Определения FryingPan.c:13
const string SOUND_BURNING_DONE
DEPRECATED.
Определения FryingPan.c:246
bool m_CookingIsBurned
Определения FryingPan.c:7
void RefreshAudioVisuals(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
Определения FryingPan.c:171
override bool CanReceiveItemIntoCargo(EntityAI item)
Определения FryingPan.c:63
int PARTICLE_BAKING_DONE
Определения FryingPan.c:14
const string SOUND_BAKING_DONE
DEPRECATED.
Определения FryingPan.c:243
void SoundCookingStart(string sound_name)
DEPRECATED.
override bool IsCookware()
Определения FryingPan.c:33
bool m_CookingIsDone
Определения FryingPan.c:5
void ParticleCookingStart(int particle_id)
Определения FryingPan.c:207
override bool CanPutInCargo(EntityAI parent)
Определения FryingPan.c:48
void SoundCookingStop()
DEPRECATED.
CookingMethodType m_CookingMethod
Определения FryingPan.c:4
int PARTICLE_BURNING_DONE
Определения FryingPan.c:17
EffectSound m_SoundEffectCooking
DEPRECATED.
Определения FryingPan.c:239
override float GetQuantityNormalizedScripted()
Определения FryingPan.c:43
string m_SoundPlaying
DEPRECATED.
Определения FryingPan.c:240
override void EEDelete(EntityAI parent)
Определения FryingPan.c:123
void FryingPan()
Определения FryingPan.c:19
override void OnVariablesSynchronized()
Определения FryingPan.c:139
SoundOnVehicle m_SoundCooking
Определения FryingPan.c:238
int PARTICLE_DRYING_START
Определения FryingPan.c:15
Legacy way of using particles in the game.
Определения Particle.c:7
static const int COOKING_DRYING_DONE
Определения ParticleList.c:68
static const int INVALID
Определения ParticleList.c:20
static const int COOKING_DRYING_START
Определения ParticleList.c:67
static const int COOKING_BAKING_START
Определения ParticleList.c:65
static const int COOKING_BURNING_DONE
Определения ParticleList.c:69
static const int COOKING_BAKING_DONE
Определения ParticleList.c:66
Определения ParticleList.c:12
Определения EnConvert.c:106
proto native CGame GetGame()