DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionBuildStoneCircle.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
6 }
7}
8
10{
12 {
13 m_CallbackClass = ActionBuildStoneCircleCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
15 m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
18 m_Text = "#build_stonecircle";
19
20 }
21
23 {
24
27 }
28
29 override typename GetInputType()
30 {
32 }
33
34 override bool HasProgress()
35 {
36 return true;
37 }
38
39 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
40 {
41 Object target_object = target.GetObject();
42
43 if ( target_object && target_object.IsFireplace() )
44 {
45 FireplaceBase fireplace_target = FireplaceBase.Cast( target_object );
46
47 if ( fireplace_target.IsBaseFireplace() && fireplace_target.CanBuildStoneCircle() )
48 {
49 return true;
50 }
51 }
52
53 return false;
54 }
55
56 override void OnFinishProgressServer( ActionData action_data )
57 {
58 Object target_object = action_data.m_Target.GetObject();
59 FireplaceBase fireplace_target = FireplaceBase.Cast( target_object );
60
61 if ( fireplace_target.CanBuildStoneCircle() )
62 {
63 ItemBase attached_item = ItemBase.Cast( fireplace_target.GetAttachmentByType( fireplace_target.ATTACHMENT_STONES ) );
64
65 /*InventoryLocation inventory_location = new InventoryLocation;
66 attached_item.GetInventory().GetCurrentInventoryLocation( inventory_location );
67 fireplace_target.GetInventory().SetSlotLock( inventory_location.GetSlot(), true );*/
68
69 //set oven state
70 fireplace_target.SetStoneCircleState( true );
71
72 // extend lifetime
73 fireplace_target.SetLifetimeMax( FireplaceBase.LIFETIME_FIREPLACE_STONE_CIRCLE );
74
75 //add specialty to soft skills
76 action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
77 }
78 }
79}
void CreateConditionComponents()
Definition ActionBase.c:218
protected float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool HasProgress()
For UI: hiding of progress bar.
Definition ActionBase.c:238
protected string m_Text
Definition ActionBase.c:49
protected bool m_FullBody
Definition ActionBase.c:52
protected int m_StanceMask
Definition ActionBase.c:53
ActionBuildStoneCircleCB ActionContinuousBaseCB ActionBuildStoneCircle()
class ActionTargets ActionTarget
protected ActionData m_ActionData
protected void OnFinishProgressServer(ActionData action_data)
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
ref ActionTarget m_Target
Definition ActionBase.c:32
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool IsBaseFireplace()
Definition Fireplace.c:19
const float DEFAULT
const float DEFAULT_CONSTRUCT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602