19 RegisterNetSyncVariableBool(
"m_Openable.m_IsOpened");
20 RegisterNetSyncVariableBool(
"m_IsSoundSynchRemote");
21 RegisterNetSyncVariableBool(
"m_IsPlaceSound");
31 super.OnStoreSave( ctx );
38 if ( !super.OnStoreLoad( ctx, version ) )
42 if ( version >= 110 && !ctx.
Read( opened ) )
111 super.OnWasAttached(parent, slot_id);
118 super.OnWasDetached(parent, slot_id);
127 SetAnimationPhase(
"Lid",1);
128 SetAnimationPhase(
"Lid2",0);
132 SetAnimationPhase(
"Lid",0);
133 SetAnimationPhase(
"Lid2",1);
139 super.OnVariablesSynchronized();
188 ingredient =
ItemBase.Cast( GetInventory().FindAttachment(slot_id) );
196 ingredient =
ItemBase.Cast( GetInventory().FindAttachment(slot_id) );
204 ingredient =
ItemBase.Cast( GetInventory().FindAttachment(slot_id) );
212 ingredient =
ItemBase.Cast( GetInventory().FindAttachment(slot_id) );
221 ingredient =
ItemBase.Cast( GetInventory().FindAttachment(slot_id) );
229 ingredient =
ItemBase.Cast( GetInventory().FindAttachment(slot_id) );
231 ItemBase reactant =
ItemBase.Cast( GetInventory().FindAttachment(slot_id) );
232 if ( ingredient && reactant &&
GetQuantity() > 5000 )
239 ItemBase ingredientR =
ItemBase.Cast( GetInventory().FindAttachment(slot_id) );
241 ItemBase ingredientG =
ItemBase.Cast( GetInventory().FindAttachment(slot_id) );
243 ItemBase ingredientB =
ItemBase.Cast( GetInventory().FindAttachment(slot_id) );
244 if ( (ingredientR || ingredientG || ingredientB) &&
GetQuantity() > 10000)
264 ItemBase lime =
ItemBase.Cast( GetInventory().CreateInInventory(
"GardenLime") );
266 lime.SetQuantity(lime_quantity);
273 int item_count = GetInventory().GetCargo().GetItemCount();
278 for (
int i = 0; i < item_count; i++)
280 item = GetInventory().GetCargo().GetItem(i);
281 if ( item.IsPeltBase() )
283 pelt_count =
g_Game.ConfigGetInt(
"cfgVehicles " + item.GetType() +
" peltGain");
284 if ( pelt_count <= lime_amount )
287 lambda.SetTransferParams(
true,
true,
true);
288 player.ServerReplaceItemWithNew(lambda);
290 lime_amount -= pelt_count;
291 if ( lime_amount <= 0 )
303 if ( pelt_count > 0 )
312 int item_count = GetInventory().GetCargo().GetItemCount();
313 string item_name =
"";
316 for (
int i = 0; i < item_count; i++)
318 item = GetInventory().GetCargo().GetItem(i);
319 if ( item.IsClothing() )
321 if (
GetGame().ObjectIsKindOf (item,
"LeatherSack_Natural") )
323 item_name =
"Bag_LeatherSack_"+color;
325 else if (
GetGame().ObjectIsKindOf (item,
"LeatherStorageVest_Natural") )
327 item_name =
"Vest_LeatherStorage_"+color;
329 else if (
GetGame().ObjectIsKindOf (item,
"LeatherJacket_Natural") )
331 item_name =
"Top_LeatherJacket_"+color;
333 else if (
GetGame().ObjectIsKindOf (item,
"LeatherPants_Natural") )
335 item_name =
"Pants_LeatherPants_"+color;
337 else if (
GetGame().ObjectIsKindOf (item,
"LeatherMoccasinsShoes_Natural") )
339 item_name =
"Shoes_LeatherMoccasins_"+color;
341 else if (
GetGame().ObjectIsKindOf (item,
"LeatherHat_Natural") )
343 item_name =
"Hat_Leather_"+color;
345 if ( item_name !=
"" )
348 lambda.SetTransferParams(
true,
true,
true);
349 player.ServerReplaceItemWithNew(lambda);
353 if ( item_name !=
"" )
363 int bleach_amount = bleach.GetQuantity();
364 int item_count = GetInventory().GetCargo().GetItemCount();
365 string item_name =
"";
367 for (
int i = 0; i < item_count; i++)
369 item = GetInventory().GetCargo().GetItem(i);
370 if ( item.IsClothing() )
374 if ( (
GetGame().ObjectIsKindOf (item,
"TShirt_ColorBase") && !
GetGame().ObjectIsKindOf (item,
"TShirt_White") ) || (
GetGame().ObjectIsKindOf (item,
"Armband_ColorBase") && !
GetGame().ObjectIsKindOf (item,
"Armband_White") ) )
376 int index = item.GetType().IndexOf(
"_");
377 string itemtype = item.GetType().Substring( 0, index + 1 );
379 MiscGameplayFunctions.TurnItemIntoItem(itemIB,itemtype+
"White",player);
383 if (
GetGame().IsKindOf (item.GetDisplayName(),
"LeatherSack_ColorBase") )
385 item_name =
"LeatherSack_Natural";
387 else if (
GetGame().IsKindOf (item.GetDisplayName(),
"LeatherStorageVest_ColorBase") )
389 item_name =
"LeatherStorageVest_Natural";
391 else if (
GetGame().IsKindOf (item.GetDisplayName(),
"LeatherJacket_ColorBase") )
393 item_name =
"LeatherJacket_Natural";
395 else if (
GetGame().IsKindOf (item.GetDisplayName(),
"LeatherPants_ColorBase") )
397 item_name =
"LeatherPants_Natural";
399 else if (
GetGame().IsKindOf (item.GetDisplayName(),
"LeatherMoccasinsShoes_ColorBase") )
401 item_name =
"LeatherMoccasinsShoes_Natural";
403 else if (
GetGame().IsKindOf (item.GetDisplayName(),
"LeatherHat_ColorBase") )
405 item_name =
"LeatherHat_Natural";
407 if ( item_name !=
"" )
410 lambda.SetTransferParams(
true,
true,
true);
411 player.ServerReplaceItemWithNew(lambda);
424 bleach.SetQuantity(bleach_amount);
426 if ( item_name !=
"" )
439 int item_count = GetInventory().GetCargo().GetItemCount();
440 bool was_colored =
false;
443 r = rci.GetQuantity()/10;
448 g = gci.GetQuantity()/10;
453 b = bci.GetQuantity()/10;
456 for (
int i = 0; i < item_count; i++)
458 item = GetInventory().GetCargo().GetItem(i);
459 if ( item.IsClothing() )
461 if (
GetGame().ObjectIsKindOf (item,
"TShirt_White") ||
GetGame().ObjectIsKindOf (item,
"Armband_White") )
464 int index = itemIB.GetType().IndexOf(
"_");
465 string itemtype = itemIB.GetType().Substring( 0, index + 1 );
468 clambda.SetTransferParams(
true,
true,
true);
469 MiscGameplayFunctions.TurnItemIntoItemEx(player, clambda);
498 if ( !super.CanPutInCargo( parent ))
509 if ( !super.CanPutIntoHands( parent ))
521 return super.CanReceiveItemIntoCargo( item );
543 super.OnPlacementComplete( player, position, orientation );
550 return "placeBarrel_SoundSet";
589 {
r = rr;
g = gg;
b = bb;
a = aa; }
593 super.CopyOldPropertiesToNew(old_item, new_item);
599 new_item.SetObjectTexture(new_item.GetHiddenSelectionsData().GetHiddenSelectionIndex(
"personality" ), MiscGameplayFunctions.GetColorString(
r,
g,
b,
a));
602 ib.SetColor(
r*255,
g*255,
b*255,
a*255);
615 super.CopyOldPropertiesToNew(old_item, new_item);
624 Debug.
LogError(
"TanLeatherLambda: failed to create new item",
"static");
void AddAction(typename actionName)
void DeployableContainer_Base()
Container_Base m_HalfExtents
override float GetQuantity()
override bool IsBeingPlaced()
override void SetTakeable(bool pState)
void SetIsPlaceSound(bool is_place_sound)
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
bool IsSoundSynchRemote()
protected bool m_Initialized
class JsonUndergroundAreaTriggerData GetPosition
override void OnDebugSpawn()
protected ref RainProcurementComponentBarrel m_RainProcComponent
override bool CanReleaseCargo(EntityAI attachment)
void TanPelts(ItemBase lime, PlayerBase player)
override void OnStoreSave(ParamsWriteContext ctx)
void SoundBarrelOpenPlay()
override bool CanReceiveItemIntoCargo(EntityAI item)
void ColourLeatherClothes(ItemBase color_source, PlayerBase player, string color)
void ColourClothes(ItemBase rci, ItemBase gci, ItemBase bci, PlayerBase player)
void Lock(float actiontime)
override bool CanPutInCargo(EntityAI parent)
void SoundBarrelClosePlay()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
void DetermineAction(PlayerBase player)
override int GetDamageSystemVersionChange()
override string GetPlaceSoundset()
ref RainProcurementManager m_RainProcurement
override void OnWasDetached(EntityAI parent, int slot_id)
override bool CanPutIntoHands(EntityAI parent)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
private ref Timer m_BarrelOpener
protected ref OpenableBehaviour m_Openable
override void OnWasAttached(EntityAI parent, int slot_id)
override void OnVariablesSynchronized()
protected void UpdateVisualState()
override bool CanDetachAttachment(EntityAI parent)
void ProduceFertilizer(ItemBase guts, ItemBase plant, PlayerBase player)
override float GetLiquidThroughputCoef()
void BleachClothes(ItemBase bleach, PlayerBase player)
override void SetActions()
override void CopyOldPropertiesToNew(notnull EntityAI old_item, EntityAI new_item)
void ColourClothesLambda(EntityAI old_item, string new_item_type, PlayerBase player, int rr, int gg, int bb, int aa)
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
void StopRainProcurement()
Called on server to queue rain procurement removal (on next cycle end)
void StartRainProcurement()
Called on server to queue rain procurement (on next cycle end)
DEPRECATED, done through the RainProcurementHandler / component instead.
Manager class for managing Effect (EffectParticle, EffectSound)
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Serialization general interface. Serializer API works with:
proto bool Write(void value_out)
proto bool Read(void value_in)
override void CopyOldPropertiesToNew(notnull EntityAI old_item, EntityAI new_item)
void TanLeatherLambda(EntityAI old_item, string new_item_type, PlayerBase player, int pelt_count)
proto native CGame GetGame()
const int BAREL_LIME_PER_PELT
const float BAREL_LIME_PER_PLANT
const int BAREL_BLEACH_PER_CLOTH
const float LIQUID_THROUGHPUT_BARREL
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float Floor(float f)
Returns floor of value.