DayZ 1.24
Loading...
Searching...
No Matches
OpenAndSwitchLambda Class Reference
Inheritance diagram for OpenAndSwitchLambda:
[legend]
Collaboration diagram for OpenAndSwitchLambda:
[legend]

Private Member Functions

void OpenAndSwitchLambda (EntityAI old_item, string new_item_type, PlayerBase player, float spill_modificator, float specialty_weight)
 
override void CopyOldPropertiesToNew (notnull EntityAI old_item, EntityAI new_item)
 
override void OnSuccess (EntityAI new_item)
 

Private Attributes

float m_SpillModifier
 
float m_SpecialtyWeight
 

Detailed Description

Definition at line 34 of file OpenItem.c.

Constructor & Destructor Documentation

◆ OpenAndSwitchLambda()

void OpenAndSwitchLambda::OpenAndSwitchLambda ( EntityAI old_item,
string new_item_type,
PlayerBase player,
float spill_modificator,
float specialty_weight )
inlineprivate

Member Function Documentation

◆ CopyOldPropertiesToNew()

override void OpenAndSwitchLambda::CopyOldPropertiesToNew ( notnull EntityAI old_item,
EntityAI new_item )
inlineprivate

Definition at line 40 of file OpenItem.c.

41 {
42 super.CopyOldPropertiesToNew(old_item, new_item);
43 }

◆ OnSuccess()

override void OpenAndSwitchLambda::OnSuccess ( EntityAI new_item)
inlineprivate

Definition at line 45 of file OpenItem.c.

46 {
47 super.OnSuccess(new_item);
48
50 if (new_item)
51 {
52 float quantity_old = ib.GetQuantity();
54 spill_amount = m_Player.GetSoftSkillsManager().SubtractSpecialtyBonus(spill_amount, m_SpecialtyWeight);
56
57 Debug.Log("quantity before spill: " + quantity_old.ToString());
58 Debug.Log("spill_amount: " + spill_amount.ToString());
59 Debug.Log("quantity_new: " + quantity_new.ToString());
60
61 ib.SetQuantity(quantity_new);
62 }
63 }
DayZPlayer m_Player
Definition Hand_Events.c:42
Definition Debug.c:14
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.
Definition Debug.c:133

References Debug::Log(), m_Player, m_SpecialtyWeight, and m_SpillModifier.

Member Data Documentation

◆ m_SpecialtyWeight

float OpenAndSwitchLambda::m_SpecialtyWeight
private

Definition at line 37 of file OpenItem.c.

Referenced by OnSuccess(), and OpenAndSwitchLambda().

◆ m_SpillModifier

float OpenAndSwitchLambda::m_SpillModifier
private

Definition at line 36 of file OpenItem.c.

Referenced by OnSuccess(), and OpenAndSwitchLambda().


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