8 if( item_tool.ConfigIsExisting(
"OpenItemSpillRange") )
10 item_tool.ConfigGetIntArray(
"OpenItemSpillRange", spill_range );
14 Debug.
LogError(
"OpenItemSpillRange config parameter missing, default values used ! ");
15 Error(
"OpenItemSpillRange config parameter missing, default values used !");
16 spill_range.Insert(0);
17 spill_range.Insert(100);
27 string old_name = old_item.GetType();
28 string new_name = old_name +
"_Opened";
30 l.SetTransferParams(
true,
true,
true,
true);
31 MiscGameplayFunctions.TurnItemIntoItemEx(player, l);
44 super.CopyOldPropertiesToNew(old_item, new_item);
49 super.OnSuccess(new_item);
54 float quantity_old = ib.GetQuantity();
56 float quantity_new = quantity_old - spill_amount;
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.
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
void OpenAndSwitchLambda(EntityAI old_item, string new_item_type, PlayerBase player, float spill_modificator, float specialty_weight)
override void OnSuccess(EntityAI new_item)
override void CopyOldPropertiesToNew(notnull EntityAI old_item, EntityAI new_item)
static void SwitchItems(EntityAI old_item, PlayerBase player, float spill_modificator, float specialty_weight)
Will switch the 'item' for a new game entity, the new entity's classname will be formed by adding the...
static void OpenAndSwitch(ItemBase item_tool, ItemBase item_target, PlayerBase player, float specialty_weight=0)
WIll open the 'item_target' by spawning a new entity and transferring item variables to the new one.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString(bool simple=true)
void Error(string err)
Messagebox with error message.
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].