DayZ 1.24
Loading...
Searching...
No Matches
Refridgerator.c
Go to the documentation of this file.
1class Refridgerator extends ItemBase
2{
4
5 override bool IsElectricAppliance()
6 {
7 return true;
8 }
9
10 override void OnInitEnergy()
11 {
12 m_SoundLoopEntity = NULL;
13 }
14
15 //--- POWER EVENTS
16 override void OnWorkStart()
17 {
18 // TO DO: Slow down or stop the aging of food inside of the fridge when such functionality is created.
19
20 m_SoundLoopEntity = PlaySoundLoop("powerGeneratorLoop", 50); // using placeholder sound
21 }
22
23 override void OnWork(float consumed_energy)
24 {
25
26 }
27
28 override void OnWorkStop()
29 {
30 // TO DO: Allow food inside the fridge to start aging again.
31
32 GetGame().ObjectDelete(m_SoundLoopEntity);
33 m_SoundLoopEntity = NULL;
34 }
35
36 //--- ACTION EVENTS
37 override void OnSwitchOn()
38 {
39
40 }
41
42 override void OnSwitchOff()
43 {
44
45 }
46
48 {
49 super.OnVariablesSynchronized();
50
51 if (IsPlaceSound())
53 }
54
55 //================================================================
56 // ADVANCED PLACEMENT
57 //================================================================
58
59 override void OnPlacementComplete(Man player, vector position = "0 0 0", vector orientation = "0 0 0")
60 {
61 super.OnPlacementComplete(player, position, orientation);
62
63 SetIsPlaceSound(true);
64 }
65
66 override string GetPlaceSoundset()
67 {
68 return "placeRefridgerator_SoundSet";
69 }
70
85}
void AddAction(typename actionName)
void RemoveAction(typename actionName)
void PlayPlaceSound()
Definition ItemBase.c:9027
void SetIsPlaceSound(bool is_place_sound)
Definition ItemBase.c:8962
bool IsPlaceSound()
Definition ItemBase.c:8967
override void OnSwitchOn()
override void OnWork(float consumed_energy)
override void OnWorkStart()
override bool IsElectricAppliance()
override void SetActions()
override void OnInitEnergy()
override void OnWorkStop()
override string GetPlaceSoundset()
override void OnVariablesSynchronized()
override void OnSwitchOff()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
SoundOnVehicle m_SoundLoopEntity
proto native CGame GetGame()