DayZ 1.24
Loading...
Searching...
No Matches
OpenItem Class Reference

Static Private Member Functions

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.
 
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 'suffix' to the classname of the old 'item'.
 

Detailed Description

Definition at line 1 of file OpenItem.c.

Member Function Documentation

◆ OpenAndSwitch()

static void OpenItem::OpenAndSwitch ( ItemBase item_tool,
ItemBase item_target,
PlayerBase player,
float specialty_weight = 0 )
inlinestaticprivate

WIll open the 'item_target' by spawning a new entity and transferring item variables to the new one.

Definition at line 4 of file OpenItem.c.

5 {
7
8 if (item_tool.ConfigIsExisting("OpenItemSpillRange"))
9 item_tool.ConfigGetIntArray("OpenItemSpillRange", spill_range);
10 else
11 {
12 Debug.LogError("OpenItemSpillRange config parameter missing, default values used ! ");
13 Error("OpenItemSpillRange config parameter missing, default values used !");
14 spill_range.Insert(0);
15 spill_range.Insert(100);
16 }
18
20 }
Definition Debug.c:14
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.
Definition Debug.c:341
Definition EnMath.c:7
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...
Definition OpenItem.c:23
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

References Error(), Debug::LogError(), Math::RandomIntInclusive(), and SwitchItems().

Referenced by RecipeBase::Do().

◆ SwitchItems()

static void OpenItem::SwitchItems ( EntityAI old_item,
PlayerBase player,
float spill_modificator,
float specialty_weight )
inlinestaticprivate

Will switch the 'item' for a new game entity, the new entity's classname will be formed by adding the 'suffix' to the classname of the old 'item'.

Definition at line 23 of file OpenItem.c.

24 {
25 string old_name = old_item.GetType();
26 string new_name = old_name + "_Opened";
28 l.SetTransferParams(true, true, true, true);
29 MiscGameplayFunctions.TurnItemIntoItemEx(player, l);
30 }

Referenced by OpenAndSwitch().


The documentation for this class was generated from the following file: