3 const int SIMPLIFIED_SHOCK_CAP = 63;
4 const int SHAKE_LEVEL_MAX = 7;
5 private int m_LifeSpanState;
6 private int m_LastShavedSeconds;
8 private bool m_HasBloodTypeVisible;
9 private bool m_LiquidTendencyDrain;
10 private bool m_FlagRaisingTendency;
11 private int m_HasBloodyHandsVisible;
23 private int m_StoreLoadVersion;
24 const int ACT_STORE_SAVE_VERSION = 4;
30 PluginConfigEmotesProfile m_ConfigEmotesProfile;
57 const int OVERLOAD_LIMIT = 30000;
92 bool m_QuickBarFT =
false;
118 float m_UnconsciousVignetteTarget = 2;
119 float m_CameraSwayModifier = 0.2;
136 float m_UnconsciousEndTime = 0;
149 const string SOUND_BREAK_LEG =
"broken_leg_SoundSet";
151 static bool DEBUG_INVENTORY_ACCESS =
false;
154 float m_UnconRefillModifier = 1;
160 const string CONTAMINATED_AREA_AMBIENT =
"ContaminatedArea_SoundSet";
178 #ifdef DIAG_DEVELOPER
179 int m_IsInsideTrigger;
180 bool m_CanBeTargetedDebug;
182 bool m_PresetSpawned;
183 ref CameraToolsMenuClient m_CameraToolsMenuClient;
184 protected PluginTargetTemperature m_TargetTemperatureDiag;
191 #ifdef DIAG_DEVELOPER
201 vector m_LocalProjectionPosition =
"0 0 0 ";
202 vector m_LocalProjectionOrientation =
"0 0 0 ";
206 int m_AddModifier = -1;
231 bool m_IsFighting =
false;
242 protected float m_LastMapScale = -1.0;
248 protected int m_InventorySoftLockCount = 0;
263 protected int m_PerformedAnimActionID = -1;
264 protected int m_ActivePrimarySymptomID = 0;
315 m_StoreLoadVersion = 0;
316 m_IsCraftingReady =
false;
318 m_LastShavedSeconds = 0;
320 m_HasBloodTypeVisible =
false;
322 m_LifespanLevelLocal = -1;
324 m_CorpseStateLocal = 0;
325 m_HasBloodyHandsVisible = 0;
326 m_PlayerLoaded =
false;
327 m_PlayerSelected =
false;
328 m_ProcessUIWarning =
false;
329 m_FlagRaisingTendency =
true;
330 m_LiquidTendencyDrain =
false;
331 m_UAParamMessage =
new Param1<string>(
"");
332 m_UnconParam =
new Param1<float>(0);
333 m_DeathDarkeningParam =
new Param1<float>(0);
339 m_VisibilityCoef = 1.0;
342 m_ActionQBControl =
false;
343 m_QuickBarHold =
false;
344 m_HideHairAnimated =
true;
345 m_WorkingNVGHeadset =
false;
346 m_LoweredNVGHeadset =
false;
347 m_AreHandsLocked =
false;
349 m_AnimCommandStarting = HumanMoveCommandID.None;
351 m_CanDisplayHitEffectPPE =
true;
352 m_HeadingRestrictData =
new HeadingRestrictData();
354 #ifdef DIAG_DEVELOPER
355 m_CanBeTargetedDebug =
true;
362 m_InjuryHandler =
new InjuryAnimationHandler(
this);
373 m_BleedingManagerServer =
new BleedingSourcesManagerServer(
this);
374 m_Environment =
new Environment(
this);
377 m_PlayerSoundManagerServer =
new PlayerSoundManagerServer(
this);
384 m_ModuleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
386 m_TrasferValues =
new TransferValues(
this);
394 if (!
GetGame().IsDedicatedServer())
396 m_MeleeDebug =
false;
397 m_UALastMessage =
"";
398 m_UALastMessageTimer =
new Timer;
400 m_BleedingManagerRemote =
new BleedingSourcesManagerRemote(
this);
407 m_ProcessRemoveEffectWidgets =
new array<int>;
410 m_ProcessRemoveGlassesEffects =
new array<int>;
413 m_ActionManager = NULL;
415 m_ConfigEmotesProfile = PluginConfigEmotesProfile.Cast(
GetPlugin(PluginConfigEmotesProfile));
419 PluginConfigDebugProfileFixed m_ConfigDebugProfileFixed = PluginConfigDebugProfileFixed.Cast(
GetPlugin(PluginConfigDebugProfileFixed));
421 PluginDeveloper m_Developer = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
428 if (player && default_preset !=
"")
431 m_ConfigDebugProfileFixed.GetPresetItems(default_preset, preset_array);
433 bool is_preset_fixed =
true;
434 if (preset_array.Count() == 0)
437 is_preset_fixed =
false;
440 if (preset_array.Count() > 0)
442 m_Developer.ClearInventory(player);
444 for (
int i = 0; i < preset_array.Count(); i++)
450 health = m_ConfigDebugProfileFixed.GetItemHealth(default_preset, i);
451 quantity = m_ConfigDebugProfileFixed.GetItemQuantity(default_preset, i);
458 m_Developer.SpawnEntityInPlayerInventory(player, preset_array.Get(i), health, quantity);
473 m_BleedingSourcesLow.Insert(
"RightToeBase");
474 m_BleedingSourcesLow.Insert(
"RightFoot");
475 m_BleedingSourcesLow.Insert(
"LeftToeBase");
476 m_BleedingSourcesLow.Insert(
"LeftFoot");
477 m_BleedingSourcesLow.Insert(
"RightUpLegRoll");
478 m_BleedingSourcesLow.Insert(
"RightUpLeg");
479 m_BleedingSourcesLow.Insert(
"RightLegRoll");
480 m_BleedingSourcesLow.Insert(
"RightLeg");
481 m_BleedingSourcesLow.Insert(
"LeftUpLegRoll");
482 m_BleedingSourcesLow.Insert(
"LeftUpLeg");
483 m_BleedingSourcesLow.Insert(
"LeftLegRoll");
484 m_BleedingSourcesLow.Insert(
"LeftLeg");
487 m_BleedingSourcesUp.Insert(
"RightForeArmRoll");
488 m_BleedingSourcesUp.Insert(
"LeftForeArmRoll");
489 m_BleedingSourcesUp.Insert(
"RightForeArm");
490 m_BleedingSourcesUp.Insert(
"RightArmRoll");
491 m_BleedingSourcesUp.Insert(
"RightArm");
492 m_BleedingSourcesUp.Insert(
"RightShoulder");
493 m_BleedingSourcesUp.Insert(
"LeftForeArm");
494 m_BleedingSourcesUp.Insert(
"LeftArmRoll");
495 m_BleedingSourcesUp.Insert(
"LeftArm");
496 m_BleedingSourcesUp.Insert(
"LeftShoulder");
497 m_BleedingSourcesUp.Insert(
"Spine3");
498 m_BleedingSourcesUp.Insert(
"Spine2");
499 m_BleedingSourcesUp.Insert(
"Spine1");
500 m_BleedingSourcesUp.Insert(
"Spine");
501 m_BleedingSourcesUp.Insert(
"Pelvis");
502 m_BleedingSourcesUp.Insert(
"Neck");
505 RegisterNetSyncVariableInt(
"m_LifeSpanState", LifeSpanState.BEARD_NONE, LifeSpanState.COUNT);
506 RegisterNetSyncVariableInt(
"m_BloodType", 0, 128);
507 RegisterNetSyncVariableInt(
"m_ShockSimplified",0, SIMPLIFIED_SHOCK_CAP);
509 RegisterNetSyncVariableInt(
"m_SoundEventParam", 0, ((EPlayerSoundEventParam.ENUM_COUNT - 1) * 2) - 1);
510 RegisterNetSyncVariableInt(
"m_StaminaState",0, eStaminaState.COUNT - 1);
511 RegisterNetSyncVariableInt(
"m_BleedingBits");
512 RegisterNetSyncVariableInt(
"m_Shakes", 0, SHAKE_LEVEL_MAX);
515 RegisterNetSyncVariableInt(
"m_MixedSoundStates", 0,
eMixedSoundStates.COUNT - 1);
517 RegisterNetSyncVariableInt(
"m_RefreshAnimStateIdx",0,3);
518 RegisterNetSyncVariableInt(
"m_BrokenLegState", -
eBrokenLegs.BROKEN_LEGS_SPLINT,
eBrokenLegs.BROKEN_LEGS_SPLINT);
519 RegisterNetSyncVariableInt(
"m_SyncedModifiers", 0, ((
eModifierSyncIDs.LAST_INDEX - 1) * 2) - 1);
520 RegisterNetSyncVariableInt(
"m_HasBloodyHandsVisible", 0,
eBloodyHandsTypes.LAST_INDEX - 1);
521 RegisterNetSyncVariableInt(
"m_ActionSoundCategoryHash");
522 RegisterNetSyncVariableInt(
"m_PerformedAnimActionID", -1, 2048);
523 RegisterNetSyncVariableInt(
"m_ActivePrimarySymptomID", 0, SymptomIDs.LAST_INDEX);
525 RegisterNetSyncVariableInt(
"m_HeatBufferStage", 0,
HeatBufferMdfr.NUMBER_OF_STAGES - 1);
526 RegisterNetSyncVariableFloat(
"m_HeatBufferDynamicMax", 0.0, 1.0, 2);
528 RegisterNetSyncVariableBool(
"m_IsUnconscious");
529 RegisterNetSyncVariableBool(
"m_IsRestrained");
530 RegisterNetSyncVariableBool(
"m_IsInWater");
531 RegisterNetSyncVariableBool(
"m_InsideEffectArea");
533 RegisterNetSyncVariableBool(
"m_HasBloodTypeVisible");
534 RegisterNetSyncVariableBool(
"m_IsRestrainStarted");
535 RegisterNetSyncVariableBool(
"m_IsRestrainPrelocked");
536 RegisterNetSyncVariableBool(
"m_HasHeatBuffer");
537 RegisterNetSyncVariableBool(
"m_IsInColdArea");
539 RegisterNetSyncVariableFloat(
"m_CurrentShock");
541 m_OriginalSlidePoseAngle = GetSlidePoseAngle();
546 m_DecayedTexture = ConfigGetString(
"decayedTexture");
556 if (!m_OnUnconsciousStart)
559 return m_OnUnconsciousStart;
564 if (!m_OnUnconsciousStop)
567 return m_OnUnconsciousStop;
572 if ((m_MedicalDrugsActive & drugType) != drugType)
573 m_MedicalDrugsActive = m_MedicalDrugsActive | drugType;
578 if ((m_MedicalDrugsActive & drugType) == drugType)
579 m_MedicalDrugsActive &= ~drugType;
582 bool IsChelationActive()
587 bool IsAntibioticsActive()
592 void SetSoundCategoryHash(
int hash)
594 m_ActionSoundCategoryHash = hash;
598 void SetPerformedActionID(
int id)
600 m_PerformedAnimActionID = id;
604 int GetPerformedActionID()
606 return m_PerformedAnimActionID;
609 void SetActivePrimarySymptomID(SymptomIDs
id)
611 m_ActivePrimarySymptomID = id;
615 SymptomIDs GetActivePrimarySymptomID()
617 return m_ActivePrimarySymptomID;
620 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)
624 if (!m_InsideEffectArea)
627 if (!m_CurrentEffectTrigger)
631 else if (trigger == m_CurrentEffectTrigger && forceUpdate)
636 else if (trigger.GetEffectsPriority() > m_CurrentEffectTrigger.GetEffectsPriority())
638 RemoveCurrentEffectTrigger();
649 m_CurrentEffectTrigger = trigger;
650 SetContaminatedEffectEx(
true, ppeIdx, aroundId, tinyId, soundset,partDynaUpdate, newBirthRate );
655 void RemoveCurrentEffectTrigger()
657 if (m_CurrentEffectTrigger)
664 SetContaminatedEffectEx(
false, m_CurrentEffectTrigger.m_PPERequester );
665 m_CurrentEffectTrigger = null;
669 void IncreaseContaminatedAreaCount()
671 if (m_ContaminatedAreaCount == 0)
672 OnContaminatedAreaEnterServer();
673 m_ContaminatedAreaCount++;
676 void DecreaseContaminatedAreaCount()
678 m_ContaminatedAreaCount--;
679 if (m_ContaminatedAreaCount <= 0)
681 m_ContaminatedAreaCount = 0;
682 OnContaminatedAreaExitServer();
685 void IncreaseEffectAreaCount()
687 if (m_EffectAreaCount == 0)
689 m_InsideEffectArea =
true;
691 OnPlayerIsNowInsideEffectAreaBeginServer();
696 void DecreaseEffectAreaCount()
699 if (m_EffectAreaCount <= 0)
701 m_EffectAreaCount = 0;
702 m_InsideEffectArea =
false;
704 OnPlayerIsNowInsideEffectAreaEndServer();
708 void SetInEffectAreaTypeFlag(EEffectAreaType flag)
710 int areaCount = m_EffectAreaOverlap.Get(flag);
713 m_EffectAreaOverlap.Set(flag, m_EffectAreaOverlap.Get(flag) + 1);
715 m_EffectAreaOverlap.Set(flag, 1);
717 m_InEffectAreaType |= flag;
720 void UnsetInEffectAreaTypeFlag(EEffectAreaType flag)
722 int areaCount = m_EffectAreaOverlap.Get(flag);
725 m_EffectAreaOverlap.Set(flag, m_EffectAreaOverlap.Get(flag) - 1);
728 m_EffectAreaOverlap.Set(flag, 0);
729 m_InEffectAreaType &= ~flag;
733 bool IsInEffectArea(EEffectAreaType area)
735 if (m_InEffectAreaType & area)
746 if (IsInEffectArea(EEffectAreaType.HOT_SPRING))
749 if (waterLevel > 0.5)
751 timeSpent = m_EffectAreaTimeToTick.Get(EEffectAreaType.HOT_SPRING);
752 timeSpent += timeSlice;
755 m_EffectAreaTimeToTick.Set(EEffectAreaType.HOT_SPRING, 0);
759 m_EffectAreaTimeToTick.Set(EEffectAreaType.HOT_SPRING, timeSpent);
763 if (IsInEffectArea(EEffectAreaType.VOLCANIC))
765 timeSpent = m_EffectAreaTimeToTick.Get(EEffectAreaType.VOLCANIC);
766 timeSpent += timeSlice;
769 m_EffectAreaTimeToTick.Set(EEffectAreaType.VOLCANIC, 0);
773 m_EffectAreaTimeToTick.Set(EEffectAreaType.VOLCANIC, timeSpent);
779 GetModifiersManager().ActivateModifier(
eModifiers.MDF_AREAEXPOSURE );
785 GetModifiersManager().DeactivateModifier(
eModifiers.MDF_AREAEXPOSURE );
806 RemoveCurrentEffectTrigger();
814 EntityAI item_EAI = this.GetInventory().FindAttachment(slot_id);
817 if (item_EAI && !item_IB)
819 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() +
"!";
830 return GetItemOnSlot(
"Headgear");
843 if (GetInventory().HasInventoryReservation(item, null))
850 if (GetHumanInventory().GetEntityInHands() == item)
863 return m_BreathVapour;
869 int bit_mask_remove = ~state;
873 if (new_states != m_MixedSoundStates)
875 m_MixedSoundStates = new_states;
885 if (new_states != m_MixedSoundStates)
887 m_MixedSoundStates = new_states;
899 return (m_BleedingBits != 0);
904 if (m_BleedingBits != bits)
906 if (m_BleedingBits == 0)
915 m_BleedingBits = bits;
921 return m_BleedingBits;
947 return m_HealingsCount;
952 return m_DiseaseCount;
963 m_PulseType = pulse_type;
968 m_ProcessAddEffectWidgets.InsertArray(effects);
973 m_ProcessRemoveEffectWidgets.InsertArray(effects);
978 m_ProcessAddGlassesEffects.Insert(
id);
983 m_ProcessRemoveGlassesEffects.Insert(
id);
988 return m_DamageDealtEffect;
993 if (m_DamageDealtEffect)
995 delete m_DamageDealtEffect;
998 if (m_CanDisplayHitEffectPPE)
1008 delete m_EffectRadial;
1016 return m_FlashbangEffect;
1021 if (m_FlashbangEffect)
1023 m_FlashbangEffect.Stop();
1024 delete m_FlashbangEffect;
1032 return m_ShockDealtEffect;
1037 if (m_ShockDealtEffect)
1039 delete m_ShockDealtEffect;
1054 if (GetBleedingManagerServer())
1055 delete GetBleedingManagerServer();
1060 GetHive().CharacterKill(
this);
1064 GetGame().EnableVoN(
this,
false);
1065 if (!
GetGame().IsDedicatedServer())
1067 GetSymptomManager().OnPlayerKilled();
1069 if (GetEconomyProfile() && !m_CorpseProcessing && m_CorpseState == 0 &&
GetGame().GetMission().InsertCorpse(
this))
1071 m_CorpseProcessing =
true;
1079 GetGame().GetMission().SyncRespawnModeInfo(GetIdentity());
1083 super.EEKilled(killer);
1088 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
1095 if (damageResult != null && damageResult.GetDamage(dmgZone,
"Shock") > 0)
1099 if (!IsUnconscious())
1101 if (
GetGame().ConfigIsExisting(
"cfgAmmo " + ammo +
" unconRefillModifier"))
1103 m_UnconRefillModifier =
GetGame().ConfigGetInt(
"cfgAmmo " + ammo +
" unconRefillModifier");
1107 m_UnconRefillModifier = 1;
1113 if (damageType ==
DamageType.EXPLOSION && ammo ==
"FlashGrenade_Ammo")
1120 if (damageResult != null && GetBleedingManagerServer())
1122 float dmg = damageResult.GetDamage(dmgZone,
"Blood");
1123 GetBleedingManagerServer().ProcessHit(dmg, source,
component, dmgZone, ammo, modelPos);
1127 #ifdef DIAG_DEVELOPER
1129 Print(
"EEHitBy() | " + GetDisplayName() +
" hit by " + source.GetDisplayName() +
" to " + dmgZone);
1131 PluginRemotePlayerDebugServer plugin_remote_server = PluginRemotePlayerDebugServer.Cast(
GetPlugin(PluginRemotePlayerDebugServer));
1132 if (plugin_remote_server)
1134 plugin_remote_server.OnDamageEvent(
this, damageResult);
1138 if (
GetGame().IsDebugMonitor())
1139 m_DebugMonitorValues.SetLastDamage(source.GetDisplayName());
1141 if (m_ActionManager)
1142 m_ActionManager.Interrupt();
1144 int transferShockToDamageCoef =
g_Game.ConfigGetInt(
string.Format(
"%1 %2 DamageApplied transferShockToDamage",
CFG_AMMO, ammo));
1145 if (transferShockToDamageCoef == 1)
1148 AddHealth(
"",
"Health", -ConvertNonlethalDamage(damageResult.GetDamage(dmgZone,
"Shock"), damageType));
1149 if (dmgZone !=
"Head")
1150 AddHealth(dmgZone,
"Health", -damageResult.GetDamage(dmgZone,
"Shock"));
1155 if (GetHealth(
"RightLeg",
"Health") <= 1 || GetHealth(
"LeftLeg",
"Health") <= 1 || GetHealth(
"RightFoot",
"Health") <= 1 || GetHealth(
"LeftFoot",
"Health") <= 1)
1157 if (GetModifiersManager().IsModifierActive(
eModifiers.MDF_BROKEN_LEGS))
1159 GetModifiersManager().DeactivateModifier(
eModifiers.MDF_BROKEN_LEGS);
1161 GetModifiersManager().ActivateModifier(
eModifiers.MDF_BROKEN_LEGS);
1164 if (ammo ==
"Bullet_CupidsBolt" && IsAlive())
1166 DamageSystem.ResetAllZones(
this);
1167 m_ModifiersManager.ResetAll();
1168 m_ModifiersManager.ActivateModifier(
eModifiers.MDF_IMMUNITYBOOST);
1171 if (m_BleedingManagerServer)
1172 m_BleedingManagerServer.RemoveAllSources();
1175 if (GetPlayerStats())
1177 int bloodType = GetStatBloodType().Get();
1178 float energyValue = GetStatEnergy().Get();
1179 float waterValue = GetStatWater().Get();
1180 float heatBuffer = GetStatHeatBuffer().Get();
1181 float heatComfort = GetStatHeatComfort().Get();
1183 GetPlayerStats().ResetAllStats();
1185 GetStatBloodType().Set(bloodType);
1186 GetStatWater().Set(waterValue);
1187 GetStatEnergy().Set(energyValue);
1188 GetStatHeatBuffer().Set(heatBuffer);
1189 GetStatHeatComfort().Set(heatComfort);
1194 m_AgentPool.RemoveAllAgents();
1200 if (IsUnconscious())
1205 m_ShockHandler.CheckValue(
true);
1213 super.EEHitByRemote(damageType, source,
component, dmgZone, ammo, modelPos);
1215 if (m_MeleeFightLogic.IsInBlock())
1225 StopSoundSet(m_SoundFliesEffect);
1234 return damage *
GameConstants.NL_DAMAGE_FIREARM_CONVERSION_PLAYERS;
1236 return super.ConvertNonlethalDamage(damage, damageType);
1246 float shakeStrength =
Math.InverseLerp(0, 500, hitData.m_InSpeed.Length());
1248 OnPlayerRecievedHit();
1251 if (hitData.m_AmmoType ==
"Bullet_CupidsBolt")
1252 Ammo_CupidsBolt.PlayOnHitParticle(hitData.m_Position);
1259 if (m_MeleeFightLogic.IsInBlock())
1266 SpawnDamageDealtEffect();
1277 SpawnFlashbangEffect(
this, visual);
1300 return m_DefaultHitPosition;
1311 return GetSelectionPositionMS(pSelection);
1318 m_FaceCoveredForShaveLayers++;
1323 m_FaceCoveredForShaveLayers--;
1328 super.EEItemAttached(item, slot_name);
1331 SwitchItemSelectionTexture(item, slot_name);
1332 Param1<PlayerBase> p =
new Param1<PlayerBase>(
this);
1333 item.SwitchItemSelectionTextureEx(EItemManipulationContext.ATTACHING, p);
1334 m_QuickBarBase.updateSlotsCount();
1335 CalculateVisibilityForAI();
1336 UpdateShoulderProxyVisibility(item, slot_name);
1338 HideHairSelections(itemIB,
true);
1344 if (!
GetGame().IsDedicatedServer())
1346 if (clothing.GetEffectWidgetTypes())
1348 QueueAddEffectWidget(clothing.GetEffectWidgetTypes());
1351 if (clothing.GetGlassesEffectID() > -1)
1353 QueueAddGlassesEffect(clothing.GetGlassesEffectID());
1357 UpdateCorpseStateVisual();
1359 else if (
GetGame().IsServer())
1361 if (clothing.IsGasMask())
1363 GetModifiersManager().ActivateModifier(
eModifiers.MDF_MASK);
1367 clothing.UpdateNVGStatus(
this,
true);
1370 AdjustBandana(item,slot_name);
1371 AdjustShemag(item,slot_name);
1376 super.EEItemDetached(item, slot_name);
1378 SwitchItemSelectionTexture(item, slot_name);
1379 item.SwitchItemSelectionTextureEx(EItemManipulationContext.DETACHING);
1380 m_QuickBarBase.updateSlotsCount();
1381 CalculateVisibilityForAI();
1383 HideHairSelections(item_base,
false);
1389 if (!
GetGame().IsDedicatedServer())
1391 if (clothing.GetEffectWidgetTypes())
1393 QueueRemoveEffectWidget(clothing.GetEffectWidgetTypes());
1396 if (clothing.GetGlassesEffectID() > -1)
1398 QueueRemoveGlassesEffect(clothing.GetGlassesEffectID());
1404 if (clothing.IsGasMask())
1406 GetModifiersManager().DeactivateModifier(
eModifiers.MDF_MASK);
1410 clothing.UpdateNVGStatus(
this,
false,
true);
1412 UpdateCorpseStateVisual();
1418 string slot = slot_name;
1420 boo = item.IsWeapon();
1422 if (slot ==
"Melee")
1424 SetSimpleHiddenSelectionState(SIMPLE_SELECTION_MELEE_RIFLE,boo);
1425 SetSimpleHiddenSelectionState(SIMPLE_SELECTION_MELEE_MELEE,!boo);
1427 else if (slot ==
"Shoulder")
1429 SetSimpleHiddenSelectionState(SIMPLE_SELECTION_SHOULDER_RIFLE,boo);
1430 SetSimpleHiddenSelectionState(SIMPLE_SELECTION_SHOULDER_MELEE,!boo);
1436 super.SwitchItemSelectionTexture(item,slot_name);
1439 EntityAI armband = FindAttachmentBySlotName(
"Armband");
1440 if (slot_name ==
"Body" && armband)
1442 Param1<PlayerBase> p =
new Param1<PlayerBase>(
this);
1443 armband.SwitchItemSelectionTextureEx(EItemManipulationContext.UPDATE,p);
1453 for (
int i = 0; i < itemsArray.Count(); i++)
1455 Class.CastTo(item, itemsArray.Get(i));
1456 if (item && !item.IsInherited(SurvivorBase)) GetInventory().LocalDestroyEntity(item);
1462 return m_CanDisplayHitEffectPPE;
1467 m_CanDisplayHitEffectPPE = enabled;
1472 if (ConfigGetBool(
"woman") != 1)
1481 int voice_type = ConfigGetInt(
"voiceType");
1483 if (voice_type == 0)
1493 return m_PlayerSoundManagerServer;
1499 if (!m_UndergroundHandler && IsAlive())
1504 return m_UndergroundHandler;
1509 if (!m_UndergroundBunkerHandler && IsAlive())
1514 return m_UndergroundBunkerHandler;
1519 m_UndergroundHandler = null;
1520 m_UndergroundBunkerHandler = null;
1542 AddAction(ActionDrinkPondContinuous, InputActionMap);
1579 if (IsControlledPlayer())
1587 SetActionsRemoteTarget();
1595 SetActionsRemoteTarget(m_InputActionMapAsTarget);
1610 if (IsControlledPlayer())
1611 actions = m_InputActionMapControled.Get(action_input_type);
1613 actions = m_InputActionMapAsTarget.Get(action_input_type);
1620 if (IsControlledPlayer())
1621 actions.InsertAll(m_InputActionMapControled.Get(action_input_type));
1623 actions.InsertAll(m_InputActionMapAsTarget.Get(action_input_type));
1625 actions.InsertAll(bcActions);
1645 InputActionMap.Insert(ai, action_array);
1647 action_array.Insert(action);
1663 for (
int i = 0; i < action_array.Count(); i++)
1665 if (action == action_array.Get(i))
1667 action_array.Remove(i);
1671 InputActionMap.Insert(ai, action_array);
1673 action_array.Insert(action);
1683 return m_RecipePick;
1701 return m_ActionManager;
1706 return m_EmoteManager;
1711 return m_RGSManager;
1715 override void OnLadder(
float delta_time, HumanMovementState pState)
1717 ProcessHandDamage(delta_time, pState);
1729 if (gloves && gloves.GetHealthLevel() < 4)
1731 gloves.AddHealth(
"",
"",
PlayerConstants.GLOVES_DAMAGE_SLIDING_LADDER_PER_SEC * delta_time);
1735 if (
Math.RandomFloat01() <
PlayerConstants.CHANCE_TO_BLEED_SLIDING_LADDER_PER_SEC * delta_time)
1737 if (
Math.RandomFloat01() < 0.5)
1739 if (GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll"))
1746 if (GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightForeArmRoll"))
1762 string surface;
int liquid;
1764 float modifier_surface =
Surface.GetParamFloat(surface,
"footDamage");
1766 if (shoes && shoes.GetHealthLevel() < 4)
1773 float rnd =
Math.RandomFloat01();
1774 float modifier_movement = GetFeetDamageMoveModifier();
1778 if (pUserInt % 2 == 0)
1780 if (GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"RightFoot"))
1786 if (GetBleedingManagerServer().AttemptAddBleedingSourceBySelection(
"LeftFoot"))
1816 #ifdef DIAG_DEVELOPER
1817 void SetStaminaDisabled(
bool value)
1826 m_AllowQuickRestrain = enable;
1831 m_AllowQuickFishing = enable;
1836 return m_AllowQuickRestrain;
1841 return m_AllowQuickFishing;
1851 return m_CraftingManager;
1861 return m_WeaponManager;
1871 if (IsInVehicle() || IsRaised() || IsSwimming() || IsClimbing() || IsClimbingLadder() || IsRestrained() || !GetWeaponManager() || GetWeaponManager().
IsRunning() || !
GetActionManager() ||
GetActionManager().GetRunningAction() != null || IsMapOpen())
1875 if (GetThrowing() && GetThrowing().IsThrowingModeEnabled())
1884 m_IsRestrainStarted = restrain_started;
1890 return m_IsRestrainStarted;
1895 m_IsRestrainPrelocked = restrain_prelock;
1901 return m_IsRestrainPrelocked;
1906 m_IsRestrained = is_restrained;
1912 return m_IsRestrained;
1917 if (m_IsRestrainStarted && IsControlledPlayer())
1922 GetGame().GetMission().HideInventory();
1928 if (m_IsRestrained && IsControlledPlayer())
1933 GetGame().GetMission().HideInventory();
1944 if (IsControlledPlayer())
1946 return !IsRestrained() && !IsRestrainPrelocked() && !IsRestrainStarted();
1953 return super.CanReleaseAttachment(attachment);
1958 return super.CanReleaseCargo(cargo);
1963 return super.CanReceiveItemIntoCargo(item);
1968 return super.CanSwapItemInCargo(child_entity, new_entity);
1976 if (!CanPickupHeavyItem(item_to_hands))
1979 return super.CanReceiveItemIntoHands(item_to_hands);
1987 return GetCraftingManager().GetRecipeID();
1999 GetCraftingManager().SetRecipeID(recipeID);
2012 return m_ConstructionActionData;
2017 if (m_ConstructionActionData)
2019 m_ConstructionActionData.ResetActionIndexes();
2028 return m_LastFirePoint;
2032 return m_LastFirePointRot;
2036 return m_LastFirePointIndex;
2041 m_LastFirePoint = last_fire_point;
2045 m_LastFirePointRot = last_fire_point_rot;
2049 m_LastFirePointIndex = last_fire_point_index;
2058 int index = m_QuickBarBase.FindEntityIndex(entity);
2060 m_QuickBarBase.SetEntityShortcut(entity,-1);
2065 int index = m_QuickBarBase.FindEntityIndex(entity);
2067 m_QuickBarBase.SetShotcutEnable(index,value);
2074 index = m_QuickBarBase.FindEntityIndex(entity);
2076 if (m_QuickBarBase.GetEntity(index) == NULL)
2085 return m_QuickBarBase.GetSize();
2090 return m_QuickBarBase.GetEntity(index);
2095 int i = FindQuickBarEntityIndex(entity);
2097 m_QuickBarBase.UpdateShotcutVisibility(i);
2102 m_QuickBarBase.SetEntityShortcut(entity, index, force);
2107 m_QuickBarBase.OnSetEntityRequest(ctx);
2114 float add_health_coef = 0.33;
2118 AddHealth(
"LeftLeg",
"Health", (GetMaxHealth(
"LeftLeg",
"Health") - GetHealth(
"LeftLeg",
"Health") ) * add_health_coef );
2119 AddHealth(
"RightLeg",
"Health", (GetMaxHealth(
"RightLeg",
"Health") - GetHealth(
"RightLeg",
"Health")) * add_health_coef );
2120 AddHealth(
"RightFoot",
"Health", (GetMaxHealth(
"RightFoot",
"Health") - GetHealth(
"RightFoot",
"Health")) * add_health_coef );
2121 AddHealth(
"LeftFoot",
"Health", (GetMaxHealth(
"LeftFoot",
"Health") - GetHealth(
"LeftFoot",
"Health")) * add_health_coef );
2131 PPERequester_Drowning req = PPERequester_Drowning.Cast(PPERequesterBank.GetRequester(PPERequesterBank.REQ_DROWNING));
2132 req.SetStamina01(GetStaminaHandler().GetStaminaNormalized());
2138 if (!GetDrowningWaterLevelCheck())
2140 float bubbleFrequency =
Math.Lerp(
PlayerConstants.DROWNING_BUBBLE_FREQUENCY_MIN,
PlayerConstants.DROWNING_BUBBLE_FREQUENCY_MAX, GetStaminaHandler().GetSyncedStaminaNormalized());
2147 AddChild(p, boneIdx);
2154 if (IsTryingHoldBreath() && CanStartConsumingStamina(
EStaminaConsumers.HOLD_BREATH))
2156 if (!m_IsHoldingBreath)
2158 OnHoldBreathStart();
2159 m_IsHoldingBreath =
true;
2162 else if (!IsTryingHoldBreath() || !CanConsumeStamina(
EStaminaConsumers.HOLD_BREATH))
2164 if (m_IsHoldingBreath) OnHoldBreathEnd();
2165 m_IsHoldingBreath =
false;
2172 RequestSoundEventEx(
EPlayerSoundEventID.HOLD_BREATH,
true, EPlayerSoundEventParam.SKIP_CONTROLLED_PLAYER);
2177 RequestSoundEventEx(
EPlayerSoundEventID.EXHAUSTED_BREATH,
true, EPlayerSoundEventParam.SKIP_CONTROLLED_PLAYER);
2183 RequestSoundEventEx(
EPlayerSoundEventID.RELEASE_BREATH,
true, EPlayerSoundEventParam.SKIP_CONTROLLED_PLAYER);
2188 return m_IsHoldingBreath;
2203 return m_MixedSoundStates;
2208 if (m_SaySoundLastSetName !=
name)
2213 m_SaySoundLastSetName =
name;
2216 m_SaySoundObject = m_SaySoundBuilder.BuildSoundObject();
2218 return GetGame().GetSoundScene().Play3D(m_SaySoundObject, m_SaySoundBuilder);
2225 int attcount = this.GetInventory().AttachmentCount();
2227 for (
int att = 0; att < attcount; att++)
2229 attachment = GetInventory().GetAttachmentFromIndex(att);
2230 if (attachment.IsItemBase())
2232 item_name = attachment.GetType();
2233 if (
GetGame().IsKindOf(item_name, searched_item))
2248 PluginSceneManager scene_editor = PluginSceneManager.Cast(
GetPlugin(PluginSceneManager));
2249 scene_editor.InitLoad();
2261 m_Environment.Init();
2265 if (m_ModuleLifespan)
2267 m_ModuleLifespan.SynchLifespanVisual(
this, m_LifeSpanState, m_HasBloodyHandsVisible, m_HasBloodTypeVisible,
m_BloodType);
2271 if (IsControlledPlayer())
2277 m_Hud.UpdateBloodName();
2279 GetGame().GetUIManager().CloseAll();
2280 GetGame().GetMission().SetPlayerRespawning(
false);
2281 GetGame().GetMission().OnPlayerRespawned(
this);
2283 m_Hud.ShowQuickbarUI(
true);
2284 m_Hud.UpdateQuickbarGlobalVisibility();
2285 m_Hud.InitHeatBufferUI(
this);
2286 m_Hud.OnPlayerLoaded();
2288 m_EffectWidgets =
GetGame().GetMission().GetEffectWidgets();
2290 if (!
GetGame().IsDedicatedServer())
2297 m_CharactersHead = Head_Default.Cast(GetInventory().FindPlaceholderForSlot(slotId));
2298 CheckHairClippingOnCharacterLoad();
2299 UpdateHairSelectionVisibility();
2300 PreloadDecayTexture();
2307 wpn.DelayedValidateAndRepair();
2311 wpn.ValidateAndRepair();
2315 m_PlayerLoaded =
true;
2320 m_PlayerDisconnectProcessed = state;
2325 return m_PlayerDisconnectProcessed;
2335 return m_HologramServer;
2340 return m_HologramLocal;
2347 m_HologramServer =
new Hologram(
this, GetLocalProjectionPosition(), item);
2348 GetHologramServer().SetProjectionPosition(GetLocalProjectionPosition());
2349 GetHologramServer().SetProjectionOrientation(GetLocalProjectionOrientation());
2350 GetHologramServer().GetProjectionEntity().OnPlacementStarted(
this);
2351 GetHologramServer().CheckPowerSource();
2352 GetHologramServer().RefreshVisual();
2363 m_HologramLocal =
new Hologram(
this, GetLocalProjectionPosition(), item);
2364 GetHologramLocal().GetProjectionEntity().OnPlacementStarted(
this);
2370 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
2372 if (IsPlacingServer())
2374 GetHologramServer().CheckPowerSource();
2375 GetHologramServer().GetParentEntity().OnPlacementCancelled(
this);
2377 delete m_HologramServer;
2381 else if (entityInHands && entityInHands.HasEnergyManager())
2383 if (entityInHands.GetCompEM().IsPlugged())
2384 entityInHands.OnPlacementCancelled(
this);
2391 m_AreHandsLocked =
true;
2396 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
2397 if (entityInHands && entityInHands.HasEnergyManager())
2399 if (entityInHands.GetCompEM().IsPlugged())
2400 entityInHands.OnPlacementCancelled(
this);
2403 delete m_HologramLocal;
2408 SetLocalProjectionPosition(
vector.Zero);
2409 delete m_HologramServer;
2414 SetLocalProjectionPosition(
vector.Zero);
2415 delete m_HologramLocal;
2420 if (m_HologramServer)
2428 if (m_HologramLocal)
2436 if (enable != m_IsDrowning)
2444 m_IsDrowning = enable;
2450 if (IsControlledPlayer())
2452 PPERequester_Drowning req = PPERequester_Drowning.Cast(PPERequesterBank.GetRequester(PPERequesterBank.REQ_DROWNING));
2456 SpawnDrowningBubbles();
2463 if (IsControlledPlayer())
2465 PPERequester_Drowning req = PPERequester_Drowning.Cast(PPERequesterBank.GetRequester(PPERequesterBank.REQ_DROWNING));
2476 PlacingCancelServer();
2487 m_ProcessResetADS =
true;
2488 ProcessADSSyncResetRequest();
2490 else if (!
GetGame().IsMultiplayer())
2504 m_ProcessResetADS =
false;
2526 foreach (
string t: disallowedUndergroundTypes)
2528 if (item.IsKindOf(t))
2537 m_UndergroundPresence = presence;
2542 if (IsPlacingLocal())
2552 PlacingCancelLocal();
2558 PlacingStartLocal(GetItemInHands());
2562 PlacingStartLocal(item);
2568 m_LocalProjectionPosition = local_position;
2573 Debug.Log(
string.Format(
"SetLocalProjectionPosition | pos: %1", m_LocalProjectionPosition),
"hologramLogs");
2580 m_LocalProjectionOrientation = local_orientation;
2585 return m_LocalProjectionPosition;
2590 return m_LocalProjectionOrientation;
2595 if (m_IsInColdArea != state)
2597 m_IsInColdArea = state;
2604 return m_IsInColdArea;
2627 SetContaminatedEffectEx(
false);
2631 StopSoundSet(m_SoundFliesEffect);
2636 m_CameraSwayModifier = new_camera.GetWeaponSwayModifier();
2637 m_CurrentCamera = new_camera;
2642 return m_CurrentCamera;
2647 if (!m_CurrentCamera)
2650 return m_CurrentCamera.GetCurrentPitch() <
PlayerConstants.CAMERA_THRESHOLD_PITCH;
2655 return m_BleedingManagerServer;
2660 return m_BleedingManagerRemote;
2665 return m_SymptomManager;
2678 return m_TrasferValues;
2683 return m_DebugMonitorValues;
2689 if (!IsPlayerSelected() || !IsAlive())
2691 if (m_ModifiersManager)
2692 m_ModifiersManager.OnScheduledTick(deltaTime);
2693 if (m_NotifiersManager)
2694 m_NotifiersManager.OnScheduledTick();
2695 if (m_TrasferValues)
2696 m_TrasferValues.OnScheduledTick(deltaTime);
2699 if (GetBleedingManagerServer())
2700 GetBleedingManagerServer().OnTick(deltaTime);
2702 m_Environment.Update(deltaTime);
2705 ItemBase heldItem = GetItemInHands();
2706 if (heldItem && heldItem.HasEnergyManager() && heldItem.GetCompEM().IsPlugged())
2712 placed_entity.GetCompEM().UpdatePlugState();
2720 if (!m_DeathSyncSent && m_KillerData)
2722 SyncEvents.SendEntityKilled(
this, m_KillerData.m_Killer, m_KillerData.m_MurderWeapon, m_KillerData.m_KillerHiTheBrain);
2723 m_DeathSyncSent =
true;
2727 if (m_DebugMonitorValues)
2728 m_DebugMonitorValues.OnScheduledTick(delta_time);
2729 if (GetSymptomManager())
2730 GetSymptomManager().OnTick(delta_time, pCurrentCommandID,
m_MovementState);
2736 if (m_PlayerSoundEventHandler)
2737 m_PlayerSoundEventHandler.OnTick(delta_time);
2739 if (m_ProcessRemoveEffectWidgets && m_ProcessRemoveEffectWidgets.Count() > 0)
2744 if (m_ProcessAddEffectWidgets && m_ProcessAddEffectWidgets.Count() > 0)
2749 HandleGlassesEffect();
2751 if (m_ContaminatedAreaEffectEnabled)
2752 ContaminatedParticleAdjustment();
2754 #ifdef DIAG_DEVELOPER
2757 m_WeaponDebug.OnCommandHandlerUpdate();
2761 m_ProcessAddEffectWidgets.Clear();
2762 m_ProcessRemoveEffectWidgets.Clear();
2765 m_AnimCommandStarting = HumanMoveCommandID.None;
2768 UpdateMovementInertia();
2770 if (m_ProcessResetADS)
2771 ProcessADSSyncResetRequest();
2777 HumanCommandMove hcm = GetCommand_Move();
2780 float staminaPercentage = GetStaminaHandler().GetSyncedStaminaNormalized();
2781 hcm.SetTurnSpanSprintModifier(2 - staminaPercentage);
2782 hcm.SetRunSprintFilterModifier((2 - staminaPercentage) * 0.5);
2783 hcm.SetDirectionSprintFilterModifier(2 - staminaPercentage);
2788 int m_DbgListSelection = 0;
2789 float m_DbgSliderValue = 0.0;
2794 return m_NotifiersManager;
2812 super.EEItemIntoHands(item);
2816 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(item, {
Bolt_Base});
2819 if (
Class.CastTo(w, item))
2821 w.ResetWeaponAnimState();
2823 HumanCommandMove cm = GetCommand_Move();
2826 cm.SetMeleeBlock(
false);
2827 GetMeleeFightLogic().SetBlock(
false);
2832 if (item.IsHeavyBehaviour() && IsRaised())
2834 HumanCommandMove cm2 = GetCommand_Move();
2841 SurrenderDummyItem dummyItem;
2842 if (
Class.CastTo(dummyItem, item) && GetEmoteManager())
2843 GetEmoteManager().ForceSurrenderState(
true);
2851 super.EEItemOutOfHands(item);
2853 if (IsPlacingLocal())
2863 return m_PlayerStomach;
2866 override void CommandHandler(
float pDt,
int pCurrentCommandID,
bool pCurrentCommandFinished)
2868 EvaluateDamageHit(pCurrentCommandID);
2871 super.CommandHandler(pDt,pCurrentCommandID,pCurrentCommandFinished);
2873 vector playerPosition = PhysicsGetPositionWS();
2877 CheckZeroSoundEvent();
2878 CheckSendSoundEvent();
2880 ProcessADDModifier();
2882 if (m_BrokenLegsJunctureReceived)
2884 m_BrokenLegsJunctureReceived =
false;
2885 bool initial = m_BrokenLegState < 0;
2892 BrokenLegForceProne();
2894 GetUApi().GetInputByID(UATempRaiseWeapon).Supress();
2900 if (IsFireWeaponRaised() || m_IsHoldingBreath)
2902 ProcessHoldBreath(pDt);
2907 if (m_AreHandsLocked && GetHumanInventory().GetEntityInHands())
2909 m_AreHandsLocked =
false;
2913 if (hic.CameraIsFreeLook() && m_DirectionToCursor ==
vector.Zero)
2915 m_DirectionToCursor =
GetGame().GetCurrentCameraDirection();
2917 else if (!hic.CameraIsFreeLook() && m_DirectionToCursor !=
vector.Zero)
2919 m_DirectionToCursor =
vector.Zero;
2922 if (m_WeaponManager)
2924 m_WeaponManager.Update(pDt);
2926 if (m_EmoteManager && IsPlayerSelected())
2928 m_EmoteManager.Update(pDt);
2932 m_RGSManager.Update();
2934 if (m_StanceIndicator)
2936 m_StanceIndicator.Update();
2942 if (m_InjuryHandler)
2944 m_InjuryHandler.Update(pDt);
2946 if (m_HCAnimHandler)
2952 m_ShockHandler.Update(pDt);
2957 GetPlayerSoundManagerServer().Update();
2964 ProcessDrowning(pDt);
2968 HandleDamageHit(pCurrentCommandID);
2972 mngr.Update(pCurrentCommandID);
2974 HumanCommandUnconscious hcu = GetCommand_Unconscious();
2975 HumanCommandVehicle hcv = GetCommand_Vehicle();
2977 if (!m_UnconsciousDebug)
2980 if (m_ShouldBeUnconscious && m_IsUnconscious)
2985 m_Swimming.m_bWasSwimming |= hcu.IsInWater();
2988 if (m_Swimming.m_bWasSwimming)
2993 OnUnconsciousUpdate(pDt, m_LastCommandBeforeUnconscious);
2996 else if (m_ShouldBeUnconscious)
2999 bool isTransitioning = hcv && (hcv.IsGettingIn() || hcv.IsGettingOut() || hcv.IsSwitchSeat());
3003 OnUnconsciousUpdate(pDt, m_LastCommandBeforeUnconscious);
3005 m_IsUnconscious =
true;
3006 OnUnconsciousStart();
3013 m_LastCommandBeforeUnconscious = pCurrentCommandID;
3017 m_TransportCache = hcv.GetTransport();
3021 m_TransportCache = null;
3025 m_JumpClimb.CheckAndFinishJump();
3026 StartCommand_Unconscious(0);
3027 SetFallYDiff(playerPosition[1]);
3031 else if (m_IsUnconscious)
3036 OnUnconsciousUpdate(pDt, m_LastCommandBeforeUnconscious);
3039 if (m_UnconsciousTime > 2)
3044 if (m_Swimming.m_bWasSwimming || m_LastCommandBeforeUnconscious ==
DayZPlayerConstants.COMMANDID_VEHICLE)
3047 hcu.WakeUp(wakeUpStance);
3049 m_IsUnconscious =
false;
3050 OnUnconsciousStop(pCurrentCommandID);
3058 m_IsUnconscious =
false;
3059 OnUnconsciousStop(pCurrentCommandID);
3066 int quickBarSlot = hic.IsQuickBarSlot();
3067 if (quickBarSlot && IsAlive())
3069 if (hic.IsQuickBarSingleUse())
3071 OnQuickBarSingleUse(quickBarSlot);
3074 if (hic.IsQuickBarContinuousUseStart() && ((!
GetGame().IsDedicatedServer()) && !
GetGame().GetUIManager().GetMenu()))
3076 OnQuickBarContinuousUseStart(quickBarSlot);
3079 if (hic.IsQuickBarContinuousUseEnd() && ((!
GetGame().IsDedicatedServer())))
3081 OnQuickBarContinuousUseEnd(quickBarSlot);
3094 HumanCommandMove hcm = GetCommand_Move();
3095 bool isSwimmingOrClimbing = GetCommand_Swim() || GetCommand_Climb() || GetCommand_Ladder();
3096 bool isStaminaLimitAppliable = hcm || isSwimmingOrClimbing;
3098 if (isStaminaLimitAppliable)
3100 hic.LimitsDisableSprint(!(CanConsumeStamina(
EStaminaConsumers.SPRINT) && CanSprint()));
3107 if (!
GetGame().IsDedicatedServer())
3115 if (IsMapCallbackCancelInput())
3119 else if (IsMapCallbackEndInput())
3128 #ifdef DIAG_DEVELOPER
3130 m_Bot.OnUpdate(pDt);
3133 if (m_CheckMeleeItem && (!
GetGame().IsDedicatedServer()))
3135 CheckMeleeItemDamage(m_CheckMeleeItem);
3136 SetCheckMeleeItem();
3140 TryGetInVehicleDebug();
3143 OnCommandHandlerTick(pDt, pCurrentCommandID);
3147 void SetGetInVehicleDebug(
EntityAI ent)
3149 m_GetInVehicleTransportDebug =
Transport.Cast(ent);
3152 void TryGetInVehicleDebug()
3154 if (m_GetInVehicleTransportDebug)
3156 HumanCommandVehicle vehCommand = StartCommand_Vehicle(m_GetInVehicleTransportDebug, 0, 0);
3159 vehCommand.SetVehicleType(m_GetInVehicleTransportDebug.GetAnimInstance());
3161 m_GetInVehicleTransportDebug = null;
3175 if (m_hac && !GetMapClosingSyncSent())
3193 GetGame().GetMission().RemoveActiveInputExcludes({
"map"});
3194 GetGame().GetMission().RemoveActiveInputRestriction(EInputRestrictors.MAP);
3196 else if (!
GetGame().IsMultiplayer())
3203 m_hac.InternalCommand(command_ID);
3205 SetMapClosingSyncSet(
true);
3209 if (!
GetGame().IsDedicatedServer())
3216 m_Hud.ShowQuickbarPlayer(
true);
3219 GetGame().GetMission().RemoveActiveInputExcludes({
"map"});
3220 GetGame().GetMission().RemoveActiveInputRestriction(EInputRestrictors.MAP);
3237 m_MapClosingSyncSent = state;
3242 return m_MapClosingSyncSent;
3257 if (
GetUApi().GetInputByID(UADefaultAction).LocalPress() ||
GetUApi().GetInputByID(UAUIMenu).LocalPress() ||
GetUApi().GetInputByID(UAGear).LocalPress())
3267 return m_MapNavigationBehaviour;
3272 if (GetMapNavigationBehaviour())
3274 GetMapNavigationBehaviour().OnItemInPlayerPossession(item);
3280 if (GetMapNavigationBehaviour())
3282 GetMapNavigationBehaviour().OnItemNotInPlayerPossession(item);
3288 m_CheckMeleeItem = item;
3293 m_ShakesForced = value;
3299 if (m_ShakesForced > 0)
3301 level = m_ShakesForced;
3305 float heat_comfort = GetStatHeatComfort().Get();
3306 if (heat_comfort <=
PlayerConstants.THRESHOLD_HEAT_COMFORT_MINUS_WARNING)
3309 level =
Math.Lerp(1,7,value);
3310 level =
Math.Clamp(value,1,7);
3317 if (level != m_Shakes)
3326 if (super.IsLanded(pCurrentCommandID))
3334 bool wasFalling = m_IsUnconsciousFalling;
3335 m_IsUnconsciousFalling = PhysicsIsFalling(
false);
3336 return wasFalling && !m_IsUnconsciousFalling;
3346 if (super.OnLand(pCurrentCommandID, fallDamageData))
3359 if (super.IsAlreadyInFallingCommand(pCurrentCommandID))
3371 CloseInventoryMenu();
3375 GetGame().GetMission().GetHud().ShowHudUI(
false);
3376 SetInventorySoftLock(
true);
3379 EntityAI entity_in_hands = GetHumanInventory().GetEntityInHands();
3380 if (entity_in_hands && CanDropEntity(entity_in_hands) && !IsRestrained() && !IsSurrendered())
3382 DropItem(
ItemBase.Cast(entity_in_hands));
3385 GetGame().GetSoundScene().SetSoundVolume(0,2);
3395 if (m_TransportCache)
3396 m_TransportCache.MarkCrewMemberUnconscious(m_TransportCache.CrewMemberIndex(
this));
3400 GetGame().EnableVoN(
this,
false);
3408 if (GetMeleeFightLogic())
3410 GetMeleeFightLogic().SetBlock(
false);
3414 SetMasterAttenuation(
"UnconsciousAttenuation");
3416 if (m_OnUnconsciousStart)
3417 m_OnUnconsciousStart.Invoke(
this);
3422 m_UnconRefillModifier =1;
3424 m_UnconsciousTime = 0;
3425 m_UnconsciousVignetteTarget = 2;
3428 GetGame().GetMission().GetHud().ShowHudUI(
true);
3431 GetGame().GetSoundScene().SetSoundVolume(
g_Game.m_volume_sound,1);
3432 PPERequester_UnconEffects requester = PPERequester_UnconEffects.Cast(PPERequesterBank.GetRequester(PPERequester_UnconEffects));
3433 requester.FadeOutEffect();
3434 GetGame().GetMission().GetHud().ShowQuickbarUI(
true);
3435 if (
GetGame().GetUIManager().IsDialogVisible())
3437 GetGame().GetUIManager().CloseDialog();
3444 SetInventorySoftLock(
false);
3451 GetGame().EnableVoN(
this,
true);
3459 SetMasterAttenuation(
"");
3461 if (m_OnUnconsciousStop)
3462 m_OnUnconsciousStop.Invoke(
this);
3467 m_UnconsciousTime += pDt;
3470 int shock_simplified = SimplifyShock();
3472 if (m_ShockSimplified != shock_simplified)
3474 m_ShockSimplified = shock_simplified;
3480 PluginAdminLog adm = PluginAdminLog.Cast(
GetPlugin(PluginAdminLog));
3481 adm.PlayerKilledByDrowningUncon(
this);
3483 SetHealth(
"",
"",-100);
3488 GetGame().GetMission().GetHud().ShowQuickbarUI(
false);
3491 float shock_simple_normalized = GetSimplifiedShockNormalized();
3493 float sin =
Math.Sin(m_UnconsciousTime * 0.35);
3494 float sin_normalized = (sin + 1) / 2;
3495 if (sin_normalized < 0.05)
3497 m_UnconsciousVignetteTarget = (1 - shock_simple_normalized / 3) * 2;
3499 float vignette =
Math.Lerp(2,m_UnconsciousVignetteTarget, sin_normalized);
3500 m_UnconParam.param1 = vignette;
3501 PPERequesterBank.GetRequester(PPERequester_UnconEffects).Start(m_UnconParam);
3508 int shock =
Math.Lerp(0, SIMPLIFIED_SHOCK_CAP, GetHealth(
"",
"Shock") / GetMaxHealth(
"",
"Shock"));
3509 shock =
Math.Clamp(shock, 0, SIMPLIFIED_SHOCK_CAP);
3515 return (m_ShockSimplified / SIMPLIFIED_SHOCK_CAP);
3525 return m_IsUnconscious;
3530 #ifdef DIAG_DEVELOPER
3531 if (!m_CanBeTargetedDebug)
3537 return super.CanBeTargetedByAI(ai) && !IsUnconscious() && !IsInVehicle();
3542 AddHealth(
"",
"Shock",shock);
3548 CloseInventoryMenu();
3549 GetGame().GetMission().RemoveActiveInputExcludes({
"inventory"},
true);
3550 GetGame().GetMission().RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
3561 return Math.AbsInt(m_BrokenLegState);
3567 m_BrokenLegState = stateId;
3574 m_InjuryHandler.m_ForceInjuryAnimMask = m_InjuryHandler.m_ForceInjuryAnimMask & ~eInjuryOverrides.BROKEN_LEGS;
3575 m_InjuryHandler.m_ForceInjuryAnimMask = m_InjuryHandler.m_ForceInjuryAnimMask & ~eInjuryOverrides.BROKEN_LEGS_SPLINT;
3600 m_InjuryHandler.m_ForceInjuryAnimMask = m_InjuryHandler.m_ForceInjuryAnimMask & ~eInjuryOverrides.PRONE_ANIM_OVERRIDE;
3601 m_InjuryHandler.m_ForceInjuryAnimMask = m_InjuryHandler.m_ForceInjuryAnimMask & ~eInjuryOverrides.BROKEN_LEGS;
3602 m_InjuryHandler.m_ForceInjuryAnimMask = m_InjuryHandler.m_ForceInjuryAnimMask | eInjuryOverrides.BROKEN_LEGS_SPLINT;
3604 m_InjuryHandler.CheckValue(
false);
3612 m_InjuryHandler.m_ForceInjuryAnimMask = m_InjuryHandler.m_ForceInjuryAnimMask & ~eInjuryOverrides.PRONE_ANIM_OVERRIDE;
3613 m_InjuryHandler.m_ForceInjuryAnimMask = m_InjuryHandler.m_ForceInjuryAnimMask & ~eInjuryOverrides.BROKEN_LEGS_SPLINT;
3614 m_InjuryHandler.m_ForceInjuryAnimMask = m_InjuryHandler.m_ForceInjuryAnimMask | eInjuryOverrides.BROKEN_LEGS;
3617 BrokenLegWalkShock();
3618 m_InjuryHandler.CheckValue(
false);
3624 m_InjuryHandler.m_ForceInjuryAnimMask = m_InjuryHandler.m_ForceInjuryAnimMask & ~eInjuryOverrides.BROKEN_LEGS;
3625 m_InjuryHandler.m_ForceInjuryAnimMask = m_InjuryHandler.m_ForceInjuryAnimMask & ~eInjuryOverrides.BROKEN_LEGS_SPLINT;
3632 PlaySoundSet(m_BrokenLegSound, SOUND_BREAK_LEG, 0.1, 0.1);
3636 if (!IsInWater() && !IsSwimming() && !IsClimbingLadder() && !IsInVehicle() && !IsClimbing() && DayZPlayerUtils.PlayerCanChangeStance(
this,
DayZPlayerConstants.STANCEIDX_PRONE))
3641 Class.CastTo(attachment, GetItemOnSlot(
"Splint_Right"));
3642 if (attachment && attachment.GetType() ==
"Splint_Applied")
3644 attachment.Delete();
3648 m_ShockHandler.CheckValue(
true);
3651 if (m_ShockHandler.GetCurrentShock() >= 25)
3663 HumanCommandMove hcm = StartCommand_Move();
3664 hcm = GetCommand_Move();
3673 m_JumpClimb.CheckAndFinishJump();
3682 float avgLegHealth = GetHealth(
"RightLeg",
"") + GetHealth(
"LeftLeg",
"") + GetHealth(
"RightFoot",
"") + GetHealth(
"LeftFoot",
"");
3683 avgLegHealth *= 0.25;
3689 PhysicsGetVelocity(v);
3691 if (v.LengthSq() > 0)
3698 if (IsClimbingLadder())
3721 m_ShockHandler.CheckValue(
true);
3726 void MovingShock(
float legHealth,
float highShock,
float midShock,
float lowShock)
3731 m_ShockHandler.SetShock(highShock);
3733 else if (legHealth >=
PlayerConstants.BROKEN_LEGS_HIGH_HEALTH_THRESHOLD)
3736 m_ShockHandler.SetShock(lowShock);
3741 m_ShockHandler.SetShock(midShock);
3747 Param1<float> damage =
new Param1<float>(0);
3748 damage.param1 = dmg;
3749 GetGame().RPCSingleParam(
this,
ERPCs.RPC_SHOCK, damage,
true, GetIdentity());
3755 if (item.IsHeavyBehaviour() && (GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS || GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS_SPLINT))
3758 return super.CanPickupHeavyItem(item);
3764 SetHealth(
"RightLeg",
"", 0);
3765 SetHealth(
"RightFoot",
"", 0);
3766 SetHealth(
"LeftLeg",
"", 0);
3767 SetHealth(
"LeftFoot",
"", 0);
3772 ItemBase itemInHands = GetItemInHands();
3773 if (itemInHands && itemInHands.IsHeavyBehaviour())
3774 DropItem(itemInHands);
3780 Class.CastTo(attachment, GetItemOnSlot(
"Splint_Right"));
3781 if (attachment && attachment.GetType() ==
"Splint_Applied")
3793 ItemBase itemInHands = GetItemInHands();
3796 if (itemInHands.IsHeavyBehaviour())
3798 TryHideItemInHands(
false);
3800 ServerDropEntity(itemInHands);
3805 TryHideItemInHands(
true);
3807 itemInHands.OnItemInHandsPlayerSwimStart(
this);
3809 m_AnimCommandStarting = HumanMoveCommandID.CommandSwim;
3812 GetInventory().LockInventory(LOCK_FROM_SCRIPT);
3814 CloseInventoryMenu();
3818 GetWeaponManager().DelayedRefreshAnimationState(10);
3819 RequestHandAnimationStateRefresh();
3821 GetGame().GetMission().AddActiveInputExcludes({
"swimming"});
3826 TryHideItemInHands(
false,
true);
3829 GetInventory().UnlockInventory(LOCK_FROM_SCRIPT);
3833 GetWeaponManager().RefreshAnimationState();
3835 GetGame().GetMission().RemoveActiveInputExcludes({
"swimming"});
3840 m_AnimCommandStarting = HumanMoveCommandID.CommandLadder;
3841 TryHideItemInHands(
true);
3844 GetInventory().LockInventory(LOCK_FROM_SCRIPT);
3846 CloseInventoryMenu();
3848 GetGame().GetMission().AddActiveInputExcludes({
"ladderclimbing"});
3853 TryHideItemInHands(
false,
true);
3856 GetInventory().UnlockInventory(LOCK_FROM_SCRIPT);
3858 GetGame().GetMission().RemoveActiveInputExcludes({
"ladderclimbing"});
3863 m_AnimCommandStarting = HumanMoveCommandID.CommandFall;
3866 GetInventory().LockInventory(LOCK_FROM_SCRIPT);
3868 CloseInventoryMenu();
3871 GetWeaponManager().DelayedRefreshAnimationState(10);
3872 RequestHandAnimationStateRefresh();
3878 GetInventory().UnlockInventory(LOCK_FROM_SCRIPT);
3881 m_JumpClimb.CheckAndFinishJump();
3883 GetWeaponManager().RefreshAnimationState();
3888 m_AnimCommandStarting = HumanMoveCommandID.CommandClimb;
3891 GetInventory().LockInventory(LOCK_FROM_SCRIPT);
3893 CloseInventoryMenu();
3896 GetWeaponManager().DelayedRefreshAnimationState(10);
3897 RequestHandAnimationStateRefresh();
3903 GetInventory().UnlockInventory(LOCK_FROM_SCRIPT);
3905 GetWeaponManager().RefreshAnimationState();
3910 m_AnimCommandStarting = HumanMoveCommandID.CommandVehicle;
3913 GetInventory().LockInventory(LOCK_FROM_SCRIPT);
3915 CloseInventoryMenu();
3917 ItemBase itemInHand = GetItemInHands();
3918 EntityAI itemOnHead = FindAttachmentBySlotName(
"Headgear");
3920 if (itemInHand && itemInHand.GetCompEM())
3921 itemInHand.GetCompEM().SwitchOff();
3923 TryHideItemInHands(
true);
3925 if (itemOnHead && itemOnHead.GetCompEM())
3926 itemOnHead.GetCompEM().SwitchOff();
3928 GetGame().GetMission().AddActiveInputExcludes({
"vehicledriving"});
3934 GetInventory().UnlockInventory(LOCK_FROM_SCRIPT);
3936 if (!m_ShouldBeUnconscious)
3937 TryHideItemInHands(
false,
true);
3939 GetGame().GetMission().RemoveActiveInputExcludes({
"vehicledriving"});
3944 m_AnimCommandStarting = HumanMoveCommandID.CommandMelee2;
3945 m_IsFighting =
true;
3948 GetWeaponManager().DelayedRefreshAnimationState(10);
3949 RequestHandAnimationStateRefresh();
3954 RunFightBlendTimer();
3956 GetWeaponManager().RefreshAnimationState();
3962 m_AnimCommandStarting = HumanMoveCommandID.CommandDeath;
3965 GetWeaponManager().DelayedRefreshAnimationState(10);
3966 RequestHandAnimationStateRefresh();
3968 super.OnCommandDeathStart();
3973 m_ActionManager.OnJumpStart();
3976 GetWeaponManager().DelayedRefreshAnimationState(10);
3977 RequestHandAnimationStateRefresh();
3983 if (m_PresenceNotifier)
3987 case HumanCommandFall.LANDTYPE_NONE:
3988 case HumanCommandFall.LANDTYPE_LIGHT:
3991 case HumanCommandFall.LANDTYPE_MEDIUM:
3992 case HumanCommandFall.LANDTYPE_HEAVY:
3998 GetWeaponManager().RefreshAnimationState();
4003 return ((1 << stance) & stanceMask) != 0;
4012 m_SprintedTimePerStanceMin =
PlayerConstants.FULL_SPRINT_DELAY_FROM_PRONE;
4015 m_SprintedTimePerStanceMin =
PlayerConstants.FULL_SPRINT_DELAY_FROM_CROUCH;
4017 if ((IsStance(previousStance, prone) && IsStance(newStance, notProne)) || (IsStance(previousStance, notProne) && IsStance(newStance, prone)))
4020 GetWeaponManager().RefreshAnimationState();
4031 if (GetThrowing().IsThrowingAnimationPlaying())
4037 if (
Math.AbsInt(previousStance - newStance) == 3)
4068 m_InjuryHandler.m_ForceInjuryAnimMask = m_InjuryHandler.m_ForceInjuryAnimMask & ~eInjuryOverrides.PRONE_ANIM_OVERRIDE;
4069 ForceUpdateInjuredState();
4079 if (IsInFBEmoteState() || m_EmoteManager.m_MenuEmote)
4112 m_IsVehicleSeatDriver =
true;
4114 m_Hud.ShowVehicleInfo();
4116#ifdef FEATURE_NETWORK_RECONCILIATION
4120 Pawn pawn = Pawn.Cast(GetParent());
4123 identity.Possess(pawn);
4130#ifdef FEATURE_NETWORK_RECONCILIATION
4134 if (identity && !m_ShouldBeUnconscious)
4137 identity.Possess(
this);
4141 m_IsVehicleSeatDriver =
false;
4143 m_Hud.HideVehicleInfo();
4148 if (change_to_enabled)
4150 PlacingCancelLocal();
4151 PlacingCancelServer();
4160 m_Hud.Update(timeSlice);
4164 m_EffectWidgets.
Update(timeSlice);
4168 if (m_UndergroundHandler)
4169 m_UndergroundHandler.Tick(timeSlice);
4171 if (m_UndergroundBunkerHandler)
4172 m_UndergroundBunkerHandler.Tick(timeSlice);
4175 if (m_InEffectAreaType != 0 &&
GetGame().IsServer())
4176 OnUpdateEffectAreaServer(timeSlice);
4181 float delta_time = (
GetGame().
GetTime() - m_LastPostFrameTickTime) / 1000;
4185 if (GetDamageDealtEffect())
4188 GetDamageDealtEffect().Update(delta_time);
4190 delete GetDamageDealtEffect();
4197 m_EffectRadial.Update(delta_time);
4200 m_EffectRadial = null;
4204 if (GetFlashbangEffect())
4208 GetFlashbangEffect().Update(delta_time);
4212 GetFlashbangEffect().Stop();
4213 delete GetFlashbangEffect();
4217 if (GetShockEffect())
4220 GetShockEffect().Update(delta_time);
4222 delete GetShockEffect();
4225 m_InventoryActionHandler.OnUpdate();
4228 #ifdef DIAG_DEVELOPER
4229 DiagOnPostFrame(other, extra);
4233#ifdef DIAG_DEVELOPER
4234 protected void DiagOnPostFrame(
IEntity other,
int extra)
4240 m_WeaponDebug.OnPostFrameUpdate();
4243 if (GetBleedingManagerRemote())
4245 GetBleedingManagerRemote().OnUpdate();
4252 m_MeleeDebug =
true;
4257 m_MeleeDebug =
false;
4267 PluginDrawCheckerboard drawCheckerboard = PluginDrawCheckerboard.Cast(
GetPluginManager().GetPluginByType(PluginDrawCheckerboard));
4268 if (drawCheckerboard && !drawCheckerboard.IsActive())
4274 if (m_PresenceNotifier)
4279 if (m_TargetTemperatureDiag)
4287 GetCollisionBox(minmax);
4290 if (m_IsInsideTrigger)
4297 dbgShape.CreateMatrix(mat);
4298 dbgShape.SetMatrix(mat);
4302 if (m_Environment && m_Environment.m_Debug)
4305 EnvDebugData envDebugData = m_Environment.GetEnvDebugData();
4306 GetGame().RPCSingleParam(
this,
ERPCs.DIAG_MISC_ENVIRONMENT_DEBUG_DATA, envDebugData,
false, GetIdentity());
4308 m_Environment.ShowEnvDebugPlayerInfo(
DiagMenu.GetBool(
DiagMenuIDs.MISC_ENVIRONMENT_DEBUG));
4312 if (m_FallDamage && m_FallDamage.m_Debug)
4315 FallDamageDebugData fallDamageDebugData = m_FallDamage.GetFallDamageDebugData();
4316 GetGame().RPCSingleParam(
this,
ERPCs.DIAG_MISC_FALLDAMAGE_DEBUG_DATA, fallDamageDebugData,
false, GetIdentity());
4318 m_FallDamage.ShowFallDamageDebugInfo(
DiagMenu.GetBool(
DiagMenuIDs.MISC_FALLDAMAGE_DEBUG));
4325 super.OnEnterTrigger(trigger);
4327 ++m_IsInsideTrigger;
4332 super.OnLeaveTrigger(trigger);
4334 --m_IsInsideTrigger;
4341 m_Hud.SetStaminaBarVisibility(show);
4346 if (GetStaminaHandler())
4347 GetStaminaHandler().DepleteStaminaEx(modifier,dT,coef);
4352 if (!GetStaminaHandler())
4355 bool val = (GetStaminaHandler().HasEnoughStaminaFor(consumer) && !IsRestrained() && !IsInFBEmoteState());
4358 StaminaHUDNotifier(
false);
4365 if (!GetStaminaHandler())
4368 bool val = (GetStaminaHandler().HasEnoughStaminaToStart(consumer) && !IsRestrained() && !IsInFBEmoteState());
4371 StaminaHUDNotifier(
false);
4376 override bool CanClimb(
int climbType, SHumanCommandClimbResult climbRes)
4391 if (climbType > 0 && m_InjuryHandler && m_InjuryHandler.GetInjuryAnimValue() >=
InjuryAnimValues.LVL3)
4394 return super.CanClimb(climbType,climbRes);
4399 if (GetBrokenLegs() !=
eBrokenLegs.NO_BROKEN_LEGS)
4408 if (m_InjuryHandler && m_InjuryHandler.GetInjuryAnimValue() >=
InjuryAnimValues.LVL3)
4411 if (IsInFBEmoteState() || m_EmoteManager.m_MenuEmote)
4416 return super.CanJump();
4421 return m_JumpClimb.m_bIsJumpInProgress;
4427 temp =
GetGame().GetMission().GetActiveRefresherLocations();
4428 int count = temp.Count();
4431 vector pos = target.GetPosition();
4432 for (
int i = 0; i < count; i++)
4450 m_RefreshAnimStateIdx++;
4451 if (m_RefreshAnimStateIdx > 3)
4452 m_RefreshAnimStateIdx = 0;
4461 GetItemAccessor().OnItemInHandsChanged(
true);
4462 GetItemAccessor().ResetWeaponInHands();
4476 vector pdir = GetDirection();
4481 if (
Math.AbsFloat(pdir[0]-ptv[0]) < 0.5 &&
Math.AbsFloat(pdir[2]-ptv[2]) < 0.5)
4494 if (m_AreHandsLocked)
4500 if (GetThrowing().IsThrowingModeEnabled() || GetThrowing().IsThrowingAnimationPlaying())
4503 if (IsRaised() || GetCommand_Melee() || IsSwimming() || IsClimbingLadder() || IsClimbing() || IsRestrained() || IsRestrainPrelocked())
4506 if (GetDayZPlayerInventory().
IsProcessing() || IsItemsToDelete())
4512 if (GetWeaponManager() && GetWeaponManager().
IsRunning())
4522 EntityAI quickBarEntity = GetQuickBarEntity(slotClicked - 1);
4524 if (!quickBarEntity)
4530 if (
Class.CastTo(mag, quickBarEntity) &&
Class.CastTo(wpn, mag.GetHierarchyParent()))
4533 EntityAI inHandEntity = GetHumanInventory().GetEntityInHands();
4535 if (!GetDayZPlayerInventory().
IsIdle())
4539 handInventoryLocation.SetHands(
this,quickBarEntity);
4540 if (this.GetInventory().HasInventoryReservation(quickBarEntity, handInventoryLocation))
4543 if (inHandEntity == quickBarEntity)
4545 if (GetHumanInventory().CanRemoveEntityInHands())
4547 if (
LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] Stash - PredictiveMoveItemFromHandsToInventory HND=" +
Object.GetDebugName(inHandEntity));
4548 PredictiveMoveItemFromHandsToInventory();
4554 quickBarEntity.GetInventory().GetCurrentInventoryLocation(invLocQBItem);
4555 if (GetInventory().HasInventoryReservation(quickBarEntity,invLocQBItem))
4563 inHandEntity.GetInventory().GetCurrentInventoryLocation(inHandEntityFSwapDst);
4565 int index = GetHumanInventory().FindUserReservedLocationIndex(inHandEntity);
4567 GetHumanInventory().GetUserReservedLocation(index, Reserved_Item_il);
4569 if (Reserved_Item_il)
4570 inHandEntityFSwapDst.CopyLocationFrom(Reserved_Item_il,
true);
4575 PredictiveSwapEntities(quickBarEntity, inHandEntity);
4580 PredictiveForceSwapEntities(quickBarEntity, inHandEntity, inHandEntityFSwapDst);
4585 if (GetInventory().HasInventoryReservation(quickBarEntity,handInventoryLocation))
4588 if (GetInventory().CanAddEntityIntoHands(quickBarEntity))
4591 PredictiveTakeEntityToHands(quickBarEntity);
4599 if (GetInventory().IsInventoryLocked())
4602 if (IsSwimming() || IsClimbingLadder() || GetCommand_Melee() || IsClimbing() || IsRestrained() || IsRestrainPrelocked())
4609 ItemBase itemInHands =
ItemBase.Cast(GetHumanInventory().GetEntityInHands());
4611 if (itemInHands != quickBarItem)
4621 if (IsRaised() || GetCommand_Melee())
4625 m_QuickBarFT =
true;
4629 m_QuickBarHold =
true;
4640 if (m_ActionQBControl)
4656 m_QuickBarFT =
false;
4660 m_QuickBarHold =
false;
4669 return m_ActionQBControl;
4673 m_ActionQBControl =
false;
4682 OnQuickBarSingleUse(slotClicked);
4688 EntityAI quickBarEntity = GetQuickBarEntity(slotClicked - 1);
4689 EntityAI entity_in_hands = GetHumanInventory().GetEntityInHands();
4691 ReloadWeapon(entity_in_hands, quickBarEntity);
4697 EntityAI magazine = GetMagazineToReload(weapon);
4698 ReloadWeapon(weapon, magazine);
4711 mngr_client.Interrupt();
4713 else if (GetHumanInventory().GetEntityInHands()!= magazine)
4717 Class.CastTo(wpn, weapon);
4718 Class.CastTo(mag, magazine);
4719 if (GetWeaponManager().CanUnjam(wpn))
4721 GetWeaponManager().Unjam();
4723 else if (GetWeaponManager().CanAttachMagazine(wpn, mag))
4725 GetWeaponManager().AttachMagazine(mag);
4727 else if (GetWeaponManager().CanSwapMagazine(wpn, mag))
4729 GetWeaponManager().SwapMagazine(mag);
4731 else if (GetWeaponManager().CanLoadBullet(wpn, mag))
4735 ActionTarget atrg =
new ActionTarget(mag,
this, -1,
vector.Zero, -1.0);
4751 int last_ammo_magazine_count;
4752 int ammo_magazine_count;
4755 int last_ammo_pile_count;
4756 int ammo_pile_count;
4759 for (
int att_i = 0; att_i < GetInventory().AttachmentCount(); ++att_i)
4761 EntityAI attachment = GetInventory().GetAttachmentFromIndex(att_i);
4762 ref
CargoBase attachment_cargo = attachment.GetInventory().GetCargo();
4764 if (attachment_cargo)
4766 for (
int cgo_i = 0; cgo_i < attachment_cargo.GetItemCount(); ++cgo_i)
4768 EntityAI cargo_item = attachment_cargo.GetItem(cgo_i);
4771 if (cargo_item.IsMagazine())
4773 Magazine magazine = Magazine.Cast(cargo_item);
4774 ammo_pile_count = magazine.GetAmmoCount();
4779 if (ammo_pile_count > 0)
4781 if (last_ammo_magazine_count == 0)
4783 ammo_magazine = magazine;
4784 last_ammo_magazine_count = ammo_pile_count;
4788 if (last_ammo_magazine_count < ammo_pile_count)
4790 ammo_magazine = magazine;
4791 last_ammo_magazine_count = ammo_pile_count;
4797 else if (weapon_manager.
CanLoadBullet(weapon_base, magazine))
4799 if (ammo_pile_count > 0)
4801 if (last_ammo_pile_count == 0)
4803 ammo_pile = magazine;
4804 last_ammo_pile_count = ammo_pile_count;
4808 if (last_ammo_pile_count > ammo_pile_count)
4810 ammo_pile = magazine;
4811 last_ammo_pile_count = ammo_pile_count;
4824 return ammo_magazine;
4837 GetGame().GetMission().AddDummyPlayerToScheduler(
this);
4841#ifdef DIAG_DEVELOPER
4844 m_Bot =
new Bot(
this);
4854 return m_LiquidTendencyDrain;
4860 m_LiquidTendencyDrain = state;
4867 return m_FlagRaisingTendency;
4873 m_FlagRaisingTendency = state;
4876 override SoundOnVehicle
PlaySound(
string sound_name,
float range,
bool create_local =
false)
4878 return BetaSound.SaySound(
this, sound_name, range,
false);
4883 return GetWeightEx();
4888 return GetWeightEx() >= OVERLOAD_LIMIT;
4901 float newload = GetPlayerLoad() + addedload;
4902 SetPlayerLoad(newload);
4910 return GetInventory().HasEntityInInventory(entity);
4915 if (
GetGame().IsMultiplayer())
4929 if (
LogManager.IsSyncLogEnable())
syncDebugPrint(
"[syncinv] " +
GetDebugName(
this) +
" STS=" + GetSimulationTimeStamp() +
" NeedInventoryJunctureFromServer item=" +
Object.GetDebugName(item) +
" currPar=" + currParent +
" newPar=" + newParent);
4931 bool i_owned = GetHumanInventory().HasEntityInInventory(item);
4933 bool cp_owned =
false;
4935 cp_owned = GetHumanInventory().HasEntityInInventory(currParent);
4937 bool np_owned =
false;
4939 np_owned = GetHumanInventory().HasEntityInInventory(newParent);
4941 bool all_owned = i_owned && cp_owned && (np_owned || (newParent == null));
4942 if (
LogManager.IsSyncLogEnable())
syncDebugPrint(
"[syncinv] " +
GetDebugName(
this) +
" STS=" + GetSimulationTimeStamp() +
" NeedInventoryJunctureFromServer=" + !all_owned +
" i_pwn=" + i_owned +
" cp_pwn=" + cp_owned +
" np_pwn=" + np_owned);
4946 Error(
"[syncinv] unsupported instance type t=" + t);
4956 float totalWeight = super.GetWeightSpecialized(forceRecalc);
4958 ItemBase itemHands = GetItemInHands();
4961 totalWeight += itemHands.GetWeightEx(forceRecalc);
4964 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
4966 float itemInHandsWeight = totalWeight - super.GetWeightSpecialized(forceRecalc);
4968 dta.SetCalcDetails(
"TMan: " + (super.GetWeightSpecialized(forceRecalc)+ itemInHandsWeight) +
"(contents weight[includes item in hands])");
4976 const int VISIBILITY_SLOTS_COUNT = 10;
4978 int attcount = GetInventory().AttachmentCount();
4979 float sumVisibility = 0;
4980 float countVisibility = 0;
4981 float visibilityMean = 0;
4985 for (
int att = 0; att < attcount; att++)
4987 EntityAI attachment = GetInventory().GetAttachmentFromIndex(att);
4988 if (attachment.IsClothing())
4991 Class.CastTo(clothing, attachment);
4992 sumVisibility += clothing.GetItemVisibility();
4997 visibilityMean = (sumVisibility + (VISIBILITY_SLOTS_COUNT - countVisibility)) / VISIBILITY_SLOTS_COUNT;
4998 SetVisibilityCoef(visibilityMean);
5003 SetVisibilityCoef(visibilityMean);
5009 m_VisibilityCoef = pVisibility;
5014 return m_VisibilityCoef;
5026 float health = GetHealth(
"",
"");
5032 float toxicity = GetStatToxicity().Get();
5038 float blood = GetHealth(
"",
"Blood");
5044 float energy = GetStatEnergy().Get();
5050 float water = GetStatWater().Get();
5056 float immunity = GetImmunity();
5057 if (m_ImmunityBoosted)
5065 float immunity = GetImmunity();
5066 float immmunity_max = 1;
5073 float health = GetHealth(
"",
"");
5074 float health_max = GetMaxHealth(
"",
"");
5080 float toxicity = GetStatToxicity().Get();
5081 float toxicity_max = GetStatToxicity().GetMax();
5087 float blood = GetHealth(
"",
"Blood");
5088 float blood_max = GetMaxHealth(
"",
"Blood");
5094 float energy = GetStatEnergy().Get();
5095 float energy_max = GetStatEnergy().GetMax();
5101 float water = GetStatWater().Get();
5102 float water_max = GetStatWater().GetMax();
5110 if (stat_value <= critical)
5112 return Math.InverseLerp(0, critical, stat_value);
5114 if (stat_value <= low)
5116 return Math.InverseLerp(critical, low, stat_value);
5118 if (stat_value <= normal)
5120 return Math.InverseLerp(low, normal, stat_value);
5122 if (stat_value <= high)
5124 return Math.InverseLerp(normal, high, stat_value);
5126 return Math.InverseLerp(high, max, stat_value);
5131 if (stat_value <= critical)
5135 if (stat_value <= low)
5139 if (stat_value <= normal)
5143 if (stat_value <= high)
5152 m_ImmunityBoosted = boosted;
5161 if (GetPlayerStats())
5163 float max_health = GetMaxHealth(
"GlobalHealth",
"Health") + 0.01;
5164 float max_blood = GetMaxHealth(
"GlobalHealth",
"Blood") + 0.01;
5165 float energy_normalized = GetStatEnergy().Get() /
PlayerConstants.SL_ENERGY_MAX;
5166 float water_normalized = GetStatWater().Get() /
PlayerConstants.SL_WATER_MAX;
5167 float health_normalized = GetHealth(
"GlobalHealth",
"Health") / max_health;
5168 float blood_normalized = GetHealth(
"GlobalHealth",
"Blood") / max_blood;
5169 immunity = energy_normalized + water_normalized + health_normalized + blood_normalized;
5170 immunity = immunity / 4;
5171 immunity =
Math.Clamp(immunity,0,1);
5184 if (IsRaised() || (item && item.IsHeavyBehaviour()))
5187 if (item && GetThrowing() && GetThrowing().IsThrowingModeEnabled())
5190 if (GetBrokenLegs() !=
eBrokenLegs.NO_BROKEN_LEGS)
5213 return GetCommand_Move() && GetCommand_Move().IsInRoll();
5227 return m_IsFighting;
5232 return m_EmoteManager && m_EmoteManager.IsEmotePlaying();
5246 return m_AnimCommandStarting & mask;
5251 if (!m_FightEndBlendTimer)
5252 m_FightEndBlendTimer =
new Timer();
5253 if (!m_FightEndBlendTimer.IsRunning())
5255 m_FightEndBlendTimer.Run(
PlayerConstants.MELEE2_MOVEMENT_BLEND_DELAY,
this,
"EndFighting");
5261 m_IsFighting =
false;
5268 if (item && item.GetHierarchyParent() && item.GetHierarchyParent().IsWeapon() && item.IsRuined())
5270 PlayAttachmentDropSound();
5271 return DropItem(item);
5274 if (item && item == GetItemInHands() && item.IsRuined())
5276 return PredictiveDropEntity(item);
5289 super.RPC(rpc_type, params, guaranteed, recipient);
5295 super.OnRPC(sender, rpc_type, ctx);
5301 case ERPCs.RPC_PLAYER_STAT:
5302 if (GetPlayerStats())
5303 GetPlayerStats().OnRPC(ctx);
5306 case ERPCs.RPC_SYNC_DISPLAY_STATUS:
5313 case ERPCs.RPC_PLAYER_SYMPTOM_ON:
5314 if (GetSymptomManager())
5316 GetSymptomManager().OnRPC(
ERPCs.RPC_PLAYER_SYMPTOM_ON, ctx);
5320 case ERPCs.RPC_PLAYER_SYMPTOM_OFF:
5321 if (GetSymptomManager())
5323 GetSymptomManager().OnRPC(
ERPCs.RPC_PLAYER_SYMPTOM_OFF, ctx);
5327 case ERPCs.RPC_DAMAGE_VALUE_SYNC:
5328 if (m_TrasferValues)
5329 m_TrasferValues.OnRPC(ctx);
5332 case ERPCs.RPC_USER_ACTION_MESSAGE:
5337 if (ctx.Read(m_UAParamMessage))
5339 string actiontext = m_UAParamMessage.param1;
5340 MessageAction(actiontext);
5344 case ERPCs.RPC_SOFT_SKILLS_SPECIALTY_SYNC:
5345 ref Param1<float> p_synch =
new Param1<float>(0);
5347 float specialty_level = p_synch.param1;
5348 GetSoftSkillsManager().SetSpecialtyLevel(specialty_level);
5351 case ERPCs.RPC_SOFT_SKILLS_STATS_SYNC:
5352 ref Param5<float, float, float, float, bool> p_debug_synch =
new Param5<float, float ,float, float, bool>(0, 0, 0, 0,
false);
5353 ctx.Read(p_debug_synch);
5354 float general_bonus_before = p_debug_synch.param1;
5355 float general_bonus_after = p_debug_synch.param2;
5356 float last_UA_value = p_debug_synch.param3;
5357 float cooldown_value = p_debug_synch.param4;
5358 float cooldown_active = p_debug_synch.param5;
5359 GetSoftSkillsManager().SetGeneralBonusBefore(general_bonus_before);
5360 GetSoftSkillsManager().SetGeneralBonusAfter(general_bonus_after);
5361 GetSoftSkillsManager().SetLastUAValue(last_UA_value);
5362 GetSoftSkillsManager().SetCoolDownValue(cooldown_value);
5363 GetSoftSkillsManager().SetCoolDown(cooldown_active);
5366 case ERPCs.RPC_WARNING_ITEMDROP:
5371 GetGame().GetMission().AddActiveInputExcludes({
"menu"});
5376 case ERPCs.RPC_WARNING_TELEPORT:
5381 GetGame().GetMission().AddActiveInputExcludes({
"menu"});
5385 case ERPCs.RPC_INIT_SET_QUICKBAR:
5386 ref Param1<int> count =
new Param1<int>(0);
5387 if (ctx.Read(count))
5389 for (
int i = 0; i < count.param1 ; i++)
5391 m_QuickBarBase.OnSetEntityRPC(ctx);
5396 case ERPCs.RPC_SYNC_THERMOMETER:
5399 if (ctx.Read(value))
5400 m_Hud.SetTemperature(value.ToString() +
"#degrees_celsius");
5405 case ERPCs.RPC_CHECK_PULSE:
5418 if (m_CheckPulseLastTarget)
5420 m_CheckPulseLastTarget.SetLastUAMessage(
ActionCheckPulse.GetPulseMessage(pulse, blood_level));
5426 case PlantType.TREE_HARD:
5427 SoundHardTreeFallingPlay();
5430 case PlantType.TREE_SOFT:
5431 SoundSoftTreeFallingPlay();
5434 case PlantType.BUSH_HARD:
5435 SoundHardBushFallingPlay();
5438 case PlantType.BUSH_SOFT:
5439 SoundSoftBushFallingPlay();
5442 case ERPCs.RPC_DEBUG_MONITOR_FLT:
5443 if (m_DebugMonitorValues)
5445 m_DebugMonitorValues.OnRPCFloat(ctx);
5449 case ERPCs.RPC_DEBUG_MONITOR_STR:
5450 if (m_DebugMonitorValues)
5452 m_DebugMonitorValues.OnRPCString(ctx);
5470 #ifdef DIAG_DEVELOPER
5471 case ERPCs.DEV_RPC_AGENT_RESET:
5475 m_AgentPool.RemoveAllAgents();
5479 case ERPCs.DEV_PLAYER_DEBUG_REQUEST:
5481 PluginRemotePlayerDebugServer plugin_remote_server = PluginRemotePlayerDebugServer.Cast(
GetPlugin(PluginRemotePlayerDebugServer));
5482 plugin_remote_server.OnRPC(ctx,
this);
5486 case ERPCs.DEV_PLAYER_DEBUG_DATA:
5488 PluginRemotePlayerDebugClient plugin_remote_client = PluginRemotePlayerDebugClient.Cast(
GetPlugin(PluginRemotePlayerDebugClient));
5489 PluginDeveloper plugin_dev = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
5490 if (plugin_dev.m_ScriptConsole)
5491 plugin_dev.m_ScriptConsole.OnRPCEx(rpc_type, ctx);
5493 plugin_remote_client.OnRPC(ctx);
5497 case ERPCs.DEV_AGENT_GROW:
5499 m_AgentPool.RemoteGrowRequestDebug(ctx);
5503 case ERPCs.RPC_ITEM_DIAG_CLOSE:
5506 mid.StopWatchRequest(
this);
5511 case ERPCs.DEV_REQUEST_UTS_DEBUG:
5513 PluginUniversalTemperatureSourceServer plugin_uts_server = PluginUniversalTemperatureSourceServer.Cast(
GetPlugin(PluginUniversalTemperatureSourceServer));
5514 plugin_uts_server.OnRPC(ctx,
this);
5518 case ERPCs.DEV_UTS_DEBUG_DATA:
5520 PluginUniversalTemperatureSourceClient plugin_uts_client = PluginUniversalTemperatureSourceClient.Cast(
GetPlugin(PluginUniversalTemperatureSourceClient));
5521 plugin_uts_client.OnRPC(ctx);
5528 case ERPCs.DEV_RPC_SERVER_SCRIPT:
5537 bool success =
GetGame().ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
5544 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
5546 PluginDeveloper dev = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
5547 if (dev.m_ScriptConsole)
5548 dev.m_ScriptConsole.OnRPCEx(rpc_type, ctx);
5552 case ERPCs.DEV_SET_DEV_ITEM:
5554 Param1<EntityAI> ent =
new Param1<EntityAI>(null);
5555 if (ctx.Read(ent) && ent.param1)
5558 mid2.RegisterDebugItem(ent.param1,
this);
5564 case ERPCs.RPC_ITEM_DIAG:
5566 Param1<EntityAI> p1 =
new Param1<EntityAI>(null);
5570 plgn.OnRPC(p1.param1, ctx);
5577 #ifdef DIAG_DEVELOPER
5578 PluginDeveloper module_rc = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
5580 module_rc.OnRPC(
this, rpc_type, ctx);
5582 PluginDeveloperSync module_rcs = PluginDeveloperSync.Cast(
GetPlugin(PluginDeveloperSync));
5584 module_rcs.OnRPC(
this, rpc_type, ctx);
5592 if (plugin_diag_menu)
5593 plugin_diag_menu.OnRPC(
this, rpc_type, ctx);
5599 super.OnGameplayDataHandlerSync();
5622 if (m_ContaminatedAreaEffectEnabled == enable)
5627 if (!m_ContaminatedAroundPlayer)
5634 m_ContaminatedAroundPlayer.SetParameter(0,
EmitorParam.BIRTH_RATE, newBirthRate);
5638 if (!m_ContaminatedAroundPlayerTiny && tinyId !=0)
5646 if (
Class.CastTo(ppeRequester, PPERequesterBank.GetRequester(ppeIdx)))
5647 ppeRequester.
Start();
5651 if (!m_AmbientContamination && soundset !=
"")
5652 PlaySoundSetLoop(m_AmbientContamination, soundset, 0.1, 0.1);
5658 if (m_ContaminatedAroundPlayer)
5660 m_ContaminatedAroundPlayer.
Stop();
5661 m_ContaminatedAroundPlayer = null;
5664 if (m_ContaminatedAroundPlayerTiny)
5666 m_ContaminatedAroundPlayerTiny.
Stop();
5667 m_ContaminatedAroundPlayerTiny = null;
5670 PPERequesterBank.GetRequester(ppeIdx).Stop(
new Param1<bool>(
true));
5673 if (m_AmbientContamination)
5674 StopSoundSet(m_AmbientContamination);
5679 m_ContaminatedAreaEffectEnabled = enable;
5684 SetContaminatedEffectEx(enable, ppeIdx, aroundId, tinyId,
"", partDynaUpdate, newBirthRate);
5690 UpdateCorpseStateVisual();
5691 if (m_CorpseState > 0 && !GetIsFrozen())
5692 SetDecayEffects(
Math.AbsInt(m_CorpseState));
5695 m_CorpseStateLocal = m_CorpseState;
5701 super.EEHealthLevelChanged(oldLevel, newLevel, zone);
5702 if (!
GetGame().IsDedicatedServer())
5706 ClearLastUAMessage();
5708 if (m_CorpseState != 0)
5719 super.OnVariablesSynchronized();
5720 if (m_ModuleLifespan)
5722 m_ModuleLifespan.SynchLifespanVisual(
this, m_LifeSpanState, m_HasBloodyHandsVisible, m_HasBloodTypeVisible,
m_BloodType);
5724 if (m_LifespanLevelLocal != m_LifeSpanState)
5726 m_LifespanLevelLocal = m_LifeSpanState;
5727 UpdateHairSelectionVisibility();
5732 if (GetBleedingManagerRemote() && IsPlayerLoaded())
5734 GetBleedingManagerRemote().OnVariablesSynchronized(GetBleedingBits());
5737 if (m_CorpseStateLocal != m_CorpseState && (IsPlayerLoaded() || IsControlledPlayer()))
5739 UpdateCorpseState();
5742 if (m_RefreshAnimStateIdx != m_LocalRefreshAnimStateIdx)
5744 RefreshHandAnimationState(396);
5745 m_LocalRefreshAnimStateIdx = m_RefreshAnimStateIdx;
5747 if (m_InsideEffectArea != m_InsideEffectAreaPrev)
5749 if (m_InsideEffectArea)
5751 OnPlayerIsNowInsideEffectAreaBeginClient();
5755 OnPlayerIsNowInsideEffectAreaEndClient();
5757 m_InsideEffectAreaPrev = m_InsideEffectArea;
5761 if (m_SyncedModifiers != m_SyncedModifiersPrev)
5763 int diff = (m_SyncedModifiers & ~m_SyncedModifiersPrev) | (~m_SyncedModifiers & m_SyncedModifiersPrev);
5778 m_SyncedModifiersPrev = m_SyncedModifiers;
5782 HandleBrokenLegsSync();
5785 ItemBase itemHands = GetItemInHands();
5794 if (m_IsRestrainedLocal != m_IsRestrained)
5796 m_IsRestrainedLocal = m_IsRestrained;
5797 OnRestrainChangeClient();
5800 if (m_IsRestrainStartedLocal != m_IsRestrainStarted)
5802 m_IsRestrainStartedLocal = m_IsRestrainStarted;
5803 OnRestrainStartedChangeClient();
5810 return (m_SyncedModifiers & m_SyncedModifiersPrev);
5815 if (m_BrokenLegState != m_LocalBrokenState)
5817 m_LocalBrokenState = m_BrokenLegState;
5820 if (m_BrokenLegState < 0)
5832 item.SetHealthMax(
"",
"");
5833 item.SetWet(item.GetWetInit());
5834 item.SetTemperatureDirect(
GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE);
5835 item.SetFrozen(
false);
5846 m_PlayerSelected =
true;
5848 m_QuickBarBase.updateSlotsCount();
5850 m_WeaponManager.SortMagazineAfterLoad();
5854#ifdef FEATURE_NETWORK_RECONCILIATION
5858 identity.Possess(
this);
5866 m_CachedPlayerID = identity.GetId();
5867 m_CachedPlayerName = identity.GetName();
5874 if (m_aQuickBarLoad)
5876 int count = m_aQuickBarLoad.Count();
5877 Param1<int> paramCount =
new Param1<int>(count);
5878 params.Insert(paramCount);
5879 for (
int i = 0; i < count; i++)
5881 m_QuickBarBase.OnSetEntityNoSync(m_aQuickBarLoad.Get(i).param1,m_aQuickBarLoad.Get(i).param2);
5882 params.Insert(m_aQuickBarLoad.Get(i));
5885 if (count > 0 &&
GetGame().IsMultiplayer())
5887 GetGame().RPC(
this,
ERPCs.RPC_INIT_SET_QUICKBAR, params,
true, identity);
5889 m_aQuickBarLoad = NULL;
5892 GetSoftSkillsManager().InitSpecialty(GetStatSpecialty().
Get());
5893 GetModifiersManager().SetModifiers(
true);
5897 if (
GetGame().IsMultiplayer())
5900 if (m_ProcessUIWarning)
5902 GetGame().RPCSingleParam(
this,
ERPCs.RPC_WARNING_ITEMDROP, null,
true, identity);
5903 m_ProcessUIWarning =
false;
5906 GetGame().GetMission().SyncRespawnModeInfo(identity);
5933 GetGame().GetMission().ResetGUI();
5938 m_DeathCheckTimer =
new Timer();
5939 m_DeathCheckTimer.Run(0.1,
this,
"CheckDeath", null,
true);
5943 int characterCount =
GetGame().GetMenuData().GetCharactersCount() - 1;
5944 int idx =
GetGame().GetMenuData().GetLastPlayedCharacter();
5945 if (idx ==
GameConstants.DEFAULT_CHARACTER_MENU_ID || idx > characterCount)
5950 GetGame().GetMission().EnableAllInputs(
true);
5953 m_PresenceNotifier.Init(
this);
5954 #ifdef DIAG_DEVELOPER
5955 m_TargetTemperatureDiag = PluginTargetTemperature.Cast(
GetPlugin(PluginTargetTemperature));
5956 m_TargetTemperatureDiag.Init(
this);
5958 OnGameplayDataHandlerSync();
5962 m_Bot =
new Bot(
this);
5969 super.SimulateDeath(state);
5971 m_UndergroundHandler = null;
5972 m_UndergroundBunkerHandler = null;
5973 if (m_EffectWidgets)
5982 g_Game.GetMenuData().SaveCharacter(
false,
true);
5983 g_Game.GetMenuData().SetCharacterName(
g_Game.GetMenuData().GetLastPlayedCharacter(),
g_Game.GetMenuDefaultCharacterData(
false).GetCharacterName());
5984 g_Game.GetMenuData().SaveCharactersLocal();
5991 BurlapSackCover attachment;
5994 PPERequester_BurlapSackEffects req;
5995 if (
Class.CastTo(req,PPERequesterBank.GetRequester(PPERequesterBank.REQ_BURLAPSACK)))
6001 else if (req.IsRequesterRunning())
6003 PPERequesterBank.GetRequester(PPERequester_BurlapSackEffects).Stop();
6019 if (item && item.IsObstructingVoice())
6021 item.MutePlayer(
this,
true);
6025 GetGame().SetVoiceEffect(
this, VoiceEffectMumbling,
false);
6026 GetGame().SetVoiceEffect(
this, VoiceEffectObstruction,
false);
6034 m_EffectWidgets.ResetMaskUpdateCount();
6035 float resistance = 0;
6036 if (mask.HasIntegratedFilter() || mask.IsExternalFilterAttached())
6037 resistance = 1 - mask.GetFilterQuantity01();
6041 m_EffectWidgets.IncreaseMaskUpdateCount();
6049 if (m_EffectWidgets)
6054 UpdateMaskBreathWidget(mask,
true);
6064 if (m_EffectWidgets)
6069 if (m_EffectWidgets.m_MaskWidgetUpdateCount < 2 && callback.GetLength() > 2 && playback_time > 0.5 )
6070 UpdateMaskBreathWidget(mask);
6079 if (super.OnInputUserDataProcess(userDataType, ctx))
6082 if (m_QuickBarBase.OnInputUserDataProcess(userDataType, ctx))
6085 if (m_WeaponManager.OnInputUserDataProcess(userDataType, ctx))
6088 if (HandleRemoteItemManipulation(userDataType, ctx))
6094 if (TogglePlacingServer(userDataType, ctx))
6097 if (ResetADSPlayerSync(userDataType, ctx))
6104 if (ctx.Read(uid) && ctx.Read(mute))
6106 GetGame().MutePlayer(uid, GetIdentity().GetPlainId(), mute);
6113 return m_EmoteManager.OnInputUserDataProcess(userDataType, ctx);
6116 return ReadLiftWeaponRequest(userDataType, ctx);
6118 if (m_ActionManager)
6119 return m_ActionManager.OnInputUserDataProcess(userDataType, ctx);
6125 float blood = GetHealth(
"GlobalHealth",
"Blood");
6126 float blood_scale_normalized =
Math.InverseLerp(
PlayerConstants.BLOOD_THRESHOLD_FATAL, GetMaxHealth(
"",
"Blood"), blood);
6127 blood_scale_normalized =
Math.Clamp(blood_scale_normalized,0,1);
6138 bool use_stack_max =
false;
6141 if (!ctx.Read(type))
6146 if (!ctx.Read(item1))
6150 if (item1 && dst.ReadFromContext(ctx))
6154 if (ctx.Read(dummy))
6155 item1.SplitItemToInventoryLocation(dst);
6157 item1.SplitIntoStackMaxToInventoryLocation(dst);
6163 if (!ctx.Read(item1))
6165 if (!ctx.Read(item2))
6167 if (!ctx.Read(use_stack_max))
6169 if (!ctx.Read(slot_id))
6172 if (type == -1 && item1 && item2)
6174 item1.CombineItems(item2, use_stack_max);
6176 else if (type == 1 && item1)
6179 item1.SplitIntoStackMax(item2, slot_id,
this);
6181 item1.SplitItem(
this);
6183 else if (type == 2 && item1)
6190 item1.SplitIntoStackMaxCargo(item2, slot_id, row, col);
6192 else if (type == 3 && item1)
6194 item1.SplitIntoStackMaxHands(
this);
6206 return ItemBase.Cast(humanInventory.GetEntityInHands());
6221 return SpawnAI(object_name, pos);
6227 Math3D.MatrixIdentity4(mtx);
6229 inv_loc.SetGround(null, mtx);
6233 if (
g_Game.IsKindOf(object_name,
"Boat"))
6237 return EntityAI.Cast(
GetGame().CreateObjectEx(object_name, inv_loc.GetPos(), flags));
6245 vector posRandom = MiscGameplayFunctions.GetRandomizedPositionVerifiedPlayer(
this,raycastDistance,radius,
this);
6246 return SpawnEntityOnGroundPos(object_name,posRandom);
6252 return SpawnEntityOnGroundPos(object_name, position);
6268 bool can_be_dropped = CanDropEntity(item);
6271 can_be_dropped = PredictiveDropEntity(item);
6275 pos_spawn[0] = pos_spawn[0] +
Math.RandomFloat(-0.2, 0.2);
6276 pos_spawn[2] = pos_spawn[2] +
Math.RandomFloat(-0.2, 0.2);
6278 item.SetPosition(pos_spawn);
6279 item.PlaceOnSurface();
6280 return can_be_dropped;
6307 string t = src.GetType();
6310 bool locked =
GetGame().HasInventoryJunctureDestination(
this, loc);
6313 Print(
"Warning: Split: CreateCopyOfItemInInventory - Cannot create entity at locked inventory at loc=" +
InventoryLocation.DumpToStringNullSafe(loc));
6319 MiscGameplayFunctions.TransferItemProperties(src, dst);
6321 GetGame().RemoteObjectTreeCreate(dst);
6323 Print(
"CreateCopyOfItemInInventory - created " + dst.GetName() +
" at loc=" +
InventoryLocation.DumpToStringNullSafe(loc));
6332 return CreateCopyOfItemInInventoryOrGroundEx(src,
false);
6337 ItemBase dst = CreateCopyOfItemInInventory(src);
6340 dst =
ItemBase.Cast(SpawnEntityOnGroundPos(src.GetType(),
this.GetPosition()));
6341 dst.PlaceOnSurface();
6342 dst.SetResultOfSplit(markItemAsSplitResult);
6343 MiscGameplayFunctions.TransferItemProperties(src, dst);
6362 GetGame().ChatMP(
this, text, style);
6373 Message(text,
"colorStatusChannel");
6379 Message(text,
"colorAction");
6385 Message(text,
"colorFriendly");
6391 Message(text,
"colorImportant");
6402 GetGame().GetUIManager().CloseAll();
6403 GetGame().GetMission().RemoveActiveInputExcludes({
"inventory"},
false);
6404 GetGame().GetMission().RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
6421 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
6426 for (
int i = 0; i < items.Count(); i++)
6435 ItemBase item_in_hands =
ItemBase.Cast(GetHumanInventory().GetEntityInHands());
6439 LocalDestroyEntityInHands();
6450 int count = itemsArray.Count();
6452 for (
int i = 0; i < itemsArray.Count(); i++)
6454 Class.CastTo(item, itemsArray.Get(i));
6456 if (item && !item.IsInherited(SurvivorBase))
6458 ServerDropEntity(item);
6466 GetGame().ObjectGetType(
this, type);
6478 m_ModuleLifespan.UpdateLifespan(
this,
true);
6483 if (!HasCoveredFaceForShave() && GetLifeSpanState())
6496 super.OnParticleEvent(pEventType ,pUserString, pUserInt);
6498 if (!
GetGame().IsDedicatedServer())
6500 if (pUserInt == 123456)
6503 int boneIdx = player.GetBoneIndexByName(
"Head");
6519 eff.SetAutodestroy(
true);
6522 player.AddChild(p, boneIdx);
6531 if (!ToDelete() && IsAlive() && !IsSwimming() && !m_IsDrowning)
6541 if (m_AddModifier != -1)
6543 HumanCommandAdditives ad = GetCommandModifier_Additives();
6545 ad.StartModifier(m_AddModifier);
6558 switch (m_BreathVapour)
6574 AddChild(p, boneIdx);
6582 vector pos = GetBonePositionWS(index);
6583 float depth =
g_Game.GetWaterDepth(pos);
6589 else if (IsUnconscious())
6599 if (show_state != m_LifeSpanState)
6600 state_changed =
true;
6601 m_LifeSpanState = show_state;
6608 UpdateHairSelectionVisibility();
6614 return m_LifeSpanState;
6619 return m_LastShavedSeconds;
6624 m_LastShavedSeconds = last_shaved_seconds;
6629 return IsExclusionFlagPresent(GetFaceCoverageShaveValues());
6635 set<int> ret =
new set<int>;
6636 ret.Insert(EAttExclusions.SHAVING_MASK_ATT_0);
6637 ret.Insert(EAttExclusions.SHAVING_HEADGEAR_ATT_0);
6645 return m_HasBloodyHandsVisible;
6650 return m_HasBloodyHandsVisible;
6655 SetBloodyHandsBase(show);
6660 SetBloodyHandsBase(type);
6663 private void SetBloodyHandsBase(
int type)
6665 m_HasBloodyHandsVisible = type;
6668 #ifdef DIAG_DEVELOPER
6670 if (IsControlledPlayer())
6679 int GetBloodyHandsPenaltyAgents()
6681 if (HasBloodyHands())
6686 float randomValue =
Math.RandomFloat01();
6687 if (GetBloodyHandsPenaltyChancePerAgent(
eAgents.SALMONELLA) >= randomValue)
6696 float GetBloodyHandsPenaltyChancePerAgent(
eAgents type)
6699 if (m_BloodyHandsPenaltyChancePerAgent.Find(type, value))
6706 void SetBloodyHandsPenaltyChancePerAgent(
eAgents type,
float amount)
6708 float storedValue = GetBloodyHandsPenaltyChancePerAgent(type);
6709 if (amount > storedValue)
6710 m_BloodyHandsPenaltyChancePerAgent.Set(type,
Math.Clamp(amount, 0.0, 1.0));
6713 void ClearBloodyHandsPenaltyChancePerAgent(
eAgents type)
6715 m_BloodyHandsPenaltyChancePerAgent.Set(type, 0.0);
6718 bool HasBloodTypeVisible()
6720 return m_HasBloodTypeVisible;
6723 void SetBloodTypeVisible(
bool show)
6725 m_HasBloodTypeVisible = show;
6734 void SetBloodType(
int blood_type)
6746 return m_SoftSkillsManager;
6751 if (IsPlayerSelected() && !IsAlive())
6753 SimulateDeath(
true);
6754 m_DeathCheckTimer.Stop();
6765 int GetNoisePresenceInAI()
6767 if (m_PresenceNotifier)
6769 return m_PresenceNotifier.GetNoisePresence();
6778 return (m_PersistentFlags & bit);
6784 m_PersistentFlags = (m_PersistentFlags | bit);
6786 m_PersistentFlags = ((~bit) & m_PersistentFlags);
6793 int GetStoreLoadVersion()
6795 return m_StoreLoadVersion;
6801 if (
GetGame().SaveVersion() < 102)
6803 ctx.Write(ACT_STORE_SAVE_VERSION);
6806 super.OnStoreSave(ctx);
6808 GetHumanInventory().OnStoreSave(ctx);
6809 OnStoreSaveLifespan(ctx);
6813 GetPlayerStats().SaveStats(ctx);
6814 m_ModifiersManager.OnStoreSave(ctx);
6815 m_AgentPool.OnStoreSave(ctx);
6816 GetSymptomManager().OnStoreSave(ctx);
6817 if (GetBleedingManagerServer())
6819 GetBleedingManagerServer().OnStoreSave(ctx);
6821 m_PlayerStomach.OnStoreSave(ctx);
6822 ctx.Write(GetBrokenLegs());
6824 SaveAreaPersistenceFlag(ctx);
6826 HumanCommandLadder ladder = GetCommand_Ladder();
6830 ctx.Write(ladder.GetLogoutPosition());
6838 arrowManager.Save(ctx);
6845 if (GetModifiersManager())
6846 SetPersistentFlag(
PersistentFlag.AREA_PRESENCE, GetModifiersManager().IsModifierActive(
eModifiers.MDF_AREAEXPOSURE));
6847 ctx.Write(m_PersistentFlags);
6859 if (!ctx.Read(m_StoreLoadVersion))
6863 if (!super.OnStoreLoad(ctx, version))
6867 if (!GetHumanInventory().
OnStoreLoad(ctx, version))
6870 if (!OnStoreLoadLifespan(ctx, version))
6875 if (!GetPlayerStats().
LoadStats(ctx, version))
6877 Print(
"---- failed to load PlayerStats ----");
6881 if (!m_ModifiersManager.OnStoreLoad(ctx, version))
6883 Print(
"---- failed to load ModifiersManager, read fail ----");
6887 if (!m_AgentPool.OnStoreLoad(ctx, version))
6889 Print(
"---- failed to load AgentPool, read fail ----");
6893 if (!GetSymptomManager().
OnStoreLoad(ctx, version))
6895 Print(
"---- failed to load SymptomManager, read fail ----");
6899 if (!GetBleedingManagerServer().
OnStoreLoad(ctx, version))
6901 Print(
"---- failed to load BleedingManagerServer, read fail ----");
6905 if (!m_PlayerStomach.OnStoreLoad(ctx, version))
6907 Print(
"---- failed to load PlayerStomach, read fail ----");
6914 if (!ctx.Read(m_BrokenLegState))
6920 if (!ctx.Read(m_LocalBrokenState))
6927 if (version >= 125 && (!ctx.Read(m_PersistentFlags)))
6929 Print(
"---- failed to load Persistent Flags, read fail ----");
6936 if (!ctx.Read(onLadder))
6944 if (!ctx.Read(position))
6950 if (!hive || !hive.CharacterIsLoginPositionChanged(
this))
6960 arrowManager.Load(ctx);
6964 Print(
"---- PlayerBase OnStoreLoad SUCCESS ----");
6970 GetHumanInventory().OnAfterStoreLoad();
6972 m_EmoteManager.AfterStoreLoad();
6974 if (GetPlayerStats())
6975 GetPlayerStats().OnAfterStoreLoad();
6982 vector safePos = pra.GetRandomSafePos3D(currentPos);
6983 if (MiscGameplayFunctions.TeleportPlayerToSafeLocation3D(
this,safePos) &&
m_AdminLog)
6984 m_AdminLog.PlayerTeleportedLog(
this,currentPos,safePos,
"Spawning in Player Restricted Area: " + pra.areaName);
6990 ctx.Write(m_LifeSpanState);
6991 ctx.Write(m_LastShavedSeconds);
6992 ctx.Write(m_HasBloodyHandsVisible);
6993 ctx.Write(m_HasBloodTypeVisible);
6999 int lifespan_state = 0;
7000 if (!ctx.Read(lifespan_state))
7002 m_LifeSpanState = lifespan_state;
7004 int last_shaved = 0;
7005 if (!ctx.Read(last_shaved))
7007 m_LastShavedSeconds = last_shaved;
7011 bool bloody_hands_old;
7012 if (!ctx.Read(bloody_hands_old))
7014 m_HasBloodyHandsVisible = bloody_hands_old;
7018 int bloody_hands = 0;
7019 if (!ctx.Read(bloody_hands))
7021 m_HasBloodyHandsVisible = bloody_hands;
7025 bool blood_visible =
false;
7026 if (!ctx.Read(blood_visible))
7028 m_HasBloodTypeVisible = blood_visible;
7031 if (!ctx.Read(blood_type))
7039 void UpdatePlayerMeasures()
7041 int hour, minute, second;
7045 if (m_AnalyticsTimer)
7048 data.m_CharacterId =
g_Game.GetDatabaseID();
7049 data.m_TimeInterval = m_AnalyticsTimer.GetRemaining();
7050 data.m_DaytimeHour = hour;
7051 data.m_PositionStart = m_PlayerOldPos;
7053 data.m_DistanceOnFoot = distance;
7068 if (m_AnalyticsTimer)
7069 m_AnalyticsTimer.Run(60,
this,
"UpdatePlayerMeasures", null,
true);
7072 ResetConstructionActionData();
7077 Debug.Log(
"Player reconnected:"+this.
ToString(),
"Reconnect");
7081 ResetConstructionActionData();
7086 Debug.Log(
"Player disconnected:"+this.
ToString(),
"Connect");
7094 data.m_CharacterId =
g_Game.GetDatabaseID();
7095 data.m_Reason =
"Disconnected";
7098 if (m_AnalyticsTimer)
7099 m_AnalyticsTimer.Stop();
7100 UpdatePlayerMeasures();
7102 SetPlayerDisconnected(
true);
7107 GetModifiersManager().SetModifiers(enable);
7112 PluginTransmissionAgents plugin = PluginTransmissionAgents.Cast(
GetPlugin(PluginTransmissionAgents));
7114 float temperature = 0;
7120 if (pollution & EPollution.HEAVYMETAL)
7121 data.m_Agents = data.m_Agents |
eAgents.HEAVYMETAL;
7124 data.m_Agents = data.m_Agents |
eAgents.CHOLERA;
7128 m_PlayerStomach.AddToStomach(Liquid.GetLiquidClassname(
LIQUID_WATER), data.m_Amount, 0 , data.m_Agents, temperature);
7134 if (!edibleItem || !edibleItem.CanBeConsumed())
7139 data.m_Agents = edibleItem.FilterAgents(data.m_Agents | edibleItem.GetAgents());
7140 temperature = edibleItem.GetTemperature();
7145 if (edibleItem.IsLiquidContainer())
7147 int liquidType = edibleItem.GetLiquidType();
7148 string liquidClassName = Liquid.GetLiquidClassname(liquidType);
7149 if (liquidClassName.Length() == 0)
7150 Error(
"Error! Trying to add unknown liquid to stomach with item=" +
Object.GetDebugName(edibleItem) +
" data.m_Type=" + data.m_Type +
" liquid_type=" + liquidType);
7152 m_PlayerStomach.AddToStomach(liquidClassName, data.m_Amount, 0, data.m_Agents, temperature);
7158 foodStageType = edibleItem.
GetFoodStage().GetFoodStageType();
7160 m_PlayerStomach.AddToStomach(data.m_Source.GetType(), data.m_Amount, foodStageType, data.m_Agents, temperature);
7163 edibleItem.Consume(data.m_Amount,
this);
7172 void ShowUnconsciousScreen(
bool show)
7177 GetGame().GetUIManager().ScreenFadeIn(0,
"You are Unconscious", FadeColors.BLACK, FadeColors.WHITE);
7182 GetGame().GetUIManager().ScreenFadeOut(0);
7188 override void RequestSoundEventEx(
EPlayerSoundEventID id,
bool from_server_and_client =
false,
int param = 0)
7192 PlaySoundEventEx(
id,
false,
false, param);
7195 SendSoundEventEx(
id, param);
7198 override void RequestSoundEvent(
EPlayerSoundEventID id,
bool from_server_and_client =
false)
7200 RequestSoundEventEx(
id, from_server_and_client);
7205 SendSoundEventEx(
id);
7215 m_SoundEventParam = param;
7218 if (!
GetGame().IsMultiplayer())
7228 if (m_SoundEvent != 0 && m_SoundEventSent)
7231 m_SoundEventParam = 0;
7232 m_SoundEventSent =
false;
7239 if (m_SoundEvent!= 0 && !m_SoundEventSent)
7241 m_SoundEventSent =
true;
7247 if (m_ReplaceSoundEventHandler)
7248 return m_ReplaceSoundEventHandler.PlayReplaceSound(soundEventID, soundType, param);
7255 return PlaySoundEventEx(
id, from_anim_system, is_from_server);
7260 if (!m_PlayerSoundEventHandler)
7263 return m_PlayerSoundEventHandler.PlayRequestEx(
id, is_from_server, param);
7268 return m_PlayerSoundEventHandler;
7276 m_BleedingSourceCount++;
7277 if (IsControlledPlayer())
7279 if (!
GetGame().IsDedicatedServer())
7284 dis_elm.SetValue(GetBleedingSourceCount());
7296 m_BleedingSourceCount--;
7300 if (GetBleedingSourceCount() > 0)
7310 if (IsControlledPlayer())
7312 if (!
GetGame().IsDedicatedServer())
7318 dis_elm.SetValue(GetBleedingSourceCount());
7327 OnBleedingSourceRemoved();
7332 return m_BleedingSourceCount;
7338 #ifdef DIAG_DEVELOPER
7341 GetStomach().ClearContents();
7343 DamageSystem.ResetAllZones(
this);
7344 GetModifiersManager().ResetAll();
7347 if (m_BleedingManagerServer)
7348 m_BleedingManagerServer.RemoveAllSources();
7351 if (GetPlayerStats())
7353 int bloodType = GetStatBloodType().Get();
7354 GetPlayerStats().ResetAllStats();
7355 GetStatBloodType().Set(bloodType);
7360 m_AgentPool.RemoveAllAgents();
7366 if (IsUnconscious())
7372 GetStatWater().Set(GetStatWater().
GetMax());
7373 GetStatEnergy().Set(GetStatEnergy().
GetMax());
7377 FixAllInventoryItems();
7382 ClearBloodyHandsPenaltyChancePerAgent(
eAgents.SALMONELLA);
7390 HumanCommandVehicle vehCmd = GetCommand_Vehicle();
7393 Transport transport = vehCmd.GetTransport();
7395 transport.FixEntity();
7402 if (m_SoundEvent != 0)
7404 PlaySoundEventEx(m_SoundEvent,
false,
true,m_SoundEventParam);
7406 m_SoundEventParam = 0;
7410 if (m_PerformedAnimActionID == -1)
7412 if (m_PerformedActionSounds.Count() == 0)
7421 m_PerformedActionSounds.Clear();
7427 if (
GetGame().IsClient())
return;
7428 RequestSoundEvent(1234);
7434 if (state != m_StaminaState)
7436 m_StaminaState = state;
7444 return m_StaminaState;
7449 m_QuickBarBase.updateSlotsCount();
7455 if (GetPlayerState() ==
EPlayerStates.ALIVE && !IsRestrained())
7457 GetHive().CharacterSave(
this);
7469 if (
Math.RandomFloat01() > chance)
7472 GetGame().GetPlayers(m_ServerPlayers);
7473 float dist_check = distance * distance;
7474 PluginTransmissionAgents plugin = PluginTransmissionAgents.Cast(
GetPlugin(PluginTransmissionAgents));
7476 foreach (Man target: m_ServerPlayers)
7478 if (
vector.DistanceSq(GetWorldPosition(), target.GetWorldPosition()) < dist_check && target !=
this)
7487 SpreadAgentsEx(3,1);
7493 return m_AgentPool.GetAgents();
7499 m_AgentPool.RemoveAgent(agent_id);
7505 m_AgentPool.RemoveAllAgents();
7512 m_AgentPool.AddAgent(agent,count);
7518 return m_AgentPool.GetSingleAgentCount(agent_id);
7524 int max_count = PluginTransmissionAgents.GetAgentMaxCount(agent_id);
7525 return m_AgentPool.GetSingleAgentCount(agent_id) / max_count;
7530 return m_AgentPool.GetTotalAgentCount();
7535 m_AgentPool.PrintAgents();
7540 m_AgentPool.ImmuneSystemTick(value, deltaT);
7550 m_AgentPool.SetTemporaryResistance(agent, time);
7555 return m_AgentPool.GetTemporaryResistance(agent);
7561 float min_distance = 0.5;
7564 vector to = from + (
GetGame().GetCurrentCameraDirection() * min_distance);
7567 int contactComponent;
7569 DayZPhysics.RaycastRV(from, to, contactPos, contactDir, contactComponent, NULL, NULL, NULL,
false,
true);
7578 return (!mask || (mask && mask.AllowFoodConsumption()));
7589 return m_ModifiersManager;
7594 if (!m_StatWater && GetPlayerStats())
7603 if (!m_StatToxicity && GetPlayerStats())
7607 return m_StatToxicity;
7612 if (!m_StatEnergy && GetPlayerStats())
7616 return m_StatEnergy;
7621 if (!m_StatHeatComfort && GetPlayerStats())
7625 return m_StatHeatComfort;
7630 if (!m_StatTremor && GetPlayerStats())
7634 return m_StatTremor;
7639 if (!m_StatWet && GetPlayerStats())
7648 if (!m_StatDiet && GetPlayerStats())
7657 if (!m_StatStamina && GetPlayerStats())
7661 return m_StatStamina;
7666 if (!m_StatSpecialty && GetPlayerStats())
7670 return m_StatSpecialty;
7675 if (!m_StatBloodType && GetPlayerStats())
7679 return m_StatBloodType;
7684 if (!m_StatHeatBuffer && GetPlayerStats())
7688 return m_StatHeatBuffer;
7693 m_HeatBufferDynamicMax = value;
7699 return m_HeatBufferDynamicMax;
7704 m_HasHeatBuffer = show;
7710 m_HeatBufferStage = heatbufferStage;
7717 return m_UALastMessage;
7722 m_UALastMessage = pMsg;
7724 if (m_UALastMessageTimer.IsRunning())
7726 m_UALastMessageTimer.Stop();
7729 m_UALastMessageTimer.Run(
PlayerConstants.LAST_UA_MSG_LIFETIME,
this,
"ClearLastUAMessage", null);
7734 if (m_UALastMessageTimer.IsRunning())
7736 m_UALastMessageTimer.Stop();
7739 m_UALastMessage =
"";
7748 m_InjuryHandler.CheckValue(
true);
7753#ifdef DIAG_DEVELOPER
7754 if (m_Bot && action_id >
EActions.PLAYER_BOT_INTERNAL_START && action_id <
EActions.PLAYER_BOT_END)
7756 m_Bot.StartAction(action_id);
7761 if (super.OnAction(action_id, player, ctx))
7769 GetGame().GizmoSelectObject(
this);
7772 GetGame().GizmoSelectPhysics(GetPhysics());
7795 PluginTransmissionAgents pluginTransmissionAgents = PluginTransmissionAgents.Cast(
GetPlugin(PluginTransmissionAgents));
7797#ifdef DIAG_DEVELOPER
7803 map<int, string> agentList = pluginTransmissionAgents.GetSimpleAgentList();
7807 foreach (
int tid,
string tname : agentList)
7809 string injectName =
"Inject " + tname;
7810 string removeName =
"Remove " + tname;
7820#ifdef DIAG_DEVELOPER
7825 int cnt = e.GetVariableCount();
7828 for (i = 0; i < cnt; i++)
7830 if (!e.GetVariableValue(null, i, val))
7833 if (val <=
EActions.PLAYER_BOT_INTERNAL_START)
7836 if (val ==
EActions.PLAYER_BOT_START)
7842 if (val >=
EActions.PLAYER_BOT_END)
7845 string name = e.GetVariableName(i);
7854 super.GetDebugActions(outputList);
7856 if (Gizmo_IsSupported())
7873 super.OnSyncJuncture(pJunctureID, pCtx);
7881 m_InjuryHandler.SetInjuryCommandParams(enable, level);
7884 GetSymptomManager().SetAnimation(pCtx);
7887 OnQuickbarSetEntityRequest(pCtx);
7890 GetInventory().OnInventoryJunctureFromServer(pCtx);
7893 GetInventory().OnInventoryJunctureRepairFromServer(pCtx);
7896 GetInventory().OnInventoryJunctureFailureFromServer(pCtx);
7901 m_ActionManager.OnSyncJuncture(pJunctureID,pCtx);
7906 m_WeaponManager.OnSyncJuncture(pJunctureID,pCtx);
7912 GetSymptomManager().SetAnimation(pCtx);
7918 if (GetAimingModel() && IsFireWeaponRaised())
7920 GetAimingModel().RequestKuruShake(amount);
7925 m_EmoteManager.OnSyncJuncture(pJunctureID, pCtx);
7928 SetLiftWeapon(pJunctureID, pCtx);
7937 m_BrokenLegsJunctureReceived =
true;
7953 SetGetInVehicleDebug(vehicle);
7961 return m_ItemsToDelete.Count() > 0;
7968 AddItemToDelete(item);
7975 item.SetPrepareToDelete();
7976 m_ItemsToDelete.Insert(item);
7982 return !(GetThrowing().IsThrowingAnimationPlaying() || GetDayZPlayerInventory().IsProcessing() || (
GetActionManager() &&
GetActionManager().GetRunningAction()));
7992 int count = m_ItemsToDelete.Count();
7995 if (CanDeleteItems())
8002 for (
int i = count - 1; i >= 0 ; i--)
8004 itemToDelete = m_ItemsToDelete.Get(i);
8005 if (itemToDelete != null)
8007 itemToDelete.GetInventory().GetCurrentInventoryLocation(il);
8010 if (itemToDelete == null || (GetItemInHands() == null && il.GetType() ==
InventoryLocationType.UNKNOWN))
8012 m_ItemsToDelete.Remove(i);
8018 for (
int j = count - 1; j >= 0 ; j--)
8020 itemToDelete = m_ItemsToDelete.Get(j);
8021 if (itemToDelete == null)
8023 m_ItemsToDelete.Remove(j);
8027 itemToDelete.Delete();
8028 m_ItemsToDelete.Remove(j);
8041 if (action && action.IsFullBody(
this) && action.IsCameraLockOnPerform())
8043 if (!m_IsHeadingRestricted)
8045 m_IsHeadingRestricted =
true;
8046 m_HeadingRestrictData.InitData(pModel.m_fHeadingAngle, action.GetCameraLRAngle());
8052 m_IsHeadingRestricted =
false;
8058 HumanItemAccessor hia = GetItemAccessor();
8066 m_fLastHeadingDiff = 0;
8071 return super.HeadingModel(pDt, pModel);
8076 return m_InventorySoftLockCount > 0;
8083 m_InventorySoftLockCount++;
8085 m_InventorySoftLockCount--;
8087 if (m_InventorySoftLockCount < 0)
8088 m_InventorySoftLockCount = 0;
8090 m_InventorySoftLocked = IsInventorySoftLocked();
8095 if (m_aQuickBarLoad)
8101 return m_LiftWeapon_player;
8106 return m_ObstructWeapon_player;
8116 float obstruction = GetWeaponObstruction();
8120 if (obstruction <= 0.0)
8125 float penetration = weapon.GetObstructionPenetrationDistance(obstruction);
8126 bool inSights = m_CameraIronsight || m_CameraOptics;
8131 return penetration > 0.040;
8137 return penetration > 0.005;
8148 SetLiftWeapon(state, obstruct);
8160 SetLiftWeapon(state, obstruct);
8167 m_ProcessLiftWeaponState = state;
8168 m_ProcessLiftWeapon =
true;
8169 m_ProcessObstructWeapon = obstruct;
8175 HumanCommandWeapons hcw;
8177 bool liftChange = m_LiftWeapon_player != state;
8178 bool obstructChange =
Math.AbsFloat(m_ObstructWeapon_player-obstruct) > 0.03;
8181 m_LiftWeapon_player = state;
8182 m_ObstructWeapon_player = obstruct;
8186 GetWeaponManager().OnLiftWeapon();
8189 if (!liftChange && !obstructChange)
8199 if (!ctx.CanStoreInputUserData())
8207 ctx.Write(obstruct);
8222 bool limited = weap.LiftWeaponCheckEx(
this, obstruct, hitObject);
8223 if (weap.UseWeaponObstruction(
this, obstruct, hitObject))
8232 obstruct =
Math.Clamp( obstruct, 0, 1 );
8234 if (m_LiftWeapon_player != limited || m_ObstructWeapon_player != obstruct)
8236 SendLiftWeaponSync(limited, obstruct);
8239 else if (m_LiftWeapon_player || m_ObstructWeapon_player > 0)
8241 SendLiftWeaponSync(
false);
8248 if (m_ProcessLiftWeapon)
8250 bool liftChange = m_LiftWeapon_player != m_ProcessLiftWeaponState;
8253 GetWeaponManager().OnLiftWeapon();
8255 m_LiftWeapon_player = m_ProcessLiftWeaponState;
8256 m_ObstructWeapon_player = m_ProcessObstructWeapon;
8257 m_ProcessLiftWeapon =
false;
8266 super.HideClothing(optic, state);
8277 if (optic && optic.GetCurrentStepFOV() <
GameConstants.DZPLAYER_CAMERA_FOV_IRONSIGHTS)
8283 SetInvisibleRecursive(
true,
this,clothingArray);
8293 SetInvisibleRecursive(
false,
this,clothingArray);
8305 super.SetDeathDarknessLevel(duration, tick_time);
8307 if (IsControlledPlayer())
8309 float actual_tick = tick_time;
8310 if (GetDamageDealtEffect())
8311 m_DamageDealtEffect = null;
8313 if (GetFlashbangEffect())
8314 m_FlashbangEffect = null;
8318 progress = 1 - ((duration - m_DeathDarkeningCurrentTime) / duration);
8320 m_DeathDarkeningCurrentTime += actual_tick;
8322 if (!IsAlive() && IsPlayerSelected())
8324 m_DeathDarkeningParam.param1 = progress;
8325 PPERequesterBank.GetRequester(PPERequester_DeathDarkening).Start(m_DeathDarkeningParam);
8328 if (m_DeathDarkeningCurrentTime >= duration)
8330 StopDeathDarkeningEffect();
8335 StopDeathDarkeningEffect();
8343 if ((m_EmoteManager.m_Callback && m_EmoteManager.m_Callback.m_IsFullbody) || m_EmoteManager.m_IsSurrendered)
8354 m_EmoteManager.EndSurrenderRequest(data);
8360 return m_EmoteManager.m_IsSurrendered;
8367 return m_PlayerLoaded;
8374 if (IsInFBEmoteState() && IsControlledPlayer() && IsPlayerSelected())
8376 OverrideSlidePoseAngle(
Math.PI2);
8378 else if (!IsInFBEmoteState() && IsControlledPlayer() && IsPlayerSelected())
8380 OverrideSlidePoseAngle(m_OriginalSlidePoseAngle);
8392 isActionPossible =
false;
8393 Magazine mag = Magazine.Cast(item);
8397 if (GetWeaponManager().CanDetachMagazine(wpn, mag))
8400 isActionPossible =
true;
8415 if (CanRedirectToWeaponManager(item,can_detach))
8418 if (can_detach && target.GetInventory().FindFreeLocationFor(item, flags, il))
8420 return GetWeaponManager().DetachMagazine(il);
8424 return super.PredictiveTakeEntityToTargetInventory(target, flags, item);
8430 if (CanRedirectToWeaponManager(item,can_detach))
8433 if (can_detach && GetInventory().FindFreeLocationFor(item, flags, il))
8435 return GetWeaponManager().DetachMagazine(il);
8439 return super.PredictiveTakeEntityToInventory(flags, item);
8445 Magazine mag = Magazine.Cast(item);
8446 if (parentWpn && mag)
8448 if (GetWeaponManager().CanAttachMagazine(parentWpn, mag))
8449 return GetWeaponManager().AttachMagazine(mag);
8453 return super.PredictiveTakeEntityToTargetAttachment(target, item);
8459 Magazine mag = Magazine.Cast(item);
8460 if (parentWpn && mag)
8462 if (target.CanReceiveAttachment(item,slot) && GetWeaponManager().CanAttachMagazine(parentWpn, mag))
8463 return GetWeaponManager().AttachMagazine(mag);
8467 return super.PredictiveTakeEntityToTargetAttachmentEx(target, item,slot);
8473 if (CanRedirectToWeaponManager(item,can_detach))
8478 return GetWeaponManager().DetachMagazine(il);
8482 return super.PredictiveTakeEntityToTargetCargo(target,item);
8488 if (CanRedirectToWeaponManager(item, can_detach))
8493 dst.SetCargoAuto(cargo, item, row, col, item.GetInventory().GetFlipCargo());
8495 return GetWeaponManager().DetachMagazine(dst);
8499 return super.PredictiveTakeEntityToTargetCargoEx (cargo, item, row, col);
8505 if (CanRedirectToWeaponManager(item,can_detach))
8510 Math3D.MatrixIdentity4(m4);
8515 il.SetGround(item, m4);
8516 return GetWeaponManager().DetachMagazine(il);
8520 return super.PredictiveDropEntity(item);
8526 Magazine swapmag1 = Magazine.Cast(item1);
8527 Magazine swapmag2 = Magazine.Cast(item2);
8529 if (swapmag1 && swapmag2)
8533 if (
Class.CastTo(parentWpn, swapmag1.GetHierarchyParent()))
8535 if (GetWeaponManager().CanSwapMagazine(parentWpn, swapmag2))
8537 Print(
"[inv] PlayerBase.PredictiveSwapEntities: swapping mag1=" + swapmag1 +
" to parent wpn=" + parentWpn +
" of mag1=" + swapmag1);
8538 return GetWeaponManager().SwapMagazine(swapmag2);
8542 Print(
"[inv] PlayerBase.PredictiveSwapEntities: can not swap magazines");
8547 if (
Class.CastTo(parentWpn, swapmag2.GetHierarchyParent()))
8549 if (GetWeaponManager().CanSwapMagazine(parentWpn, swapmag1))
8551 Print(
"[inv] PlayerBase.PredictiveSwapEntities: swapping mag1=" + swapmag1 +
" to parent wpn=" + parentWpn +
" of mag2=" + swapmag2);
8552 return GetWeaponManager().SwapMagazine(swapmag1);
8556 Print(
"[inv] PlayerBase.PredictiveSwapEntities: can not swap magazines");
8564 if (IsSwapBetweenHandsAndGroundLargeItem(item1,item2,item_hands,item_ground) && !m_ActionManager.GetRunningAction())
8567 CastTo(mngr_client,m_ActionManager);
8569 ActionTarget atrg =
new ActionTarget(item_ground,null,-1,
vector.Zero,-1.0);
8570 if (mngr_client.GetAction(ActionSwapItemToHands).Can(
this,atrg,
ItemBase.Cast(item_hands)))
8575 return super.PredictiveSwapEntities(item1, item2);
8584 if (item1.IsHeavyBehaviour() && item1.GetInventory().GetCurrentInventoryLocation(il) && il.GetType() ==
InventoryLocationType.GROUND && !m_ActionManager.GetRunningAction())
8588 CastTo(mngr_client,m_ActionManager);
8590 ActionTarget atrg =
new ActionTarget(item1,null,-1,
vector.Zero,-1.0);
8591 if (mngr_client.GetAction(ActionSwapItemToHands).Can(
this,atrg,
ItemBase.Cast(item2)))
8598 return super.PredictiveForceSwapEntities(item1, item2, item2_dst);
8603 if (item.IsHeavyBehaviour() && !m_ActionManager.GetRunningAction() && !item.GetHierarchyParent())
8606 if (CastTo(mngr_client,m_ActionManager))
8608 ActionTarget atrg =
new ActionTarget(item,null,-1,
vector.Zero,-1.0);
8620 super.PredictiveTakeEntityToHands(item);
8630 if (CanRedirectToWeaponManager(item,can_detach))
8634 return GetWeaponManager().DetachMagazine(dst);
8638 return super.PredictiveTakeToDst(src,dst);
8646 if (item1.GetInventory().GetCurrentInventoryLocation(il) && il.GetType() ==
InventoryLocationType.HANDS)
8648 if (item2.GetInventory().GetCurrentInventoryLocation(il) && il.GetType() ==
InventoryLocationType.HANDS)
8650 if (item1.GetInventory().GetCurrentInventoryLocation(il) && il.GetType() ==
InventoryLocationType.GROUND)
8651 item_ground = item1;
8652 if (item2.GetInventory().GetCurrentInventoryLocation(il) && il.GetType() ==
InventoryLocationType.GROUND)
8653 item_ground = item2;
8655 return item_hands && item_ground && item_ground.IsHeavyBehaviour();
8664 if (!m_CharactersHead)
8666 ErrorEx(
"No valid head detected on character!");
8672 m_HideHairAnimated = !m_HideHairAnimated;
8673 for (
int i = 0; i < m_CharactersHead.m_HeadHairSelectionArray.Count(); ++i)
8677 stt.SetSelectionState(m_HideHairAnimated);
8678 m_CharactersHead.m_HeadHairHidingStateMap.Set(i, stt);
8679#ifdef DIAG_DEVELOPER
8682 diagmenu.m_HairHidingStateMap.Set(i, m_HideHairAnimated);
8692#ifdef DIAG_DEVELOPER
8695 switchState = !diagmenuu.m_HairHidingStateMap.Get(level);
8696 diagmenuu.m_HairHidingStateMap.Set(level, switchState);
8702 switchState = !state;
8706 stt.SetSelectionState(switchState);
8707 m_CharactersHead.m_HeadHairHidingStateMap.Set(level, stt);
8713 if (!item || !item.GetHeadHidingSelection() || !m_CharactersHead)
8722 item.GetInventory().GetCurrentAttachmentSlotInfo(slot_id,slot_name);
8724 if (item.HidesSelectionBySlot())
8726 count = item.GetInventory().GetSlotIdCount();
8727 for (i = 0; i < count; i++)
8729 if (item.GetInventory().GetSlotId(i) == slot_id)
8731 str = item.GetHeadHidingSelection().Get(i);
8732 idx = m_CharactersHead.m_HeadHairSelectionArray.Find(str);
8734 SetHairLevelToHide(idx,state);
8737 Debug.Log(
"No valid selection '" + str +
"' found on head of " +
GetType() +
". Verify the p3d, model config, and the 'HAIR_HIDING_SELECTIONS' macro in basicDefines.");
8744 count = item.GetHeadHidingSelection().Count();
8745 for (i = 0; i < count; i++)
8747 str = item.GetHeadHidingSelection().Get(i);
8748 idx = m_CharactersHead.m_HeadHairSelectionArray.Find(str);
8750 SetHairLevelToHide(idx,state);
8753 Debug.Log(
"No valid selection '" + str +
"' found on head of " +
GetType() +
". Verify the p3d, model config, and the 'HAIR_HIDING_SELECTIONS' macro in basicDefines.");
8757 UpdateHairSelectionVisibility();
8762 if (!m_CharactersHead)
8765 bool exception_hidden =
false;
8767 int count = m_CharactersHead.m_HeadHairHidingStateMap.Count();
8771 if (IsMale() && m_CharactersHead.GetBeardIndex() > -1 && !was_debug)
8773 SetHairLevelToHide(m_CharactersHead.GetBeardIndex(),GetLifeSpanState() != LifeSpanState.BEARD_EXTRA);
8777 for (i = 0; i < count; i++)
8779 m_CharactersHead.SetSimpleHiddenSelectionState(i,
true);
8782 for (i = 0; i < count; i++)
8784 stt = m_CharactersHead.m_HeadHairHidingStateMap.Get(i);
8785 shown = stt.GetSelectionState();
8788 if (!m_CharactersHead.IsHandlingException())
8790 m_CharactersHead.SetSimpleHiddenSelectionState(i,shown);
8791 UpdateTranslatedSelections(stt);
8796 exception_hidden =
true;
8802 if (exception_hidden)
8804 m_CharactersHead.SetSimpleHiddenSelectionState(m_CharactersHead.GetHairIndex(),
false);
8806 m_CharactersHead.SetSimpleHiddenSelectionState(m_CharactersHead.GetBeardIndex(),
false);
8813 array<int> translatedSelectinosArray = stt.GetTranslatedSelections();
8814 for (
int i = 0; i < translatedSelectinosArray.Count(); i++)
8816 index = translatedSelectinosArray.Get(i);
8818 m_CharactersHead.SetSimpleHiddenSelectionState(index,
false);
8828 HideHairSelections(headgear,
true);
8829 HideHairSelections(mask,
true);
8834 return m_ActiveNVTypes && m_ActiveNVTypes.Count() > 0;
8839 return m_LoweredNVGHeadset;
8844 if (!m_ActiveNVTypes || m_ActiveNVTypes.Count() == 0)
8850 return m_ActiveNVTypes[m_ActiveNVTypes.Count() - 1];
8856 return m_ActiveNVTypes;
8863 AddActiveNV(
NVTypes.NV_GOGGLES);
8868 m_LoweredNVGHeadset = state;
8873 if (!m_ActiveNVTypes || (
GetGame().IsMultiplayer() &&
GetGame().IsServer()))
8876 Error(
"AddActiveNV | illegal server-side call!");
8882 if (m_ActiveNVTypes.Find(type) == -1)
8883 m_ActiveNVTypes.Insert(type);
8888 if (!m_ActiveNVTypes || (
GetGame().IsMultiplayer() &&
GetGame().IsServer()))
8891 Error(
"RemoveActiveNV | illegal server-side call!");
8897 if (m_ActiveNVTypes.Find(type) != -1)
8898 m_ActiveNVTypes.RemoveItem(type);
8903 m_ActiveNVTypes.Clear();
8909 string text = super.GetDebugText();
8926 void DEBUGRotateNVG()
8930 if (FindAttachmentBySlotName(
"Eyewear"))
8932 nvg = NVGoggles.Cast(FindAttachmentBySlotName(
"Eyewear").FindAttachmentBySlotName(
"NVG"));
8934 else if (FindAttachmentBySlotName(
"Headgear"))
8936 nvg = NVGoggles.Cast(FindAttachmentBySlotName(
"Headgear").FindAttachmentBySlotName(
"NVG"));
8941 nvg.RotateGoggles(nvg.m_IsLowered);
8950 if (slot_name ==
"Headgear")
8952 item.SetSimpleHiddenSelectionState(0,1);
8953 item.SetSimpleHiddenSelectionState(1,0);
8955 else if (slot_name ==
"Mask")
8957 item.SetSimpleHiddenSelectionState(0,0);
8958 item.SetSimpleHiddenSelectionState(1,1);
8967 if (slot_name ==
"Headgear")
8969 item.SetSimpleHiddenSelectionState(0,1);
8970 item.SetSimpleHiddenSelectionState(1,0);
8972 else if (slot_name ==
"Mask")
8974 item.SetSimpleHiddenSelectionState(0,0);
8975 item.SetSimpleHiddenSelectionState(1,1);
8985 int state =
Math.AbsInt(m_CorpseState);
8996 for (
int i = 0; i < bodyparts.Count(); i++)
8999 bodypart = GetInventory().FindPlaceholderForSlot(slot_id);
9000 item =
ItemBase.Cast(GetInventory().FindAttachment(slot_id));
9004 path =
"cfgVehicles " + bodypart.GetType();
9005 idx = bodypart.GetHiddenSelectionIndex(
"personality");
9008 bodypart.SetObjectTexture(idx,m_DecayedTexture);
9013 path =
"cfgVehicles " + item.GetType();
9014 idx = item.GetHiddenSelectionIndex(
"personality");
9017 item.SetObjectTexture(idx,m_DecayedTexture);
9022 SetFaceTexture(m_DecayedTexture);
9040 m_FliesEff.SetDecalOwner(
this);
9042 p = m_FliesEff.GetParticle();
9043 AddChild(p, boneIdx);
9044 if (!m_SoundFliesEffect)
9046 PlaySoundSetLoop(m_SoundFliesEffect,
"Flies_SoundSet", 1.0, 1.0);
9057 m_FliesEff.SetDecalOwner(
this);
9059 p = m_FliesEff.GetParticle();
9060 AddChild(p, boneIdx);
9061 if (!m_SoundFliesEffect)
9063 PlaySoundSetLoop(m_SoundFliesEffect,
"Flies_SoundSet", 1.0, 1.0);
9070 StopSoundSet(m_SoundFliesEffect);
9077 int idx = GetHiddenSelectionIndex(
"decay_preload");
9079 SetObjectTexture(idx, m_DecayedTexture);
9084 m_LastMapScale = scale;
9090 scale = m_LastMapScale;
9093 return m_LastMapScale != -1.0;
9102 if (GetItemInHands() == item)
9104 return PredictiveDropEntity(item);
9111 ActionTarget actionTarget =
new ActionTarget(null, null, -1,
vector.Zero, -1);
9127 m_ProcessUIWarning = state;
9143 legZones.Insert(
"LeftLeg");
9144 legZones.Insert(
"RightLeg");
9145 legZones.Insert(
"RightFoot");
9146 legZones.Insert(
"LeftFoot");
9148 foreach (
string legZone : legZones)
9149 DecreaseHealth(legZone,
"", inputDmg);
9155 if (!hide && ((!IsSwimming() && !IsClimbingLadder() && !IsInVehicle() && !AnimCommandCheck(HumanMoveCommandID.CommandSwim | HumanMoveCommandID.CommandLadder | HumanMoveCommandID.CommandVehicle)) || force))
9157 GetItemAccessor().HideItemInHands(
false);
9161 GetItemAccessor().HideItemInHands(
true);
9169 if (target.GetInventory().FindFreeLocationFor(item, flags, il))
9171 return CheckAndExecuteStackSplitToInventoryLocation(il,item);
9178 int slotID = il.GetSlot();
9179 float stackableTarget = item.GetTargetQuantityMax(slotID);
9180 if (stackableTarget > 0 && stackableTarget < item.GetQuantity())
9183 if (CastTo(itemB, item))
9185 itemB.SplitIntoStackMaxToInventoryLocationClient(il);
9194 if (CheckAndExecuteStackSplit(flags, item,
this))
9200 return super.TakeEntityToInventoryImpl(mode, flags, item);
9211 return super.TakeEntityToCargoImpl(mode, item);
9222 return super.TakeEntityAsAttachmentImpl(mode, item);
9233 super.TakeEntityToHandsImpl(mode, item);
9238 if (CheckAndExecuteStackSplit(flags, item, target))
9244 return super.TakeEntityToTargetInventoryImpl(mode, target, flags, item);
9255 return super.TakeEntityToTargetCargoImpl(mode, target, item);
9266 return super.TakeEntityToTargetAttachmentImpl(mode, target, item);
9271 if (CheckAndExecuteStackSplitToInventoryLocation(dst, dst.GetItem()))
9277 return super.TakeToDstImpl(mode, src, dst);
9289 if (GetCommand_Move() && m_ContaminatedAroundPlayer && m_ContaminatedAroundPlayerTiny)
9291 float playerSpeed = GetCommand_Move().GetCurrentMovementSpeed();
9297 float particleLifetime = 5.25;
9298 float particleSpeed = 0.25;
9299 if (playerSpeed >= 1)
9301 particleLifetime = 3.5;
9302 particleSpeed = 3.25;
9304 if (playerSpeed >= 2)
9306 particleLifetime = 2.5;
9307 particleSpeed = 5.25;
9309 if (playerSpeed >= 3)
9311 particleLifetime = 1.5;
9312 particleSpeed = 8.25;
9314 m_ContaminatedAroundPlayer.SetParameter(0,
EmitorParam.LIFETIME, particleLifetime);
9315 m_ContaminatedAroundPlayer.SetParameter(1,
EmitorParam.LIFETIME, particleLifetime);
9316 m_ContaminatedAroundPlayer.SetParameter(2,
EmitorParam.LIFETIME, particleLifetime);
9317 m_ContaminatedAroundPlayer.SetParameter(3,
EmitorParam.LIFETIME, particleLifetime);
9319 m_ContaminatedAroundPlayerTiny.SetParameter(0,
EmitorParam.VELOCITY, particleSpeed);
9321 GetTransform(transform);
9322 m_ContaminatedAroundPlayer.SetTransform(transform);
9323 m_ContaminatedAroundPlayerTiny.SetTransform(transform);
9329 if (!IsControlledPlayer())
9333 if (m_ProcessRemoveGlassesEffects)
9335 for (i = 0; i < m_ProcessRemoveGlassesEffects.Count(); i++)
9337 PPERequesterBank.GetRequester(m_ProcessRemoveGlassesEffects[i]).Stop();
9339 m_ProcessRemoveGlassesEffects.Clear();
9342 if (m_ProcessAddGlassesEffects)
9344 for (i = 0; i < m_ProcessAddGlassesEffects.Count(); i++)
9346 PPERequesterBank.GetRequester(m_ProcessAddGlassesEffects[i]).Start();
9348 m_ProcessAddGlassesEffects.Clear();
9357 int pivot = componentIndex;
9373 vector parentTransMat[4];
9376 arrow.GetTransform(arrowTransMat);
9380 GetTransformWS(parentTransMat);
9385 Math3D.YawPitchRollMatrix(closeBoneRotWS *
Math.RAD2DEG,rotMatrix);
9387 parentTransMat[0] = rotMatrix[0];
9388 parentTransMat[1] = rotMatrix[1];
9389 parentTransMat[2] = rotMatrix[2];
9390 parentTransMat[3] = closeBonePosWS;
9393 Math3D.MatrixInvMultiply4(parentTransMat, arrowTransMat, arrowTransMat);
9394 Math3D.MatrixOrthogonalize4(arrowTransMat);
9395 arrow.SetTransform(arrowTransMat);
9397 AddChild(arrow, pivot);
9401 BleedingSourcesManagerServer bleedingManager = GetBleedingManagerServer();
9402 if (bleedingManager)
9404 if (!bleedingManager.AttemptAddBleedingSourceBySelection(compName))
9405 bleedingManager.AttemptAddBleedingSourceBySelection(
"Pelvis");
9417 return m_CachedPlayerName;
9422 return m_CachedPlayerID;
9427 super.OnFreezeStateChangeClient();
9429 UpdateCorpseState();
9434 return m_HasHeatBuffer;
9439 return m_HeatBufferStage;
9449 private int m_FaceCoveredForShaveLayers = 0;
9450 int m_AntibioticsActive;
9452 void SwitchItemTypeAttach(
EntityAI item,
string slot)
9458 void SwitchItemTypeDetach(
EntityAI item,
string slot);
9461 void IncreaseAntibioticsCount()
9466 void DecreaseAntibioticsCount()
9474 consumeData.m_Type = consume_type;
9475 consumeData.m_Amount = amount;
9476 consumeData.m_Source = source;
9477 consumeData.m_Agents = 0;
9479 return Consume(consumeData);
9482 bool HasStaminaRemaining()
9484 if (!GetStaminaHandler())
9487 return GetStaminaHandler().GetStamina() > 0;
9490 void SetBloodyHandsPenalty()
9498 if (GetStaminaHandler())
9499 GetStaminaHandler().DepleteStamina(modifier,dT);
Param4< int, int, string, int > TSelectableActionInfoWithColor
void syncDebugPrint(string s)
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ActionEatSnowContinuousCB ActionContinuousBaseCB ActionEatSnowContinuous()
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()
WorldCraftActionReciveData m_RecipeID
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
ref ArrowManagerBase m_ArrowManager
override ArrowManagerBase GetArrowManager()
const int BREATH_VAPOUR_LEVEL_MAX
void EffectRadial(Param param1, Param param2)
class RecipeCacheData m_Recipes
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)
bool IsKindOf(string cfg_class_name, string cfg_parent_name)
Returns is class name inherited from parent class name.
AnalyticsManagerServer GetAnalyticsServer()
proto int GetTime()
returns mission time in milliseconds
proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType)
AnalyticsManagerClient GetAnalyticsClient()
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
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 bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
static void ApplyEffects(PlayerBase player)
inventory for plain man/human
Client only - manage set up crafting on client.
provides access to slot configuration
ref MapNavigationBehaviour m_MapNavigationBehaviour
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
void SetNVGWorking(bool state)
Deprecated.
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)
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()
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()
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()
GameplayEffectWidgets_base m_EffectWidgets
effect widgets
override void RemoveAgent(int agent_id)
override vector GetDefaultHitPosition()
float m_OriginalSlidePoseAngle
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()
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)
void AntibioticsAttack(float value)
override bool IsWeaponObstructionBlockingADS()
ActionManagerBase GetActionManager()
bool IsItemInInventory(EntityAI entity)
void AddActiveNV(int type)
int m_RefreshAnimStateIdx
void SetLoadedQuickBarItemBind(EntityAI entity, int index)
void CheckSendSoundEvent()
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)
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.
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)
ref ModifiersManager m_ModifiersManager
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
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)
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)
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)
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
array< int > GetNVTypesArray()
string m_SaySoundLastSetName
ConstructionActionData GetConstructionActionData()
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()
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.
UndergroundBunkerHandlerClient GetUndergroundBunkerHandler()
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()
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.
static Particle PlayInWorld(int particle_id, vector global_pos)
Creates a particle emitter on the given position and activates it.
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
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:
Serialization general interface. Serializer API works with:
void OnSyncJuncture(int pJunctureID, ParamsReadContext pCtx)
called from PlayerBase - syncs stamina values on server with client AND sets the value to match on se...
void SetStamina(float stamina_value)
void Update(float deltaT, int pCurrentCommandID)
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)
ref DayZPlayerImplementMeleeCombat m_MeleeCombat
DisplayElementBase GetElement(eDisplayElements element_id)
void VirtualHud(PlayerBase player)
int GetID()
Get the ID registered in SEffectManager.
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()
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
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
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)
class JsonUndergroundAreaTriggerData GetPosition
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)
void NotifiersManager(PlayerBase player)
ref VirtualHud m_VirtualHud
VirtualHud GetVirtualHud()
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
PlayerStatBase GetStatObject(int id)
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)