Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
refridgerator.c
Go to the documentation of this file.
1 class Refridgerator extends ItemBase
2 {
3  SoundOnVehicle m_SoundLoopEntity;
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 
47  override void OnVariablesSynchronized()
48  {
49  super.OnVariablesSynchronized();
50 
51  if ( IsPlaceSound() )
52  {
54  }
55  }
56 
57  //================================================================
58  // ADVANCED PLACEMENT
59  //================================================================
60 
61  override void OnPlacementComplete( Man player, vector position = "0 0 0", vector orientation = "0 0 0" )
62  {
63  super.OnPlacementComplete( player, position, orientation );
64 
65  SetIsPlaceSound( true );
66  }
67 
68  override string GetPlaceSoundset()
69  {
70  return "placeRefridgerator_SoundSet";
71  }
72 
73  override void SetActions()
74  {
75  super.SetActions();
77 
86  }
87 }
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
ActionPlugIn
Definition: actionplugin.c:1
ActionTakeItemToHands
Definition: actiontakeitemtohands.c:1
ActionPlaceObject
Definition: actionplaceobject.c:9
OnWorkStop
override void OnWorkStop()
Definition: m18smokegrenade_colorbase.c:2
RemoveAction
void RemoveAction(typename actionName)
Definition: advancedcommunication.c:118
OnVariablesSynchronized
override void OnVariablesSynchronized()
Definition: anniversarymusicsource.c:42
IsPlaceSound
bool IsPlaceSound()
Definition: itembase.c:4288
OnPlacementComplete
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Definition: explosivesbase.c:133
ActionTogglePlaceObject
Definition: actiontoggleplaceobject.c:1
vector
Definition: enconvert.c:105
PlayPlaceSound
void PlayPlaceSound()
Definition: itembase.c:4348
OnWork
override void OnWork(float consumed_energy)
Definition: smokegrenadebase.c:195
AddAction
void AddAction(typename actionName)
Definition: advancedcommunication.c:86
SetActions
void SetActions()
Definition: advancedcommunication.c:79
SetIsPlaceSound
void SetIsPlaceSound(bool is_place_sound)
Definition: itembase.c:4283
ActionUnplugThisByCord
Definition: actionunplugthisbycord.c:1
ActionRepositionPluggedItem
Definition: actionrepositionpluggeditem.c:1
ActionTurnOffWhileOnGround
Definition: actionturnoffwhileonground.c:1
ActionTurnOnWhileOnGround
Definition: actionturnonwhileonground.c:1
GetPlaceSoundset
override string GetPlaceSoundset()
Definition: fireplacebase.c:2574
OnWorkStart
override void OnWorkStart()
Definition: smokegrenadebase.c:175