DayZ 1.24
Loading...
Searching...
No Matches
Bottle_Base.c File Reference

Go to the source code of this file.

Enumerations

enum  SoundTypeBottle { POURING = 1 , EMPTYING = 0 }
 

Functions

void Bottle_Base ()
 
void ~Bottle_Base ()
 
override void EEDelete (EntityAI parent)
 
override void EECargoIn (EntityAI item)
 
override void Synchronize ()
 
override void OnRPC (PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
 
override void OnVariablesSynchronized ()
 
void RemoveAudioVisualsOnClient ()
 
void RefreshAudioVisualsOnClient (CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
 
void RefreshAudioVisuals (CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
 
void RemoveAudioVisuals ()
 
void ParticleCookingStart (int particle_id)
 
void ParticleCookingStop ()
 
void PlayPouringLoopSound ()
 
void StopPouringLoopSound ()
 
void PlayEmptyingLoopSound ()
 
void StopEmptyingLoopSound ()
 
string GetEmptyingLoopSoundset ()
 
string GetEmptyingEndSoundset ()
 
string GetPouringSoundset ()
 
string GetEmptyingLoopSoundsetHard ()
 
string GetEmptyingLoopSoundsetSoft ()
 
string GetEmptyingLoopSoundsetWater ()
 
string GetEmptyingEndSoundsetHard ()
 
string GetEmptyingEndSoundsetSoft ()
 
string GetEmptyingEndSoundsetWater ()
 
float GetLiquidEmptyRate ()
 Returns base liquid empty rate (absolute)..preferrably use the 'GetLiquidThroughputCoef' instead.
 
override void SetActions ()
 
override void OnDebugSpawn ()
 

Variables

enum SoundTypeBottle m_ParticleCooking
 
int m_ParticlePlaying = ParticleList.INVALID
 
int PARTICLE_BOILING_EMPTY = ParticleList.COOKING_BOILING_EMPTY
 
int PARTICLE_BOILING_START = ParticleList.COOKING_BOILING_START
 
int PARTICLE_BOILING_DONE = ParticleList.COOKING_BOILING_DONE
 
int PARTICLE_BAKING_START = ParticleList.COOKING_BAKING_START
 
int PARTICLE_BAKING_DONE = ParticleList.COOKING_BAKING_DONE
 
int PARTICLE_DRYING_START = ParticleList.COOKING_DRYING_START
 
int PARTICLE_DRYING_DONE = ParticleList.COOKING_DRYING_DONE
 
int PARTICLE_BURNING_DONE = ParticleList.COOKING_BURNING_DONE
 
EffectSound m_PouringLoopSound
 
EffectSound m_EmptyingLoopSound
 
CookingMethodType m_CookingMethod
 
bool m_CookingIsDone
 
bool m_CookingIsEmpty
 
bool m_CookingIsBurned
 
const string SOUND_BOILING_EMPTY = "Boiling_SoundSet"
 
const string SOUND_BOILING_START = "Boiling_SoundSet"
 
const string SOUND_BOILING_DONE = "Boiling_Done_SoundSet"
 
const string SOUND_DRYING_START = "Drying_SoundSet"
 
const string SOUND_DRYING_DONE = "Drying_Done_SoundSet"
 
float m_LiquidEmptyRate
 
const float QUANTITY_EMPTIED_PER_SEC_DEFAULT = 200
 

Enumeration Type Documentation

◆ SoundTypeBottle

Enumerator
POURING 
EMPTYING 

Definition at line 1 of file Bottle_Base.c.

2{
3 POURING = 1,
4 EMPTYING = 0,
5}
@ POURING
Definition Bottle_Base.c:3
@ EMPTYING
Definition Bottle_Base.c:4

Function Documentation

◆ Bottle_Base()

void Bottle_Base ( )
private

Definition at line 46 of file Bottle_Base.c.

47 {
48 RegisterNetSyncVariableInt("m_CookingMethod", CookingMethodType.NONE, CookingMethodType.COUNT);
49 RegisterNetSyncVariableBool("m_CookingIsDone");
50 RegisterNetSyncVariableBool("m_CookingIsEmpty");
51 RegisterNetSyncVariableBool("m_CookingIsBurned");
52
54 }
float m_LiquidEmptyRate
Definition Bottle_Base.c:43
const float QUANTITY_EMPTIED_PER_SEC_DEFAULT
Definition Bottle_Base.c:44
CookingMethodType
Definition Cooking.c:2

References m_LiquidEmptyRate, and QUANTITY_EMPTIED_PER_SEC_DEFAULT.

◆ EECargoIn()

override void EECargoIn ( EntityAI item)
private

Definition at line 70 of file Bottle_Base.c.

71 {
72 super.EECargoIn(item);
73
74 MiscGameplayFunctions.SoakItemInsideParentContainingLiquidAboveThreshold(ItemBase.Cast(item), this);
75 }

◆ EEDelete()

override void EEDelete ( EntityAI parent)
private

Definition at line 62 of file Bottle_Base.c.

63 {
64 super.EEDelete(parent);
65
66 //remove audio visuals
68 }
void RemoveAudioVisuals()

References RemoveAudioVisuals().

◆ GetEmptyingEndSoundset()

string GetEmptyingEndSoundset ( )
private

Definition at line 304 of file Bottle_Base.c.

305 {
306 vector pos = GetPosition();
307 string surfaceType = GetGame().GetPlayer().GetSurfaceType();
308 string soundSet = "";
309
310 bool diggable = GetGame().IsSurfaceDigable(surfaceType);
311
312 if (!diggable)
314 else if (diggable)
316 else if (GetGame().SurfaceIsPond(pos[0], pos[2]) || GetGame().SurfaceIsSea(pos[0], pos[2]))
318
319 return soundSet;
320 }
string GetEmptyingEndSoundsetSoft()
string GetEmptyingEndSoundsetHard()
string GetEmptyingEndSoundsetWater()
class JsonUndergroundAreaTriggerData GetPosition
proto native CGame GetGame()

References Bottle_Base::GetEmptyingEndSoundsetHard(), Bottle_Base::GetEmptyingEndSoundsetSoft(), Bottle_Base::GetEmptyingEndSoundsetWater(), GetGame(), and GetPosition.

Referenced by StopEmptyingLoopSound().

◆ GetEmptyingEndSoundsetHard()

string GetEmptyingEndSoundsetHard ( )
private

◆ GetEmptyingEndSoundsetSoft()

string GetEmptyingEndSoundsetSoft ( )
private

◆ GetEmptyingEndSoundsetWater()

string GetEmptyingEndSoundsetWater ( )
private

◆ GetEmptyingLoopSoundset()

string GetEmptyingLoopSoundset ( )
private

Definition at line 286 of file Bottle_Base.c.

287 {
288 vector pos = GetPosition();
289 string surfaceType = GetGame().GetPlayer().GetSurfaceType();
290 string soundSet = "";
291
292 bool diggable = GetGame().IsSurfaceDigable(surfaceType);
293
294 if (!diggable)
296 else if (diggable)
298 else if (GetGame().SurfaceIsPond(pos[0], pos[2]) || GetGame().SurfaceIsSea(pos[0], pos[2]))
300
301 return soundSet;
302 }
string GetEmptyingLoopSoundsetHard()
string GetEmptyingLoopSoundsetWater()
string GetEmptyingLoopSoundsetSoft()

References Bottle_Base::GetEmptyingLoopSoundsetHard(), Bottle_Base::GetEmptyingLoopSoundsetSoft(), Bottle_Base::GetEmptyingLoopSoundsetWater(), GetGame(), and GetPosition.

Referenced by PlayEmptyingLoopSound().

◆ GetEmptyingLoopSoundsetHard()

string GetEmptyingLoopSoundsetHard ( )
private

◆ GetEmptyingLoopSoundsetSoft()

string GetEmptyingLoopSoundsetSoft ( )
private

◆ GetEmptyingLoopSoundsetWater()

string GetEmptyingLoopSoundsetWater ( )
private

◆ GetLiquidEmptyRate()

float GetLiquidEmptyRate ( )
private

Returns base liquid empty rate (absolute)..preferrably use the 'GetLiquidThroughputCoef' instead.

Definition at line 331 of file Bottle_Base.c.

332 {
333 return m_LiquidEmptyRate;
334 }

References m_LiquidEmptyRate.

◆ GetPouringSoundset()

string GetPouringSoundset ( )
private

◆ OnDebugSpawn()

override void OnDebugSpawn ( )
private

Definition at line 355 of file Bottle_Base.c.

356 {
358 }
void SetQuantityMax()
Definition ItemBase.c:7905

References SetQuantityMax().

◆ OnRPC()

override void OnRPC ( PlayerIdentity sender,
int rpc_type,
ParamsReadContext ctx )
private

Definition at line 89 of file Bottle_Base.c.

90 {
91 super.OnRPC(sender, rpc_type, ctx);
92
93 Param1<bool> p = new Param1<bool>(false);
94
95 if (!ctx.Read(p))
96 return;
97
98 bool play = p.param1;
99 switch (rpc_type)
100 {
101 case SoundTypeBottle.POURING:
102 if (play)
104 else
106
107 break;
108
109 case SoundTypeBottle.EMPTYING:
110 if (play)
112 else
114
115 break;
116 }
117 }
SoundTypeBottle
Definition Bottle_Base.c:2
void StopEmptyingLoopSound()
void StopPouringLoopSound()
void PlayEmptyingLoopSound()
void PlayPouringLoopSound()

References PlayEmptyingLoopSound(), PlayPouringLoopSound(), StopEmptyingLoopSound(), and StopPouringLoopSound().

◆ OnVariablesSynchronized()

override void OnVariablesSynchronized ( )
private

Definition at line 119 of file Bottle_Base.c.

120 {
121 super.OnVariablesSynchronized();
122
125 else
127 }
bool m_CookingIsBurned
Definition Bottle_Base.c:34
bool m_CookingIsEmpty
Definition Bottle_Base.c:33
void RefreshAudioVisuals(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
bool m_CookingIsDone
Definition Bottle_Base.c:32
CookingMethodType m_CookingMethod
Definition Bottle_Base.c:31

References m_CookingIsBurned, m_CookingIsDone, m_CookingIsEmpty, m_CookingMethod, RefreshAudioVisuals(), and RemoveAudioVisuals().

◆ ParticleCookingStart()

void ParticleCookingStart ( int particle_id)
private

Definition at line 232 of file Bottle_Base.c.

233 {
234#ifndef SERVER
236 {
237 //stop previous particles
239
240 //create new
241 vector localPos = MiscGameplayFunctions.GetSteamPosition(GetHierarchyParent());
242 m_ParticleCooking = ParticleManager.GetInstance().PlayInWorld(particle_id, localPos);
244
245 }
246#endif
247 }
enum SoundTypeBottle m_ParticleCooking
int m_ParticlePlaying
Definition Bottle_Base.c:11
void ParticleCookingStop()
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
int particle_id

References m_ParticleCooking, m_ParticlePlaying, particle_id, ParticleCookingStop(), and ParticleManager().

Referenced by RefreshAudioVisuals().

◆ ParticleCookingStop()

void ParticleCookingStop ( )
private

Definition at line 249 of file Bottle_Base.c.

250 {
251 if (m_ParticleCooking && GetGame() && !GetGame().IsDedicatedServer())
252 {
253 m_ParticleCooking.Stop();
256 }
257 }
static const int INVALID

References GetGame(), ParticleList::INVALID, m_ParticleCooking, and m_ParticlePlaying.

Referenced by ParticleCookingStart(), and RemoveAudioVisuals().

◆ PlayEmptyingLoopSound()

void PlayEmptyingLoopSound ( )
private

Definition at line 271 of file Bottle_Base.c.

272 {
275 }
EffectSound m_EmptyingLoopSound
Definition Bottle_Base.c:28
string GetEmptyingLoopSoundset()
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
Manager class for managing Effect (EffectParticle, EffectSound)
static EffectSound PlaySoundOnObject(string sound_set, Object parent_object, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.

References GetEmptyingLoopSoundset(), EffectSound::IsSoundPlaying(), m_EmptyingLoopSound, and SEffectManager::PlaySoundOnObject().

Referenced by OnRPC().

◆ PlayPouringLoopSound()

void PlayPouringLoopSound ( )
private

◆ RefreshAudioVisuals()

void RefreshAudioVisuals ( CookingMethodType cooking_method,
bool is_done,
bool is_empty,
bool is_burned )
private

Definition at line 146 of file Bottle_Base.c.

147 {
148 string soundName;
149 int particleId;
150
151 //if at least one of the food items is burned
152 if (is_burned)
153 {
156 }
157 //proper cooking methods
158 else
159 {
160 switch (cooking_method)
161 {
162 case CookingMethodType.BOILING:
163 if (is_empty)
164 {
167 }
168 else
169 {
170 if (is_done)
171 {
174 }
175 else
176 {
179 }
180 }
181
182 break;
183
184 case CookingMethodType.BAKING:
185 if (is_done)
186 {
189 }
190 else
191 {
194 }
195
196 break;
197
198 case CookingMethodType.DRYING:
199 if (is_done)
200 {
203 }
204 else
205 {
208 }
209
210 break;
211
212 default:
213 soundName = "";
215
216 break;
217 }
218 }
219
220 //play effects
223 }
int PARTICLE_BAKING_DONE
Definition Bottle_Base.c:19
int PARTICLE_DRYING_DONE
Definition Bottle_Base.c:22
int PARTICLE_BOILING_DONE
Definition Bottle_Base.c:16
int PARTICLE_DRYING_START
Definition Bottle_Base.c:21
int PARTICLE_BAKING_START
Definition Bottle_Base.c:18
void ParticleCookingStart(int particle_id)
int PARTICLE_BURNING_DONE
Definition Bottle_Base.c:24
const string SOUND_DRYING_START
Definition Bottle_Base.c:40
int PARTICLE_BOILING_EMPTY
Definition Bottle_Base.c:14
const string SOUND_DRYING_DONE
Definition Bottle_Base.c:41
const string SOUND_BOILING_DONE
Definition Bottle_Base.c:39
const string SOUND_BOILING_START
Definition Bottle_Base.c:38
int PARTICLE_BOILING_START
Definition Bottle_Base.c:15
const string SOUND_BOILING_EMPTY
Definition Bottle_Base.c:37
const string SOUND_BURNING_DONE
const string SOUND_BAKING_DONE
void SoundCookingStart(string sound_name)
const string SOUND_BAKING_START
static const int NONE

References ParticleList::NONE, PARTICLE_BAKING_DONE, PARTICLE_BAKING_START, PARTICLE_BOILING_DONE, PARTICLE_BOILING_EMPTY, PARTICLE_BOILING_START, PARTICLE_BURNING_DONE, PARTICLE_DRYING_DONE, PARTICLE_DRYING_START, ParticleCookingStart(), SOUND_BAKING_DONE, SOUND_BAKING_START, SOUND_BOILING_DONE, SOUND_BOILING_EMPTY, SOUND_BOILING_START, SOUND_BURNING_DONE, SOUND_DRYING_DONE, SOUND_DRYING_START, and SoundCookingStart().

Referenced by OnVariablesSynchronized().

◆ RefreshAudioVisualsOnClient()

void RefreshAudioVisualsOnClient ( CookingMethodType cooking_method,
bool is_done,
bool is_empty,
bool is_burned )
private

Definition at line 136 of file Bottle_Base.c.

137 {
142
143 Synchronize();
144 }
override void Synchronize()
Definition Bottle_Base.c:84

References m_CookingIsBurned, m_CookingIsDone, m_CookingIsEmpty, m_CookingMethod, and Synchronize().

◆ RemoveAudioVisuals()

void RemoveAudioVisuals ( )
private

Definition at line 225 of file Bottle_Base.c.

226 {
229 }
void SoundCookingStop()

References ParticleCookingStop(), and SoundCookingStop().

Referenced by EEDelete(), and OnVariablesSynchronized().

◆ RemoveAudioVisualsOnClient()

void RemoveAudioVisualsOnClient ( )
private

Definition at line 129 of file Bottle_Base.c.

130 {
132
133 Synchronize();
134 }

References m_CookingMethod, and Synchronize().

◆ SetActions()

override void SetActions ( )
private

Definition at line 336 of file Bottle_Base.c.

References ActionExtinguishFireplaceByLiquid(), and AddAction().

◆ StopEmptyingLoopSound()

void StopEmptyingLoopSound ( )
private

Definition at line 277 of file Bottle_Base.c.

278 {
281
283 sound.SetAutodestroy(true);
284 }
string GetEmptyingEndSoundset()
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
void SoundStop()
Stops sound.

References GetEmptyingEndSoundset(), m_EmptyingLoopSound, SEffectManager::PlaySoundOnObject(), and EffectSound::SoundStop().

Referenced by OnRPC().

◆ StopPouringLoopSound()

void StopPouringLoopSound ( )
private

Definition at line 265 of file Bottle_Base.c.

266 {
269 }

References m_PouringLoopSound, and EffectSound::SoundStop().

Referenced by OnRPC().

◆ Synchronize()

override void Synchronize ( )
private

Definition at line 84 of file Bottle_Base.c.

85 {
86 SetSynchDirty();
87 }

◆ ~Bottle_Base()

void ~Bottle_Base ( )
private

Definition at line 56 of file Bottle_Base.c.

57 {
60 }
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.

References SEffectManager::DestroyEffect(), m_EmptyingLoopSound, and m_PouringLoopSound.

Variable Documentation

◆ m_CookingIsBurned

◆ m_CookingIsDone

◆ m_CookingIsEmpty

◆ m_CookingMethod

◆ m_EmptyingLoopSound

EffectSound m_EmptyingLoopSound
protected

Definition at line 28 of file Bottle_Base.c.

Referenced by PlayEmptyingLoopSound(), StopEmptyingLoopSound(), and ~Bottle_Base().

◆ m_LiquidEmptyRate

float m_LiquidEmptyRate
protected

Definition at line 43 of file Bottle_Base.c.

Referenced by Bottle_Base(), and GetLiquidEmptyRate().

◆ m_ParticleCooking

◆ m_ParticlePlaying

◆ m_PouringLoopSound

EffectSound m_PouringLoopSound
protected

Definition at line 27 of file Bottle_Base.c.

Referenced by PlayPouringLoopSound(), StopPouringLoopSound(), and ~Bottle_Base().

◆ PARTICLE_BAKING_DONE

int PARTICLE_BAKING_DONE = ParticleList.COOKING_BAKING_DONE
protected

Definition at line 19 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().

◆ PARTICLE_BAKING_START

int PARTICLE_BAKING_START = ParticleList.COOKING_BAKING_START
protected

Definition at line 18 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().

◆ PARTICLE_BOILING_DONE

int PARTICLE_BOILING_DONE = ParticleList.COOKING_BOILING_DONE
protected

Definition at line 16 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().

◆ PARTICLE_BOILING_EMPTY

int PARTICLE_BOILING_EMPTY = ParticleList.COOKING_BOILING_EMPTY
protected

Definition at line 14 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().

◆ PARTICLE_BOILING_START

int PARTICLE_BOILING_START = ParticleList.COOKING_BOILING_START
protected

Definition at line 15 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().

◆ PARTICLE_BURNING_DONE

int PARTICLE_BURNING_DONE = ParticleList.COOKING_BURNING_DONE
protected

Definition at line 24 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().

◆ PARTICLE_DRYING_DONE

int PARTICLE_DRYING_DONE = ParticleList.COOKING_DRYING_DONE
protected

Definition at line 22 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().

◆ PARTICLE_DRYING_START

int PARTICLE_DRYING_START = ParticleList.COOKING_DRYING_START
protected

Definition at line 21 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().

◆ QUANTITY_EMPTIED_PER_SEC_DEFAULT

const float QUANTITY_EMPTIED_PER_SEC_DEFAULT = 200
private

Definition at line 44 of file Bottle_Base.c.

Referenced by Bottle_Base().

◆ SOUND_BOILING_DONE

const string SOUND_BOILING_DONE = "Boiling_Done_SoundSet"
protected

Definition at line 39 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().

◆ SOUND_BOILING_EMPTY

const string SOUND_BOILING_EMPTY = "Boiling_SoundSet"
protected

Definition at line 37 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().

◆ SOUND_BOILING_START

const string SOUND_BOILING_START = "Boiling_SoundSet"
protected

Definition at line 38 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().

◆ SOUND_DRYING_DONE

const string SOUND_DRYING_DONE = "Drying_Done_SoundSet"
protected

Definition at line 41 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().

◆ SOUND_DRYING_START

const string SOUND_DRYING_START = "Drying_SoundSet"
protected

Definition at line 40 of file Bottle_Base.c.

Referenced by RefreshAudioVisuals().