6#ifdef FEATURE_NETWORK_RECONCILIATION
7class PlayerBaseOwnerState : DayZPlayerImplementOwnerState
9 protected override event void Write(PawnStateWriter ctx)
14 protected override event void Read(PawnStateReader ctx)
20class PlayerBaseMove : DayZPlayerImplementMove
24 float m_fStaminaValue;
25 float m_fStaminaCapacity;
26 float m_fStaminaDepletion;
28 bool m_bStaminaSynced;
29 float m_fStaminaSyncedValue;
30 float m_fStaminaSyncedCapacity;
32 protected void PlayerBaseMove()
34 m_bStaminaSynced =
false;
37 protected override event void Write(PawnMoveWriter ctx, PawnMove prev)
39 super.Write(ctx, prev);
42 protected override event void Read(PawnMoveReader ctx, PawnMove prev)
44 super.Read(ctx, prev);
51 const int SIMPLIFIED_SHOCK_CAP = 63;
52 const int SHAKE_LEVEL_MAX = 7;
53 private int m_LifeSpanState;
54 private int m_LastShavedSeconds;
55 private int m_BloodType;
56 private bool m_HasBloodTypeVisible;
57 private bool m_LiquidTendencyDrain;
58 private bool m_FlagRaisingTendency;
59 private int m_HasBloodyHandsVisible;
71 private int m_StoreLoadVersion;
72 const int ACT_STORE_SAVE_VERSION = 4;
77 private PluginPlayerStatus m_ModulePlayerStatus;
78 PluginConfigEmotesProfile m_ConfigEmotesProfile;
225 #ifdef DIAG_DEVELOPER
226 int m_IsInsideTrigger;
227 bool m_CanBeTargetedDebug;
229 bool m_PresetSpawned;
230 ref CameraToolsMenuClient m_CameraToolsMenuClient;
231 protected PluginTargetTemperature m_TargetTemperatureDiag;
238 #ifdef DIAG_DEVELOPER
362 m_StoreLoadVersion = 0;
363 m_IsCraftingReady =
false;
365 m_LastShavedSeconds = 0;
367 m_HasBloodTypeVisible =
false;
369 m_LifespanLevelLocal = -1;
371 m_CorpseStateLocal = 0;
372 m_HasBloodyHandsVisible = 0;
373 m_PlayerLoaded =
false;
374 m_PlayerSelected =
false;
375 m_ProcessUIWarning =
false;
376 m_FlagRaisingTendency =
true;
377 m_LiquidTendencyDrain =
false;
378 m_UAParamMessage =
new Param1<string>(
"");
379 m_UnconParam =
new Param1<float>(0);
380 m_DeathDarkeningParam =
new Param1<float>(0);
386 m_VisibilityCoef = 1.0;
389 m_ActionQBControl =
false;
390 m_QuickBarHold =
false;
391 m_HideHairAnimated =
true;
392 m_WorkingNVGHeadset =
false;
393 m_LoweredNVGHeadset =
false;
394 m_AreHandsLocked =
false;
396 m_AnimCommandStarting = HumanMoveCommandID.None;
398 m_CanDisplayHitEffectPPE =
true;
399 m_HeadingRestrictData =
new HeadingRestrictData();
401 #ifdef DIAG_DEVELOPER
402 m_CanBeTargetedDebug =
true;
409 m_InjuryHandler =
new InjuryAnimationHandler(
this);
418 m_NotifiersManager =
new NotifiersManager(
this);
420 m_BleedingManagerServer =
new BleedingSourcesManagerServer(
this);
421 m_Environment =
new Environment(
this);
424 m_PlayerSoundManagerServer =
new PlayerSoundManagerServer(
this);
430 m_SymptomManager =
new SymptomManager(
this);
431 m_ModuleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
433 m_TrasferValues =
new TransferValues(
this);
435 m_SoftSkillsManager =
new SoftSkillsManager(
this);
437 m_WeaponManager =
new WeaponManager(
this);
438 m_DebugMonitorValues =
new DebugMonitorValues(
this);
441 if (!
g_Game.IsDedicatedServer())
443 m_MeleeDebug =
false;
444 m_UALastMessage =
"";
445 m_UALastMessageTimer =
new Timer;
446 m_InventoryActionHandler =
new InventoryActionHandler(
this);
447 m_BleedingManagerRemote =
new BleedingSourcesManagerRemote(
this);
449 m_StanceIndicator =
new StanceIndicator(
this);
451 ClientData.AddPlayerBase(
this);
453 m_ProcessAddEffectWidgets =
new array<int>;
454 m_ProcessRemoveEffectWidgets =
new array<int>;
455 m_ActiveNVTypes =
new array<int>;
456 m_ProcessAddGlassesEffects =
new array<int>;
457 m_ProcessRemoveGlassesEffects =
new array<int>;
460 m_ActionManager = NULL;
462 m_ConfigEmotesProfile = PluginConfigEmotesProfile.Cast(
GetPlugin(PluginConfigEmotesProfile));
466 PluginConfigDebugProfileFixed m_ConfigDebugProfileFixed = PluginConfigDebugProfileFixed.Cast(
GetPlugin(PluginConfigDebugProfileFixed));
468 PluginDeveloper m_Developer = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
470 PlayerBase player =
this;
475 if (player && default_preset !=
"")
478 m_ConfigDebugProfileFixed.GetPresetItems(default_preset, preset_array);
480 bool is_preset_fixed =
true;
481 if (preset_array.Count() == 0)
484 is_preset_fixed =
false;
487 if (preset_array.Count() > 0)
489 m_Developer.ClearInventory(player);
491 for (
int i = 0; i < preset_array.Count(); i++)
497 health = m_ConfigDebugProfileFixed.GetItemHealth(default_preset, i);
498 quantity = m_ConfigDebugProfileFixed.GetItemQuantity(default_preset, i);
505 m_Developer.SpawnEntityInPlayerInventory(player, preset_array.Get(i), health, quantity);
519 m_BleedingSourcesLow =
new array<string>;
520 m_BleedingSourcesLow.Insert(
"RightToeBase");
521 m_BleedingSourcesLow.Insert(
"RightFoot");
522 m_BleedingSourcesLow.Insert(
"LeftToeBase");
523 m_BleedingSourcesLow.Insert(
"LeftFoot");
524 m_BleedingSourcesLow.Insert(
"RightUpLegRoll");
525 m_BleedingSourcesLow.Insert(
"RightUpLeg");
526 m_BleedingSourcesLow.Insert(
"RightLegRoll");
527 m_BleedingSourcesLow.Insert(
"RightLeg");
528 m_BleedingSourcesLow.Insert(
"LeftUpLegRoll");
529 m_BleedingSourcesLow.Insert(
"LeftUpLeg");
530 m_BleedingSourcesLow.Insert(
"LeftLegRoll");
531 m_BleedingSourcesLow.Insert(
"LeftLeg");
533 m_BleedingSourcesUp =
new array<string>;
534 m_BleedingSourcesUp.Insert(
"RightForeArmRoll");
535 m_BleedingSourcesUp.Insert(
"LeftForeArmRoll");
536 m_BleedingSourcesUp.Insert(
"RightForeArm");
537 m_BleedingSourcesUp.Insert(
"RightArmRoll");
538 m_BleedingSourcesUp.Insert(
"RightArm");
539 m_BleedingSourcesUp.Insert(
"RightShoulder");
540 m_BleedingSourcesUp.Insert(
"LeftForeArm");
541 m_BleedingSourcesUp.Insert(
"LeftArmRoll");
542 m_BleedingSourcesUp.Insert(
"LeftArm");
543 m_BleedingSourcesUp.Insert(
"LeftShoulder");
544 m_BleedingSourcesUp.Insert(
"Spine3");
545 m_BleedingSourcesUp.Insert(
"Spine2");
546 m_BleedingSourcesUp.Insert(
"Spine1");
547 m_BleedingSourcesUp.Insert(
"Spine");
548 m_BleedingSourcesUp.Insert(
"Pelvis");
549 m_BleedingSourcesUp.Insert(
"Neck");
551 RegisterNetSyncVariableInt(
"m_PersistentFlags", 0, 1<<(EnumTools.GetEnumSize(
PersistentFlag) + 1));
552 RegisterNetSyncVariableInt(
"m_LifeSpanState", LifeSpanState.BEARD_NONE, LifeSpanState.COUNT);
553 RegisterNetSyncVariableInt(
"m_BloodType", 0, 128);
554 RegisterNetSyncVariableInt(
"m_ShockSimplified",0, SIMPLIFIED_SHOCK_CAP);
556 RegisterNetSyncVariableInt(
"m_SoundEventParam", 0, ((EPlayerSoundEventParam.ENUM_COUNT - 1) * 2) - 1);
557 RegisterNetSyncVariableInt(
"m_StaminaState",0, eStaminaState.COUNT - 1);
558 RegisterNetSyncVariableInt(
"m_BleedingBits");
559 RegisterNetSyncVariableInt(
"m_Shakes", 0, SHAKE_LEVEL_MAX);
562 RegisterNetSyncVariableInt(
"m_MixedSoundStates", 0,
eMixedSoundStates.COUNT - 1);
563 RegisterNetSyncVariableInt(
"m_CorpseState",-PlayerConstants.CORPSE_STATE_DECAYED,PlayerConstants.CORPSE_STATE_DECAYED);
564 RegisterNetSyncVariableInt(
"m_RefreshAnimStateIdx",0,3);
565 RegisterNetSyncVariableInt(
"m_BrokenLegState", -
eBrokenLegs.BROKEN_LEGS_SPLINT,
eBrokenLegs.BROKEN_LEGS_SPLINT);
566 RegisterNetSyncVariableInt(
"m_SyncedModifiers", 0, ((
eModifierSyncIDs.LAST_INDEX - 1) * 2) - 1);
567 RegisterNetSyncVariableInt(
"m_HasBloodyHandsVisible", 0,
eBloodyHandsTypes.LAST_INDEX - 1);
568 RegisterNetSyncVariableInt(
"m_ActionSoundCategoryHash");
569 RegisterNetSyncVariableInt(
"m_PerformedAnimActionID", -1, 2048);
570 RegisterNetSyncVariableInt(
"m_ActivePrimarySymptomID", 0, SymptomIDs.LAST_INDEX);
572 RegisterNetSyncVariableInt(
"m_HeatBufferStage", 0, HeatBufferMdfr.NUMBER_OF_STAGES - 1);
573 RegisterNetSyncVariableFloat(
"m_HeatBufferDynamicMax", 0.0, 1.0, 2);
575 RegisterNetSyncVariableBool(
"m_IsUnconscious");
576 RegisterNetSyncVariableBool(
"m_IsRestrained");
577 RegisterNetSyncVariableBool(
"m_IsInWater");
578 RegisterNetSyncVariableBool(
"m_InsideEffectArea");
580 RegisterNetSyncVariableBool(
"m_HasBloodTypeVisible");
581 RegisterNetSyncVariableBool(
"m_IsRestrainStarted");
582 RegisterNetSyncVariableBool(
"m_IsRestrainPrelocked");
583 RegisterNetSyncVariableBool(
"m_HasHeatBuffer");
584 RegisterNetSyncVariableBool(
"m_IsInColdArea");
586 RegisterNetSyncVariableFloat(
"m_CurrentShock");
588 m_OriginalSlidePoseAngle = GetSlidePoseAngle();
593 m_DecayedTexture = ConfigGetString(
"decayedTexture");
596 m_BloodyHandsPenaltyChancePerAgent =
new map<eAgents, float>();
605 ClientData.RemovePlayerBase(
this);
606 SetContaminatedEffectEx(
false);
609 SEffectManager.DestroyEffect(m_FliesEff);
610 StopSoundSet(m_SoundFliesEffect);
616 void SetEnergyManagerState(
ItemBase itemInHands,
bool state)
621 if(itemInHands.m_LightSourceItem && itemInHands.m_LightSourceItem.GetCompEM())
623 if(state && itemInHands.m_LightSourceItem.GetCompEM().GetPreviousSwitchState())
624 itemInHands.m_LightSourceItem.GetCompEM().SwitchOn();
626 itemInHands.m_LightSourceItem.GetCompEM().SwitchOff();
631 else if(itemInHands.GetCompEM())
633 if(state && itemInHands.GetCompEM().GetPreviousSwitchState())
634 itemInHands.GetCompEM().SwitchOn();
636 itemInHands.GetCompEM().SwitchOff();
642#ifdef FEATURE_NETWORK_RECONCILIATION
643 protected override event typename GetOwnerStateType()
645 return PlayerBaseOwnerState;
648 protected override event typename GetMoveType()
650 return PlayerBaseMove;
653 protected override event void ObtainMove( PawnMove pMove)
655 super.ObtainMove(pMove);
657 PlayerBaseMove move = PlayerBaseMove.Cast(pMove);
658 GetStaminaHandler().ObtainMove(move);
661 protected override event bool ReplayMove(PawnMove pMove)
663 if (!super.ReplayMove(pMove))
666 PlayerBaseMove move = PlayerBaseMove.Cast(pMove);
667 GetStaminaHandler().ReplayMove(move);
668 UpdateMovementInertia();
673 protected override event void ObtainState( PawnOwnerState pState)
675 super.ObtainState(pState);
677 PlayerBaseOwnerState state = PlayerBaseOwnerState.Cast(pState);
679 GetStaminaHandler().ObtainState(state);
682 protected override event void RewindState(PawnOwnerState pState, PawnMove pMove, inout NetworkRewindType pRewindType)
684 super.RewindState(pState, pMove, pRewindType);
686 PlayerBaseOwnerState state = PlayerBaseOwnerState.Cast(pState);
687 PlayerBaseMove move = PlayerBaseMove.Cast(pMove);
688 GetStaminaHandler().RewindState(state, move);
692 ScriptInvoker GetOnUnconsciousStart()
694 if (!m_OnUnconsciousStart)
695 m_OnUnconsciousStart =
new ScriptInvoker();
697 return m_OnUnconsciousStart;
700 ScriptInvoker GetOnUnconsciousStop()
702 if (!m_OnUnconsciousStop)
703 m_OnUnconsciousStop =
new ScriptInvoker();
705 return m_OnUnconsciousStop;
710 if ((m_MedicalDrugsActive & drugType) != drugType)
711 m_MedicalDrugsActive = m_MedicalDrugsActive | drugType;
716 if ((m_MedicalDrugsActive & drugType) == drugType)
717 m_MedicalDrugsActive &= ~drugType;
720 bool IsChelationActive()
725 bool IsAntibioticsActive()
730 void SetSoundCategoryHash(
int hash)
732 m_ActionSoundCategoryHash = hash;
736 void SetPerformedActionID(
int id)
738 m_PerformedAnimActionID = id;
742 int GetPerformedActionID()
744 return m_PerformedAnimActionID;
747 void SetActivePrimarySymptomID(SymptomIDs
id)
749 m_ActivePrimarySymptomID = id;
753 SymptomIDs GetActivePrimarySymptomID()
755 return m_ActivePrimarySymptomID;
758 void RequestTriggerEffect(EffectTrigger trigger,
int ppeIdx = -1,
int aroundId = ParticleList.CONTAMINATED_AREA_GAS_AROUND,
int tinyId = ParticleList.CONTAMINATED_AREA_GAS_TINY,
string soundset =
"",
bool partDynaUpdate =
false,
int newBirthRate = 0,
bool forceUpdate =
false)
762 if (!m_InsideEffectArea)
765 if (!m_CurrentEffectTrigger)
769 else if (trigger == m_CurrentEffectTrigger && forceUpdate)
774 else if (trigger.GetEffectsPriority() > m_CurrentEffectTrigger.GetEffectsPriority())
776 RemoveCurrentEffectTrigger();
787 m_CurrentEffectTrigger = trigger;
788 SetContaminatedEffectEx(
true, ppeIdx, aroundId, tinyId, soundset,partDynaUpdate, newBirthRate );
793 void RemoveCurrentEffectTrigger()
795 if (m_CurrentEffectTrigger)
802 SetContaminatedEffectEx(
false, m_CurrentEffectTrigger.m_PPERequester );
803 m_CurrentEffectTrigger = null;
807 void IncreaseContaminatedAreaCount()
809 if (m_ContaminatedAreaCount == 0)
810 OnContaminatedAreaEnterServer();
811 m_ContaminatedAreaCount++;
814 void DecreaseContaminatedAreaCount()
816 m_ContaminatedAreaCount--;
817 if (m_ContaminatedAreaCount <= 0)
819 m_ContaminatedAreaCount = 0;
820 OnContaminatedAreaExitServer();
823 void IncreaseEffectAreaCount()
825 if (m_EffectAreaCount == 0)
827 m_InsideEffectArea =
true;
829 OnPlayerIsNowInsideEffectAreaBeginServer();
834 void DecreaseEffectAreaCount()
837 if (m_EffectAreaCount <= 0)
839 m_EffectAreaCount = 0;
840 m_InsideEffectArea =
false;
842 OnPlayerIsNowInsideEffectAreaEndServer();
846 void SetInEffectAreaTypeFlag(EEffectAreaType flag)
848 int areaCount = m_EffectAreaOverlap.Get(flag);
851 m_EffectAreaOverlap.Set(flag, m_EffectAreaOverlap.Get(flag) + 1);
853 m_EffectAreaOverlap.Set(flag, 1);
855 m_InEffectAreaType |= flag;
858 void UnsetInEffectAreaTypeFlag(EEffectAreaType flag)
860 int areaCount = m_EffectAreaOverlap.Get(flag);
863 m_EffectAreaOverlap.Set(flag, m_EffectAreaOverlap.Get(flag) - 1);
866 m_EffectAreaOverlap.Set(flag, 0);
867 m_InEffectAreaType &= ~flag;
871 bool IsInEffectArea(EEffectAreaType area)
873 if (m_InEffectAreaType & area)
884 if (IsInEffectArea(EEffectAreaType.HOT_SPRING))
887 if (waterLevel > 0.5)
890 timeSpent += timeSlice;
901 if (IsInEffectArea(EEffectAreaType.VOLCANIC))
904 timeSpent += timeSlice;
944 RemoveCurrentEffectTrigger();
952 EntityAI item_EAI = this.GetInventory().FindAttachment(slot_id);
955 if (item_EAI && !item_IB)
957 string str =
"Warning! GetItemOnSlot() >> found item on slot " + slot_type +
" can't be cast to ItemBase! Found item is " + item_EAI.GetType() +
" and the player is " +
GetType() +
"!";
981 if (GetInventory().HasInventoryReservation(item, null))
988 if (GetEntityInHands() == item)
1007 int bit_mask_remove = ~state;
1198 GetHive().CharacterKill(
this);
1202 g_Game.EnableVoN(
this,
false);
1203 if (!
g_Game.IsDedicatedServer())
1217 g_Game.GetMission().SyncRespawnModeInfo(GetIdentity());
1221 super.EEKilled(killer);
1226 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
1233 if (damageResult != null && damageResult.GetDamage(dmgZone,
"Shock") > 0)
1239 if (
g_Game.ConfigIsExisting(
"cfgAmmo " + ammo +
" unconRefillModifier"))
1251 if (damageType ==
DamageType.EXPLOSION && ammo ==
"FlashGrenade_Ammo")
1260 float dmg = damageResult.GetDamage(dmgZone,
"Blood");
1265 #ifdef DIAG_DEVELOPER
1267 Print(
"EEHitBy() | " + GetDisplayName() +
" hit by " + source.GetDisplayName() +
" to " + dmgZone);
1269 PluginRemotePlayerDebugServer plugin_remote_server = PluginRemotePlayerDebugServer.Cast(
GetPlugin(PluginRemotePlayerDebugServer));
1270 if (plugin_remote_server)
1272 plugin_remote_server.OnDamageEvent(
this, damageResult);
1276 if (
g_Game.IsDebugMonitor())
1282 int transferShockToDamageCoef =
g_Game.ConfigGetInt(
string.Format(
"%1 %2 DamageApplied transferShockToDamage",
CFG_AMMO, ammo));
1283 if (transferShockToDamageCoef == 1)
1287 if (dmgZone !=
"Head")
1288 AddHealth(dmgZone,
"Health", -damageResult.GetDamage(dmgZone,
"Shock"));
1293 if (GetHealth(
"RightLeg",
"Health") <= 1 || GetHealth(
"LeftLeg",
"Health") <= 1 || GetHealth(
"RightFoot",
"Health") <= 1 || GetHealth(
"LeftFoot",
"Health") <= 1)
1302 if (ammo ==
"Bullet_CupidsBolt" && IsAlive())
1304 DamageSystem.ResetAllZones(
this);
1346 g_Game.GetAnalyticsServer().OnEntityHit(source,
this);
1351 super.EEHitByRemote(damageType, source,
component, dmgZone, ammo, modelPos);
1353 if (m_MeleeFightLogic.IsInBlock())
1372 return damage *
GameConstants.NL_DAMAGE_FIREARM_CONVERSION_PLAYERS;
1374 return super.ConvertNonlethalDamage(damage, damageType);
1384 float shakeStrength =
Math.InverseLerp(0, 500, hitData.m_InSpeed.Length());
1389 if (hitData.m_AmmoType ==
"Bullet_CupidsBolt")
1390 Ammo_CupidsBolt.PlayOnHitParticle(hitData.m_Position);
1397 if (m_MeleeFightLogic.IsInBlock())
1449 return GetSelectionPositionMS(pSelection);
1456 m_FaceCoveredForShaveLayers++;
1461 m_FaceCoveredForShaveLayers--;
1466 super.EEItemAttached(item, slot_name);
1470 Param1<PlayerBase> p =
new Param1<PlayerBase>(
this);
1471 item.SwitchItemSelectionTextureEx(EItemManipulationContext.ATTACHING, p);
1478 g_Game.GetAnalyticsClient().OnItemAttachedAtPlayer(item, slot_name);
1482 if (!
g_Game.IsDedicatedServer())
1484 if (clothing.GetEffectWidgetTypes())
1489 if (clothing.GetGlassesEffectID() > -1)
1497 else if (
g_Game.IsServer())
1499 if (clothing.IsGasMask())
1505 clothing.UpdateNVGStatus(
this,
true);
1514 super.EEItemDetached(item, slot_name);
1517 item.SwitchItemSelectionTextureEx(EItemManipulationContext.DETACHING);
1527 if (!
g_Game.IsDedicatedServer())
1529 if (clothing.GetEffectWidgetTypes())
1534 if (clothing.GetGlassesEffectID() > -1)
1542 if (clothing.IsGasMask())
1548 clothing.UpdateNVGStatus(
this,
false,
true);
1556 string slot = slot_name;
1558 boo = item.IsWeapon();
1560 if (slot ==
"Melee")
1562 SetSimpleHiddenSelectionState(SIMPLE_SELECTION_MELEE_RIFLE,boo);
1563 SetSimpleHiddenSelectionState(SIMPLE_SELECTION_MELEE_MELEE,!boo);
1565 else if (slot ==
"Shoulder")
1567 SetSimpleHiddenSelectionState(SIMPLE_SELECTION_SHOULDER_RIFLE,boo);
1568 SetSimpleHiddenSelectionState(SIMPLE_SELECTION_SHOULDER_MELEE,!boo);
1574 super.SwitchItemSelectionTexture(item,slot_name);
1577 EntityAI armband = FindAttachmentBySlotName(
"Armband");
1578 if (slot_name ==
"Body" && armband)
1580 Param1<PlayerBase> p =
new Param1<PlayerBase>(
this);
1581 armband.SwitchItemSelectionTextureEx(EItemManipulationContext.UPDATE,p);
1592 for (
int i = 0; i < itemsArray.Count(); i++)
1594 Class.CastTo(item, itemsArray.Get(i));
1612 if (ConfigGetBool(
"woman") != 1)
1621 int voice_type = ConfigGetInt(
"voiceType");
1623 if (voice_type == 0)
1659 AddAction(ActionLockedDoors, InputActionMap);
1709 if (IsControlledPlayer())
1740 if (IsControlledPlayer())
1750 if (IsControlledPlayer())
1755 actions.InsertAll(bcActions);
1775 InputActionMap.Insert(ai, action_array);
1777 action_array.Insert(action);
1793 for (
int i = 0; i < action_array.Count(); i++)
1795 if (action == action_array.Get(i))
1797 action_array.Remove(i);
1801 InputActionMap.Insert(ai, action_array);
1803 action_array.Insert(action);
1845 override void OnLadder(
float delta_time, HumanMovementState pState)
1859 if (gloves && gloves.GetHealthLevel() < 4)
1861 gloves.AddHealth(
"",
"",
PlayerConstants.GLOVES_DAMAGE_SLIDING_LADDER_PER_SEC * delta_time);
1865 if (
Math.RandomFloat01() <
PlayerConstants.CHANCE_TO_BLEED_SLIDING_LADDER_PER_SEC * delta_time)
1867 if (
Math.RandomFloat01() < 0.5)
1892 string surface;
int liquid;
1893 g_Game.SurfaceUnderObject(
this, surface, liquid);
1894 float modifier_surface =
Surface.GetParamFloat(surface,
"footDamage");
1896 if (shoes && shoes.GetHealthLevel() < 4)
1903 float rnd =
Math.RandomFloat01();
1908 if (pUserInt % 2 == 0)
1942 if (m_ModulePlayerStatus)
1943 m_ModulePlayerStatus.SetStamina(value, range);
1946 #ifdef DIAG_DEVELOPER
1947 void SetStaminaDisabled(
bool value)
2005 if (GetThrowing() && GetThrowing().IsThrowingModeEnabled())
2053 g_Game.GetMission().HideInventory();
2065 g_Game.GetMission().HideInventory();
2076 if (IsControlledPlayer())
2085 return super.CanReleaseAttachment(attachment);
2090 return super.CanReleaseCargo(cargo);
2095 return super.CanReceiveItemIntoCargo(item);
2100 return super.CanSwapItemInCargo(child_entity, new_entity);
2111 return super.CanReceiveItemIntoHands(item_to_hands);
2246 float add_health_coef = 0.33;
2250 AddHealth(
"LeftLeg",
"Health", (GetMaxHealth(
"LeftLeg",
"Health") - GetHealth(
"LeftLeg",
"Health") ) * add_health_coef );
2251 AddHealth(
"RightLeg",
"Health", (GetMaxHealth(
"RightLeg",
"Health") - GetHealth(
"RightLeg",
"Health")) * add_health_coef );
2252 AddHealth(
"RightFoot",
"Health", (GetMaxHealth(
"RightFoot",
"Health") - GetHealth(
"RightFoot",
"Health")) * add_health_coef );
2253 AddHealth(
"LeftFoot",
"Health", (GetMaxHealth(
"LeftFoot",
"Health") - GetHealth(
"LeftFoot",
"Health")) * add_health_coef );
2263 PPERequester_Drowning req = PPERequester_Drowning.Cast(PPERequesterBank.GetRequester(PPERequesterBank.REQ_DROWNING));
2279 AddChild(p, boneIdx);
2304 RequestSoundEventEx(
EPlayerSoundEventID.HOLD_BREATH,
true, EPlayerSoundEventParam.SKIP_CONTROLLED_PLAYER);
2309 RequestSoundEventEx(
EPlayerSoundEventID.EXHAUSTED_BREATH,
true, EPlayerSoundEventParam.SKIP_CONTROLLED_PLAYER);
2315 RequestSoundEventEx(
EPlayerSoundEventID.RELEASE_BREATH,
true, EPlayerSoundEventParam.SKIP_CONTROLLED_PLAYER);
2360 for (
int att = 0; att < attcount; ++att)
2363 if (attachment.IsItemBase())
2365 item_name = attachment.GetType();
2366 if (
g_Game.IsKindOf(item_name, searched_item))
2379 if (!
g_Game.IsMultiplayer() &&
g_Game.GetPlayer() &&
g_Game.GetPlayer().GetID() ==
this.GetID())
2381 PluginSceneManager scene_editor = PluginSceneManager.Cast(
GetPlugin(PluginSceneManager));
2382 scene_editor.InitLoad();
2398 if (m_ModuleLifespan)
2400 m_ModuleLifespan.SynchLifespanVisual(
this, m_LifeSpanState, m_HasBloodyHandsVisible, m_HasBloodTypeVisible, m_BloodType);
2404 if (IsControlledPlayer())
2412 m_Hud.UpdateBloodName();
2414 g_Game.GetUIManager().CloseAll();
2415 mission.SetPlayerRespawning(
false);
2416 mission.OnPlayerRespawned(
this);
2418 m_Hud.ShowQuickbarUI(
true);
2419 m_Hud.UpdateQuickbarGlobalVisibility();
2420 m_Hud.InitHeatBufferUI(
this);
2421 m_Hud.OnPlayerLoaded();
2425 if (!
g_Game.IsDedicatedServer())
2432 m_CharactersHead = Head_Default.Cast(GetInventory().FindPlaceholderForSlot(slotId));
2442 wpn.DelayedValidateAndRepair();
2446 wpn.ValidateAndRepair();
2505 EntityAI entityInHands = GetEntityInHands();
2516 else if (entityInHands && entityInHands.HasEnergyManager())
2518 if (entityInHands.GetCompEM().IsPlugged())
2519 entityInHands.OnPlacementCancelled(
this);
2531 EntityAI entityInHands = GetEntityInHands();
2532 if (entityInHands && entityInHands.HasEnergyManager())
2534 if (entityInHands.GetCompEM().IsPlugged())
2535 entityInHands.OnPlacementCancelled(
this);
2579 if (IsControlledPlayer())
2581 PPERequester_Drowning req = PPERequester_Drowning.Cast(PPERequesterBank.GetRequester(PPERequesterBank.REQ_DROWNING));
2592 if (IsControlledPlayer())
2594 PPERequester_Drowning req = PPERequester_Drowning.Cast(PPERequesterBank.GetRequester(PPERequesterBank.REQ_DROWNING));
2616 m_ProcessResetADS =
true;
2619 else if (!
g_Game.IsMultiplayer())
2633 m_ProcessResetADS =
false;
2655 foreach (
string t: disallowedUndergroundTypes)
2657 if (item.IsKindOf(t))
2809 if (!IsPlayerSelected() || !IsAlive())
2825 EntityAI heldEntity = GetEntityInHands();
2826 if (heldEntity && heldEntity.HasEnergyManager() && heldEntity.GetCompEM().IsPlugged())
2829 EntityAI placed_entity = heldEntity;
2832 placed_entity.GetCompEM().UpdatePlugState();
2840 if (!m_DeathSyncSent && m_KillerData)
2842 SyncEvents.SendEntityKilled(
this, m_KillerData.m_Killer, m_KillerData.m_MurderWeapon, m_KillerData.m_KillerHiTheBrain);
2843 m_DeathSyncSent =
true;
2856 if (m_PlayerSoundEventHandler)
2857 m_PlayerSoundEventHandler.OnTick(delta_time);
2874 #ifdef DIAG_DEVELOPER
2877 m_WeaponDebug.OnCommandHandlerUpdate();
2890 if (m_ProcessResetADS)
2897 HumanCommandMove hcm = GetCommand_Move();
2901 hcm.SetTurnSpanSprintModifier(2 - staminaPercentage);
2902 hcm.SetRunSprintFilterModifier((2 - staminaPercentage) * 0.5);
2903 hcm.SetDirectionSprintFilterModifier(2 - staminaPercentage);
2920 int currentTime =
g_Game.GetTime();
2921 float deltaT = (currentTime -
m_LastTick) * 0.001;
2933 super.EEItemIntoHands(item);
2937 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(item, {
Bolt_Base});
2940 if (
Class.CastTo(w, item))
2942 w.ResetWeaponAnimState();
2944 HumanCommandMove cm = GetCommand_Move();
2947 cm.SetMeleeBlock(
false);
2948 GetMeleeFightLogic().SetBlock(
false);
2953 if (item.IsHeavyBehaviour() && IsRaised())
2955 HumanCommandMove cm2 = GetCommand_Move();
2962 SurrenderDummyItem dummyItem;
2972 super.EEItemOutOfHands(item);
2979 SurrenderDummyItem dummyItem;
2991 override void CommandHandler(
float pDt,
int pCurrentCommandID,
bool pCurrentCommandFinished)
2993 EvaluateDamageHit(pCurrentCommandID);
2996 super.CommandHandler(pDt,pCurrentCommandID,pCurrentCommandFinished);
2998 vector playerPosition = PhysicsGetPositionWS();
3019 GetUApi().GetInputByID(UATempRaiseWeapon).Supress();
3040 if (hic.CameraIsFreeLook())
3047 if (!hic.CameraIsFreeLook())
3099 HandleDamageHit(pCurrentCommandID);
3103 mngr.Update(pCurrentCommandID);
3105 HumanCommandUnconscious hcu = GetCommand_Unconscious();
3106 HumanCommandVehicle hcv = GetCommand_Vehicle();
3108 if (!m_UnconsciousDebug)
3111 if (m_ShouldBeUnconscious && m_IsUnconscious)
3116 m_Swimming.m_bWasSwimming |= hcu.IsInWater();
3119 if (m_Swimming.m_bWasSwimming)
3127 else if (m_ShouldBeUnconscious)
3130 bool isTransitioning = hcv && (hcv.IsGettingIn() || hcv.IsGettingOut() || hcv.IsSwitchSeat());
3136 m_IsUnconscious =
true;
3144 m_LastCommandBeforeUnconscious = pCurrentCommandID;
3148 m_TransportCache = hcv.GetTransport();
3152 m_TransportCache = null;
3156 m_JumpClimb.CheckAndFinishJump();
3157 StartCommand_Unconscious(0);
3158 SetFallYDiff(playerPosition[1]);
3162 else if (m_IsUnconscious)
3175 if (m_Swimming.m_bWasSwimming || m_LastCommandBeforeUnconscious ==
DayZPlayerConstants.COMMANDID_VEHICLE)
3178 hcu.WakeUp(wakeUpStance);
3180 m_IsUnconscious =
false;
3189 m_IsUnconscious =
false;
3197 int quickBarSlot = hic.IsQuickBarSlot();
3198 if (quickBarSlot && IsAlive())
3200 if (hic.IsQuickBarSingleUse())
3205 if (hic.IsQuickBarContinuousUseStart() && ((!
g_Game.IsDedicatedServer()) && !
g_Game.GetUIManager().GetMenu()))
3210 if (hic.IsQuickBarContinuousUseEnd() && ((!
g_Game.IsDedicatedServer())))
3225 HumanCommandMove hcm = GetCommand_Move();
3226 bool isSwimmingOrClimbing = GetCommand_Swim() || GetCommand_Climb() || GetCommand_Ladder();
3227 bool isStaminaLimitAppliable = hcm || isSwimmingOrClimbing;
3229 if (isStaminaLimitAppliable)
3238 if (!
g_Game.IsDedicatedServer())
3259 #ifdef DIAG_DEVELOPER
3261 m_Bot.OnUpdate(pDt);
3271 TryGetInVehicleDebug();
3278 void SetGetInVehicleDebug(
EntityAI ent)
3280 m_GetInVehicleTransportDebug =
Transport.Cast(ent);
3283 void TryGetInVehicleDebug()
3285 if (m_GetInVehicleTransportDebug)
3287 HumanCommandVehicle vehCommand = StartCommand_Vehicle(m_GetInVehicleTransportDebug, 0, 0);
3290 vehCommand.SetVehicleType(m_GetInVehicleTransportDebug.GetAnimInstance());
3292 m_GetInVehicleTransportDebug = null;
3325 mission.RemoveActiveInputExcludes({
"map"});
3326 mission.RemoveActiveInputRestriction(EInputRestrictors.MAP);
3328 else if (!
g_Game.IsMultiplayer())
3335 m_hac.InternalCommand(command_ID);
3341 if (!
g_Game.IsDedicatedServer())
3344 if (uiManager.IsMenuOpen(
MENU_MAP))
3346 uiManager.FindMenu(
MENU_MAP).Close();
3349 m_Hud.ShowQuickbarPlayer(
true);
3352 mission.RemoveActiveInputExcludes({
"map"});
3353 mission.RemoveActiveInputRestriction(EInputRestrictors.MAP);
3390 if (
GetUApi().GetInputByID(UADefaultAction).LocalPress() ||
GetUApi().GetInputByID(UAUIMenu).LocalPress() ||
GetUApi().GetInputByID(UAGear).LocalPress())
3439 if (heat_comfort <=
PlayerConstants.THRESHOLD_HEAT_COMFORT_MINUS_WARNING)
3442 level =
Math.Lerp(1,7,value);
3443 level =
Math.Clamp(value,1,7);
3459 if (super.IsLanded(pCurrentCommandID))
3467 bool wasFalling = m_IsUnconsciousFalling;
3468 m_IsUnconsciousFalling = PhysicsIsFalling(
false);
3469 return wasFalling && !m_IsUnconsciousFalling;
3479 if (super.OnLand(pCurrentCommandID, fallDamageData))
3492 if (super.IsAlreadyInFallingCommand(pCurrentCommandID))
3506 RequestSoundEventStop(0);
3510 g_Game.GetMission().GetHud().ShowHudUI(
false);
3514 EntityAI entity_in_hands = GetEntityInHands();
3520 g_Game.GetSoundScene().SetSoundVolume(0,2);
3530 if (m_TransportCache)
3531 m_TransportCache.MarkCrewMemberUnconscious(m_TransportCache.CrewMemberIndex(
this));
3535 g_Game.EnableVoN(
this,
false);
3543 if (GetMeleeFightLogic())
3545 GetMeleeFightLogic().SetBlock(
false);
3549 SetMasterAttenuation(
"UnconsciousAttenuation");
3564 hud.ShowHudUI(
true);
3567 g_Game.GetSoundScene().SetSoundVolume(
g_Game.m_volume_sound,1);
3568 PPERequester_UnconEffects requester = PPERequester_UnconEffects.Cast(PPERequesterBank.GetRequester(PPERequester_UnconEffects));
3569 requester.FadeOutEffect();
3570 hud.ShowQuickbarUI(
true);
3572 if (uiManager.IsDialogVisible())
3574 uiManager.CloseDialog();
3588 g_Game.EnableVoN(
this,
true);
3596 SetMasterAttenuation(
"");
3617 PluginAdminLog adm = PluginAdminLog.Cast(
GetPlugin(PluginAdminLog));
3618 adm.PlayerKilledByDrowningUncon(
this);
3620 SetHealth(
"",
"",-100);
3625 g_Game.GetMission().GetHud().ShowQuickbarUI(
false);
3631 float sin_normalized = (sin + 1) / 2;
3632 if (sin_normalized < 0.05)
3638 PPERequesterBank.GetRequester(PPERequester_UnconEffects).Start(
m_UnconParam);
3645 int shock =
Math.Lerp(0, SIMPLIFIED_SHOCK_CAP, GetHealth(
"",
"Shock") / GetMaxHealth(
"",
"Shock"));
3646 shock =
Math.Clamp(shock, 0, SIMPLIFIED_SHOCK_CAP);
3662 return m_IsUnconscious;
3667 #ifdef DIAG_DEVELOPER
3668 if (!m_CanBeTargetedDebug)
3674 return super.CanBeTargetedByAI(ai) && !
IsUnconscious() && !IsInVehicle();
3679 AddHealth(
"",
"Shock",shock);
3686 g_Game.GetMission().RemoveActiveInputExcludes({
"inventory"},
true);
3687 g_Game.GetMission().RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
3779 if (attachment && attachment.GetType() ==
"Splint_Applied")
3781 attachment.Delete();
3800 HumanCommandMove hcm = StartCommand_Move();
3801 hcm = GetCommand_Move();
3810 m_JumpClimb.CheckAndFinishJump();
3819 float avgLegHealth = GetHealth(
"RightLeg",
"") + GetHealth(
"LeftLeg",
"") + GetHealth(
"RightFoot",
"") + GetHealth(
"LeftFoot",
"");
3820 avgLegHealth *= 0.25;
3826 PhysicsGetVelocity(v);
3828 if (v.LengthSq() > 0)
3835 if (IsClimbingLadder())
3863 void MovingShock(
float legHealth,
float highShock,
float midShock,
float lowShock)
3870 else if (legHealth >=
PlayerConstants.BROKEN_LEGS_HIGH_HEALTH_THRESHOLD)
3884 Param1<float> damage =
new Param1<float>(0);
3885 damage.param1 = dmg;
3886 g_Game.RPCSingleParam(
this,
ERPCs.RPC_SHOCK, damage,
true, GetIdentity());
3895 return super.CanPickupHeavyItem(item);
3901 SetHealth(
"RightLeg",
"", 0);
3902 SetHealth(
"RightFoot",
"", 0);
3903 SetHealth(
"LeftLeg",
"", 0);
3904 SetHealth(
"LeftFoot",
"", 0);
3910 if (itemInHands && itemInHands.IsHeavyBehaviour())
3918 if (attachment && attachment.GetType() ==
"Splint_Applied")
3933 if (itemInHands.IsHeavyBehaviour())
3937 ServerDropEntity(itemInHands);
3944 itemInHands.OnItemInHandsPlayerSwimStart(
this);
3959 g_Game.GetMission().AddActiveInputExcludes({
"swimming"});
3974 g_Game.GetMission().RemoveActiveInputExcludes({
"swimming"});
3988 g_Game.GetMission().AddActiveInputExcludes({
"ladderclimbing"});
3999 g_Game.GetMission().RemoveActiveInputExcludes({
"ladderclimbing"});
4024 m_JumpClimb.CheckAndFinishJump();
4073 EntityAI itemOnHead = FindAttachmentBySlotName(
"Headgear");
4075 if (itemInHand && itemInHand.GetCompEM())
4076 itemInHand.GetCompEM().SwitchOff();
4080 if (itemOnHead && itemOnHead.GetCompEM())
4081 itemOnHead.GetCompEM().SwitchOff();
4083 g_Game.GetMission().AddActiveInputExcludes({
"vehicledriving"});
4092 if (!m_ShouldBeUnconscious)
4095 g_Game.GetMission().RemoveActiveInputExcludes({
"vehicledriving"});
4124 super.OnCommandDeathStart();
4143 case HumanCommandFall.LANDTYPE_NONE:
4144 case HumanCommandFall.LANDTYPE_LIGHT:
4147 case HumanCommandFall.LANDTYPE_MEDIUM:
4148 case HumanCommandFall.LANDTYPE_HEAVY:
4159 return ((1 << stance) & stanceMask) != 0;
4168 m_SprintedTimePerStanceMin =
PlayerConstants.FULL_SPRINT_DELAY_FROM_PRONE;
4171 m_SprintedTimePerStanceMin =
PlayerConstants.FULL_SPRINT_DELAY_FROM_CROUCH;
4187 if (GetThrowing().IsThrowingAnimationPlaying())
4193 if (
Math.AbsInt(previousStance - newStance) == 3)
4259 g_Game.SurfaceUnderObject(
this, surfaceType, liquidType);
4270 m_Hud.ShowVehicleInfo();
4272#ifdef FEATURE_NETWORK_RECONCILIATION
4279 identity.Possess(pawn);
4286#ifdef FEATURE_NETWORK_RECONCILIATION
4290 if (identity && !m_ShouldBeUnconscious)
4293 identity.Possess(
this);
4299 m_Hud.HideVehicleInfo();
4304 if (change_to_enabled)
4335 int currentTime =
g_Game.GetTime();
4383 #ifdef DIAG_DEVELOPER
4384 DiagOnPostFrame(other, extra);
4388#ifdef DIAG_DEVELOPER
4389 protected void DiagOnPostFrame(
IEntity other,
int extra)
4395 m_WeaponDebug.OnPostFrameUpdate();
4398 if (GetBleedingManagerRemote())
4400 GetBleedingManagerRemote().OnUpdate();
4407 m_MeleeDebug =
true;
4410 else if (!DiagMenu.GetBool(
DiagMenuIDs.MELEE_DEBUG) && m_MeleeDebug)
4412 m_MeleeDebug =
false;
4417 if (DiagMenu.GetBool(
DiagMenuIDs.SOUNDS_ITEM_IMPACT_SOUNDS))
4418 InventoryItem.DrawImpacts();
4422 PluginDrawCheckerboard drawCheckerboard = PluginDrawCheckerboard.Cast(
GetPluginManager().GetPluginByType(PluginDrawCheckerboard));
4423 if (drawCheckerboard && !drawCheckerboard.IsActive())
4425 drawCheckerboard.ShowWidgets(DiagMenu.GetBool(
DiagMenuIDs.MISC_DRAW_CHECKERBOARD));
4429 if (m_PresenceNotifier)
4431 m_PresenceNotifier.EnableDebug(DiagMenu.GetBool(
DiagMenuIDs.MISC_PRESENCE_NOTIFIER_DBG));
4434 if (m_TargetTemperatureDiag)
4436 m_TargetTemperatureDiag.ShowDebug(DiagMenu.GetBool(
DiagMenuIDs.MISC_TARGET_TEMPERATURE));
4439 if (DiagMenu.GetBool(
DiagMenuIDs.TRIGGER_PLAYER_DEBUG))
4442 GetCollisionBox(minmax);
4445 if (m_IsInsideTrigger)
4452 dbgShape.CreateMatrix(mat);
4453 dbgShape.SetMatrix(mat);
4457 if (m_Environment && m_Environment.m_Debug)
4460 EnvDebugData envDebugData = m_Environment.GetEnvDebugData();
4461 g_Game.RPCSingleParam(
this,
ERPCs.DIAG_MISC_ENVIRONMENT_DEBUG_DATA, envDebugData,
false, GetIdentity());
4463 m_Environment.ShowEnvDebugPlayerInfo(DiagMenu.GetBool(
DiagMenuIDs.MISC_ENVIRONMENT_DEBUG));
4467 if (m_FallDamage && m_FallDamage.m_Debug)
4470 FallDamageDebugData fallDamageDebugData = m_FallDamage.GetFallDamageDebugData();
4471 g_Game.RPCSingleParam(
this,
ERPCs.DIAG_MISC_FALLDAMAGE_DEBUG_DATA, fallDamageDebugData,
false, GetIdentity());
4473 m_FallDamage.ShowFallDamageDebugInfo(DiagMenu.GetBool(
DiagMenuIDs.MISC_FALLDAMAGE_DEBUG));
4478 override void OnEnterTrigger(ScriptedEntity trigger)
4480 super.OnEnterTrigger(trigger);
4482 ++m_IsInsideTrigger;
4485 override void OnLeaveTrigger(ScriptedEntity trigger)
4487 super.OnLeaveTrigger(trigger);
4489 --m_IsInsideTrigger;
4496 m_Hud.SetStaminaBarVisibility(show);
4531 override bool CanClimb(
int climbType, SHumanCommandClimbResult climbRes)
4549 return super.CanClimb(climbType,climbRes);
4571 return super.CanJump();
4576 return m_JumpClimb.m_bIsJumpInProgress;
4582 temp =
g_Game.GetMission().GetActiveRefresherLocations();
4583 int count = temp.Count();
4586 vector pos = target.GetPosition();
4587 for (
int i = 0; i < count; i++)
4616 GetItemAccessor().OnItemInHandsChanged(
true);
4617 GetItemAccessor().ResetWeaponInHands();
4631 vector pdir = GetDirection();
4636 if (
Math.AbsFloat(pdir[0]-ptv[0]) < 0.5 &&
Math.AbsFloat(pdir[2]-ptv[2]) < 0.5)
4656 if (GetThrowing().IsThrowingModeEnabled() || GetThrowing().IsThrowingAnimationPlaying())
4680 if (!quickBarEntity)
4686 if (
Class.CastTo(mag, quickBarEntity) &&
Class.CastTo(wpn, mag.GetHierarchyParent()))
4689 EntityAI inHandEntity = GetEntityInHands();
4691 if (!GetDayZPlayerInventory().
IsIdle())
4695 handInventoryLocation.SetHands(
this,quickBarEntity);
4699 if (inHandEntity == quickBarEntity)
4701 if (GetHumanInventory().CanRemoveEntityInHands())
4703 if (
LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] Stash - PredictiveMoveItemFromHandsToInventory HND=" +
Object.GetDebugName(inHandEntity));
4704 PredictiveMoveItemFromHandsToInventory();
4710 quickBarEntity.GetInventory().GetCurrentInventoryLocation(invLocQBItem);
4718 int index = GetHumanInventory().FindUserReservedLocationIndex(inHandEntity);
4720 GetHumanInventory().GetUserReservedLocation(index, inHandEntityFSwapDst);
4750 if (GetInventory().IsInventoryLocked())
4762 if (itemInHands != quickBarItem)
4772 if (IsRaised() || GetCommand_Melee())
4840 EntityAI entity_in_hands = GetEntityInHands();
4862 mngr_client.Interrupt();
4864 else if (GetEntityInHands()!= magazine)
4868 Class.CastTo(wpn, weapon);
4869 Class.CastTo(mag, magazine);
4886 ActionTarget atrg =
new ActionTarget(mag,
this, -1,
vector.Zero, -1.0);
4902 int last_ammo_magazine_count;
4903 int ammo_magazine_count;
4906 int last_ammo_pile_count;
4907 int ammo_pile_count;
4912 for (
int att_i = 0; att_i < nAttachment; ++att_i)
4915 ref
CargoBase attachment_cargo = attachment.GetInventory().GetCargo();
4917 if (attachment_cargo)
4919 int nAttachmentCargoItem = attachment_cargo.GetItemCount();
4920 for (
int cgo_i = 0; cgo_i < nAttachmentCargoItem; ++cgo_i)
4922 EntityAI cargo_item = attachment_cargo.GetItem(cgo_i);
4925 if (cargo_item.IsMagazine())
4927 Magazine magazine = Magazine.Cast(cargo_item);
4928 ammo_pile_count = magazine.GetAmmoCount();
4933 if (ammo_pile_count > 0)
4935 if (last_ammo_magazine_count == 0)
4937 ammo_magazine = magazine;
4938 last_ammo_magazine_count = ammo_pile_count;
4942 if (last_ammo_magazine_count < ammo_pile_count)
4944 ammo_magazine = magazine;
4945 last_ammo_magazine_count = ammo_pile_count;
4951 else if (weapon_manager.
CanLoadBullet(weapon_base, magazine))
4953 if (ammo_pile_count > 0)
4955 if (last_ammo_pile_count == 0)
4957 ammo_pile = magazine;
4958 last_ammo_pile_count = ammo_pile_count;
4962 if (last_ammo_pile_count > ammo_pile_count)
4964 ammo_pile = magazine;
4965 last_ammo_pile_count = ammo_pile_count;
4978 return ammo_magazine;
4991 g_Game.GetMission().AddDummyPlayerToScheduler(
this);
4995#ifdef DIAG_DEVELOPER
4998 m_Bot =
new Bot(
this);
5008 return m_LiquidTendencyDrain;
5014 m_LiquidTendencyDrain = state;
5021 return m_FlagRaisingTendency;
5027 m_FlagRaisingTendency = state;
5030 override SoundOnVehicle
PlaySound(
string sound_name,
float range,
bool create_local =
false)
5032 return BetaSound.SaySound(
this, sound_name, range,
false);
5037 return GetWeightEx();
5064 return GetInventory().HasEntityInInventory(entity);
5069 if (
g_Game.IsMultiplayer())
5083 if (
LogManager.IsSyncLogEnable())
syncDebugPrint(
"[syncinv] " +
GetDebugName(
this) +
" STS=" + GetSimulationTimeStamp() +
" NeedInventoryJunctureFromServer item=" +
Object.GetDebugName(item) +
" currPar=" + currParent +
" newPar=" + newParent);
5085 bool i_owned = GetHumanInventory().HasEntityInInventory(item);
5087 bool cp_owned =
false;
5089 cp_owned = GetHumanInventory().HasEntityInInventory(currParent);
5091 bool np_owned =
false;
5093 np_owned = GetHumanInventory().HasEntityInInventory(newParent);
5095 bool all_owned = i_owned && cp_owned && (np_owned || (newParent == null));
5096 if (
LogManager.IsSyncLogEnable())
syncDebugPrint(
"[syncinv] " +
GetDebugName(
this) +
" STS=" + GetSimulationTimeStamp() +
" NeedInventoryJunctureFromServer=" + !all_owned +
" i_pwn=" + i_owned +
" cp_pwn=" + cp_owned +
" np_pwn=" + np_owned);
5100 Error(
"[syncinv] unsupported instance type t=" + t);
5110 float totalWeight = super.GetWeightSpecialized(forceRecalc);
5115 totalWeight += itemHands.GetWeightEx(forceRecalc);
5118 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
5120 float itemInHandsWeight = totalWeight - super.GetWeightSpecialized(forceRecalc);
5122 dta.SetCalcDetails(
"TMan: " + (super.GetWeightSpecialized(forceRecalc)+ itemInHandsWeight) +
"(contents weight[includes item in hands])");
5130 const int VISIBILITY_SLOTS_COUNT = 10;
5132 int attcount = GetInventory().AttachmentCount();
5133 float sumVisibility = 0;
5134 float countVisibility = 0;
5135 float visibilityMean = 0;
5139 for (
int att = 0; att < attcount; att++)
5141 EntityAI attachment = GetInventory().GetAttachmentFromIndex(att);
5142 if (attachment.IsClothing())
5145 Class.CastTo(clothing, attachment);
5146 sumVisibility += clothing.GetItemVisibility();
5151 visibilityMean = (sumVisibility + (VISIBILITY_SLOTS_COUNT - countVisibility)) / VISIBILITY_SLOTS_COUNT;
5180 float health = GetHealth(
"",
"");
5192 float blood = GetHealth(
"",
"Blood");
5220 float immmunity_max = 1;
5227 float health = GetHealth(
"",
"");
5228 float health_max = GetMaxHealth(
"",
"");
5241 float blood = GetHealth(
"",
"Blood");
5242 float blood_max = GetMaxHealth(
"",
"Blood");
5264 if (stat_value <= critical)
5266 return Math.InverseLerp(0, critical, stat_value);
5268 if (stat_value <= low)
5270 return Math.InverseLerp(critical, low, stat_value);
5272 if (stat_value <= normal)
5274 return Math.InverseLerp(low, normal, stat_value);
5276 if (stat_value <= high)
5278 return Math.InverseLerp(normal, high, stat_value);
5280 return Math.InverseLerp(high, max, stat_value);
5285 if (stat_value <= critical)
5289 if (stat_value <= low)
5293 if (stat_value <= normal)
5297 if (stat_value <= high)
5317 float max_health = GetMaxHealth(
"GlobalHealth",
"Health") + 0.01;
5318 float max_blood = GetMaxHealth(
"GlobalHealth",
"Blood") + 0.01;
5321 float health_normalized = GetHealth(
"GlobalHealth",
"Health") / max_health;
5322 float blood_normalized = GetHealth(
"GlobalHealth",
"Blood") / max_blood;
5323 immunity = energy_normalized + water_normalized + health_normalized + blood_normalized;
5324 immunity = immunity / 4;
5325 immunity =
Math.Clamp(immunity,0,1);
5338 if (IsRaised() || (item && item.IsHeavyBehaviour()))
5344 if (item && GetThrowing() && GetThrowing().IsThrowingModeEnabled())
5370 return GetCommand_Move() && GetCommand_Move().IsInRoll();
5408 if (!m_FightEndBlendTimer)
5409 m_FightEndBlendTimer =
new Timer();
5410 if (!m_FightEndBlendTimer.IsRunning())
5412 m_FightEndBlendTimer.Run(
PlayerConstants.MELEE2_MOVEMENT_BLEND_DELAY,
this,
"EndFighting");
5425 if (item && item.GetHierarchyParent() && item.GetHierarchyParent().IsWeapon() && item.IsRuined())
5446 super.RPC(rpc_type, params, guaranteed, recipient);
5452 super.OnRPC(sender, rpc_type, ctx);
5458 case ERPCs.RPC_PLAYER_STAT:
5463 case ERPCs.RPC_SYNC_DISPLAY_STATUS:
5470 case ERPCs.RPC_PLAYER_SYMPTOM_ON:
5477 case ERPCs.RPC_PLAYER_SYMPTOM_OFF:
5484 case ERPCs.RPC_DAMAGE_VALUE_SYNC:
5489 case ERPCs.RPC_USER_ACTION_MESSAGE:
5501 case ERPCs.RPC_SOFT_SKILLS_SPECIALTY_SYNC:
5502 ref Param1<float> p_synch =
new Param1<float>(0);
5504 float specialty_level = p_synch.param1;
5505 GetSoftSkillsManager().SetSpecialtyLevel(specialty_level);
5508 case ERPCs.RPC_SOFT_SKILLS_STATS_SYNC:
5509 ref Param5<float, float, float, float, bool> p_debug_synch =
new Param5<float, float ,float, float, bool>(0, 0, 0, 0,
false);
5510 ctx.Read(p_debug_synch);
5511 float general_bonus_before = p_debug_synch.param1;
5512 float general_bonus_after = p_debug_synch.param2;
5513 float last_UA_value = p_debug_synch.param3;
5514 float cooldown_value = p_debug_synch.param4;
5515 float cooldown_active = p_debug_synch.param5;
5516 GetSoftSkillsManager().SetGeneralBonusBefore(general_bonus_before);
5517 GetSoftSkillsManager().SetGeneralBonusAfter(general_bonus_after);
5518 GetSoftSkillsManager().SetLastUAValue(last_UA_value);
5519 GetSoftSkillsManager().SetCoolDownValue(cooldown_value);
5520 GetSoftSkillsManager().SetCoolDown(cooldown_active);
5523 case ERPCs.RPC_WARNING_ITEMDROP:
5528 g_Game.GetMission().AddActiveInputExcludes({
"menu"});
5533 case ERPCs.RPC_WARNING_TELEPORT:
5538 g_Game.GetMission().AddActiveInputExcludes({
"menu"});
5542 case ERPCs.RPC_INIT_SET_QUICKBAR:
5543 ref Param1<int> count =
new Param1<int>(0);
5544 if (ctx.Read(count))
5546 for (
int i = 0; i < count.param1 ; i++)
5553 case ERPCs.RPC_SYNC_THERMOMETER:
5556 if (ctx.Read(value))
5557 m_Hud.SetTemperature(value.ToString() +
"#degrees_celsius");
5562 case ERPCs.RPC_CHECK_PULSE:
5583 case PlantType.TREE_HARD:
5584 SoundHardTreeFallingPlay();
5587 case PlantType.TREE_SOFT:
5588 SoundSoftTreeFallingPlay();
5591 case PlantType.BUSH_HARD:
5592 SoundHardBushFallingPlay();
5595 case PlantType.BUSH_SOFT:
5596 SoundSoftBushFallingPlay();
5599 case ERPCs.RPC_DEBUG_MONITOR_FLT:
5606 case ERPCs.RPC_DEBUG_MONITOR_STR:
5613 case ERPCs.RPC_ITEM_REPAIR:
5614 PluginInventoryRepair repairPlugin = PluginInventoryRepair.Cast(
GetPlugin(PluginInventoryRepair));
5615 repairPlugin.OnRPC(ctx);
5631 #ifdef DIAG_DEVELOPER
5632 case ERPCs.DEV_RPC_AGENT_RESET:
5640 case ERPCs.DEV_PLAYER_DEBUG_REQUEST:
5642 PluginRemotePlayerDebugServer plugin_remote_server = PluginRemotePlayerDebugServer.Cast(
GetPlugin(PluginRemotePlayerDebugServer));
5643 plugin_remote_server.OnRPC(ctx,
this);
5647 case ERPCs.DEV_PLAYER_DEBUG_DATA:
5649 PluginRemotePlayerDebugClient plugin_remote_client = PluginRemotePlayerDebugClient.Cast(
GetPlugin(PluginRemotePlayerDebugClient));
5650 PluginDeveloper plugin_dev = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
5651 if (plugin_dev.m_ScriptConsole)
5652 plugin_dev.m_ScriptConsole.OnRPCEx(rpc_type, ctx);
5654 plugin_remote_client.OnRPC(ctx);
5658 case ERPCs.DEV_AGENT_GROW:
5664 case ERPCs.RPC_ITEM_DIAG_CLOSE:
5667 mid.StopWatchRequest(
this);
5672 case ERPCs.DEV_REQUEST_UTS_DEBUG:
5674 PluginUniversalTemperatureSourceServer plugin_uts_server = PluginUniversalTemperatureSourceServer.Cast(
GetPlugin(PluginUniversalTemperatureSourceServer));
5675 plugin_uts_server.OnRPC(ctx,
this);
5679 case ERPCs.DEV_UTS_DEBUG_DATA:
5681 PluginUniversalTemperatureSourceClient plugin_uts_client = PluginUniversalTemperatureSourceClient.Cast(
GetPlugin(PluginUniversalTemperatureSourceClient));
5682 plugin_uts_client.OnRPC(ctx);
5689 case ERPCs.DEV_RPC_SERVER_SCRIPT:
5698 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
5705 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
5707 PluginDeveloper dev = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
5708 if (dev.m_ScriptConsole)
5709 dev.m_ScriptConsole.OnRPCEx(rpc_type, ctx);
5713 case ERPCs.DEV_SET_DEV_ITEM:
5715 Param1<EntityAI> ent =
new Param1<EntityAI>(null);
5716 if (ctx.Read(ent) && ent.param1)
5719 mid2.RegisterDebugItem(ent.param1,
this);
5725 case ERPCs.RPC_ITEM_DIAG:
5727 Param1<EntityAI> p1 =
new Param1<EntityAI>(null);
5731 plgn.OnRPC(p1.param1, ctx);
5738 #ifdef DIAG_DEVELOPER
5739 PluginDeveloper module_rc = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
5741 module_rc.OnRPC(
this, rpc_type, ctx);
5743 PluginDeveloperSync module_rcs = PluginDeveloperSync.Cast(
GetPlugin(PluginDeveloperSync));
5745 module_rcs.OnRPC(
this, rpc_type, ctx);
5753 if (plugin_diag_menu)
5754 plugin_diag_menu.OnRPC(
this, rpc_type, ctx);
5760 super.OnGameplayDataHandlerSync();
5807 if (
Class.CastTo(ppeRequester, PPERequesterBank.GetRequester(ppeIdx)))
5808 ppeRequester.
Start();
5831 PPERequesterBank.GetRequester(ppeIdx).Stop(
new Param1<bool>(
true));
5862 g_Game.GetWeather().GetSnowfall().GetLimits(min,max);
5870 super.EEHealthLevelChanged(oldLevel, newLevel, zone);
5871 if (!
g_Game.IsDedicatedServer())
5888 super.OnVariablesSynchronized();
5890 if (m_ModuleLifespan)
5892 m_ModuleLifespan.SynchLifespanVisual(
this, m_LifeSpanState, m_HasBloodyHandsVisible, m_HasBloodTypeVisible, m_BloodType);
6003 item.SetHealthMax(
"",
"");
6004 item.SetWet(item.GetWetInit());
6005 item.SetTemperatureDirect(
GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE);
6006 item.SetFrozen(
false);
6017 m_PlayerSelected =
true;
6025#ifdef FEATURE_NETWORK_RECONCILIATION
6029 identity.Possess(
this);
6048 Param1<int> paramCount =
new Param1<int>(count);
6049 params.Insert(paramCount);
6050 for (
int i = 0; i < count; i++)
6056 if (count > 0 &&
g_Game.IsMultiplayer())
6058 g_Game.RPC(
this,
ERPCs.RPC_INIT_SET_QUICKBAR, params,
true, identity);
6068 if (
g_Game.IsMultiplayer())
6073 g_Game.RPCSingleParam(
this,
ERPCs.RPC_WARNING_ITEMDROP, null,
true, identity);
6077 g_Game.GetMission().SyncRespawnModeInfo(identity);
6104 g_Game.GetMission().ResetGUI();
6114 int characterCount =
g_Game.GetMenuData().GetCharactersCount() - 1;
6115 int idx =
g_Game.GetMenuData().GetLastPlayedCharacter();
6116 if (idx ==
GameConstants.DEFAULT_CHARACTER_MENU_ID || idx > characterCount)
6121 g_Game.GetMission().EnableAllInputs(
true);
6125 #ifdef DIAG_DEVELOPER
6126 m_TargetTemperatureDiag = PluginTargetTemperature.Cast(
GetPlugin(PluginTargetTemperature));
6127 m_TargetTemperatureDiag.Init(
this);
6133 m_Bot =
new Bot(
this);
6140 super.SimulateDeath(state);
6154 menuData.SaveCharacter(
false,
true);
6155 menuData.SetCharacterName(menuData.GetLastPlayedCharacter(),
g_Game.GetMenuDefaultCharacterData(
false).GetCharacterName());
6156 menuData.SaveCharactersLocal();
6163 BurlapSackCover attachment;
6166 PPERequester_BurlapSackEffects req;
6167 if (
Class.CastTo(req,PPERequesterBank.GetRequester(PPERequesterBank.REQ_BURLAPSACK)))
6173 else if (req.IsRequesterRunning())
6175 PPERequesterBank.GetRequester(PPERequester_BurlapSackEffects).Stop();
6192 if (item && item.IsObstructingVoice())
6194 item.MutePlayer(
this,
true);
6198 g_Game.SetVoiceEffect(
this, VoiceEffectMumbling,
false);
6199 g_Game.SetVoiceEffect(
this, VoiceEffectObstruction,
false);
6208 float resistance = 0;
6209 if (mask.HasIntegratedFilter() || mask.IsExternalFilterAttached())
6210 resistance = 1 - mask.GetFilterQuantity01();
6242 if (
m_EffectWidgets.m_MaskWidgetUpdateCount < 2 && callback.GetLength() > 2 && playback_time > 0.5 )
6252 if (super.OnInputUserDataProcess(userDataType, ctx))
6280 if (ctx.Read(uid) && ctx.Read(mute))
6282 g_Game.MutePlayer(uid, GetIdentity().GetPlainId(), mute);
6301 float blood = GetHealth(
"GlobalHealth",
"Blood");
6302 float blood_scale_normalized =
Math.InverseLerp(
PlayerConstants.BLOOD_THRESHOLD_FATAL, GetMaxHealth(
"",
"Blood"), blood);
6303 blood_scale_normalized =
Math.Clamp(blood_scale_normalized,0,1);
6316 bool use_stack_max =
false;
6321 if (!ctx.Read(type))
6326 if (!ctx.Read(item1))
6329 if (!dstIL.ReadFromContext(ctx))
6333 if (!ctx.Read(dummy))
6336 if (item1 && dstIL.IsValid())
6338 item1.GetInventory().GetCurrentInventoryLocation(srcIL);
6347 item1.SplitItemToInventoryLocation(dstIL);
6349 item1.SplitIntoStackMaxToInventoryLocation(dstIL);
6355 if (!ctx.Read(item1))
6357 if (!ctx.Read(item2))
6359 if (!ctx.Read(use_stack_max))
6361 if (!ctx.Read(slot_id))
6364 item1.GetInventory().GetCurrentInventoryLocation(srcIL);
6369 if (type == -1 && item1 && item2)
6371 item2.GetInventory().GetCurrentInventoryLocation(dstIL);
6374 item1.CombineItems(item2, use_stack_max);
6376 else if (type == 1 && item1)
6389 dstIL.SetAttachment(item2, item1, slot_id);
6399 item1.SplitIntoStackMax(item2, slot_id,
this);
6407 item1.SplitItem(
this);
6410 else if (type == 2 && item1 && item2)
6418 dstIL.SetCargo(item2, item1, slot_id, row, col,
false);
6422 item1.SplitIntoStackMaxCargo(item2, slot_id, row, col);
6424 else if (type == 3 && item1)
6426 dstIL.SetHands(
this, item1);
6429 item1.SplitIntoStackMaxHands(
this);
6439 return ItemBase.Cast(GetEntityInHands());
6449 bool is_AI =
g_Game.IsKindOf(object_name,
"DZ_LightAI");
6452 return SpawnAI(object_name, pos);
6458 Math3D.MatrixIdentity4(mtx);
6460 inv_loc.SetGround(null, mtx);
6464 if (
g_Game.IsKindOf(object_name,
"Boat"))
6468 return EntityAI.Cast(
g_Game.CreateObjectEx(object_name, inv_loc.GetPos(), flags));
6476 vector posRandom = MiscGameplayFunctions.GetRandomizedPositionVerifiedPlayer(
this,raycastDistance,radius,
this);
6488 bool is_ai =
g_Game.IsKindOf(object_name,
"DZ_LightAI");
6506 pos_spawn[0] = pos_spawn[0] +
Math.RandomFloat(-0.2, 0.2);
6507 pos_spawn[2] = pos_spawn[2] +
Math.RandomFloat(-0.2, 0.2);
6509 item.SetPosition(pos_spawn);
6510 item.PlaceOnSurface();
6511 return can_be_dropped;
6538 string t = src.GetType();
6542 bool locked =
g_Game.HasInventoryJunctureDestination(
this, loc);
6545 Print(
"Warning: Split: CreateCopyOfItemInInventory - Cannot create entity at locked inventory at loc=" +
InventoryLocation.DumpToStringNullSafe(loc));
6551 MiscGameplayFunctions.TransferItemProperties(src, dst);
6553 g_Game.RemoteObjectTreeCreate(dst);
6555 Print(
"CreateCopyOfItemInInventory - created " + dst.GetName() +
" at loc=" +
InventoryLocation.DumpToStringNullSafe(loc));
6573 dst.PlaceOnSurface();
6574 dst.SetResultOfSplit(markItemAsSplitResult);
6575 MiscGameplayFunctions.TransferItemProperties(src, dst);
6594 g_Game.ChatMP(
this, text, style);
6598 g_Game.Chat(text, style);
6605 Message(text,
"colorStatusChannel");
6617 Message(text,
"colorFriendly");
6623 Message(text,
"colorImportant");
6635 g_Game.GetUIManager().CloseAll();
6636 mission.RemoveActiveInputExcludes({
"inventory"},
false);
6637 mission.RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
6655 if ((
g_Game.IsServer() || !
g_Game.IsMultiplayer()) && inventory)
6659 int nItems = items.Count();
6660 for (
int i = 0; i < nItems; ++i)
6665 g_Game.ObjectDelete(item);
6673 LocalDestroyEntityInHands();
6684 int count = itemsArray.Count();
6686 for (
int i = 0; i < count; ++i)
6688 Class.CastTo(item, itemsArray.Get(i));
6692 ServerDropEntity(item);
6700 g_Game.ObjectGetType(
this, type);
6712 m_ModuleLifespan.UpdateLifespan(
this,
true);
6730 super.OnParticleEvent(pEventType ,pUserString, pUserInt);
6732 if (!
g_Game.IsDedicatedServer())
6734 if (pUserInt == 123456)
6736 PlayerBase player = PlayerBase.Cast(
this);
6737 int boneIdx = player.GetBoneIndexByName(
"Head");
6753 eff.SetAutodestroy(
true);
6756 player.AddChild(p, boneIdx);
6765 if (!ToDelete() && IsAlive() && !IsSwimming() && !
m_IsDrowning)
6777 HumanCommandAdditives ad = GetCommandModifier_Additives();
6808 AddChild(p, boneIdx);
6816 vector pos = GetBonePositionWS(index);
6817 float depth =
g_Game.GetWaterDepth(pos);
6833 if (show_state != m_LifeSpanState)
6834 state_changed =
true;
6835 m_LifeSpanState = show_state;
6848 return m_LifeSpanState;
6853 return m_LastShavedSeconds;
6858 m_LastShavedSeconds = last_shaved_seconds;
6869 set<int> ret =
new set<int>;
6870 ret.Insert(EAttExclusions.SHAVING_MASK_ATT_0);
6871 ret.Insert(EAttExclusions.SHAVING_HEADGEAR_ATT_0);
6879 return m_HasBloodyHandsVisible;
6884 return m_HasBloodyHandsVisible;
6889 SetBloodyHandsBase(show);
6894 SetBloodyHandsBase(type);
6897 private void SetBloodyHandsBase(
int type)
6899 m_HasBloodyHandsVisible = type;
6902 #ifdef DIAG_DEVELOPER
6904 if (IsControlledPlayer())
6913 int GetBloodyHandsPenaltyAgents()
6915 if (HasBloodyHands())
6917 if (GetInventory().FindAttachment(InventorySlots.GLOVES))
6920 float randomValue = Math.RandomFloat01();
6921 if (GetBloodyHandsPenaltyChancePerAgent(
eAgents.SALMONELLA) >= randomValue)
6930 float GetBloodyHandsPenaltyChancePerAgent(
eAgents type)
6933 if (m_BloodyHandsPenaltyChancePerAgent.Find(type, value))
6940 void SetBloodyHandsPenaltyChancePerAgent(
eAgents type,
float amount)
6942 float storedValue = GetBloodyHandsPenaltyChancePerAgent(type);
6943 if (amount > storedValue)
6944 m_BloodyHandsPenaltyChancePerAgent.Set(type, Math.Clamp(amount, 0.0, 1.0));
6947 void ClearBloodyHandsPenaltyChancePerAgent(
eAgents type)
6949 m_BloodyHandsPenaltyChancePerAgent.Set(type, 0.0);
6952 bool HasBloodTypeVisible()
6954 return m_HasBloodTypeVisible;
6957 void SetBloodTypeVisible(
bool show)
6959 m_HasBloodTypeVisible = show;
6968 void SetBloodType(
int blood_type)
6978 SoftSkillsManager GetSoftSkillsManager()
6980 return m_SoftSkillsManager;
6985 if (IsPlayerSelected() && !IsAlive())
6987 SimulateDeath(
true);
6988 m_DeathCheckTimer.Stop();
6999 int GetNoisePresenceInAI()
7001 if (m_PresenceNotifier)
7003 return m_PresenceNotifier.GetNoisePresence();
7012 return (m_PersistentFlags & bit);
7018 m_PersistentFlags = (m_PersistentFlags | bit);
7020 m_PersistentFlags = ((~bit) & m_PersistentFlags);
7027 int GetStoreLoadVersion()
7029 return m_StoreLoadVersion;
7035 if (
g_Game.SaveVersion() < 102)
7037 ctx.Write(ACT_STORE_SAVE_VERSION);
7040 super.OnStoreSave(ctx);
7042 GetHumanInventory().OnStoreSave(ctx);
7043 OnStoreSaveLifespan(ctx);
7047 GetPlayerStats().SaveStats(ctx);
7048 m_ModifiersManager.OnStoreSave(ctx);
7049 m_AgentPool.OnStoreSave(ctx);
7050 GetSymptomManager().OnStoreSave(ctx);
7051 if (GetBleedingManagerServer())
7053 GetBleedingManagerServer().OnStoreSave(ctx);
7055 m_PlayerStomach.OnStoreSave(ctx);
7056 ctx.Write(GetBrokenLegs());
7058 SaveAreaPersistenceFlag(ctx);
7060 HumanCommandLadder ladder = GetCommand_Ladder();
7064 ctx.Write(ladder.GetLogoutPosition());
7071 ArrowManagerPlayer arrowManager = ArrowManagerPlayer.Cast(
GetArrowManager());
7072 arrowManager.Save(ctx);
7079 if (GetModifiersManager())
7080 SetPersistentFlag(
PersistentFlag.AREA_PRESENCE, GetModifiersManager().IsModifierActive(
eModifiers.MDF_AREAEXPOSURE));
7081 ctx.Write(m_PersistentFlags);
7088 m_aQuickBarLoad =
new array<ref Param2<EntityAI,int>>;
7093 if (!ctx.Read(m_StoreLoadVersion))
7097 if (!super.OnStoreLoad(ctx, version))
7101 if (!GetHumanInventory().
OnStoreLoad(ctx, version))
7104 if (!OnStoreLoadLifespan(ctx, version))
7109 if (!GetPlayerStats().
LoadStats(ctx, version))
7111 Print(
"---- failed to load PlayerStats ----");
7115 if (!m_ModifiersManager.OnStoreLoad(ctx, version))
7117 Print(
"---- failed to load ModifiersManager, read fail ----");
7121 if (!m_AgentPool.OnStoreLoad(ctx, version))
7123 Print(
"---- failed to load AgentPool, read fail ----");
7127 if (!GetSymptomManager().
OnStoreLoad(ctx, version))
7129 Print(
"---- failed to load SymptomManager, read fail ----");
7133 if (!GetBleedingManagerServer().
OnStoreLoad(ctx, version))
7135 Print(
"---- failed to load BleedingManagerServer, read fail ----");
7139 if (!m_PlayerStomach.OnStoreLoad(ctx, version))
7141 Print(
"---- failed to load PlayerStomach, read fail ----");
7148 if (!ctx.Read(m_BrokenLegState))
7154 if (!ctx.Read(m_LocalBrokenState))
7161 if (version >= 125 && (!ctx.Read(m_PersistentFlags)))
7163 Print(
"---- failed to load Persistent Flags, read fail ----");
7170 if (!ctx.Read(onLadder))
7178 if (!ctx.Read(position))
7184 if (!hive || !hive.CharacterIsLoginPositionChanged(
this))
7193 ArrowManagerPlayer arrowManager = ArrowManagerPlayer.Cast(
GetArrowManager());
7194 arrowManager.Load(ctx);
7198 Print(
"---- PlayerBase OnStoreLoad SUCCESS ----");
7204 GetHumanInventory().OnAfterStoreLoad();
7206 m_EmoteManager.AfterStoreLoad();
7208 if (GetPlayerStats())
7209 GetPlayerStats().OnAfterStoreLoad();
7211 PlayerRestrictedAreaInstance pra;
7213 if (
g_Game.GetGameState() != DayZGameState.MAIN_MENU && CfgPlayerRestrictedAreaHandler.IsInitialized() && CfgPlayerRestrictedAreaHandler.IsPointInPlayerRestrictedArea(currentPos,pra))
7216 vector safePos = pra.GetRandomSafePos3D(currentPos);
7217 if (MiscGameplayFunctions.TeleportPlayerToSafeLocation3D(
this,safePos) &&
m_AdminLog)
7218 m_AdminLog.PlayerTeleportedLog(
this,currentPos,safePos,
"Spawning in Player Restricted Area: " + pra.areaName);
7224 ctx.Write(m_LifeSpanState);
7225 ctx.Write(m_LastShavedSeconds);
7226 ctx.Write(m_HasBloodyHandsVisible);
7227 ctx.Write(m_HasBloodTypeVisible);
7233 int lifespan_state = 0;
7234 if (!ctx.Read(lifespan_state))
7236 m_LifeSpanState = lifespan_state;
7238 int last_shaved = 0;
7239 if (!ctx.Read(last_shaved))
7241 m_LastShavedSeconds = last_shaved;
7245 bool bloody_hands_old;
7246 if (!ctx.Read(bloody_hands_old))
7248 m_HasBloodyHandsVisible = bloody_hands_old;
7252 int bloody_hands = 0;
7253 if (!ctx.Read(bloody_hands))
7255 m_HasBloodyHandsVisible = bloody_hands;
7259 bool blood_visible =
false;
7260 if (!ctx.Read(blood_visible))
7262 m_HasBloodTypeVisible = blood_visible;
7265 if (!ctx.Read(blood_type))
7272 vector m_PlayerOldPos;
7273 void UpdatePlayerMeasures()
7275 int hour, minute, second;
7278 distance = StatGet(AnalyticsManagerServer.STAT_DISTANCE);
7279 if (m_AnalyticsTimer)
7281 StatsEventMeasuresData data =
new StatsEventMeasuresData();
7282 data.m_CharacterId =
g_Game.GetDatabaseID();
7283 data.m_TimeInterval = m_AnalyticsTimer.GetRemaining();
7284 data.m_DaytimeHour = hour;
7285 data.m_PositionStart = m_PlayerOldPos;
7287 data.m_DistanceOnFoot = distance;
7288 Analytics.PlayerMeasures(data);
7299 g_Game.GetAnalyticsServer().OnPlayerConnect(
this);
7302 if (m_AnalyticsTimer)
7303 m_AnalyticsTimer.Run(60,
this,
"UpdatePlayerMeasures", null,
true);
7306 ResetConstructionActionData();
7311 Debug.Log(
"Player reconnected:"+this.
ToString(),
"Reconnect");
7315 ResetConstructionActionData();
7320 Debug.Log(
"Player disconnected:"+this.
ToString(),
"Connect");
7325 g_Game.GetAnalyticsServer().OnPlayerDisconnect(
this);
7327 StatsEventDisconnectedData data =
new StatsEventDisconnectedData();
7328 data.m_CharacterId =
g_Game.GetDatabaseID();
7329 data.m_Reason =
"Disconnected";
7330 Analytics.PlayerDisconnected(data);
7332 if (m_AnalyticsTimer)
7333 m_AnalyticsTimer.Stop();
7334 UpdatePlayerMeasures();
7336 SetPlayerDisconnected(
true);
7341 GetModifiersManager().SetModifiers(enable);
7344 bool Consume(PlayerConsumeData data)
7346 PluginTransmissionAgents plugin = PluginTransmissionAgents.Cast(
GetPlugin(PluginTransmissionAgents));
7347 WorldData worldData =
g_Game.GetMission().GetWorldData();
7349 float temperature = 0;
7355 if (pollution & EPollution.HEAVYMETAL)
7356 data.m_Agents = data.m_Agents |
eAgents.HEAVYMETAL;
7359 data.m_Agents = data.m_Agents |
eAgents.CHOLERA;
7363 m_PlayerStomach.AddToStomach(Liquid.GetLiquidClassname(
LIQUID_WATER), data.m_Amount, 0 , data.m_Agents, temperature);
7368 Edible_Base edibleItem = Edible_Base.Cast(data.m_Source);
7369 if (!edibleItem || !edibleItem.CanBeConsumed())
7374 data.m_Agents = edibleItem.FilterAgents(data.m_Agents | edibleItem.GetAgents());
7375 temperature = edibleItem.GetTemperature();
7380 if (edibleItem.IsLiquidContainer())
7382 int liquidType = edibleItem.GetLiquidType();
7383 string liquidClassName = Liquid.GetLiquidClassname(liquidType);
7384 if (liquidClassName.Length() == 0)
7385 Error(
"Error! Trying to add unknown liquid to stomach with item=" +
Object.GetDebugName(edibleItem) +
" data.m_Type=" + data.m_Type +
" liquid_type=" + liquidType);
7387 m_PlayerStomach.AddToStomach(liquidClassName, data.m_Amount, 0, data.m_Agents, temperature);
7393 foodStageType = edibleItem.
GetFoodStage().GetFoodStageType();
7395 m_PlayerStomach.AddToStomach(data.m_Source.GetType(), data.m_Amount, foodStageType, data.m_Agents, temperature);
7398 edibleItem.Consume(data.m_Amount,
this);
7407 void ShowUnconsciousScreen(
bool show)
7412 g_Game.GetUIManager().ScreenFadeIn(0,
"You are Unconscious", FadeColors.BLACK, FadeColors.WHITE);
7417 g_Game.GetUIManager().ScreenFadeOut(0);
7423 override void RequestSoundEventEx(
EPlayerSoundEventID id,
bool from_server_and_client =
false,
int param = 0)
7427 PlaySoundEventEx(
id,
false,
false, param);
7431 SendSoundEventEx(
id, param);
7434 override void RequestSoundEvent(
EPlayerSoundEventID id,
bool from_server_and_client =
false)
7436 RequestSoundEventEx(
id, from_server_and_client);
7439 override void RequestSoundEventStop(
EPlayerSoundEventID id,
bool from_server_and_client =
false,
int param = EPlayerSoundEventParam.STOP_PLAYBACK)
7443 StopSoundEvent(
id,
false, param);
7447 SendSoundEventEx(
id, param);
7465 if (!
g_Game.IsMultiplayer())
7494 if (m_ReplaceSoundEventHandler)
7495 return m_ReplaceSoundEventHandler.PlayReplaceSound(soundEventID, soundType, param);
7507 if (!m_PlayerSoundEventHandler)
7510 return m_PlayerSoundEventHandler.PlayRequestEx(
id, is_from_server, param);
7515 if (!m_PlayerSoundEventHandler)
7518 return m_PlayerSoundEventHandler.StopRequest(
id, is_from_server, param);
7523 return m_PlayerSoundEventHandler;
7532 if (IsControlledPlayer())
7534 if (!
g_Game.IsDedicatedServer())
7565 if (IsControlledPlayer())
7567 if (!
g_Game.IsDedicatedServer())
7593 #ifdef DIAG_DEVELOPER
7598 DamageSystem.ResetAllZones(
this);
7637 ClearBloodyHandsPenaltyChancePerAgent(
eAgents.SALMONELLA);
7645 HumanCommandVehicle vehCmd = GetCommand_Vehicle();
7648 Transport transport = vehCmd.GetTransport();
7650 transport.FixEntity();
7668 if (m_PerformedActionSounds.Count() == 0)
7677 m_PerformedActionSounds.Clear();
7683 if (
g_Game.IsClient())
return;
7684 RequestSoundEvent(1234);
7713 GetHive().CharacterSave(
this);
7725 if (
Math.RandomFloat01() > chance)
7729 float dist_check = distance * distance;
7730 PluginTransmissionAgents plugin = PluginTransmissionAgents.Cast(
GetPlugin(PluginTransmissionAgents));
7734 if (
vector.DistanceSq(GetWorldPosition(), target.GetWorldPosition()) < dist_check && target !=
this)
7780 int max_count = PluginTransmissionAgents.GetAgentMaxCount(agent_id);
7781 return m_AgentPool.GetSingleAgentCount(agent_id) / max_count;
7812 float min_distance = 0.5;
7815 vector to = from + (
g_Game.GetCurrentCameraDirection() * min_distance);
7818 int contactComponent;
7820 DayZPhysics.RaycastRV(from, to, contactPos, contactDir, contactComponent, NULL, NULL, NULL,
false,
true);
7829 return (!mask || (mask && mask.AllowFoodConsumption()));
7912 return m_StatStamina;
7921 return m_StatSpecialty;
7930 return m_StatBloodType;
7939 return m_StatHeatBuffer;
8004#ifdef DIAG_DEVELOPER
8005 if (m_Bot && action_id >
EActions.PLAYER_BOT_INTERNAL_START && action_id <
EActions.PLAYER_BOT_END)
8007 m_Bot.StartAction(action_id);
8012 if (super.OnAction(action_id, player, ctx))
8048 PluginTransmissionAgents pluginTransmissionAgents = PluginTransmissionAgents.Cast(
GetPlugin(PluginTransmissionAgents));
8050#ifdef DIAG_DEVELOPER
8056 map<int, string> agentList = pluginTransmissionAgents.GetSimpleAgentList();
8060 foreach (
int tid,
string tname : agentList)
8062 string injectName =
"Inject " + tname;
8063 string removeName =
"Remove " + tname;
8073#ifdef DIAG_DEVELOPER
8078 int cnt = e.GetVariableCount();
8081 for (i = 0; i < cnt; i++)
8083 if (!e.GetVariableValue(null, i, val))
8086 if (val <=
EActions.PLAYER_BOT_INTERNAL_START)
8089 if (val ==
EActions.PLAYER_BOT_START)
8095 if (val >=
EActions.PLAYER_BOT_END)
8098 string name = e.GetVariableName(i);
8107 super.GetDebugActions(outputList);
8109 if (Gizmo_IsSupported())
8126 super.OnSyncJuncture(pJunctureID, pCtx);
8143 GetInventory().OnInventoryJunctureFromServer(pCtx);
8146 GetInventory().OnInventoryJunctureFailureFromServer(pCtx);
8168 if (GetAimingModel() && IsFireWeaponRaised())
8170 GetAimingModel().RequestKuruShake(amount);
8203 SetGetInVehicleDebug(vehicle);
8225 item.SetPrepareToDelete();
8232 return !(GetThrowing().IsThrowingAnimationPlaying() || GetDayZPlayerInventory().IsProcessing() || (
GetActionManager() &&
GetActionManager().GetRunningAction()));
8252 for (
int i = count - 1; i >= 0 ; i--)
8255 if (itemToDelete != null)
8257 itemToDelete.GetInventory().GetCurrentInventoryLocation(il);
8268 for (
int j = count - 1; j >= 0 ; j--)
8271 if (itemToDelete == null)
8277 itemToDelete.Delete();
8291 if (action && action.IsFullBody(
this) && action.IsCameraLockOnPerform())
8308 HumanItemAccessor hia = GetItemAccessor();
8316 m_fLastHeadingDiff = 0;
8321 return super.HeadingModel(pDt, pModel);
8351 return m_LiftWeapon_player;
8356 return m_ObstructWeapon_player;
8370 if (obstruction <= 0.0)
8375 float penetration = weapon.GetObstructionPenetrationDistance(obstruction);
8376 bool inSights = m_CameraIronsight || m_CameraOptics;
8381 return penetration > 0.040;
8387 return penetration > 0.005;
8417 m_ProcessLiftWeaponState = state;
8418 m_ProcessLiftWeapon =
true;
8419 m_ProcessObstructWeapon = obstruct;
8425 HumanCommandWeapons hcw;
8427 bool liftChange = m_LiftWeapon_player != state;
8428 bool obstructChange =
Math.AbsFloat(m_ObstructWeapon_player-obstruct) > 0.03;
8431 m_LiftWeapon_player = state;
8432 m_ObstructWeapon_player = obstruct;
8439 if (!liftChange && !obstructChange)
8449 if (!ctx.CanStoreInputUserData())
8457 ctx.Write(obstruct);
8472 bool limited = weap.LiftWeaponCheckEx(
this, obstruct, hitObject);
8473 if (weap.UseWeaponObstruction(
this, obstruct, hitObject))
8482 obstruct =
Math.Clamp( obstruct, 0, 1 );
8484 if (m_LiftWeapon_player != limited || m_ObstructWeapon_player != obstruct)
8489 else if (m_LiftWeapon_player || m_ObstructWeapon_player > 0)
8498 if (m_ProcessLiftWeapon)
8500 bool liftChange = m_LiftWeapon_player != m_ProcessLiftWeaponState;
8505 m_LiftWeapon_player = m_ProcessLiftWeaponState;
8506 m_ObstructWeapon_player = m_ProcessObstructWeapon;
8507 m_ProcessLiftWeapon =
false;
8516 super.HideClothing(optic, state);
8527 if (optic && optic.GetCurrentStepFOV() <
GameConstants.DZPLAYER_CAMERA_FOV_IRONSIGHTS)
8533 SetInvisibleRecursive(
true,
this,clothingArray);
8543 SetInvisibleRecursive(
false,
this,clothingArray);
8555 super.SetDeathDarknessLevel(duration, tick_time);
8557 if (IsControlledPlayer())
8559 float actual_tick = tick_time;
8568 progress = 1 - ((duration - m_DeathDarkeningCurrentTime) / duration);
8570 m_DeathDarkeningCurrentTime += actual_tick;
8572 if (!IsAlive() && IsPlayerSelected())
8578 if (m_DeathDarkeningCurrentTime >= duration)
8580 StopDeathDarkeningEffect();
8585 StopDeathDarkeningEffect();
8626 OverrideSlidePoseAngle(
Math.PI2);
8628 else if (!
IsInFBEmoteState() && IsControlledPlayer() && IsPlayerSelected())
8642 isActionPossible =
false;
8643 Magazine mag = Magazine.Cast(item);
8650 isActionPossible =
true;
8668 if (can_detach && target.GetInventory().FindFreeLocationFor(item, flags, il))
8674 return super.PredictiveTakeEntityToTargetInventory(target, flags, item);
8683 if (can_detach && GetInventory().FindFreeLocationFor(item, flags, il))
8689 return super.PredictiveTakeEntityToInventory(flags, item);
8695 Magazine mag = Magazine.Cast(item);
8696 if (parentWpn && mag)
8703 return super.PredictiveTakeEntityToTargetAttachment(target, item);
8709 Magazine mag = Magazine.Cast(item);
8710 if (parentWpn && mag)
8712 if (target.CanReceiveAttachment(item,slot) &&
GetWeaponManager().CanAttachMagazine(parentWpn, mag))
8717 return super.PredictiveTakeEntityToTargetAttachmentEx(target, item,slot);
8732 return super.PredictiveTakeEntityToTargetCargo(target,item);
8743 dst.SetCargoAuto(cargo, item, row, col, item.GetInventory().GetFlipCargo());
8749 return super.PredictiveTakeEntityToTargetCargoEx (cargo, item, row, col);
8760 Math3D.MatrixIdentity4(m4);
8765 il.SetGround(item, m4);
8770 return super.PredictiveDropEntity(item);
8776 Magazine swapmag1 = Magazine.Cast(item1);
8777 Magazine swapmag2 = Magazine.Cast(item2);
8779 if (swapmag1 && swapmag2)
8783 if (
Class.CastTo(parentWpn, swapmag1.GetHierarchyParent()))
8787 Print(
"[inv] PlayerBase.PredictiveSwapEntities: swapping mag1=" + swapmag1 +
" to parent wpn=" + parentWpn +
" of mag1=" + swapmag1);
8792 Print(
"[inv] PlayerBase.PredictiveSwapEntities: can not swap magazines");
8797 if (
Class.CastTo(parentWpn, swapmag2.GetHierarchyParent()))
8801 Print(
"[inv] PlayerBase.PredictiveSwapEntities: swapping mag1=" + swapmag1 +
" to parent wpn=" + parentWpn +
" of mag2=" + swapmag2);
8806 Print(
"[inv] PlayerBase.PredictiveSwapEntities: can not swap magazines");
8819 ActionTarget atrg =
new ActionTarget(item_ground,null,-1,
vector.Zero,-1.0);
8820 if (mngr_client.GetAction(ActionSwapItemToHands).Can(
this,atrg,
ItemBase.Cast(item_hands)))
8825 return super.PredictiveSwapEntities(item1, item2);
8840 ActionTarget atrg =
new ActionTarget(item1,null,-1,
vector.Zero,-1.0);
8841 if (mngr_client.GetAction(ActionSwapItemToHands).Can(
this,atrg,
ItemBase.Cast(item2)))
8848 return super.PredictiveForceSwapEntities(item1, item2, item2_dst);
8853 if (item.IsHeavyBehaviour() && !
m_ActionManager.GetRunningAction() && !item.GetHierarchyParent())
8858 ActionTarget atrg =
new ActionTarget(item,null,-1,
vector.Zero,-1.0);
8870 super.PredictiveTakeEntityToHands(item);
8888 return super.PredictiveTakeToDst(src,dst);
8896 if (item1.GetInventory().GetCurrentInventoryLocation(il) && il.GetType() ==
InventoryLocationType.HANDS)
8898 if (item2.GetInventory().GetCurrentInventoryLocation(il) && il.GetType() ==
InventoryLocationType.HANDS)
8900 if (item1.GetInventory().GetCurrentInventoryLocation(il) && il.GetType() ==
InventoryLocationType.GROUND)
8901 item_ground = item1;
8902 if (item2.GetInventory().GetCurrentInventoryLocation(il) && il.GetType() ==
InventoryLocationType.GROUND)
8903 item_ground = item2;
8905 return item_hands && item_ground && item_ground.IsHeavyBehaviour();
8916 ErrorEx(
"No valid head detected on character!");
8923 for (
int i = 0; i <
m_CharactersHead.m_HeadHairSelectionArray.Count(); ++i)
8929#ifdef DIAG_DEVELOPER
8942#ifdef DIAG_DEVELOPER
8945 switchState = !diagmenuu.m_HairHidingStateMap.Get(level);
8946 diagmenuu.m_HairHidingStateMap.Set(level, switchState);
8952 switchState = !state;
8956 stt.SetSelectionState(switchState);
8975 if (item.HidesSelectionBySlot())
8978 for (i = 0; i < count; ++i)
8980 if (itemInventory.
GetSlotId(i) == slot_id)
8982 str = item.GetHeadHidingSelection().Get(i);
8988 Debug.Log(
"No valid selection '" + str +
"' found on head of " +
GetType() +
". Verify the p3d, model config, and the 'HAIR_HIDING_SELECTIONS' macro in basicDefines.");
8995 count = item.GetHeadHidingSelection().Count();
8996 for (i = 0; i < count; i++)
8998 str = item.GetHeadHidingSelection().Get(i);
9004 Debug.Log(
"No valid selection '" + str +
"' found on head of " +
GetType() +
". Verify the p3d, model config, and the 'HAIR_HIDING_SELECTIONS' macro in basicDefines.");
9016 bool exception_hidden =
false;
9028 for (i = 0; i < count; i++)
9033 for (i = 0; i < count; i++)
9036 shown = stt.GetSelectionState();
9047 exception_hidden =
true;
9053 if (exception_hidden)
9064 array<int> translatedSelectinosArray = stt.GetTranslatedSelections();
9065 for (
int i = 0; i < translatedSelectinosArray.Count(); i++)
9067 index = translatedSelectinosArray.Get(i);
9120 Error(
"AddActiveNV | illegal server-side call!");
9135 Error(
"RemoveActiveNV | illegal server-side call!");
9153 string text = super.GetDebugText();
9170 void DEBUGRotateNVG()
9174 if (FindAttachmentBySlotName(
"Eyewear"))
9176 nvg = NVGoggles.Cast(FindAttachmentBySlotName(
"Eyewear").FindAttachmentBySlotName(
"NVG"));
9178 else if (FindAttachmentBySlotName(
"Headgear"))
9180 nvg = NVGoggles.Cast(FindAttachmentBySlotName(
"Headgear").FindAttachmentBySlotName(
"NVG"));
9185 nvg.RotateGoggles(nvg.m_IsLowered);
9194 if (slot_name ==
"Headgear")
9196 item.SetSimpleHiddenSelectionState(0,1);
9197 item.SetSimpleHiddenSelectionState(1,0);
9199 else if (slot_name ==
"Mask")
9201 item.SetSimpleHiddenSelectionState(0,0);
9202 item.SetSimpleHiddenSelectionState(1,1);
9211 if (slot_name ==
"Headgear")
9213 item.SetSimpleHiddenSelectionState(0,1);
9214 item.SetSimpleHiddenSelectionState(1,0);
9216 else if (slot_name ==
"Mask")
9218 item.SetSimpleHiddenSelectionState(0,0);
9219 item.SetSimpleHiddenSelectionState(1,1);
9241 int nBodyparts = bodyparts.Count();
9242 for (
int i = 0; i < nBodyparts; ++i)
9250 path =
"cfgVehicles " + bodypart.GetType();
9251 idx = bodypart.GetHiddenSelectionIndex(
"personality");
9259 path =
"cfgVehicles " + item.GetType();
9260 idx = item.GetHiddenSelectionIndex(
"personality");
9289 AddChild(p, boneIdx);
9306 AddChild(p, boneIdx);
9323 int idx = GetHiddenSelectionIndex(
"decay_preload");
9357 ActionTarget actionTarget =
new ActionTarget(null, null, -1,
vector.Zero, -1);
9389 legZones.Insert(
"LeftLeg");
9390 legZones.Insert(
"RightLeg");
9391 legZones.Insert(
"RightFoot");
9392 legZones.Insert(
"LeftFoot");
9394 foreach (
string legZone : legZones)
9395 DecreaseHealth(legZone,
"", inputDmg);
9403 if (!hide && ((!IsSwimming() && !IsClimbingLadder() && !IsInVehicle() && !
AnimCommandCheck(HumanMoveCommandID.CommandSwim | HumanMoveCommandID.CommandLadder | HumanMoveCommandID.CommandVehicle)) || force))
9405 SetEnergyManagerState(item,
true);
9406 GetItemAccessor().HideItemInHands(
false);
9410 SetEnergyManagerState(item,
false);
9411 GetItemAccessor().HideItemInHands(
true);
9419 if (target.GetInventory().FindFreeLocationFor(item, flags, il))
9428 int slotID = il.GetSlot();
9429 float stackableTarget = item.GetTargetQuantityMax(slotID);
9430 if (stackableTarget > 0 && stackableTarget < item.GetQuantity())
9433 if (CastTo(itemB, item))
9435 itemB.SplitIntoStackMaxToInventoryLocationClient(il);
9450 return super.TakeEntityToInventoryImpl(mode, flags, item);
9461 return super.TakeEntityToCargoImpl(mode, item);
9472 return super.TakeEntityAsAttachmentImpl(mode, item);
9483 super.TakeEntityToHandsImpl(mode, item);
9494 return super.TakeEntityToTargetInventoryImpl(mode, target, flags, item);
9505 return super.TakeEntityToTargetCargoImpl(mode, target, item);
9516 return super.TakeEntityToTargetAttachmentImpl(mode, target, item);
9527 return super.TakeToDstImpl(mode, src, dst);
9541 float playerSpeed = GetCommand_Move().GetCurrentMovementSpeed();
9547 float particleLifetime = 5.25;
9548 float particleSpeed = 0.25;
9549 if (playerSpeed >= 1)
9551 particleLifetime = 3.5;
9552 particleSpeed = 3.25;
9554 if (playerSpeed >= 2)
9556 particleLifetime = 2.5;
9557 particleSpeed = 5.25;
9559 if (playerSpeed >= 3)
9561 particleLifetime = 1.5;
9562 particleSpeed = 8.25;
9571 GetTransform(transform);
9579 if (!IsControlledPlayer())
9607 int pivot = componentIndex;
9623 vector parentTransMat[4];
9626 arrow.GetTransform(arrowTransMat);
9630 GetTransformWS(parentTransMat);
9635 Math3D.YawPitchRollMatrix(closeBoneRotWS *
Math.RAD2DEG,rotMatrix);
9637 parentTransMat[0] = rotMatrix[0];
9638 parentTransMat[1] = rotMatrix[1];
9639 parentTransMat[2] = rotMatrix[2];
9640 parentTransMat[3] = closeBonePosWS;
9643 Math3D.MatrixInvMultiply4(parentTransMat, arrowTransMat, arrowTransMat);
9644 Math3D.MatrixOrthogonalize4(arrowTransMat);
9645 arrow.SetTransform(arrowTransMat);
9647 AddChild(arrow, pivot);
9652 if (bleedingManager)
9654 if (!bleedingManager.AttemptAddBleedingSourceBySelection(compName))
9655 bleedingManager.AttemptAddBleedingSourceBySelection(
"Pelvis");
9677 super.OnFreezeStateChangeClient();
9701 private int m_FaceCoveredForShaveLayers = 0;
9702 int m_AntibioticsActive;
9704 void SwitchItemTypeAttach(
EntityAI item,
string slot)
9710 void SwitchItemTypeDetach(
EntityAI item,
string slot);
9713 void IncreaseAntibioticsCount()
9718 void DecreaseAntibioticsCount()
9725 PlayerConsumeData consumeData =
new PlayerConsumeData();
9726 consumeData.m_Type = consume_type;
9727 consumeData.m_Amount = amount;
9728 consumeData.m_Source = source;
9729 consumeData.m_Agents = 0;
9731 return Consume(consumeData);
9734 bool HasStaminaRemaining()
9736 if (!GetStaminaHandler())
9739 return GetStaminaHandler().GetStamina() > 0;
9742 void SetBloodyHandsPenalty()
9749 if (GetStaminaHandler())
9750 GetStaminaHandler().DepleteStaminaEx(modifier,dT);
9753 [
Obsolete(
"use the GetUndergroundHandler instead")]
9754 UndergroundBunkerHandlerClient GetUndergroundBunkerHandler()
9760 void SetNVGWorking(
bool state)
9763 AddActiveNV(
NVTypes.NV_GOGGLES);
9766 [
Obsolete(
"not used but kept in the case of modders needing/using it")]
9767 void AntibioticsAttack(
float value)
Param4< int, int, string, int > TSelectableActionInfoWithColor
void syncDebugPrint(string s)
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
void ActionDrinkPondContinuous()
ActionEatSnowContinuousCB ActionContinuousBaseCB ActionEatSnowContinuous()
ActionBase GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
ActionStartCarCB ActionContinuousBaseCB ActionStartEngine()
ActionStartEngineBoatCB ActionContinuousBaseCB ActionStartEngineBoat()
ActionUncoverHeadBase ActionContinuousBase ActionUncoverHeadSelf()
override bool CanBePerformedWhileChangingStance()
ActionWashHandsSnowCB ActionContinuousBaseCB ActionWashHandsSnow()
ActionWashHandsWaterCB ActionContinuousBaseCB ActionWashHandsWater()
void AddAction(typename actionName)
void RemoveAction(typename actionName)
ref ArrowManagerBase m_ArrowManager
override ArrowManagerBase GetArrowManager()
const int BREATH_VAPOUR_LEVEL_MAX
void EffectRadial(Param param1, Param param2)
class RecipeCacheData m_Recipes
override event void Read(PawnStateReader ctx)
override event void Write(PawnStateWriter ctx)
const int ECE_EQUIP_ATTACHMENTS
const int ECE_PLACE_ON_SURFACE
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
bool CanPerformActionFromQuickbar(ItemBase mainItem, ItemBase targetItem)
void PerformActionFromQuickbar(ItemBase mainItem, ItemBase targetItem)
override void RequestInterruptAction()
client requests action interrupt
override void RequestEndAction()
void PerformActionStart(ActionBase action, ActionTarget target, ItemBase item, Param extra_data=NULL)
override void EndActionInput()
void ForceTarget(Object targetObject)
represents base for cargo storage for entities
Super root of all classes in Enforce script.
Client only - manage set up crafting on client.
this is main camera class
static bool NoHeading(float pDt, SDayZPlayerHeadingModel pModel, out float pLastHeadingDiff)
override FoodStage GetFoodStage()
Wrapper class for managing particles through SEffectManager.
Particle GetParticle()
Gets the main particle which this Effect is managing.
void SetDecalOwner(Object o)
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool PredictiveSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
script counterpart to engine's class Inventory
bool LocalDestroyEntity(notnull EntityAI item)
proto native bool FindFirstFreeLocationForNewEntity(string item_type, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFirstFreeLocationForNewEntity.
proto native EntityAI GetAttachmentFromIndex(int index)
static proto native bool PrepareDropEntityPos(EntityAI owner, notnull EntityAI item, out vector mat[4], bool useValuesInMatrix=false, int conflictCheckDepth=-1)
Finds a transformation for the item to be dropped to If the initial transforation overlaps with anoth...
proto native EntityAI FindPlaceholderForSlot(int slot)
Returns placeholder entity for slot (naked arms, legs etc).
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native void LockInventory(int lockType)
bool CanAddEntityIntoHands(notnull EntityAI item)
Test if entity can be put into hands.
proto native bool IsInventoryLocked()
proto native void UnlockInventory(int lockType)
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
static proto native EntityAI LocationCreateLocalEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
creates new local item directly at location @NOTE: the item is created localy, i.e....
proto native int GetSlotId(int index)
attachments
bool GetCurrentAttachmentSlotInfo(out int slot_id, out string slot_name)
Returns true if the item is currently attached and outputs attachment slot id and name.
static proto native bool HasInventoryReservation(EntityAI item, InventoryLocation dst)
Internally: HasInventoryReservationEx(item, dst, FindInventoryReservationMode.LEGACY,...
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
const float c_MaxItemDistanceRadius
anti-cheats
proto native int AttachmentCount()
Returns count of attachments attached to this item.
proto native int GetSlotIdCount()
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)...
static void ApplyEffects(PlayerBase player)
Client only - manage set up crafting on client.
provides access to slot configuration
ref MapNavigationBehaviour m_MapNavigationBehaviour
override bool StopSoundEvent(EPlayerSoundEventID id, bool is_from_server=false, int param=0)
bool AnimCommandCheck(HumanMoveCommandID mask)
bool IsTargetInActiveRefresherRange(EntityAI target)
override void PredictiveTakeEntityToHands(EntityAI item)
float GetSimplifiedShockNormalized()
string m_UALastMessage
user actions & symptoms
ref PlayerSoundManagerServer m_PlayerSoundManagerServer
SymptomManager GetSymptomManager()
void UpdateHairSelectionVisibility(bool was_debug=false)
PlayerStat< float > GetStatSpecialty()
DayZPlayerCameraBase m_CurrentCamera
ref Param2< float, float > m_UAProgressParam
bool GetLiquidTendencyDrain()
PlayerStat< float > GetStatToxicity()
PlayerBase m_CheckPulseLastTarget
override bool IsUnconsciousStateOnly()
float GetSingleAgentCountNormalized(int agent_id)
override bool IsRefresherSignalingViable()
ref BleedingSourcesManagerRemote m_BleedingManagerRemote
ref array< int > m_ProcessAddGlassesEffects
override bool PredictiveTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
void SetPlayerLoad(float load)
override void ProcessLiftWeapon()
ref CraftingManager m_CraftingManager
void FixAllInventoryItems()
override bool IsLanded(int pCurrentCommandID)
void ReloadWeapon(EntityAI weapon, EntityAI magazine)
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
void AddPossibleCoverFaceForShave()
DEPRECATED!
void RefreshHandAnimationState(int delay=0)
void ImmuneSystemTick(float value, float deltaT)
override void OnReceivedHit(ImpactEffectsData hitData)
override void OnVariablesSynchronized()
ref array< int > m_ProcessRemoveEffectWidgets
void OnUnconsciousStart()
void SetCraftingRecipeID(int recipeID)
PlayerSoundManagerServer GetPlayerSoundManagerServer()
void UpdateQuickBarEntityVisibility(EntityAI entity)
override bool CanStartConsumingStamina(EStaminaConsumers consumer)
override bool NeedInventoryJunctureFromServer(notnull EntityAI item, EntityAI currParent, EntityAI newParent)
ItemBase GetItemOnSlot(string slot_type)
Returns item that's on this player's attachment slot. Parameter slot_type should be a string from con...
override void OnThrowingModeChange(bool change_to_enabled)
override bool CanSwapItemInCargo(EntityAI child_entity, EntityAI new_entity)
bool TakeEntityToInventoryImpl(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
void MessageAction(string text)
void ClearLastUAMessage()
void OnCommandHandlerTick(float delta_time, int pCurrentCommandID)
ref SymptomManager m_SymptomManager
void SetImmunityBoosted(bool boosted)
bool CheckAndExecuteStackSplit(FindInventoryLocationType flags, notnull EntityAI item, notnull EntityAI target)
override SoundOnVehicle PlaySound(string sound_name, float range, bool create_local=false)
override void OnCommandClimbStart()
void RadialQuickBarCombine(int slotClicked)
void Message(string text, string style)
void MapNavigationItemInPossession(EntityAI item)
void SetMixedSoundState(eMixedSoundStates state)
ref map< EEffectAreaType, float > m_EffectAreaTimeToTick
PlayerStat< float > m_StatEnergy
void PlacingCancelServer()
bool m_MeleeDebug
melee stats
float GetImmunity()
returns player's immunity strength between 0..1
override bool IsLiftWeapon()
ItemBase CreateCopyOfItemInInventoryOrGroundEx(ItemBase src, bool markItemAsSplitResult=false)
static ref array< string > m_BleedingSourcesLow
vector m_DirectionToCursor
void ProcessADSSyncResetRequest()
void OnBleedingSourceAdded()
DamageDealtEffect GetDamageDealtEffect()
ref TInputActionMap m_InputActionMap
ref PlayerStats m_PlayerStats
void SendSoundEventEx(EPlayerSoundEventID id, int param=0)
void ResetPlayer(bool set_max)
override void OnCommandDeathStart()
EntityAI SpawnAI(string object_name, vector pos)
override void OnPlayerRecievedHit()
void EndSurrenderRequest(SurrenderData data=null)
ends surrender, originally intended for surrender->restrained transitioning
ItemBase GetItemOnHead()
Returns item on player's head. For an example, a headtorch.
void OnInventoryMenuClose()
bool CanSpawnBreathVaporEffect()
void CloseMapEx(bool cancelled)
TransferValues GetTransferValues()
int m_SyncedModifiersPrev
override float GetWeaponObstruction()
ref array< int > m_Recipes
void UpdateBrokenLegs(int stateId)
override bool IsUnconscious()
override void SpawnDamageDealtEffect()
DebugMonitorValues GetDebugMonitorValues()
bool m_MapCloseRequestProcessed
ref EffectParticle m_FliesEff
ref array< int > m_ProcessRemoveGlassesEffects
ref ArrowManagerPlayer m_ArrowManager
PlayerStat< float > m_StatHeatComfort
ref PlayerAgentPool m_AgentPool
void QueueRemoveEffectWidget(array< int > effects)
EPulseType GetPulseType()
EEffectAreaType m_InEffectAreaType
override bool PredictiveDropEntity(notnull EntityAI item)
void SetStaminaState(eStaminaState state)
override void OnRollFinish()
void SetHeatBufferDynamicMax(float value)
int GetBreathVapourLevel()
bool IsSwapBetweenHandsAndGroundLargeItem(notnull EntityAI item1, notnull EntityAI item2, out EntityAI item_hands, out EntityAI item_ground)
ref UndergroundHandlerClient m_UndergroundHandler
vector GetLocalProjectionOrientation()
void SetStamina(int value, int range)
void SetActionEndInput(ActionBase action)
float GetStatBordersWater()
bool TakeEntityToTargetAttachmentImpl(InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
void dmgDebugPrint(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
float GetTemporaryResistanceToAgent(int agent)
override void OnLadder(float delta_time, HumanMovementState pState)
called every command handler tick when player is on ladder
override bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
void OnPlayerReceiveFlashbangHitStart(bool visual)
override array< string > GetSuitableFinisherHitComponents()
returns list of suitable finisher hit components (defined on base entity/entity type)
string GetLastUAMessage()
UA Last Message.
eMixedSoundStates GetMixedSoundStates()
void SpawnShockEffect(float intensity_max)
void MessageFriendly(string text)
bool IsMapCallbackCancelInput()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override int GetQuickBarBonus()
ref Hologram m_HologramServer
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
BleedingSourcesManagerServer GetBleedingManagerServer()
vector m_LocalProjectionOrientation
override bool PredictiveSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
void OnPlayerIsNowInsideEffectAreaEndServer()
void OnBleedingSourceRemovedEx(ItemBase item)
static Particle m_ContaminatedAroundPlayerTiny
override void EEKilled(Object killer)
void SetBloodyHands(bool show)
float GetStatBordersEnergy()
override bool CanReleaseAttachment(EntityAI attachment)
void RadialQuickBarSingleUse(int slotClicked)
override void EEItemOutOfHands(EntityAI item)
float GetBordersImmunity()
int m_ActivePrimarySymptomID
void QuickReloadWeapon(EntityAI weapon)
void PreloadDecayTexture()
void DecreaseHealingsCount()
bool CanConsumeFood(ConsumeConditionData data=null)
VirtualHud GetVirtualHud()
EffectSound m_AmbientContamination
override void EEItemIntoHands(EntityAI item)
void MapNavigationItemNotInPossession(EntityAI item)
void UpdateShoulderProxyVisibility(EntityAI item, string slot_name)
int GetCraftingRecipeID()
override bool IsRestrained()
void OnSpawnedFromConsole()
void SetLiftWeapon(bool state, float obstruct=0)
ref Param2< int, int > m_UAParam
override bool PredictiveTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
ref array< int > m_ProcessAddEffectWidgets
override void SwitchItemSelectionTexture(EntityAI item, string slot_name)
bool m_InsideEffectAreaPrev
bool ReadLiftWeaponRequest(int userDataType, ParamsReadContext ctx)
EStatLevels GetStatLevelEnergy()
bool m_AllowQuickRestrain
override bool IsFighting()
ref EffectRadial m_EffectRadial
ref Environment m_Environment
void SetNVGLowered(bool state)
void SetLocalProjectionOrientation(vector local_orientation)
override void EOnFrame(IEntity other, float timeSlice)
int m_ContaminatedAreaCount
PlayerStat< float > GetStatEnergy()
void OnUnconsciousUpdate(float pDt, int last_command)
override void OnCommandLadderStart()
int m_PerformedAnimActionID
GameplayEffectWidgets_base m_EffectWidgets
effect widgets
override void RemoveAgent(int agent_id)
override vector GetDefaultHitPosition()
float m_OriginalSlidePoseAngle
float m_UnconsciousEndTime
override EntityAI SpawnEntityOnGroundPos(string object_name, vector pos)
PlayerStomach GetStomach()
ref PlayerStomach m_PlayerStomach
void OnQuickbarSetEntityRequest(ParamsReadContext ctx)
void IncreaseDiseaseCount()
void SetMapOpen(bool state)
CraftingManager GetCraftingManager()
void AdjustBandana(EntityAI item, string slot_name)
void SetLastMapInfo(float scale, vector pos)
override string GetDefaultHitComponent()
returns default hit component (fallback)
bool m_BrokenLegsJunctureReceived
override void CommandHandler(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
override WeaponManager GetWeaponManager()
ModifiersManager GetModifiersManager()
float GetStatLevelBorders(float stat_value, float critical, float low, float normal, float high, float max)
void RequestUnconsciousness(bool enable)
UndergroundHandlerClient GetUndergroundHandler()
string m_CachedPlayerName
override void EEItemDetached(EntityAI item, string slot_name)
void RemoveAction(typename actionName, out TInputActionMap InputActionMap)
bool ResetADSPlayerSync(int userDataType, ParamsReadContext ctx)
server only
void SetHairLevelToHide(int level, bool state, bool was_debug=false)
Dynamic hair hiding.
void SpawnDrowningBubbles()
void IncreaseHealingsCount()
void SetActionsRemoteTarget(out TInputActionMap InputActionMap)
override bool CanChangeStance(int previousStance, int newStance)
override bool CanDropEntity(notnull EntityAI item)
ref SoundObject m_SaySoundObject
EffectTrigger m_CurrentEffectTrigger
ItemBase m_CheckMeleeItem
void HandleBrokenLegsSync()
void OnVoiceEventPlayback(PlayerSoundEventBase voice_event, AbstractWave callback, float playback_time)
called every cmd handler tick during a playback of PlayerSoundEvent, m_ProcessPlaybackEvent needs to ...
void TogglePlacingLocal(ItemBase item=null)
ref ShockDealtEffect m_ShockDealtEffect
void OnJumpOutVehicleFinish(float carSpeed)
float GetHeatBufferDynamicMax()
void SetUnderground(EUndergroundPresence presence)
void QueueRemoveGlassesEffect(int id)
bool m_IsRestrainStartedLocal
bool m_MapClosingSyncSent
bool m_CanPlayBrokenLegSound
override void OnStanceChange(int previousStance, int newStance)
void PlacingCancelLocal()
static ref array< CargoBase > SPREAD_AGENTS_PROXY_CARGOS
void SetInWater(bool pState)
water contact (driven by Environment)
void SetLastFirePointRot(float last_fire_point_rot)
void OnVoiceEvent(PlayerSoundEventBase voice_event)
void SetEnableQuickBarEntityShortcut(EntityAI entity, bool value)
EntityAI CreateInInventory(string item_name, string cargo_type="", bool full_quantity=false)
override bool IsWeaponObstructionBlockingADS()
ActionManagerBase GetActionManager()
bool IsItemInInventory(EntityAI entity)
void AddActiveNV(int type)
int m_RefreshAnimStateIdx
void SetLoadedQuickBarItemBind(EntityAI entity, int index)
void CheckSendSoundEvent()
int m_InventorySoftLockCount
void SetLifeSpanStateVisible(int show_state)
override void OnJumpStart()
void RemoveQuickBarEntityShortcut(EntityAI entity)
vector SetDefaultHitPosition(string pSelection)
override bool IsHoldingBreath()
void UpdateTranslatedSelections(SelectionTranslation stt)
ref DebugMonitorValues m_DebugMonitorValues
bool m_InventorySoftLocked
void MessageImportant(string text)
void SetHitPPEEnabled(bool enabled)
bool m_CanDisplayHitEffectPPE
ref Param3< float, float, bool > m_StaminaParam
Hologram GetHologramLocal()
override void OnGameplayDataHandlerSync()
void OnQuickBarContinuousUseStart(int slotClicked)
float GetHealthRegenSpeed()
override bool PredictiveTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
void RemovePossibleCoverFaceForShave()
DEPRECATED!
void SetBloodyHandsEx(eBloodyHandsTypes type)
void UnsetMixedSoundState(eMixedSoundStates state)
void SendLiftWeaponSync(bool state, float obstruct=0)
Client-side only.
void UpdateMaskBreathWidget(notnull MaskBase mask, bool is_start=false)
override void OnCommandMoveStart()
ref Hologram m_HologramLocal
int GetSingleAgentCount(int agent_id)
override bool PredictiveTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
ref array< string > m_DbgOptions
void QueueAddEffectWidget(array< int > effects)
void SetQuickFishing(bool enable)
override bool CanPickupHeavyItem(notnull EntityAI item)
PluginPresenceNotifier m_PresenceNotifier
void SetInColdArea(bool state)
void OnPlayerReceiveFlashbangHitEnd()
EmoteManager GetEmoteManager()
void RunFightBlendTimer()
void SetFlagTendencyRaise(bool state)
DEPRECATED.
float m_UnconsciousVignetteTarget
void CheckZeroSoundEvent()
ref EffectSound m_SoundFliesEffect
void HandleGlassesEffect()
void SendSoundEvent(EPlayerSoundEventID id)
float GetVisibilityCoef()
DayZPlayerCamera GetCurrentPlayerCamera()
EStatLevels GetStatLevelBlood()
override bool IsManagingArrows()
void OnPlayerIsNowInsideEffectAreaEndClient()
PlayerStat< float > m_StatTremor
EntityAI FindCargoByBaseType(string searched_item)
static set< int > GetFaceCoverageShaveValues()
returns a set of face covering values
vector m_DefaultHitPosition
override void OnCommandLadderFinish()
ref BleedingSourcesManagerServer m_BleedingManagerServer
override void JunctureDeleteItem(EntityAI item)
int GetBleedingSourceCount()
override void OnCommandMelee2Finish()
override void OnCommandSwimStart()
bool m_IsVehicleSeatDriver
void CloseInventoryMenu()
int m_BleedingSourceCount
override void OnVehicleSeatDriverEnter()
bool CheckMeleeItemDamage(ItemBase item)
int FindQuickBarEntityIndex(EntityAI entity)
void SetToDelete(ParamsReadContext pCtx)
void OnUpdateEffectAreaServer(float timeSlice)
EMedicalDrugsType m_MedicalDrugsActive
override bool PredictiveTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
bool IsStance(int stance, int stanceMask)
bool IsCurrentCameraAimedAtGround()
ref Timer m_UALastMessageTimer
override bool PredictiveTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
void OnVehicleSwitchSeat(int seatIndex)
ref InventoryActionHandler m_InventoryActionHandler
EStatLevels GetImmunityLevel()
ref TransferValues m_TrasferValues
EStatLevels GetStatLevelToxicity()
void ProcessHoldBreath(float dT)
void KillUndergroundHandler()
PlayerStat< float > GetStatTremor()
void AddAction(typename actionName)
void SpawnBreathVaporEffect()
ref Param1< float > m_DeathDarkeningParam
void SetMapClosingSyncSet(bool state)
void OnPlayerIsNowInsideEffectAreaBeginClient()
bool TogglePlacingServer(int userDataType, ParamsReadContext ctx)
override bool PredictiveTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
ref VirtualHud m_VirtualHud
ref Timer m_AnalyticsTimer
void UpdateCorpseStateVisual()
bool IsRestrainPrelocked()
void AdjustShemag(EntityAI item, string slot_name)
override bool IsAlreadyInFallingCommand(int pCurrentCommandID)
ref TInputActionMap m_InputActionMapControled
override void OnCommandClimbFinish()
ref HiddenSelectionsData m_EmptyGloves
NotifiersManager GetNotifiersManager()
void SetLastFirePoint(vector last_fire_point)
eBloodyHandsTypes HasBloodyHandsEx()
float m_LastPostFrameTickTime
float GetStatBordersToxicity()
void DecreaseDiseaseCount()
void SetActions(out TInputActionMap InputActionMap)
float m_HeatBufferDynamicMax
void SetActionsRemoteTarget()
bool GetLastMapInfo(out float scale, out vector pos)
void ProcessADDModifier()
void SetRestrained(bool is_restrained)
void SetLocalProjectionPosition(vector local_position)
ref ScriptInvoker m_OnUnconsciousStop
ref SoftSkillsManager m_SoftSkillsManager
override string GetHitComponentForAI()
Melee helpers.
override vector GetCenter()
float GetWeightSpecialized(bool forceRecalc=false)
override void EEItemAttached(EntityAI item, string slot_name)
bool CheckAndExecuteStackSplitToInventoryLocation(InventoryLocation il, notnull EntityAI item)
BleedingSourcesManagerRemote GetBleedingManagerRemote()
PlayerStat< float > GetStatHeatComfort()
ref ScriptInvoker m_OnUnconsciousStart
invokers
bool TakeEntityToTargetInventoryImpl(InventoryMode mode, notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
override void OnCommandSwimFinish()
override void OnCommandVehicleStart()
bool IsSyncedModifierActive(eModifierSyncIDs modifier)
Checks whether modifier (which has syncing enabled) is currently active, works on both Client and Ser...
FlashbangEffect GetFlashbangEffect()
override bool PhysicalPredictiveDropItem(EntityAI entity, bool heavy_item_only=true)
float m_UnconRefillModifier
ref ModifiersManager m_ModifiersManager
ref map< EEffectAreaType, int > m_EffectAreaOverlap
void CloseMap()
DEPRECATED; terminates map animation callback and re-enables controls.
ShockDealtEffect GetShockEffect()
void PlacingStartServer(ItemBase item)
ref array< EntityAI > m_ItemsToDelete
override void ProcessFeetDamageServer(int pUserInt)
override void InsertAgent(int agent, float count=1)
void SetQuickBarEntityShortcut(EntityAI entity, int index, bool force=false)
PlayerStat< float > m_StatToxicity
override void OnFreezeStateChangeClient()
bool m_PlayerDisconnectProcessed
bool GetDrowningWaterLevelCheck()
int m_AnimCommandStarting
bool m_IsRestrainPrelocked
int m_ForceInjuryAnimMask
ref EffectSound m_BrokenLegSound
void SetPlayerDisconnected(bool state)
PlayerStat< float > GetStatWater()
override void OnCommandVehicleFinish()
override bool PlaySoundEventType(ESoundEventType soundType, int soundEventID, int param=0)
PlayerStat< int > GetStatBloodType()
void SetLastUAMessage(string pMsg)
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void OnVehicleSeatDriverLeft()
void SetShakesForced(int value)
bool CanManipulateInventory()
float GetLastFirePointRot()
void SpawnDamageDealtEffect2(Param param1=null, Param param2=null)
int m_DebugMonitorEnabled
EntityAI GetQuickBarEntity(int index)
StaminaHandler GetStaminaHandler()
override bool CanReceiveItemIntoCargo(EntityAI item)
ref SoundObjectBuilder m_SaySoundBuilder
static ref array< Man > m_ServerPlayers
ref NotifiersManager m_NotifiersManager
override bool PlaySoundEvent(EPlayerSoundEventID id, bool from_anim_system=false, bool is_from_server=false)
override void EOnPostFrame(IEntity other, int extra)
ref StanceIndicator m_StanceIndicator
float ConvertNonlethalDamage(float damage, DamageType damageType)
ItemBase GetItemInHands()
void OnUnconsciousStop(int pCurrentCommandID)
EntityAI SpawnEntityOnGroundRaycastDispersed(string object_name, float raycastDistance=DEFAULT_SPAWN_DISTANCE, float radius=UAItemsSpreadRadius.DEFAULT)
int GetLastFirePointIndex()
void SetCheckMeleeItem(ItemBase item=null)
static bool DEBUG_INVENTORY_ACCESS
void SetDecayEffects(int effect=-1)
PluginAdminLog m_AdminLog
bool CanRedirectToWeaponManager(notnull EntityAI item, out bool isActionPossible)
bool HasCoveredFaceForShave()
ref array< ref Param2< EntityAI, int > > m_aQuickBarLoad
void DealShock(float dmg)
void SetPulseType(EPulseType pulse_type)
void SetDrowning(bool enable)
void SetRestrainPrelocked(bool restrain_prelock)
PlayerStats GetPlayerStats()
void OnCameraChanged(DayZPlayerCameraBase new_camera)
override void OnCommandFallStart()
ref SoundParams m_SaySoundParams
PlayerSoundEventHandler GetPlayerSoundEventHandler()
EntityAI GetMagazineToReload(EntityAI weapon)
void QueueAddGlassesEffect(int id)
override bool IsInventoryVisible()
void CalculateVisibilityForAI()
RandomGeneratorSyncManager GetRandomGeneratorSyncManager()
void OnScheduledTick(float deltaTime)
void AddAction(typename actionName, out TInputActionMap InputActionMap)
void SetLastFirePointIndex(int last_fire_point_index)
PluginRecipesManager m_ModuleRecipesManager
vector m_CraftingInitialPos
PlayerStat< int > GetStatWet()
override void HideClothing(ItemOptics optic, bool state)
state 'true' == hide
vector GetLocalProjectionPosition()
ItemBase CreateCopyOfItemInInventoryOrGround(ItemBase src)
ref array< int > m_ActiveNVTypes
Head_Default m_CharactersHead
override bool HeadingModel(float pDt, SDayZPlayerHeadingModel pModel)
EStatLevels GetStatLevelWater()
void ToggleHeatBufferVisibility(int heatbufferStage)
void OnRestrainChangeClient()
PlayerStat< float > GetStatStamina()
void OnQuickBarContinuousUseEnd(int slotClicked)
bool DropItem(ItemBase item)
void ProcessHandDamage(float delta_time, HumanMovementState pState)
float GetStatBordersHealth()
float GetTotalAgentCount()
override bool IsInventorySoftLocked()
void PlacingStartLocal(ItemBase item)
const string SOUND_BREAK_LEG
void ForceUpdateInjuredState()
update injured state immediately
void OnPlayerIsNowInsideEffectAreaBeginServer()
bool IsPlayerDisconnected()
ref WeaponManager m_WeaponManager
bool GetFlagTendencyRaise()
DEPRECATED.
void SetTemporaryResistanceToAgent(int agent, float time)
void OnQuickBarSingleUse(int slotClicked)
void MovingShock(float legHealth, float highShock, float midShock, float lowShock)
void BrokenLegWalkShock()
void OnBleedingSourceRemoved()
void OnInventoryMenuOpen()
ref StaminaHandler m_StaminaHandler
override void OnCommandMelee2Start()
ref DamageDealtEffect m_DamageDealtEffect
override void ClearInventory()
PlayerStat< float > m_StatWater
override void DepleteStaminaEx(EStaminaModifiers modifier, float dT=-1, float coef=1.0)
bool m_ContaminatedAreaEffectEnabled
override void RPC(int rpc_type, array< ref Param > params, bool guaranteed, PlayerIdentity recipient=NULL)
void ResetConstructionActionData()
ref ConstructionActionData m_ConstructionActionData
MapNavigationBehaviour GetMapNavigationBehaviour()
ItemBase CreateCopyOfItemInInventory(ItemBase src)
RandomGeneratorSyncManager m_RGSManager
override bool IsIgnoredByConstruction()
static Particle m_ContaminatedAroundPlayer
ref Timer m_DeathCheckTimer
ref Param1< float > m_UnconParam
override void OnSyncJuncture(int pJunctureID, ParamsReadContext pCtx)
static ref array< Object > SPREAD_AGENTS_OBJECTS
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
array< int > GetNVTypesArray()
string m_SaySoundLastSetName
ConstructionActionData GetConstructionActionData()
float m_CameraSwayModifier
EntityAI SpawnEntityOnGroundOnCursorDir(string object_name, float distance)
override void TakeEntityToHandsImpl(InventoryMode mode, EntityAI item)
static ref TStringArray m_QBarItems
override bool OnLand(int pCurrentCommandID, FallDamageData fallDamageData)
ref HeatComfortAnimHandler m_HCAnimHandler
override void RemoveAllAgents()
int GetLastShavedSeconds()
void SpreadAgentsEx(float distance=3, float chance=0.25)
chance between [0..1] , distance in meters
void SetLiftWeapon(int pJunctureID, ParamsReadContext ctx)
bool HandleRemoteItemManipulation(int userDataType, ParamsReadContext ctx)
void DamageAllLegs(float inputDmg)
void RequestResetADSSync()
void RemoveActiveNV(int type)
bool GetMapClosingSyncSent()
void BrokenLegForceProne(bool forceOverride=false)
void UpdateQuickBarExtraSlots()
override bool CanBeTargetedByAI(EntityAI ai)
override bool CanPlaceItem(EntityAI item)
void DropAllItems()
Drops all clothes/wearables this character is carrying on themselves.
ref UndergroundBunkerHandlerClient m_UndergroundBunkerHandler
override bool PlaySoundEventEx(EPlayerSoundEventID id, bool from_anim_system=false, bool is_from_server=false, int param=0)
void SpawnFlashbangEffect(PlayerBase player, bool visual)
void HideHairSelections(ItemBase item, bool state)
ref FlashbangEffect m_FlashbangEffect
override void CheckAnimationOverrides()
void SetVisibilityCoef(float pVisibility)
EStatLevels GetStatLevelHealth()
float GetStatBordersBlood()
bool TakeEntityAsAttachmentImpl(InventoryMode mode, notnull EntityAI item)
override void OnParticleEvent(string pEventType, string pUserString, int pUserInt)
void OnContaminatedAreaExitServer()
void PlacingCompleteLocal()
EUndergroundPresence m_UndergroundPresence
override bool IsSelfAdjustingTemperature()
override void SetInventorySoftLock(bool status)
'soft lock' meaning inventory screen cannot be displayed, but mechanically, inventory operations are ...
bool TakeEntityToTargetCargoImpl(InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
AbstractWave SaySoundSet(string name)
void PlacingCompleteServer()
override bool IsInFBEmoteState()
void SetRestrainStarted(bool restrain_started)
QuickBarBase m_QuickBarBase
void ProcessDrowning(float dT)
override void OnRollStart(bool isToTheRight)
eBrokenLegs GetBrokenLegs()
void ShockRefill(float pDt)
functionality moved to ShockMdfr::OnTick
void TryHideItemInHands(bool hide, bool force=false)
tries to hide item in player's hands, some exceptions for various movement states
ref Param1< string > m_UAParamMessage
bool TakeEntityToCargoImpl(InventoryMode mode, notnull EntityAI item)
override void CheckLiftWeapon()
void SetQuickRestrain(bool enable)
void AddPlayerLoad(float addedload)
void RequestHandAnimationStateRefresh()
ActionManagerBase m_ActionManager
override void OnJumpEnd(int pLandType=0)
override void OnCommandFallFinish()
ref ShockHandler m_ShockHandler
int m_LocalRefreshAnimStateIdx
bool IsMapCallbackEndInput()
float GetFeetDamageMoveModifier()
vector m_LocalProjectionPosition
void OnHoldBreathExhausted()
ref TInputActionMap m_InputActionMapAsTarget
override bool PredictiveForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
PlayerStat< float > GetStatHeatBuffer()
void SetBleedingBits(int bits)
void ContaminatedParticleAdjustment()
void LockHandsUntilItemHeld()
void ResetActionEndInput()
void SetLiquidTendencyDrain(bool state)
void UpdateMovementInertia()
Update movement inertia based on stamina available.
bool m_IsHeadingRestricted
override bool CanReceiveItemIntoHands(EntityAI item_to_hands)
override bool CanConsumeStamina(EStaminaConsumers consumer)
ref InjuryAnimationHandler m_InjuryHandler
void OnContaminatedAreaEnterServer()
void ToggleHeatBufferVisibility(bool show)
void SetLastShavedSeconds(int last_shaved_seconds)
override void AddItemToDelete(EntityAI item)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override bool CanClimb(int climbType, SHumanCommandClimbResult climbRes)
ref PlayerSoundManagerClient m_PlayerSoundManagerClient
ref HeadingRestrictData m_HeadingRestrictData
override void EEHitByRemote(int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos)
ref EmoteManager m_EmoteManager
void SetContaminatedEffect(bool enable, int ppeIdx=-1, int aroundId=ParticleList.CONTAMINATED_AREA_GAS_AROUND, int tinyId=ParticleList.CONTAMINATED_AREA_GAS_TINY, bool partDynaUpdate=false, int newBirthRate=0)
void OnRestrainStartedChangeClient()
override ArrowManagerBase GetArrowManager()
const string CONTAMINATED_AREA_AMBIENT
void GiveShock(float shock)
override void SetProcessUIWarning(bool state)
bool TakeToDstImpl(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
void SetBrokenLegs(int stateId)
override void SimulateDeath(bool state)
void CheckHairClippingOnCharacterLoad()
helper method for re-checking hairhiding on character load
void SetContaminatedEffectEx(bool enable, int ppeIdx=-1, int aroundId=ParticleList.CONTAMINATED_AREA_GAS_AROUND, int tinyId=ParticleList.CONTAMINATED_AREA_GAS_TINY, string soundset="", bool partDynaUpdate=false, int newBirthRate=0)
override void EEDelete(EntityAI parent)
bool IsFacingTarget(Object target)
override void SetDeathDarknessLevel(float duration, float tick_time)
void StaminaHUDNotifier(bool show)
vector GetLastFirePoint()
static ref array< string > m_BleedingSourcesUp
Hologram GetHologramServer()
override void AddArrow(Object arrow, int componentIndex, vector closeBonePosWS, vector closeBoneRotWS)
void RemoveAction(typename actionName)
override bool CanReleaseCargo(EntityAI cargo)
EStatLevels GetStatLevel(float stat_value, float critical, float low, float normal, float high)
void MessageStatus(string text)
void PlayAttachmentDropSound()
PlayerStat< float > GetStatDiet()
Static component of PPE manager, used to hold the instance.
void Start(Param par=null)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Legacy way of using particles in the game.
Keeps track of agents and their simulation.
The class that will be instanced (moddable).
void OnVariableSynchronized()
Manager class for managing Effect (EffectParticle, EffectSound).
static int PlayInWorld(notnull Effect eff, vector pos)
Play an Effect.
static int PlayOnObject(notnull Effect eff, Object obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_relative_to_world=false)
Play an Effect.
static EffectSound PlaySoundOnObject(string sound_set, Object parent_object, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
static bool IsEffectExist(int effect_id)
Checks whether an Effect ID is registered in SEffectManager.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
ScriptInvoker Class provide list of callbacks usage:
Native class for boats - handles physics simulation.
static void ApplyEffects(PlayerBase player)
bool CanLoadBullet(Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
bool CanAttachMagazine(Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
bool CanSwapMagazine(Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
float GetLiquidTypeEnviroTemperature(int liquidType)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DamageType
exposed from C++ (do not change)
proto native int GetBoneIndexByName(string pBoneName)
returns bone index for a name (-1 if pBoneName doesn't exist)
override string GetDebugName()
DayZPlayerInstanceType
defined in C++
proto native DayZPlayerType GetDayZPlayerType()
returns appropriate DayZPlayerType
proto native DayZPlayerCamera GetCurrentCamera()
-------------— camera additional functions ----------------------—
proto native DayZPlayerInstanceType GetInstanceType()
DayZPlayerConstants
defined in C++
proto native void SendSyncJuncture(int pJunctureID, ParamsWriteContext ctx)
-------------— sync stuff ----------------------—
float GetCurrentWaterLevel()
proto native bool IsPlayerInStance(int pStanceMask)
-------------— camera additiona functions ----------------------—
string GetDefaultHitPositionComponent()
class DayZPlayerCameraResult DayZPlayerCamera(DayZPlayer pPlayer, HumanInputController pInput)
ref HumanMovementState m_MovementState
movement state
void DayZPlayerCameraOptics(DayZPlayer pPlayer, HumanInputController pInput)
override bool OnInventoryCheck(int userDataType, ParamsReadContext ctx)
ref DayZPlayerImplementMeleeCombat m_MeleeCombat
DisplayElementBase GetElement(eDisplayElements element_id)
void VirtualHud(PlayerBase player)
void EmoteManager(PlayerBase player)
PluginAdminLog m_AdminLog
bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
void AddToEnvironmentTemperature(float pTemperature)
bool IsProcessing()
returns true when FP is heating or cooling
proto native float GetMax()
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
Serializer ParamsWriteContext
proto GizmoApi GetGizmoApi()
class GP5GasMask extends MaskBase ItemBase
const int AGT_UACTION_CONSUME
const int AGT_AIRBOURNE_BIOLOGICAL
void Error(string err)
Messagebox with error message.
proto void Print(void var)
Prints content of variable to console/log.
proto native void SetPosition(vector position)
Set the world position of the Effect.
array< string > TStringArray
class array< Class T > PrintString
void Obsolete(string msg="")
EntityEvent
Entity events for event-mask, or throwing event from code.
const int SAT_DEBUG_ACTION
SetSoundControllerOverride(string controllerName, float value, SoundControllerAction action)
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
vector GetPosition()
Get the world position of the Effect.
class SoundObject SoundParams(string name)
proto void GetHourMinuteSecond(out int hour, out int minute, out int second)
Returns system time.
proto native bool IsCLIParam(string param)
Returns if command line argument is present.
proto native Hive GetHive()
class HumanItemBehaviorCfg OnItemInHandsChanged(bool pInstant=false)
signalization from script to engine that item in hands changed
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
override void InsertAgent(int agent, float count=1)
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
void MapNavigationBehaviour(PlayerBase pPlayer, EMapNavigationType pNavigationType=EMapNavigationType.BASIC)
void OnReconnect(PlayerBase player)
is called when a modifier is being re-activated upon player server connection, use to activate system...
void OnStoreSave(ParamsWriteContext ctx)
PluginPlayerStatus m_ModulePlayerStatus
max 32 synced modifiers supported, 0 == no sync
bool OnStoreLoad(ParamsReadContext ctx, int version)
void ModifiersManager(PlayerBase player)
ref VirtualHud m_VirtualHud
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor).
void PlayerSoundEventHandler(PlayerBase player)
void PlayerSoundManagerClient(PlayerBase player)
void PlayerStat(T min, T max, T init, string label, int flags)
bool LoadStats(ParamsReadContext ctx, int version)
void PlayerStats(Man player)
enum EPSstatsFlags m_PlayerStats
void PlayerStomach(PlayerBase player)
PluginConfigDebugProfile m_ConfigDebugProfile
void PluginItemDiagnostic()
ref map< PlayerBase, int > m_BloodType
PluginManager GetPluginManager()
Returns registred plugin by class type, better is to use global funtion GetPlugin(typename plugin_typ...
PluginBase GetPlugin(typename plugin_type)
void PluginPresenceNotifier()
EPresenceNotifierNoiseEventType
void QuickBarBase(PlayerBase player)
void RandomGeneratorSyncManager(DayZPlayer player)
const float DEFAULT_SPAWN_DISTANCE
void ReplaceSoundEventHandler(PlayerBase player)
StaminaHandler m_StaminaHandler
void UndergroundHandlerClient(PlayerBase player)