4 static const string SLOT_TEXTURE_DIGGED_WET_LIME =
"dz\\gear\\cultivation\\data\\soil_digged_wet_lime_CO.paa";
5 static const string SLOT_TEXTURE_DIGGED_WET_PLANT =
"dz\\gear\\cultivation\\data\\soil_digged_wet_plant_CO.paa";
8 static const string SLOT_MATERIAL_WET =
"dz\\gear\\cultivation\\data\\soil_cultivated_wet.rvmat";
9 static const string SLOT_MATERIAL_DRY =
"dz\\gear\\cultivation\\data\\soil_cultivated.rvmat";
11 static const string SLOT_MATERIAL_LIMED_WET =
"dz\\gear\\cultivation\\data\\soil_cultivated_limed_wet.rvmat";
12 static const string SLOT_MATERIAL_LIMED_DRY =
"dz\\gear\\cultivation\\data\\soil_cultivated_limed.rvmat";
13 static const string SLOT_MATERIAL_COMPOST_WET =
"dz\\gear\\cultivation\\data\\soil_cultivated_compost_wet.rvmat";
14 static const string SLOT_MATERIAL_COMPOST_DRY =
"dz\\gear\\cultivation\\data\\soil_cultivated_compost.rvmat";
17 private static const string SLOT_SELECTION_DIGGED_PREFIX =
"seedbase_";
18 private static const string SLOT_SELECTION_COVERED_PREFIX =
"slotCovered_";
19 private static const string SLOT_MEMORY_POINT_PREFIX =
"slot_";
20 private static const string SLOT_SEEDBASE_PREFIX =
"seedbase_";
22 private static const int CHECK_RAIN_INTERVAL = 15;
23 private static const float CREATE_PLANT_DELAY = 1000.0;
24 private static const float RAIN_INTENSITY_THRESHOLD = 0.05;
27 protected int m_SlotFertilityState = 0;
28 protected int m_SlotWateredState = 0;
29 protected int m_MaxWateredStateVal = 0;
31 protected int m_SlotState = 0;
41 protected float m_DefaultFertility = 1;
48 RegisterNetSyncVariableInt(
"m_SlotState");
49 RegisterNetSyncVariableInt(
"m_SlotFertilityState");
50 RegisterNetSyncVariableInt(
"m_SlotWateredState");
52 RegisterNetSyncVariableInt(
"m_SlotWaterBitmap0");
53 RegisterNetSyncVariableInt(
"m_SlotWaterBitmap1");
54 RegisterNetSyncVariableInt(
"m_SlotWaterBitmap2");
56 RegisterNetSyncVariableInt(
"m_SlotFertilizerBitmap0");
57 RegisterNetSyncVariableInt(
"m_SlotFertilizerBitmap1");
58 RegisterNetSyncVariableInt(
"m_SlotFertilizerBitmap2");
65 for (
int i = 1; i <= GetGardenSlotsCount(); ++i)
68 string input = SLOT_SEEDBASE_PREFIX + i.ToString();
69 string output = SLOT_MEMORY_POINT_PREFIX;
72 output = output +
"0";
74 output = output + i.ToString();
76 m_map_slots.Set(input, output);
80 SetMaxWaterStateVal();
90 if (
GetGame() && m_CheckRainTimer)
92 m_CheckRainTimer.Stop();
93 m_CheckRainTimer = null;
99 super.OnVariablesSynchronized();
106 if (!m_Slots || m_Slots.Count() == 0)
110 int slotsCount = GetGardenSlotsCount();
111 for (
int i = 0; i < slotsCount; i++)
113 Slot slot = m_Slots.Get(i);
116 int fertilityState = (m_SlotFertilityState >> i) & 1;
117 slot.SetFertilityState(fertilityState);
119 int wateredState = (m_SlotWateredState >> i) & 1;
120 slot.SetWateredState(wateredState);
122 int waterQuantity = GetWaterQuantity(i);
123 slot.SetWater(waterQuantity);
125 int fertilizerQuantity = GetFertilizerQuantity(i);
126 slot.SetFertilizerQuantity(fertilizerQuantity);
128 int slotState = GetSlotState(i);
129 slot.SetState(slotState);
133 override bool HasProxyParts()
140 return EInventoryIconVisibility.HIDE_VICINITY;
143 void SetBaseFertility(
float value)
145 m_DefaultFertility = value;
148 float GetBaseFertility()
150 return m_DefaultFertility;
158 void InitializeSlots()
161 int slots_count = GetGardenSlotsCount();
163 for (
int i = 0; i < slots_count; i++)
165 Slot slot =
new Slot(GetBaseFertility());
166 slot.SetSlotIndex(i);
168 string name =
"SeedBase_" + i1;
170 slot.SetSlotId(slotID);
171 slot.SetGarden(
this);
172 slot.SetState(eGardenSlotState.STATE_DIGGED);
173 m_Slots.Insert(slot);
175 SetWaterQuantity(i, 0);
176 SetFertilizerQuantity(i, 0);
182 void SetMaxWaterStateVal()
186 for (
int i = 0; i < m_Slots.Count(); i++ )
188 state += 1 *
Math.Pow( 2, i );
191 m_MaxWateredStateVal = state;
194 int GetMaxWaterStateVal()
196 return m_MaxWateredStateVal;
204 if (!super.OnStoreLoad(ctx, version))
210 ctx.Read(some_value);
213 int slots_count = GetGardenSlotsCount();
214 for (
int i = 0; i < slots_count; i++)
216 Slot slot = m_Slots.Get(i);
217 if (!slot.OnStoreLoadCustom(ctx, version))
220 float waterQuantity = slot.GetWater();
221 SetWaterQuantity(i, waterQuantity);
223 float fertilizerQuantity = slot.GetFertilizerQuantity();
224 SetFertilizerQuantity(i, fertilizerQuantity);
227 if ( version >= 119 )
229 if(!ctx.Read( m_SlotFertilityState ))
233 if ( version >= 120 )
235 if (!ctx.Read( m_SlotWateredState ))
244 super.EEOnAfterLoad();
255 int slotsCount = GetGardenSlotsCount();
256 for (
int i = 0; i < slotsCount; ++i)
258 UpdateSlotTexture(i);
261 if (
g_Game.IsDedicatedServer())
268 super.OnStoreSave( ctx );
270 int slots_count = GetGardenSlotsCount();
272 for (
int i = 0; i < slots_count; i++ )
274 Slot slot = m_Slots.Get( i );
276 slot.OnStoreSaveCustom( ctx );
279 ctx.Write(m_SlotFertilityState);
281 ctx.Write( m_SlotWateredState );
286 Debug.Log(
"PRINT ALL SLOTS FROM...");
288 int slots = GetInventory().GetAttachmentSlotsCount();
289 Debug.Log(
"Nb Slots : " + slots);
291 for (
int i = 0; i < slots ; i++ )
293 Slot slot = m_Slots.Get(i);
294 Debug.Log(
"i : " + i);
295 Debug.Log(
"Slot : " + slot);
297 float slot_fertility = slot.GetFertility();
298 float slot_fertility_usage = slot.GetFertilityMax();
299 string slot_fertility_type = slot.GetFertilityType();
300 float slot_water = slot.GetWater();
301 float slot_water_usage = slot.GetWaterUsage();
302 ItemBase slot_seed = slot.GetSeed();
303 ItemBase slot_plant = slot.GetPlant();
305 float slot_slot_Index = slot.GetSlotIndex();
306 int slot_slot_ID = slot.GetSlotId();
307 int slot_wateredState = slot.GetWateredState();
308 int slot_FertilityState = slot.GetFertilityState();
310 Debug.Log(
"Fertility : " + slot_fertility);
311 Debug.Log(
"Fertility Usage : " + slot_fertility_usage);
312 Debug.Log(
"Fertility Type : " + slot_fertility_type);
313 Debug.Log(
"Fertility State : " + slot_FertilityState);
314 Debug.Log(
"Water : " + slot_water);
315 Debug.Log(
"Water Usage : " + slot_water_usage);
316 Debug.Log(
"Watered State : " +
typename.EnumToString(eWateredState, slot_wateredState));
317 Debug.Log(
"Seed : " + slot_seed);
318 Debug.Log(
"Plant : " + slot_plant);
319 if (slot_plant && PlantBase.Cast(slot_plant))
320 PlantBase.Cast(slot_plant).PrintValues();
321 Debug.Log(
"State : " + slot_state);
322 Debug.Log(
"Slot Index : " + slot_slot_Index);
323 Debug.Log(
"Slot ID : " + slot_slot_ID);
324 Debug.Log(
"///////////////////////////");
327 Debug.Log(
"END OF ALL SLOTS FOR...");
328 Debug.Log(
"" +
this);
331 override bool CanPutInCargo(
EntityAI parent )
333 if ( !super.CanPutInCargo(parent) ) {
return false;}
337 override bool CanPutIntoHands(
EntityAI parent )
339 if ( !super.CanPutIntoHands( parent ) )
351 int GetGardenSlotsCount()
356 bool CanPlantSeed(
string selection_component)
358 Slot slot = GetSlotBySelection(selection_component);
359 if (slot != NULL && slot.GetState() == eGardenSlotState.STATE_DIGGED)
370 string ConvertAttSlotToPlantSlot(
string attach_slot)
373 if ( m_map_slots.Contains(attach_slot) )
375 string return_value = m_map_slots.Get(attach_slot);
384 super.EEItemAttached(item, slot_name);
386 string path =
string.Format(
"CfgVehicles %1 Horticulture PlantType", item.GetType());
387 bool IsItemSeed =
GetGame().ConfigIsExisting(
path);
391 string converted_slot_name;
394 int index = GetSlotIndexByAttachmentSlot(slot_name);
398 converted_slot_name = SLOT_MEMORY_POINT_PREFIX +
"0" + index.ToString();
402 converted_slot_name = SLOT_MEMORY_POINT_PREFIX + index.ToString();
406 PlantSeed(
ItemBase.Cast(item), converted_slot_name);
408 else if (
g_Game.IsClient())
410 Slot slot = GetSlotByIndex(GetSlotIndexByAttachmentSlot(slot_name) - 1);
413 slot.SetPlant(PlantBase.Cast(item));
414 slot.SetState(eGardenSlotState.STATE_PLANTED);
421 super.EEItemDetached(item, slot_name);
425 string path =
string.Format(
"CfgVehicles %1 Horticulture PlantType", item.GetType());
426 bool IsItemSeed =
GetGame().ConfigIsExisting(
path);
428 string converted_slot_name = ConvertAttSlotToPlantSlot(slot_name);
429 Slot slot = GetSlotBySelection(converted_slot_name);
438 slot.SetState(eGardenSlotState.STATE_DIGGED);
443 void PlantSeed(
ItemBase seed,
string selection_component )
445 int slot_index = GetSlotIndexBySelection( selection_component );
447 if ( slot_index != -1 )
449 PluginHorticulture module_horticulture = PluginHorticulture.Cast(
GetPlugin( PluginHorticulture ) );
450 string plant_type = module_horticulture.GetPlantType( seed );
452 Slot slot = m_Slots.Get( slot_index );
453 slot.SetState(eGardenSlotState.STATE_PLANTED);
454 slot.m_PlantType = plant_type;
457 if ( !slot.NeedsWater() || slot.GetWateredState() == eWateredState.WET)
460 if (slot.GetWateredState() == eWateredState.WET && slot.NeedsWater())
462 int waterMax = slot.GetWaterMax();
463 slot.SetWater(waterMax);
474 void CreatePlant(Slot slot)
481 seed.UnlockFromParent();
484 PlantBase plant = PlantBase.Cast( GetInventory().CreateAttachmentEx(slot.m_PlantType, slot.GetSlotId()));
485 int slot_index = slot.GetSlotIndex();
486 slot.SetPlant(plant);
487 slot.SetState(eGardenSlotState.STATE_PLANTED);
488 plant.Init(
this, slot.GetFertility(), slot.m_HarvestingEfficiency, slot.GetWater());
489 plant.LockToParent();
494 void SetSlotState(
int slotIndex,
int value)
497 int shift = slotIndex * 2;
498 int mask = 3 << shift;
499 int currentState = (m_SlotState & mask) >> shift;
502 m_SlotState &= ~mask;
505 m_SlotState |= (value << shift);
507 if (
g_Game.IsServer() && currentState != value)
511 int GetSlotState(
int slotIndex)
513 int shift = slotIndex * 2;
514 int mask = 3 << shift;
515 int value = (m_SlotState & mask) >> shift;
519 void SlotWaterStateUpdate( Slot slot )
521 int idx = slot.GetSlotIndex();
523 int currentState = (m_SlotWateredState >> idx) & 1;
524 int newState = slot.GetWateredState();
526 m_SlotWateredState &= ~mask;
529 m_SlotWateredState |= (newState << idx);
531 if ((
g_Game.IsServer() || !
g_Game.IsMultiplayer()) && currentState != newState)
533 UpdateSlotTexture(slot.GetSlotIndex());
540 void SlotFertilityStateUpdate(Slot slot)
542 int idx = slot.GetSlotIndex();
544 int currentState = (m_SlotFertilityState >> idx) & 1;
545 int newState = slot.GetFertilityState();
548 m_SlotFertilityState &= ~mask;
551 m_SlotFertilityState |= (newState << idx);
553 if ((
g_Game.IsServer() || !
g_Game.IsMultiplayer()) && currentState != newState)
555 UpdateSlotTexture(slot.GetSlotIndex());
563 void UpdateSlotTexture(
int slot_index )
565 if (!m_Slots || m_Slots.Count() - 1 < slot_index)
568 Slot slot = m_Slots.Get( slot_index );
571 if ( slot.IsDigged() || slot.IsPlanted() )
573 string str_hide = SLOT_SELECTION_COVERED_PREFIX + (slot_index + 1).
ToStringLen(2);
574 string str_show = SLOT_SELECTION_DIGGED_PREFIX + (slot_index + 1).
ToStringLen(1);
576 HideSelection( str_hide );
577 ShowSelection( str_show );
580 if ( slot.GetFertilityState() ==
eFertlityState.FERTILIZED && slot.GetFertilityType() !=
"" )
582 SetSlotTextureFertilized( slot_index, slot.GetFertilityType() );
586 SetSlotTextureDigged( slot_index );
590 void SetSlotTextureDigged(
int slot_index )
594 string str_digged = SLOT_SELECTION_DIGGED_PREFIX + (slot_index + 1).
ToStringLen(1);
596 ShowSelection( str_digged );
597 string texture = textures.Get(0);
598 SetObjectTexture( slot_index, texture );
600 Slot slot = m_Slots.Get( slot_index );
602 if ( slot.GetWateredState() == 0 )
605 SetObjectMaterial( slot_index, SLOT_MATERIAL_DRY );
610 SetObjectMaterial( slot_index, SLOT_MATERIAL_WET );
614 void SetSlotTextureFertilized(
int slot_index,
string item_type )
618 int tex_id =
GetGame().ConfigGetInt(
string.Format(
"cfgVehicles %1 Horticulture TexId", item_type) );
620 string str_show = SLOT_SELECTION_DIGGED_PREFIX + (slot_index + 1).
ToStringLen(2);
622 ShowSelection( str_show );
623 SetObjectTexture( slot_index, textures.Get(tex_id) );
625 Slot slot = m_Slots.Get( slot_index );
627 int slot_index_offset = 0;
630 if ( slot.GetWateredState() == 0 )
633 if ( slot.GetFertilityType() ==
"GardenLime" )
635 SetObjectMaterial( slot_index + slot_index_offset, SLOT_MATERIAL_LIMED_DRY );
637 else if ( slot.GetFertilityType() ==
"PlantMaterial" )
639 SetObjectMaterial( slot_index + slot_index_offset, SLOT_MATERIAL_COMPOST_DRY );
645 if ( slot.GetFertilityType() ==
"GardenLime" )
647 SetObjectMaterial( slot_index + slot_index_offset, SLOT_MATERIAL_LIMED_WET );
649 else if ( slot.GetFertilityType() ==
"PlantMaterial" )
651 SetObjectMaterial( slot_index + slot_index_offset, SLOT_MATERIAL_COMPOST_WET );
656 void RemoveSlot(
int index)
660 Slot slot = m_Slots.Get(index);
661 PlantBase plant = slot.GetPlant();
663 if (plant && !plant.IsPendingDeletion())
665 plant.UnlockFromParent();
666 plant.m_MarkForDeletion =
true;
670 slot.Init(GetBaseFertility());
672 int idx = slot.GetSlotIndex();
676 m_SlotFertilityState &= ~mask;
677 m_SlotWateredState &= ~mask;
680 m_SlotFertilityState |= (slot.GetFertilityState() << idx);
681 m_SlotWateredState |= (slot.GetWateredState() << idx);
684 SetWaterQuantity(index, 0);
685 SetFertilizerQuantity(index, 0);
689 HideSelection(SLOT_SELECTION_COVERED_PREFIX + (index + 1).
ToStringLen(2));
690 UpdateSlotTexture(idx);
696 void RemoveSlotPlant(
Object plant )
698 int index = GetSlotIndexByPlant( plant );
705 Slot GetSlotBySelection(
string selection_component )
707 int slot_index = GetSlotIndexBySelection( selection_component );
709 if ( slot_index > -1 )
711 return m_Slots.Get( slot_index );
720 int GetSlotIndexBySelection(
string selection_component )
724 if ( m_Slots != NULL )
726 string selection_component_lower = selection_component;
727 selection_component_lower.ToLower();
729 int start = selection_component_lower.IndexOf( SLOT_MEMORY_POINT_PREFIX );
733 start += SLOT_MEMORY_POINT_PREFIX.Length();
735 int length = selection_component.Length();
739 int length_add = length - end;
740 int length_from_end = 2 + length_add;
741 string num_str = selection_component.Substring( start, length_from_end );
742 slot_index = num_str.ToInt();
744 slot_index = slot_index - 1;
752 int GetSlotIndexByAttachmentSlot(
string att_slot )
756 int start =
"SeedBase_".Length();
757 int end = att_slot.Length();
758 int len = end - start;
760 string num_str = att_slot.Substring( start, len );
761 slot_index = num_str.ToInt();
766 int GetSlotIndexByPlant(
Object plant )
768 if ( m_Slots != NULL )
770 for (
int i = 0; i < m_Slots.Count(); i++ )
772 PlantBase found_plant = m_Slots.Get(i).GetPlant();
774 if ( found_plant == plant )
784 int GetNearestSlotIDByState(
vector position,
int slot_state)
786 float nearest_distance = 1000.0;
787 int nearest_slot_index = -1;
788 int slots_count = GetGardenSlotsCount();
789 for (
int i = 0; i < slots_count; i++)
791 Slot slot = m_Slots.Get(i);
792 vector slot_pos = GetSlotPosition(i);
793 float current_distance =
vector.Distance(position, slot_pos);
795 if (current_distance < nearest_distance)
797 if (slot != NULL && slot.GetState() == slot_state)
799 nearest_distance = current_distance;
800 nearest_slot_index = i;
805 return nearest_slot_index;
808 vector GetSlotPosition(
int index )
810 string memory_point = SLOT_MEMORY_POINT_PREFIX + (index + 1).
ToStringLen(2);
811 vector pos = this.GetSelectionPositionMS( memory_point );
813 return this.ModelToWorld( pos );
816 void CheckRainStart()
818 if ( !m_CheckRainTimer )
821 m_CheckRainTimer.Run( CHECK_RAIN_INTERVAL,
this,
"CheckRainTick", NULL,
true );
827 float wetness = rainIntensity * 20 * CHECK_RAIN_INTERVAL;
829 if (rainIntensity > 1 || rainIntensity < 0)
833 wetness = -0.1 * CHECK_RAIN_INTERVAL;
836 if (rainIntensity > RAIN_INTENSITY_THRESHOLD)
840 int slotsCount = GetGardenSlotsCount();
841 for (
int i = 0; i < slotsCount; i++)
845 Slot slot = m_Slots.Get(i);
848 slot.GiveWater(wetness *
Math.RandomFloat01());
861 Slot GetSlotByIndex(
int index )
863 return m_Slots.Get(index);
873 void SetFertilizerBitmapByIndex(
int index,
int value)
878 m_SlotFertilizerBitmap0 = value;
881 m_SlotFertilizerBitmap1 = value;
884 m_SlotFertilizerBitmap2 = value;
889 int GetFertilizerBitmapByIndex(
int index)
894 return m_SlotFertilizerBitmap0;
896 return m_SlotFertilizerBitmap1;
898 return m_SlotFertilizerBitmap2;
903 void SetWaterBitmapByIndex(
int index,
int value)
908 m_SlotWaterBitmap0 = value;
911 m_SlotWaterBitmap1 = value;
914 m_SlotWaterBitmap2 = value;
919 int GetWaterBitmapByIndex(
int index)
924 return m_SlotWaterBitmap0;
926 return m_SlotWaterBitmap1;
928 return m_SlotWaterBitmap2;
933 void SetWaterQuantity(
int slotIndex,
int value)
936 int slotsPerInt = 32 / bitsPerSlot;
938 int groupIndex = slotIndex / slotsPerInt;
939 int bitOffset = (slotIndex % slotsPerInt) * bitsPerSlot;
941 int mask = 255 << bitOffset;
942 value =
Math.Clamp(value, 0, 200);
944 int temp = GetWaterBitmapByIndex(groupIndex);
946 temp |= (value << bitOffset);
947 SetWaterBitmapByIndex(groupIndex, temp);
950 int GetWaterQuantity(
int slotIndex)
953 int slotsPerInt = 32 / bitsPerSlot;
955 int groupIndex = slotIndex / slotsPerInt;
956 int bitOffset = (slotIndex % slotsPerInt) * bitsPerSlot;
958 int value = GetWaterBitmapByIndex(groupIndex);
959 return (value >> bitOffset) & 255;
962 void SetFertilizerQuantity(
int slotIndex,
int value)
965 int slotsPerInt = 32 / bitsPerSlot;
967 int groupIndex = slotIndex / slotsPerInt;
968 int bitOffset = (slotIndex % slotsPerInt) * bitsPerSlot;
970 int mask = 255 << bitOffset;
971 value =
Math.Clamp(value, 0, 200);
973 int temp = GetFertilizerBitmapByIndex(groupIndex);
975 temp |= (value << bitOffset);
976 SetFertilizerBitmapByIndex(groupIndex, temp);
979 int GetFertilizerQuantity(
int slotIndex)
982 int slotsPerInt = 32 / bitsPerSlot;
984 int groupIndex = slotIndex / slotsPerInt;
985 int bitOffset = (slotIndex % slotsPerInt) * bitsPerSlot;
987 int value = GetFertilizerBitmapByIndex(groupIndex);
988 return (value >> bitOffset) & 255;
993 bool IsCorrectFertilizer(
ItemBase item,
string selection_component )
995 Slot slot = GetSlotBySelection( selection_component );
999 string item_type = item.GetType();
1001 if ( slot.GetFertilityType() ==
"" || slot.GetFertilityType() == item_type )
1011 void UpdateTexturesOnAllSlots()
1013 int slots_count = GetGardenSlotsCount();
1014 for (
int i = 0; i < slots_count; ++i)
1016 UpdateSlotTexture(i);
1021 bool NeedsFertilization(
string selection_component)
1023 Slot slot = GetSlotBySelection(selection_component);
1035 [
Obsolete(
"CAContinuousFertilizeGardenSlot::FertilizeSlot is used now instead.")]
1036 void Fertilize(
PlayerBase player,
ItemBase item,
float consumed_quantity,
string selection_component )
1038 Slot slot = GetSlotBySelection( selection_component );
1042 string item_type = item.GetType();
1044 if ( slot.GetFertilityType() ==
"" || slot.GetFertilityType() == item_type )
1046 slot.SetFertilityType(item_type);
1048 float add_energy_to_slot =
GetGame().ConfigGetFloat(
string.Format(
"cfgVehicles %1 Horticulture AddEnergyToSlot", item_type) );
1049 slot.m_FertilizerUsage =
GetGame().ConfigGetFloat(
string.Format(
"cfgVehicles %1 Horticulture ConsumedQuantity", item_type) );
1051 float coef =
Math.Clamp( consumed_quantity / slot.m_FertilizerUsage, 0.0, 1.0 );
1052 add_energy_to_slot = coef * add_energy_to_slot;
1054 slot.m_FertilizerQuantity += consumed_quantity;
1055 slot.m_Fertility += add_energy_to_slot;
1057 if ( slot.GetFertilizerQuantity() >= slot.GetFertilizerQuantityMax() )
1059 int slot_index = slot.GetSlotIndex();
1061 if (slot_index > -1)
1063 UpdateSlotTexture( slot_index );
1066 m_SlotFertilityState |= slot.GetFertilityState() << slot.GetSlotIndex();
1072 slot.SetFertilizerQuantity(0);
1073 slot.SetFertilityType(
"");
1081 void WaterAllSlots()
1083 for (
int i = 0; i < m_Slots.Count(); i++)
1085 Slot slot = m_Slots[i];
1089 slot.SetWateredState(eWateredState.WET);
1090 UpdateSlotTexture(slot.GetSlotIndex());
1091 m_SlotWateredState |= eWateredState.WET << slot.GetSlotIndex();
void AddAction(typename actionName)
override void EEItemDetached(EntityAI item, string slot_name)
override void EEItemAttached(EntityAI item, string slot_name)
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto native Weather GetWeather()
Returns weather controller object.
provides access to slot configuration
ref array< ref Slot > m_Slots
int m_SlotFertilizerBitmap1
int m_SlotFertilizerBitmap0
ref Timer m_CheckRainTimer
int m_SlotFertilizerBitmap2
Serialization general interface. Serializer API works with:
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
override void OnVariablesSynchronized()
override int GetHideIconMask()
string ToStringLen(int len)
Integer to string with fixed length, padded with zeroes.
override bool CanRemoveFromHands(EntityAI parent)
proto native CGame GetGame()
override void SyncSlots()
GardenPlotGreenhouse GardenPlot EOnInit(IEntity other, int extra)
void Obsolete(string msg="")
EntityEvent
Entity events for event-mask, or throwing event from code.
class JsonUndergroundAreaTriggerData GetPosition
override void EEOnAfterLoad()
void OnStoreSave(ParamsWriteContext ctx)
PluginBase GetPlugin(typename plugin_type)