8 static const string FIREPOINT_ACTION_SELECTION =
"fireplace_action";
9 static const string FIREPOINT_FIRE_POSITION =
"fireplace_point";
10 static const string FIREPOINT_PLACE_ROT =
"fireplace_rot";
11 static const string FIREPOINT_SMOKE_POSITION =
"fireplace_smoke";
25 RegisterNetSyncVariableFloat(
"m_SmokePosX", 0, 0, 2 );
26 RegisterNetSyncVariableFloat(
"m_SmokePosY", 0, 0, 2 );
27 RegisterNetSyncVariableFloat(
"m_SmokePosZ", 0, 0, 2 );
28 RegisterNetSyncVariableInt(
"m_FirePointIndex", 0, 9 );
39 super.OnStoreSave( ctx );
45 ctx.
Write( m_SmokePosX );
46 ctx.
Write( m_SmokePosY );
47 ctx.
Write( m_SmokePosZ );
52 if ( !super.OnStoreLoad( ctx, version ) )
64 if ( !ctx.
Read( m_SmokePosX ) )
69 if ( !ctx.
Read( m_SmokePosY ) )
74 if ( !ctx.
Read( m_SmokePosZ ) )
90 int index_location = action_selection.
Length() - 1;
102 vector fire_point_pos = building.GetSelectionPositionMS( FIREPOINT_FIRE_POSITION + fire_point_index.
ToString() );
103 vector fire_point_rot = building.GetSelectionPositionMS( FIREPOINT_PLACE_ROT + fire_point_index.
ToString() );
104 fire_point_pos_world = building.ModelToWorld( fire_point_pos );
105 fire_point_rot_world = building.ModelToWorld( fire_point_rot );
112 for (
int i = 0; i < nearest_objects.Count(); ++i )
114 Object object = nearest_objects.Get( i );
116 if (
object.IsInherited( FireplaceIndoor ) )
127 m_SmokePosX = smoke_point_pos[0];
128 m_SmokePosY = smoke_point_pos[1];
129 m_SmokePosZ = smoke_point_pos[2];
137 return Vector( m_SmokePosX, m_SmokePosY, m_SmokePosZ );
162 super.EEItemAttached(item, slot_name);
171 bool edible_base_attached =
false;
174 case "DirectCookingA":
176 edible_base_attached =
true;
178 case "DirectCookingB":
180 edible_base_attached =
true;
182 case "DirectCookingC":
184 edible_base_attached =
true;
189 edible_base_attached =
true;
193 edible_base_attached =
true;
197 edible_base_attached =
true;
201 edible_base_attached =
true;
206 if (
GetGame().IsServer() && edible_base_attached)
211 if (edBase.GetFoodStage())
213 edBase.SetCookingTime(0);
223 super.EEItemDetached(item, slot_name);
237 case "DirectCookingA":
240 case "DirectCookingB":
243 case "DirectCookingC":
266 cooking_pot.RemoveAudioVisualsOnClient();
272 cauldron.RemoveAudioVisualsOnClient();
277 FryingPan frying_pan = FryingPan.Cast(item);
278 frying_pan.RemoveAudioVisualsOnClient();
301 return super.CanReceiveItemIntoCargo( item );
359 Param1<bool> failure;
ActionPlaceFireplaceIndoor m_FirePointIndex
void RefreshFireplaceVisuals()
protected int PARTICLE_SMALL_FIRE
protected ItemBase m_SmokingSlots[SMOKING_SLOT_COUNT]
protected void RemoveFromFireConsumables(FireConsumable fire_consumable)
protected bool IsFuel(ItemBase item)
Returns if item attached to fireplace is fuel.
protected int PARTICLE_FIRE_END
protected int PARTICLE_SMALL_SMOKE
protected FireConsumable GetFireConsumableByItem(ItemBase item)
protected int PARTICLE_FIRE_START
protected int PARTICLE_NORMAL_FIRE
protected bool m_RoofAbove
protected void AddToFireConsumables(ItemBase item)
protected int PARTICLE_STEAM_END
void StartFire(bool force_start=false)
void SetIgniteFailure(bool failure)
protected float m_LightDistance
protected bool IsKindling(ItemBase item)
Returns if item attached to fireplace is kindling.
protected Particle m_ParticleSmallSmoke
protected int PARTICLE_NORMAL_SMOKE
protected Particle m_ParticleNormalSmoke
void ClearCookingEquipment()
DEPRECATED.
protected ItemBase m_DirectCookingSlots[DIRECT_COOKING_SLOT_COUNT]
void PlayParticle(int particle_id=-1)
Method to tell the particle to start playing.
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
proto native void GetObjectsAtPosition3D(vector pos, float radius, out array< Object > objects, out array< CargoBase > proxyCargos)
Returns list of all objects in sphere "radius" around position "pos".
override bool CanRemoveFromHands(EntityAI player)
void SetSmokePointPosition(vector smoke_point_pos)
override void OnIgnitedTarget(EntityAI ignited_item)
override protected vector GetSmokeEffectPosition()
override void OnStoreSave(ParamsWriteContext ctx)
static int GetFirePointIndex(string action_selection)
override bool CanReceiveItemIntoCargo(EntityAI item)
protected float m_SmokePosZ
override bool CanBeIgnitedBy(EntityAI igniter=NULL)
override bool CanPutInCargo(EntityAI parent)
protected float m_SmokePosY
override bool IsIgnited()
override void ParticleNormalSmokeStart()
void SetFirePointIndex(int fire_point_index)
override void EEItemDetached(EntityAI item, string slot_name)
override void OnIgnitedThis(EntityAI fire_source)
override bool CanIgniteItem(EntityAI ignite_target=NULL)
override bool IsThisIgnitionSuccessful(EntityAI item_source=NULL)
override bool CanPutIntoHands(EntityAI parent)
override bool CanRemoveFromCargo(EntityAI parent)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override bool HasFlammableMaterial()
override void EEItemAttached(EntityAI item, string slot_name)
static bool CanPlaceFireplaceInSelectedSpot(Object building, int fire_point_index, out vector fire_point_pos_world, out vector fire_point_rot_world)
override void ParticleSmallSmokeStart()
override bool IsFireplaceIndoor()
protected float m_SmokePosX
static const int HOUSE_NORMAL_SMOKE
static const int HOUSE_SMALL_SMOKE
static const int HOUSE_FIRE_END
static const int HOUSE_NORMAL_FIRE
static const int HOUSE_FIRE_START
static const int HOUSE_FIRE_STEAM_2END
static const int HOUSE_SMALL_FIRE
Serialization general interface. Serializer API works with:
proto bool Write(void value_out)
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
proto native int ToInt()
Converts string to integer.
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.
proto native int Length()
Returns length of string.