6475{
6477 {
6478 return true;
6479 }
6480};
6481
6482
6483
6485{
6489
6491
6494
6495
6496
6497
6498
6507
6513
6518
6523
6544 protected bool m_IsResultOfSplit
6545
6547
6552
6553
6554
6556
6560
6561
6562
6564
6567
6568
6569
6575
6576
6584
6587
6588
6590
6591
6593
6594
6599
6600
6605
6606
6608
6609
6611 {
6616
6617 if (!
GetGame().IsDedicatedServer())
6618 {
6620 {
6622
6624 {
6626 }
6627 }
6628
6631 }
6632
6633 m_OldLocation = null;
6634
6636 {
6638 }
6639
6640 if (ConfigIsExisting("headSelectionsToHide"))
6641 {
6644 }
6645
6647 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6648 {
6650 }
6651
6653
6654 m_IsResultOfSplit = false;
6655
6657 }
6658
6660 {
6661 super.InitItemVariables();
6662
6668 m_Count = ConfigGetInt(
"count");
6669
6672
6677
6680
6685
6697
6701
6702
6705 if (ConfigIsExisting("canBeSplit"))
6706 {
6709 }
6710
6712 if (ConfigIsExisting("itemBehaviour"))
6714
6715
6718 RegisterNetSyncVariableInt("m_VarLiquidType");
6719 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6720
6721 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6722 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6723 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6724
6725 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6726 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6727 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6728 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6729
6730 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6731 RegisterNetSyncVariableBool("m_IsTakeable");
6732 RegisterNetSyncVariableBool("m_IsHologram");
6733
6736 {
6739 }
6740
6742
6744 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6746
6747 }
6748
6750 {
6752 }
6753
6755 {
6758 {
6763 }
6764 }
6765
6766 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6767 {
6769 {
6772 }
6773
6775 }
6776
6778 {
6784 }
6785
6787
6789 {
6791
6792 if (!action)
6793 {
6794 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6795 return;
6796 }
6797
6799 if (!ai)
6800 {
6802 return;
6803 }
6804
6806 if (!action_array)
6807 {
6808 action_array = new array<ActionBase_Basic>;
6810 }
6811 if (LogManager.IsActionLogEnable())
6812 {
6813 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6814 }
6815
6816 if (action_array.Find(action) != -1)
6817 {
6818 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6819 }
6820 else
6821 {
6822 action_array.Insert(action);
6823 }
6824 }
6825
6827 {
6829 ActionBase action = player.GetActionManager().GetAction(actionName);
6832
6833 if (action_array)
6834 {
6835 action_array.RemoveItem(action);
6836 }
6837 }
6838
6839
6840
6842 {
6843 ActionOverrideData overrideData = new ActionOverrideData();
6847
6849 if (!actionMap)
6850 {
6853 }
6854
6855 actionMap.Insert(this.
Type(), overrideData);
6856
6857 }
6858
6860
6862
6863
6865 {
6868
6871
6872 string config_to_search = "CfgVehicles";
6873 string muzzle_owner_config;
6874
6876 {
6877 if (IsInherited(Weapon))
6878 config_to_search = "CfgWeapons";
6879
6880 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6881
6882 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6883
6885
6886 if (config_OnFire_subclass_count > 0)
6887 {
6888 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6889
6890 for (int i = 0; i < config_OnFire_subclass_count; i++)
6891 {
6892 string particle_class = "";
6894 string config_OnFire_entry = config_OnFire_class + particle_class;
6895 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6896 WPOF_array.Insert(WPOF);
6897 }
6898
6899
6901 }
6902 }
6903
6905 {
6906 config_to_search = "CfgWeapons";
6907 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6908
6909 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6910
6912
6913 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6914 {
6915 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6916
6917 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6918 {
6919 string particle_class2 = "";
6921 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6922 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6923 WPOBE_array.Insert(WPOBE);
6924 }
6925
6926
6928 }
6929 }
6930 }
6931
6932
6934 {
6937
6939 {
6940 string config_to_search = "CfgVehicles";
6941
6942 if (IsInherited(Weapon))
6943 config_to_search = "CfgWeapons";
6944
6945 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6946 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6947
6948 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6949 {
6950
6952
6954 {
6956 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6958 return;
6959 }
6960
6963
6964
6965
6967 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6968
6969 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6970 {
6971 string particle_class = "";
6973 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6975
6976 if (entry_type == CT_CLASS)
6977 {
6978 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6979 WPOOH_array.Insert(WPOF);
6980 }
6981 }
6982
6983
6985 }
6986 }
6987 }
6988
6990 {
6992 }
6993
6995 {
6997 {
6999
7002
7005
7006 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7007 }
7008 }
7009
7011 {
7013 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7014
7016 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7017
7019 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7020
7022 {
7024 }
7025 }
7026
7028 {
7030 }
7031
7033 {
7036 else
7038
7040 {
7043 }
7044 else
7045 {
7048
7051 }
7052
7054 }
7055
7057 {
7059 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7060 }
7061
7063 {
7065 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7067 }
7068
7070 {
7072 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7073 }
7074
7076 {
7079
7080 OverheatingParticle OP = new OverheatingParticle();
7085
7087 }
7088
7090 {
7093
7094 return -1;
7095 }
7096
7098 {
7100 {
7103
7104 for (int i = count; i > 0; --i)
7105 {
7106 int id = i - 1;
7109
7112
7113 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7114 {
7115 if (p)
7116 {
7119 }
7120 }
7121 }
7122 }
7123 }
7124
7126 {
7128 {
7130 {
7131 int id = i - 1;
7133
7134 if (OP)
7135 {
7137
7138 if (p)
7139 {
7141 }
7142
7143 delete OP;
7144 }
7145 }
7146
7149 }
7150 }
7151
7154 {
7155 return 0.0;
7156 }
7157
7158
7160 {
7161 return 250;
7162 }
7163
7165 {
7166 return 0;
7167 }
7168
7171 {
7173 return true;
7174
7175 return false;
7176 }
7177
7180 {
7183
7185 {
7187 }
7188 else
7189 {
7190
7192 }
7193
7195 }
7196
7203 {
7204 return -1;
7205 }
7206
7207
7208
7209
7211 {
7213 {
7215 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7216
7217 if (r_index >= 0)
7218 {
7219 InventoryLocation r_il = new InventoryLocation;
7220 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7221
7222 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7225 {
7226 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7227 }
7229 {
7230 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7231 }
7232
7233 }
7234
7235 player.GetHumanInventory().ClearUserReservedLocation(this);
7236 }
7237
7240 }
7241
7242
7243
7244
7246 {
7247 return ItemBase.m_DebugActionsMask;
7248 }
7249
7251 {
7252 return ItemBase.m_DebugActionsMask & mask;
7253 }
7254
7256 {
7257 ItemBase.m_DebugActionsMask = mask;
7258 }
7259
7261 {
7262 ItemBase.m_DebugActionsMask |= mask;
7263 }
7264
7266 {
7267 ItemBase.m_DebugActionsMask &= ~mask;
7268 }
7269
7271 {
7273 {
7275 }
7276 else
7277 {
7279 }
7280 }
7281
7282
7284 {
7285 if (GetEconomyProfile())
7286 {
7287 float q_max = GetEconomyProfile().GetQuantityMax();
7288 if (q_max > 0)
7289 {
7290 float q_min = GetEconomyProfile().GetQuantityMin();
7291 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7292
7294 {
7295 ComponentEnergyManager comp = GetCompEM();
7297 {
7299 }
7300 }
7302 {
7304
7305 }
7306
7307 }
7308 }
7309 }
7310
7313 {
7314 EntityAI parent = GetHierarchyParent();
7315
7316 if (parent)
7317 {
7318 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7319 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7320 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7321 }
7322 }
7323
7326 {
7327 EntityAI parent = GetHierarchyParent();
7328
7329 if (parent)
7330 {
7331 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7332 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7333 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7334 }
7335 }
7336
7338 {
7339
7340
7341
7342
7344
7346 {
7347 if (ScriptInputUserData.CanStoreInputUserData())
7348 {
7349 ScriptInputUserData ctx = new ScriptInputUserData;
7355 ctx.
Write(use_stack_max);
7358
7360 {
7361 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7362 }
7363 }
7364 }
7365 else if (!
GetGame().IsMultiplayer())
7366 {
7368 }
7369 }
7370
7372 {
7374 }
7375
7377 {
7379 }
7380
7382 {
7384 }
7385
7387 {
7388
7389 return false;
7390 }
7391
7393 {
7394 return false;
7395 }
7396
7400 {
7401 return false;
7402 }
7403
7405 {
7406 return "";
7407 }
7408
7410
7412 {
7413 return false;
7414 }
7415
7417 {
7418 return true;
7419 }
7420
7421
7422
7424 {
7425 return true;
7426 }
7427
7429 {
7430 return true;
7431 }
7432
7434 {
7435 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7437 }
7438
7440 {
7442 }
7443
7445 {
7447 if (!is_being_placed)
7449 SetSynchDirty();
7450 }
7451
7452
7454
7456 {
7458 }
7459
7461 {
7463 }
7464
7466 {
7467 return 1;
7468 }
7469
7471 {
7472 return false;
7473 }
7474
7476 {
7478 SetSynchDirty();
7479 }
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7516 {
7517 super.OnMovedInsideCargo(container);
7518
7519 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7520 }
7521
7522 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7523 {
7524 super.EEItemLocationChanged(oldLoc,newLoc);
7525
7526 PlayerBase new_player = null;
7527 PlayerBase old_player = null;
7528
7529 if (newLoc.GetParent())
7530 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7531
7532 if (oldLoc.GetParent())
7533 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7534
7536 {
7537 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7538
7539 if (r_index >= 0)
7540 {
7541 InventoryLocation r_il = new InventoryLocation;
7542 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7543
7544 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7547 {
7548 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7549 }
7551 {
7552 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7553 }
7554
7555 }
7556 }
7557
7559 {
7560 if (new_player)
7561 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7562
7563 if (new_player == old_player)
7564 {
7565
7566 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7567 {
7569 {
7570 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7571 {
7572 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7573 }
7574 }
7575 else
7576 {
7577 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7578 }
7579 }
7580
7581 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7582 {
7583 int type = oldLoc.GetType();
7585 {
7586 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7587 }
7589 {
7590 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7591 }
7592 }
7593 if (!m_OldLocation)
7594 {
7595 m_OldLocation = new InventoryLocation;
7596 }
7597 m_OldLocation.Copy(oldLoc);
7598 }
7599 else
7600 {
7601 if (m_OldLocation)
7602 {
7603 m_OldLocation.Reset();
7604 }
7605 }
7606
7608 }
7609 else
7610 {
7611 if (new_player)
7612 {
7613 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7614 if (res_index >= 0)
7615 {
7616 InventoryLocation il = new InventoryLocation;
7617 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7619 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7622 {
7623 il.
GetParent().GetOnReleaseLock().Invoke(it);
7624 }
7626 {
7628 }
7629
7630 }
7631 }
7633 {
7634
7636 }
7637
7638 if (m_OldLocation)
7639 {
7640 m_OldLocation.Reset();
7641 }
7642 }
7643 }
7644
7645 override void EOnContact(IEntity other, Contact extra)
7646 {
7648 {
7649 int liquidType = -1;
7651 if (impactSpeed > 0.0)
7652 {
7654 #ifndef SERVER
7656 #else
7658 SetSynchDirty();
7659 #endif
7661 }
7662 }
7663
7664 #ifdef SERVER
7665 if (GetCompEM() && GetCompEM().IsPlugged())
7666 {
7667 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7668 GetCompEM().UnplugThis();
7669 }
7670 #endif
7671 }
7672
7674
7676 {
7678 }
7679
7681 {
7682
7683 }
7684
7686 {
7687 super.OnItemLocationChanged(old_owner, new_owner);
7688
7689 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7690 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7691
7692 if (!relatedPlayer && playerNew)
7693 relatedPlayer = playerNew;
7694
7695 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7696 {
7698 if (actionMgr)
7699 {
7700 ActionBase currentAction = actionMgr.GetRunningAction();
7701 if (currentAction)
7703 }
7704 }
7705
7706 Man ownerPlayerOld = null;
7707 Man ownerPlayerNew = null;
7708
7709 if (old_owner)
7710 {
7711 if (old_owner.
IsMan())
7712 {
7713 ownerPlayerOld = Man.Cast(old_owner);
7714 }
7715 else
7716 {
7717 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7718 }
7719 }
7720 else
7721 {
7723 {
7725
7726 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7727 {
7728 GetCompEM().UnplugThis();
7729 }
7730 }
7731 }
7732
7733 if (new_owner)
7734 {
7735 if (new_owner.
IsMan())
7736 {
7737 ownerPlayerNew = Man.Cast(new_owner);
7738 }
7739 else
7740 {
7741 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7742 }
7743 }
7744
7745 if (ownerPlayerOld != ownerPlayerNew)
7746 {
7747 if (ownerPlayerOld)
7748 {
7749 array<EntityAI> subItemsExit = new array<EntityAI>;
7751 for (int i = 0; i < subItemsExit.Count(); i++)
7752 {
7755 }
7756 }
7757
7758 if (ownerPlayerNew)
7759 {
7760 array<EntityAI> subItemsEnter = new array<EntityAI>;
7762 for (int j = 0; j < subItemsEnter.Count(); j++)
7763 {
7766 }
7767 }
7768 }
7769 else if (ownerPlayerNew != null)
7770 {
7771 PlayerBase nplayer;
7772 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7773 {
7774 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7776 for (int k = 0; k < subItemsUpdate.Count(); k++)
7777 {
7779 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7780 }
7781 }
7782 }
7783
7784 if (old_owner)
7785 old_owner.OnChildItemRemoved(this);
7786 if (new_owner)
7787 new_owner.OnChildItemReceived(this);
7788 }
7789
7790
7792 {
7793 super.EEDelete(parent);
7794 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7795 if (player)
7796 {
7798
7799 if (player.IsAlive())
7800 {
7801 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7802 if (r_index >= 0)
7803 {
7804 InventoryLocation r_il = new InventoryLocation;
7805 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7806
7807 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7810 {
7811 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7812 }
7814 {
7815 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7816 }
7817
7818 }
7819
7820 player.RemoveQuickBarEntityShortcut(this);
7821 }
7822 }
7823 }
7824
7826 {
7827 super.EEKilled(killer);
7828
7831 {
7832 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7833 {
7834 if (IsMagazine())
7835 {
7836 if (Magazine.Cast(this).GetAmmoCount() > 0)
7837 {
7839 }
7840 }
7841 else
7842 {
7844 }
7845 }
7846 }
7847 }
7848
7850 {
7851 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7852
7853 super.OnWasAttached(parent, slot_id);
7854
7857
7859 }
7860
7862 {
7863 super.OnWasDetached(parent, slot_id);
7864
7867 }
7868
7870 {
7871 int idx;
7874
7875 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7876 if (inventory_slots.Count() < 1)
7877 {
7878 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7879 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7880 }
7881 else
7882 {
7883 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7884 }
7885
7886 idx = inventory_slots.Find(slot);
7887 if (idx < 0)
7888 return "";
7889
7890 return attach_types.Get(idx);
7891 }
7892
7894 {
7895 int idx = -1;
7896 string slot;
7897
7900
7901 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7902 if (inventory_slots.Count() < 1)
7903 {
7904 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7905 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7906 }
7907 else
7908 {
7909 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7910 if (detach_types.Count() < 1)
7911 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7912 }
7913
7914 for (int i = 0; i < inventory_slots.Count(); i++)
7915 {
7916 slot = inventory_slots.Get(i);
7917 }
7918
7919 if (slot != "")
7920 {
7921 if (detach_types.Count() == 1)
7922 idx = 0;
7923 else
7924 idx = inventory_slots.Find(slot);
7925 }
7926 if (idx < 0)
7927 return "";
7928
7929 return detach_types.Get(idx);
7930 }
7931
7933 {
7934
7936
7937
7938 float min_time = 1;
7939 float max_time = 3;
7940 float delay = Math.RandomFloat(min_time, max_time);
7941
7942 explode_timer.Run(delay, this, "DoAmmoExplosion");
7943 }
7944
7946 {
7947 Magazine magazine = Magazine.Cast(this);
7948 int pop_sounds_count = 6;
7949 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7950
7951
7952 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7953 string sound_name = pop_sounds[ sound_idx ];
7955
7956
7957 magazine.ServerAddAmmoCount(-1);
7958
7959
7960 float min_temp_to_explode = 100;
7961
7962 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7963 {
7965 }
7966 }
7967
7968
7969 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7970 {
7971 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7972
7973 const int CHANCE_DAMAGE_CARGO = 4;
7974 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7975 const int CHANCE_DAMAGE_NOTHING = 2;
7976
7978 {
7979 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7980 int chances;
7981 int rnd;
7982
7983 if (GetInventory().GetCargo())
7984 {
7985 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7986 rnd = Math.RandomInt(0,chances);
7987
7988 if (rnd < CHANCE_DAMAGE_CARGO)
7989 {
7991 }
7992 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7993 {
7995 }
7996 }
7997 else
7998 {
7999 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8000 rnd = Math.RandomInt(0,chances);
8001
8002 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8003 {
8005 }
8006 }
8007 }
8008 }
8009
8011 {
8012 if (GetInventory().GetCargo())
8013 {
8014 int item_count = GetInventory().GetCargo().GetItemCount();
8015 if (item_count > 0)
8016 {
8017 int random_pick = Math.RandomInt(0, item_count);
8019 if (!item.IsExplosive())
8020 {
8021 item.AddHealth("","",damage);
8022 return true;
8023 }
8024 }
8025 }
8026 return false;
8027 }
8028
8030 {
8031 int attachment_count = GetInventory().AttachmentCount();
8032 if (attachment_count > 0)
8033 {
8034 int random_pick = Math.RandomInt(0, attachment_count);
8035 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8036 if (!attachment.IsExplosive())
8037 {
8038 attachment.AddHealth("","",damage);
8039 return true;
8040 }
8041 }
8042 return false;
8043 }
8044
8046 {
8048 }
8049
8051 {
8053 return GetInventory().CanRemoveEntity();
8054
8055 return false;
8056 }
8057
8059 {
8060
8062 return false;
8063
8064
8066 return false;
8067
8068
8069
8071 if (delta == 0)
8072 return false;
8073
8074
8075 return true;
8076 }
8077
8079 {
8081 {
8082 if (ScriptInputUserData.CanStoreInputUserData())
8083 {
8084 ScriptInputUserData ctx = new ScriptInputUserData;
8089 ctx.
Write(destination_entity);
8093 }
8094 }
8095 else if (!
GetGame().IsMultiplayer())
8096 {
8098 }
8099 }
8100
8102 {
8103 float split_quantity_new;
8107 InventoryLocation loc = new InventoryLocation;
8108
8109 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8110 {
8112 split_quantity_new = stack_max;
8113 else
8115
8117 {
8118 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8119 if (new_item)
8120 {
8121 new_item.SetResultOfSplit(true);
8122 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8124 new_item.
SetQuantity(split_quantity_new,
false,
true);
8125 }
8126 }
8127 }
8128 else if (destination_entity && slot_id == -1)
8129 {
8130 if (quantity > stack_max)
8131 split_quantity_new = stack_max;
8132 else
8133 split_quantity_new = quantity;
8134
8136 {
8138 {
8141 }
8142
8143 if (new_item)
8144 {
8145 new_item.SetResultOfSplit(true);
8146 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8148 new_item.
SetQuantity(split_quantity_new,
false,
true);
8149 }
8150 }
8151 }
8152 else
8153 {
8154 if (stack_max != 0)
8155 {
8157 {
8159 }
8160
8161 if (split_quantity_new == 0)
8162 {
8163 if (!
GetGame().IsMultiplayer())
8164 player.PhysicalPredictiveDropItem(this);
8165 else
8166 player.ServerDropEntity(this);
8167 return;
8168 }
8169
8171 {
8173
8174 if (new_item)
8175 {
8176 new_item.SetResultOfSplit(true);
8177 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8180 new_item.PlaceOnSurface();
8181 }
8182 }
8183 }
8184 }
8185 }
8186
8188 {
8189 float split_quantity_new;
8193 InventoryLocation loc = new InventoryLocation;
8194
8195 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8196 {
8198 split_quantity_new = stack_max;
8199 else
8201
8203 {
8204 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8205 if (new_item)
8206 {
8207 new_item.SetResultOfSplit(true);
8208 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8210 new_item.
SetQuantity(split_quantity_new,
false,
true);
8211 }
8212 }
8213 }
8214 else if (destination_entity && slot_id == -1)
8215 {
8216 if (quantity > stack_max)
8217 split_quantity_new = stack_max;
8218 else
8219 split_quantity_new = quantity;
8220
8222 {
8224 {
8227 }
8228
8229 if (new_item)
8230 {
8231 new_item.SetResultOfSplit(true);
8232 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8234 new_item.
SetQuantity(split_quantity_new,
false,
true);
8235 }
8236 }
8237 }
8238 else
8239 {
8240 if (stack_max != 0)
8241 {
8243 {
8245 }
8246
8248 {
8250
8251 if (new_item)
8252 {
8253 new_item.SetResultOfSplit(true);
8254 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8257 new_item.PlaceOnSurface();
8258 }
8259 }
8260 }
8261 }
8262 }
8263
8265 {
8267 {
8268 if (ScriptInputUserData.CanStoreInputUserData())
8269 {
8270 ScriptInputUserData ctx = new ScriptInputUserData;
8275 dst.WriteToContext(ctx);
8277 }
8278 }
8279 else if (!
GetGame().IsMultiplayer())
8280 {
8282 }
8283 }
8284
8286 {
8288 {
8289 if (ScriptInputUserData.CanStoreInputUserData())
8290 {
8291 ScriptInputUserData ctx = new ScriptInputUserData;
8296 ctx.
Write(destination_entity);
8302 }
8303 }
8304 else if (!
GetGame().IsMultiplayer())
8305 {
8307 }
8308 }
8309
8311 {
8313 }
8314
8316 {
8318 float split_quantity_new;
8320 if (dst.IsValid())
8321 {
8322 int slot_id = dst.GetSlot();
8324
8325 if (quantity > stack_max)
8326 split_quantity_new = stack_max;
8327 else
8328 split_quantity_new = quantity;
8329
8331 {
8333
8334 if (new_item)
8335 {
8336 new_item.SetResultOfSplit(true);
8337 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8339 new_item.
SetQuantity(split_quantity_new,
false,
true);
8340 }
8341
8342 return new_item;
8343 }
8344 }
8345
8346 return null;
8347 }
8348
8350 {
8352 float split_quantity_new;
8354 if (destination_entity)
8355 {
8357 if (quantity > stackable)
8358 split_quantity_new = stackable;
8359 else
8360 split_quantity_new = quantity;
8361
8363 {
8364 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8365 if (new_item)
8366 {
8367 new_item.SetResultOfSplit(true);
8368 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8370 new_item.
SetQuantity(split_quantity_new,
false,
true);
8371 }
8372 }
8373 }
8374 }
8375
8377 {
8379 {
8380 if (ScriptInputUserData.CanStoreInputUserData())
8381 {
8382 ScriptInputUserData ctx = new ScriptInputUserData;
8387 ItemBase destination_entity =
this;
8388 ctx.
Write(destination_entity);
8392 }
8393 }
8394 else if (!
GetGame().IsMultiplayer())
8395 {
8397 }
8398 }
8399
8401 {
8403 float split_quantity_new;
8405 if (player)
8406 {
8408 if (quantity > stackable)
8409 split_quantity_new = stackable;
8410 else
8411 split_quantity_new = quantity;
8412
8414 {
8415 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8416 new_item =
ItemBase.Cast(in_hands);
8417 if (new_item)
8418 {
8419 new_item.SetResultOfSplit(true);
8420 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8422 new_item.SetQuantity(split_quantity_new, false, true);
8423 }
8424 }
8425 }
8426 }
8427
8429 {
8431 float split_quantity_new = Math.Floor(quantity * 0.5);
8432
8434 return;
8435
8437
8438 if (new_item)
8439 {
8440 if (new_item.GetQuantityMax() < split_quantity_new)
8441 {
8442 split_quantity_new = new_item.GetQuantityMax();
8443 }
8444
8445 new_item.SetResultOfSplit(true);
8446 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8447
8449 {
8452 }
8453 else
8454 {
8456 new_item.
SetQuantity(split_quantity_new,
false,
true);
8457 }
8458 }
8459 }
8460
8462 {
8464 float split_quantity_new = Math.Floor(quantity / 2);
8465
8467 return;
8468
8469 InventoryLocation invloc = new InventoryLocation;
8471
8473 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8474
8475 if (new_item)
8476 {
8477 if (new_item.GetQuantityMax() < split_quantity_new)
8478 {
8479 split_quantity_new = new_item.GetQuantityMax();
8480 }
8482 {
8485 }
8486 else if (split_quantity_new > 1)
8487 {
8489 new_item.
SetQuantity(split_quantity_new,
false,
true);
8490 }
8491 }
8492 }
8493
8496 {
8497 SetWeightDirty();
8499
8500 if (parent)
8501 parent.OnAttachmentQuantityChangedEx(this, delta);
8502
8504 {
8506 {
8508 }
8510 {
8511 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8513 }
8514 }
8515
8516 }
8517
8520 {
8521
8522 }
8523
8526 {
8528 }
8529
8531 {
8532 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8533
8535 {
8536 if (newLevel == GameConstants.STATE_RUINED)
8537 {
8539 EntityAI parent = GetHierarchyParent();
8540 if (parent && parent.IsFireplace())
8541 {
8542 CargoBase cargo = GetInventory().GetCargo();
8543 if (cargo)
8544 {
8546 {
8548 }
8549 }
8550 }
8551 }
8552
8554 {
8555
8557 return;
8558 }
8559
8560 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8561 {
8563 }
8564 }
8565 }
8566
8567
8569 {
8570 super.OnRightClick();
8571
8573 {
8575 {
8576 if (ScriptInputUserData.CanStoreInputUserData())
8577 {
8578 EntityAI root = GetHierarchyRoot();
8579 Man playerOwner = GetHierarchyRootPlayer();
8580 InventoryLocation dst = new InventoryLocation;
8581
8582
8583 if (!playerOwner && root && root == this)
8584 {
8586 }
8587 else
8588 {
8589
8590 GetInventory().GetCurrentInventoryLocation(dst);
8592 {
8595 {
8597 }
8598 else
8599 {
8601
8602
8603 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8604 {
8606 }
8607 else
8608 {
8609 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8610 }
8611 }
8612 }
8613 }
8614
8615 ScriptInputUserData ctx = new ScriptInputUserData;
8623 }
8624 }
8625 else if (!
GetGame().IsMultiplayer())
8626 {
8628 }
8629 }
8630 }
8631
8633 {
8634 if (root)
8635 {
8636 vector m4[4];
8637 root.GetTransform(m4);
8638 dst.SetGround(this, m4);
8639 }
8640 else
8641 {
8642 GetInventory().GetCurrentInventoryLocation(dst);
8643 }
8644 }
8645
8646 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8647 {
8648
8649 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8650 return false;
8651
8652 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8653 return false;
8654
8655
8657 return false;
8658
8659
8660 Magazine mag = Magazine.Cast(this);
8661 if (mag)
8662 {
8663 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8664 return false;
8665
8666 if (stack_max_limit)
8667 {
8668 Magazine other_mag = Magazine.Cast(other_item);
8669 if (other_item)
8670 {
8671 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8672 return false;
8673 }
8674
8675 }
8676 }
8677 else
8678 {
8679
8681 return false;
8682
8684 return false;
8685 }
8686
8687 PlayerBase player = null;
8688 if (CastTo(player, GetHierarchyRootPlayer()))
8689 {
8690 if (player.GetInventory().HasAttachment(this))
8691 return false;
8692
8693 if (player.IsItemsToDelete())
8694 return false;
8695 }
8696
8697 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8698 return false;
8699
8700 int slotID;
8702 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8703 return false;
8704
8705 return true;
8706 }
8707
8709 {
8711 }
8712
8714 {
8715 return m_IsResultOfSplit;
8716 }
8717
8719 {
8720 m_IsResultOfSplit = value;
8721 }
8722
8724 {
8726 }
8727
8729 {
8730 float other_item_quantity = other_item.GetQuantity();
8731 float this_free_space;
8732
8734
8736
8737 if (other_item_quantity > this_free_space)
8738 {
8739 return this_free_space;
8740 }
8741 else
8742 {
8743 return other_item_quantity;
8744 }
8745 }
8746
8748 {
8750 }
8751
8753 {
8755 return;
8756
8757 if (!IsMagazine() && other_item)
8758 {
8760 if (quantity_used != 0)
8761 {
8762 float hp1 = GetHealth01("","");
8763 float hp2 = other_item.GetHealth01("","");
8764 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8765 hpResult = hpResult / (
GetQuantity() + quantity_used);
8766
8767 hpResult *= GetMaxHealth();
8768 Math.Round(hpResult);
8769 SetHealth("", "Health", hpResult);
8770
8772 other_item.AddQuantity(-quantity_used);
8773 }
8774 }
8776 }
8777
8779 {
8780 #ifdef SERVER
8781 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8782 GetHierarchyParent().IncreaseLifetimeUp();
8783 #endif
8784 };
8785
8787 {
8788 PlayerBase p = PlayerBase.Cast(player);
8789
8790 array<int> recipesIds = p.m_Recipes;
8791 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8792 if (moduleRecipesManager)
8793 {
8794 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8795 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8796 }
8797
8798 for (int i = 0;i < recipesIds.Count(); i++)
8799 {
8800 int key = recipesIds.Get(i);
8801 string recipeName = moduleRecipesManager.GetRecipeName(key);
8803 }
8804 }
8805
8806
8807 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8808 {
8809 super.GetDebugActions(outputList);
8810
8811
8817
8818
8823
8828
8829
8833
8834
8836 {
8840 }
8841
8844
8845
8849
8851
8852 InventoryLocation loc = new InventoryLocation();
8853 GetInventory().GetCurrentInventoryLocation(loc);
8855 {
8856 if (Gizmo_IsSupported())
8859 }
8860
8862 }
8863
8864
8865
8866
8868 {
8869 super.OnAction(action_id, player, ctx);
8870
8872 {
8873 switch (action_id)
8874 {
8877 return true;
8880 return true;
8881 }
8882 }
8883
8885 {
8886 switch (action_id)
8887 {
8889 Delete();
8890 return true;
8891 }
8892 }
8893
8894 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8895 {
8896 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8897 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8898 PlayerBase p = PlayerBase.Cast(player);
8899 if (
EActions.RECIPES_RANGE_START < 1000)
8900 {
8901 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8902 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8903 }
8904 }
8905 #ifndef SERVER
8906 else if (action_id ==
EActions.WATCH_PLAYER)
8907 {
8908 PluginDeveloper.SetDeveloperItemClientEx(player);
8909 }
8910 #endif
8912 {
8913 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8914 {
8915 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8916 OnDebugButtonPressServer(id + 1);
8917 }
8918
8919 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8920 {
8921 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8923 }
8924
8925 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8926 {
8927 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8929 }
8930
8931 else if (action_id ==
EActions.ADD_QUANTITY)
8932 {
8933 if (IsMagazine())
8934 {
8935 Magazine mag = Magazine.Cast(this);
8936 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8937 }
8938 else
8939 {
8941 }
8942
8943 if (m_EM)
8944 {
8945 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8946 }
8947
8948 }
8949
8950 else if (action_id ==
EActions.REMOVE_QUANTITY)
8951 {
8952 if (IsMagazine())
8953 {
8954 Magazine mag2 = Magazine.Cast(this);
8955 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8956 }
8957 else
8958 {
8960 }
8961 if (m_EM)
8962 {
8963 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8964 }
8965
8966 }
8967
8968 else if (action_id ==
EActions.SET_QUANTITY_0)
8969 {
8971
8972 if (m_EM)
8973 {
8974 m_EM.SetEnergy(0);
8975 }
8976 }
8977
8978 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8979 {
8981
8982 if (m_EM)
8983 {
8984 m_EM.SetEnergy(m_EM.GetEnergyMax());
8985 }
8986 }
8987
8988 else if (action_id ==
EActions.ADD_HEALTH)
8989 {
8990 AddHealth("","",GetMaxHealth("","Health")/5);
8991 }
8992 else if (action_id ==
EActions.REMOVE_HEALTH)
8993 {
8994 AddHealth("","",-GetMaxHealth("","Health")/5);
8995 }
8996 else if (action_id ==
EActions.DESTROY_HEALTH)
8997 {
8998 SetHealth01("","",0);
8999 }
9000 else if (action_id ==
EActions.WATCH_ITEM)
9001 {
9003 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9004 #ifdef DEVELOPER
9005 SetDebugDeveloper_item(this);
9006 #endif
9007 }
9008
9009 else if (action_id ==
EActions.ADD_TEMPERATURE)
9010 {
9011 AddTemperature(20);
9012
9013 }
9014
9015 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9016 {
9017 AddTemperature(-20);
9018
9019 }
9020
9021 else if (action_id ==
EActions.FLIP_FROZEN)
9022 {
9023 SetFrozen(!GetIsFrozen());
9024
9025 }
9026
9027 else if (action_id ==
EActions.ADD_WETNESS)
9028 {
9030
9031 }
9032
9033 else if (action_id ==
EActions.REMOVE_WETNESS)
9034 {
9036
9037 }
9038
9039 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9040 {
9043
9044
9045 }
9046
9047 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9048 {
9051 }
9052
9053 else if (action_id ==
EActions.MAKE_SPECIAL)
9054 {
9055 auto debugParams = DebugSpawnParams.WithPlayer(player);
9056 OnDebugSpawnEx(debugParams);
9057 }
9058
9059 }
9060
9061
9062 return false;
9063 }
9064
9065
9066
9067
9071
9074
9075
9076
9078 {
9079 return false;
9080 }
9081
9082
9084 {
9085 return true;
9086 }
9087
9088
9090 {
9091 return true;
9092 }
9093
9094
9095
9097 {
9098 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9100 }
9101
9104 {
9105 return null;
9106 }
9107
9109 {
9110 return false;
9111 }
9112
9114 {
9115 return false;
9116 }
9117
9121
9122
9124 {
9125 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9126 return module_repairing.CanRepair(this, item_repair_kit);
9127 }
9128
9129
9130 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9131 {
9132 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9133 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9134 }
9135
9136
9138 {
9139
9140
9141
9142
9143
9144
9145
9146
9147 return 1;
9148 }
9149
9150
9151
9153 {
9155 }
9156
9157
9158
9160 {
9162 }
9163
9164
9173 {
9174 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9175
9176 if (player)
9177 {
9178 player.MessageStatus(text);
9179 }
9180 }
9181
9182
9191 {
9192 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9193
9194 if (player)
9195 {
9196 player.MessageAction(text);
9197 }
9198 }
9199
9200
9209 {
9210 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9211
9212 if (player)
9213 {
9214 player.MessageFriendly(text);
9215 }
9216 }
9217
9218
9227 {
9228 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9229
9230 if (player)
9231 {
9232 player.MessageImportant(text);
9233 }
9234 }
9235
9237 {
9238 return true;
9239 }
9240
9241
9242 override bool KindOf(
string tag)
9243 {
9244 bool found = false;
9245 string item_name = this.
GetType();
9248
9249 int array_size = item_tag_array.Count();
9250 for (int i = 0; i < array_size; i++)
9251 {
9252 if (item_tag_array.Get(i) == tag)
9253 {
9254 found = true;
9255 break;
9256 }
9257 }
9258 return found;
9259 }
9260
9261
9263 {
9264
9265 super.OnRPC(sender, rpc_type,ctx);
9266
9267
9268 switch (rpc_type)
9269 {
9270 #ifndef SERVER
9271 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9272 Param2<bool, string> p = new Param2<bool, string>(false, "");
9273
9275 return;
9276
9277 bool play = p.param1;
9278 string soundSet = p.param2;
9279
9280 if (play)
9281 {
9283 {
9285 {
9287 }
9288 }
9289 else
9290 {
9292 }
9293 }
9294 else
9295 {
9297 }
9298
9299 break;
9300 #endif
9301
9302 }
9303
9305 {
9307 }
9308 }
9309
9310
9311
9312
9314 {
9315 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9316 return plugin.GetID(
name);
9317 }
9318
9320 {
9321 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9322 return plugin.GetName(id);
9323 }
9324
9327 {
9328
9329
9330 int varFlags;
9331 if (!ctx.
Read(varFlags))
9332 return;
9333
9334 if (varFlags & ItemVariableFlags.FLOAT)
9335 {
9337 }
9338 }
9339
9341 {
9342
9343 super.SerializeNumericalVars(floats_out);
9344
9345
9346
9348 {
9350 }
9351
9353 {
9355 }
9356
9358 {
9360 }
9361
9363 {
9368 }
9369
9371 {
9373 }
9374 }
9375
9377 {
9378
9379 super.DeSerializeNumericalVars(floats);
9380
9381
9382 int index = 0;
9383 int mask = Math.Round(floats.Get(index));
9384
9385 index++;
9386
9388 {
9390 {
9392 }
9393 else
9394 {
9395 float quantity = floats.Get(index);
9397 }
9398 index++;
9399 }
9400
9402 {
9403 float wet = floats.Get(index);
9405 index++;
9406 }
9407
9409 {
9410 int liquidtype = Math.Round(floats.Get(index));
9412 index++;
9413 }
9414
9416 {
9418 index++;
9420 index++;
9422 index++;
9424 index++;
9425 }
9426
9428 {
9429 int cleanness = Math.Round(floats.Get(index));
9431 index++;
9432 }
9433 }
9434
9436 {
9437 super.WriteVarsToCTX(ctx);
9438
9439
9441 {
9443 }
9444
9446 {
9448 }
9449
9451 {
9453 }
9454
9456 {
9457 int r,g,b,a;
9463 }
9464
9466 {
9468 }
9469 }
9470
9472 {
9473 if (!super.ReadVarsFromCTX(ctx,version))
9474 return false;
9475
9476 int intValue;
9477 float value;
9478
9479 if (version < 140)
9480 {
9481 if (!ctx.
Read(intValue))
9482 return false;
9483
9484 m_VariablesMask = intValue;
9485 }
9486
9488 {
9489 if (!ctx.
Read(value))
9490 return false;
9491
9493 {
9495 }
9496 else
9497 {
9499 }
9500 }
9501
9502 if (version < 140)
9503 {
9505 {
9506 if (!ctx.
Read(value))
9507 return false;
9508 SetTemperatureDirect(value);
9509 }
9510 }
9511
9513 {
9514 if (!ctx.
Read(value))
9515 return false;
9517 }
9518
9520 {
9521 if (!ctx.
Read(intValue))
9522 return false;
9524 }
9525
9527 {
9528 int r,g,b,a;
9530 return false;
9532 return false;
9534 return false;
9536 return false;
9537
9539 }
9540
9542 {
9543 if (!ctx.
Read(intValue))
9544 return false;
9546 }
9547
9548 if (version >= 138 && version < 140)
9549 {
9551 {
9552 if (!ctx.
Read(intValue))
9553 return false;
9554 SetFrozen(intValue);
9555 }
9556 }
9557
9558 return true;
9559 }
9560
9561
9563 {
9566 {
9568 }
9569
9570 if (!super.OnStoreLoad(ctx, version))
9571 {
9573 return false;
9574 }
9575
9576 if (version >= 114)
9577 {
9578 bool hasQuickBarIndexSaved;
9579
9580 if (!ctx.
Read(hasQuickBarIndexSaved))
9581 {
9583 return false;
9584 }
9585
9586 if (hasQuickBarIndexSaved)
9587 {
9588 int itmQBIndex;
9589
9590
9591 if (!ctx.
Read(itmQBIndex))
9592 {
9594 return false;
9595 }
9596
9597 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9598 if (itmQBIndex != -1 && parentPlayer)
9599 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9600 }
9601 }
9602 else
9603 {
9604
9605 PlayerBase player;
9606 int itemQBIndex;
9607 if (version ==
int.
MAX)
9608 {
9609 if (!ctx.
Read(itemQBIndex))
9610 {
9612 return false;
9613 }
9614 }
9615 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9616 {
9617
9618 if (!ctx.
Read(itemQBIndex))
9619 {
9621 return false;
9622 }
9623 if (itemQBIndex != -1 && player)
9624 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9625 }
9626 }
9627
9628 if (version < 140)
9629 {
9630
9631 if (!LoadVariables(ctx, version))
9632 {
9634 return false;
9635 }
9636 }
9637
9638
9640 {
9642 return false;
9643 }
9644 if (version >= 132)
9645 {
9647 if (raib)
9648 {
9650 {
9652 return false;
9653 }
9654 }
9655 }
9656
9658 return true;
9659 }
9660
9661
9662
9664 {
9665 super.OnStoreSave(ctx);
9666
9667 PlayerBase player;
9668 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9669 {
9671
9672 int itemQBIndex = -1;
9673 itemQBIndex = player.FindQuickBarEntityIndex(this);
9674 ctx.
Write(itemQBIndex);
9675 }
9676 else
9677 {
9679 }
9680
9682
9684 if (raib)
9685 {
9687 }
9688 }
9689
9690
9692 {
9693 super.AfterStoreLoad();
9694
9696 {
9698 }
9699
9701 {
9704 }
9705 }
9706
9708 {
9709 super.EEOnAfterLoad();
9710
9712 {
9714 }
9715
9718 }
9719
9721 {
9722 return false;
9723 }
9724
9725
9726
9728 {
9730 {
9731 #ifdef PLATFORM_CONSOLE
9732
9734 {
9736 if (menu)
9737 {
9739 }
9740 }
9741 #endif
9742 }
9743
9745 {
9748 }
9749
9751 {
9752 SetWeightDirty();
9754 }
9756 {
9759 }
9760
9762 {
9765 }
9767 {
9770 }
9771
9772 super.OnVariablesSynchronized();
9773 }
9774
9775
9776
9778 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9779 {
9780 if (!IsServerCheck(allow_client))
9781 return false;
9782
9784 return false;
9785
9788
9789 if (value <= (min + 0.001))
9790 value = min;
9791
9792 if (value == min)
9793 {
9794 if (destroy_config)
9795 {
9796 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9797 if (dstr)
9798 {
9800 this.Delete();
9801 return true;
9802 }
9803 }
9804 else if (destroy_forced)
9805 {
9807 this.Delete();
9808 return true;
9809 }
9810
9812 }
9813
9816
9818 {
9820
9821 if (delta)
9823 }
9824
9826
9827 return false;
9828 }
9829
9830
9832 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9833 {
9835 }
9836
9838 {
9841 }
9842
9844 {
9847 }
9848
9850 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9851 {
9852 float value_clamped = Math.Clamp(value, 0, 1);
9854 SetQuantity(result, destroy_config, destroy_forced);
9855 }
9856
9857
9860 {
9862 }
9863
9865 {
9867 }
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9879 {
9880 int slot = -1;
9881 if (GetInventory())
9882 {
9883 InventoryLocation il = new InventoryLocation;
9884 GetInventory().GetCurrentInventoryLocation(il);
9886 }
9887
9889 }
9890
9892 {
9893 float quantity_max = 0;
9894
9896 {
9897 if (attSlotID != -1)
9898 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9899
9900 if (quantity_max <= 0)
9902 }
9903
9904 if (quantity_max <= 0)
9906
9907 return quantity_max;
9908 }
9909
9911 {
9913 }
9914
9916 {
9918 }
9919
9920
9922 {
9924 }
9925
9927 {
9929 }
9930
9932 {
9934 }
9935
9936
9938 {
9939
9940 float weightEx = GetWeightEx();
9941 float special = GetInventoryAndCargoWeight();
9942 return weightEx - special;
9943 }
9944
9945
9947 {
9949 }
9950
9952 {
9954 {
9955 #ifdef DEVELOPER
9956 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9957 {
9958 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9960 }
9961 #endif
9962
9964 }
9965 else if (HasEnergyManager())
9966 {
9967 #ifdef DEVELOPER
9968 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9969 {
9970 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9971 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9972 }
9973 #endif
9974 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9975 }
9976 else
9977 {
9978 #ifdef DEVELOPER
9979 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9980 {
9981 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9982 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9983 }
9984 #endif
9985 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9986 }
9987 }
9988
9991 {
9992 int item_count = 0;
9994
9995 if (GetInventory().GetCargo() != NULL)
9996 {
9997 item_count = GetInventory().GetCargo().GetItemCount();
9998 }
9999
10000 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10001 {
10002 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10003 if (item)
10004 item_count += item.GetNumberOfItems();
10005 }
10006 return item_count;
10007 }
10008
10011 {
10012 float weight = 0;
10013 float wetness = 1;
10014 if (include_wetness)
10017 {
10018 weight = wetness * m_ConfigWeight;
10019 }
10021 {
10022 weight = 1;
10023 }
10024 return weight;
10025 }
10026
10027
10028
10030 {
10031 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10032 {
10033 GameInventory inv = GetInventory();
10034 array<EntityAI> items = new array<EntityAI>;
10036 for (int i = 0; i < items.Count(); i++)
10037 {
10039 if (item)
10040 {
10042 }
10043 }
10044 }
10045 }
10046
10047
10048
10049
10051 {
10052 float energy = 0;
10053 if (HasEnergyManager())
10054 {
10055 energy = GetCompEM().GetEnergy();
10056 }
10057 return energy;
10058 }
10059
10060
10062 {
10063 super.OnEnergyConsumed();
10064
10066 }
10067
10069 {
10070 super.OnEnergyAdded();
10071
10073 }
10074
10075
10077 {
10078 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10079 {
10081 {
10082 float energy_0to1 = GetCompEM().GetEnergy0To1();
10084 }
10085 }
10086 }
10087
10088
10090 {
10091 return ConfigGetFloat("heatIsolation");
10092 }
10093
10095 {
10097 }
10098
10100 {
10101 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10102 if (
GetGame().ConfigIsExisting(paramPath))
10104
10105 return 0.0;
10106 }
10107
10109 {
10110 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10111 if (
GetGame().ConfigIsExisting(paramPath))
10113
10114 return 0.0;
10115 }
10116
10117 override void SetWet(
float value,
bool allow_client =
false)
10118 {
10119 if (!IsServerCheck(allow_client))
10120 return;
10121
10124
10126
10127 m_VarWet = Math.Clamp(value, min, max);
10128
10130 {
10133 }
10134 }
10135
10136 override void AddWet(
float value)
10137 {
10139 }
10140
10142 {
10144 }
10145
10147 {
10149 }
10150
10152 {
10154 }
10155
10157 {
10159 }
10160
10162 {
10164 }
10165
10166 override void OnWetChanged(
float newVal,
float oldVal)
10167 {
10170 if (newLevel != oldLevel)
10171 {
10173 }
10174 }
10175
10177 {
10178 SetWeightDirty();
10179 }
10180
10182 {
10183 return GetWetLevelInternal(
m_VarWet);
10184 }
10185
10186
10187
10189 {
10191 }
10192
10194 {
10196 }
10197
10199 {
10201 }
10202
10204 {
10206 }
10207
10208
10209
10211 {
10212 if (ConfigIsExisting("itemModelLength"))
10213 {
10214 return ConfigGetFloat("itemModelLength");
10215 }
10216 return 0;
10217 }
10218
10220 {
10221 if (ConfigIsExisting("itemAttachOffset"))
10222 {
10223 return ConfigGetFloat("itemAttachOffset");
10224 }
10225 return 0;
10226 }
10227
10228 override void SetCleanness(
int value,
bool allow_client =
false)
10229 {
10230 if (!IsServerCheck(allow_client))
10231 return;
10232
10234
10236
10239 }
10240
10242 {
10244 }
10245
10247 {
10248 return true;
10249 }
10250
10251
10252
10253
10255 {
10257 }
10258
10260 {
10262 }
10263
10264
10265
10266
10267 override void SetColor(
int r,
int g,
int b,
int a)
10268 {
10274 }
10276 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10277 {
10282 }
10283
10285 {
10287 }
10288
10291 {
10292 int r,g,b,a;
10294 r = r/255;
10295 g = g/255;
10296 b = b/255;
10297 a = a/255;
10298 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10299 }
10300
10301
10302
10303 override void SetLiquidType(
int value,
bool allow_client =
false)
10304 {
10305 if (!IsServerCheck(allow_client))
10306 return;
10307
10312 }
10313
10315 {
10316 return ConfigGetInt("varLiquidTypeInit");
10317 }
10318
10320 {
10322 }
10323
10325 {
10327 SetFrozen(false);
10328 }
10329
10332 {
10333 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10334 }
10335
10336
10339 {
10340 PlayerBase nplayer;
10341 if (PlayerBase.CastTo(nplayer, player))
10342 {
10344
10345 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10346 }
10347 }
10348
10349
10352 {
10353 PlayerBase nplayer;
10354 if (PlayerBase.CastTo(nplayer,player))
10355 {
10356
10357 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10358
10359 }
10360
10361
10362 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10363
10364
10365 if (HasEnergyManager())
10366 {
10367 GetCompEM().UpdatePlugState();
10368 }
10369 }
10370
10371
10373 {
10374 super.OnPlacementStarted(player);
10375
10377 }
10378
10379 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10380 {
10382 {
10383 m_AdminLog.OnPlacementComplete(player,
this);
10384 }
10385
10386 super.OnPlacementComplete(player, position, orientation);
10387 }
10388
10389
10390
10391
10392
10394 {
10396 {
10397 return true;
10398 }
10399 else
10400 {
10401 return false;
10402 }
10403 }
10404
10405
10407 {
10409 {
10411 }
10412 }
10413
10414
10416 {
10418 }
10419
10421 {
10423 }
10424
10425 override void InsertAgent(
int agent,
float count = 1)
10426 {
10427 if (count < 1)
10428 return;
10429
10431 }
10432
10435 {
10437 }
10438
10439
10441 {
10443 }
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10487 {
10489 return false;
10490 return true;
10491 }
10492
10494 {
10495
10497 }
10498
10499
10502 {
10503 super.CheckForRoofLimited(timeTresholdMS);
10504
10506 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10507 {
10508 m_PreviousRoofTestTime = time;
10509 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10510 }
10511 }
10512
10513
10515 {
10517 {
10518 return 0;
10519 }
10520
10521 if (GetInventory().GetAttachmentSlotsCount() != 0)
10522 {
10523 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10524 if (filter)
10525 return filter.GetProtectionLevel(type, false, system);
10526 else
10527 return 0;
10528 }
10529
10530 string subclassPath, entryName;
10531
10532 switch (type)
10533 {
10535 entryName = "biological";
10536 break;
10538 entryName = "chemical";
10539 break;
10540 default:
10541 entryName = "biological";
10542 break;
10543 }
10544
10545 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10546
10548 }
10549
10550
10551
10554 {
10555 if (!IsMagazine())
10557
10559 }
10560
10561
10562
10563
10564
10569 {
10570 return true;
10571 }
10572
10574 {
10576 }
10577
10578
10579
10580
10581
10583 {
10584 if (parent)
10585 {
10586 if (parent.IsInherited(DayZInfected))
10587 return true;
10588
10589 if (!parent.IsRuined())
10590 return true;
10591 }
10592
10593 return true;
10594 }
10595
10597 {
10598 if (!super.CanPutAsAttachment(parent))
10599 {
10600 return false;
10601 }
10602
10603 if (!IsRuined() && !parent.IsRuined())
10604 {
10605 return true;
10606 }
10607
10608 return false;
10609 }
10610
10612 {
10613
10614
10615
10616
10617 return super.CanReceiveItemIntoCargo(item);
10618 }
10619
10621 {
10622
10623
10624
10625
10626 GameInventory attachmentInv = attachment.GetInventory();
10628 {
10629 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10630 return false;
10631 }
10632
10633 InventoryLocation loc = new InventoryLocation();
10634 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10635 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10636 return false;
10637
10638 return super.CanReceiveAttachment(attachment, slotId);
10639 }
10640
10642 {
10643 if (!super.CanReleaseAttachment(attachment))
10644 return false;
10645
10646 return GetInventory().AreChildrenAccessible();
10647 }
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10670 {
10671 int id = muzzle_owner.GetMuzzleID();
10672 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10673
10674 if (WPOF_array)
10675 {
10676 for (int i = 0; i < WPOF_array.Count(); i++)
10677 {
10678 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10679
10680 if (WPOF)
10681 {
10682 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10683 }
10684 }
10685 }
10686 }
10687
10688
10690 {
10691 int id = muzzle_owner.GetMuzzleID();
10693
10694 if (WPOBE_array)
10695 {
10696 for (int i = 0; i < WPOBE_array.Count(); i++)
10697 {
10698 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10699
10700 if (WPOBE)
10701 {
10702 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10703 }
10704 }
10705 }
10706 }
10707
10708
10710 {
10711 int id = muzzle_owner.GetMuzzleID();
10712 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10713
10714 if (WPOOH_array)
10715 {
10716 for (int i = 0; i < WPOOH_array.Count(); i++)
10717 {
10718 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10719
10720 if (WPOOH)
10721 {
10722 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10723 }
10724 }
10725 }
10726 }
10727
10728
10730 {
10731 int id = muzzle_owner.GetMuzzleID();
10732 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10733
10734 if (WPOOH_array)
10735 {
10736 for (int i = 0; i < WPOOH_array.Count(); i++)
10737 {
10738 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10739
10740 if (WPOOH)
10741 {
10742 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10743 }
10744 }
10745 }
10746 }
10747
10748
10750 {
10751 int id = muzzle_owner.GetMuzzleID();
10752 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10753
10754 if (WPOOH_array)
10755 {
10756 for (int i = 0; i < WPOOH_array.Count(); i++)
10757 {
10758 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10759
10760 if (WPOOH)
10761 {
10762 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10763 }
10764 }
10765 }
10766 }
10767
10768
10769
10771 {
10773 {
10774 return true;
10775 }
10776
10777 return false;
10778 }
10779
10781 {
10783 {
10784 return true;
10785 }
10786
10787 return false;
10788 }
10789
10791 {
10793 {
10794 return true;
10795 }
10796
10797 return false;
10798 }
10799
10801 {
10802 return false;
10803 }
10804
10807 {
10808 return UATimeSpent.DEFAULT_DEPLOY;
10809 }
10810
10811
10812
10813
10815 {
10817 SetSynchDirty();
10818 }
10819
10821 {
10823 }
10824
10825
10827 {
10828 return false;
10829 }
10830
10833 {
10834 string att_type = "None";
10835
10836 if (ConfigIsExisting("soundAttType"))
10837 {
10838 att_type = ConfigGetString("soundAttType");
10839 }
10840
10842 }
10843
10845 {
10847 }
10848
10849
10850
10851
10852
10858
10860 {
10863
10865 }
10866
10867
10869 {
10871 return;
10872
10874
10877
10880
10881 SoundParameters params = new SoundParameters();
10885 }
10886
10887
10889 {
10891 return;
10892
10894 SetSynchDirty();
10895
10898 }
10899
10900
10902 {
10904 return;
10905
10907 SetSynchDirty();
10908
10911 }
10912
10914 {
10916 }
10917
10919 {
10921 }
10922
10925 {
10926 if (!
GetGame().IsDedicatedServer())
10927 {
10928 if (ConfigIsExisting("attachSoundSet"))
10929 {
10930 string cfg_path = "";
10931 string soundset = "";
10932 string type_name =
GetType();
10933
10936 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10937 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10938
10939 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10940 {
10941 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10942 {
10943 if (cfg_slot_array[i] == slot_type)
10944 {
10945 soundset = cfg_soundset_array[i];
10946 break;
10947 }
10948 }
10949 }
10950
10951 if (soundset != "")
10952 {
10953 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10955 }
10956 }
10957 }
10958 }
10959
10961 {
10962
10963 }
10964
10965 void OnApply(PlayerBase player);
10966
10968 {
10969 return 1.0;
10970 };
10971
10973 {
10975 }
10976
10978 {
10980 }
10981
10983
10985 {
10986 SetDynamicPhysicsLifeTime(0.01);
10988 }
10989
10991 {
10992 array<string> zone_names = new array<string>;
10993 GetDamageZones(zone_names);
10994 for (int i = 0; i < zone_names.Count(); i++)
10995 {
10996 SetHealthMax(zone_names.Get(i),"Health");
10997 }
10998 SetHealthMax("","Health");
10999 }
11000
11003 {
11004 float global_health = GetHealth01("","Health");
11005 array<string> zones = new array<string>;
11006 GetDamageZones(zones);
11007
11008 for (int i = 0; i < zones.Count(); i++)
11009 {
11010 SetHealth01(zones.Get(i),"Health",global_health);
11011 }
11012 }
11013
11016 {
11017 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11018 }
11019
11021 {
11022 if (!hasRootAsPlayer)
11023 {
11024 if (refParentIB)
11025 {
11026
11027 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11028 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11029
11030 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11031 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11032
11035 }
11036 else
11037 {
11038
11041 }
11042 }
11043 }
11044
11046 {
11048 {
11049 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11050 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
11051 {
11052 float heatPermCoef = 1.0;
11054 while (ent)
11055 {
11056 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11057 ent = ent.GetHierarchyParent();
11058 }
11059
11060 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11061 }
11062 }
11063 }
11064
11066 {
11067
11068 EntityAI parent = GetHierarchyParent();
11069 if (!parent)
11070 {
11071 hasParent = false;
11072 hasRootAsPlayer = false;
11073 }
11074 else
11075 {
11076 hasParent = true;
11077 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11078 refParentIB =
ItemBase.Cast(parent);
11079 }
11080 }
11081
11082 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11083 {
11084
11085 }
11086
11088 {
11089
11090 return false;
11091 }
11092
11094 {
11095
11096
11097 return false;
11098 }
11099
11101 {
11102
11103 return false;
11104 }
11105
11108 {
11109 return !GetIsFrozen() &&
IsOpen();
11110 }
11111
11113 {
11114 bool hasParent = false, hasRootAsPlayer = false;
11116
11117 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11118 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11119
11120 if (wwtu || foodDecay)
11121 {
11125
11126 if (processWetness || processTemperature || processDecay)
11127 {
11129
11130 if (processWetness)
11131 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11132
11133 if (processTemperature)
11135
11136 if (processDecay)
11137 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11138 }
11139 }
11140 }
11141
11144 {
11146 }
11147
11149 {
11152
11153 return super.GetTemperatureFreezeThreshold();
11154 }
11155
11157 {
11160
11161 return super.GetTemperatureThawThreshold();
11162 }
11163
11165 {
11168
11169 return super.GetItemOverheatThreshold();
11170 }
11171
11173 {
11175 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11176
11177 return super.GetTemperatureFreezeTime();
11178 }
11179
11181 {
11183 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11184
11185 return super.GetTemperatureThawTime();
11186 }
11187
11192
11194 {
11195 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11196 }
11197
11199 {
11200 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11201 }
11202
11205 {
11207 }
11208
11210 {
11212 }
11213
11215 {
11217 }
11218
11221 {
11222 return null;
11223 }
11224
11227 {
11228 return false;
11229 }
11230
11232 {
11234 {
11237 if (!trg)
11238 {
11240 explosive = this;
11241 }
11242
11243 explosive.PairRemote(trg);
11245
11246 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11247 trg.SetPersistentPairID(persistentID);
11248 explosive.SetPersistentPairID(persistentID);
11249
11250 return true;
11251 }
11252 return false;
11253 }
11254
11257 {
11258 float ret = 1.0;
11261 ret *= GetHealth01();
11262
11263 return ret;
11264 }
11265
11266 #ifdef DEVELOPER
11267 override void SetDebugItem()
11268 {
11269 super.SetDebugItem();
11270 _itemBase = this;
11271 }
11272
11274 {
11275 string text = super.GetDebugText();
11276
11278 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11279
11280 return text;
11281 }
11282 #endif
11283
11285 {
11286 return true;
11287 }
11288
11290
11292
11294 {
11297 }
11298
11299
11307
11323}
11324
11326{
11328 if (entity)
11329 {
11330 bool is_item = entity.IsInherited(
ItemBase);
11331 if (is_item && full_quantity)
11332 {
11335 }
11336 }
11337 else
11338 {
11340 return NULL;
11341 }
11342 return entity;
11343}
11344
11346{
11347 if (item)
11348 {
11349 if (health > 0)
11350 item.SetHealth("", "", health);
11351
11352 if (item.CanHaveTemperature())
11353 {
11355 if (item.CanFreeze())
11356 item.SetFrozen(false);
11357 }
11358
11359 if (item.HasEnergyManager())
11360 {
11361 if (quantity >= 0)
11362 {
11363 item.GetCompEM().SetEnergy0To1(quantity);
11364 }
11365 else
11366 {
11368 }
11369 }
11370 else if (item.IsMagazine())
11371 {
11372 Magazine mag = Magazine.Cast(item);
11373 if (quantity >= 0)
11374 {
11375 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11376 }
11377 else
11378 {
11380 }
11381
11382 }
11383 else
11384 {
11385 if (quantity >= 0)
11386 {
11387 item.SetQuantityNormalized(quantity, false);
11388 }
11389 else
11390 {
11392 }
11393
11394 }
11395 }
11396}
11397
11398#ifdef DEVELOPER
11400#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.