Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
cacontinuousquantitybloodtransfer.c
Go to the documentation of this file.
2 {
3  override void CalcAndSetQuantity( ActionData action_data )
4  {
5  if ( GetGame().IsServer() )
6  {
7  if ( m_SpentUnits )
8  {
9  m_SpentUnits.param1 = m_SpentQuantity;
10  SetACData(m_SpentUnits);
11  }
12 
13  action_data.m_MainItem.AddQuantity( -m_SpentQuantity, false, false );
14 
15  ActionGiveBloodData action_data_b = ActionGiveBloodData.Cast( action_data );
16 
17  PlayerBase bloodtarget = PlayerBase.Cast( action_data.m_Target.GetObject() );
18  if ( !bloodtarget )
19  bloodtarget = action_data.m_Player;
20 
21 
22  if( BloodTypes.MatchBloodCompatibility(action_data_b.m_ItemBloodType, bloodtarget.GetStatBloodType().Get()) )
23  {
24  bloodtarget.AddHealth("", "Blood", m_SpentQuantity);
25  }
26 
27  }
28  }
29 }
GetGame
proto native CGame GetGame()
ActionGiveBloodData
Definition: actiongivebloodself.c:1
CAContinuousQuantityRepeat
Definition: cacontinuousquantityrepeat.c:1
PlayerBase
Definition: playerbaseclient.c:1
ActionData
Definition: actionbase.c:20
BloodTypes
Definition: bloodtype.c:1
CAContinuousQuantityBloodTransfer
Definition: cacontinuousquantitybloodtransfer.c:1