Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
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;
7 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_LOW;
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 ClearInventoryReservationEx(action_data);
37 FireplaceBase fireplace_in_hands = FireplaceBase.Cast( action_data.m_MainItem );
38 BarrelHoles_ColorBase fireplace_barrel = BarrelHoles_ColorBase.Cast( action_data.m_Target.GetObject() );
39 auto lambda = new MoveEquipToExistingItemAndDestroyOldRootLambda(fireplace_in_hands, "", action_data.m_Player, fireplace_barrel);
40 action_data.m_Player.ServerReplaceItemInHandsWithNewElsewhere(lambda);
41 }
42}
float m_SpecialtyWeight
Definition actionbase.c:77
int m_StanceMask
Definition actionbase.c:62
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
void ClearInventoryReservationEx(ActionData action_data)
ref CCTBase m_ConditionTarget
Definition actionbase.c:65
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
void MoveEquipToExistingItemAndDestroyOldRootLambda(EntityAI old_item, string new_item_type, PlayerBase player, EntityAI new_item)