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();
72#ifdef FEATURE_NETWORK_RECONCILIATION
74class DayZPlayerImplementOwnerState : DayZPlayerOwnerState
76 float m_fLastHeadingDiff;
78 protected override event void Write(PawnStateWriter ctx)
82 ctx.Write(m_fLastHeadingDiff);
85 protected override event void Read(PawnStateReader ctx)
89 ctx.Read(m_fLastHeadingDiff);
93class DayZPlayerImplementMove : DayZPlayerMove
95 protected override event void Write(PawnMoveWriter ctx, PawnMove prev)
97 super.Write(ctx, prev);
101 protected override event void Read(PawnMoveReader ctx, PawnMove prev)
103 super.Read(ctx, prev);
208 #ifdef PLATFORM_CONSOLE
218 RegisterNetSyncVariableBoolSignal(
"m_TriggerPullPlayerOutOfVehicleSynch");
221#ifdef FEATURE_NETWORK_RECONCILIATION
222 protected override event typename GetOwnerStateType()
224 return DayZPlayerImplementOwnerState;
227 protected override event typename GetMoveType()
229 return DayZPlayerImplementMove;
232 protected override event void ObtainState( PawnOwnerState pState)
234 super.ObtainState(pState);
236 DayZPlayerImplementOwnerState state = DayZPlayerImplementOwnerState.Cast(pState);
238 state.m_fLastHeadingDiff = m_fLastHeadingDiff;
241 protected override event void RewindState(PawnOwnerState pState, PawnMove pMove, inout NetworkRewindType pRewindType)
243 super.RewindState(pState, pMove, pRewindType);
245 DayZPlayerImplementOwnerState state = DayZPlayerImplementOwnerState.Cast(pState);
247 if (pRewindType != NetworkRewindType.ADDITIVE)
249 m_fLastHeadingDiff = state.m_fLastHeadingDiff;
414 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
418 optics = weapon.GetAttachedOptics();
446 if (optic.HasEnergyManager())
447 optic.GetCompEM().SwitchOn();
455 if (optic.HasEnergyManager())
456 optic.GetCompEM().SwitchOff();
523 string text = super.GetDebugText();
525 text +=
"IsSimulationDisabled: " + GetIsSimulationDisabled() +
"\n";
550 for (
int i = 0; i < transport.CrewSize(); ++i)
552 if (transport.CrewMember(i) ==
this)
564 transport.CrewGetOut(crewIdx);
571#ifdef FEATURE_NETWORK_RECONCILIATION
577 identity.Possess(
this);
591 DisableSimulation(
false);
612 super.OnVariablesSynchronized();
626 PhysicsSetSolid(
true);
629 DayZPlayerVehicleCommandDeathCallback callbackVeh;
668 keepInLocalSpace =
true;
682#ifdef FEATURE_NETWORK_RECONCILIATION
688 identity.Possess(
this);
694 DisableSimulation(
false);
695 GetItemAccessor().HideItemInHands(
false);
704 PhysicsSetRagdoll(
true);
723 switch (pCurrentCommandID)
758 super.EEKilled(killer);
771 if (!
GetGame().GetMission().IsPlayerRespawning())
773 message =
"#dayz_implement_dead";
776 #ifdef PLATFORM_CONSOLE
805 if (
g_Game.GetMissionState() != DayZGame.MISSION_STATE_GAME)
813 if (m_KilledByHeadshot)
853 if (
GetGame().GetUIManager().IsDialogVisible())
865 if (
GetGame().GetUIManager().GetMenu())
907 int userDataType = 0;
908 if (!ctx.
Read(userDataType))
910 Error(
"DayZPlayer: OnInputForRemote - cannot read input type");
914 switch (userDataType)
926 Error(
"OnInputForRemote - unknown userDataType=" + userDataType);
933 int userDataType = 0;
934 if (!ctx.
Read(userDataType))
936 Error(
"DayZPlayer: OnInputFromServer - cannot read input type");
940 switch (userDataType)
946 Error(
"OnInputFromServer - unknown userDataType=" + userDataType);
959 GetItemAccessor().OnItemInHandsChanged();
964 GetItemAccessor().ResetWeaponInHands();
983 ItemOptics optic = weapon.GetAttachedOptics();
1012 weapon.StepZeroingUpAllMuzzles();
1023 weapon.StepZeroingDownAllMuzzles();
1030 HandleOptic(optic,
false, pInputs, pExitIronSights);
1036 if (weapon && weapon.IsInOptics())
1038 weapon.ExitOptics();
1062 bool autofire = weapon.GetCurrentModeAutoFire(weapon.GetCurrentMuzzle()) && weapon.IsChamberEjectable(weapon.GetCurrentMuzzle());
1063 int burst = weapon.GetCurrentModeBurstSize(weapon.GetCurrentMuzzle());
1064 int burst_count = weapon.GetBurstCount();
1065 if (!autofire && (burst < 2 || burst_count < 1))
1072 else if (autofire || burst > 1)
1074#ifdef DIAG_DEVELOPER
1076 if (burst_option == 0)
1081 if (autofire || burst_count < burst)
1088 weapon.ResetBurstCount();
1090#ifdef DIAG_DEVELOPER
1092 else if (burst_option == 1)
1094 if (burst > 1 && burst_count == burst)
1096 weapon.ResetBurstCount();
1098 else if (burst > 1 && burst_count < burst)
1115 #ifdef PLATFORM_CONSOLE
1118 if (!weapon.IsWaitingForActionFinish() && !
IsFighting())
1120 int muzzle_index = weapon.GetCurrentMuzzle();
1122 if (weapon.IsChamberFiredOut(muzzle_index))
1124 if (weapon.CanProcessWeaponEvents())
1129 pExitIronSights =
true;
1153 bool controllerPressIn;
1154 bool controllerPressOut;
1158 weapon =
Weapon_Base.Cast(optic.GetHierarchyParent());
1159 FOVcount = optic.GetStepFOVCount();
1160 controllerPressIn = input.
SyncedPress_ID(UAZoomInOpticsControllerHelper);
1166 optic.SetStepFOVIndex(0);
1170 if (controllerPressIn)
1172 if (!optic.StepFOVUp())
1176 optic.SetStepFOVIndex(0);
1179 if (weapon && weapon.CanEnterIronsights())
1195 weapon =
Weapon_Base.Cast(optic.GetHierarchyParent());
1196 FOVcount = optic.GetStepFOVCount();
1197 controllerPressOut = input.
SyncedPress_ID(UAZoomOutOpticsControllerHelper);
1200 if (!optic.StepFOVDown())
1202 if (controllerPressOut)
1204 if (FOVcount > 0 && (!weapon || !weapon.CanEnterIronsights()))
1206 optic.SetStepFOVIndex(FOVcount - 1);
1210 if (weapon && weapon.CanEnterIronsights())
1222 optic.SetStepFOVIndex(FOVcount - 1);
1259 SyncHitInfo greatest_hit;
1267 if (IsAlive() && !IsUnconscious() && data.m_HasSource &&
GetGame().GetMission().GetHud() &&
GetGame().
GetPlayer() ==
this)
1280 greatest_hit = data;
1283 else if (data.m_Fullbody)
1285 greatest_hit = data;
1360 vector targetDirection = GetDirection();
1363 targetDirection[1] = 0;
1364 toSourceDirection[1] = 0;
1369 float cosFi =
vector.
Dot(targetDirection, toSourceDirection);
1370 vector cross = targetDirection * toSourceDirection;
1374 pAnimHitDir = -pAnimHitDir;
1382 int invertHitDir = 0;
1385 pAnimHitFullbody =
false;
1388 switch (pDamageType)
1398 pAnimHitFullbody =
true;
1402 int impactBehaviour = 0;
1404 if (!IsUnconscious() && GetHealth(
"",
"Shock") > 25)
1407 if (pComponent ==
"Torso" || pComponent ==
"Head")
1412 if ((fireDamage > 80.0 || shockDamage > 40.0) && impactBehaviour == 1)
1413 pAnimHitFullbody =
true;
1425 pAnimHitFullbody =
true;
1433 vector targetDirection = GetDirection();
1436 targetDirection[1] = 0;
1437 toSourceDirection[1] = 0;
1442 float cosFi =
vector.
Dot(targetDirection, toSourceDirection);
1443 vector cross = targetDirection * toSourceDirection;
1448 if (invertHitDir > 0)
1452 pAnimHitDir = -pAnimHitDir;
1460 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
1462 m_TransportHitRegistered =
false;
1467 float animHitDirDeath;
1473 if (!m_DeathSyncSent)
1475 Man killer = source.GetHierarchyRootPlayer();
1480 m_KillerData.m_Killer = killer;
1481 m_KillerData.m_MurderWeapon = source;
1484 if (killer && killer.IsPlayer())
1487 if (dmgZone ==
"Brain")
1489 m_KilledByHeadshot =
true;
1490 if (m_KillerData.m_Killer == killer)
1491 m_KillerData.m_KillerHiTheBrain =
true;
1500 bool animHitFullbody;
1501 if (
EvaluateDamageHitAnimation(damageResult, damageType, source, dmgZone, ammo, modelPos, animType, animHitDir, animHitFullbody))
1505 bool skipSoundRequest =
false;
1506 if (damageType ==
DamageType.CUSTOM && GetCommand_Fall())
1509 if (!skipSoundRequest)
1515 if (animHitFullbody)
1575 if (actMenuValue != 0)
1605 if (IsUnconscious() || (GetCommand_Move() && GetCommand_Move().
IsLeavingUncon()))
1688 if (
IsRaised() && GetInputInterface().SyncedPress(
"UAGetOverControllerHelper"))
1716 bool CanClimb(
int climbType, SHumanCommandClimbResult climbRes)
1724 if (
IsRaised() && GetInputInterface().SyncedPress(
"UAGetOverControllerHelper"))
1736 if (
Class.
CastTo(entity,climbRes.m_GrabPointParent) && entity.IsHologram())
1738 if (
Class.
CastTo(entity,climbRes.m_ClimbStandPointParent) && entity.IsHologram())
1740 if (
Class.
CastTo(entity,climbRes.m_ClimbOverStandPointParent) && entity.IsHologram())
1786 bool bADSToggle =
false;
1787 bool exitSights =
false;
1794 if (playerPB.IsRolling())
1833 if (bADSToggle && !GetCommand_Melee2() && !
GetThrowing().IsThrowingModeEnabled())
1835 if (hia.IsItemInHandsWeapon() && playerPB.GetItemInHands() && playerPB.GetItemInHands().IsWeapon() && playerPB.GetWeaponManager() && !playerPB.GetWeaponManager().IsRunning())
1838 ItemOptics optic = weapon.GetAttachedOptics();
1839 bool switchToADS =
false;
1840 bool canUseIronsights = weapon.CanEnterIronsights();
1841 bool canUseOptics = optic != NULL;
1843 if (canUseIronsights || canUseOptics)
1851 switchToADS =
false;
1859 else if (switchToADS)
1862 if (weapon.GetWasIronSight() && !canUseIronsights)
1864 weapon.SetWasIronSight(
false);
1866 else if (!weapon.GetWasIronSight() && !canUseOptics)
1868 weapon.SetWasIronSight(
true);
1871 if (weapon.GetWasIronSight())
1876 else if (!weapon.GetWasIronSight() || (!canUseIronsights && canUseOptics))
1929 if (
GetGame().GetWorld().Is3rdPersonDisabled())
1979 float headingAngle = MiscGameplayFunctions.GetHeadingAngle(
this);
1982 float headingAngleDiff = 0.0;
1993 if (headingAngleDiff > 0.2)
1997 float timefilterconstant = 400 - (headingAngleDiff * 100);
2001 float volume = headingAngleDiff / 0.5;
2017 string soundSetName =
"Cloth_Body_longmove_TShirt_Soundset";
2019 string bodyClothName =
"";
2023 bodyClothName = attachment.GetAttachmentSoundType();
2026 if (bodyClothName !=
"")
2028 string path =
"CfgSoundTables CfgAttachmentSoundTables Cloth_Body_Longmove_LookupTable";
2031 for (
int i = 0; i < soundCount; i++)
2036 if (
name == bodyClothName)
2040 soundSetName = stringArray.Get(0);
2050 if (soundObjectBuilder != NULL)
2052 SoundObject soundObject = soundObjectBuilder.BuildSoundObject();
2054 if (soundObject != NULL)
2060 wave.SetVolumeRelative(volume);
2070 float volume2 = headingAngleDiff * 2;
2086 string soundSetName2 =
"walkProne_noHS_asphalt_ext_Char_SoundSet";
2089 if (surfaceType !=
"")
2091 string movementSurfaceType =
"walkProne_" + surfaceType;
2093 string path2 =
"CfgSoundTables CfgStepSoundTables walkProne_noHS_Char_LookupTable";
2096 for (
int i2 = 0; i2 < soundCount2; i2++)
2101 if (name2 == movementSurfaceType)
2105 soundSetName2 = stringArray2.Get(0);
2107 delete stringArray2;
2115 if (soundObjectBuilder2 != NULL)
2117 SoundObject soundObject2 = soundObjectBuilder2.BuildSoundObject();
2119 if (soundObject2 != NULL)
2125 wave2.SetVolumeRelative(volume2);
2174 override void CommandHandler(
float pDt,
int pCurrentCommandID,
bool pCurrentCommandFinished)
2178 vector playerPosition = PhysicsGetPositionWS();
2186 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
2190 bool isWeapon = entityInHands && entityInHands.IsInherited(
Weapon);
2192 bool updateAimingMdfr =
false;
2196 updateAimingMdfr =
true;
2201 updateAimingMdfr =
true;
2205 if (updateAimingMdfr)
2207 if (isRaisedNow && isWeapon)
2223 bool exitIronSights =
false;
2228 bool exitOptic =
false;
2256 if (
m_Swimming.CheckSwimmingStart( waterLevel ) )
2261 StartCommand_Swim();
2268 if (pCurrentCommandFinished)
2284 if (PhysicsIsFalling(
true))
2286 StartCommand_Fall(0);
2294 StartCommand_Swim();
2298 StartCommand_Move();
2300 if (GetHumanInventory().GetEntityInHands())
2395 OnLand(pCurrentCommandID, fallDamageData);
2396 npar = type.GetNoiseParamsLandLight();
2399 else if (fallDamageData.
m_Height < 3.0)
2406 OnLand(pCurrentCommandID, fallDamageData);
2407 npar = type.GetNoiseParamsLandLight();
2410 else if (fallDamageData.
m_Height < 5.0)
2413 OnLand(pCurrentCommandID, fallDamageData);
2414 npar = type.GetNoiseParamsLandHeavy();
2420 OnLand(pCurrentCommandID, fallDamageData);
2421 npar = type.GetNoiseParamsLandHeavy();
2427 OnPlayerRecievedHit();
2440 else if (PhysicsIsFalling(
false))
2443 StartCommand_Fall(0);
2460 hcls.m_fFwMaxDistance = 3;
2462 hcls.m_fFwMaxDistance = 1.2;
2464 SHumanCommandClimbResult ret;
2490 if (amplitude > 0.1 || force)
2493 ad.SetTalking(
true);
2510 case VoiceLevelWhisper:
2511 vonpar = pt.GetNoiseParamsWhisper();
2513 case VoiceLevelTalk:
2514 vonpar = pt.GetNoiseParamsTalk();
2516 case VoiceLevelShout:
2517 vonpar = pt.GetNoiseParamsShout();
2527 ad.SetTalking(
false);
2539 m_Throwing.HandleThrowing(hic, hcw, entityInHands, pDt);
2583 playerDebug.CommandHandler();
2615 EntityAI item_in_hands = player.GetHumanInventory().GetEntityInHands();
2616 if (item_in_hands != NULL && player.CanDropEntity(item_in_hands) &&
GetGame().
GetPlayer().GetHumanInventory().CanRemoveEntityInHands())
2618 player.PredictiveDropEntity(item_in_hands);
2690 ad.SetInjured(v,
true);
2697 ad.SetExhaustion(v,
true);
2717 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
2720 optics = weapon.GetAttachedOptics();
2721 else if (entityInHands)
2767 return transport.Get3rdPersonCameraType();
2928 #ifdef PLATFORM_CONSOLE
2929 if (
GetUApi().GetInputByID(UAVoiceModifierHelper).LocalValue() == 0)
2944 int userDataTypeParam = 0;
2945 if (!ctx.
Read(userDataTypeParam))
2947 Error(
"DayZPlayerImplement: cannot read input type");
2964 if (ctx.
Read(target))
2970 if (ctx.
Read(hitPos))
2975 int hitZoneIdx = -1;
2976 if (ctx.
Read(hitZoneIdx))
2981 int finisherType = -1;
2982 if (ctx.
Read(finisherType))
2999 switch (pJunctureID)
3007 SyncHitInfo data =
new SyncHitInfo;
3021 switch (boots.GetAttachmentSoundType())
3039 switch (attachment.GetAttachmentSoundType())
3042 return AnimUpperBodyType.NylonJacket;
3044 return AnimUpperBodyType.TShirt;
3046 return AnimUpperBodyType.WoolShirt;
3048 return AnimUpperBodyType.HeavyJacket;
3049 case "LeatherJacket":
3050 return AnimUpperBodyType.LeatherJacket;
3052 return AnimUpperBodyType.Coat;
3053 case "ChemlonDress":
3054 return AnimUpperBodyType.ChemlonDress;
3056 return AnimUpperBodyType.Ghillie;
3058 return AnimUpperBodyType.Chainmail;
3062 return AnimUpperBodyType.None;
3070 switch (back.GetAttachmentSoundType())
3073 return AnimBackType.Small;
3075 return AnimBackType.Military;
3077 return AnimBackType.Outdoor;
3079 return AnimBackType.Ghillie;
3083 return AnimBackType.None;
3092 AnimRangedWeaponType shoulderAttType = AnimRangedWeaponType.None;
3093 AnimRangedWeaponType meleeAttType = AnimRangedWeaponType.None;
3095 if (shoulderAttachment)
3097 switch (shoulderAttachment.GetAttachmentSoundType())
3101 shoulderAttType = AnimRangedWeaponType.Shotgun;
3106 shoulderAttType = AnimRangedWeaponType.Rifle;
3111 if (meleeAttachment)
3113 switch (meleeAttachment.GetAttachmentSoundType())
3117 meleeAttType = AnimRangedWeaponType.Shotgun;
3122 meleeAttType = AnimRangedWeaponType.Rifle;
3128 if (shoulderAttType == AnimRangedWeaponType.Shotgun || meleeAttType == AnimRangedWeaponType.Shotgun)
3129 return AnimRangedWeaponType.Shotgun;
3131 if (shoulderAttType == AnimRangedWeaponType.Rifle || meleeAttType == AnimRangedWeaponType.Rifle)
3132 return AnimRangedWeaponType.Rifle;
3134 return AnimRangedWeaponType.None;
3142 g_Game.SurfaceUnderObjectByBoneCorrectedLiquid(
this, limbType, surfaceType, liquidType);
3164 if (noisePar != null)
3178 GetMovementState(state);
3186 if (pUserInt % 2 == 1)
3189 if (surface.
Length() == 0)
3195 if (surface.
Length() == 0)
3199 if (surface.
Length() != 0)
3207 if (stepParticleID > 0)
3218 if (surface2.
Length() != 0)
3226 orientation =
Vector(0, 0, 0);
3229 excludedObjects.Insert(
this);
3232 if (
GetGame().IsBoxCollidingGeometry(
GetPosition(), orientation, edgeLength, ObjIntersectView, ObjIntersectNone, excludedObjects, collidedObjects))
3234 for (
int i = 0; i < collidedObjects.Count(); ++i)
3240 if (colObject && colObject.HasPlayerCollisionSound())
3242 for (
int j = 0; j < type.GetVegetationSounds().
Count(); ++j)
3251 if (vegSoundObject != NULL)
3254 PlaySound(vegSoundObject, vegSoundObjectBuilder);
3266 SoundObject soundObject = soundBuilder.BuildSoundObject();
3267 if (soundObject != NULL)
3279 float noiseMultiplier = 0;
3283 noiseParams = type.GetNoiseParamsStand();
3285 noiseParams = type.GetNoiseParamsCrouch();
3287 noiseParams = type.GetNoiseParamsProne();
3290 Debug.
Log(
string.Format(
"Wrong stance, id: %1 using backup with stand stance (id: 0)", state.
m_iStanceIdx));
3291 noiseParams = type.GetNoiseParamsStand();
3296 AddNoise(noiseParams, noiseMultiplier);
3309 if (pEventType ==
"Sound")
3314 if (eventReplaceID > 0)
3323 else if (pEventType ==
"SoundWeapon")
3328 if (eventReplaceID > 0)
3337 else if (pEventType ==
"SoundAttachment")
3341 else if (pEventType ==
"SoundVoice")
3356 Debug.
Log(
"OnSoundEvent: Unknown sound event \"" + pEventType +
"\"");
3369 AnimSoundEvent soundEvent = null;
3373 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
3374 if (entityInHands && entityInHands.IsInherited(
ItemBase))
3378 if (item.HasQuantity())
3379 quantity = (
float)item.GetQuantity() / (item.GetQuantityMax() - item.GetQuantityMin());
3384 if (soundEvent == null)
3387 soundEvent = type.GetSoundWeaponEvent(pUserInt);
3390 if (soundEvent != null)
3392 if (!
GetGame().IsDedicatedServer())
3397 builder.AddVariable(
"quantity", quantity);
3398 builder.AddVariable(
"interior", IsSoundInsideBuilding());
3400 SoundObject soundObject = builder.BuildSoundObject();
3401 if (soundObject != NULL)
3406 if (pUserString ==
"StopOnAnimEnd")
3429 pUserString.
Split(
",", attachments);
3430 for (
int i = 0; i < attachments.Count(); i++)
3432 int attachmentHash = -1;
3433 if (attachments[i] ==
"shoulder")
3435 else if (attachments[i] ==
"body")
3437 else if (attachments[i] ==
"back")
3442 if (soundBuilder != NULL)
3444 SoundObject soundObject = soundBuilder.BuildSoundObject();
3445 if (soundObject != NULL)
3458 soundObjectBuilder.AddVariable(
"laddertype", 1);
3462 soundObjectBuilder.AddVariable(
"laddertype", 0);
3469 soundObjectBuilder.AddVariable(
"bare", 1);
3470 soundObjectBuilder.AddVariable(
"sneakers", 0);
3471 soundObjectBuilder.AddVariable(
"boots", 0);
3475 soundObjectBuilder.AddVariable(
"bare", 0);
3476 soundObjectBuilder.AddVariable(
"sneakers", 1);
3477 soundObjectBuilder.AddVariable(
"boots", 0);
3481 soundObjectBuilder.AddVariable(
"bare", 0);
3482 soundObjectBuilder.AddVariable(
"sneakers", 0);
3483 soundObjectBuilder.AddVariable(
"boots", 1);
3490 DayZPlayerTypeAnimTable table = type.GetSoundTable();
3491 AnimSoundEvent soundEvent;
3494 soundEvent = table.GetSoundEvent(pUserInt);
3497 if (soundEvent != NULL)
3499 if (!
GetGame().IsDedicatedServer())
3502 if (GetCommand_Ladder())
3506 objectBuilder.AddEnvSoundVariables(
GetPosition());
3508 SoundObject soundObject = objectBuilder.BuildSoundObject();
3509 if (soundObject != NULL)
3514 if (pUserString ==
"StopOnAnimEnd")
3521 if (soundEvent.m_NoiseParams != NULL)
3543 if (mask || head_gear)
3545 string category_mask;
3546 string category_headgear;
3549 int priority_headgear;
3553 category_mask = mask.ConfigGetString(
"soundVoiceType");
3554 priority_mask = mask.ConfigGetInt(
"soundVoicePriority");
3558 category_headgear = head_gear.ConfigGetString(
"soundVoiceType");
3559 priority_headgear = head_gear.ConfigGetInt(
"soundVoicePriority");
3562 if (priority_headgear >= priority_mask && category_headgear !=
"")
3564 category = category_headgear;
3568 category = category_mask;
3583 int maleVoiceType = 0;
3584 int femaleVoiceType = 0;
3585 if (player.IsMale())
3587 maleVoiceType = player.GetVoiceType();
3591 femaleVoiceType = player.GetVoiceType();
3594 soundBuilder.AddVariable(
"male", maleVoiceType);
3595 soundBuilder.AddVariable(
"female", femaleVoiceType);
3598 SoundObject soundObject = soundBuilder.BuildSoundObject();
3599 if (soundObject != NULL)
3602 wave =
PlaySound(soundObject, soundBuilder);
3621 bool unconscious = IsUnconscious();
3624 if (ib && (
PlayerBase.DEBUG_INVENTORY_ACCESS || !IsAlive() || restrained || unconscious || ib.CanBeMovedOverride()))
3653 if (!IsAlive() || player.IsUnconscious())
3663 super.OnRPC(sender, rpc_type, ctx);
3665 if (rpc_type ==
ERPCs.RPC_DAYZPLAYER_DEBUGSERVERWALK)
3667 Print(
"ERPCs.RPC_DAYZPLAYER_DEBUGSERVERWALK");
3669 Param1<bool> rp =
new Param1<bool>(
false);
3672 GetInputController().OverrideMovementSpeed(rp.param1, 1);
3673 GetInputController().OverrideAimChangeX(rp.param1, 0.01);
3688 return fall.PhysicsLanded();
3724 StartCommand_Move();
3778 RegisterTransportHit(transport);
3828#ifdef DIAG_DEVELOPER
3831 return Weapon_Base.Cast(GetHumanInventory().CreateInHands(type));
void syncDebugPrint(string s)
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
proto native CEApi GetCEApi()
Get the CE API.
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DamageType
exposed from C++ (do not change)
bool ModCommandHandlerInside(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
proto native void ResetDeathCooldown()
bool ModCommandHandlerBefore(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
bool ModCommandHandlerAfter(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
void DayZPlayerImplementFallDamage(DayZPlayer pPlayer)
void DayZPlayerImplementMeleeCombat(DayZPlayerImplement player)
void DayZPlayerMeleeFightLogic_LightHeavy(DayZPlayerImplement player)
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 ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
void PlayerSoundEventHandler(PlayerBase player)
override void OnRPC(ParamsReadContext ctx)
void PluginDayzPlayerDebug()
PluginManager GetPluginManager()
Returns registred plugin by class type, better is to use global funtion GetPlugin(typename plugin_typ...
void ReplaceSoundEventHandler(PlayerBase player)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native NoiseSystem GetNoiseSystem()
proto native World GetWorld()
override ScriptCallQueue GetCallQueue(int call_category)
proto native AbstractSoundScene GetSoundScene()
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native int GetVoiceLevel(Object player=null)
Get voice level of VoN (on both client and server) (VoiceLevelWhisper = 0, VoiceLevelNormal = 1,...
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native Input GetInput()
proto native Mission GetMission()
Super root of all classes in Enforce script.
void ProcessSoundEvent(string pEventType, string pUserString, int pUserInt)
void DepleteStamina(EStaminaModifiers modifier, float dT=-1)
bool IsWeaponDebugEnabled()
void ResetWeaponRaiseProgress()
void SendSoundEventEx(EPlayerSoundEventID id, int param=0)
DayZPlayerImplementThrowing GetThrowing()
void LockControls(bool state)
override void StopDeathDarkeningEffect()
override bool IsShootingFromCamera()
bool m_IsUnconsciousFalling
bool m_HandheldOpticsInUse
ref PlayerSoundEventHandler m_PlayerSoundEventHandler
void OverrideShootFromCamera(bool pState)
WeaponManager GetWeaponManager()
void SendCompleteWeaponRaiseJuncture()
AnimBackType GetBackAttachmentType()
void ShowDeadScreen(bool show, float duration)
void OverrideSlidePoseAngle(float value)
movement sliding override, originally for FB gestures
bool IsWeaponRaiseCompleted()
ref DayZPlayerImplementJumpClimb m_JumpClimb
bool m_WeaponRaiseCompleted
measures time from the weapon raise start to complete raise (once per)
bool IsTryingHoldBreath()
void ResetDamageHitState(bool resetTimer)
void SetFallYDiff(float value)
bool IsLanded(int pCurrentCommandID)
void CompleteWeaponRaise()
float m_SprintedTimePerStanceMin
void OnSoundEvent(string pEventType, string pUserString, int pUserInt)
void ShowWeaponDebug(bool show)
bool m_ShouldBeUnconscious
void SetIronsights(bool value)
ref array< AbstractWave > m_PerformedActionSounds
void TriggerPullPlayerOutOfVehicle()
ref Timer m_ADSAutomationTimer
bool IsFBSymptomPlaying()
AbstractWave ProcessVoiceEvent(string pEventType, string pUserString, int pUserInt)
bool CheckForRespawn(EntityAI item)
override bool IsEyeZoom()
Legacy.
bool m_IsShootingFromCamera
void ProcessAttachmentEvent(string pEventType, string pUserString, int pUserInt)
void RequestSoundEventEx(EPlayerSoundEventID id, bool from_server_and_client=false, int param=0)
float GetSlidePoseAngle()
void OnParticleEvent(string pEventType, string pUserString, int pUserInt)
void ~DayZPlayerImplement()
bool HandleDamageHit(int pCurrentCommandID)
void SetIsInThirdPerson(bool state)
bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
void SetSuicide(bool state)
bool m_CameraOpticsAimOverride
bool ModCommandHandlerBefore(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
void HandleWeapons(float pDt, Entity pInHands, HumanInputController pInputs, out bool pExitIronSights)
ref DayZPlayerMeleeFightLogic_LightHeavy m_MeleeFightLogic
void EOnContact(IEntity other, Contact extra)
void CheckAnimationOverrides()
AbstractWave PlaySound(SoundObject so, SoundObjectBuilder sob)
bool ProcessJumpOrClimb(float pDt, int pCurrentCommandID)
bool m_IsFireWeaponRaised
ref DayZPlayerImplementAiming m_AimingModel
void RequestSoundEvent(EPlayerSoundEventID id, bool from_server_and_client=false)
bool m_ProcessLiftWeaponState
string GetSurfaceType(SurfaceAnimationBone limbType)
ref DeathEffectTimer m_DeathEffectTimer
void SetClimbingLadderType(string value)
static const float DEFAULT_DYING_TIME
ref DayZPlayerImplementThrowing m_Throwing
override float GetCurrentWaterLevel()
bool ModCommandHandlerAfter(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
void HideClothing(ItemOptics optic, bool state)
bool CanPickupHeavyItemSwap(notnull EntityAI item1, notnull EntityAI item2)
override void SetCurrentWaterLevel(float pWaterLevel)
void TriggerPullPlayerOutOfVehicleImpl()
bool m_ContinueFirearmMelee
bool m_TriggerPullPlayerOutOfVehicleSynch
bool IsAlreadyInFallingCommand(int pCurrentCommandID)
int m_LastCommandBeforeUnconscious
bool IsInFBEmoteState()
Checks if fullbody animation or specific locked state is active in emote manager.
bool CanConsumeStamina(EStaminaConsumers consumer)
Implementations only! - used on PlayerBase.
bool OnLand(int pCurrentCommandID, FallDamageData fallDamageData)
float m_TestDamageCounter
override void OnItemInHandsChanged()
static const int DEAD_SCREEN_DELAY
ref DayZPlayerImplementMeleeCombat m_MeleeCombat
override int CameraHandler(int pCameraMode)
int m_DebugWeaponChangeShowSlot
override int GetEyeZoomLevel()
Transport GetTransportCache()
Get the transport that was cached when entering unconsciousness.
string m_DebugWeaponChangeItem
bool CanStartConsumingStamina(EStaminaConsumers consumer)
bool PlaySoundEvent(EPlayerSoundEventID id, bool from_anim_system=false, bool is_from_server=false)
bool ModCommandHandlerInside(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
override bool IsInThirdPerson()
void ProcessFeetDamageServer(int pUserInt)
int m_PullPlayerOutOfVehicleState
void SetVariablesLadderSoundObjectBuilder(SoundObjectBuilder soundObjectBuilder)
DayZPlayerImplementMeleeCombat GetMeleeCombat()
void SetHandheldOpticsInUse(bool state)
ref array< ref SyncHitInfo > m_SyncedHitDataArray
void OnSyncJuncture(int pJunctureID, ParamsReadContext pCtx)
DayZPlayerImplementFallDamage GetFallDamage()
ref WeaponDebug m_WeaponDebug
float m_LastHeadingAngleBlock
void OnLadder(float delta_time, HumanMovementState pState)
called every command handler tick when player is on ladder
void AttenuateSoundIfNecessary(SoundObject soundObject)
bool m_ProcessWeaponRaiseCompleted
void EvaluateDamageHit(int pCurrentCommandID)
Must be ran at the start of CommandHandler before Jump is triggered.
void OnMovementChanged()
Event, called when HumanMovementState.m_iMovement changes...walk, run, sprint, etc....
bool CanClimb(int climbType, SHumanCommandClimbResult climbRes)
bool m_PullPlayerOutOfVehicleKeepsInLocalSpace
override bool HeadingModel(float pDt, SDayZPlayerHeadingModel pModel)
is replayed after correction when 'NetworkRewindType.REPLAY' is used
void SetOptics(bool value)
int m_DebugWeaponChangeStage
bool IsInFullbodyDamageAnimation()
void SetReturnToOptics(bool state)
ref Timer m_FightEndBlendTimer
bool PlaySoundEventType(ESoundEventType soundType, int soundEventID, int param=0)
Handle sound event by respective sound handler based on its type.
float m_LastHeadingAngleBlock2
bool m_isFBsymptomPlaying
override void OnInputForRemote(ParamsReadContext ctx)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
event from damage system
override void EEKilled(Object killer)
string m_ClimbingLadderType
float m_DebugDirectionVal
VKOSTIK - tady dat 0 misto -1.
AnimRangedWeaponType GetShoulderAttachmentType()
bool m_AimingFinisherStarted
void CommandHandlerDebug(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
int GetTypeOfDeath(int pCurrentCommandID)
ref HumanMovementState m_MovementState
time step for gradual update of dead screen visibilibty up to full visbility [s]
ref DayZPlayerImplementFallDamage m_FallDamage
int m_ActionSoundCategoryHash
void SendDeathJuncture(int pAnimTypeDeath, float pAnimHitDirDeath)
bool IsHandheldOpticsInUse()
bool m_CameraEyeZoom
DEPRECATED.
override void OnVariablesSynchronized()
int m_LastSurfaceUnderHash
AnimBootsType GetBootsType()
bool m_IsTryingHoldBreath
void SimulateDeath(bool state)
DayZPlayerInventory GetDayZPlayerInventory()
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
static const float DYING_PROGRESSION_TIME
how long does it take to full death screen [s]
bool IsFireWeaponRaised()
bool HandleDeath(int pCurrentCommandID)
const float HIT_INTERVAL_MIN
void DayZPlayerImplement()
constructor
bool CheckForTakeItem(EntityAI item)
override string GetDebugText()
AnimUpperBodyType GetBodyAttachmentType()
void ProcessWeaponEvent(string pEventType, string pUserString, int pUserInt)
bool CanPickupHeavyItem(notnull EntityAI item)
-------------— Checks if player can pick up heavy item ----------------------—
bool m_ProcessFirearmMeleeHit
SHumanCommandMoveSettings m_MoveSettings
void OnJumpEnd(int pLandType=0)
void AddNoise(NoiseParams noisePar, float noiseMultiplier=1.0)
DayZPlayerImplementAiming GetAimingModel()
float m_DeathDarkeningCurrentTime
bool PlaySoundEventEx(EPlayerSoundEventID id, bool from_anim_system=false, bool is_from_server=false, int param=0)
bool CheckForDropItem(EntityAI item)
void HandleOptic(notnull ItemOptics optic, bool inHands, HumanInputController pInputs, out bool pExitOptics)
bool EvaluateDeathAnimation(int pDamageType, EntityAI pSource, string pAmmoType, out int pAnimType, out float pAnimHitDir)
selects animation type and direction based on damage system data
float m_CurrentWaterLevel
void OnStepEvent(string pEventType, string pUserString, int pUserInt)
void ResetDeathStartTime()
override bool AimingModel(float pDt, SDayZPlayerAimingModel pModel)
ref ReplaceSoundEventHandler m_ReplaceSoundEventHandler
DayZPlayerMeleeFightLogic_LightHeavy GetMeleeFightLogic()
void SendSoundEvent(EPlayerSoundEventID id)
void SwitchOptics(ItemOptics optic, bool state)
void OnInputUserDataReceived(ParamsReadContext ctx)
override void CommandHandler(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
override void OnInputFromServer(ParamsReadContext ctx)
ref DayZPlayerImplementSwimming m_Swimming
void SetDeathDarknessLevel(float duration, float tick_time)
ECameraZoomType m_CameraEyeZoomLevel
Transport m_TransportCache
static const int DAYZCAMERA_OPTICS
optics
static const int DAYZCAMERA_1ST
1st person camera
static const int DAYZCAMERA_3RD_PRO_RAISED
3rd - laying raised
static const int DAYZCAMERA_3RD_CLIMB
climb / vault
static const int DAYZCAMERA_3RD_CRO_RAISED
3rd - crouch
static const int DAYZCAMERA_3RD_ERC_SPR
3rd - standing sprint
static const int DAYZCAMERA_3RD_PRO
3rd - laying
static const int DAYZCAMERA_3RD_ERC
3rd - standing
static const int DAYZCAMERA_IRONSIGHTS
ironsights camera
static const int DAYZCAMERA_3RD_CRO
3rd - crouch
static const int DAYZCAMERA_3RD_ERC_RAISED
3rd - standing raised
static const int DAYZCAMERA_1ST_UNCONSCIOUS
unconscious
static const int DAYZCAMERA_3RD_ERC_RAISED_MELEE
3rd - laying raised
static const int DAYZCAMERA_1ST_VEHICLE
vehicle 1st person
static const int DAYZCAMERA_3RD_JUMP
jump
override void OnSimulationEnd()
override bool ShouldSimulationBeDisabled()
static bool NoHeading(float pDt, SDayZPlayerHeadingModel pModel, out float pLastHeadingDiff)
static bool RotateOrient(float pDt, SDayZPlayerHeadingModel pModel, out float pLastHeadingDiff)
static bool ClampHeading(float pDt, SDayZPlayerHeadingModel pModel, out float pLastHeadingDiff)
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_DEATH
static bool ReadDamageHitParamsEx(ParamsReadContext pCtx, out SyncHitInfo pData)
static void SendDeath(DayZPlayer pPlayer, int pType, float pHitDir)
static const int SJ_DAMAGE_HIT
static bool ReadDeathParams(ParamsReadContext pCtx, out int pType, out float pHitDir)
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 bool IsFinisher()
proto native void Cancel()
cancels command melee and goes to HumanCommandMove
proto native float GetCurrentMovementSpeed()
0,1,2..3 idle, walk, run, sprint
proto native bool IsStandingFromBack()
return true if prone on back is chaning to crounch/stand
proto native bool IsChangingStance()
returns true if character is changing stance
proto native bool IsWakingUp()
proto native bool IsInWater()
proto native bool IsOnLand()
proto native Transport GetTransport()
proto native bool IsGettingIn()
proto native void ProcessLeaveEvents()
proto native bool WasGearChange()
proto native bool IsGettingOut()
proto native bool IsActionFinished()
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....
proto native bool StartAction(WeaponActions pAction, int pActionType)
start reload,mechanism,chambering,unjam ...
proto native void SetADS(bool pState)
sets head tilt to optics
proto native int IsEvent()
return -1 when there is no event, otherwise it returns pId of event from animation
HumanInventory... with FSM (synchronous, no anims)
bool m_bJumpAllowed
default false
int m_StanceRotation[6]
6 stances -> all has movement mask, STANCEIDX_ ... is index
int m_iMovement
current stance (DayZPlayerConstants.STANCEIDX_ERECT, ...), only if the command has a stance
int m_iStanceIdx
current command's id
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
proto native bool StepZeroingUp()
sets zeroing to next defined (respective to current) value in zeroing config array
proto native bool ExitOptics()
switches out of optics mode (if possible)
proto native bool IsInOptics()
is weapon in optics mode or not
proto native bool IsUsingWeaponIronsightsOverride()
is optics using ironsights override settings or not
proto native bool EnterOptics()
switches to optics mode if possible
proto native bool StepZeroingDown()
sets zeroing to previous (respective to current) defined value in zeroing config array
static bool IsSyncLogEnable()
static void PlayVegetationCollideParticles(Object object, DayZPlayerImplement player)
static float GetNoiseMultiplier(DayZPlayerImplement playerImplement)
static float GetNoiseReduction(Weather weather)
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 float FULL_SPRINT_DELAY_DEFAULT
static const float HEAVY_HIT_THRESHOLD
static const int CHECK_EVERY_N_STEP
The class that will be instanced (moddable)
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 ...
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 bool Read(void value_in)
static int GetStepsParticleID(string surface_name)
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 ScreenFadeOut(float duration)
void ShowUICursor(bool visible)
proto native void CloseDialog()
proto native void ScreenFadeIn(float duration, string text, int backgroundColor, int textColor)
SoundObjectBuilder GetSoundObjectBuilder()
TIntArray GetAnimEventIds()
script counterpart to engine's class Weapon
proto native bool Is3rdPersonDisabled()
proto void SetVoiceOn(bool listening, bool toggled=false)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
proto float Normalize()
Normalizes vector. Returns length.
proto native void SetVerticalMinimumAimLimit(float value)
sets vertical minimum aim limit for a player
void SDayZPlayerHeadingModel()
cannot be created from script
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++
int GetEyeZoomLevel()
returns eye zoom level, uses ECameraZoomType values
proto native bool IsPlayerInStance(int pStanceMask)
-------------— camera additiona functions ----------------------—
Serializer ParamsReadContext
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 int AbsInt(int i)
Returns absolute value.
static const float RAD2DEG
static proto float AbsFloat(float f)
Returns absolute value.
proto native AbstractWave Play3D(SoundObject soundObject, SoundObjectBuilder soundBuilder)
proto native void SetSoundVolume(float vol, float time)
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
class JsonUndergroundAreaTriggerData GetPosition
class SoundObject SoundParams(string name)
proto native void SetSpeechExVolume(float vol, float time)
proto native void SetPosition(vector position)
Note: Sets the position locally if parented, retrieves globally with the sound offset.
proto native void SetVOIPVolume(float vol, float time)
proto native void SetKind(WaveKind kind)
proto native void SetRadioVolume(float vol, float time)
proto native void SetMusicVolume(float vol, float time)
proto native int Length()
Returns length of string.
proto native int Hash()
Returns hash of string.
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
class HumanCommandLadder HumanCommandSwim()
class HumanCommandMelee2 HumanCommandFall()
proto native bool IsLeavingUncon()
return true if character transitions out of uncon
class HumanCommandWeapons HumanCommandAdditives()
class SHumanGlobalSettings SHumanCommandMoveSettings()
class SHumanCommandSwimSettings SHumanCommandClimbSettings()