DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionCloseDoors.c
См. документацию.
2{
4
6 {
7 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
8 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
9 m_Text = "#close";
10 }
11
13 {
16 }
17
18 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
19 {
20 if (!target)
21 return false;
22
23 if (!IsBuilding(target))
24 return false;
25
26 BuildingBase building;
27 if (Class.CastTo(building, target.GetObject()))
28 {
29 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
30 if (doorIndex != -1)
31 {
32 if (!IsInReach(player, target, UAMaxDistances.DEFAULT))
33 return false;
34
35 if (!building.DoorsDirectionalCheck(player,target.GetComponentIndex()))
36 return false;
37
38 return building.CanDoorBeClosed(doorIndex);
39 }
40 }
41
42 return false;
43 }
44
45 override void OnStartServer(ActionData action_data)
46 {
47 super.OnStartServer(action_data);
48
49 BuildingBase building;
50 if (Class.CastTo(building, action_data.m_Target.GetObject()))
51 {
52 int doorIndex = building.GetDoorIndex(action_data.m_Target.GetComponentIndex());
53 if (doorIndex != -1)
54 {
55 if (building.CanDoorBeClosed(doorIndex))
56 {
57 building.CloseDoor(doorIndex);
58 }
59 }
60 }
61 }
62
63 override void OnEndServer(ActionData action_data)
64 {
65 super.OnEndServer(action_data);
66
67 m_NoisePar = new NoiseParams();
68 m_NoisePar.LoadFromPath("CfgVehicles SurvivorBase NoiseActionDefault");
69 NoiseSystem noise = g_Game.GetNoiseSystem();
70 if (noise)
71 {
72 if (action_data.m_Player)
73 {
74 Object targetObj = action_data.m_Target.GetObject();
75 noise.AddNoisePos(action_data.m_Player, action_data.m_Player.GetPosition(), m_NoisePar);
76 }
77 }
78 }
79
80 override bool IsLockTargetOnUse()
81 {
82 return false;
83 }
84}
void BuildingBase()
string m_Text
Определения ActionBase.c:57
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Определения ActionBase.c:1290
bool IsBuilding(ActionTarget target)
Определения ActionBase.c:1280
ref CCIBase m_ConditionItem
Определения ActionBase.c:63
ref CCTBase m_ConditionTarget
Определения ActionBase.c:64
int m_StanceMask
Определения ActionBase.c:61
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:125
DayZGame g_Game
Определения DayZGame.c:4074
class NoiseSystem NoiseParams()
Определения Noise.c:18
void ActionCloseDoors()
Определения ActionCloseDoors.c:5
override bool IsLockTargetOnUse()
Определения ActionCloseDoors.c:80
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionCloseDoors.c:18
override void OnEndServer(ActionData action_data)
Определения ActionCloseDoors.c:63
ref NoiseParams m_NoisePar
Определения ActionCloseDoors.c:3
override void CreateConditionComponents()
Определения ActionCloseDoors.c:12
override void OnStartServer(ActionData action_data)
Определения ActionCloseDoors.c:45
PlayerBase m_Player
Определения ActionBase.c:40
ref ActionTarget m_Target
Определения ActionBase.c:39
Определения ActionBase.c:22
void ActionInteractBase()
Определения ActionInteractBase.c:43
int m_CommandUID
Определения AnimatedActionBase.c:147
Определения CCINone.c:2
Определения CCTCursor.c:2
Super root of all classes in Enforce script.
Определения EnScript.c:11
proto void AddNoisePos(EntityAI source_entity, vector pos, NoiseParams noise_params, float external_strenght_multiplier=1.0)
Определения Noise.c:2
Определения ObjectTyped.c:2
Определения PlayerBaseClient.c:2
const float DEFAULT
Определения ActionConstants.c:114
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.