3 protected float m_SmokePosX;
4 protected float m_SmokePosY;
5 protected float m_SmokePosZ;
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";
13 void FireplaceIndoor()
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 ) )
88 static int GetFirePointIndex(
string action_selection )
90 int index_location = action_selection.Length() - 1;
91 return action_selection.Substring( index_location, 1 ).ToInt();
94 void SetFirePointIndex(
int fire_point_index )
99 static bool CanPlaceFireplaceInSelectedSpot(
Object building,
int fire_point_index, out
vector fire_point_pos_world, out
vector fire_point_rot_world )
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 );
110 GetGame().GetObjectsAtPosition3D( fire_point_pos_world, 0.25, nearest_objects, proxy_cargos );
112 for (
int i = 0; i < nearest_objects.Count(); ++i )
114 Object object = nearest_objects.Get( i );
116 if (
object.IsInherited( FireplaceIndoor ) )
125 void SetSmokePointPosition(
vector smoke_point_pos )
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 );
331 override bool CanIgniteItem(
EntityAI ignite_target = NULL )
341 override bool IsIgnited()
346 override void OnIgnitedTarget(
EntityAI ignited_item )
356 override bool IsThisIgnitionSuccessful(
EntityAI item_source = NULL )
359 Param1<bool> failure;
373 GetGame().RPCSingleParam(
this, FirePlaceFailure.WET, failure,
true );