DayZ 1.24
Loading...
Searching...
No Matches
ActionTakeOvenIndoor.c
Go to the documentation of this file.
2{
3 string m_NewItemTypeName = "Fireplace";
4
6 {
7 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS;
8 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
9 m_Text = "#take_fireplace";
10 }
11
12 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
13 {
14 Object target_object = target.GetObject();
15
16 //empty hands --interact action base condition
17 if (target_object && target_object.IsFireplace())
18 {
19 OvenIndoor fireplace_indoor = OvenIndoor.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 }
31
33 {
34 Object target_object = action_data.m_Target.GetObject();
35 OvenIndoor fireplace_indoor = OvenIndoor.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 }
47}
48
50{
52
57
59 {
60 super.CopyOldPropertiesToNew(old_item, new_item);
61
63 }
64}
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
void TakeOvenFromIndoorLambda(EntityAI old_item, string new_item_type, PlayerBase player)
DayZPlayer m_Player
Definition Hand_Events.c:42
FindInventoryLocationType
flags for searching locations in inventory
override void OnExecuteServer(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
InventoryLocation.
base class for transformation operations (creating one item from another)
void CopyOldPropertiesToNew(notnull EntityAI old_item, EntityAI new_item)
Step E. copy properties from old object to the created one.
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597