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

Private Member Functions

void ActionTakeFireplaceIndoor ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 

Private Attributes

string m_NewItemTypeName = "Fireplace"
 

Detailed Description

Definition at line 1 of file ActionTakeFireplaceIndoor.c.

Constructor & Destructor Documentation

◆ ActionTakeFireplaceIndoor()

void ActionTakeFireplaceIndoor::ActionTakeFireplaceIndoor ( )
inlineprivate

Definition at line 5 of file ActionTakeFireplaceIndoor.c.

6 {
7 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS;
8 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
9 m_Text = "#take_fireplace";
10 }
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CommandUID, m_StanceMask, and m_Text.

Member Function Documentation

◆ ActionCondition()

override bool ActionTakeFireplaceIndoor::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 12 of file ActionTakeFireplaceIndoor.c.

13 {
14 Object target_object = target.GetObject();
15
16 //empty hands --interact action base condition
17 if (target_object && target_object.IsFireplace())
18 {
19 FireplaceIndoor fireplace_indoor = FireplaceIndoor.Cast(target_object);
20
21 if (fireplace_indoor && !fireplace_indoor.HasAshes() && !fireplace_indoor.IsBurning() && fireplace_indoor.IsCargoEmpty() && !fireplace_indoor.DirectCookingSlotsInUse())
22 {
24 bool found = player.GetInventory().FindFirstFreeLocationForNewEntity(m_NewItemTypeName, FindInventoryLocationType.ANY, targetIL);
25 return found;
26 }
27 }
28
29 return false;
30 }
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocation.

References m_NewItemTypeName.

◆ OnExecuteServer()

override void ActionTakeFireplaceIndoor::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 32 of file ActionTakeFireplaceIndoor.c.

33 {
34 Object target_object = action_data.m_Target.GetObject();
35 FireplaceIndoor fireplace_indoor = FireplaceIndoor.Cast(target_object);
36
39 bool found = action_data.m_Player.GetInventory().FindFirstFreeLocationForNewEntity(m_NewItemTypeName, FindInventoryLocationType.ANY, targetIL);
40 if (found)
41 {
42 // allow action only if there is place in inventory
43 lambda.OverrideNewLocation(targetIL);
44 action_data.m_Player.ServerReplaceItemWithNew(lambda);
45 }
46 }
void TakeFireplaceFromIndoorLambda(EntityAI old_item, string new_item_type, PlayerBase player)

References m_NewItemTypeName, and TakeFireplaceFromIndoorLambda().

Member Data Documentation

◆ m_NewItemTypeName

string ActionTakeFireplaceIndoor::m_NewItemTypeName = "Fireplace"
private

Definition at line 3 of file ActionTakeFireplaceIndoor.c.

Referenced by ActionCondition(), and OnExecuteServer().


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