Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionplacefireplaceintobarrel.c
Go to the documentation of this file.
2 {
4  {
5  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
6  m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
8  m_Text = "#place_object";
9  }
10 
11  override void CreateConditionComponents()
12  {
15  }
16 
17  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
18  {
19  Object target_object = target.GetObject();
20 
21  if ( target_object && target_object.IsInherited( BarrelHoles_ColorBase ) )
22  {
23  BarrelHoles_ColorBase fireplace_barrel = BarrelHoles_ColorBase.Cast( target_object );
24 
25  if ( fireplace_barrel.IsOpen() && fireplace_barrel.GetInventory().AttachmentCount() == 0 && fireplace_barrel.IsCargoEmpty() )
26  {
27  return true;
28  }
29  }
30 
31  return false;
32  }
33 
34  override void OnExecuteServer( ActionData action_data )
35  {
36  FireplaceBase fireplace_in_hands = FireplaceBase.Cast( action_data.m_MainItem );
37  BarrelHoles_ColorBase fireplace_barrel = BarrelHoles_ColorBase.Cast( action_data.m_Target.GetObject() );
38 
39  auto lambda = new MoveEquipToExistingItemAndDestroyOldRootLambda(fireplace_in_hands, "", action_data.m_Player, fireplace_barrel);
40  action_data.m_Player.ServerReplaceItemInHandsWithNewElsewhere(lambda);
41 
42  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
43  }
44 }
ItemBase
Definition: inventoryitem.c:730
MoveEquipToExistingItemAndDestroyOldRootLambda
void MoveEquipToExistingItemAndDestroyOldRootLambda(EntityAI old_item, string new_item_type, PlayerBase player, EntityAI new_item)
Definition: miscgameplayfunctions.c:168
UASoftSkillsWeight
Definition: actionconstants.c:118
FireplaceBase
Definition: barrelholes_colorbase.c:1
UAMaxDistances
Definition: actionconstants.c:104
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
ActionPlaceFireplaceIntoBarrel
Definition: actionplacefireplaceintobarrel.c:1
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTNonRuined
Definition: cctnonruined.c:1
Object
Definition: objecttyped.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
ActionSingleUseBase
Definition: actionsingleusebase.c:41
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
BarrelHoles_ColorBase
Definition: barrelholes_blue.c:1