DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс DayZPlayerImplementSwimming

Закрытые члены

void DayZPlayerImplementSwimming (DayZPlayer pPlayer)
 
float GetWaterDepth ()
 
float GetCharacterDepth ()
 
bool CheckSwimmingStart (out vector waterLevel)
 
bool HandleSwimming (int pCurrentCommandID, HumanCommandMove pCMove, HumanMovementState pState)
 ha
 

Закрытые данные

DayZPlayer m_pPlayer
 
SHumanCommandSwimSettings m_pSettings
 
bool m_bWasSwimming = false
 

Подробное описание

Конструктор(ы)

◆ DayZPlayerImplementSwimming()

void DayZPlayerImplementSwimming ( DayZPlayer pPlayer)
inlineprivate
10 {
12 m_pSettings = pPlayer.GetDayZPlayerType().CommandSwimSettingsW();
13 }
DayZPlayer m_pPlayer
Definition DayZPlayerImplementSwimming.c:5
SHumanCommandSwimSettings m_pSettings
Definition DayZPlayerImplementSwimming.c:6
Definition EntityAI.c:95

Перекрестные ссылки m_pPlayer и m_pSettings.

Методы

◆ CheckSwimmingStart()

bool CheckSwimmingStart ( out vector waterLevel)
inlineprivate
32 {
33 return DayZPlayerUtils.CheckWaterLevel(m_pPlayer,waterLevel) == EWaterLevels.LEVEL_SWIM_START;
34 }
void DayZPlayerUtils()
cannot be instantiated
Definition DayZPlayerUtils.c:465
EWaterLevels
Definition EWaterLevels.c:2

Перекрестные ссылки DayZPlayerUtils() и m_pPlayer.

Используется в HandleSwimming().

◆ GetCharacterDepth()

float GetCharacterDepth ( )
inlineprivate
24 {
25 vector pp = m_pPlayer.PhysicsGetPositionWS();
26 vector wl = HumanCommandSwim.WaterLevelCheck(m_pPlayer, pp);
27
28 return wl[1];
29 }
Definition EnConvert.c:106
class HumanCommandLadder HumanCommandSwim()
Definition human.c:673

Перекрестные ссылки HumanCommandSwim() и m_pPlayer.

◆ GetWaterDepth()

float GetWaterDepth ( )
inlineprivate
16 {
17 vector pp = m_pPlayer.PhysicsGetPositionWS();
18 vector wl = HumanCommandSwim.WaterLevelCheck(m_pPlayer, pp);
19
20 return wl[0];
21 }

Перекрестные ссылки HumanCommandSwim() и m_pPlayer.

Используется в HandleSwimming().

◆ HandleSwimming()

bool HandleSwimming ( int pCurrentCommandID,
HumanCommandMove pCMove,
HumanMovementState pState )
inlineprivate

ha

get water level

now movement

handled !

38 {
39 if ( pCurrentCommandID == DayZPlayerConstants.COMMANDID_UNCONSCIOUS || pCurrentCommandID == DayZPlayerConstants.COMMANDID_DAMAGE )
40 return false;
41
42 m_bWasSwimming = false;
43
45 if (pCurrentCommandID != DayZPlayerConstants.COMMANDID_SWIM)
46 {
47 vector wl;
49 {
50 m_pPlayer.StartCommand_Swim();
51 m_bWasSwimming = true;
52 return true;
53 }
54
56 if ((pCurrentCommandID == DayZPlayerConstants.COMMANDID_MOVE) && (pCMove != null))
57 {
58 pCMove.SetCurrentWaterLevel(wl[1]);
60
61 if (wl[1] > m_pSettings.m_fToErectLevel && pState.m_iStanceIdx != DayZPlayerConstants.STANCEIDX_ERECT && pState.m_iStanceIdx != DayZPlayerConstants.STANCEIDX_RAISEDERECT )
62 {
63 if ( DayZPlayerUtils.PlayerCanChangeStance(m_pPlayer, DayZPlayerConstants.STANCEIDX_ERECT) )
64 {
65 pCMove.ForceStanceUp(DayZPlayerConstants.STANCEIDX_ERECT);
66 }
67 else
68 {
69 m_pPlayer.StartCommand_Swim();
70 m_bWasSwimming = true;
71 return true;
72 }
73 }
74 else if (wl[1] > m_pSettings.m_fToCrouchLevel && (pState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_PRONE || pState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDPRONE))
75 {
76 if ( DayZPlayerUtils.PlayerCanChangeStance(m_pPlayer, DayZPlayerConstants.STANCEIDX_CROUCH) )
77 {
78 pCMove.ForceStanceUp(DayZPlayerConstants.STANCEIDX_CROUCH);
79 }
80 else
81 {
82 m_pPlayer.StartCommand_Swim();
83 m_bWasSwimming = true;
84 return true;
85 }
86 }
87 }
88
89 // not handled
90 return false;
91 }
92 else // if (pCurrentCommandID == DayZPlayerConstants.COMMANDID_SWIM)
93 {
95 {
96 if (DayZPlayerUtils.PlayerCanChangeStance(m_pPlayer, DayZPlayerConstants.STANCEIDX_ERECT, true))
97 {
98 HumanCommandSwim hcs = m_pPlayer.GetCommand_Swim();
99 hcs.StopSwimming();
100 m_bWasSwimming = false;
101 return true;
102 }
103 }
104
106 m_bWasSwimming = true;
107 return true;
108 }
109 }
override void SetCurrentWaterLevel(float pWaterLevel)
Definition DayZPlayerImplement.c:372
float GetWaterDepth()
Definition DayZPlayerImplementSwimming.c:15
bool m_bWasSwimming
Definition DayZPlayerImplementSwimming.c:7
bool CheckSwimmingStart(out vector waterLevel)
Definition DayZPlayerImplementSwimming.c:31
float m_fToCrouchLevel
when to crouch
Definition humansettings.c:66
float m_fToErectLevel
when to stand
Definition humansettings.c:67
float m_fWaterLevelOut
what water level causes to stop swimming (1.2m)
Definition humansettings.c:63
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки CheckSwimmingStart(), DayZPlayerUtils(), GetWaterDepth(), HumanCommandSwim(), m_bWasSwimming, SHumanCommandSwimSettings::m_fToCrouchLevel, SHumanCommandSwimSettings::m_fToErectLevel, SHumanCommandSwimSettings::m_fWaterLevelOut, m_pPlayer, m_pSettings и DayZPlayer::SetCurrentWaterLevel().

Поля

◆ m_bWasSwimming

bool m_bWasSwimming = false
private

Используется в HandleSwimming().

◆ m_pPlayer

◆ m_pSettings

SHumanCommandSwimSettings m_pSettings
private

Используется в DayZPlayerImplementSwimming() и HandleSwimming().


Объявления и описания членов класса находятся в файле: