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

Go to the source code of this file.

Enumerations

enum  FireplaceFireState {
  NO_FIRE = 1 , START_FIRE = 2 , SMALL_FIRE = 3 , NORMAL_FIRE = 4 ,
  END_FIRE = 5 , EXTINGUISHING_FIRE = 6 , EXTINGUISHED_FIRE = 7 , REIGNITED_FIRE = 8 ,
  COUNT = 9
}
 

Functions

void FireplaceBase ()
 
void ~FireplaceBase ()
 
override void EEInit ()
 
override void EEItemAttached (EntityAI item, string slot_name)
 
override void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
 
override void OnAttachmentRuined (EntityAI attachment)
 
override void EEDelete (EntityAI parent)
 
override void OnStoreSave (ParamsWriteContext ctx)
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
override void AfterStoreLoad ()
 
void Synchronize ()
 
override void OnVariablesSynchronized ()
 
override bool IsFireplace ()
 
bool IsBaseFireplace ()
 
bool IsBarrelWithHoles ()
 
bool IsFireplaceIndoor ()
 
bool IsIndoorOven ()
 
override bool CanHaveWetness ()
 
override bool CanHaveTemperature ()
 
ItemBase GetCookingEquipment ()
 
void SetCookingEquipment (ItemBase equipment)
 
void ClearCookingEquipment (ItemBase pItem)
 
void ClearCookingEquipment ()
 DEPRECATED.
 
bool DirectCookingSlotsInUse ()
 
bool SmokingSlotsInUse ()
 
void DestroyFireplace ()
 [DEPRECATED]
 
override bool IsPrepareToDelete ()
 
override void EECargoOut (EntityAI item)
 
void RefreshFireplaceVisuals ()
 
void SetBurntFirewood ()
 
void RefreshFireplacePhysics ()
 
void RefreshFireParticlesAndSounds (bool force_refresh)
 
void StopAllParticlesAndSounds ()
 
bool CanShowSmoke ()
 
void RefreshFireState ()
 
bool PlayParticle (out Particle particle, int particle_type, vector pos, bool worldpos=false)
 
bool StopParticle (out Particle particle)
 
void ParticleFireStartStart ()
 
void ParticleFireStartStop ()
 
void ParticleSmallFireStart ()
 
void ParticleSmallFireStop ()
 
void ParticleNormalFireStart ()
 
void ParticleNormalFireStop ()
 
void ParticleSmallSmokeStart ()
 
void ParticleSmallSmokeStop ()
 
void ParticleNormalSmokeStart ()
 
void ParticleNormalSmokeStop ()
 
void ParticleFireEndStart ()
 
void ParticleFireEndStop ()
 
void ParticleFireWindyNoIgniteStart ()
 
void ParticleSteamExtinguishingStart ()
 
void ParticleSteamExtinguishingStop ()
 
void ParticleSteamEndStart ()
 
void ParticleSteamEndStop ()
 
void ParticleWetNoIgniteStart ()
 
void ParticleWetNoIgniteStop ()
 
bool GetCeilingHeight (out float actual_height)
 
float GetAirResistanceForSmokeParticles (float actual_height)
 
vector GetFireEffectPosition ()
 
vector GetSmokeEffectPosition ()
 
void SoundFireLightStart ()
 
void SoundFireHeavyStart ()
 
void SoundFireNoFireStart ()
 
void SoundFireExtinguishedStart ()
 
void SoundFireWetNoIgniteStart ()
 
void SoundFireExtinguishingStart ()
 
void SoundFireWindyNoIgniteStart ()
 
void SoundFireStop ()
 
void AddToFireConsumables (ItemBase item)
 
float GetFireConsumableTypeEnergy (ItemBase item)
 
void RemoveFromFireConsumables (FireConsumable fire_consumable)
 
FireConsumable GetFireConsumableByItem (ItemBase item)
 
FireConsumable SetItemToConsume ()
 
FireConsumable GetItemToConsume ()
 
void SpendFireConsumable (float amount)
 
int GetKindlingCount ()
 Returns count of all kindling type items (define in 'm_KindlingTypes') attached to fireplace.
 
int GetFuelCount ()
 Returns count of all fuel type items (define in 'm_FuelTypes') attached to fireplace.
 
bool IsKindling (ItemBase item)
 Returns if item attached to fireplace is kindling.
 
bool IsFuel (ItemBase item)
 Returns if item attached to fireplace is fuel.
 
bool IsItemTypeAttached (typename item_type)
 
bool IsItemAttachedQuantity (typename item_type, float quantity)
 
bool HasLastAttachment ()
 
bool HasLastFuelKindlingAttached ()
 
bool IsBurning ()
 
void SetBurningState (bool is_burning)
 
bool HasAshes ()
 
void SetAshesState (bool has_ashes)
 
bool IsOven ()
 
bool HasStoneCircle ()
 
bool HasStones ()
 
int GetAttachedStonesCount ()
 
void SetOvenState (bool is_oven)
 
void SetStoneCircleState (bool has_stonecircle)
 
float GetTemperatureLossMP ()
 
void SetTemperatureLossMP (float value)
 
float GetFuelBurnRateMP ()
 
void SetFuelBurnRateMP (float value)
 
int GetFireState ()
 
void SetFireState (FireplaceFireState state)
 
void SetExtinguishingState ()
 
void StartFire (bool force_start=false)
 
void StartHeating ()
 
void Heating ()
 
void StopFire (FireplaceFireState fire_state=FireplaceFireState.END_FIRE)
 
void StopHeating ()
 
void StartCooling ()
 
void Cooling ()
 
void StopCooling ()
 
void CookWithEquipment ()
 
Cooking GetCookingProcess ()
 
void CookOnDirectSlot (ItemBase slot_item, float temp_equip, float temp_ext)
 
void SmokeOnSmokingSlot (ItemBase slot_item, float temp_equip, float temp_ext)
 
void BurnItemsInFireplace ()
 
void AddTemperatureToItemByFire (ItemBase item)
 
void AddTemperatureToFireplace (float amount)
 DEPRECATED.
 
void AddDamageToItemByFireEx (ItemBase item, bool can_be_ruined, bool pAttachment)
 
void AddDamageToItemByFire (ItemBase item, bool can_be_ruined)
 
void AddWetnessToItem (ItemBase item, float amount)
 
void AddWetnessToFireplace (float amount)
 
void TransferHeatToNearPlayers ()
 DEPRECATED.
 
void CreateAreaDamage ()
 
void DestroyAreaDamage ()
 
bool IsFacingFireplace (PlayerBase player)
 DEPRECATED.
 
bool HasAnyKindling ()
 
static bool IsWindy ()
 
bool GetIgniteFailure ()
 
void SetIgniteFailure (bool failure)
 
static bool IsEntityWet (notnull EntityAI entity_ai)
 
bool IsWet ()
 
bool IsRoofAbove ()
 
override bool IsOpen ()
 
bool IsCeilingHighEnoughForSmoke ()
 
static bool IsRainingAboveEntity (notnull EntityAI entity_ai)
 
bool IsRainingAbove ()
 
static bool IsEntityOnWaterSurface (notnull EntityAI entity_ai)
 
bool IsOnWaterSurface ()
 
static bool IsEntityOnInteriorSurface (notnull EntityAI entity_ai)
 
bool IsOnInteriorSurface ()
 
override bool IsEmpty ()
 
bool IsCargoEmpty ()
 
bool HasCookingStand ()
 
bool IsInAnimPhase (string anim_phase)
 
bool IsSpaceFor (vector size)
 
override bool CanSwapEntities (EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
 
bool CanBuildOven ()
 
bool IsSpaceForOven ()
 
bool CanBuildStoneCircle ()
 
bool IsSpaceForCircle ()
 
bool CanDismantleOven ()
 
bool CanDismantleStoneCircle ()
 
bool CanCookOnStick ()
 
bool CanExtinguishFire ()
 
FireplaceLight GetLightEntity ()
 
void SetLightEntity (FireplaceLight light)
 
override void OnPlacementComplete (Man player, vector position="0 0 0", vector orientation="0 0 0")
 
override string GetPlaceSoundset ()
 
void CalcAndSetTotalEnergy ()
 
void CalcAndSetQuantity ()
 
override void OnAttachmentQuantityChanged (ItemBase item)
 
override bool CanReleaseAttachment (EntityAI attachment)
 
void LockOvenAttachments (bool lock)
 
override bool DisassembleOnLastDetach ()
 
override void OnRPC (PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
 
override void OnDebugSpawn ()
 
override void GetDebugActions (out TSelectableActionInfoArrayEx outputList)
 
override bool OnAction (int action_id, Man player, ParamsReadContext ctx)
 

Variables

enum FireplaceFireState WIND = 0
 
enum FireplaceFireState WET = 1
 
enum FireplaceFireState m_IsBurning = false
 
bool m_HasAshes = false
 
bool m_IsOven = false
 
bool m_HasStoneCircle = false
 
bool m_RoofAbove = false
 
bool m_NoIgnite = false
 
int m_OvenAttachmentsLockState = -1
 
FireplaceFireState m_FireState = FireplaceFireState.NO_FIRE
 
FireplaceFireState m_LastFireState = FireplaceFireState.NO_FIRE
 
vector m_HalfExtents
 
float m_TemperatureLossMP = 1.0
 
float m_FuelBurnRateMP = 1.0
 determines how fast will the fireplace loose its temperature when cooling (lower is better)
 
ref Cooking m_CookingProcess
 determines how fast will the fuel item burn before spending (lower is better)
 
const float PARAM_SMALL_FIRE_TEMPERATURE = 150
 
const float PARAM_NORMAL_FIRE_TEMPERATURE = 1000
 maximum fireplace temperature of a small fire (degree Celsius)
 
const float PARAM_MIN_FIRE_TEMPERATURE = 30
 maximum fireplace temperature of a normal fire (degree Celsius)
 
const float PARAM_TEMPERATURE_INCREASE = 3
 minimum fireplace temperature under which the fireplace is inactive (degree Celsius)
 
const float PARAM_TEMPERATURE_DECREASE = 3
 how much will temperature increase when fireplace is burning (degree Celsius per second)
 
const float PARAM_MAX_WET_TO_IGNITE = 0.2
 how much will temperature decrease when fireplace is cooling (degree Celsius per second)
 
const float PARAM_MIN_TEMP_TO_REIGNITE = 30
 maximum wetness value when the fireplace can be ignited
 
const float PARAM_IGNITE_RAIN_THRESHOLD = 0.1
 minimum fireplace temperature under which the fireplace can be reignited using air only (degree Celsius)
 
const float PARAM_BURN_WET_THRESHOLD = 0.40
 maximum rain value when the fireplace can be ignited
 
const float PARAM_WET_INCREASE_COEF = 0.02
 maximum wetness value when the fireplace is able to burn
 
const float PARAM_WET_HEATING_DECREASE_COEF = 0.01
 value for calculating of wetness that fireplace gain when raining
 
const float PARAM_WET_COOLING_DECREASE_COEF = 0.002
 value for calculating wetness loss during heating process
 
const float PARAM_FIRE_CONSUM_RATE_AMOUNT = 0.5
 value for calculating wetness loss during cooling process
 
const float PARAM_BURN_DAMAGE_COEF = 5.0
 base value of fire consumption rate (how many base energy will be spent on each update)
 
const float PARAM_ITEM_HEAT_TEMP_INCREASE_COEF = 10
 value for calculating damage on items located in fireplace cargo
 
const float PARAM_ITEM_HEAT_MIN_TEMP = 40
 value for calculating temperature increase on each heat update interval (degree Celsius)
 
const float PARAM_MAX_ITEM_HEAT_TEMP_INCREASE = 200
 minimum temperature for items that can be heated in fireplace cargo or as attachments (degree Celsius)
 
const float PARAM_FULL_HEAT_RADIUS = 2.0
 maximum value of temperature of items in fireplace when heating (degree Celsius)
 
const float PARAM_HEAT_RADIUS = 4.0
 radius in which objects are fully heated by fire
 
const float PARAM_HEAT_THROUGH_AIR_COEF = 0.1
 radius in which objects are heated by fire
 
const float PARAM_MAX_TRANSFERED_TEMPERATURE = 25
 DEPRECATED value for calculation of heat transfered from fireplace through air to player (environment)
 
const int MIN_STONES_TO_BUILD_CIRCLE = 8
 
const int MIN_STONES_TO_BUILD_OVEN = 16
 minimum amount of stones for circle
 
const int MAX_TEMPERATURE_TO_DISMANTLE_OVEN = 40
 minimum amount of stones for oven
 
const float MIN_CEILING_HEIGHT = 5
 maximum temperature for dismantling oven
 
const float TEMPERATURE_LOSS_MP_DEFAULT = 1.0
 min height of ceiling for fire to be ignited
 
const float TEMPERATURE_LOSS_MP_STONES = 0.90
 
const float TEMPERATURE_LOSS_MP_OVEN = 0.75
 
const float FUEL_BURN_RATE_DEFAULT = 1.0
 
const float FUEL_BURN_RATE_STONES = 0.92
 
const float FUEL_BURN_RATE_OVEN = 0.85
 
const float PARAM_COOKING_TEMP_THRESHOLD = 100
 cooking
 
const float PARAM_COOKING_EQUIP_MAX_TEMP = 250
 temperature threshold for starting coooking process (degree Celsius)
 
const float PARAM_COOKING_EQUIP_TEMP_INCREASE = 10
 maximum temperature of attached cooking equipment (degree Celsius)
 
const int TIMER_HEATING_UPDATE_INTERVAL = 3
 
const int TIMER_COOLING_UPDATE_INTERVAL = 2
 update interval duration of heating process (seconds)
 
const int DIRECT_COOKING_SLOT_COUNT = 3
 direct cooking slots
 
const float DIRECT_COOKING_SPEED = 1.5
 
const int SMOKING_SLOT_COUNT = 4
 
const float SMOKING_SPEED = 1
 
const int LIFETIME_FIREPLACE_STONE_CIRCLE = 172800
 
const int LIFETIME_FIREPLACE_STONE_OVEN = 604800
 
const float IGNITE_WIND_THRESHOLD = 0.8
 
ref Timer m_HeatingTimer
 
ref Timer m_CoolingTimer
 
FireplaceLight m_Light
 
float m_LightDistance = 2000
 
ItemBase m_CookingEquipment
 
ItemBase m_DirectCookingSlots [DIRECT_COOKING_SLOT_COUNT]
 
ItemBase m_SmokingSlots [SMOKING_SLOT_COUNT]
 
ref FireConsumable m_ItemToConsume
 
int PARTICLE_FIRE_START = ParticleList.CAMP_FIRE_START
 
int PARTICLE_OVEN_FIRE_START = ParticleList.CAMP_STOVE_FIRE_START
 
int PARTICLE_SMALL_FIRE = ParticleList.CAMP_SMALL_FIRE
 
int PARTICLE_NORMAL_FIRE = ParticleList.CAMP_NORMAL_FIRE
 
int PARTICLE_OVEN_FIRE = ParticleList.CAMP_STOVE_FIRE
 
int PARTICLE_SMALL_SMOKE = ParticleList.CAMP_SMALL_SMOKE
 
int PARTICLE_NORMAL_SMOKE = ParticleList.CAMP_NORMAL_SMOKE
 
int PARTICLE_FIRE_END = ParticleList.CAMP_FIRE_END
 
int PARTICLE_OVEN_FIRE_END = ParticleList.CAMP_STOVE_FIRE_END
 
int PARTICLE_STEAM_END = ParticleList.CAMP_STEAM_2END
 
int PARTICLE_STEAM_EXTINGUISHING = ParticleList.CAMP_STEAM_EXTINGUISH_START
 
int PARTICLE_NO_IGNITE_WIND = ParticleList.CAMP_NO_IGNITE_WIND
 
Particle m_ParticleFireStart
 
Particle m_ParticleSmallFire
 
Particle m_ParticleNormalFire
 
Particle m_ParticleSmallSmoke
 
Particle m_ParticleNormalSmoke
 
Particle m_ParticleFireEnd
 
Particle m_ParticleSteamEnd
 
Particle m_ParticleSteamExtinguishing
 
const string SOUND_FIRE_HEAVY = "HeavyFire_SoundSet"
 
const string SOUND_FIRE_LIGHT = "LightFire_SoundSet"
 
const string SOUND_FIRE_NO_FIRE = "NoFuelFire_SoundSet"
 
const string SOUND_FIRE_EXTINGUISHING = "ExtinguishByWater_SoundSet"
 
const string SOUND_FIRE_EXTINGUISHED = "ExtinguishByWaterEnd_SoundSet"
 
EffectSound m_SoundFireLoop
 
EffectSound m_SoundFire
 
static ref map< typename, ref FireConsumableTypem_FireConsumableTypes
 
ref map< ItemBase, ref FireConsumablem_FireConsumables
 
const string MESSAGE_IGNITE_IGNIT_ITEM_DAMAGED = "You cannot start fire. Fireplace is ruined."
 
const string MESSAGE_IGNITE_NO_KINDLING = "There needs to be some kindling to start a fire."
 
const string MESSAGE_IGNITE_TOO_WET = "The fireplace is too wet to be ignited."
 
const string MESSAGE_IGNITE_RAIN = "The fire went out because of the rain."
 
const string MESSAGE_IGNITE_WIND = "The fire went out because of the wind."
 
const string MESSAGE_IGNITE_IN_WATER = "I cannot ignite the fireplace in the water."
 
const string MESSAGE_IGNITE_UNDER_LOW_ROOF = "I cannot ignite the fireplace here, the is not enough room."
 
const string MESSAGE_REIGNITE_NO_KINDLING = "There needs to be some kindling to start a fire."
 
const string MESSAGE_REIGNITE_RAIN = "Cannot reignite fireplace in rain."
 
const string MESSAGE_REIGNITE_TOO_WET = "The fireplace is too wet to be reignited."
 
const string MESSAGE_BURY_ASHES_FAILED_NOT_EMPTY = "Cannot bury ashes. There are sill items in it."
 
const string MESSAGE_BURY_ASHES_FAILED_SURFACE = "Cannot bury ashes on hard surface."
 
const string MESSAGE_BURY_ASHES_FAILED_BURNING = "Cannot bury ashes, the fireplace is still burning."
 
const string MESSAGE_BURY_ASHES_FAILED_TOO_HOT = "Cannot bury ashes, the fireplace is too hot."
 
const string MESSAGE_CANNOT_BUILD_OVEN = "Cannot build oven."
 
const string MESSAGE_CANNOT_DISMANTLE_OVEN = "Cannot dismantle oven."
 
const string ANIMATION_ASHES = "Ashes"
 
const string ANIMATION_KINDLING = "Kindling"
 
const string ANIMATION_STICKS = "Sticks"
 
const string ANIMATION_WOOD = "Wood"
 
const string ANIMATION_BURNT_WOOD = "BurntWood"
 
const string ANIMATION_STONE = "Stone"
 
const string ANIMATION_STONES = "StonesCircle"
 
const string ANIMATION_TRIPOD = "Tripod"
 
const string ANIMATION_OVEN = "Oven"
 
const string ANIMATION_INVENTORY = "Inventory"
 
const string ANIMATION_COOKWARE_HANDLE = "handleRotate"
 
const string ANIMATION_CAULDRON_HANDLE = "handle1Rotate"
 
const string MATERIAL_FIREPLACE_GLOW = "dz\\gear\\cooking\\data\\stoneground.rvmat"
 
const string MATERIAL_FIREPLACE_NOGLOW = "dz\\gear\\cooking\\data\\stonegroundnoemit.rvmat"
 
 ATTACHMENT_STICKS = WoodenStick
 
 ATTACHMENT_FIREWOOD = Firewood
 
 ATTACHMENT_RAGS = Rag
 
 ATTACHMENT_BANDAGE = BandageDressing
 
 ATTACHMENT_BOOK = ItemBook
 
 ATTACHMENT_BARK_OAK = Bark_Oak
 
 ATTACHMENT_BARK_BIRCH = Bark_Birch
 
 ATTACHMENT_PAPER = Paper
 
 ATTACHMENT_GIFTWRAP = GiftWrapPaper
 
 ATTACHMENT_PUNCHEDCARD = PunchedCard
 
 ATTACHMENT_EYEMASK_COLORBASE = EyeMask_ColorBase
 
 ATTACHMENT_TRIPOD = Tripod
 
 ATTACHMENT_COOKINGSTAND = CookingStand
 
 ATTACHMENT_STONES = Stone
 
 ATTACHMENT_COOKING_POT = Pot
 
 ATTACHMENT_FRYING_PAN = FryingPan
 
 ATTACHMENT_CAULDRON = Cauldron
 
const string OBJECT_CLUTTER_CUTTER = "ClutterCutterFireplace"
 
Object m_ClutterCutter
 
ref AreaDamageManager m_AreaDamage
 
float m_TotalEnergy
 
ref NoiseParams m_NoisePar
 
bool m_CanNoise = true
 
ref UniversalTemperatureSource m_UTSource
 
ref UniversalTemperatureSourceSettings m_UTSSettings
 
ref UniversalTemperatureSourceLambdaFireplace m_UTSLFireplace
 

Enumeration Type Documentation

◆ FireplaceFireState

Enumerator
NO_FIRE 
START_FIRE 
SMALL_FIRE 
NORMAL_FIRE 
END_FIRE 
EXTINGUISHING_FIRE 
EXTINGUISHED_FIRE 
REIGNITED_FIRE 
COUNT 

Definition at line 1 of file FireplaceBase.c.

2{
3 NO_FIRE = 1,
4 START_FIRE = 2,
5 SMALL_FIRE = 3,
6 NORMAL_FIRE = 4,
7 END_FIRE = 5,
11
12 COUNT = 9 //for net sync purposes
13}
@ NO_FIRE
@ SMALL_FIRE
@ EXTINGUISHED_FIRE
@ COUNT
@ EXTINGUISHING_FIRE
@ REIGNITED_FIRE
@ END_FIRE
@ NORMAL_FIRE
@ START_FIRE

Function Documentation

◆ AddDamageToItemByFire()

void AddDamageToItemByFire ( ItemBase item,
bool can_be_ruined )
protected

Definition at line 2140 of file FireplaceBase.c.

2141 {
2142 item.DecreaseHealth(PARAM_BURN_DAMAGE_COEF, false);
2143
2144 if (item.CanBeCooked() & item.GetHealthLevel() >= GameConstants.STATE_BADLY_DAMAGED)
2145 {
2147 edible_item.ChangeFoodStage(FoodStageType.BURNED);
2148 }
2149 }
const float PARAM_BURN_DAMAGE_COEF
base value of fire consumption rate (how many base energy will be spent on each update)
FoodStageType
Definition FoodStage.c:2
const int STATE_BADLY_DAMAGED
Definition constants.c:758

References PARAM_BURN_DAMAGE_COEF, and GameConstants::STATE_BADLY_DAMAGED.

◆ AddDamageToItemByFireEx()

void AddDamageToItemByFireEx ( ItemBase item,
bool can_be_ruined,
bool pAttachment )
protected

fireplace cargo only

cargo item attachments

fuel & kindling

cookable

Definition at line 2083 of file FireplaceBase.c.

2084 {
2085 if (!item)
2086 return;
2087
2089 return;
2090
2092 if (!pAttachment)
2093 {
2095 GameInventory itemInventory = item.GetInventory();
2096 if (itemInventory)
2097 {
2098 for (int i = 0; i < itemInventory.AttachmentCount(); ++i)
2099 itemInventory.GetAttachmentFromIndex(i).AddHealth("", "", -PARAM_BURN_DAMAGE_COEF);
2100 }
2101
2102 item.AddHealth("", "", -PARAM_BURN_DAMAGE_COEF);
2103 }
2104 else
2105 {
2106 float timerCoef = 1.0;
2107 if (m_HeatingTimer && m_HeatingTimer.IsRunning())
2109 else if (m_CoolingTimer && m_CoolingTimer.IsRunning())
2111
2112 switch (item.Type())
2113 {
2114 case ATTACHMENT_TRIPOD:
2120 break;
2121 }
2122
2124 if (IsFuel(item) || IsKindling(item))
2125 {
2126 if (item.GetHealthLevel() < GameConstants.STATE_BADLY_DAMAGED)
2127 item.DecreaseHealth(PARAM_BURN_DAMAGE_COEF, false);
2128 }
2129
2131 if (item.CanBeCooked() && item.GetHealthLevel() >= GameConstants.STATE_BADLY_DAMAGED)
2132 {
2134 edible_item.ChangeFoodStage(FoodStageType.BURNED);
2135 }
2136 }
2137 }
const int TIMER_HEATING_UPDATE_INTERVAL
ATTACHMENT_FRYING_PAN
const int TIMER_COOLING_UPDATE_INTERVAL
update interval duration of heating process (seconds)
ATTACHMENT_CAULDRON
const float PARAM_ITEM_HEAT_MIN_TEMP
value for calculating temperature increase on each heat update interval (degree Celsius)
ref Timer m_CoolingTimer
bool IsFuel(ItemBase item)
Returns if item attached to fireplace is fuel.
ATTACHMENT_COOKING_POT
ATTACHMENT_TRIPOD
ref Timer m_HeatingTimer
ATTACHMENT_COOKINGSTAND
bool IsKindling(ItemBase item)
Returns if item attached to fireplace is kindling.
override float GetTemperature()
Definition ItemBase.c:8204
script counterpart to engine's class Inventory
Definition Inventory.c:79
const float FIRE_ATTACHMENT_DAMAGE_PER_SECOND
various damage per second constants
Definition constants.c:727

References ATTACHMENT_CAULDRON, ATTACHMENT_COOKING_POT, ATTACHMENT_COOKINGSTAND, ATTACHMENT_FRYING_PAN, ATTACHMENT_TRIPOD, GameConstants::FIRE_ATTACHMENT_DAMAGE_PER_SECOND, GetTemperature(), IsFuel(), IsKindling(), m_CoolingTimer, m_HeatingTimer, PARAM_BURN_DAMAGE_COEF, PARAM_ITEM_HEAT_MIN_TEMP, GameConstants::STATE_BADLY_DAMAGED, TIMER_COOLING_UPDATE_INTERVAL, and TIMER_HEATING_UPDATE_INTERVAL.

Referenced by BurnItemsInFireplace().

◆ AddTemperatureToFireplace()

void AddTemperatureToFireplace ( float amount)
protected

DEPRECATED.

Definition at line 2080 of file FireplaceBase.c.

2080{};

◆ AddTemperatureToItemByFire()

void AddTemperatureToItemByFire ( ItemBase item)
protected

Definition at line 2069 of file FireplaceBase.c.

2070 {
2071 if (item.GetTemperatureMax() >= PARAM_ITEM_HEAT_MIN_TEMP)
2072 {
2073 float temperature = item.GetTemperature() + PARAM_ITEM_HEAT_TEMP_INCREASE_COEF;
2075 item.SetTemperature(temperature);
2076 }
2077 }
const float PARAM_MAX_ITEM_HEAT_TEMP_INCREASE
minimum temperature for items that can be heated in fireplace cargo or as attachments (degree Celsius...
const float PARAM_ITEM_HEAT_TEMP_INCREASE_COEF
value for calculating damage on items located in fireplace cargo
Definition EnMath.c:7
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'.

References Math::Clamp(), PARAM_ITEM_HEAT_MIN_TEMP, PARAM_ITEM_HEAT_TEMP_INCREASE_COEF, and PARAM_MAX_ITEM_HEAT_TEMP_INCREASE.

Referenced by BurnItemsInFireplace().

◆ AddToFireConsumables()

void AddToFireConsumables ( ItemBase item)
protected

Definition at line 1259 of file FireplaceBase.c.

1260 {
1263 }
void CalcAndSetQuantity()
float GetFireConsumableTypeEnergy(ItemBase item)
ref map< ItemBase, ref FireConsumable > m_FireConsumables

References CalcAndSetQuantity(), GetFireConsumableTypeEnergy(), and m_FireConsumables.

Referenced by FireplaceBase::EEItemAttached().

◆ AddWetnessToFireplace()

void AddWetnessToFireplace ( float amount)
protected

Definition at line 2161 of file FireplaceBase.c.

2162 {
2163 //add wetness
2164 float wetness = GetWet();
2165 wetness = wetness + amount;
2166 wetness = Math.Clamp(wetness, 0, 1); //wetness <0-1>
2167 SetWet(wetness);
2168
2169 //decrease temperature
2170 if (amount > 0)
2171 {
2172 float temperature = GetTemperature();
2173 temperature = temperature * (1 - (wetness * 0.5));
2175 // temperature via UniversalTemperatureSource
2176 m_UTSLFireplace.SetFuelCount(GetFuelCount());
2177 m_UTSLFireplace.SetCurrentTemperature(temperature);
2178 }
2179 }
const float PARAM_NORMAL_FIRE_TEMPERATURE
maximum fireplace temperature of a small fire (degree Celsius)
const float PARAM_MIN_FIRE_TEMPERATURE
maximum fireplace temperature of a normal fire (degree Celsius)
ref UniversalTemperatureSourceLambdaFireplace m_UTSLFireplace
int GetFuelCount()
Returns count of all fuel type items (define in 'm_FuelTypes') attached to fireplace.
override void SetWet(float value, bool allow_client=false)
Definition ItemBase.c:8252
override float GetWet()
Definition ItemBase.c:8281

References Math::Clamp(), GetFuelCount(), GetTemperature(), GetWet(), m_UTSLFireplace, PARAM_MIN_FIRE_TEMPERATURE, PARAM_NORMAL_FIRE_TEMPERATURE, and SetWet().

Referenced by Cooling(), and Heating().

◆ AddWetnessToItem()

void AddWetnessToItem ( ItemBase item,
float amount )
protected

Definition at line 2152 of file FireplaceBase.c.

2153 {
2154 float wetness = item.GetWet();
2155 wetness = wetness + amount;
2156 wetness = Math.Clamp(wetness, 0, 1); //wetness <0-1>
2157 item.SetWet(wetness);
2158 }

References Math::Clamp().

Referenced by BurnItemsInFireplace().

◆ AfterStoreLoad()

override void AfterStoreLoad ( )
protected

Definition at line 436 of file FireplaceBase.c.

437 {
438 super.AfterStoreLoad();
439
440 Synchronize();
441
442 //start fire
443 if (IsBurning())
444 {
445 if (GetGame() && GetGame().IsServer())
446 {
447 StartFire(true); //will be auto-synchronized when starting fire
448 }
449 }
450 }
bool IsBurning()
void StartFire(bool force_start=false)
void Synchronize()
proto native CGame GetGame()

References GetGame(), IsBurning(), StartFire(), and Synchronize().

◆ BurnItemsInFireplace()

void BurnItemsInFireplace ( )
protected

cargo

attachments

Definition at line 2031 of file FireplaceBase.c.

2032 {
2034 CargoBase cargo = GetInventory().GetCargo();
2035 for (int i = 0; i < cargo.GetItemCount(); i++)
2036 {
2037 ItemBase item = ItemBase.Cast(cargo.GetItem(i));
2038
2039 //set damage
2040 AddDamageToItemByFireEx(item, false, false);
2041
2042 if (item.GetHealth("", "Health") <= 0 && !item.IsKindOf("Grenade_Base"))
2043 item.Delete();
2044
2045 //add temperature
2047
2048 //remove wetness
2050 }
2051
2053 for (int j = 0; j < GetInventory().AttachmentCount(); ++j)
2054 {
2055 ItemBase attachment = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(j));
2056
2057 //set damage
2058 AddDamageToItemByFireEx(attachment, false, true);
2059
2060 //add temperature
2062
2063 //remove wetness
2065 }
2066 }
void AddTemperatureToItemByFire(ItemBase item)
const float PARAM_WET_HEATING_DECREASE_COEF
value for calculating of wetness that fireplace gain when raining
void AddDamageToItemByFireEx(ItemBase item, bool can_be_ruined, bool pAttachment)
void AddWetnessToItem(ItemBase item, float amount)
represents base for cargo storage for entities
Definition Cargo.c:7

References AddDamageToItemByFireEx(), AddTemperatureToItemByFire(), AddWetnessToItem(), and PARAM_WET_HEATING_DECREASE_COEF.

Referenced by Cooling(), and Heating().

◆ CalcAndSetQuantity()

void CalcAndSetQuantity ( )
protected

Definition at line 2478 of file FireplaceBase.c.

2479 {
2480 if (GetGame() && GetGame().IsServer())
2481 {
2482 float remainingEnergy;
2483
2485 {
2486 float quantity = fireConsumable.GetItem().GetQuantity();
2487 if (quantity > 0)
2488 {
2489 remainingEnergy += ((quantity - 1) * fireConsumable.GetEnergy()) + fireConsumable.GetRemainingEnergy();
2490 //Print( fireConsumable.GetItem().GetType() + " remaining energy = " + ( ( ( quantity - 1 ) * fire_consumable.GetEnergy() ) + fire_consumable.GetRemainingEnergy() ).ToString() );
2491 }
2492 else
2493 {
2494 remainingEnergy += fireConsumable.GetRemainingEnergy();
2495 //Print( fireConsumable.GetItem().GetType() + " remaining energy = " + ( fireConsumable.GetRemainingEnergy().ToString() ) );
2496 }
2497 }
2498
2500 }
2501 }
float m_TotalEnergy
bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Set item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
Definition ItemBase.c:7838
override int GetQuantityMax()
Definition ItemBase.c:7941

References GetGame(), GetQuantityMax(), m_FireConsumables, m_TotalEnergy, and SetQuantity().

Referenced by AddToFireConsumables(), CAContinuousEmpty::Cancel(), CAContinuousEmptyMagazine::Cancel(), CAContinuousFill::Cancel(), CAContinuousFillBrakes::Cancel(), CAContinuousFillCoolant::Cancel(), CAContinuousFillFuel::Cancel(), CAContinuousFillOil::Cancel(), CAContinuousQuantity::Cancel(), CAContinuousQuantityLiquidTransfer::Cancel(), CAContinuousQuantityRepeat::Cancel(), CAContinuousTransferQuantity::Cancel(), CAContinuousDisinfectPlant::Execute(), CAContinuousEmpty::Execute(), CAContinuousEmptyMagazine::Execute(), CAContinuousFertilizeGardenSlot::Execute(), CAContinuousFill::Execute(), CAContinuousFillBrakes::Execute(), CAContinuousFillCoolant::Execute(), CAContinuousFillFuel::Execute(), CAContinuousFillOil::Execute(), CAContinuousFillPowerGenerator::Execute(), CAContinuousQuantity::Execute(), CAContinuousQuantityLiquidTransfer::Execute(), CAContinuousQuantityRepeat::Execute(), CAContinuousTransferQuantity::Execute(), CAContinuousWaterPlant::Execute(), CAContinuousWaterSlot::Execute(), CASingleUseQuantity::Execute(), OnAttachmentQuantityChanged(), RemoveFromFireConsumables(), and SpendFireConsumable().

◆ CalcAndSetTotalEnergy()

void CalcAndSetTotalEnergy ( )
protected

Definition at line 2447 of file FireplaceBase.c.

2448 {
2449 if (GetGame() && GetGame().IsServer())
2450 {
2451 m_TotalEnergy = 0;
2452
2454 {
2455 string quantityConfigPath = string.Format("CfgVehicles %1 varQuantityMax", fireConsumableType.GetItemType().ToString());
2456 string stackMaxConfigPath = string.Format("CfgSlots Slot_%1 stackMax", fireConsumableType.GetAttSlot());
2457 if (GetGame().ConfigIsExisting(quantityConfigPath))
2458 float quantityMax = GetGame().ConfigGetFloat(quantityConfigPath);
2459
2460 if (GetGame().ConfigIsExisting(stackMaxConfigPath))
2461 float stackMax = GetGame().ConfigGetFloat(stackMaxConfigPath);
2462
2463 //debug
2464 //Print( fireConsumableType.GetItemType().ToString() + " quantityMax = " + quantityMax.ToString() + " [" + (quantity_max*fire_consumable_type.GetEnergy()).ToString() + "] | stack_max = " + stack_max.ToString() + " [" + (stack_max*fire_consumable_type.GetEnergy()).ToString() + "]" );
2465
2466 if (stackMax > 0)
2467 m_TotalEnergy += stackMax * fireConsumableType.GetEnergy();
2468 else
2470 }
2471
2472 //debug
2473 //Print( "Total energy = " + m_TotalEnergy.ToString() );
2474 }
2475 }
float quantityMax
static ref map< typename, ref FireConsumableType > m_FireConsumableTypes

References GetGame(), m_FireConsumableTypes, m_TotalEnergy, and quantityMax.

Referenced by FireplaceBase().

◆ CanBuildOven()

bool CanBuildOven ( )
protected

Definition at line 2365 of file FireplaceBase.c.

2366 {
2367 return !IsOven() && !IsBurning() && (GetAttachedStonesCount() >= MIN_STONES_TO_BUILD_OVEN) && !FindAttachmentBySlotName("CookingTripod") && !HasStoneCircle() && IsSpaceForOven();
2368 }
bool IsSpaceForOven()
const int MIN_STONES_TO_BUILD_OVEN
minimum amount of stones for circle
bool HasStoneCircle()
int GetAttachedStonesCount()
bool IsOven()

References GetAttachedStonesCount(), HasStoneCircle(), IsBurning(), IsOven(), IsSpaceForOven(), and MIN_STONES_TO_BUILD_OVEN.

◆ CanBuildStoneCircle()

bool CanBuildStoneCircle ( )
protected

Definition at line 2377 of file FireplaceBase.c.

2378 {
2380 }
bool IsSpaceForCircle()
const int MIN_STONES_TO_BUILD_CIRCLE

References GetAttachedStonesCount(), HasStoneCircle(), IsBurning(), IsOven(), IsSpaceForCircle(), and MIN_STONES_TO_BUILD_CIRCLE.

◆ CanCookOnStick()

bool CanCookOnStick ( )
protected

Definition at line 2398 of file FireplaceBase.c.

2399 {
2401 }
const float PARAM_COOKING_TEMP_THRESHOLD
cooking

References GetTemperature(), and PARAM_COOKING_TEMP_THRESHOLD.

◆ CanDismantleOven()

bool CanDismantleOven ( )
protected

Definition at line 2388 of file FireplaceBase.c.

2389 {
2391 }
const int MAX_TEMPERATURE_TO_DISMANTLE_OVEN
minimum amount of stones for oven
bool SmokingSlotsInUse()
bool DirectCookingSlotsInUse()

References DirectCookingSlotsInUse(), GetTemperature(), IsBurning(), IsOven(), MAX_TEMPERATURE_TO_DISMANTLE_OVEN, and SmokingSlotsInUse().

◆ CanDismantleStoneCircle()

bool CanDismantleStoneCircle ( )
protected

Definition at line 2393 of file FireplaceBase.c.

2394 {
2395 return (HasStoneCircle() && !IsOven() && !IsBurning());
2396 }

References HasStoneCircle(), IsBurning(), and IsOven().

◆ CanExtinguishFire()

bool CanExtinguishFire ( )
protected

Definition at line 2404 of file FireplaceBase.c.

2405 {
2406 return IsBurning();
2407 }

References IsBurning().

◆ CanHaveTemperature()

override bool CanHaveTemperature ( )
protected

Definition at line 524 of file FireplaceBase.c.

525 {
526 return true;
527 }

◆ CanHaveWetness()

override bool CanHaveWetness ( )
protected

Definition at line 519 of file FireplaceBase.c.

520 {
521 return true;
522 }

◆ CanReleaseAttachment()

override bool CanReleaseAttachment ( EntityAI attachment)
protected

Definition at line 2510 of file FireplaceBase.c.

2511 {
2512 if (!super.CanReleaseAttachment(attachment))
2513 return false;
2514
2516 if (IsKindling(item) || IsFuel(item))
2517 return !IsBurning();
2518
2519 return true;
2520 }

References IsBurning(), IsFuel(), and IsKindling().

◆ CanShowSmoke()

bool CanShowSmoke ( )
protected

Definition at line 959 of file FireplaceBase.c.

960 {
961 return true;
962 }

◆ CanSwapEntities()

override bool CanSwapEntities ( EntityAI otherItem,
InventoryLocation otherDestination,
InventoryLocation destination )
protected

Definition at line 2357 of file FireplaceBase.c.

2358 {
2359 if (!otherDestination || otherDestination.GetParent() == this)
2360 return false;
2361 return true;
2362 }

◆ ClearCookingEquipment() [1/2]

void ClearCookingEquipment ( )
protected

DEPRECATED.

Definition at line 549 of file FireplaceBase.c.

550 {
552 }
void SetCookingEquipment(ItemBase equipment)

References FireplaceBase::SetCookingEquipment().

Referenced by FireplaceBase::EEItemDetached(), and ItemBase::EEItemDetached().

◆ ClearCookingEquipment() [2/2]

void ClearCookingEquipment ( ItemBase pItem)
protected

Definition at line 540 of file FireplaceBase.c.

541 {
543 m_CookingProcess.TerminateCookingSounds(pItem);
544
546 }
ref Cooking m_CookingProcess
determines how fast will the fuel item burn before spending (lower is better)

References m_CookingProcess, and FireplaceBase::SetCookingEquipment().

◆ CookOnDirectSlot()

void CookOnDirectSlot ( ItemBase slot_item,
float temp_equip,
float temp_ext )
protected

Definition at line 1994 of file FireplaceBase.c.

1995 {
1996 if (m_CookingProcess == null)
1997 m_CookingProcess = new Cooking();
1998
1999 m_CookingProcess.CookWithEquipment(slot_item);
2000
2001 switch (slot_item.Type())
2002 {
2009 else
2011 slot_item.SetTemperature(cookEquipTemp);
2012 break;
2013 }
2014 }
const float PARAM_SMALL_FIRE_TEMPERATURE
const float PARAM_COOKING_EQUIP_MAX_TEMP
temperature threshold for starting coooking process (degree Celsius)
const float PARAM_COOKING_EQUIP_TEMP_INCREASE
maximum temperature of attached cooking equipment (degree Celsius)

References ATTACHMENT_CAULDRON, ATTACHMENT_COOKING_POT, ATTACHMENT_FRYING_PAN, Math::Clamp(), m_CookingProcess, PARAM_COOKING_EQUIP_MAX_TEMP, PARAM_COOKING_EQUIP_TEMP_INCREASE, PARAM_ITEM_HEAT_MIN_TEMP, and PARAM_SMALL_FIRE_TEMPERATURE.

Referenced by Cooling(), and Heating().

◆ CookWithEquipment()

void CookWithEquipment ( )
protected

Definition at line 1978 of file FireplaceBase.c.

1979 {
1980 if (m_CookingProcess == null)
1981 m_CookingProcess = new Cooking();
1982
1983 m_CookingProcess.CookWithEquipment(m_CookingEquipment);
1984 }
ItemBase m_CookingEquipment

References m_CookingEquipment, and m_CookingProcess.

Referenced by Cooling(), Heating(), and ItemBase::OnWork().

◆ Cooling()

void Cooling ( )
protected

Definition at line 1844 of file FireplaceBase.c.

1845 {
1846 float wetness = GetWet();
1847 float temperature = GetTemperature();
1848 float temperature_modifier = 0;
1849
1850 if (!IsBurning() && temperature >= 10)
1851 {
1852 //check wetness
1853 //set wetness if raining and alter temperature modifier (which will lower temperature increase because of rain)
1854 float rain = GetGame().GetWeather().GetRain().GetActual();
1855 if (IsRainingAbove() && !IsRoofAbove())
1856 {
1857 //set wet to fireplace
1859
1860 //set temperature modifier
1862 }
1863 else //subtract wetness
1865
1866 //calculate already obtained wetness (e.g. extinguished by water)
1868
1869 // temperature via UniversalTemperatureSource
1870 m_UTSLFireplace.SetFuelCount(GetFuelCount());
1872 m_UTSLFireplace.SetCurrentTemperature(temperature);
1874
1875 //damage cargo items
1877
1878 //cook with equipment if temperature of equipment is still high
1880 {
1881 float cook_equip_temp = m_CookingEquipment.GetTemperature();
1882
1884 {
1885 //cook
1887 }
1888 }
1889
1890 float cook_item_temp;
1891 int i;
1892
1893 // manage cooking on direct cooking slots
1895 {
1896 for (i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++)
1897 {
1899 {
1900 cook_item_temp = m_DirectCookingSlots[i].GetTemperature();
1903 }
1904 }
1905 }
1906
1907 // manage smoking slots
1908 if (SmokingSlotsInUse())
1909 {
1910 for (i = 0; i < SMOKING_SLOT_COUNT; i++)
1911 {
1912 if (m_SmokingSlots[i])
1914 }
1915 }
1916
1917 //Debug
1918 //PlayerBase player = ( PlayerBase ) GetGame().GetPlayer();
1919 //if (player != NULL) {player.MessageAction ( temperature.ToString() );}
1920 }
1921 else
1922 {
1923 //stop cooling
1924 if (Math.AbsFloat(temperature) < 10)
1925 {
1926 StopCooling();
1927 m_UTSource.SetActive(false);
1928 }
1929 }
1930 }
ref UniversalTemperatureSourceSettings m_UTSSettings
const int DIRECT_COOKING_SLOT_COUNT
direct cooking slots
const float PARAM_TEMPERATURE_DECREASE
how much will temperature increase when fireplace is burning (degree Celsius per second)
void StopCooling()
void BurnItemsInFireplace()
bool IsRainingAbove()
void CookOnDirectSlot(ItemBase slot_item, float temp_equip, float temp_ext)
void CookWithEquipment()
const float PARAM_WET_COOLING_DECREASE_COEF
value for calculating wetness loss during heating process
const int SMOKING_SLOT_COUNT
void SmokeOnSmokingSlot(ItemBase slot_item, float temp_equip, float temp_ext)
bool IsRoofAbove()
ItemBase m_DirectCookingSlots[DIRECT_COOKING_SLOT_COUNT]
ref UniversalTemperatureSource m_UTSource
const float PARAM_WET_INCREASE_COEF
maximum wetness value when the fireplace is able to burn
ItemBase m_SmokingSlots[SMOKING_SLOT_COUNT]
void AddWetnessToFireplace(float amount)
static proto float AbsFloat(float f)
Returns absolute value.

References Math::AbsFloat(), AddWetnessToFireplace(), BurnItemsInFireplace(), CookOnDirectSlot(), CookWithEquipment(), DIRECT_COOKING_SLOT_COUNT, DirectCookingSlotsInUse(), GetFuelCount(), GetGame(), GetTemperature(), GetWet(), IsBurning(), IsRainingAbove(), IsRoofAbove(), m_CookingEquipment, m_DirectCookingSlots, m_SmokingSlots, m_UTSLFireplace, m_UTSource, m_UTSSettings, PARAM_COOKING_TEMP_THRESHOLD, PARAM_TEMPERATURE_DECREASE, PARAM_WET_COOLING_DECREASE_COEF, PARAM_WET_INCREASE_COEF, SmokeOnSmokingSlot(), SMOKING_SLOT_COUNT, SmokingSlotsInUse(), StopCooling(), and TIMER_COOLING_UPDATE_INTERVAL.

◆ CreateAreaDamage()

void CreateAreaDamage ( )
protected

Definition at line 2185 of file FireplaceBase.c.

2186 {
2187 //destroy area damage if some already exists
2189
2190 //create new area damage
2192 m_AreaDamage.SetDamageComponentType(AreaDamageComponentTypes.HITZONE);
2193 m_AreaDamage.SetExtents("-0.30 0 -0.30", "0.30 0.75 0.30");
2194 m_AreaDamage.SetLoopInterval(0.5);
2195 m_AreaDamage.SetDeferDuration(0.5);
2196 m_AreaDamage.SetHitZones({ "Head", "Torso", "LeftHand", "LeftLeg", "LeftFoot", "RightHand", "RightLeg", "RightFoot" });
2197 m_AreaDamage.SetAmmoName("FireDamage");
2198 m_AreaDamage.Spawn();
2199 }
ref AreaDamageManager m_AreaDamage
void DestroyAreaDamage()
Deferred version of AreaDamageLooped.

References DestroyAreaDamage(), AreaDamageComponentTypes::HITZONE, and m_AreaDamage.

Referenced by ItemBase::UpdateAttachmentVisuals().

◆ DestroyAreaDamage()

◆ DestroyFireplace()

void DestroyFireplace ( )
protected

[DEPRECATED]

Definition at line 575 of file FireplaceBase.c.

576 {
577 DeleteSafe();
578 }

◆ DirectCookingSlotsInUse()

bool DirectCookingSlotsInUse ( )
protected

Definition at line 554 of file FireplaceBase.c.

555 {
556 for (int i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++)
557 {
559 return true;
560 }
561 return false;
562 }

References DIRECT_COOKING_SLOT_COUNT, and m_DirectCookingSlots.

Referenced by CanDismantleOven(), FireplaceBase::CanPutInCargo(), FireplaceBase::CanPutIntoHands(), Cooling(), Heating(), and StopCooling().

◆ DisassembleOnLastDetach()

override bool DisassembleOnLastDetach ( )
protected

Definition at line 2555 of file FireplaceBase.c.

2556 {
2557 return true;
2558 }

◆ EECargoOut()

override void EECargoOut ( EntityAI item)
protected

Definition at line 585 of file FireplaceBase.c.

586 {
587 super.EECargoOut(item);
588
589 CheckForDestroy();
590 }

◆ EEDelete()

override void EEDelete ( EntityAI parent)
protected

Definition at line 368 of file FireplaceBase.c.

369 {
370 super.EEDelete(parent);
371
373
374 // cleanup particles (for cases of leaving burning fplace and going back outside of network bubble)
375#ifndef SERVER
377#endif
378 }
void SetFireState(FireplaceFireState state)
void StopAllParticlesAndSounds()
FireplaceFireState

References SetFireState(), and StopAllParticlesAndSounds().

◆ EEInit()

override void EEInit ( )
protected

Definition at line 285 of file FireplaceBase.c.

286 {
287 super.EEInit();
288
289 //refresh visual on init
291
292 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
293 {
295 m_UTSSettings.m_AffectStat = true;
296 m_UTSSettings.m_ManualUpdate = true;
297 m_UTSSettings.m_TemperatureMin = 0;
301 m_UTSSettings.m_RangeMax = PARAM_HEAT_RADIUS;
302
304 m_UTSLFireplace.SetSmallFireplaceTemperatureMax(PARAM_SMALL_FIRE_TEMPERATURE);
305 m_UTSLFireplace.SetNormalFireplaceTemperatureMax(PARAM_NORMAL_FIRE_TEMPERATURE);
306
308 }
309 }
void RefreshFireplaceVisuals()
const float PARAM_MAX_TRANSFERED_TEMPERATURE
DEPRECATED value for calculation of heat transfered from fireplace through air to player (environment...
const float PARAM_HEAT_RADIUS
radius in which objects are fully heated by fire
const float PARAM_FULL_HEAT_RADIUS
maximum value of temperature of items in fireplace when heating (degree Celsius)
original Timer deletes m_params which is unwanted

References GetGame(), m_UTSLFireplace, m_UTSource, m_UTSSettings, PARAM_FULL_HEAT_RADIUS, PARAM_HEAT_RADIUS, PARAM_MAX_TRANSFERED_TEMPERATURE, PARAM_NORMAL_FIRE_TEMPERATURE, PARAM_SMALL_FIRE_TEMPERATURE, and RefreshFireplaceVisuals().

◆ EEItemAttached()

override void EEItemAttached ( EntityAI item,
string slot_name )
protected

Definition at line 311 of file FireplaceBase.c.

312 {
313 super.EEItemAttached(item, slot_name);
314
315 //cookware
316 switch (item.Type())
317 {
322 break;
323 }
324 }

References ATTACHMENT_CAULDRON, ATTACHMENT_COOKING_POT, ATTACHMENT_FRYING_PAN, and FireplaceBase::SetCookingEquipment().

◆ FireplaceBase()

void FireplaceBase ( )
protected

Definition at line 232 of file FireplaceBase.c.

233 {
234 //STATIC: define kindling types
236 {
239 m_FireConsumableTypes.Insert(ATTACHMENT_BANDAGE, new FireConsumableType(ATTACHMENT_BANDAGE, 14, true, "MedicalBandage"));
247
248 //define fuel types
249 m_FireConsumableTypes.Insert(ATTACHMENT_STICKS, new FireConsumableType(ATTACHMENT_STICKS, 40, false, "WoodenStick"));
251 }
252
253 //calculate total energy
255
256 //define fuel / kindling items (fire consumables)
258
259 //default burning parameters
262
263 //synchronized variables
264 RegisterNetSyncVariableBool("m_IsBurning");
265 RegisterNetSyncVariableBool("m_HasAshes");
266 RegisterNetSyncVariableBool("m_IsOven");
267 RegisterNetSyncVariableBool("m_HasStoneCircle");
268 RegisterNetSyncVariableBool("m_RoofAbove");
269 RegisterNetSyncVariableInt("m_FireState", FireplaceFireState.NO_FIRE, FireplaceFireState.COUNT);
270 RegisterNetSyncVariableBool("m_IsSoundSynchRemote");
271 RegisterNetSyncVariableBool("m_IsPlaceSound");
272 RegisterNetSyncVariableBool("m_NoIgnite");
273
275 }
ATTACHMENT_FIREWOOD
ATTACHMENT_BARK_OAK
ATTACHMENT_STICKS
const float TEMPERATURE_LOSS_MP_DEFAULT
min height of ceiling for fire to be ignited
ATTACHMENT_PUNCHEDCARD
void SetFuelBurnRateMP(float value)
ATTACHMENT_EYEMASK_COLORBASE
ATTACHMENT_BANDAGE
ATTACHMENT_BOOK
ATTACHMENT_GIFTWRAP
ATTACHMENT_RAGS
ATTACHMENT_PAPER
const float FUEL_BURN_RATE_DEFAULT
ATTACHMENT_BARK_BIRCH
void SetTemperatureLossMP(float value)
vector m_HalfExtents
void CalcAndSetTotalEnergy()
static const vector Zero
Definition EnConvert.c:110

References ATTACHMENT_BANDAGE, ATTACHMENT_BARK_BIRCH, ATTACHMENT_BARK_OAK, ATTACHMENT_BOOK, ATTACHMENT_EYEMASK_COLORBASE, ATTACHMENT_FIREWOOD, ATTACHMENT_GIFTWRAP, ATTACHMENT_PAPER, ATTACHMENT_PUNCHEDCARD, ATTACHMENT_RAGS, ATTACHMENT_STICKS, CalcAndSetTotalEnergy(), FUEL_BURN_RATE_DEFAULT, m_FireConsumables, m_FireConsumableTypes, m_HalfExtents, SetFuelBurnRateMP(), SetTemperatureLossMP(), TEMPERATURE_LOSS_MP_DEFAULT, and vector::Zero.

◆ GetAirResistanceForSmokeParticles()

float GetAirResistanceForSmokeParticles ( float actual_height)
protected

Definition at line 1186 of file FireplaceBase.c.

1187 {
1188 float air_res;
1190
1191 air_res = (6 - actual_height) * 0.33;
1192 air_res = Math.Clamp(air_res, 0, 2);
1193
1194 return air_res;
1195 }

References Math::Clamp().

Referenced by ParticleNormalSmokeStart(), and ParticleSmallSmokeStart().

◆ GetAttachedStonesCount()

int GetAttachedStonesCount ( )
protected

Definition at line 1531 of file FireplaceBase.c.

1532 {
1533 if (HasStones())
1534 return GetAttachmentByType(ATTACHMENT_STONES).GetQuantity();
1535
1536 return 0;
1537 }
bool HasStones()
ATTACHMENT_STONES

References ATTACHMENT_STONES, and HasStones().

Referenced by CanBuildOven(), and CanBuildStoneCircle().

◆ GetCeilingHeight()

bool GetCeilingHeight ( out float actual_height)
protected

Definition at line 1170 of file FireplaceBase.c.

1171 {
1172 vector from = this.GetPosition();
1173 vector to = this.GetPosition();
1174 from[1] = from[1] + 1.0;
1175 to[1] = to[1] + MIN_CEILING_HEIGHT;
1178 int contactComponent;
1179
1182
1183 return hit;
1184 }
const float MIN_CEILING_HEIGHT
maximum temperature for dismantling oven
class JsonUndergroundAreaTriggerData GetPosition
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.

References vector::Distance(), GetPosition, MIN_CEILING_HEIGHT, and DayZPhysics::RaycastRV().

Referenced by ParticleNormalSmokeStart(), and ParticleSmallSmokeStart().

◆ GetCookingEquipment()

◆ GetCookingProcess()

Cooking GetCookingProcess ( )
protected

Definition at line 1986 of file FireplaceBase.c.

1987 {
1988 if (m_CookingProcess == null)
1989 m_CookingProcess = new Cooking();
1990
1991 return m_CookingProcess;
1992 }

References m_CookingProcess.

◆ GetDebugActions()

override void GetDebugActions ( out TSelectableActionInfoArrayEx outputList)
protected

Definition at line 2617 of file FireplaceBase.c.

2618 {
2619 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.ACTIVATE_ENTITY, "Ignite", FadeColors.LIGHT_GREY));
2620 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.DEACTIVATE_ENTITY, "Extinguish", FadeColors.LIGHT_GREY));
2621 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "___________________________", FadeColors.LIGHT_GREY));
2622
2623 super.GetDebugActions(outputList);
2624 }
Param4< int, int, string, int > TSelectableActionInfoWithColor
Definition EntityAI.c:97
EActions
Definition EActions.c:2
const int SAT_DEBUG_ACTION
Definition constants.c:424

References SAT_DEBUG_ACTION.

◆ GetFireConsumableByItem()

FireConsumable GetFireConsumableByItem ( ItemBase item)
protected

Definition at line 1297 of file FireplaceBase.c.

1298 {
1299 return m_FireConsumables.Get(item);
1300 }

References m_FireConsumables.

Referenced by FireplaceBase::EEItemDetached().

◆ GetFireConsumableTypeEnergy()

float GetFireConsumableTypeEnergy ( ItemBase item)
protected

support for inherited classes; second pass of lookup inside FireConsumableType

Definition at line 1265 of file FireplaceBase.c.

1266 {
1268 if (!fireConsumableType)
1269 {
1271 int count = m_FireConsumableTypes.Count();
1272 for (int i = 0; i < count; ++i)
1273 {
1274 if (item.IsInherited(m_FireConsumableTypes.GetKey(i)))
1276 }
1277 }
1278
1280 return fireConsumableType.GetEnergy();
1281
1282 return 0;
1283 }

References m_FireConsumableTypes.

Referenced by AddToFireConsumables().

◆ GetFireEffectPosition()

vector GetFireEffectPosition ( )
protected

Definition at line 1199 of file FireplaceBase.c.

1200 {
1201 return Vector(0, 0.05, 0);
1202 }
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

References Vector().

Referenced by ParticleFireEndStart(), ParticleFireStartStart(), ParticleFireWindyNoIgniteStart(), ParticleNormalFireStart(), ParticleSmallFireStart(), ParticleSteamEndStart(), ParticleSteamExtinguishingStart(), and ParticleWetNoIgniteStart().

◆ GetFireState()

int GetFireState ( )
protected

Definition at line 1586 of file FireplaceBase.c.

1587 {
1588 return m_FireState;
1589 }
FireplaceFireState m_FireState

References m_FireState.

Referenced by Heating(), RefreshFireParticlesAndSounds(), and RefreshFireState().

◆ GetFuelBurnRateMP()

float GetFuelBurnRateMP ( )
protected

Definition at line 1575 of file FireplaceBase.c.

1576 {
1577 return m_FuelBurnRateMP;
1578 }
float m_FuelBurnRateMP
determines how fast will the fireplace loose its temperature when cooling (lower is better)

References m_FuelBurnRateMP.

Referenced by Heating().

◆ GetFuelCount()

int GetFuelCount ( )
protected

Returns count of all fuel type items (define in 'm_FuelTypes') attached to fireplace.

Definition at line 1406 of file FireplaceBase.c.

1407 {
1408 int attachmentsCount = GetInventory().AttachmentCount();
1409 int fuelCount = 0;
1410
1411 for (int i = 0; i < attachmentsCount; ++i)
1412 {
1413 ItemBase item = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(i));
1414 if (IsFuel(item))
1415 fuelCount++;
1416 }
1417
1418 return fuelCount;
1419 }

References IsFuel().

Referenced by AddWetnessToFireplace(), Cooling(), HasLastFuelKindlingAttached(), and Heating().

◆ GetIgniteFailure()

bool GetIgniteFailure ( )
protected

Definition at line 2235 of file FireplaceBase.c.

2236 {
2237 return m_NoIgnite;
2238 }
bool m_NoIgnite

References m_NoIgnite.

Referenced by FireplaceBase::IsThisIgnitionSuccessful().

◆ GetItemToConsume()

FireConsumable GetItemToConsume ( )
protected

Definition at line 1332 of file FireplaceBase.c.

1333 {
1334 return m_ItemToConsume;
1335 }
ref FireConsumable m_ItemToConsume

References m_ItemToConsume.

Referenced by SpendFireConsumable().

◆ GetKindlingCount()

int GetKindlingCount ( )
protected

Returns count of all kindling type items (define in 'm_KindlingTypes') attached to fireplace.

Definition at line 1389 of file FireplaceBase.c.

1390 {
1391 int attachmentsCount = GetInventory().AttachmentCount();
1392 int kindlingCount = 0;
1393
1394 for (int i = 0; i < attachmentsCount; ++i)
1395 {
1396 ItemBase item = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(i));
1397
1398 if (IsKindling(item))
1399 kindlingCount++;
1400 }
1401
1402 return kindlingCount;
1403 }

References IsKindling().

Referenced by HasAnyKindling(), HasLastFuelKindlingAttached(), and RefreshFireplaceVisuals().

◆ GetLightEntity()

FireplaceLight GetLightEntity ( )
protected

Definition at line 2409 of file FireplaceBase.c.

2410 {
2411 return m_Light;
2412 }
FireplaceLight m_Light

References m_Light.

Referenced by RefreshFireplaceVisuals(), and ~FireplaceBase().

◆ GetPlaceSoundset()

override string GetPlaceSoundset ( )
protected

Definition at line 2438 of file FireplaceBase.c.

2439 {
2440 return "placeFireplace_SoundSet";
2441 }

◆ GetSmokeEffectPosition()

vector GetSmokeEffectPosition ( )
protected

Definition at line 1204 of file FireplaceBase.c.

1205 {
1206 return Vector(0, 0.05, 0);
1207 }

References Vector().

◆ GetTemperatureLossMP()

float GetTemperatureLossMP ( )
protected

Definition at line 1564 of file FireplaceBase.c.

1565 {
1566 return m_TemperatureLossMP;
1567 }
float m_TemperatureLossMP

References m_TemperatureLossMP.

◆ HasAnyKindling()

bool HasAnyKindling ( )
protected

Definition at line 2220 of file FireplaceBase.c.

2221 {
2222 return GetKindlingCount() > 0;
2223 }
int GetKindlingCount()
Returns count of all kindling type items (define in 'm_KindlingTypes') attached to fireplace.

References GetKindlingCount().

Referenced by FireplaceBase::CanBeIgnitedBy(), and FireplaceBase::IsThisIgnitionSuccessful().

◆ HasAshes()

◆ HasCookingStand()

bool HasCookingStand ( )
protected

Definition at line 2331 of file FireplaceBase.c.

2332 {
2333 return GetInventory().FindAttachment(InventorySlots.GetSlotIdFromString("CookingTripod")) != null;
2334 }
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id

References InventorySlots::GetSlotIdFromString().

Referenced by FireplaceBase::CanPutInCargo(), FireplaceBase::CanPutIntoHands(), and Heating().

◆ HasLastAttachment()

bool HasLastAttachment ( )
protected

Definition at line 1472 of file FireplaceBase.c.

1473 {
1474 return GetInventory().AttachmentCount() == 1;
1475 }

◆ HasLastFuelKindlingAttached()

bool HasLastFuelKindlingAttached ( )
protected

Definition at line 1478 of file FireplaceBase.c.

1479 {
1480 return (GetFuelCount() + GetKindlingCount()) == 1;
1481 }

References GetFuelCount(), and GetKindlingCount().

◆ HasStoneCircle()

◆ HasStones()

bool HasStones ( )
protected

Definition at line 1524 of file FireplaceBase.c.

1525 {
1526 EntityAI attached_item = GetAttachmentByType(ATTACHMENT_STONES);
1527
1528 return attached_item && attached_item.GetQuantity() > 0;
1529 }

References ATTACHMENT_STONES.

Referenced by FireplaceBase::CanPutInCargo(), FireplaceBase::CanPutIntoHands(), GetAttachedStonesCount(), and RefreshFireplaceVisuals().

◆ Heating()

void Heating ( )
protected

Definition at line 1681 of file FireplaceBase.c.

1682 {
1683 float temperature = GetTemperature();
1684 float temperature_modifier = 0;
1685
1686 //check burning conditions
1688 {
1689 StopFire(FireplaceFireState.EXTINGUISHED_FIRE);
1690 return;
1691 }
1692 else
1693 {
1694 if (m_FireConsumables.Count() == 0)
1695 {
1696 StopFire();
1697 return;
1698 }
1699 }
1700
1701 //spend actual fire consumable
1703 SpendFireConsumable(amount);
1704
1705 //set wetness if raining and alter temperature modifier (which will lower temperature increase because of rain)
1706 float rain = GetGame().GetWeather().GetRain().GetActual();
1708 {
1709 //set wet to fireplace
1711
1712 //set temperature modifier
1714 }
1715 //subtract wetness when heating and not raining above
1716 else
1718
1719 // temperature via UniversalTemperatureSource
1720 m_UTSLFireplace.SetFuelCount(GetFuelCount());
1722 m_UTSLFireplace.SetCurrentTemperature(temperature);
1724
1725 //check fire state
1726 if (GetFireState() != FireplaceFireState.EXTINGUISHING_FIRE)
1728
1729 //damage cargo items
1731
1732 //manage cooking equipment (this applies only for case of cooking pot on a tripod)
1734 {
1735 float cook_equip_temp = m_CookingEquipment.GetTemperature();
1736
1738 {
1739 //start cooking
1741 }
1742
1743 //DEBUG
1744 /*
1745 PlayerBase player = ( PlayerBase ) GetGame().GetPlayer();
1746 string s_message = "cooking equipment temp = " + ftoa(cook_equip_temp) + " | PARAM_COOKING_TEMP_THRESHOLD = " + ftoa(PARAM_COOKING_TEMP_THRESHOLD);
1747 if (player != NULL) {player.MessageAction (s_message);}
1748 Print ( s_message );
1749 */
1750 //set temperature to cooking equipment
1754 else
1756
1757 m_CookingEquipment.SetTemperature(cook_equip_temp);
1758 }
1759
1760 float cook_item_temp;
1761 int i;
1762 // manage cooking on direct cooking slots
1764 {
1765 for (i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++)
1766 {
1768 {
1769 cook_item_temp = m_DirectCookingSlots[i].GetTemperature();
1772 }
1773 }
1774 }
1775
1776 // manage smoking slots
1777 if (SmokingSlotsInUse())
1778 {
1779 for (i = 0; i < SMOKING_SLOT_COUNT; i++)
1780 {
1781 if (m_SmokingSlots[i])
1783 }
1784 }
1785
1786 //Make noise for AI, only at night
1787 if (GetGame().GetWorld().IsNight() && m_CanNoise)
1788 {
1789 NoiseSystem noise = GetGame().GetNoiseSystem();
1790 if (noise && m_NoisePar)
1791 noise.AddNoisePos(this, GetPosition(), m_NoisePar);
1792 m_CanNoise = false;
1793 }
1794 else
1795 m_CanNoise = true;
1796
1797 Synchronize();
1798 }
float GetFuelBurnRateMP()
const float PARAM_TEMPERATURE_INCREASE
minimum fireplace temperature under which the fireplace is inactive (degree Celsius)
const float PARAM_FIRE_CONSUM_RATE_AMOUNT
value for calculating wetness loss during cooling process
bool m_CanNoise
bool HasCookingStand()
void StopFire(FireplaceFireState fire_state=FireplaceFireState.END_FIRE)
ref NoiseParams m_NoisePar
void SpendFireConsumable(float amount)
void RefreshFireState()
int GetFireState()
const float PARAM_BURN_WET_THRESHOLD
maximum rain value when the fireplace can be ignited

References AddWetnessToFireplace(), BurnItemsInFireplace(), Math::Clamp(), CookOnDirectSlot(), CookWithEquipment(), DIRECT_COOKING_SLOT_COUNT, DirectCookingSlotsInUse(), GetFireState(), GetFuelBurnRateMP(), GetFuelCount(), GetGame(), GetPosition, GetTemperature(), GetWet(), HasCookingStand(), IsRoofAbove(), m_CanNoise, m_CookingEquipment, m_DirectCookingSlots, m_FireConsumables, m_NoisePar, m_SmokingSlots, m_UTSLFireplace, m_UTSource, m_UTSSettings, PARAM_BURN_WET_THRESHOLD, PARAM_COOKING_EQUIP_MAX_TEMP, PARAM_COOKING_EQUIP_TEMP_INCREASE, PARAM_COOKING_TEMP_THRESHOLD, PARAM_FIRE_CONSUM_RATE_AMOUNT, PARAM_ITEM_HEAT_MIN_TEMP, PARAM_SMALL_FIRE_TEMPERATURE, PARAM_TEMPERATURE_INCREASE, PARAM_WET_HEATING_DECREASE_COEF, PARAM_WET_INCREASE_COEF, RefreshFireState(), SmokeOnSmokingSlot(), SMOKING_SLOT_COUNT, SmokingSlotsInUse(), SpendFireConsumable(), StopFire(), Synchronize(), and TIMER_HEATING_UPDATE_INTERVAL.

◆ IsBarrelWithHoles()

bool IsBarrelWithHoles ( )
protected

Definition at line 504 of file FireplaceBase.c.

505 {
506 return false;
507 }

◆ IsBaseFireplace()

bool IsBaseFireplace ( )
protected

Definition at line 499 of file FireplaceBase.c.

500 {
501 return false;
502 }

◆ IsBurning()

◆ IsCargoEmpty()

bool IsCargoEmpty ( )
protected

Definition at line 2326 of file FireplaceBase.c.

2327 {
2328 return (GetInventory().GetCargo().GetItemCount() == 0);
2329 }

Referenced by FireplaceBase::CanPutInCargo(), and FireplaceBase::CanPutIntoHands().

◆ IsCeilingHighEnoughForSmoke()

bool IsCeilingHighEnoughForSmoke ( )
protected

Definition at line 2269 of file FireplaceBase.c.

2270 {
2271 return !MiscGameplayFunctions.IsUnderRoof(this, FireplaceBase.MIN_CEILING_HEIGHT);
2272 }

Referenced by FireplaceBase::IsThisIgnitionSuccessful().

◆ IsEmpty()

override bool IsEmpty ( )
protected

Definition at line 2320 of file FireplaceBase.c.

2321 {
2322 return (GetInventory().GetCargo().GetItemCount() == 0 && GetInventory().AttachmentCount() == 0);
2323 }

Referenced by RecipeBase::CanDo(), CivilianBelt::CanPutInCargo(), HipPack_ColorBase::CanPutInCargo(), Belt_Base::CanPutInCargo(), MilitaryBelt::CanPutInCargo(), RopeBelt::CanPutInCargo(), and IsPrepareToDelete().

◆ IsEntityOnInteriorSurface()

static bool IsEntityOnInteriorSurface ( notnull EntityAI entity_ai)
staticprotected

Definition at line 2307 of file FireplaceBase.c.

2308 {
2309 string surfaceType;
2310 vector fireplacePosition = entity_ai.GetPosition();
2311 GetGame().SurfaceGetType3D(fireplacePosition[0], fireplacePosition[1] + 1.0, fireplacePosition[2], surfaceType);
2312 return (GetGame().ConfigGetInt("CfgSurfaces " + surfaceType + " interior") == 1);
2313 }

References GetGame().

Referenced by FireplaceBase::CanIgniteEntityAsFireplace().

◆ IsEntityOnWaterSurface()

static bool IsEntityOnWaterSurface ( notnull EntityAI entity_ai)
staticprotected

Definition at line 2286 of file FireplaceBase.c.

2287 {
2288 vector fireplacePosition = entity_ai.GetPosition();
2289 string surfaceType;
2290 g_Game.SurfaceGetType3D(fireplacePosition[0], fireplacePosition[1] + g_Game.SurfaceGetSeaLevel(), fireplacePosition[2], surfaceType);
2291 if (!surfaceType)
2292 {
2293 float waterLevelDiff = fireplacePosition[1] - g_Game.SurfaceGetSeaLevel();
2294 return waterLevelDiff < 0.5;
2295 }
2296 else if (surfaceType.Contains("water"))
2297 return true;
2298
2299 return false;
2300 }
DayZGame g_Game
Definition DayZGame.c:3528

References g_Game.

◆ IsEntityWet()

static bool IsEntityWet ( notnull EntityAI entity_ai)
staticprotected

Definition at line 2246 of file FireplaceBase.c.

2247 {
2248 return (entity_ai.GetWet() >= FireplaceBase.PARAM_MAX_WET_TO_IGNITE);
2249 }

◆ IsFacingFireplace()

bool IsFacingFireplace ( PlayerBase player)
protected

DEPRECATED.

Definition at line 2208 of file FireplaceBase.c.

2209 {
2210 ErrorEx("Deprecated method", ErrorExSeverity.INFO);
2211
2212 return false;
2213 }
ErrorExSeverity
Definition EnDebug.c:62
enum ShapeType ErrorEx

References ErrorEx.

◆ IsFireplace()

override bool IsFireplace ( )
protected

Definition at line 494 of file FireplaceBase.c.

495 {
496 return true;
497 }

Referenced by TripodBase::CanSwapEntities(), and InventoryItem::ProcessItemTemperature().

◆ IsFireplaceIndoor()

bool IsFireplaceIndoor ( )
protected

Definition at line 509 of file FireplaceBase.c.

510 {
511 return false;
512 }

◆ IsFuel()

bool IsFuel ( ItemBase item)
protected

Returns if item attached to fireplace is fuel.

support for inherited classes; second pass of lookup inside FireConsumableType

Definition at line 1440 of file FireplaceBase.c.

1441 {
1443 if (!fireConsumableType)
1444 {
1446 int count = m_FireConsumableTypes.Count();
1447 for (int i = 0; i < count; ++i)
1448 {
1449 if (item.IsInherited(m_FireConsumableTypes.GetKey(i)))
1451 }
1452 }
1453
1454 return fireConsumableType && !fireConsumableType.IsKindling();
1455 }

References m_FireConsumableTypes.

Referenced by AddDamageToItemByFireEx(), FireplaceBase::CanReceiveAttachment(), CanReleaseAttachment(), FireplaceBase::CanReleaseAttachment(), FireplaceBase::EEItemAttached(), FireplaceBase::EEItemDetached(), and GetFuelCount().

◆ IsInAnimPhase()

bool IsInAnimPhase ( string anim_phase)
protected

Definition at line 2337 of file FireplaceBase.c.

2338 {
2339 return GetAnimationPhase(anim_phase) == 0;
2340 }

Referenced by SetBurntFirewood().

◆ IsIndoorOven()

bool IsIndoorOven ( )
protected

Definition at line 514 of file FireplaceBase.c.

515 {
516 return false;
517 }

◆ IsItemAttachedQuantity()

bool IsItemAttachedQuantity ( typename item_type ,
float quantity )
protected

Definition at line 1464 of file FireplaceBase.c.

1465 {
1466 ItemBase item = ItemBase.Cast(GetAttachmentByType(item_type));
1467
1468 return item.GetQuantity() >= quantity;
1469 }

◆ IsItemTypeAttached()

bool IsItemTypeAttached ( typename item_type )
protected

Definition at line 1458 of file FireplaceBase.c.

1459 {
1460 return GetAttachmentByType(item_type) != null;
1461 }

Referenced by RefreshFireplaceVisuals(), and FireplaceBase::RefreshPhysics().

◆ IsKindling()

bool IsKindling ( ItemBase item)
protected

Returns if item attached to fireplace is kindling.

support for inherited classes; second pass of lookup inside FireConsumableType

Definition at line 1422 of file FireplaceBase.c.

1423 {
1425 if (!fireConsumableType)
1426 {
1428 int count = m_FireConsumableTypes.Count();
1429 for (int i = 0; i < count; ++i)
1430 {
1431 if (item.IsInherited(m_FireConsumableTypes.GetKey(i)))
1433 }
1434 }
1435
1436 return fireConsumableType && fireConsumableType.IsKindling();
1437 }

References m_FireConsumableTypes.

Referenced by AddDamageToItemByFireEx(), FireplaceBase::CanReceiveAttachment(), CanReleaseAttachment(), FireplaceBase::CanReleaseAttachment(), FireplaceBase::EEItemAttached(), FireplaceBase::EEItemDetached(), and GetKindlingCount().

◆ IsOnInteriorSurface()

bool IsOnInteriorSurface ( )
protected

Definition at line 2314 of file FireplaceBase.c.

2315 {
2316 return FireplaceBase.IsEntityOnInteriorSurface(this);
2317 }

Referenced by FireplaceBase::IsThisIgnitionSuccessful().

◆ IsOnWaterSurface()

bool IsOnWaterSurface ( )
protected

Definition at line 2301 of file FireplaceBase.c.

2302 {
2303 return FireplaceBase.IsEntityOnWaterSurface(this);
2304 }

Referenced by FireplaceBase::IsThisIgnitionSuccessful().

◆ IsOpen()

override bool IsOpen ( )
protected

Definition at line 2263 of file FireplaceBase.c.

2264 {
2265 return true;
2266 }

◆ IsOven()

◆ IsPrepareToDelete()

override bool IsPrepareToDelete ( )
protected

Definition at line 580 of file FireplaceBase.c.

581 {
582 return IsEmpty() && !IsBurning() && !HasAshes();
583 }
bool HasAshes()
override bool IsEmpty()

References HasAshes(), IsBurning(), and IsEmpty().

Referenced by Entity::CheckForDestroy(), and Entity::TryDelete().

◆ IsRainingAbove()

bool IsRainingAbove ( )
protected

Definition at line 2280 of file FireplaceBase.c.

2281 {
2282 return FireplaceBase.IsRainingAboveEntity(this);
2283 }

Referenced by Cooling(), and FireplaceBase::IsThisIgnitionSuccessful().

◆ IsRainingAboveEntity()

static bool IsRainingAboveEntity ( notnull EntityAI entity_ai)
staticprotected

Definition at line 2275 of file FireplaceBase.c.

2276 {
2277 return (GetGame() && (GetGame().GetWeather().GetRain().GetActual() >= FireplaceBase.PARAM_IGNITE_RAIN_THRESHOLD));
2278 }

References GetGame().

◆ IsRoofAbove()

bool IsRoofAbove ( )
protected

Definition at line 2257 of file FireplaceBase.c.

2258 {
2259 return m_RoofAbove;
2260 }
bool m_RoofAbove

References m_RoofAbove.

Referenced by Cooling(), Heating(), ParticleNormalSmokeStart(), ParticleSmallSmokeStart(), and StartHeating().

◆ IsSpaceFor()

bool IsSpaceFor ( vector size)
protected

Definition at line 2342 of file FireplaceBase.c.

2343 {
2344 array<Object> objs = {};
2345 if (GetGame().IsBoxCollidingGeometry(GetWorldPosition() + Vector(0, size[1] * 0.5 + 0.1, 0), GetDirection().VectorToAngles(), size, ObjIntersect.View, ObjIntersect.Geom, {this}, objs))
2346 {
2347 foreach (Object obj : objs)
2348 {
2349 if (dBodyGetInteractionLayer(obj) == PhxInteractionLayers.ITEM_LARGE)
2350 return false;
2351 }
2352 }
2353 return true;
2354 }
PhxInteractionLayers
Definition DayZPhysics.c:2
proto native int dBodyGetInteractionLayer(notnull IEntity ent)

References dBodyGetInteractionLayer(), GetGame(), and Vector().

Referenced by IsSpaceForCircle(), and IsSpaceForOven().

◆ IsSpaceForCircle()

bool IsSpaceForCircle ( )
protected

Definition at line 2382 of file FireplaceBase.c.

2383 {
2384 return IsSpaceFor(Vector(0.9, 0.1, 0.9));
2385 }
bool IsSpaceFor(vector size)

References IsSpaceFor(), and Vector().

Referenced by CanBuildStoneCircle().

◆ IsSpaceForOven()

bool IsSpaceForOven ( )
protected

Definition at line 2370 of file FireplaceBase.c.

2371 {
2372 const float size = 0.6;
2373 return IsSpaceFor(Vector(size, size, size));
2374 }

References IsSpaceFor(), and Vector().

Referenced by CanBuildOven().

◆ IsWet()

bool IsWet ( )
protected

Definition at line 2251 of file FireplaceBase.c.

2252 {
2253 return FireplaceBase.IsEntityWet(this);
2254 }

Referenced by FireplaceBase::IsThisIgnitionSuccessful(), and RefreshFireplaceVisuals().

◆ IsWindy()

static bool IsWindy ( )
staticprotected

Definition at line 2226 of file FireplaceBase.c.

2227 {
2228 //check wind
2229 float wind_speed = GetGame().GetWeather().GetWindSpeed();
2230 float wind_speed_threshold = GetGame().GetWeather().GetWindMaximumSpeed() * FireplaceBase.IGNITE_WIND_THRESHOLD;
2231
2232 return (wind_speed >= wind_speed_threshold);
2233 }

References GetGame().

Referenced by FireplaceBase::IsThisIgnitionSuccessful(), and StartHeating().

◆ LockOvenAttachments()

void LockOvenAttachments ( bool lock)
protected

Definition at line 2522 of file FireplaceBase.c.

2523 {
2524 //Print("LockOvenAttachments");
2525 //string path_cooking_equipment = "" + CFG_VEHICLESPATH + " " + GetType() + " GUIInventoryAttachmentsProps CookingEquipment attachmentSlots";
2526 string path_cooking_equipment = string.Format("%1 %2 GUIInventoryAttachmentsProps CookingEquipment attachmentSlots", CFG_VEHICLESPATH, GetType());
2527 //string path_direct_cooking = "" + CFG_VEHICLESPATH + " " + GetType() + " GUIInventoryAttachmentsProps DirectCooking attachmentSlots";
2528 string path_direct_cooking = string.Format("%1 %2 GUIInventoryAttachmentsProps DirectCooking attachmentSlots", CFG_VEHICLESPATH, GetType());
2529 if (GetGame().ConfigIsExisting(path_cooking_equipment) && GetGame().ConfigIsExisting(path_direct_cooking))
2530 {
2534 GetGame().ConfigGetTextArray(path_direct_cooking, arr_direct_cooking);
2535 for (int i = 0; i < arr_cooking_equipment.Count(); i++)
2536 {
2537 if (lock != GetInventory().GetSlotLock(InventorySlots.GetSlotIdFromString(arr_cooking_equipment[i])))
2538 {
2539 GetInventory().SetSlotLock(InventorySlots.GetSlotIdFromString(arr_cooking_equipment[i]), lock);
2540 //Print("attachment lock: " + arr_cooking_equipment[i] + " " + lock);
2541 }
2542 }
2543
2544 for (i = 0; i < arr_direct_cooking.Count(); i++)
2545 {
2546 if (lock == GetInventory().GetSlotLock(InventorySlots.GetSlotIdFromString(arr_direct_cooking[i])))
2547 {
2548 GetInventory().SetSlotLock(InventorySlots.GetSlotIdFromString(arr_direct_cooking[i]), !lock);
2549 //Print("attachment lock: " + arr_direct_cooking[i] + " " + !lock);
2550 }
2551 }
2552 }
2554 }
eBleedingSourceType GetType()
int m_OvenAttachmentsLockState
const string CFG_VEHICLESPATH
Definition constants.c:209

References CFG_VEHICLESPATH, GetGame(), InventorySlots::GetSlotIdFromString(), GetType(), and m_OvenAttachmentsLockState.

Referenced by RefreshFireplaceVisuals().

◆ OnAction()

override bool OnAction ( int action_id,
Man player,
ParamsReadContext ctx )
protected

Definition at line 2626 of file FireplaceBase.c.

2627 {
2628 if (super.OnAction(action_id, player, ctx))
2629 return true;
2630 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
2631 {
2632 if (action_id == EActions.ACTIVATE_ENTITY)
2634 else if (action_id == EActions.DEACTIVATE_ENTITY)
2635 StopFire();
2636 }
2637 return false;
2638 }
override void OnIgnitedThis(EntityAI fire_source)
Executed on Server when some item ignited this one.

References GetGame(), FireplaceBase::OnIgnitedThis(), and StopFire().

◆ OnAttachmentQuantityChanged()

override void OnAttachmentQuantityChanged ( ItemBase item)
protected

Definition at line 2503 of file FireplaceBase.c.

2504 {
2505 super.OnAttachmentQuantityChanged(item);
2506
2508 }

References CalcAndSetQuantity().

◆ OnAttachmentRuined()

override void OnAttachmentRuined ( EntityAI attachment)
protected

Definition at line 334 of file FireplaceBase.c.

335 {
336 switch (attachment.Type())
337 {
340 int slot = InventorySlots.GetSlotIdFromString("CookingEquipment");
341 EntityAI ent = GetInventory().FindAttachment(slot);
342 if (ent)
343 {
344 switch (ent.Type())
345 {
349 vector direction = ent.GetDirection();
351
352 float angle = Math.Acos(dot);
353 if (direction[0] < 0)
354 angle = -angle;
355
356 float cos = Math.Cos(angle);
357 float sin = Math.Sin(angle);
358 GetInventory().DropEntityInBounds(InventoryMode.SERVER, this, ent, "2 0 2", angle, cos, sin);
359 break;
360 }
361 }
362
363 attachment.Delete();
364 break;
365 }
366 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Definition EnConvert.c:271
static const vector Forward
Definition EnConvert.c:109
static proto float Acos(float c)
Returns angle in radians from cosinus.
static proto float Cos(float angle)
Returns cosinus of angle in radians.
static proto float Sin(float angle)
Returns sinus of angle in radians.

References Math::Acos(), ATTACHMENT_CAULDRON, ATTACHMENT_COOKING_POT, ATTACHMENT_COOKINGSTAND, ATTACHMENT_FRYING_PAN, ATTACHMENT_TRIPOD, Math::Cos(), vector::Dot(), vector::Forward, InventorySlots::GetSlotIdFromString(), and Math::Sin().

◆ OnDebugSpawn()

override void OnDebugSpawn ( )
protected

Definition at line 2601 of file FireplaceBase.c.

2602 {
2603 ItemBase firewood = ItemBase.Cast(GetInventory().CreateInInventory("Firewood"));
2604 firewood.SetQuantity(firewood.GetQuantityMax());
2605
2606 ItemBase sticks = ItemBase.Cast(GetInventory().CreateInInventory("WoodenStick"));
2607 sticks.SetQuantity(sticks.GetQuantityMax());
2608
2609 ItemBase stone = ItemBase.Cast(GetInventory().CreateInInventory("Stone"));
2610 stone.SetQuantity(stone.GetQuantityMax());
2611
2612 GetInventory().CreateInInventory("Rag");
2613
2614 SpawnEntityOnGroundPos("PetrolLighter", GetPosition());
2615 }

References GetPosition.

◆ OnItemLocationChanged()

override void OnItemLocationChanged ( EntityAI old_owner,
EntityAI new_owner )
protected

Definition at line 326 of file FireplaceBase.c.

327 {
328 super.OnItemLocationChanged(old_owner, new_owner);
329
330 //refresh physics after location change (with delay)
332 }
void RefreshFireplacePhysics()
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10

References CALL_CATEGORY_GAMEPLAY, GetGame(), and FireplaceBase::RefreshFireplacePhysics().

◆ OnPlacementComplete()

override void OnPlacementComplete ( Man player,
vector position = "0 0 0",
vector orientation = "0 0 0" )
protected

Definition at line 2423 of file FireplaceBase.c.

2424 {
2425 super.OnPlacementComplete(player, position, orientation);
2426
2427 if (GetGame().IsServer())
2428 {
2429 //remove grass
2431 cc_object.SetOrientation(orientation);
2432 GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(GetGame().ObjectDelete, 1000, false, cc_object);
2433
2434 SetIsPlaceSound(true);
2435 }
2436 }
const int ECE_PLACE_ON_SURFACE
const string OBJECT_CLUTTER_CUTTER
void SetIsPlaceSound(bool is_place_sound)
Definition ItemBase.c:8962

References CALL_CATEGORY_GAMEPLAY, ECE_PLACE_ON_SURFACE, GetGame(), OBJECT_CLUTTER_CUTTER, and SetIsPlaceSound().

◆ OnRPC()

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

Definition at line 2560 of file FireplaceBase.c.

2561 {
2562 super.OnRPC(sender, rpc_type, ctx);
2563
2564 ref Param1<bool> p = new Param1<bool>(false);
2565
2566 if (ctx.Read(p))
2567 bool failure = p.param1;
2568
2569 switch (rpc_type)
2570 {
2571 case FirePlaceFailure.WIND:
2572
2573 if (failure)
2574 {
2576 SoundFireStop();
2578 }
2579
2580 break;
2581
2582 case FirePlaceFailure.WET:
2583
2584 if (failure)
2585 {
2587 SoundFireStop();
2589 }
2590
2591 break;
2592 }
2593 }
void ParticleWetNoIgniteStart()
void SoundFireStop()
void SoundFireWetNoIgniteStart()
void SoundFireWindyNoIgniteStart()
void ParticleFireWindyNoIgniteStart()

References ParticleFireWindyNoIgniteStart(), ParticleWetNoIgniteStart(), SoundFireStop(), SoundFireWetNoIgniteStart(), and SoundFireWindyNoIgniteStart().

◆ OnStoreLoad()

override bool OnStoreLoad ( ParamsReadContext ctx,
int version )
protected

Definition at line 398 of file FireplaceBase.c.

399 {
400 if (!super.OnStoreLoad(ctx, version))
401 return false;
402
403 //--- Fireplace data ---
404 //Load ashes state
405 if (!ctx.Read(m_HasAshes))
406 {
407 m_HasAshes = false; //set default
408 return false;
409 }
410
411 //Load temperature loss MP
412 if (!ctx.Read(m_TemperatureLossMP))
413 {
414 m_TemperatureLossMP = 1.0; //set default
415 return false;
416 }
417
418 //Load fuel burn rate MP
419 if (!ctx.Read(m_FuelBurnRateMP))
420 {
421 m_FuelBurnRateMP = 1.0; //set default
422 return false;
423 }
424
425 //Load burning state, if true start fire
426 if (!ctx.Read(m_IsBurning))
427 {
428 m_IsBurning = false; //set default
429 return false;
430 }
431 //---
432
433 return true;
434 }

References m_FuelBurnRateMP, m_HasAshes, m_IsBurning, and m_TemperatureLossMP.

◆ OnStoreSave()

override void OnStoreSave ( ParamsWriteContext ctx)
protected

Definition at line 381 of file FireplaceBase.c.

382 {
383 super.OnStoreSave(ctx);
384
385 //Save ashes state
386 ctx.Write(m_HasAshes);
387
388 //Save temperature loss MP
390
391 //Save fuel burn rate MP
392 ctx.Write(m_FuelBurnRateMP);
393
394 //Save burning state
395 ctx.Write(m_IsBurning);
396 }

References m_FuelBurnRateMP, m_HasAshes, m_IsBurning, and m_TemperatureLossMP.

◆ OnVariablesSynchronized()

override void OnVariablesSynchronized ( )
protected

Definition at line 469 of file FireplaceBase.c.

470 {
471 super.OnVariablesSynchronized();
472
475
476 if (IsPlaceSound())
478
479 if (IsBaseFireplace() && !IsOven())
480 {
483 else if (!m_IsBurning && m_AreaDamage)
485 }
486 }
void RefreshFireParticlesAndSounds(bool force_refresh)
void CreateAreaDamage()
bool IsBaseFireplace()
void PlayPlaceSound()
Definition ItemBase.c:9027
bool IsPlaceSound()
Definition ItemBase.c:8967

References FireplaceBase::CreateAreaDamage(), DestroyAreaDamage(), FireplaceBase::IsBaseFireplace(), IsOven(), IsPlaceSound(), m_AreaDamage, m_IsBurning, PlayPlaceSound(), RefreshFireParticlesAndSounds(), and RefreshFireplaceVisuals().

◆ ParticleFireEndStart()

void ParticleFireEndStart ( )
protected

Definition at line 1117 of file FireplaceBase.c.

1118 {
1119 if (IsOven())
1121 else
1123 }
bool PlayParticle(out Particle particle, int particle_type, vector pos, bool worldpos=false)
int PARTICLE_FIRE_END
vector GetFireEffectPosition()
Particle m_ParticleFireEnd
int PARTICLE_OVEN_FIRE_END

References GetFireEffectPosition(), IsOven(), m_ParticleFireEnd, PARTICLE_FIRE_END, PARTICLE_OVEN_FIRE_END, and PlayParticle().

Referenced by RefreshFireParticlesAndSounds().

◆ ParticleFireEndStop()

void ParticleFireEndStop ( )
protected

Definition at line 1125 of file FireplaceBase.c.

1126 {
1128 }
bool StopParticle(out Particle particle)

References m_ParticleFireEnd, and StopParticle().

Referenced by RefreshFireParticlesAndSounds().

◆ ParticleFireStartStart()

void ParticleFireStartStart ( )
protected

◆ ParticleFireStartStop()

void ParticleFireStartStop ( )
protected

Definition at line 1035 of file FireplaceBase.c.

1036 {
1038 }

References m_ParticleFireStart, and StopParticle().

Referenced by RefreshFireParticlesAndSounds().

◆ ParticleFireWindyNoIgniteStart()

void ParticleFireWindyNoIgniteStart ( )
protected

◆ ParticleNormalFireStart()

void ParticleNormalFireStart ( )
protected

◆ ParticleNormalFireStop()

void ParticleNormalFireStop ( )
protected

Definition at line 1063 of file FireplaceBase.c.

1064 {
1066 }

References m_ParticleNormalFire, and StopParticle().

Referenced by RefreshFireParticlesAndSounds().

◆ ParticleNormalSmokeStart()

void ParticleNormalSmokeStart ( )
protected

Definition at line 1093 of file FireplaceBase.c.

1094 {
1096
1097 //calculate air resistance
1098 float actual_height;
1100 {
1102
1103 //alter smoke height
1105 }
1106
1107 if (IsRoofAbove())
1109 }
float GetAirResistanceForSmokeParticles(float actual_height)
int PARTICLE_NORMAL_SMOKE
bool GetCeilingHeight(out float actual_height)
vector GetSmokeEffectPosition()
Particle m_ParticleNormalSmoke
void SetParameter(int emitter, int parameter, float value)
Set the value of a parameter of an emitor in the particle.
Definition Particle.c:603
EmitorParam
Definition EnVisual.c:114

References GetAirResistanceForSmokeParticles(), GetCeilingHeight(), FireplaceBase::GetSmokeEffectPosition(), IsRoofAbove(), m_ParticleNormalSmoke, PARTICLE_NORMAL_SMOKE, PlayParticle(), and Particle::SetParameter().

◆ ParticleNormalSmokeStop()

void ParticleNormalSmokeStop ( )
protected

Definition at line 1111 of file FireplaceBase.c.

1112 {
1114 }

References m_ParticleNormalSmoke, and StopParticle().

Referenced by RefreshFireParticlesAndSounds().

◆ ParticleSmallFireStart()

void ParticleSmallFireStart ( )
protected

◆ ParticleSmallFireStop()

void ParticleSmallFireStop ( )
protected

Definition at line 1049 of file FireplaceBase.c.

1050 {
1052 }

References m_ParticleSmallFire, and StopParticle().

Referenced by RefreshFireParticlesAndSounds().

◆ ParticleSmallSmokeStart()

void ParticleSmallSmokeStart ( )
protected

◆ ParticleSmallSmokeStop()

void ParticleSmallSmokeStop ( )
protected

Definition at line 1087 of file FireplaceBase.c.

1088 {
1090 }

References m_ParticleSmallSmoke, and StopParticle().

Referenced by RefreshFireParticlesAndSounds().

◆ ParticleSteamEndStart()

void ParticleSteamEndStart ( )
protected

◆ ParticleSteamEndStop()

void ParticleSteamEndStop ( )
protected

Definition at line 1155 of file FireplaceBase.c.

1156 {
1158 }

References m_ParticleSteamEnd, and StopParticle().

Referenced by RefreshFireParticlesAndSounds().

◆ ParticleSteamExtinguishingStart()

void ParticleSteamExtinguishingStart ( )
protected

◆ ParticleSteamExtinguishingStop()

void ParticleSteamExtinguishingStop ( )
protected

Definition at line 1144 of file FireplaceBase.c.

References m_ParticleSteamExtinguishing, and StopParticle().

Referenced by RefreshFireParticlesAndSounds().

◆ ParticleWetNoIgniteStart()

void ParticleWetNoIgniteStart ( )
protected

◆ ParticleWetNoIgniteStop()

void ParticleWetNoIgniteStop ( )
protected

Definition at line 1165 of file FireplaceBase.c.

1166 {
1168 }

References m_ParticleSteamEnd, and StopParticle().

◆ PlayParticle()

bool PlayParticle ( out Particle particle,
int particle_type,
vector pos,
bool worldpos = false )
protected

Definition at line 997 of file FireplaceBase.c.

998 {
999 if (!particle && GetGame() && (!GetGame().IsDedicatedServer()))
1000 {
1001 if (!worldpos)
1002 particle = ParticleManager.GetInstance().PlayOnObject(particle_type, this, pos);
1003 else
1004 particle = ParticleManager.GetInstance().PlayInWorld(particle_type, pos);
1005
1006 return true;
1007 }
1008
1009 return false;
1010 }
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)

References GetGame(), and ParticleManager().

◆ RefreshFireParticlesAndSounds()

void RefreshFireParticlesAndSounds ( bool force_refresh)
protected

Definition at line 761 of file FireplaceBase.c.

762 {
764
766 {
767 switch (fire_state)
768 {
769 case FireplaceFireState.START_FIRE:
770 {
771 //particles
773
774 //sounds
777 break;
778 }
779 case FireplaceFireState.SMALL_FIRE:
780 {
781 //particles
783
785
786 if (CanShowSmoke())
788 else
790
793
795
796 //sounds
799 break;
800 }
801 case FireplaceFireState.NORMAL_FIRE:
802 {
803 //particles
805
808
810
811 if (CanShowSmoke())
813 else
815
817
818 //sounds
821 break;
822 }
823 case FireplaceFireState.END_FIRE:
824 {
825 //particles
827
830
833
835
836 //sounds
839 break;
840 }
841 case FireplaceFireState.EXTINGUISHING_FIRE: //TODO add steam particles when extinguishing
842 {
843 //particles
845
848
851
853
855
856 //sounds
859 break;
860 }
861 case FireplaceFireState.EXTINGUISHED_FIRE: //TODO add steam particles when fireplace is extinguished
862 {
863 //particles
865
868
871
873
875
876 if (CanShowSmoke())
878 else
880
881 //sounds
885 break;
886 }
887 case FireplaceFireState.REIGNITED_FIRE:
888 {
889 //particles
891
894
897
899
901
902 //sounds
904 break;
905 }
906 case FireplaceFireState.NO_FIRE:
907 {
908 //particles
910
913
916
918
921
922 //sounds
924 break;
925 }
926 }
927
929 }
930 }
void ParticleSteamExtinguishingStop()
void ParticleSmallFireStart()
void SoundFireLightStart()
void ParticleNormalFireStop()
void ParticleSteamEndStart()
void SoundFireExtinguishedStart()
void ParticleSteamExtinguishingStart()
void ParticleSmallSmokeStart()
void SoundFireHeavyStart()
FireplaceFireState m_LastFireState
void ParticleNormalSmokeStop()
bool CanShowSmoke()
void ParticleFireStartStart()
void SoundFireExtinguishingStart()
void ParticleNormalFireStart()
void SoundFireNoFireStart()
void ParticleSmallSmokeStop()
void ParticleFireEndStart()
void ParticleFireEndStop()
void ParticleFireStartStop()
void ParticleSteamEndStop()
void ParticleSmallFireStop()
void ParticleNormalSmokeStart()

References FireplaceBase::CanShowSmoke(), GetFireState(), m_LastFireState, ParticleFireEndStart(), ParticleFireEndStop(), ParticleFireStartStart(), ParticleFireStartStop(), ParticleNormalFireStart(), ParticleNormalFireStop(), FireplaceBase::ParticleNormalSmokeStart(), ParticleNormalSmokeStop(), ParticleSmallFireStart(), ParticleSmallFireStop(), FireplaceBase::ParticleSmallSmokeStart(), ParticleSmallSmokeStop(), ParticleSteamEndStart(), ParticleSteamEndStop(), ParticleSteamExtinguishingStart(), ParticleSteamExtinguishingStop(), SoundFireExtinguishedStart(), SoundFireExtinguishingStart(), SoundFireHeavyStart(), SoundFireLightStart(), SoundFireNoFireStart(), and SoundFireStop().

Referenced by OnVariablesSynchronized(), and FireplaceBase::OnVariablesSynchronized().

◆ RefreshFireplacePhysics()

void RefreshFireplacePhysics ( )
protected

◆ RefreshFireplaceVisuals()

void RefreshFireplaceVisuals ( )
protected

single stone; everything else hidden

hide stones stack completely

Definition at line 596 of file FireplaceBase.c.

597 {
598 if (IsHologram())
599 return;
600
601 // Light
602#ifndef SERVER
603 if (IsBurning())
604 {
605 //turn light on
606 if (!GetLightEntity())
607 {
608 SetLightEntity(FireplaceLight.Cast(ScriptedLightBase.CreateLight(FireplaceLight, GetPosition(), 20)));
609 GetLightEntity().AttachOnMemoryPoint(this, "light");
610 }
611
612 if (GetLightEntity() && GetLightEntity().GetBrightness() > 0)
613 {
614 // change brightness based on the distance of player to the fireplace
615 Object player = GetGame().GetPlayer();
617
618 if (IsOven())
619 lightDist = 50;
620
621 if (player)
622 {
623 if (vector.DistanceSq(player.GetPosition(), this.GetPosition()) > lightDist * lightDist)
624 GetLightEntity().FadeBrightnessTo(0, 5);
625 else
626 GetLightEntity().FadeBrightnessTo(FireplaceLight.m_FireplaceBrightness, 5);
627 }
628
629 // The following solves an issue with the light point clipping through narrow geometry
631 GetLightEntity().SetInteriorMode();
632 else
633 GetLightEntity().SetExteriorMode();
634 }
635 }
636 else
637 {
638 //turn light off
639 if (GetLightEntity())
640 GetLightEntity().FadeOut();
641 }
642#endif
643
644 //set default burn parameters based on fireplace type
646 {
649 }
650 else if (HasStoneCircle())
651 {
654 }
655 else
656 {
659 }
660
661 // Oven attachments
662 if (IsOven())
663 {
664 //lock attachment slots
667 }
668 else
669 {
670 //unlock attachment slots
672 LockOvenAttachments(false);
673 }
674
675 //VISUAL STATES
676 //Fuel state
677 if (GetGame().IsServer()) // SetAnimationPhase should ideally be called on server only..
678 {
679 // Sticks state
681 SetAnimationPhase(ANIMATION_STICKS, 0);
682 else
683 SetAnimationPhase(ANIMATION_STICKS, 1);
684
685 // Firewood state
687 {
688 if (IsBurning() && HasAshes())
689 {
690 SetAnimationPhase(ANIMATION_BURNT_WOOD, 0); // Because this might not be set under certain circumstances
691 SetAnimationPhase(ANIMATION_WOOD, 1);
692 }
693
694 if (IsWet() || !IsBurning())
695 {
696 SetAnimationPhase(ANIMATION_BURNT_WOOD, 1);
697 SetAnimationPhase(ANIMATION_WOOD, 0);
698 }
699 }
700 else
701 {
702 SetAnimationPhase(ANIMATION_WOOD, 1);
703 SetAnimationPhase(ANIMATION_BURNT_WOOD, 1);
704 }
705
706 // Kindling state
707 if (GetKindlingCount() != 0)
708 SetAnimationPhase(ANIMATION_KINDLING, 0);
709 else
710 SetAnimationPhase(ANIMATION_KINDLING, 1);
711
712 // Ashes state
713 if (HasAshes())
714 SetAnimationPhase(ANIMATION_ASHES, 0);
715 else
716 SetAnimationPhase(ANIMATION_ASHES, 1);
717
718 // Stone variations
719 if (HasStones())
720 {
721 if (HasStoneCircle())
722 {
723 SetAnimationPhase(ANIMATION_STONES, 0);
724 SetAnimationPhase(ANIMATION_STONE, 1);
725 }
726 else if (IsOven())
727 {
728 SetAnimationPhase(ANIMATION_OVEN, 0);
729 SetAnimationPhase(ANIMATION_STONE, 1);
730 }
731 else
732 {
734 SetAnimationPhase(ANIMATION_STONES, 1);
735 SetAnimationPhase(ANIMATION_OVEN, 1);
736 SetAnimationPhase(ANIMATION_STONE, 0);
737 }
738 }
739 else
740 {
741 SetAnimationPhase(ANIMATION_STONE, 1);
742 }
743 }
744
745 //refresh physics (with delay)
747 }
const float TEMPERATURE_LOSS_MP_OVEN
const string ANIMATION_OVEN
void LockOvenAttachments(bool lock)
bool IsBarrelWithHoles()
float m_LightDistance
FireplaceLight GetLightEntity()
const float TEMPERATURE_LOSS_MP_STONES
const string ANIMATION_ASHES
const string ANIMATION_STONES
const float FUEL_BURN_RATE_OVEN
bool IsWet()
bool IsIndoorOven()
const string ANIMATION_WOOD
const float FUEL_BURN_RATE_STONES
const string ANIMATION_KINDLING
const string ANIMATION_STICKS
const string ANIMATION_STONE
bool IsFireplaceIndoor()
bool IsItemTypeAttached(typename item_type)
const string ANIMATION_BURNT_WOOD
void SetLightEntity(FireplaceLight light)
override bool IsHologram()
Definition ItemBase.c:5641
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.

References ANIMATION_ASHES, ANIMATION_BURNT_WOOD, ANIMATION_KINDLING, ANIMATION_OVEN, ANIMATION_STICKS, ANIMATION_STONE, ANIMATION_STONES, ANIMATION_WOOD, ATTACHMENT_FIREWOOD, ATTACHMENT_STICKS, ATTACHMENT_STONES, CALL_CATEGORY_GAMEPLAY, vector::DistanceSq(), FUEL_BURN_RATE_DEFAULT, FUEL_BURN_RATE_OVEN, FUEL_BURN_RATE_STONES, GetGame(), GetKindlingCount(), GetLightEntity(), GetPosition, HasAshes(), HasStoneCircle(), HasStones(), FireplaceBase::IsBarrelWithHoles(), IsBurning(), FireplaceBase::IsFireplaceIndoor(), IsHologram(), FireplaceBase::IsIndoorOven(), IsItemTypeAttached(), IsOven(), IsWet(), LockOvenAttachments(), m_LightDistance, m_OvenAttachmentsLockState, FireplaceBase::RefreshFireplacePhysics(), SetFuelBurnRateMP(), SetLightEntity(), SetTemperatureLossMP(), TEMPERATURE_LOSS_MP_DEFAULT, TEMPERATURE_LOSS_MP_OVEN, and TEMPERATURE_LOSS_MP_STONES.

Referenced by EEInit(), FireplaceBase::EEItemAttached(), FireplaceBase::EEItemDetached(), OnVariablesSynchronized(), SetItemToConsume(), and Synchronize().

◆ RefreshFireState()

void RefreshFireState ( )
protected

Definition at line 965 of file FireplaceBase.c.

966 {
967 float temperature = GetTemperature();
968
969 //if it's burning
970 if (IsBurning())
971 {
972 //Start fire
974 {
975 if (GetFireState() != FireplaceFireState.START_FIRE)
977 }
978 //Small fire
980 {
981 if (GetFireState() != FireplaceFireState.SMALL_FIRE)
983 }
984 //Normal fire
986 {
987 if (GetFireState() != FireplaceFireState.NORMAL_FIRE)
988 SetFireState(FireplaceFireState.NORMAL_FIRE);
989 }
990 }
991 }

References GetFireState(), GetTemperature(), IsBurning(), PARAM_MIN_FIRE_TEMPERATURE, PARAM_SMALL_FIRE_TEMPERATURE, and SetFireState().

Referenced by Heating().

◆ RemoveFromFireConsumables()

void RemoveFromFireConsumables ( FireConsumable fire_consumable)
protected

Definition at line 1286 of file FireplaceBase.c.

1287 {
1288 if (fire_consumable)
1289 {
1290 m_FireConsumables.Remove(fire_consumable.GetItem());
1291 delete fire_consumable;
1292 }
1293
1295 }

References CalcAndSetQuantity(), and m_FireConsumables.

Referenced by FireplaceBase::EEItemDetached(), and SpendFireConsumable().

◆ SetAshesState()

void SetAshesState ( bool has_ashes)
protected

Definition at line 1506 of file FireplaceBase.c.

1507 {
1509
1510 if (m_HasAshes)
1512 }
void SetBurntFirewood()

References m_HasAshes, and SetBurntFirewood().

Referenced by SpendFireConsumable().

◆ SetBurningState()

void SetBurningState ( bool is_burning)
protected

Definition at line 1494 of file FireplaceBase.c.

1495 {
1497 }

References m_IsBurning.

Referenced by StartFire(), and StopFire().

◆ SetBurntFirewood()

void SetBurntFirewood ( )
protected

Definition at line 749 of file FireplaceBase.c.

750 {
751 if (GetGame().IsServer() && IsInAnimPhase(ANIMATION_WOOD))
752 {
753 SetAnimationPhase(ANIMATION_WOOD, 1);
754 SetAnimationPhase(ANIMATION_BURNT_WOOD, 0);
755 }
756 }
bool IsInAnimPhase(string anim_phase)

References ANIMATION_BURNT_WOOD, ANIMATION_WOOD, GetGame(), and IsInAnimPhase().

Referenced by SetAshesState().

◆ SetCookingEquipment()

void SetCookingEquipment ( ItemBase equipment)
protected

Definition at line 535 of file FireplaceBase.c.

536 {
538 }

References m_CookingEquipment.

Referenced by ItemBase::ClearCookingEquipment(), and ItemBase::EEItemAttached().

◆ SetExtinguishingState()

void SetExtinguishingState ( )
protected

Definition at line 1602 of file FireplaceBase.c.

1603 {
1604 SetFireState(FireplaceFireState.EXTINGUISHING_FIRE);
1605 }

References SetFireState().

◆ SetFireState()

void SetFireState ( FireplaceFireState state)
protected

Definition at line 1592 of file FireplaceBase.c.

1593 {
1594 if (m_FireState != state)
1595 {
1597
1598 Synchronize();
1599 }
1600 }

References m_FireState, and Synchronize().

Referenced by EEDelete(), RefreshFireState(), SetExtinguishingState(), StopCooling(), and StopFire().

◆ SetFuelBurnRateMP()

void SetFuelBurnRateMP ( float value)
protected

Definition at line 1580 of file FireplaceBase.c.

1581 {
1583 }

References m_FuelBurnRateMP.

Referenced by FireplaceBase(), and RefreshFireplaceVisuals().

◆ SetIgniteFailure()

void SetIgniteFailure ( bool failure)
protected

Definition at line 2240 of file FireplaceBase.c.

2241 {
2243 }

References m_NoIgnite.

Referenced by FireplaceBase::IsThisIgnitionSuccessful().

◆ SetItemToConsume()

FireConsumable SetItemToConsume ( )
protected

Definition at line 1305 of file FireplaceBase.c.

1306 {
1307 if (m_FireConsumables.Count() == 0)
1309 else
1310 {
1311 for (int i = 0; i < m_FireConsumables.Count(); ++i)
1312 {
1313 ItemBase key = m_FireConsumables.GetKey(i);
1315
1316 if (i == 0)
1318 else
1319 {
1320 if (fireConsumable.GetEnergy() < m_ItemToConsume.GetEnergy())
1322 }
1323 }
1324 }
1325
1326 //refresh visual
1328
1329 return m_ItemToConsume;
1330 }

References m_FireConsumables, m_ItemToConsume, and RefreshFireplaceVisuals().

Referenced by SpendFireConsumable(), and StartFire().

◆ SetLightEntity()

void SetLightEntity ( FireplaceLight light)
protected

Definition at line 2414 of file FireplaceBase.c.

2415 {
2416 m_Light = light;
2417 }

References m_Light.

Referenced by RefreshFireplaceVisuals().

◆ SetOvenState()

void SetOvenState ( bool is_oven)
protected

Definition at line 1539 of file FireplaceBase.c.

1540 {
1541 if (m_IsOven != is_oven)
1542 {
1543 m_IsOven = is_oven;
1545
1546 GetInventory().SetSlotLock(InventorySlots.GetSlotIdFromString("Stones"), is_oven);
1547
1548 Synchronize();
1549 }
1550 }

References InventorySlots::GetSlotIdFromString(), m_IsOven, m_RoofAbove, and Synchronize().

◆ SetStoneCircleState()

void SetStoneCircleState ( bool has_stonecircle)
protected

Definition at line 1551 of file FireplaceBase.c.

1552 {
1554 {
1556
1557 GetInventory().SetSlotLock(InventorySlots.GetSlotIdFromString("Stones"), has_stonecircle);
1558
1559 Synchronize();
1560 }
1561 }

References InventorySlots::GetSlotIdFromString(), m_HasStoneCircle, and Synchronize().

◆ SetTemperatureLossMP()

void SetTemperatureLossMP ( float value)
protected

Definition at line 1569 of file FireplaceBase.c.

1570 {
1572 }

References m_TemperatureLossMP.

Referenced by FireplaceBase(), and RefreshFireplaceVisuals().

◆ SmokeOnSmokingSlot()

void SmokeOnSmokingSlot ( ItemBase slot_item,
float temp_equip,
float temp_ext )
protected

Definition at line 2016 of file FireplaceBase.c.

2017 {
2018 if (m_CookingProcess == NULL)
2019 m_CookingProcess = new Cooking();
2020
2021 // smoking slots accept only individual meat/fruit/veg items
2023 if (ingr)
2024 m_CookingProcess.SmokeItem(ingr, FireplaceBase.TIMER_HEATING_UPDATE_INTERVAL * FireplaceBase.SMOKING_SPEED);
2025 }

References m_CookingProcess.

Referenced by Cooling(), and Heating().

◆ SmokingSlotsInUse()

bool SmokingSlotsInUse ( )
protected

Definition at line 564 of file FireplaceBase.c.

565 {
566 for (int i = 0; i < SMOKING_SLOT_COUNT; i++)
567 {
568 if (m_SmokingSlots[i])
569 return true;
570 }
571 return false;
572 }

References m_SmokingSlots, and SMOKING_SLOT_COUNT.

Referenced by CanDismantleOven(), FireplaceBase::CanPutIntoHands(), Cooling(), and Heating().

◆ SoundFireExtinguishedStart()

void SoundFireExtinguishedStart ( )
protected

Definition at line 1229 of file FireplaceBase.c.

1230 {
1231 PlaySoundSet(m_SoundFire, SOUND_FIRE_EXTINGUISHED, 0.1, 0.1);
1232 }
const string SOUND_FIRE_EXTINGUISHED
EffectSound m_SoundFire

References m_SoundFire, and SOUND_FIRE_EXTINGUISHED.

Referenced by RefreshFireParticlesAndSounds().

◆ SoundFireExtinguishingStart()

void SoundFireExtinguishingStart ( )
protected

Definition at line 1239 of file FireplaceBase.c.

1240 {
1241 PlaySoundSetLoop(m_SoundFireLoop, SOUND_FIRE_EXTINGUISHING, 1.0, 0.5);
1242 }
const string SOUND_FIRE_EXTINGUISHING
EffectSound m_SoundFireLoop

References m_SoundFireLoop, and SOUND_FIRE_EXTINGUISHING.

Referenced by RefreshFireParticlesAndSounds().

◆ SoundFireHeavyStart()

void SoundFireHeavyStart ( )
protected

Definition at line 1219 of file FireplaceBase.c.

1220 {
1221 PlaySoundSetLoop(m_SoundFireLoop, SOUND_FIRE_HEAVY, 1.0, 2.0);
1222 }
const string SOUND_FIRE_HEAVY

References m_SoundFireLoop, and SOUND_FIRE_HEAVY.

Referenced by RefreshFireParticlesAndSounds().

◆ SoundFireLightStart()

void SoundFireLightStart ( )
protected

Definition at line 1214 of file FireplaceBase.c.

1215 {
1216 PlaySoundSetLoop(m_SoundFireLoop, SOUND_FIRE_LIGHT, 1.0, 1.0);
1217 }
const string SOUND_FIRE_LIGHT

References m_SoundFireLoop, and SOUND_FIRE_LIGHT.

Referenced by RefreshFireParticlesAndSounds().

◆ SoundFireNoFireStart()

void SoundFireNoFireStart ( )
protected

Definition at line 1224 of file FireplaceBase.c.

1225 {
1226 PlaySoundSetLoop(m_SoundFireLoop, SOUND_FIRE_NO_FIRE, 2.0, 2.0);
1227 }
const string SOUND_FIRE_NO_FIRE

References m_SoundFireLoop, and SOUND_FIRE_NO_FIRE.

Referenced by RefreshFireParticlesAndSounds().

◆ SoundFireStop()

void SoundFireStop ( )
protected

Definition at line 1250 of file FireplaceBase.c.

1251 {
1252 StopSoundSet(m_SoundFireLoop);
1253 }

References m_SoundFireLoop.

Referenced by OnRPC(), and RefreshFireParticlesAndSounds().

◆ SoundFireWetNoIgniteStart()

void SoundFireWetNoIgniteStart ( )
protected

Definition at line 1234 of file FireplaceBase.c.

1235 {
1236 PlaySoundSet(m_SoundFire, SOUND_FIRE_EXTINGUISHED, 0.1, 0.1);
1237 }

References m_SoundFire, and SOUND_FIRE_EXTINGUISHED.

Referenced by OnRPC().

◆ SoundFireWindyNoIgniteStart()

void SoundFireWindyNoIgniteStart ( )
protected

Definition at line 1244 of file FireplaceBase.c.

1245 {
1246 PlaySoundSet(m_SoundFire, "ExtinguishByWind_SoundSet", 0, 0);
1247 }

References m_SoundFire.

Referenced by OnRPC().

◆ SpendFireConsumable()

void SpendFireConsumable ( float amount)
protected

Definition at line 1341 of file FireplaceBase.c.

1342 {
1343 //spend item
1345
1346 if (!fireConsumable)
1347 {
1348 //Set new item to consume
1350 }
1351
1352 if (fireConsumable)
1353 {
1354 ItemBase item = fireConsumable.GetItem();
1355 fireConsumable.SetRemainingEnergy(fireConsumable.GetRemainingEnergy() - amount);
1356
1357 if (fireConsumable.GetRemainingEnergy() <= 0 || amount == 0)
1358 {
1359 //set ashes
1360 if (!HasAshes())
1361 SetAshesState(true);
1362
1363 if (item.IsAnyInherited({ItemBook, Paper, GiftWrapPaper, EyeMask_ColorBase}))
1364 {
1366 item.Delete();
1367 }
1368 else
1369 {
1370 //if there is nothing left, delete and remove old consumable, set new fire consumable
1371 if (item.GetQuantity() <= 1)
1372 {
1373 //remove item from fuel items
1375 }
1376 else
1377 fireConsumable.SetRemainingEnergy(fireConsumable.GetEnergy());
1378
1379 item.AddQuantity(-1);
1381 }
1382 }
1383 }
1384
1386 }
void RemoveFromFireConsumables(FireConsumable fire_consumable)
FireConsumable GetItemToConsume()
void SetAshesState(bool has_ashes)
FireConsumable SetItemToConsume()

References CalcAndSetQuantity(), GetItemToConsume(), HasAshes(), RemoveFromFireConsumables(), SetAshesState(), and SetItemToConsume().

Referenced by Heating(), and StopFire().

◆ StartCooling()

void StartCooling ( )
protected

Definition at line 1831 of file FireplaceBase.c.

1832 {
1833 if (m_HeatingTimer)
1834 {
1835 m_HeatingTimer.Stop();
1837 }
1838
1839 //Start cooling
1841 m_CoolingTimer.Run(TIMER_COOLING_UPDATE_INTERVAL, this, "Cooling", null, true);
1842 }

References CALL_CATEGORY_GAMEPLAY, m_CoolingTimer, m_HeatingTimer, and TIMER_COOLING_UPDATE_INTERVAL.

Referenced by StopFire().

◆ StartFire()

void StartFire ( bool force_start = false)
protected

Definition at line 1615 of file FireplaceBase.c.

1616 {
1617 //stop cooling process if active
1618 if (m_CoolingTimer)
1619 {
1620 m_CoolingTimer.Stop();
1622 }
1623
1624 //set under roof flag (was fire ignited under roof?)
1625 if (MiscGameplayFunctions.IsUnderRoof(this))
1626 m_RoofAbove = true;
1627
1628 //start fire
1629 if (!IsBurning() || force_start)
1630 {
1632 SetBurningState(true);
1633 m_UTSource.SetActive(true);
1634 StartHeating();
1635
1636 //Update navmesh
1637 if (!IsFireplaceIndoor())
1638 {
1639 SetAffectPathgraph(false, true);
1640 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, this);
1641 }
1642 }
1643
1644 Synchronize();
1645 }
void StartHeating()
void SetBurningState(bool is_burning)
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

References CALL_CATEGORY_SYSTEM, GetGame(), IsBurning(), FireplaceBase::IsFireplaceIndoor(), m_CoolingTimer, m_RoofAbove, m_UTSource, SetBurningState(), SetItemToConsume(), StartHeating(), and Synchronize().

Referenced by AfterStoreLoad(), and FireplaceBase::OnIgnitedThis().

◆ StartHeating()

void StartHeating ( )
protected

Definition at line 1648 of file FireplaceBase.c.

1649 {
1650 //visual
1651 SetObjectMaterial(0, MATERIAL_FIREPLACE_GLOW);
1652
1653 if (IsWindy() && !IsRoofAbove() && !IsOven() && !IsBarrelWithHoles())
1654 {
1655 StopFire();
1656 return;
1657 }
1658
1660 {
1661 StopFire(FireplaceFireState.EXTINGUISHED_FIRE);
1662 return;
1663 }
1664
1665 //create area damage
1666 if (IsBaseFireplace() && !IsOven())
1668
1670 m_HeatingTimer.Run(TIMER_HEATING_UPDATE_INTERVAL, this, "Heating", null, true);
1671
1672 //Setup the noise parameters on fire start
1673 m_NoisePar = new NoiseParams();
1674 if (IsRoofAbove() || IsOven() || IsFireplaceIndoor()) //If we have a roof, we are probably inside
1675 m_NoisePar.LoadFromPath("CfgVehicles FireplaceBase NoiseFireplaceSpecial");
1676 else
1677 m_NoisePar.LoadFromPath("CfgVehicles FireplaceBase NoiseFireplaceBase");
1678 }
const string MATERIAL_FIREPLACE_GLOW
static bool IsWindy()
class NoiseSystem NoiseParams()
Definition Noise.c:15

References CALL_CATEGORY_GAMEPLAY, FireplaceBase::CreateAreaDamage(), GetWet(), FireplaceBase::IsBarrelWithHoles(), FireplaceBase::IsBaseFireplace(), FireplaceBase::IsFireplaceIndoor(), IsOven(), IsRoofAbove(), IsWindy(), m_HeatingTimer, m_NoisePar, MATERIAL_FIREPLACE_GLOW, NoiseParams(), PARAM_BURN_WET_THRESHOLD, StopFire(), and TIMER_HEATING_UPDATE_INTERVAL.

Referenced by StartFire().

◆ StopAllParticlesAndSounds()

◆ StopCooling()

void StopCooling ( )
protected

Definition at line 1932 of file FireplaceBase.c.

1933 {
1934 //stop all fire visuals
1936 SetObjectMaterial(0, MATERIAL_FIREPLACE_NOGLOW);
1937
1938 //Stop cooling
1939 m_CoolingTimer.Stop();
1941
1942 //destroy area damage
1944
1945 //remove cookware audio visuals
1946 if (GetCookingEquipment())
1947 {
1949 if (cooking_pot)
1950 cooking_pot.RemoveAudioVisualsOnClient();
1951 }
1952
1954 {
1955 for (int i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++)
1956 {
1958 {
1960 if (cookingpot)
1961 cookingpot.RemoveAudioVisualsOnClient();
1962
1963 FryingPan fryingpan = FryingPan.Cast(m_DirectCookingSlots[i]);
1964 if (fryingpan)
1965 fryingpan.RemoveAudioVisualsOnClient();
1966
1968 if (itsfood)
1969 itsfood.MakeSoundsOnClient(false);
1970 }
1971 }
1972 }
1973 }
ItemBase GetCookingEquipment()
const string MATERIAL_FIREPLACE_NOGLOW

References DestroyAreaDamage(), DIRECT_COOKING_SLOT_COUNT, DirectCookingSlotsInUse(), GetCookingEquipment(), m_CoolingTimer, m_DirectCookingSlots, MATERIAL_FIREPLACE_NOGLOW, and SetFireState().

Referenced by Cooling().

◆ StopFire()

void StopFire ( FireplaceFireState fire_state = FireplaceFireState.END_FIRE)
protected

Definition at line 1804 of file FireplaceBase.c.

1805 {
1806 StopHeating();
1808 SetBurningState(false);
1809 StartCooling();
1811
1812 //Update navmesh
1813 if (!IsFireplaceIndoor())
1814 {
1815 SetAffectPathgraph(false, false);
1816 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, this);
1817 }
1818
1819 Synchronize();
1820 }
void StartCooling()
void StopHeating()

References CALL_CATEGORY_SYSTEM, GetGame(), FireplaceBase::IsFireplaceIndoor(), SetBurningState(), SetFireState(), SpendFireConsumable(), StartCooling(), StopHeating(), and Synchronize().

Referenced by Heating(), OnAction(), and StartHeating().

◆ StopHeating()

void StopHeating ( )
protected

Definition at line 1822 of file FireplaceBase.c.

1823 {
1824 if (!m_HeatingTimer)
1825 return;
1826
1827 m_HeatingTimer.Stop();
1829 }

References m_HeatingTimer.

Referenced by StopFire().

◆ StopParticle()

bool StopParticle ( out Particle particle)
protected

Definition at line 1013 of file FireplaceBase.c.

1014 {
1015 if (particle && GetGame() && (!GetGame().IsDedicatedServer()))
1016 {
1017 particle.Stop();
1018 particle = NULL;
1019
1020 return true;
1021 }
1022
1023 return false;
1024 }

References GetGame().

◆ Synchronize()

void Synchronize ( )
protected

Definition at line 455 of file FireplaceBase.c.

456 {
457 if (GetGame() && GetGame().IsServer())
458 {
459 SetSynchDirty();
460
461 if (GetGame().IsMultiplayer() && GetGame().IsServer())
462 {
463 //Refresh visuals (on server)
465 }
466 }
467 }

References CALL_CATEGORY_GAMEPLAY, GetGame(), and RefreshFireplaceVisuals().

◆ TransferHeatToNearPlayers()

void TransferHeatToNearPlayers ( )
protected

DEPRECATED.

Definition at line 2182 of file FireplaceBase.c.

2182{}

◆ ~FireplaceBase()

void ~FireplaceBase ( )
protected

Definition at line 277 of file FireplaceBase.c.

278 {
280
281 if (GetLightEntity())
282 GetLightEntity().FadeOut();
283 }

References DestroyAreaDamage(), and GetLightEntity().

Variable Documentation

◆ ANIMATION_ASHES

const string ANIMATION_ASHES = "Ashes"
protected

Definition at line 170 of file FireplaceBase.c.

Referenced by RefreshFireplaceVisuals().

◆ ANIMATION_BURNT_WOOD

const string ANIMATION_BURNT_WOOD = "BurntWood"
protected

Definition at line 174 of file FireplaceBase.c.

Referenced by RefreshFireplaceVisuals(), and SetBurntFirewood().

◆ ANIMATION_CAULDRON_HANDLE

const string ANIMATION_CAULDRON_HANDLE = "handle1Rotate"
protected

◆ ANIMATION_COOKWARE_HANDLE

const string ANIMATION_COOKWARE_HANDLE = "handleRotate"
protected

◆ ANIMATION_INVENTORY

const string ANIMATION_INVENTORY = "Inventory"
protected

Definition at line 179 of file FireplaceBase.c.

◆ ANIMATION_KINDLING

const string ANIMATION_KINDLING = "Kindling"
protected

Definition at line 171 of file FireplaceBase.c.

Referenced by RefreshFireplaceVisuals().

◆ ANIMATION_OVEN

const string ANIMATION_OVEN = "Oven"
protected

Definition at line 178 of file FireplaceBase.c.

Referenced by RefreshFireplaceVisuals(), and FireplaceBase::RefreshPhysics().

◆ ANIMATION_STICKS

const string ANIMATION_STICKS = "Sticks"
protected

Definition at line 172 of file FireplaceBase.c.

Referenced by RefreshFireplaceVisuals().

◆ ANIMATION_STONE

const string ANIMATION_STONE = "Stone"
protected

Definition at line 175 of file FireplaceBase.c.

Referenced by RefreshFireplaceVisuals().

◆ ANIMATION_STONES

const string ANIMATION_STONES = "StonesCircle"
protected

Definition at line 176 of file FireplaceBase.c.

Referenced by RefreshFireplaceVisuals().

◆ ANIMATION_TRIPOD

const string ANIMATION_TRIPOD = "Tripod"
protected

Definition at line 177 of file FireplaceBase.c.

Referenced by FireplaceBase::RefreshPhysics().

◆ ANIMATION_WOOD

const string ANIMATION_WOOD = "Wood"
protected

Definition at line 173 of file FireplaceBase.c.

Referenced by RefreshFireplaceVisuals(), and SetBurntFirewood().

◆ ATTACHMENT_BANDAGE

ATTACHMENT_BANDAGE = BandageDressing
protected

Definition at line 194 of file FireplaceBase.c.

Referenced by FireplaceBase().

◆ ATTACHMENT_BARK_BIRCH

ATTACHMENT_BARK_BIRCH = Bark_Birch
protected

Definition at line 197 of file FireplaceBase.c.

Referenced by FireplaceBase().

◆ ATTACHMENT_BARK_OAK

ATTACHMENT_BARK_OAK = Bark_Oak
protected

Definition at line 196 of file FireplaceBase.c.

Referenced by FireplaceBase().

◆ ATTACHMENT_BOOK

ATTACHMENT_BOOK = ItemBook
protected

Definition at line 195 of file FireplaceBase.c.

Referenced by FireplaceBase().

◆ ATTACHMENT_CAULDRON

◆ ATTACHMENT_COOKING_POT

◆ ATTACHMENT_COOKINGSTAND

ATTACHMENT_COOKINGSTAND = CookingStand
protected

Definition at line 204 of file FireplaceBase.c.

Referenced by AddDamageToItemByFireEx(), and OnAttachmentRuined().

◆ ATTACHMENT_EYEMASK_COLORBASE

ATTACHMENT_EYEMASK_COLORBASE = EyeMask_ColorBase
protected

Definition at line 201 of file FireplaceBase.c.

Referenced by FireplaceBase().

◆ ATTACHMENT_FIREWOOD

ATTACHMENT_FIREWOOD = Firewood
protected

Definition at line 191 of file FireplaceBase.c.

Referenced by FireplaceBase(), and RefreshFireplaceVisuals().

◆ ATTACHMENT_FRYING_PAN

◆ ATTACHMENT_GIFTWRAP

ATTACHMENT_GIFTWRAP = GiftWrapPaper
protected

Definition at line 199 of file FireplaceBase.c.

Referenced by FireplaceBase().

◆ ATTACHMENT_PAPER

ATTACHMENT_PAPER = Paper
protected

Definition at line 198 of file FireplaceBase.c.

Referenced by FireplaceBase().

◆ ATTACHMENT_PUNCHEDCARD

ATTACHMENT_PUNCHEDCARD = PunchedCard
protected

Definition at line 200 of file FireplaceBase.c.

Referenced by FireplaceBase().

◆ ATTACHMENT_RAGS

ATTACHMENT_RAGS = Rag
protected

Definition at line 193 of file FireplaceBase.c.

Referenced by FireplaceBase().

◆ ATTACHMENT_STICKS

ATTACHMENT_STICKS = WoodenStick
protected

Definition at line 190 of file FireplaceBase.c.

Referenced by FireplaceBase(), and RefreshFireplaceVisuals().

◆ ATTACHMENT_STONES

◆ ATTACHMENT_TRIPOD

◆ DIRECT_COOKING_SLOT_COUNT

const int DIRECT_COOKING_SLOT_COUNT = 3
protected

direct cooking slots

update interval duration of cooling process (seconds)

Definition at line 86 of file FireplaceBase.c.

Referenced by Cooling(), DirectCookingSlotsInUse(), Heating(), and StopCooling().

◆ DIRECT_COOKING_SPEED

const float DIRECT_COOKING_SPEED = 1.5
protected

Definition at line 87 of file FireplaceBase.c.

◆ FUEL_BURN_RATE_DEFAULT

const float FUEL_BURN_RATE_DEFAULT = 1.0
protected

Definition at line 74 of file FireplaceBase.c.

Referenced by FireplaceBase(), and RefreshFireplaceVisuals().

◆ FUEL_BURN_RATE_OVEN

const float FUEL_BURN_RATE_OVEN = 0.85
protected

Definition at line 76 of file FireplaceBase.c.

Referenced by RefreshFireplaceVisuals().

◆ FUEL_BURN_RATE_STONES

const float FUEL_BURN_RATE_STONES = 0.92
protected

Definition at line 75 of file FireplaceBase.c.

Referenced by RefreshFireplaceVisuals().

◆ IGNITE_WIND_THRESHOLD

const float IGNITE_WIND_THRESHOLD = 0.8
protected

Definition at line 95 of file FireplaceBase.c.

◆ LIFETIME_FIREPLACE_STONE_CIRCLE

const int LIFETIME_FIREPLACE_STONE_CIRCLE = 172800
protected

Definition at line 92 of file FireplaceBase.c.

◆ LIFETIME_FIREPLACE_STONE_OVEN

const int LIFETIME_FIREPLACE_STONE_OVEN = 604800
protected

Definition at line 93 of file FireplaceBase.c.

◆ m_AreaDamage

◆ m_CanNoise

bool m_CanNoise = true
private

Definition at line 221 of file FireplaceBase.c.

Referenced by Heating().

◆ m_ClutterCutter

◆ m_CookingEquipment

◆ m_CookingProcess

ref Cooking m_CookingProcess
protected

determines how fast will the fuel item burn before spending (lower is better)

Definition at line 40 of file FireplaceBase.c.

Referenced by ClearCookingEquipment(), ItemBase::ClearCookingEquipment(), CookOnDirectSlot(), CookWithEquipment(), ItemBase::CookWithEquipment(), GetCookingProcess(), ItemBase::OnSwitchOff(), and SmokeOnSmokingSlot().

◆ m_CoolingTimer

ref Timer m_CoolingTimer
protected

Definition at line 99 of file FireplaceBase.c.

Referenced by AddDamageToItemByFireEx(), StartCooling(), StartFire(), and StopCooling().

◆ m_DirectCookingSlots

◆ m_FireConsumables

◆ m_FireConsumableTypes

ref map<typename, ref FireConsumableType> m_FireConsumableTypes
staticprotected

◆ m_FireState

Definition at line 31 of file FireplaceBase.c.

Referenced by GetFireState(), and SetFireState().

◆ m_FuelBurnRateMP

float m_FuelBurnRateMP = 1.0
protected

determines how fast will the fireplace loose its temperature when cooling (lower is better)

Definition at line 37 of file FireplaceBase.c.

Referenced by GetFuelBurnRateMP(), OnStoreLoad(), OnStoreSave(), and SetFuelBurnRateMP().

◆ m_HalfExtents

vector m_HalfExtents
protected

Definition at line 33 of file FireplaceBase.c.

◆ m_HasAshes

bool m_HasAshes = false
protected

Definition at line 25 of file FireplaceBase.c.

Referenced by HasAshes(), OnStoreLoad(), OnStoreSave(), and SetAshesState().

◆ m_HasStoneCircle

bool m_HasStoneCircle = false
protected

◆ m_HeatingTimer

ref Timer m_HeatingTimer
protected

Definition at line 98 of file FireplaceBase.c.

Referenced by AddDamageToItemByFireEx(), StartCooling(), StartHeating(), and StopHeating().

◆ m_IsBurning

◆ m_IsOven

bool m_IsOven = false
protected

◆ m_ItemToConsume

ref FireConsumable m_ItemToConsume
protected

Definition at line 109 of file FireplaceBase.c.

Referenced by GetItemToConsume(), and SetItemToConsume().

◆ m_LastFireState

FireplaceFireState m_LastFireState = FireplaceFireState.NO_FIRE
protected

Definition at line 32 of file FireplaceBase.c.

Referenced by RefreshFireParticlesAndSounds().

◆ m_Light

FireplaceLight m_Light
protected

Definition at line 102 of file FireplaceBase.c.

◆ m_LightDistance

◆ m_NoIgnite

bool m_NoIgnite = false
protected

Definition at line 29 of file FireplaceBase.c.

Referenced by GetIgniteFailure(), and SetIgniteFailure().

◆ m_NoisePar

ref NoiseParams m_NoisePar
protected

Definition at line 220 of file FireplaceBase.c.

◆ m_OvenAttachmentsLockState

int m_OvenAttachmentsLockState = -1
protected

Definition at line 30 of file FireplaceBase.c.

Referenced by LockOvenAttachments(), and RefreshFireplaceVisuals().

◆ m_ParticleFireEnd

Particle m_ParticleFireEnd
protected

◆ m_ParticleFireStart

Particle m_ParticleFireStart
protected

◆ m_ParticleNormalFire

Particle m_ParticleNormalFire
protected

◆ m_ParticleNormalSmoke

◆ m_ParticleSmallFire

Particle m_ParticleSmallFire
protected

◆ m_ParticleSmallSmoke

◆ m_ParticleSteamEnd

◆ m_ParticleSteamExtinguishing

Particle m_ParticleSteamExtinguishing
protected

◆ m_RoofAbove

◆ m_SmokingSlots

◆ m_SoundFire

◆ m_SoundFireLoop

◆ m_TemperatureLossMP

float m_TemperatureLossMP = 1.0
protected

◆ m_TotalEnergy

float m_TotalEnergy
protected

Definition at line 217 of file FireplaceBase.c.

Referenced by CalcAndSetQuantity(), and CalcAndSetTotalEnergy().

◆ m_UTSLFireplace

Definition at line 226 of file FireplaceBase.c.

Referenced by AddWetnessToFireplace(), Cooling(), EEInit(), and Heating().

◆ m_UTSource

◆ m_UTSSettings

◆ MATERIAL_FIREPLACE_GLOW

const string MATERIAL_FIREPLACE_GLOW = "dz\\gear\\cooking\\data\\stoneground.rvmat"
protected

Definition at line 185 of file FireplaceBase.c.

Referenced by StartHeating().

◆ MATERIAL_FIREPLACE_NOGLOW

const string MATERIAL_FIREPLACE_NOGLOW = "dz\\gear\\cooking\\data\\stonegroundnoemit.rvmat"
protected

Definition at line 186 of file FireplaceBase.c.

Referenced by StopCooling().

◆ MAX_TEMPERATURE_TO_DISMANTLE_OVEN

const int MAX_TEMPERATURE_TO_DISMANTLE_OVEN = 40
protected

minimum amount of stones for oven

Definition at line 67 of file FireplaceBase.c.

Referenced by CanDismantleOven().

◆ MESSAGE_BURY_ASHES_FAILED_BURNING

const string MESSAGE_BURY_ASHES_FAILED_BURNING = "Cannot bury ashes, the fireplace is still burning."
protected

Definition at line 164 of file FireplaceBase.c.

◆ MESSAGE_BURY_ASHES_FAILED_NOT_EMPTY

const string MESSAGE_BURY_ASHES_FAILED_NOT_EMPTY = "Cannot bury ashes. There are sill items in it."
protected

Definition at line 162 of file FireplaceBase.c.

◆ MESSAGE_BURY_ASHES_FAILED_SURFACE

const string MESSAGE_BURY_ASHES_FAILED_SURFACE = "Cannot bury ashes on hard surface."
protected

Definition at line 163 of file FireplaceBase.c.

◆ MESSAGE_BURY_ASHES_FAILED_TOO_HOT

const string MESSAGE_BURY_ASHES_FAILED_TOO_HOT = "Cannot bury ashes, the fireplace is too hot."
protected

Definition at line 165 of file FireplaceBase.c.

◆ MESSAGE_CANNOT_BUILD_OVEN

const string MESSAGE_CANNOT_BUILD_OVEN = "Cannot build oven."
protected

Definition at line 166 of file FireplaceBase.c.

◆ MESSAGE_CANNOT_DISMANTLE_OVEN

const string MESSAGE_CANNOT_DISMANTLE_OVEN = "Cannot dismantle oven."
protected

Definition at line 167 of file FireplaceBase.c.

◆ MESSAGE_IGNITE_IGNIT_ITEM_DAMAGED

const string MESSAGE_IGNITE_IGNIT_ITEM_DAMAGED = "You cannot start fire. Fireplace is ruined."
protected

Definition at line 152 of file FireplaceBase.c.

◆ MESSAGE_IGNITE_IN_WATER

const string MESSAGE_IGNITE_IN_WATER = "I cannot ignite the fireplace in the water."
protected

Definition at line 157 of file FireplaceBase.c.

◆ MESSAGE_IGNITE_NO_KINDLING

const string MESSAGE_IGNITE_NO_KINDLING = "There needs to be some kindling to start a fire."
protected

Definition at line 153 of file FireplaceBase.c.

◆ MESSAGE_IGNITE_RAIN

const string MESSAGE_IGNITE_RAIN = "The fire went out because of the rain."
protected

Definition at line 155 of file FireplaceBase.c.

◆ MESSAGE_IGNITE_TOO_WET

const string MESSAGE_IGNITE_TOO_WET = "The fireplace is too wet to be ignited."
protected

Definition at line 154 of file FireplaceBase.c.

◆ MESSAGE_IGNITE_UNDER_LOW_ROOF

const string MESSAGE_IGNITE_UNDER_LOW_ROOF = "I cannot ignite the fireplace here, the is not enough room."
protected

Definition at line 158 of file FireplaceBase.c.

◆ MESSAGE_IGNITE_WIND

const string MESSAGE_IGNITE_WIND = "The fire went out because of the wind."
protected

Definition at line 156 of file FireplaceBase.c.

◆ MESSAGE_REIGNITE_NO_KINDLING

const string MESSAGE_REIGNITE_NO_KINDLING = "There needs to be some kindling to start a fire."
protected

Definition at line 159 of file FireplaceBase.c.

◆ MESSAGE_REIGNITE_RAIN

const string MESSAGE_REIGNITE_RAIN = "Cannot reignite fireplace in rain."
protected

Definition at line 160 of file FireplaceBase.c.

◆ MESSAGE_REIGNITE_TOO_WET

const string MESSAGE_REIGNITE_TOO_WET = "The fireplace is too wet to be reignited."
protected

Definition at line 161 of file FireplaceBase.c.

◆ MIN_CEILING_HEIGHT

const float MIN_CEILING_HEIGHT = 5
protected

maximum temperature for dismantling oven

Definition at line 68 of file FireplaceBase.c.

Referenced by GetCeilingHeight().

◆ MIN_STONES_TO_BUILD_CIRCLE

const int MIN_STONES_TO_BUILD_CIRCLE = 8
protected

maximum value for temperature that will be transfered to player (environment)

Definition at line 65 of file FireplaceBase.c.

Referenced by CanBuildStoneCircle().

◆ MIN_STONES_TO_BUILD_OVEN

const int MIN_STONES_TO_BUILD_OVEN = 16
protected

minimum amount of stones for circle

Definition at line 66 of file FireplaceBase.c.

Referenced by CanBuildOven().

◆ OBJECT_CLUTTER_CUTTER

const string OBJECT_CLUTTER_CUTTER = "ClutterCutterFireplace"
protected

◆ PARAM_BURN_DAMAGE_COEF

const float PARAM_BURN_DAMAGE_COEF = 5.0
protected

base value of fire consumption rate (how many base energy will be spent on each update)

Definition at line 56 of file FireplaceBase.c.

◆ PARAM_BURN_WET_THRESHOLD

const float PARAM_BURN_WET_THRESHOLD = 0.40
protected

maximum rain value when the fireplace can be ignited

Definition at line 51 of file FireplaceBase.c.

Referenced by Heating(), and StartHeating().

◆ PARAM_COOKING_EQUIP_MAX_TEMP

const float PARAM_COOKING_EQUIP_MAX_TEMP = 250
protected

temperature threshold for starting coooking process (degree Celsius)

Definition at line 80 of file FireplaceBase.c.

Referenced by CookOnDirectSlot(), Heating(), and ItemBase::OnWork().

◆ PARAM_COOKING_EQUIP_TEMP_INCREASE

const float PARAM_COOKING_EQUIP_TEMP_INCREASE = 10
protected

maximum temperature of attached cooking equipment (degree Celsius)

Definition at line 81 of file FireplaceBase.c.

Referenced by CookOnDirectSlot(), Heating(), and ItemBase::OnWork().

◆ PARAM_COOKING_TEMP_THRESHOLD

const float PARAM_COOKING_TEMP_THRESHOLD = 100
protected

cooking

Definition at line 79 of file FireplaceBase.c.

Referenced by CanCookOnStick(), Cooling(), Heating(), and ItemBase::OnWork().

◆ PARAM_FIRE_CONSUM_RATE_AMOUNT

const float PARAM_FIRE_CONSUM_RATE_AMOUNT = 0.5
protected

value for calculating wetness loss during cooling process

Definition at line 55 of file FireplaceBase.c.

Referenced by Heating().

◆ PARAM_FULL_HEAT_RADIUS

const float PARAM_FULL_HEAT_RADIUS = 2.0
protected

maximum value of temperature of items in fireplace when heating (degree Celsius)

Definition at line 60 of file FireplaceBase.c.

Referenced by BuildingSuper::EEInit(), and EEInit().

◆ PARAM_HEAT_RADIUS

const float PARAM_HEAT_RADIUS = 4.0
protected

radius in which objects are fully heated by fire

Definition at line 61 of file FireplaceBase.c.

Referenced by BuildingSuper::EEInit(), and EEInit().

◆ PARAM_HEAT_THROUGH_AIR_COEF

const float PARAM_HEAT_THROUGH_AIR_COEF = 0.1
protected

radius in which objects are heated by fire

Definition at line 62 of file FireplaceBase.c.

◆ PARAM_IGNITE_RAIN_THRESHOLD

const float PARAM_IGNITE_RAIN_THRESHOLD = 0.1
protected

minimum fireplace temperature under which the fireplace can be reignited using air only (degree Celsius)

Definition at line 50 of file FireplaceBase.c.

◆ PARAM_ITEM_HEAT_MIN_TEMP

const float PARAM_ITEM_HEAT_MIN_TEMP = 40
protected

value for calculating temperature increase on each heat update interval (degree Celsius)

Definition at line 58 of file FireplaceBase.c.

Referenced by AddDamageToItemByFireEx(), AddTemperatureToItemByFire(), CookOnDirectSlot(), and Heating().

◆ PARAM_ITEM_HEAT_TEMP_INCREASE_COEF

const float PARAM_ITEM_HEAT_TEMP_INCREASE_COEF = 10
protected

value for calculating damage on items located in fireplace cargo

Definition at line 57 of file FireplaceBase.c.

Referenced by AddTemperatureToItemByFire().

◆ PARAM_MAX_ITEM_HEAT_TEMP_INCREASE

const float PARAM_MAX_ITEM_HEAT_TEMP_INCREASE = 200
protected

minimum temperature for items that can be heated in fireplace cargo or as attachments (degree Celsius)

Definition at line 59 of file FireplaceBase.c.

Referenced by AddTemperatureToItemByFire().

◆ PARAM_MAX_TRANSFERED_TEMPERATURE

const float PARAM_MAX_TRANSFERED_TEMPERATURE = 25
protected

DEPRECATED value for calculation of heat transfered from fireplace through air to player (environment)

Definition at line 63 of file FireplaceBase.c.

Referenced by BuildingSuper::EEInit(), and EEInit().

◆ PARAM_MAX_WET_TO_IGNITE

const float PARAM_MAX_WET_TO_IGNITE = 0.2
protected

how much will temperature decrease when fireplace is cooling (degree Celsius per second)

Definition at line 48 of file FireplaceBase.c.

◆ PARAM_MIN_FIRE_TEMPERATURE

const float PARAM_MIN_FIRE_TEMPERATURE = 30
protected

maximum fireplace temperature of a normal fire (degree Celsius)

Definition at line 45 of file FireplaceBase.c.

Referenced by AddWetnessToFireplace(), and RefreshFireState().

◆ PARAM_MIN_TEMP_TO_REIGNITE

const float PARAM_MIN_TEMP_TO_REIGNITE = 30
protected

maximum wetness value when the fireplace can be ignited

Definition at line 49 of file FireplaceBase.c.

◆ PARAM_NORMAL_FIRE_TEMPERATURE

const float PARAM_NORMAL_FIRE_TEMPERATURE = 1000
protected

maximum fireplace temperature of a small fire (degree Celsius)

Definition at line 44 of file FireplaceBase.c.

Referenced by AddWetnessToFireplace(), and EEInit().

◆ PARAM_SMALL_FIRE_TEMPERATURE

const float PARAM_SMALL_FIRE_TEMPERATURE = 150
protected

Definition at line 43 of file FireplaceBase.c.

Referenced by CookOnDirectSlot(), EEInit(), Heating(), and RefreshFireState().

◆ PARAM_TEMPERATURE_DECREASE

const float PARAM_TEMPERATURE_DECREASE = 3
protected

how much will temperature increase when fireplace is burning (degree Celsius per second)

Definition at line 47 of file FireplaceBase.c.

Referenced by Cooling().

◆ PARAM_TEMPERATURE_INCREASE

const float PARAM_TEMPERATURE_INCREASE = 3
protected

minimum fireplace temperature under which the fireplace is inactive (degree Celsius)

Definition at line 46 of file FireplaceBase.c.

Referenced by Heating().

◆ PARAM_WET_COOLING_DECREASE_COEF

const float PARAM_WET_COOLING_DECREASE_COEF = 0.002
protected

value for calculating wetness loss during heating process

Definition at line 54 of file FireplaceBase.c.

Referenced by Cooling().

◆ PARAM_WET_HEATING_DECREASE_COEF

const float PARAM_WET_HEATING_DECREASE_COEF = 0.01
protected

value for calculating of wetness that fireplace gain when raining

Definition at line 53 of file FireplaceBase.c.

Referenced by BurnItemsInFireplace(), and Heating().

◆ PARAM_WET_INCREASE_COEF

const float PARAM_WET_INCREASE_COEF = 0.02
protected

maximum wetness value when the fireplace is able to burn

Definition at line 52 of file FireplaceBase.c.

Referenced by Cooling(), and Heating().

◆ PARTICLE_FIRE_END

◆ PARTICLE_FIRE_START

◆ PARTICLE_NO_IGNITE_WIND

int PARTICLE_NO_IGNITE_WIND = ParticleList.CAMP_NO_IGNITE_WIND
protected

Definition at line 123 of file FireplaceBase.c.

Referenced by ParticleFireWindyNoIgniteStart().

◆ PARTICLE_NORMAL_FIRE

◆ PARTICLE_NORMAL_SMOKE

◆ PARTICLE_OVEN_FIRE

int PARTICLE_OVEN_FIRE = ParticleList.CAMP_STOVE_FIRE
protected

Definition at line 116 of file FireplaceBase.c.

Referenced by ParticleNormalFireStart(), and ParticleSmallFireStart().

◆ PARTICLE_OVEN_FIRE_END

int PARTICLE_OVEN_FIRE_END = ParticleList.CAMP_STOVE_FIRE_END
protected

Definition at line 120 of file FireplaceBase.c.

Referenced by ParticleFireEndStart(), and ParticleFireWindyNoIgniteStart().

◆ PARTICLE_OVEN_FIRE_START

int PARTICLE_OVEN_FIRE_START = ParticleList.CAMP_STOVE_FIRE_START
protected

Definition at line 113 of file FireplaceBase.c.

Referenced by ParticleFireStartStart().

◆ PARTICLE_SMALL_FIRE

◆ PARTICLE_SMALL_SMOKE

◆ PARTICLE_STEAM_END

◆ PARTICLE_STEAM_EXTINGUISHING

int PARTICLE_STEAM_EXTINGUISHING = ParticleList.CAMP_STEAM_EXTINGUISH_START
protected

Definition at line 122 of file FireplaceBase.c.

Referenced by ParticleSteamExtinguishingStart().

◆ SMOKING_SLOT_COUNT

const int SMOKING_SLOT_COUNT = 4
protected

Definition at line 88 of file FireplaceBase.c.

Referenced by Cooling(), Heating(), and SmokingSlotsInUse().

◆ SMOKING_SPEED

const float SMOKING_SPEED = 1
protected

Definition at line 89 of file FireplaceBase.c.

◆ SOUND_FIRE_EXTINGUISHED

const string SOUND_FIRE_EXTINGUISHED = "ExtinguishByWaterEnd_SoundSet"
protected

Definition at line 139 of file FireplaceBase.c.

Referenced by SoundFireExtinguishedStart(), and SoundFireWetNoIgniteStart().

◆ SOUND_FIRE_EXTINGUISHING

const string SOUND_FIRE_EXTINGUISHING = "ExtinguishByWater_SoundSet"
protected

Definition at line 138 of file FireplaceBase.c.

Referenced by SoundFireExtinguishingStart().

◆ SOUND_FIRE_HEAVY

const string SOUND_FIRE_HEAVY = "HeavyFire_SoundSet"
protected

Definition at line 135 of file FireplaceBase.c.

Referenced by SoundFireHeavyStart().

◆ SOUND_FIRE_LIGHT

const string SOUND_FIRE_LIGHT = "LightFire_SoundSet"
protected

Definition at line 136 of file FireplaceBase.c.

Referenced by SoundFireLightStart().

◆ SOUND_FIRE_NO_FIRE

const string SOUND_FIRE_NO_FIRE = "NoFuelFire_SoundSet"
protected

Definition at line 137 of file FireplaceBase.c.

Referenced by SoundFireNoFireStart().

◆ TEMPERATURE_LOSS_MP_DEFAULT

const float TEMPERATURE_LOSS_MP_DEFAULT = 1.0
protected

min height of ceiling for fire to be ignited

Definition at line 70 of file FireplaceBase.c.

Referenced by FireplaceBase(), and RefreshFireplaceVisuals().

◆ TEMPERATURE_LOSS_MP_OVEN

const float TEMPERATURE_LOSS_MP_OVEN = 0.75
protected

Definition at line 72 of file FireplaceBase.c.

Referenced by RefreshFireplaceVisuals().

◆ TEMPERATURE_LOSS_MP_STONES

const float TEMPERATURE_LOSS_MP_STONES = 0.90
protected

Definition at line 71 of file FireplaceBase.c.

Referenced by RefreshFireplaceVisuals().

◆ TIMER_COOLING_UPDATE_INTERVAL

const int TIMER_COOLING_UPDATE_INTERVAL = 2
protected

update interval duration of heating process (seconds)

Definition at line 84 of file FireplaceBase.c.

Referenced by AddDamageToItemByFireEx(), Cooling(), and StartCooling().

◆ TIMER_HEATING_UPDATE_INTERVAL

const int TIMER_HEATING_UPDATE_INTERVAL = 3
protected

how much will temperature increase when attached on burning fireplace (degree Celsius)

Definition at line 83 of file FireplaceBase.c.

Referenced by AddDamageToItemByFireEx(), BuildingSuper::EEInit(), Heating(), and StartHeating().

◆ WET

◆ WIND