Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actiontogglefishing.c
Go to the documentation of this file.
1 /*class ActionToggleFishing: ActionSingleUseBase
2 {
3  void ActionToggleFishing()
4  {
5  m_Sound = "CastingRod";
6  }
7 
8  override void CreateConditionComponents()
9  {
10  m_ConditionItem = new CCINonRuined;
11  m_ConditionTarget = new CCTNone;
12  }
13 
14  override bool HasTarget()
15  {
16  return false;
17  }
18 
19  override string GetText()
20  {
21  return "TODO";
22  }
23 
24  override bool ActionCondition ( PlayerBase player, ActionTarget target, ItemBase item )
25  {
26  return true;
27 
28  vector pos_cursor = target.GetCursorHitPos();
29  float distance = Math.AbsInt(vector.Distance(pos_cursor,player.GetPosition()));
30  if ( distance <= 2 )
31  {
32  return true;
33  }
34  else
35  {
36  return false;
37  }
38  }
39 
40  override void OnExecuteServer( ActionData action_data )
41  {
42  FishingRod_Base nitem = FishingRod_Base.Cast( action_data.m_MainItem );
43  if( action_data.m_MainItem.GetAnimationPhase("OpenRod") )
44  {
45  //nitem.DeactivateFishing();
46  action_data.m_MainItem.SetAnimationPhase("CloseRod",1);
47  action_data.m_MainItem.SetAnimationPhase("OpenRod",0);
48  }
49  else
50  {
51  //nitem.ActivateFishing();
52  action_data.m_MainItem.SetAnimationPhase("CloseRod",0);
53  action_data.m_MainItem.SetAnimationPhase("OpenRod",1);
54  }
55  }
56 };*/