DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionWorldLiquidActionSwitch.c
См. документацию.
1//can be eventually extended to allow switching for multiple action types?
4{
7 {
8 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_PRONE;
9 }
10
16
17 /*override string GetText()
18 {
19 //return "#switch_to" + " " + m_switch_to;
20 if (!m_switch_to)
21 return "#switch_to_liquid_drain";
22 return "#switch_to_liquid_pour";
23 }*/
24
25 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
26 {
27 ItemBase target_item = ItemBase.Cast(target.GetObject());
28 if (Barrel_ColorBase.Cast(target_item) && !target_item.IsOpen())
29 return false;
30
31 if ( target_item && item && Liquid.CanFillContainer( item, target_item.GetLiquidType(),true ) && Liquid.CanFillContainer( target_item, item.GetLiquidType(), true ) && !GetGame().IsInventoryOpen() ) //TODO find better condition than IsKindOf
32 {
33 if ( target_item.GetQuantity() > target_item.GetQuantityMin() && item.GetQuantity() < item.GetQuantityMax() && !player.GetLiquidTendencyDrain() && Liquid.CanFillContainer( item, target_item.GetLiquidType() ) )
34 {
35 if ( Liquid.CanFillContainer( target_item, item.GetLiquidType() ) )
36 {
37 m_switch_to = 0;//"#liquid_drain";
38 return true;
39 }
40 else
41 {
42 player.SetLiquidTendencyDrain(true);
43 return false;
44 }
45 }
46 if ( item.GetQuantity() > item.GetQuantityMin() && target_item.GetQuantity() < target_item.GetQuantityMax() && player.GetLiquidTendencyDrain() && Liquid.CanFillContainer( target_item, item.GetLiquidType() ) )
47 {
48 if ( Liquid.CanFillContainer( item, target_item.GetLiquidType() ) )
49 {
50 m_switch_to = 1;//"#liquid_pour";
51 return true;
52 }
53 else
54 {
55 player.SetLiquidTendencyDrain(false);
56 return false;
57 }
58 }
59 }
60 return false;
61 }
62
63 override void Start( ActionData action_data ) //Setup on start of action
64 {
65 super.Start( action_data );
66 bool state;
67 state = action_data.m_Player.GetLiquidTendencyDrain();
68 action_data.m_Player.SetLiquidTendencyDrain(!state);
69
70 //Print(action_data.m_Player.GetLiquidTendencyDrain());
71 }
72
73 override bool IsLocal()
74 {
75 return true;
76 }
77
78 override bool IsInstant()
79 {
80 return true;
81 }
82
84 {
85 return false;
86 }
87};
ActionBase ActionData
Определения ActionBase.c:30
class ActionTargets ActionTarget
int m_StanceMask
Определения ActionBase.c:62
ref CCIBase m_ConditionItem
Определения ActionBase.c:64
ref CCTBase m_ConditionTarget
Определения ActionBase.c:65
void ActionSingleUseBase()
Определения ActionSingleUseBase.c:31
override void Start(ActionData action_data)
Определения ActionWorldLiquidActionSwitch.c:63
override void CreateConditionComponents()
Определения ActionWorldLiquidActionSwitch.c:11
override bool RemoveForceTargetAfterUse()
Определения ActionWorldLiquidActionSwitch.c:83
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionWorldLiquidActionSwitch.c:25
Определения CCINonRuined.c:2
Определения CCTNonRuined.c:2
Определения InventoryItem.c:731
Определения PlayerBaseClient.c:2
const float DEFAULT
Определения ActionConstants.c:112
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
proto native CGame GetGame()