24 int boneIndex =
m_pPlayer.GetBoneIndexByName(
"RightHand_Dummy");
27 m_pPlayer.GetBoneTransformWS(boneIndex, m4);
33 int deadBodyLifetime =
GetCEApi().GetCEGlobalInt(
"CleanupLifetimeDeadPlayer");
34 if (deadBodyLifetime <= 0)
36 deadBodyLifetime = 3600;
38 itemInHands.SetLifetime(deadBodyLifetime);
62class DeathEffectTimer
extends Timer
68 PPERequesterBank.GetRequester(PPERequester_DeathDarkening).Stop();
74 static const int DEAD_SCREEN_DELAY = 1000;
75 static const float DEFAULT_DYING_TIME = 2.5;
76 static const float DYING_PROGRESSION_TIME = 0.05;
132 protected bool m_RaiseStarted =
false;
133 protected bool m_AimingFinisherStarted =
false;
140 protected bool m_PullPlayerOutOfVehicleKeepsInLocalSpace =
false;
141 protected int m_PullPlayerOutOfVehicleState = -1;
147 m_SprintFull =
false;
156 m_ADSAutomationTimer =
new Timer();
158 m_WeaponRaiseCompleted =
false;
160 m_IsShootingFromCamera =
true;
161 m_ProcessFirearmMeleeHit =
false;
162 m_ContinueFirearmMelee =
false;
163 m_WasIronsight =
true;
164 #ifdef PLATFORM_CONSOLE
167 m_LastSurfaceUnderHash = (
"cp_gravel").Hash();
168 m_NextVoNNoiseTime = 0;
170 m_CurrentWaterLevel = 0;
171 m_WeaponRaiseTime = 0;
173 RegisterNetSyncVariableBoolSignal(
"m_TriggerPullPlayerOutOfVehicleSynch");
178 return m_AimingModel;
188 return m_MeleeFightLogic;
213 return m_CameraEyeZoomLevel;
218 return m_IsShootingFromCamera;
223 m_IsShootingFromCamera = pState;
228 return m_CameraIronsight;
233 return m_CameraOptics;
238 return m_Camera3rdPerson;
243 m_Camera3rdPerson = state;
257 return m_IsTryingHoldBreath;
273 m_WeaponDebug = null;
279 return m_WeaponDebug != null;
289 return m_CurrentWaterLevel;
294 m_CurrentWaterLevel = pWaterLevel;
302 m_WasIronsight = m_CameraIronsight;
305 m_CameraIronsight = value;
319 m_CameraOptics = value;
326 hcw.
SetADS(!IsHandheldOpticsInUse());
334 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
338 optics = weapon.GetAttachedOptics();
345 SetIronsights(
false);
350 SwitchOptics(optics,
false);
366 if (optic.HasEnergyManager())
367 optic.GetCompEM().SwitchOn();
369 optic.OnOpticEnter();
375 if (optic.HasEnergyManager())
376 optic.GetCompEM().SwitchOff();
380 if (m_CameraOptics != state)
388 m_ClimbingLadderType = value;
417 return m_isFBsymptomPlaying;
425 int m_DeathAnimType = -2;
426 float m_DeathHitDir = 0;
427 bool m_DeathJuctureSent =
false;
431 string text = super.GetDebugText();
433 text +=
"IsSimulationDisabled: " + GetIsSimulationDisabled() +
"\n";
458 for (
int i = 0; i < transport.CrewSize(); ++i)
460 if (transport.CrewMember(i) ==
this)
472 transport.CrewGetOut(crewIdx);
473 TriggerPullPlayerOutOfVehicleImpl();
484 DisableSimulation(
false);
492 m_PullPlayerOutOfVehicleState = 0;
493 m_TriggerPullPlayerOutOfVehicleSynch =
true;
500 if (m_TriggerPullPlayerOutOfVehicleSynch && !
GetGame().IsDedicatedServer())
502 TriggerPullPlayerOutOfVehicleImpl();
505 super.OnVariablesSynchronized();
512 switch (m_PullPlayerOutOfVehicleState)
517 m_PullPlayerOutOfVehicleState = -1;
518 if (!m_PullPlayerOutOfVehicleKeepsInLocalSpace)
526 DayZPlayerVehicleCommandDeathCallback callbackVeh;
535 if (m_DeathAnimType != -2 &&
g_Game.GetMissionState() ==
g_Game.MISSION_STATE_GAME)
537 if (!CommitedSuicide())
539 int type = m_DeathAnimType;
541 type = GetTypeOfDeath(pCurrentCommandID);
549 int crewPos = transport.CrewMemberIndex(
this);
555 transport.CrewDeath(crewPos);
559 transport.CrewGetOut(crewPos);
561 if (!m_PullPlayerOutOfVehicleKeepsInLocalSpace)
566 DisableSimulation(
false);
569 m_TransportCache = null;
594 switch (pCurrentCommandID)
618 if (m_DeathJuctureSent)
622 m_DeathJuctureSent =
true;
627 SendDeathJuncture(-1, 0);
629 super.EEKilled(killer);
639 if (show && IsPlayerSelected())
642 if (!
GetGame().GetMission().IsPlayerRespawning())
644 message =
"#dayz_implement_dead";
647 #ifdef PLATFORM_CONSOLE
667 if (m_DeathEffectTimer && m_DeathEffectTimer.IsRunning())
669 m_DeathEffectTimer.Stop();
670 m_DeathEffectTimer = null;
676 if (
g_Game.GetMissionState() != DayZGame.MISSION_STATE_GAME)
683 float duration = DEFAULT_DYING_TIME;
684 if (m_KilledByHeadshot)
689 if (duration > DYING_PROGRESSION_TIME && !m_IsUnconscious)
691 if (!m_DeathEffectTimer)
692 m_DeathEffectTimer =
new DeathEffectTimer();
695 m_DeathEffectTimer.Run(DYING_PROGRESSION_TIME,
this,
"SetDeathDarknessLevel", par,
true);
698 ShowDeadScreen(state, duration);
708 StopDeathDarkeningEffect();
709 ShowDeadScreen(state, 0);
724 if (
GetGame().GetUIManager().IsDialogVisible())
736 if (
GetGame().GetUIManager().GetMenu())
754 m_WeaponRaiseTime = 0;
755 m_WeaponRaiseCompleted =
true;
760 m_WeaponRaiseTime = 0;
761 m_WeaponRaiseCompleted =
false;
766 return m_WeaponRaiseCompleted;
777 int userDataType = 0;
778 if (!ctx.
Read(userDataType))
780 Error(
"DayZPlayer: OnInputForRemote - cannot read input type");
784 switch (userDataType)
787 GetDayZPlayerInventory().OnEventForRemoteWeapon(ctx);
790 GetDayZPlayerInventory().OnHandEventForRemote(ctx);
793 GetDayZPlayerInventory().OnInputUserDataForRemote(ctx);
796 Error(
"OnInputForRemote - unknown userDataType=" + userDataType);
803 int userDataType = 0;
804 if (!ctx.
Read(userDataType))
806 Error(
"DayZPlayer: OnInputFromServer - cannot read input type");
810 switch (userDataType)
813 GetDayZPlayerInventory().OnServerInventoryCommand(ctx);
816 Error(
"OnInputFromServer - unknown userDataType=" + userDataType);
847 GetDayZPlayerInventory().HandleWeaponEvents(pDt, pExitIronSights);
851 ItemOptics optic = weapon.GetAttachedOptics();
861 m_IsTryingHoldBreath =
true;
865 m_IsTryingHoldBreath =
false;
870 GetWeaponManager().SetNextMuzzleMode();
874 if (optic && (optic.IsInOptics() || optic.IsUsingWeaponIronsightsOverride()))
876 optic.StepZeroingUp();
880 weapon.StepZeroingUpAllMuzzles();
885 if (optic && (optic.IsInOptics() || optic.IsUsingWeaponIronsightsOverride()))
887 optic.StepZeroingDown();
891 weapon.StepZeroingDownAllMuzzles();
895 if (!m_LiftWeapon_player && (m_CameraIronsight || !weapon.CanEnterIronsights() || m_CameraOptics))
898 HandleOptic(optic,
false, pInputs, pExitIronSights);
903 m_IsFireWeaponRaised =
false;
904 if (weapon && weapon.IsInOptics())
909 ResetWeaponRaiseProgress();
915 m_IsFireWeaponRaised =
true;
916 if (!IsWeaponRaiseCompleted())
918 m_WeaponRaiseTime += pDt;
923 CompleteWeaponRaise();
928 if (GetWeaponManager().CanFire(weapon))
930 bool autofire = weapon.GetCurrentModeAutoFire(weapon.GetCurrentMuzzle()) && weapon.IsChamberEjectable(weapon.GetCurrentMuzzle());
931 int burst = weapon.GetCurrentModeBurstSize(weapon.GetCurrentMuzzle());
932 int burst_count = weapon.GetBurstCount();
933 if (!autofire && (burst < 2 || burst_count < 1))
937 GetWeaponManager().Fire(weapon);
940 else if (autofire || burst > 1)
943 int burst_option = GetWeaponManager().GetBurstOption();
944 if (burst_option == 0)
949 if (autofire || burst_count < burst)
951 GetWeaponManager().Fire(weapon);
956 weapon.ResetBurstCount();
960 else if (burst_option == 1)
962 if (burst > 1 && burst_count == burst)
964 weapon.ResetBurstCount();
966 else if (burst > 1 && burst_count < burst)
968 GetWeaponManager().Fire(weapon);
975 GetWeaponManager().Fire(weapon);
983 #ifdef PLATFORM_CONSOLE
984 if (
GetGame().
GetInput().LocalRelease(
"UAFire",
false) || m_ShouldReload)
986 if (!weapon.IsWaitingForActionFinish() && !IsFighting())
988 int muzzle_index = weapon.GetCurrentMuzzle();
990 if (weapon.IsChamberFiredOut(muzzle_index))
992 if (weapon.CanProcessWeaponEvents())
994 if (GetWeaponManager().CanEjectBullet(weapon))
996 GetWeaponManager().EjectBullet();
997 pExitIronSights =
true;
998 m_ShouldReload =
false;
1005 m_ShouldReload =
true;
1021 bool controllerPressIn;
1022 bool controllerPressOut;
1026 weapon =
Weapon_Base.Cast(optic.GetHierarchyParent());
1027 FOVcount = optic.GetStepFOVCount();
1028 controllerPressIn = input.
SyncedPress_ID(UAZoomInOpticsControllerHelper);
1030 if (weapon && m_CameraIronsight && !m_CameraOptics)
1032 SetIronsights(
false);
1033 SwitchOptics(optic,
true);
1034 optic.SetStepFOVIndex(0);
1036 else if (m_CameraOptics)
1038 if (controllerPressIn)
1040 if (!optic.StepFOVUp())
1044 optic.SetStepFOVIndex(0);
1047 if (weapon && weapon.CanEnterIronsights())
1049 SwitchOptics(optic,
false);
1051 SetIronsights(
true);
1064 weapon =
Weapon_Base.Cast(optic.GetHierarchyParent());
1065 FOVcount = optic.GetStepFOVCount();
1066 controllerPressOut = input.
SyncedPress_ID(UAZoomOutOpticsControllerHelper);
1069 if (!optic.StepFOVDown())
1071 if (controllerPressOut)
1073 if (FOVcount > 0 && (!weapon || !weapon.CanEnterIronsights()))
1075 optic.SetStepFOVIndex(FOVcount - 1);
1079 if (weapon && weapon.CanEnterIronsights())
1081 SwitchOptics(optic,
false);
1083 SetIronsights(
true);
1087 else if (controllerPressOut && weapon && m_CameraIronsight)
1089 SwitchOptics(optic,
true);
1092 optic.SetStepFOVIndex(FOVcount - 1);
1103 bool m_DamageHitFullbody =
false;
1104 int m_DamageHitAnimType = -1.0;
1105 float m_DamageHitDir = 0.0;
1106 float m_DamageHealth = 0.0;
1110 if (!m_SyncedHitDataArray || m_SyncedHitDataArray.Count() == 0)
1117 SyncHitInfo greatest_hit;
1118 for (
int i = 0; i < m_SyncedHitDataArray.Count(); i++)
1120 data = m_SyncedHitDataArray[i];
1121 m_DamageHitDir = data.m_HitDir;
1125 if (IsAlive() && !IsUnconscious() && data.m_HasSource &&
GetGame().GetMission().GetHud() &&
GetGame().
GetPlayer() ==
this)
1127 m_DamageHealth = data.m_HealthDamage;
1128 if (m_DamageHealth > 0.0)
1138 greatest_hit = data;
1141 else if (data.m_Fullbody)
1143 greatest_hit = data;
1148 m_DamageHitFullbody = greatest_hit.m_Fullbody;
1149 m_DamageHitAnimType = greatest_hit.m_AnimType;
1150 m_DamageHitDir = greatest_hit.m_HitDir;
1152 m_SyncedHitDataArray.Clear();
1153 m_DamageHealth = 0.0;
1160 if (m_DamageHitAnimType != -1 && m_TransportCache == null && !CommitedSuicide())
1166 m_DamageHitAnimType = -1;
1172 m_DamageHitAnimType = -1;
1190 vector targetDirection = GetDirection();
1193 targetDirection[1] = 0;
1194 toSourceDirection[1] = 0;
1199 float cosFi =
vector.
Dot(targetDirection, toSourceDirection);
1200 vector cross = targetDirection * toSourceDirection;
1204 pAnimHitDir = -pAnimHitDir;
1212 int invertHitDir = 0;
1215 pAnimHitFullbody =
false;
1218 switch (pDamageType)
1220 case DT_CLOSE_COMBAT:
1227 if (!IsUnconscious() && pAnimType == 1 && !m_MeleeFightLogic.IsInBlock())
1228 pAnimHitFullbody =
true;
1232 int impactBehaviour = 0;
1234 if (!IsUnconscious() && GetHealth(
"",
"Shock") > 25)
1237 if (pComponent ==
"Torso" || pComponent ==
"Head")
1242 if ((fireDamage > 80.0 || shockDamage > 40.0) && impactBehaviour == 1)
1243 pAnimHitFullbody =
true;
1255 pAnimHitFullbody =
true;
1263 vector targetDirection = GetDirection();
1266 targetDirection[1] = 0;
1267 toSourceDirection[1] = 0;
1272 float cosFi =
vector.
Dot(targetDirection, toSourceDirection);
1273 vector cross = targetDirection * toSourceDirection;
1278 if (invertHitDir > 0)
1282 pAnimHitDir = -pAnimHitDir;
1290 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
1292 m_TransportHitRegistered =
false;
1297 float animHitDirDeath;
1298 if (EvaluateDeathAnimation(damageType, source, ammo, animTypeDeath, animHitDirDeath))
1300 SendDeathJuncture(animTypeDeath, animHitDirDeath);
1303 if (!m_DeathSyncSent)
1305 Man killer = source.GetHierarchyRootPlayer();
1310 m_KillerData.m_Killer = killer;
1311 m_KillerData.m_MurderWeapon = source;
1314 if (killer && killer.IsPlayer())
1317 if (dmgZone ==
"Brain")
1319 m_KilledByHeadshot =
true;
1320 if (m_KillerData.m_Killer == killer)
1321 m_KillerData.m_KillerHiTheBrain =
true;
1330 bool animHitFullbody;
1331 if (EvaluateDamageHitAnimation(damageResult, damageType, source, dmgZone, ammo, modelPos, animType, animHitDir, animHitFullbody))
1335 bool skipSoundRequest =
false;
1337 skipSoundRequest = GetFallDamage().GetLandType() <
HumanCommandFall.LANDTYPE_MEDIUM;
1339 if (!skipSoundRequest)
1345 if (animHitFullbody)
1357 float m_fLastHeadingDiff = 0;
1367 m_fLastHeadingDiff = 0;
1378 m_fLastHeadingDiff = 0;
1383 m_fLastHeadingDiff = 0;
1390 m_fLastHeadingDiff = 0;
1396 if (actMenuValue != 0)
1405 m_fLastHeadingDiff = 0;
1415 m_fLastHeadingDiff = 0;
1447 if (!m_AimingFinisherStarted)
1450 m_AimingFinisherStarted =
true;
1452 m_AimingModel.ProcessStealthFilters(pDt, pModel);
1460 if (!m_RaiseStarted)
1462 m_AimingModel.OnRaiseBegin(
this);
1463 m_RaiseStarted =
true;
1470 m_RaiseStarted =
false;
1471 m_AimingFinisherStarted =
false;
1485 if (IsFBSymptomPlaying() || IsRestrained() || IsUnconscious() || IsInFBEmoteState())
1491 if (
IsRaised() && GetInputInterface().SyncedPress(
"UAGetOverControllerHelper"))
1506 bool CanClimb(
int climbType, SHumanCommandClimbResult climbRes)
1508 if (IsFBSymptomPlaying() || IsRestrained() || IsUnconscious() || IsInFBEmoteState())
1514 if (
IsRaised() && GetInputInterface().SyncedPress(
"UAGetOverControllerHelper"))
1526 if (
Class.
CastTo(entity,climbRes.m_GrabPointParent) && entity.IsHologram())
1528 if (
Class.
CastTo(entity,climbRes.m_ClimbStandPointParent) && entity.IsHologram())
1530 if (
Class.
CastTo(entity,climbRes.m_ClimbOverStandPointParent) && entity.IsHologram())
1548 GetDayZPlayerInventory().CancelHandEvent();
1553 GetDayZPlayerInventory().CancelWeaponEvent();
1558 GetDayZPlayerInventory().AbortWeaponEvent();
1569 if (m_CameraIronsight || m_CameraOptics)
1576 bool bADSToggle =
false;
1577 bool exitSights =
false;
1584 if (playerPB.IsRolling())
1589 if (m_ResetADS || !hia.IsItemInHandsWeapon())
1597 ResetWeaponRaiseProgress();
1608 if (m_bADS && !m_CameraIronsight && !m_CameraOptics)
1611 if (!IsWeaponRaiseCompleted())
1623 if (bADSToggle && !
GetCommand_Melee2() && !GetThrowing().IsThrowingModeEnabled())
1625 if (hia.IsItemInHandsWeapon() && playerPB.GetItemInHands() && playerPB.GetItemInHands().IsWeapon() && playerPB.GetWeaponManager() && !playerPB.GetWeaponManager().IsRunning())
1628 ItemOptics optic = weapon.GetAttachedOptics();
1629 bool switchToADS =
false;
1630 bool canUseIronsights = weapon.CanEnterIronsights();
1631 bool canUseOptics = optic != NULL;
1633 if (canUseIronsights || canUseOptics)
1634 switchToADS = m_bADS;
1641 switchToADS =
false;
1645 if (IsLiftWeapon() || !
IsRaised() || GetDayZPlayerInventory().
IsProcessing() || !IsWeaponRaiseCompleted() || IsFighting())
1649 else if (switchToADS)
1652 if (m_WasIronsight && !canUseIronsights)
1654 m_WasIronsight =
false;
1656 else if (!m_WasIronsight && !canUseOptics)
1658 m_WasIronsight =
true;
1664 SwitchOptics(optic,
false);
1665 SetIronsights(
true);
1667 else if (!m_WasIronsight || (!canUseIronsights && canUseOptics))
1669 SetIronsights(
false);
1670 SwitchOptics(optic,
true);
1677 if (hcw && (m_CameraOptics))
1690 if (exitSights && !IsHandheldOpticsInUse() && (m_CameraIronsight || m_CameraOptics) ||
GetCommand_Melee2())
1700 if (m_CameraIronsight || m_CameraOptics)
1720 if (
GetGame().GetWorld().Is3rdPersonDisabled())
1722 m_Camera3rdPerson =
false;
1726 m_Camera3rdPerson = !m_Camera3rdPerson;
1730 if (m_LiftWeapon_player && (m_CameraOptics || m_CameraIronsight))
1734 GetDayZPlayerType().SetVerticalMinimumAimLimit(DayZPlayerCameraIronsights.CONST_UD_MIN_BACK);
1736 GetDayZPlayerType().SetVerticalMinimumAimLimit(DayZPlayerCameraIronsights.CONST_UD_MIN);
1745 else if (!IsClimbingLadder() && !IsSwimming() && !IsInVehicle())
1764 float headingAngle = MiscGameplayFunctions.GetHeadingAngle(
this);
1765 float headingAngleDiffBlock =
Math.
AbsFloat(m_LastHeadingAngleBlock - headingAngle);
1766 float headingAngleDiffBlock2 =
Math.
AbsFloat(m_LastHeadingAngleBlock2 - headingAngle);
1767 float headingAngleDiff = 0.0;
1769 if (m_LastHeadingAngle * headingAngle < 0.0)
1771 headingAngleDiff =
Math.
AbsFloat(m_LastHeadingAngle + headingAngle);
1775 headingAngleDiff =
Math.
AbsFloat(m_LastHeadingAngle - headingAngle);
1778 if (headingAngleDiff > 0.2)
1782 float timefilterconstant = 400 - (headingAngleDiff * 100);
1784 if (headingAngleDiffBlock > 0.8 && time - m_LastBackSoundTime > timefilterconstant)
1786 float volume = headingAngleDiff / 0.5;
1796 m_SoundOffset = headingAngleDiff / 2;
1797 if (m_SoundOffset > 0.25)
1799 m_SoundOffset = 0.25;
1802 string soundSetName =
"Cloth_Body_longmove_TShirt_Soundset";
1804 string bodyClothName =
"";
1808 bodyClothName = attachment.GetAttachmentSoundType();
1811 if (bodyClothName !=
"")
1813 string path =
"CfgSoundTables CfgAttachmentSoundTables Cloth_Body_Longmove_LookupTable";
1816 for (
int i = 0; i < soundCount; i++)
1821 if (
name == bodyClothName)
1825 soundSetName = stringArray.Get(0);
1835 if (soundObjectBuilder != NULL)
1839 if (soundObject != NULL)
1848 m_LastHeadingAngleBlock = headingAngle;
1853 if (headingAngleDiffBlock2 > 1.5 && time - m_LastBackSoundTime2 > (timefilterconstant * 2))
1855 float volume2 = headingAngleDiff * 2;
1861 m_SoundOffset = headingAngleDiff / 1.8;
1862 if (m_SoundOffset < 0.1)
1864 m_SoundOffset = 0.1;
1866 if (m_SoundOffset > 0.3)
1868 m_SoundOffset = 0.3;
1871 string soundSetName2 =
"walkProne_noHS_asphalt_ext_Char_SoundSet";
1872 string surfaceType = GetSurfaceType();
1874 if (surfaceType !=
"")
1876 string movementSurfaceType =
"walkProne_" + surfaceType;
1878 string path2 =
"CfgSoundTables CfgStepSoundTables walkProne_noHS_Char_LookupTable";
1881 for (
int i2 = 0; i2 < soundCount2; i2++)
1886 if (name2 == movementSurfaceType)
1890 soundSetName2 = stringArray2.Get(0);
1892 delete stringArray2;
1900 if (soundObjectBuilder2 != NULL)
1904 if (soundObject2 != NULL)
1913 m_LastHeadingAngleBlock2 = headingAngle;
1918 m_LastHeadingAngle = headingAngle;
1959 override void CommandHandler(
float pDt,
int pCurrentCommandID,
bool pCurrentCommandFinished)
1961 if (ModCommandHandlerBefore(pDt, pCurrentCommandID, pCurrentCommandFinished))
1967 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
1971 bool isWeapon = entityInHands && entityInHands.IsInherited(
Weapon);
1973 bool updateAimingMdfr =
false;
1974 if (isWeapon != m_IsWeapon)
1976 m_IsWeapon = isWeapon;
1977 updateAimingMdfr =
true;
1980 if (isRaisedNow != m_IsRaised)
1982 updateAimingMdfr =
true;
1986 if (updateAimingMdfr)
1988 if (isRaisedNow && isWeapon)
2001 if (isWeapon && (!m_ProcessFirearmMeleeHit || !m_ContinueFirearmMelee))
2003 m_ProcessFirearmMeleeHit =
false;
2004 bool exitIronSights =
false;
2005 HandleWeapons(pDt, entityInHands, hic, exitIronSights);
2007 else if (IsHandheldOpticsInUse() && m_CameraOptics && opticInHands)
2009 bool exitOptic =
false;
2010 HandleOptic(opticInHands,
true, hic, exitOptic);
2019 OnMovementChanged();
2024 if (HandleDeath(pCurrentCommandID))
2030 if (pCurrentCommandFinished)
2034 if ((m_LastCommandBeforeUnconscious ==
DayZPlayerConstants.COMMANDID_VEHICLE) && (m_TransportCache != null))
2036 int crew_index = m_TransportCache.CrewMemberIndex(
this);
2037 int seat = m_TransportCache.GetSeatAnimationType(crew_index);
2039 m_TransportCache = null;
2054 if (m_Swimming.m_bWasSwimming)
2062 if (GetHumanInventory().GetEntityInHands())
2072 if (ModCommandHandlerInside(pDt, pCurrentCommandID, pCurrentCommandFinished))
2097 m_SprintedTime += pDt;
2098 if (m_SprintedTime > 0.5)
2099 m_SprintFull =
true;
2101 m_SprintFull =
false;
2105 m_SprintedTime = 0.0;
2106 m_SprintFull =
false;
2111 if (m_Swimming.HandleSwimming(pCurrentCommandID, hcm,
m_MovementState))
2113 m_JumpClimb.CheckAndFinishJump();
2138 if (fall.PhysicsLanded())
2151 npar = type.GetNoiseParamsLandLight();
2154 else if (fallDamageData.
m_Height < 3.0)
2162 npar = type.GetNoiseParamsLandLight();
2165 else if (fallDamageData.
m_Height < 5.0)
2169 npar = type.GetNoiseParamsLandHeavy();
2176 npar = type.GetNoiseParamsLandHeavy();
2182 OnPlayerRecievedHit();
2185 m_FallDamage.HandleFallDamage(fallDamageData);
2186 m_JumpClimb.CheckAndFinishJump(fallDamageData.
m_LandType);
2212 hcls.m_fFwMaxDistance = 3;
2214 hcls.m_fFwMaxDistance = 1.2;
2216 SHumanCommandClimbResult ret;
2228 m_JumpClimb.JumpOrClimb();
2243 if (amplitude > 0.1 || force)
2246 ad.SetTalking(
true);
2252 if (now >= m_NextVoNNoiseTime)
2254 m_NextVoNNoiseTime = now + 1000;
2263 case VoiceLevelWhisper:
2264 vonpar = pt.GetNoiseParamsWhisper();
2266 case VoiceLevelTalk:
2267 vonpar = pt.GetNoiseParamsTalk();
2269 case VoiceLevelShout:
2270 vonpar = pt.GetNoiseParamsShout();
2280 ad.SetTalking(
false);
2292 m_Throwing.HandleThrowing(hic, hcw, entityInHands, pDt);
2295 if (m_MeleeFightLogic.HandleFightLogic(pCurrentCommandID, hic, entityInHands,
m_MovementState, m_ContinueFirearmMelee))
2297 m_ProcessFirearmMeleeHit = isWeapon && (hic.
IsMeleeWeaponAttack() || m_ProcessFirearmMeleeHit) || m_ContinueFirearmMelee;
2304 if (ModCommandHandlerAfter(pDt, pCurrentCommandID, pCurrentCommandFinished))
2317 float m_TestDamageCounter = -1;
2318 float m_DebugDirectionVal = -180;
2319 bool m_DebugTypeVal =
false;
2321 int m_DebugWeaponChangeStage = 0;
2333 playerDebug.CommandHandler();
2336 if (m_DebugWeaponChangeStage == 0)
2342 if (playerDebug.IsWeaponChange(m_DebugWeaponChangeItem, hideSlot, m_DebugWeaponChangeShowSlot))
2349 m_DebugWeaponChangeStage = 1;
2352 else if (m_DebugWeaponChangeStage == 1)
2365 EntityAI item_in_hands = player.GetHumanInventory().GetEntityInHands();
2366 if (item_in_hands != NULL && player.CanDropEntity(item_in_hands) &&
GetGame().
GetPlayer().GetHumanInventory().CanRemoveEntityInHands())
2368 player.PredictiveDropEntity(item_in_hands);
2371 if (m_DebugWeaponChangeItem !=
"")
2381 m_DebugWeaponChangeStage = 2;
2385 else if (m_DebugWeaponChangeStage == 2)
2390 m_DebugWeaponChangeStage = 0;
2398 if (m_TestDamageCounter >= 0)
2400 if (m_TestDamageCounter > 3)
2402 m_DebugDirectionVal = m_DebugDirectionVal + 90;
2403 m_TestDamageCounter = 0;
2405 if (m_DebugDirectionVal > 90)
2407 m_DebugDirectionVal = -180;
2408 m_DebugTypeVal = !m_DebugTypeVal;
2425 m_TestDamageCounter += pDt;
2440 ad.SetInjured(v,
true);
2447 ad.SetExhaustion(v,
true);
2464 if (!m_LiftWeapon_player)
2467 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
2470 optics = weapon.GetAttachedOptics();
2471 else if (entityInHands)
2474 if (m_CameraOptics && optics)
2478 else if (m_CameraIronsight && weapon)
2485 if (m_IsUnconscious)
2492 if (!m_Camera3rdPerson)
2508 return transport.Get3rdPersonCameraType();
2528 if (m_JumpClimb.m_bIsJumpInProgress)
2671 int userDataTypeParam = 0;
2672 if (!ctx.
Read(userDataTypeParam))
2674 Error(
"DayZPlayerImplement: cannot read input type");
2691 if (ctx.
Read(target))
2697 if (ctx.
Read(hitPos))
2702 int hitZoneIdx = -1;
2703 if (ctx.
Read(hitZoneIdx))
2708 int finisherType = -1;
2709 if (ctx.
Read(finisherType))
2726 switch (pJunctureID)
2729 if (m_DeathAnimType == -2)
2734 SyncHitInfo data =
new SyncHitInfo;
2737 m_SyncedHitDataArray.Insert(data);
2748 switch (boots.GetAttachmentSoundType())
2766 switch (attachment.GetAttachmentSoundType())
2769 return AnimUpperBodyType.NylonJacket;
2771 return AnimUpperBodyType.TShirt;
2773 return AnimUpperBodyType.WoolShirt;
2775 return AnimUpperBodyType.HeavyJacket;
2776 case "LeatherJacket":
2777 return AnimUpperBodyType.LeatherJacket;
2779 return AnimUpperBodyType.Coat;
2780 case "ChemlonDress":
2781 return AnimUpperBodyType.ChemlonDress;
2783 return AnimUpperBodyType.Ghillie;
2785 return AnimUpperBodyType.Chainmail;
2789 return AnimUpperBodyType.None;
2797 switch (back.GetAttachmentSoundType())
2800 return AnimBackType.Small;
2802 return AnimBackType.Military;
2804 return AnimBackType.Outdoor;
2806 return AnimBackType.Ghillie;
2810 return AnimBackType.None;
2819 AnimRangedWeaponType shoulderAttType = AnimRangedWeaponType.None;
2820 AnimRangedWeaponType meleeAttType = AnimRangedWeaponType.None;
2822 if (shoulderAttachment)
2824 switch (shoulderAttachment.GetAttachmentSoundType())
2828 shoulderAttType = AnimRangedWeaponType.Shotgun;
2833 shoulderAttType = AnimRangedWeaponType.Rifle;
2838 if (meleeAttachment)
2840 switch (meleeAttachment.GetAttachmentSoundType())
2844 meleeAttType = AnimRangedWeaponType.Shotgun;
2849 meleeAttType = AnimRangedWeaponType.Rifle;
2855 if (shoulderAttType == AnimRangedWeaponType.Shotgun || meleeAttType == AnimRangedWeaponType.Shotgun)
2856 return AnimRangedWeaponType.Shotgun;
2858 if (shoulderAttType == AnimRangedWeaponType.Rifle || meleeAttType == AnimRangedWeaponType.Rifle)
2859 return AnimRangedWeaponType.Rifle;
2861 return AnimRangedWeaponType.None;
2869 g_Game.SurfaceUnderObjectByBone(
this, limbType, surfaceType, liquidType);
2891 if (noisePar != null)
2912 if (pUserInt % 2 == 1)
2914 surface = GetSurfaceType(SurfaceAnimationBone.LeftBackLimb);
2915 if (surface.
Length() == 0)
2916 surface = GetSurfaceType(SurfaceAnimationBone.RightBackLimb);
2920 surface = GetSurfaceType(SurfaceAnimationBone.RightBackLimb);
2921 if (surface.
Length() == 0)
2922 surface = GetSurfaceType(SurfaceAnimationBone.LeftBackLimb);
2925 if (surface.
Length() != 0)
2926 m_LastSurfaceUnderHash = surface.
Hash();
2928 soundBuilder = table.
GetSoundBuilder(pUserInt, state.m_iMovement, m_LastSurfaceUnderHash, GetBootsType());
2932 string surface2 = GetSurfaceType();
2933 if (surface2.
Length() != 0)
2934 m_LastSurfaceUnderHash = surface2.
Hash();
2936 soundBuilder = table.
GetSoundBuilder(pUserInt, state.m_iMovement, m_LastSurfaceUnderHash, GetBootsType());
2946 if (
GetGame().IsBoxColliding(
GetPosition(), orientation, edgeLength, excludedObjects, collidedObjects))
2948 for (
int i = 0; i < collidedObjects.Count(); ++i)
2950 string objectClass = collidedObjects.Get(i).GetType();
2954 for (
int j = 0; j < type.GetVegetationSounds().
Count(); ++j)
2963 if (vegSoundObject != NULL)
2965 AttenuateSoundIfNecessary(vegSoundObject);
2966 PlaySound(vegSoundObject, vegSoundObjectBuilder);
2979 if (soundObject != NULL)
2981 AttenuateSoundIfNecessary(soundObject);
2991 float noiseMultiplier = 0;
2995 noiseParams = type.GetNoiseParamsStand();
2997 noiseParams = type.GetNoiseParamsCrouch();
2999 noiseParams = type.GetNoiseParamsProne();
3002 Debug.
Log(
string.Format(
"Wrong stance, id: %1 using backup with stand stance (id: 0)", state.m_iStanceIdx));
3003 noiseParams = type.GetNoiseParamsStand();
3008 AddNoise(noiseParams, noiseMultiplier);
3012 ProcessFeetDamageServer(pUserInt);
3019 if (pEventType ==
"Sound")
3021 ProcessSoundEvent(pEventType, pUserString, pUserInt);
3023 else if (pEventType ==
"SoundWeapon")
3025 ProcessWeaponEvent(pEventType, pUserString, pUserInt);
3027 else if (pEventType ==
"SoundAttachment")
3029 ProcessAttachmentEvent(pEventType, pUserString, pUserInt);
3031 else if (pEventType ==
"SoundVoice")
3035 int event_id = m_PlayerSoundEventHandler.ConvertAnimIDtoEventID(pUserInt);
3038 PlaySoundEvent(event_id);
3042 ProcessVoiceEvent(pEventType, pUserString, pUserInt);
3046 Debug.
Log(
"OnSoundEvent: Unknown sound event \"" + pEventType +
"\"");
3059 AnimSoundEvent soundEvent = null;
3063 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
3064 if (entityInHands && entityInHands.IsInherited(
ItemBase))
3068 if (item.HasQuantity())
3069 quantity = (
float)item.GetQuantity() / (item.GetQuantityMax() - item.GetQuantityMin());
3074 if (soundEvent == null)
3077 soundEvent = type.GetSoundWeaponEvent(pUserInt);
3080 if (soundEvent != null)
3084 SoundObjectBuilder builder = soundEvent.GetSoundBuilderEx(m_ActionSoundCategoryHash);
3088 builder.
SetVariable(
"interior", IsSoundInsideBuilding());
3091 if (soundObject != NULL)
3093 AttenuateSoundIfNecessary(soundObject);
3105 AddNoise(soundEvent.m_NoiseParams);
3116 pUserString.
Split(
",", attachments);
3117 for (
int i = 0; i < attachments.Count(); i++)
3119 int attachmentHash = -1;
3120 if (attachments[i] ==
"shoulder")
3121 attachmentHash = GetShoulderAttachmentType();
3122 else if (attachments[i] ==
"body")
3123 attachmentHash = GetBodyAttachmentType();
3124 else if (attachments[i] ==
"back")
3125 attachmentHash = GetBackAttachmentType();
3129 if (soundBuilder != NULL)
3132 if (soundObject != NULL)
3134 AttenuateSoundIfNecessary(soundObject);
3143 if (m_ClimbingLadderType ==
"wood")
3177 DayZPlayerTypeAnimTable table = type.GetSoundTable();
3178 AnimSoundEvent soundEvent;
3181 soundEvent = table.GetSoundEvent(pUserInt);
3184 if (soundEvent != NULL)
3186 if (!
GetGame().IsDedicatedServer())
3191 SetVariablesLadderSoundObjectBuilder(objectBuilder);
3196 if (soundObject != NULL)
3198 AttenuateSoundIfNecessary(soundObject);
3205 if (soundEvent.m_NoiseParams != NULL)
3227 if (mask || head_gear)
3229 string category_mask;
3230 string category_headgear;
3233 int priority_headgear;
3237 category_mask = mask.ConfigGetString(
"soundVoiceType");
3238 priority_mask = mask.ConfigGetInt(
"soundVoicePriority");
3242 category_headgear = head_gear.ConfigGetString(
"soundVoiceType");
3243 priority_headgear = head_gear.ConfigGetInt(
"soundVoicePriority");
3246 if (priority_headgear >= priority_mask && category_headgear !=
"")
3248 category = category_headgear;
3252 category = category_mask;
3267 int maleVoiceType = 0;
3268 int femaleVoiceType = 0;
3269 if (player.IsMale())
3271 maleVoiceType = player.GetVoiceType();
3275 femaleVoiceType = player.GetVoiceType();
3279 soundBuilder.
SetVariable(
"female", femaleVoiceType);
3283 if (soundObject != NULL)
3285 AttenuateSoundIfNecessary(soundObject);
3286 wave =
PlaySound(soundObject, soundBuilder);
3304 bool restrained = IsRestrained();
3305 bool unconscious = IsUnconscious();
3308 if (ib && (
PlayerBase.DEBUG_INVENTORY_ACCESS || !IsAlive() || restrained || unconscious || ib.CanBeMovedOverride()))
3324 return CheckForTakeItem(item);
3337 if (!IsAlive() || player.IsUnconscious())
3347 super.OnRPC(sender, rpc_type, ctx);
3349 if (rpc_type ==
ERPCs.RPC_DAYZPLAYER_DEBUGSERVERWALK)
3351 Print(
"ERPCs.RPC_DAYZPLAYER_DEBUGSERVERWALK");
3353 Param1<bool> rp =
new Param1<bool>(
false);
3367 if (!m_MoveSettings)
3369 if (m_MoveSettings.m_fSlidingPoseAngle != value)
3371 m_MoveSettings.m_fSlidingPoseAngle = value;
3387 return m_PlayerSelected;
3426 RegisterTransportHit(transport);
3435 soundObject.SetKind(
WaveKind.WAVEATTALWAYS);
3439 soundObject.SetKind(
WaveKind.WAVEEFFECTEX);
3448 m_HandheldOpticsInUse = state;
3453 return m_HandheldOpticsInUse;
3473 return CanPickupHeavyItem(item1) && CanPickupHeavyItem(item2);
void syncDebugPrint(string s)
proto native CEApi GetCEApi()
Get the CE API.
const int ECE_IN_INVENTORY
DamageType
exposed from C++ (do not change)
proto native void ResetDeathCooldown()
ref HumanMovementState m_MovementState
movement state
void DayZPlayerImplementFallDamage(DayZPlayer pPlayer)
void DayZPlayerImplementMeleeCombat(DayZPlayerImplement player)
protected ref DayZPlayerImplementMeleeCombat m_MeleeCombat
void DayZPlayerMeleeFightLogic_LightHeavy(DayZPlayerImplement player)
private void DayZPlayerUtils()
cannot be instantiated
bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
proto void AddNoise(EntityAI source_entity, NoiseParams noise_params, float external_strenght_multiplier=1.0)
class NoiseSystem NoiseParams()
void PlayerSoundEventHandler(PlayerBase player)
void PluginDayzPlayerDebug()
PluginManager GetPluginManager()
Returns registred plugin by class type, better is to use global funtion GetPlugin(typename plugin_typ...
class SoundObjectBuilder SoundObject(SoundParams soundParams)
void OnRPC(float stamina, float stamina_cap, bool cooldown)
deprecated use, StaminaHandler uses SyncJunctures now
class JsonUndergroundAreaTriggerData GetPosition
proto void SetStartOffset(float offset)
proto void SetVolumeRelative(float value)
proto void SetPosition(vector position)
proto native bool IsDedicatedServer()
Robust check which is preferred than the above, as it is valid much sooner.
proto native Mission GetMission()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native Input GetInput()
proto native AbstractSoundScene GetSoundScene()
override ScriptCallQueue GetCallQueue(int call_category)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto native World GetWorld()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native UIManager GetUIManager()
proto native NoiseSystem GetNoiseSystem()
proto int GetTime()
returns mission time in milliseconds
proto native int GetVoiceLevel(Object player=null)
Get voice level of VoN (on both client and server) (VoiceLevelWhisper = 0, VoiceLevelNormal = 1,...
Super root of all classes in Enforce script.
static const int DAYZCAMERA_3RD_ERC_RAISED
3rd - standing raised
static const int DAYZCAMERA_3RD_CRO_RAISED
3rd - crouch
static const int DAYZCAMERA_IRONSIGHTS
ironsights camera
static const int DAYZCAMERA_3RD_CRO
3rd - crouch
static const int DAYZCAMERA_3RD_ERC_RAISED_MELEE
3rd - laying raised
static const int DAYZCAMERA_1ST
1st person camera
static const int DAYZCAMERA_1ST_VEHICLE
vehicle 1st person
static const int DAYZCAMERA_3RD_PRO_RAISED
3rd - laying raised
static const int DAYZCAMERA_3RD_PRO
3rd - laying
static const int DAYZCAMERA_3RD_JUMP
jump
static const int DAYZCAMERA_3RD_CLIMB
climb / vault
static const int DAYZCAMERA_3RD_ERC_SPR
3rd - standing sprint
static const int DAYZCAMERA_1ST_UNCONSCIOUS
unconscious
static const int DAYZCAMERA_3RD_ERC
3rd - standing
static const int DAYZCAMERA_OPTICS
optics
override bool ShouldSimulationBeDisabled()
override void OnSimulationEnd()
override bool IsEyeZoom()
Legacy.
AnimUpperBodyType GetBodyAttachmentType()
protected bool m_CameraIronsight
void OverrideSlidePoseAngle(float value)
movement sliding override, originally for FB gestures
void ProcessAttachmentEvent(string pEventType, string pUserString, int pUserInt)
override void CommandHandler(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
bool CheckForTakeItem(EntityAI item)
protected bool m_ADSTimerLaunched
AnimRangedWeaponType GetShoulderAttachmentType()
bool CheckForRespawn(EntityAI item)
void SwitchOptics(ItemOptics optic, bool state)
protected ref DayZPlayerImplementThrowing m_Throwing
private float m_CurrentWaterLevel
protected bool m_IsWeapon
void ShowWeaponDebug(bool show)
protected ref DayZPlayerImplementAiming m_AimingModel
override void OnInputFromServer(ParamsReadContext ctx)
float GetSlidePoseAngle()
override bool IsShootingFromCamera()
bool CanPickupHeavyItem(notnull EntityAI item)
-------------— Checks if player can pick up heavy item ----------------------—
protected ref DayZPlayerImplementFallDamage m_FallDamage
protected ref DayZPlayerImplementMeleeCombat m_MeleeCombat
void TriggerPullPlayerOutOfVehicleImpl()
ref DeathEffectTimer m_DeathEffectTimer
AnimBackType GetBackAttachmentType()
bool IsTryingHoldBreath()
bool IsWeaponRaiseCompleted()
void SetOptics(bool value)
AbstractWave PlaySound(SoundObject so, SoundObjectBuilder sob)
bool ModCommandHandlerInside(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
void SetDeathDarknessLevel(float duration, float tick_time)
protected bool m_Camera3rdPerson
ref Timer m_FightEndBlendTimer
DayZPlayerImplementFallDamage GetFallDamage()
int GetTypeOfDeath(int pCurrentCommandID)
protected bool m_ProcessWeaponRaiseCompleted
override string GetDebugText()
ref WeaponDebug m_WeaponDebug
bool HandleDeath(int pCurrentCommandID)
void OnParticleEvent(string pEventType, string pUserString, int pUserInt)
protected int m_NextVoNNoiseTime
protected bool m_ResetADS
void SimulateDeath(bool state)
protected float m_DeathDarkeningCurrentTime
override void EEKilled(Object killer)
void OverrideShootFromCamera(bool pState)
protected bool m_IsTryingHoldBreath
void SetClimbingLadderType(string value)
bool IsFireWeaponRaised()
DayZPlayerInventory GetDayZPlayerInventory()
DayZPlayerImplementAiming GetAimingModel()
void SetIsInThirdPerson(bool state)
void SetHandheldOpticsInUse(bool state)
protected string m_ClimbingLadderType
override void SetCurrentWaterLevel(float pWaterLevel)
int m_ActionSoundCategoryHash
WeaponManager GetWeaponManager()
protected int m_LastCommandBeforeUnconscious
protected bool m_TriggerPullPlayerOutOfVehicleSynch
bool IsFBSymptomPlaying()
bool HandleDamageHit(int pCurrentCommandID)
protected bool m_ProcessLiftWeapon
void ResetWeaponRaiseProgress()
void ShowDeadScreen(bool show, float duration)
protected bool m_IsRaised
float m_LastHeadingAngleBlock2
protected bool m_WasIronsight
bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
void SetIronsights(bool value)
void OnLadder(float delta_time, HumanMovementState pState)
called every command handler tick when player is on ladder
void DepleteStamina(EStaminaModifiers modifier, float dT=-1)
void SetReturnToOptics(bool state)
override int GetEyeZoomLevel()
void OnSoundEvent(string pEventType, string pUserString, int pUserInt)
protected bool m_PlayerSelected
AbstractWave ProcessVoiceEvent(string pEventType, string pUserString, int pUserInt)
void HideClothing(ItemOptics optic, bool state)
protected bool m_HandheldOpticsInUse
override bool HeadingModel(float pDt, SDayZPlayerHeadingModel pModel)
void SendDeathJuncture(int pAnimTypeDeath, float pAnimHitDirDeath)
void AddNoise(NoiseParams noisePar, float noiseMultiplier=1.0)
protected void SendSoundEventEx(EPlayerSoundEventID id, int param=0)
protected int m_StepCounter
bool CanClimb(int climbType, SHumanCommandClimbResult climbRes)
void SetFallYDiff(float value)
void RequestSoundEventEx(EPlayerSoundEventID id, bool from_server_and_client=false, int param=0)
protected bool m_ProcessLiftWeaponState
void DayZPlayerImplement()
constructor
protected ECameraZoomType m_CameraEyeZoomLevel
void OnMovementChanged()
Event, called when HumanMovementState.m_iMovement changes...walk, run, sprint, etc....
bool IsHandheldOpticsInUse()
protected bool m_IsFireWeaponRaised
protected Transport m_TransportCache
void SetSuicide(bool state)
protected bool m_ShouldReload
protected ref DayZPlayerMeleeFightLogic_LightHeavy m_MeleeFightLogic
protected float m_FallYDiff
ref Timer m_ADSAutomationTimer
void ~DayZPlayerImplement()
void RequestSoundEvent(EPlayerSoundEventID id, bool from_server_and_client=false)
protected bool m_ShouldBeUnconscious
protected bool m_WeaponRaiseCompleted
measures time from the weapon raise start to complete raise (once per)
void OnSyncJuncture(int pJunctureID, ParamsReadContext pCtx)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
event from damage system
bool m_isFBsymptomPlaying
protected ref array< ref SyncHitInfo > m_SyncedHitDataArray
void OnInputUserDataReceived(ParamsReadContext ctx)
bool EvaluateDamageHitAnimation(TotalDamageResult pDamageResult, int pDamageType, EntityAI pSource, string pComponent, string pAmmoType, vector pModelPos, out int pAnimType, out float pAnimHitDir, out bool pAnimHitFullbody)
selects animation type and direction based on damage system data
bool IsWeaponDebugEnabled()
void ProcessSoundEvent(string pEventType, string pUserString, int pUserInt)
protected bool m_ProcessFirearmMeleeHit
override void OnItemInHandsChanged()
bool PlaySoundEventEx(EPlayerSoundEventID id, bool from_anim_system=false, bool is_from_server=false, int param=0)
override float GetCurrentWaterLevel()
bool CanConsumeStamina(EStaminaConsumers consumer)
Implementations only! - used on PlayerBase.
void HandleWeapons(float pDt, Entity pInHands, HumanInputController pInputs, out bool pExitIronSights)
void ResetDeathStartTime()
string GetSurfaceType(SurfaceAnimationBone limbType)
bool IsInFBEmoteState()
Checks if fullbody animation or specific locked state is active in emote manager.
protected ref PlayerSoundEventHandler m_PlayerSoundEventHandler
protected ref DayZPlayerImplementJumpClimb m_JumpClimb
private float m_WeaponRaiseTime
override void OnInputForRemote(ParamsReadContext ctx)
void ProcessWeaponEvent(string pEventType, string pUserString, int pUserInt)
bool CheckForDropItem(EntityAI item)
protected bool m_ContinueFirearmMelee
protected ref DayZPlayerImplementSwimming m_Swimming
void ProcessFeetDamageServer(int pUserInt)
float m_LastHeadingAngleBlock
protected bool m_CameraEyeZoom
bool EvaluateDeathAnimation(int pDamageType, EntityAI pSource, string pAmmoType, out int pAnimType, out float pAnimHitDir)
selects animation type and direction based on damage system data
protected bool m_CameraOptics
protected bool m_IsShootingFromCamera
int m_DebugWeaponChangeShowSlot
AnimBootsType GetBootsType()
protected bool m_LiftWeapon_player
DayZPlayerImplementThrowing GetThrowing()
protected bool m_CameraZoomToggle
override void OnVariablesSynchronized()
bool ModCommandHandlerBefore(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
override bool AimingModel(float pDt, SDayZPlayerAimingModel pModel)
void OnStepEvent(string pEventType, string pUserString, int pUserInt)
protected int m_LastSurfaceUnderHash
protected bool m_IsUnconscious
bool CanStartConsumingStamina(EStaminaConsumers consumer)
bool PlaySoundEvent(EPlayerSoundEventID id, bool from_anim_system=false, bool is_from_server=false)
override protected void EOnContact(IEntity other, Contact extra)
override int CameraHandler(int pCameraMode)
bool CanPickupHeavyItemSwap(notnull EntityAI item1, notnull EntityAI item2)
override bool IsInThirdPerson()
void CheckAnimationOverrides()
void OnJumpEnd(int pLandType=0)
void CompleteWeaponRaise()
protected void AttenuateSoundIfNecessary(SoundObject soundObject)
void SendCompleteWeaponRaiseJuncture()
bool ModCommandHandlerAfter(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
void HandleOptic(notnull ItemOptics optic, bool inHands, HumanInputController pInputs, out bool pExitOptics)
protected bool m_SprintFull
protected float m_SprintedTime
void TriggerPullPlayerOutOfVehicle()
protected SHumanCommandMoveSettings m_MoveSettings
void SetVariablesLadderSoundObjectBuilder(SoundObjectBuilder soundObjectBuilder)
protected void SendSoundEvent(EPlayerSoundEventID id)
override void StopDeathDarkeningEffect()
DayZPlayerMeleeFightLogic_LightHeavy GetMeleeFightLogic()
void CommandHandlerDebug(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
void LockControls(bool state)
DayZPlayerImplementMeleeCombat GetMeleeCombat()
string m_DebugWeaponChangeItem
static bool NoHeading(float pDt, SDayZPlayerHeadingModel pModel, out float pLastHeadingDiff)
static bool ClampHeading(float pDt, SDayZPlayerHeadingModel pModel, out float pLastHeadingDiff)
static bool RotateOrient(float pDt, SDayZPlayerHeadingModel pModel, out float pLastHeadingDiff)
static bool ReadDeathParams(ParamsReadContext pCtx, out int pType, out float pHitDir)
static bool ReadDamageHitParamsEx(ParamsReadContext pCtx, out SyncHitInfo pData)
static void SendDeath(DayZPlayer pPlayer, int pType, float pHitDir)
static void SendDamageHitEx(DayZPlayer pPlayer, int pType, float pHitDir, bool pFullbody, TotalDamageResult pDamageResult, int pDamageType, EntityAI pSource, string pComponent, string pAmmoType, vector pModelPos)
static const int SJ_DAMAGE_HIT
static const int SJ_DEATH
SoundObjectBuilder GetSoundBuilder(int eventId, string slotName, int attachmentHash)
SoundObjectBuilder GetSoundBuilder(int eventId, int pMovement, int pSurfaceHash, AnimBootsType pBoots)
override SoundObjectBuilder GetSoundBuilder(int eventId, int parameterHash)
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
void SetVehicleCommand(HumanCommandVehicle hcv)
void SpawnHitDirEffect(DayZPlayer player, float hit_direction, float intensity_max)
proto static native bool DoClimbTest(Human pHuman, SHumanCommandClimbResult pResult, int pDebugDrawLevel)
proto native void Cancel()
cancels command melee and goes to HumanCommandMove
proto native bool IsFinisher()
proto native bool IsStandingFromBack()
return true if prone on back is chaning to crounch/stand
proto native float GetCurrentMovementSpeed()
0,1,2..3 idle, walk, run, sprint
proto native bool IsInWater()
proto native bool IsOnLand()
proto native Transport GetTransport()
proto native bool IsGettingIn()
proto native bool WasGearChange()
proto native bool IsGettingOut()
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....
proto native bool IsActionFinished()
proto native int IsEvent()
return -1 when there is no event, otherwise it returns pId of event from animation
proto native void SetADS(bool pState)
sets head tilt to optics
proto native bool StartAction(WeaponActions pAction, int pActionType)
start reload,mechanism,chambering,unjam ...
bool m_bJumpAllowed
default false
int m_StanceRotation[6]
6 stances -> all has movement mask, STANCEIDX_ ... is index
int m_iStanceIdx
current command's id
int m_LocalMovement
leaning state (not all commands need to have all movements)
int m_iMovement
current stance (DayZPlayerConstants.STANCEIDX_ERECT, ...), only if the command has a stance
AnimSoundEvent GetSoundEvent(int event_id)
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
provides access to slot configuration
static float GetNoiseMultiplier(DayZPlayerImplement playerImplement)
proto void AddNoise(EntityAI source_entity, NoiseParams noise_params, float external_strenght_multiplier=1.0)
static void SetMultiplayState(bool state)
static const float WEAPON_RAISE_BLEND_DELAY
static const int CHECK_EVERY_N_STEP
static const float HEAVY_HIT_THRESHOLD
The class that will be instanced (moddable)
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto void Call(func fn, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
Serialization general interface. Serializer API works with:
proto bool Read(void value_in)
proto native void SetVariable(string name, float value)
proto native void UpdateEnvSoundControllers(vector position)
SoundObject BuildSoundObject()
proto native float GetHighestDamage(string healthType)
Base native class for all motorized wheeled vehicles.
proto native bool SyncedPress_ID(int action, bool check_focus=true)
Returns true just in frame, when action was invoked (button was pressed)
proto native void CloseDialog()
proto native void ScreenFadeIn(float duration, string text, int backgroundColor, int textColor)
void ShowUICursor(bool visible)
proto native void ScreenFadeOut(float duration)
SoundObjectBuilder GetSoundObjectBuilder()
TIntArray GetAnimEventIds()
script counterpart to engine's class Weapon
proto void SetVoiceOn(bool listening, bool toggled=false)
proto native bool Is3rdPersonDisabled()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto float Normalize()
Normalizes vector. Returns length.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
void ForceStandUpForHeavyItems(notnull EntityAI item)
-------------— Forces player to stand up when swapping to heavy item ----------------------—
DayZPlayerInstanceType
defined in C++
proto native DayZPlayerType GetDayZPlayerType()
returns appropriate DayZPlayerType
proto native DayZPlayerInstanceType GetInstanceType()
proto native float IsPlayerSpeaking()
-------------— speaking anim ----------------------—
DayZPlayerConstants
defined in C++
protected DayZPlayer m_pPlayer
data
int GetEyeZoomLevel()
returns eye zoom level, uses ECameraZoomType values
private void DayZPlayerType()
private void SDayZPlayerHeadingModel()
cannot be created from script
bool IsPlayerInStance(int pStanceMask)
-------------— camera additiona functions ----------------------—
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
proto void Print(void var)
Prints content of variable to console/log.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
array< string > TStringArray
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Acos(float c)
Returns angle in radians from cosinus.
static proto float AbsFloat(float f)
Returns absolute value.
static const float RAD2DEG
static proto int AbsInt(int i)
Returns absolute value.
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
bool Contains(string sample)
Returns true if sample is substring of string.
proto native int Hash()
Returns hash of string.
proto native int Length()
Returns length of string.
proto native void GetMovementState(HumanMovementState pState)
returns movement state (current command id, )
proto native HumanCommandDamage AddCommandModifier_Damage(int pType, float pDirection)
— modifier for light Damages
proto native HumanCommandMelee2 GetCommand_Melee2()
proto native HumanCommandVehicle StartCommand_Vehicle(Transport pTransport, int pTransportPositionIndex, int pVehicleSeat, bool fromUnconscious=false)
--— VEHICLE --—
proto native HumanCommandMove GetCommand_Move()
proto native HumanCommandFall StartCommand_Fall(float pYVelocity)
--— FALL --—
proto native HumanCommandMove StartCommand_Move()
returns current command ID
proto native void PhysicsSetSolid(bool pSolid)
proto native bool PhysicsIsFalling(bool pValidate)
returns true if physics controller is falling
proto native HumanCommandFullBodyDamage StartCommand_Damage(int pType, float pDirection)
--— FullBody Damages --—
proto native HumanCommandWeapons GetCommandModifier_Weapons()
returns interface for handling weapons
proto native HumanCommandVehicle GetCommand_Vehicle()
proto native HumanCommandFall GetCommand_Fall()
proto native HumanCommandActionCallback AddCommandModifier_Action(int pActionID, typename pCallbackClass)
adds action command modifier, creates callback instance for you
proto native HumanCommandDeathCallback StartCommand_Death(int pType, float pDirection, typename pCallbackClass)
--— Death --—
proto native HumanCommandUnconscious GetCommand_Unconscious()
proto native HumanCommandLadder GetCommand_Ladder()
proto native void UnlinkFromLocalSpace()
class HumanCommandMelee2 HumanCommandFall()
proto native HumanInputController GetInputController()
returns human input controller
proto native HumanCommandSwim StartCommand_Swim()
--— LADDER --—
proto native HumanItemAccessor GetItemAccessor()
proto native HumanCommandAdditives GetCommandModifier_Additives()
default (always-on modifiers)
proto native bool IsLeavingUncon()
return true if character transitions out of uncon
class HumanCommandWeapons HumanCommandAdditives()
private void HumanItemAccessor()
class SHumanGlobalSettings SHumanCommandMoveSettings()
class SHumanCommandSwimSettings SHumanCommandClimbSettings()