DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionDigWorms.c
См. документацию.
2{
3 override void CreateActionComponent()
4 {
5 float time_spent;
6 time_spent = UATimeSpent.DIG_WORMS;
7 if (m_ActionData.m_MainItem.KindOf("Knife"))
8 time_spent = time_spent * 1.2;
9
10 if (m_ActionData.m_Player.GetInColdArea())
12
13 m_ActionData.m_ActionComponent = new CAContinuousRepeat(time_spent);
14 }
15};
16
18{
20 {
22 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIGGIN_WORMS;
23 m_FullBody = true;
24 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
25 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_MEDIUM;
26 m_Text = "#dig_up_worms";
27 }
28
34
35 override bool Can(PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
36 {
37 if (!super.Can(player, target, item, condition_mask))
38 return false;
39
40 return player.CheckFreeSpace(vector.Forward, 0.8, false);
41 }
42
43 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
44 {
45 if (player.IsPlacingLocal())
46 return false;
47
48 return IsTargetFertile(target) && IsPlayerOnGround(player);
49 }
50
51 override bool ActionConditionContinue(ActionData action_data)
52 {
53 return IsPlayerOnGround(action_data.m_Player);
54 }
55
56 override bool HasTarget()
57 {
58 return true;
59 }
60
61 override void OnFinishProgressServer(ActionData action_data)
62 {
63 int count = action_data.m_MainItem.GetOnDigWormsAmount();
64 for (int i = 0; i < count; i++)
65 {
66 /*
67 vector posHead;
68 MiscGameplayFunctions.GetHeadBonePos(action_data.m_Player,posHead);
69 vector posRandom = MiscGameplayFunctions.GetRandomizedPositionVerified(posHead,action_data.m_Target.GetCursorHitPos(),UAItemsSpreadRadius.NARROW,action_data.m_Player);
70
71 GetGame().CreateObjectEx("Worm", posRandom, ECE_PLACE_ON_SURFACE);
72 */
73 GetGame().CreateObjectEx("Worm", action_data.m_Target.GetCursorHitPos(), ECE_PLACE_ON_SURFACE);
74 }
75
76 MiscGameplayFunctions.DealEvinronmentAdjustedDmg(action_data.m_MainItem, action_data.m_Player, 4);
77 }
78
80 {
81 if (target)
82 {
83 string surface_type;
84 vector position;
85 position = target.GetCursorHitPos();
86
87 GetGame().SurfaceGetType(position[0], position[2], surface_type);
88
89 if (GetGame().IsSurfaceFertile(surface_type))
90 {
91 return true;
92 }
93 }
94
95 return false;
96 }
97
99 {
100 vector position = player.GetPosition();
101 float heightDiff = GetGame().SurfaceY(position[0], position[2]);
102 heightDiff = position[1] - heightDiff;
103
104 return heightDiff <= 0.4; // Player is considered on ground
105 }
106
109
110};
ActionBase ActionData
Определения ActionBase.c:30
class ActionTargets ActionTarget
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
float m_SpecialtyWeight
Определения ActionBase.c:77
int m_StanceMask
Определения ActionBase.c:62
string m_Text
Определения ActionBase.c:58
ref CCIBase m_ConditionItem
Определения ActionBase.c:64
bool m_FullBody
Определения ActionBase.c:61
ref CCTBase m_ConditionTarget
Определения ActionBase.c:65
ActionData m_ActionData
Определения AnimatedActionBase.c:3
void ActionContinuousBase()
Определения ActionContinuousBase.c:124
override void OnFinishProgressServer(ActionData action_data)
Определения ActionDigWorms.c:61
bool IsPlayerOnGround(PlayerBase player)
Определения ActionDigWorms.c:98
override bool ActionConditionContinue(ActionData action_data)
Определения ActionDigWorms.c:51
void ActionDigWorms()
Определения ActionDigWorms.c:19
void SetDiggignAnimation(ItemBase item)
DEPRECATED - See ItemBase.OverrideActionAnimation() to override commands for items.
override void CreateConditionComponents()
Определения ActionDigWorms.c:29
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionDigWorms.c:43
override bool Can(PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
Определения ActionDigWorms.c:35
bool IsTargetFertile(ActionTarget target)
Определения ActionDigWorms.c:79
override bool HasTarget()
Определения ActionDigWorms.c:56
override void CreateActionComponent()
Определения ActionDigWorms.c:3
Определения ActionDigWorms.c:2
int m_CommandUID
Определения AnimatedActionBase.c:143
Определения CCINonRuined.c:2
Определения CCTSurface.c:2
proto native float SurfaceY(float x, float z)
proto float SurfaceGetType(float x, float z, out string type)
Returns: Y position the surface was found.
proto native Object CreateObjectEx(string type, vector pos, int iFlags, int iRotation=RF_DEFAULT)
Creates object of certain type.
Определения constants.c:659
Определения InventoryItem.c:731
Определения PlayerBaseClient.c:2
const float DEFAULT
Определения ActionConstants.c:112
const float DIG_WORMS
Определения ActionConstants.c:79
Определения ActionConstants.c:28
static const vector Forward
Определения EnConvert.c:109
Определения EnConvert.c:106
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
proto native CGame GetGame()
const float COLD_AREA_DIG_WORMS_MODIF
(deg Celsius) temperature limit up to which player is allowed to dig garden plots
Определения constants.c:790