1class PortableGasStove
extends ItemBase
5 protected const string FLAME_BUTANE_ON =
"dz\\gear\\cooking\\data\\flame_butane_ca.paa";
6 protected const string FLAME_BUTANE_OFF =
"";
15 protected const float PARAM_COOKING_TIME_INC_COEF = 0.5;
23 const string SOUND_BURNING =
"portablegasstove_burn_SoundSet";
24 const string SOUND_TURN_ON =
"portablegasstove_turn_on_SoundSet";
25 const string SOUND_TURN_OFF =
"portablegasstove_turn_off_SoundSet";
33 protected ref UniversalTemperatureSourceLambdaConstant
m_UTSLConst;
77 m_UTSLConst =
new UniversalTemperatureSourceLambdaConstant();
85 super.EEItemAttached(item, slot_name);
101 super.EEItemDetached(item, slot_name);
154 m_Light.AttachOnMemoryPoint(
this,
"light");
182 override void OnWork(
float consumed_energy)
199 m_TimeFactor = consumed_energy;
227 SetObjectTexture(0, FLAME_BUTANE_OFF);
228 SetObjectTexture(1, FLAME_BUTANE_OFF);
236 SetObjectTexture(0, FLAME_BUTANE_ON);
237 SetObjectTexture(1, FLAME_BUTANE_OFF);
242 SetObjectTexture(0, FLAME_BUTANE_OFF);
243 SetObjectTexture(1, FLAME_BUTANE_ON);
256 switch (cookEquipment.Type())
261 cookingPot.RemoveAudioVisualsOnClient();
264 FryingPan fryingPan = FryingPan.Cast(cookEquipment);
265 fryingPan.RemoveAudioVisualsOnClient();
276 PlaySoundSetLoop(m_SoundBurningLoop, SOUND_BURNING, 0.1, 0.3);
281 StopSoundSet(m_SoundBurningLoop);
286 PlaySoundSet(m_SoundTurnOn, SOUND_TURN_ON, 0.1, 0.1);
291 PlaySoundSet(m_SoundTurnOff, SOUND_TURN_OFF, 0.1, 0.1);
300 if (!super.CanPutInCargo(parent))
305 return !GetCompEM().IsSwitchedOn();
316 if (!super.CanPutIntoHands(parent))
321 return !GetCompEM().IsSwitchedOn();
330 return GetCompEM().IsWorking();
335 return GetCompEM().IsWorking();
353 GetInventory().CreateInInventory(
"LargeGasCanister");
354 GetInventory().CreateInInventory(
"Pot");
356 SpawnEntityOnGroundPos(
"WaterBottle", entity.GetPosition() +
Vector(0.2, 0, 0));
ActionLightItemOnFireCB ActionContinuousBaseCB ActionLightItemOnFire()
void AddAction(typename actionName)
protected ExplosiveLight m_Light
light
protected ref UniversalTemperatureSourceSettings m_UTSSettings
protected ItemBase m_CookingEquipment
protected ref UniversalTemperatureSource m_UTSource
const float PARAM_COOKING_EQUIP_MAX_TEMP
temperature threshold for starting coooking process (degree Celsius)
void ClearCookingEquipment()
DEPRECATED.
const float PARAM_COOKING_EQUIP_TEMP_INCREASE
maximum temperature of attached cooking equipment (degree Celsius)
const float PARAM_COOKING_TEMP_THRESHOLD
cooking
protected ref Cooking m_CookingProcess
determines how fast will the fuel item burn before spending (lower is better)
proto native void ObjectDelete(Object obj)
Super root of all classes in Enforce script.
Wrapper class for managing sound through SEffectManager.
protected ref UniversalTemperatureSourceSettings m_UTSSettings
override void OnDebugSpawn()
ItemBase GetCookingEquipment()
protected void SoundTurnOn()
protected void SoundBurningStop()
void ClearCookingEquipment(ItemBase pItem)
override void OnSwitchOn()
ref Cooking m_CookingProcess
override void OnSwitchOff()
override bool CanPutInCargo(EntityAI parent)
override void OnWorkStop()
void SetCookingEquipment(ItemBase equipment)
protected void RefreshFlameVisual(bool working=false, bool hasAttachment=false)
override bool IsIgnited()
protected void RefreshFlameVisual(bool working=false)
protected EffectSound m_SoundTurnOff
protected ref UniversalTemperatureSourceLambdaConstant m_UTSLConst
override void EEItemDetached(EntityAI item, string slot_name)
override void OnWork(float consumed_energy)
override bool CanIgniteItem(EntityAI ignite_target=NULL)
protected ref UniversalTemperatureSource m_UTSource
DEPRECATED Attached spark plug item.
protected EffectSound m_SoundTurnOn
override bool CanPutIntoHands(EntityAI parent)
override bool CanRemoveFromCargo(EntityAI parent)
override void OnWorkStart()
override void EEItemAttached(EntityAI item, string slot_name)
protected void RemoveCookingAudioVisuals()
protected EffectSound m_SoundBurningLoop
ItemBase m_CookingEquipment
private float m_TimeFactor
protected void SoundBurningStart()
protected void SoundTurnOff()
override void SetActions()
original Timer deletes m_params which is unwanted
float m_TemperatureMax
min temperature you can get from the TemperatureSource
float m_RangeFull
temperature cap that will limit the return value from GetTemperature method
bool m_ManualUpdate
if the Update is running periodically
float m_TemperatureMin
how often the Update is ticking
float m_RangeMax
range where the full temperature is given to receiver
float m_TemperatureCap
max temperature you can get from the TemperatureSource
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const float FIRE_ATTACHMENT_DAMAGE_PER_SECOND
various damage per second constants
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.