6419{
6421 {
6422 return true;
6423 }
6424};
6425
6426
6427
6429{
6433
6435
6438
6439
6440
6441
6442
6451
6457
6462
6467
6488 protected bool m_IsResultOfSplit
6489
6491
6496
6497
6498
6500
6504
6505
6506
6508
6511
6512
6513
6519
6520
6528
6531
6532
6534
6535
6537
6538
6543
6544
6549
6550
6552
6553
6555 {
6560
6561 if (!
GetGame().IsDedicatedServer())
6562 {
6564 {
6566
6568 {
6570 }
6571 }
6572
6575 }
6576
6577 m_OldLocation = null;
6578
6580 {
6582 }
6583
6584 if (ConfigIsExisting("headSelectionsToHide"))
6585 {
6588 }
6589
6591 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6592 {
6594 }
6595
6597
6598 m_IsResultOfSplit = false;
6599
6601 }
6602
6604 {
6605 super.InitItemVariables();
6606
6612 m_Count = ConfigGetInt(
"count");
6613
6616
6621
6624
6629
6641
6645
6646
6649 if (ConfigIsExisting("canBeSplit"))
6650 {
6653 }
6654
6656 if (ConfigIsExisting("itemBehaviour"))
6658
6659
6662 RegisterNetSyncVariableInt("m_VarLiquidType");
6663 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6664
6665 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6666 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6667 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6668
6669 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6670 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6671 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6672 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6673
6674 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6675 RegisterNetSyncVariableBool("m_IsTakeable");
6676 RegisterNetSyncVariableBool("m_IsHologram");
6677
6680 {
6683 }
6684
6686
6688 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6690
6691 }
6692
6694 {
6696 }
6697
6699 {
6702 {
6707 }
6708 }
6709
6710 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6711 {
6713 {
6716 }
6717
6719 }
6720
6722 {
6728 }
6729
6731
6733 {
6735
6736 if (!action)
6737 {
6738 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6739 return;
6740 }
6741
6743 if (!ai)
6744 {
6746 return;
6747 }
6748
6750 if (!action_array)
6751 {
6752 action_array = new array<ActionBase_Basic>;
6754 }
6755 if (LogManager.IsActionLogEnable())
6756 {
6757 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6758 }
6759
6760 if (action_array.Find(action) != -1)
6761 {
6762 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6763 }
6764 else
6765 {
6766 action_array.Insert(action);
6767 }
6768 }
6769
6771 {
6773 ActionBase action = player.GetActionManager().GetAction(actionName);
6776
6777 if (action_array)
6778 {
6779 action_array.RemoveItem(action);
6780 }
6781 }
6782
6783
6784
6786 {
6787 ActionOverrideData overrideData = new ActionOverrideData();
6791
6793 if (!actionMap)
6794 {
6797 }
6798
6799 actionMap.Insert(this.
Type(), overrideData);
6800
6801 }
6802
6804
6806
6807
6809 {
6812
6815
6816 string config_to_search = "CfgVehicles";
6817 string muzzle_owner_config;
6818
6820 {
6821 if (IsInherited(Weapon))
6822 config_to_search = "CfgWeapons";
6823
6824 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6825
6826 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6827
6829
6830 if (config_OnFire_subclass_count > 0)
6831 {
6832 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6833
6834 for (int i = 0; i < config_OnFire_subclass_count; i++)
6835 {
6836 string particle_class = "";
6838 string config_OnFire_entry = config_OnFire_class + particle_class;
6839 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6840 WPOF_array.Insert(WPOF);
6841 }
6842
6843
6845 }
6846 }
6847
6849 {
6850 config_to_search = "CfgWeapons";
6851 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6852
6853 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6854
6856
6857 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6858 {
6859 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6860
6861 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6862 {
6863 string particle_class2 = "";
6865 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6866 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6867 WPOBE_array.Insert(WPOBE);
6868 }
6869
6870
6872 }
6873 }
6874 }
6875
6876
6878 {
6881
6883 {
6884 string config_to_search = "CfgVehicles";
6885
6886 if (IsInherited(Weapon))
6887 config_to_search = "CfgWeapons";
6888
6889 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6890 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6891
6892 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6893 {
6894
6896
6898 {
6900 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6902 return;
6903 }
6904
6907
6908
6909
6911 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6912
6913 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6914 {
6915 string particle_class = "";
6917 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6919
6920 if (entry_type == CT_CLASS)
6921 {
6922 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6923 WPOOH_array.Insert(WPOF);
6924 }
6925 }
6926
6927
6929 }
6930 }
6931 }
6932
6934 {
6936 }
6937
6939 {
6941 {
6943
6946
6949
6950 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6951 }
6952 }
6953
6955 {
6957 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6958
6960 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6961
6963 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6964
6966 {
6968 }
6969 }
6970
6972 {
6974 }
6975
6977 {
6980 else
6982
6984 {
6987 }
6988 else
6989 {
6992
6995 }
6996
6998 }
6999
7001 {
7003 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7004 }
7005
7007 {
7009 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7011 }
7012
7014 {
7016 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7017 }
7018
7020 {
7023
7024 OverheatingParticle OP = new OverheatingParticle();
7029
7031 }
7032
7034 {
7037
7038 return -1;
7039 }
7040
7042 {
7044 {
7047
7048 for (int i = count; i > 0; --i)
7049 {
7050 int id = i - 1;
7053
7056
7057 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7058 {
7059 if (p)
7060 {
7063 }
7064 }
7065 }
7066 }
7067 }
7068
7070 {
7072 {
7074 {
7075 int id = i - 1;
7077
7078 if (OP)
7079 {
7081
7082 if (p)
7083 {
7085 }
7086
7087 delete OP;
7088 }
7089 }
7090
7093 }
7094 }
7095
7098 {
7099 return 0.0;
7100 }
7101
7102
7104 {
7105 return 250;
7106 }
7107
7109 {
7110 return 0;
7111 }
7112
7115 {
7117 return true;
7118
7119 return false;
7120 }
7121
7124 {
7127
7129 {
7131 }
7132 else
7133 {
7134
7136 }
7137
7139 }
7140
7147 {
7148 return -1;
7149 }
7150
7151
7152
7153
7155 {
7157 {
7159 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7160
7161 if (r_index >= 0)
7162 {
7163 InventoryLocation r_il = new InventoryLocation;
7164 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7165
7166 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7169 {
7170 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7171 }
7173 {
7174 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7175 }
7176
7177 }
7178
7179 player.GetHumanInventory().ClearUserReservedLocation(this);
7180 }
7181
7184 }
7185
7186
7187
7188
7190 {
7191 return ItemBase.m_DebugActionsMask;
7192 }
7193
7195 {
7196 return ItemBase.m_DebugActionsMask & mask;
7197 }
7198
7200 {
7201 ItemBase.m_DebugActionsMask = mask;
7202 }
7203
7205 {
7206 ItemBase.m_DebugActionsMask |= mask;
7207 }
7208
7210 {
7211 ItemBase.m_DebugActionsMask &= ~mask;
7212 }
7213
7215 {
7217 {
7219 }
7220 else
7221 {
7223 }
7224 }
7225
7226
7228 {
7229 if (GetEconomyProfile())
7230 {
7231 float q_max = GetEconomyProfile().GetQuantityMax();
7232 if (q_max > 0)
7233 {
7234 float q_min = GetEconomyProfile().GetQuantityMin();
7235 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7236
7238 {
7239 ComponentEnergyManager comp = GetCompEM();
7241 {
7243 }
7244 }
7246 {
7248
7249 }
7250
7251 }
7252 }
7253 }
7254
7257 {
7258 EntityAI parent = GetHierarchyParent();
7259
7260 if (parent)
7261 {
7262 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7263 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7264 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7265 }
7266 }
7267
7270 {
7271 EntityAI parent = GetHierarchyParent();
7272
7273 if (parent)
7274 {
7275 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7276 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7277 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7278 }
7279 }
7280
7282 {
7283
7284
7285
7286
7288
7290 {
7291 if (ScriptInputUserData.CanStoreInputUserData())
7292 {
7293 ScriptInputUserData ctx = new ScriptInputUserData;
7299 ctx.
Write(use_stack_max);
7302
7304 {
7305 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7306 }
7307 }
7308 }
7309 else if (!
GetGame().IsMultiplayer())
7310 {
7312 }
7313 }
7314
7316 {
7318 }
7319
7321 {
7323 }
7324
7326 {
7328 }
7329
7331 {
7332
7333 return false;
7334 }
7335
7337 {
7338 return false;
7339 }
7340
7344 {
7345 return false;
7346 }
7347
7349 {
7350 return "";
7351 }
7352
7354
7356 {
7357 return false;
7358 }
7359
7361 {
7362 return true;
7363 }
7364
7365
7366
7368 {
7369 return true;
7370 }
7371
7373 {
7374 return true;
7375 }
7376
7378 {
7379 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7381 }
7382
7384 {
7386 }
7387
7389 {
7391 if (!is_being_placed)
7393 SetSynchDirty();
7394 }
7395
7396
7398
7400 {
7402 }
7403
7405 {
7407 }
7408
7410 {
7411 return 1;
7412 }
7413
7415 {
7416 return false;
7417 }
7418
7420 {
7422 SetSynchDirty();
7423 }
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7460 {
7461 super.OnMovedInsideCargo(container);
7462
7463 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7464 }
7465
7466 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7467 {
7468 super.EEItemLocationChanged(oldLoc,newLoc);
7469
7470 PlayerBase new_player = null;
7471 PlayerBase old_player = null;
7472
7473 if (newLoc.GetParent())
7474 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7475
7476 if (oldLoc.GetParent())
7477 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7478
7480 {
7481 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7482
7483 if (r_index >= 0)
7484 {
7485 InventoryLocation r_il = new InventoryLocation;
7486 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7487
7488 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7491 {
7492 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7493 }
7495 {
7496 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7497 }
7498
7499 }
7500 }
7501
7503 {
7504 if (new_player)
7505 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7506
7507 if (new_player == old_player)
7508 {
7509
7510 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7511 {
7513 {
7514 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7515 {
7516 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7517 }
7518 }
7519 else
7520 {
7521 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7522 }
7523 }
7524
7525 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7526 {
7527 int type = oldLoc.GetType();
7529 {
7530 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7531 }
7533 {
7534 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7535 }
7536 }
7537 if (!m_OldLocation)
7538 {
7539 m_OldLocation = new InventoryLocation;
7540 }
7541 m_OldLocation.Copy(oldLoc);
7542 }
7543 else
7544 {
7545 if (m_OldLocation)
7546 {
7547 m_OldLocation.Reset();
7548 }
7549 }
7550
7552 }
7553 else
7554 {
7555 if (new_player)
7556 {
7557 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7558 if (res_index >= 0)
7559 {
7560 InventoryLocation il = new InventoryLocation;
7561 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7563 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7566 {
7567 il.
GetParent().GetOnReleaseLock().Invoke(it);
7568 }
7570 {
7572 }
7573
7574 }
7575 }
7577 {
7578
7580 }
7581
7582 if (m_OldLocation)
7583 {
7584 m_OldLocation.Reset();
7585 }
7586 }
7587 }
7588
7589 override void EOnContact(IEntity other, Contact extra)
7590 {
7592 {
7593 int liquidType = -1;
7595 if (impactSpeed > 0.0)
7596 {
7598 #ifndef SERVER
7600 #else
7602 SetSynchDirty();
7603 #endif
7605 }
7606 }
7607
7608 #ifdef SERVER
7609 if (GetCompEM() && GetCompEM().IsPlugged())
7610 {
7611 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7612 GetCompEM().UnplugThis();
7613 }
7614 #endif
7615 }
7616
7618
7620 {
7622 }
7623
7625 {
7626
7627 }
7628
7630 {
7631 super.OnItemLocationChanged(old_owner, new_owner);
7632
7633 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7634 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7635
7636 if (!relatedPlayer && playerNew)
7637 relatedPlayer = playerNew;
7638
7639 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7640 {
7642 if (actionMgr)
7643 {
7644 ActionBase currentAction = actionMgr.GetRunningAction();
7645 if (currentAction)
7647 }
7648 }
7649
7650 Man ownerPlayerOld = null;
7651 Man ownerPlayerNew = null;
7652
7653 if (old_owner)
7654 {
7655 if (old_owner.
IsMan())
7656 {
7657 ownerPlayerOld = Man.Cast(old_owner);
7658 }
7659 else
7660 {
7661 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7662 }
7663 }
7664 else
7665 {
7667 {
7669
7670 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7671 {
7672 GetCompEM().UnplugThis();
7673 }
7674 }
7675 }
7676
7677 if (new_owner)
7678 {
7679 if (new_owner.
IsMan())
7680 {
7681 ownerPlayerNew = Man.Cast(new_owner);
7682 }
7683 else
7684 {
7685 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7686 }
7687 }
7688
7689 if (ownerPlayerOld != ownerPlayerNew)
7690 {
7691 if (ownerPlayerOld)
7692 {
7693 array<EntityAI> subItemsExit = new array<EntityAI>;
7695 for (int i = 0; i < subItemsExit.Count(); i++)
7696 {
7699 }
7700 }
7701
7702 if (ownerPlayerNew)
7703 {
7704 array<EntityAI> subItemsEnter = new array<EntityAI>;
7706 for (int j = 0; j < subItemsEnter.Count(); j++)
7707 {
7710 }
7711 }
7712 }
7713 else if (ownerPlayerNew != null)
7714 {
7715 PlayerBase nplayer;
7716 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7717 {
7718 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7720 for (int k = 0; k < subItemsUpdate.Count(); k++)
7721 {
7723 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7724 }
7725 }
7726 }
7727
7728 if (old_owner)
7729 old_owner.OnChildItemRemoved(this);
7730 if (new_owner)
7731 new_owner.OnChildItemReceived(this);
7732 }
7733
7734
7736 {
7737 super.EEDelete(parent);
7738 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7739 if (player)
7740 {
7742
7743 if (player.IsAlive())
7744 {
7745 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7746 if (r_index >= 0)
7747 {
7748 InventoryLocation r_il = new InventoryLocation;
7749 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7750
7751 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7754 {
7755 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7756 }
7758 {
7759 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7760 }
7761
7762 }
7763
7764 player.RemoveQuickBarEntityShortcut(this);
7765 }
7766 }
7767 }
7768
7770 {
7771 super.EEKilled(killer);
7772
7775 {
7776 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7777 {
7778 if (IsMagazine())
7779 {
7780 if (Magazine.Cast(this).GetAmmoCount() > 0)
7781 {
7783 }
7784 }
7785 else
7786 {
7788 }
7789 }
7790 }
7791 }
7792
7794 {
7795 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7796
7797 super.OnWasAttached(parent, slot_id);
7798
7801
7803 }
7804
7806 {
7807 super.OnWasDetached(parent, slot_id);
7808
7811 }
7812
7814 {
7815 int idx;
7818
7819 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7820 if (inventory_slots.Count() < 1)
7821 {
7822 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7823 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7824 }
7825 else
7826 {
7827 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7828 }
7829
7830 idx = inventory_slots.Find(slot);
7831 if (idx < 0)
7832 return "";
7833
7834 return attach_types.Get(idx);
7835 }
7836
7838 {
7839 int idx = -1;
7840 string slot;
7841
7844
7845 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7846 if (inventory_slots.Count() < 1)
7847 {
7848 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7849 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7850 }
7851 else
7852 {
7853 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7854 if (detach_types.Count() < 1)
7855 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7856 }
7857
7858 for (int i = 0; i < inventory_slots.Count(); i++)
7859 {
7860 slot = inventory_slots.Get(i);
7861 }
7862
7863 if (slot != "")
7864 {
7865 if (detach_types.Count() == 1)
7866 idx = 0;
7867 else
7868 idx = inventory_slots.Find(slot);
7869 }
7870 if (idx < 0)
7871 return "";
7872
7873 return detach_types.Get(idx);
7874 }
7875
7877 {
7878
7880
7881
7882 float min_time = 1;
7883 float max_time = 3;
7884 float delay = Math.RandomFloat(min_time, max_time);
7885
7886 explode_timer.Run(delay, this, "DoAmmoExplosion");
7887 }
7888
7890 {
7891 Magazine magazine = Magazine.Cast(this);
7892 int pop_sounds_count = 6;
7893 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7894
7895
7896 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7897 string sound_name = pop_sounds[ sound_idx ];
7899
7900
7901 magazine.ServerAddAmmoCount(-1);
7902
7903
7904 float min_temp_to_explode = 100;
7905
7906 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7907 {
7909 }
7910 }
7911
7912
7913 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7914 {
7915 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7916
7917 const int CHANCE_DAMAGE_CARGO = 4;
7918 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7919 const int CHANCE_DAMAGE_NOTHING = 2;
7920
7922 {
7923 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7924 int chances;
7925 int rnd;
7926
7927 if (GetInventory().GetCargo())
7928 {
7929 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7930 rnd = Math.RandomInt(0,chances);
7931
7932 if (rnd < CHANCE_DAMAGE_CARGO)
7933 {
7935 }
7936 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7937 {
7939 }
7940 }
7941 else
7942 {
7943 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7944 rnd = Math.RandomInt(0,chances);
7945
7946 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7947 {
7949 }
7950 }
7951 }
7952 }
7953
7955 {
7956 if (GetInventory().GetCargo())
7957 {
7958 int item_count = GetInventory().GetCargo().GetItemCount();
7959 if (item_count > 0)
7960 {
7961 int random_pick = Math.RandomInt(0, item_count);
7963 if (!item.IsExplosive())
7964 {
7965 item.AddHealth("","",damage);
7966 return true;
7967 }
7968 }
7969 }
7970 return false;
7971 }
7972
7974 {
7975 int attachment_count = GetInventory().AttachmentCount();
7976 if (attachment_count > 0)
7977 {
7978 int random_pick = Math.RandomInt(0, attachment_count);
7979 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7980 if (!attachment.IsExplosive())
7981 {
7982 attachment.AddHealth("","",damage);
7983 return true;
7984 }
7985 }
7986 return false;
7987 }
7988
7990 {
7992 }
7993
7995 {
7997 return GetInventory().CanRemoveEntity();
7998
7999 return false;
8000 }
8001
8003 {
8004
8006 return false;
8007
8008
8010 return false;
8011
8012
8013
8015 if (delta == 0)
8016 return false;
8017
8018
8019 return true;
8020 }
8021
8023 {
8025 {
8026 if (ScriptInputUserData.CanStoreInputUserData())
8027 {
8028 ScriptInputUserData ctx = new ScriptInputUserData;
8033 ctx.
Write(destination_entity);
8037 }
8038 }
8039 else if (!
GetGame().IsMultiplayer())
8040 {
8042 }
8043 }
8044
8046 {
8047 float split_quantity_new;
8051 InventoryLocation loc = new InventoryLocation;
8052
8053 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8054 {
8056 split_quantity_new = stack_max;
8057 else
8059
8061 {
8062 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8063 if (new_item)
8064 {
8065 new_item.SetResultOfSplit(true);
8066 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8068 new_item.
SetQuantity(split_quantity_new,
false,
true);
8069 }
8070 }
8071 }
8072 else if (destination_entity && slot_id == -1)
8073 {
8074 if (quantity > stack_max)
8075 split_quantity_new = stack_max;
8076 else
8077 split_quantity_new = quantity;
8078
8080 {
8082 {
8085 }
8086
8087 if (new_item)
8088 {
8089 new_item.SetResultOfSplit(true);
8090 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8092 new_item.
SetQuantity(split_quantity_new,
false,
true);
8093 }
8094 }
8095 }
8096 else
8097 {
8098 if (stack_max != 0)
8099 {
8101 {
8103 }
8104
8105 if (split_quantity_new == 0)
8106 {
8107 if (!
GetGame().IsMultiplayer())
8108 player.PhysicalPredictiveDropItem(this);
8109 else
8110 player.ServerDropEntity(this);
8111 return;
8112 }
8113
8115 {
8117
8118 if (new_item)
8119 {
8120 new_item.SetResultOfSplit(true);
8121 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8124 new_item.PlaceOnSurface();
8125 }
8126 }
8127 }
8128 }
8129 }
8130
8132 {
8133 float split_quantity_new;
8137 InventoryLocation loc = new InventoryLocation;
8138
8139 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8140 {
8142 split_quantity_new = stack_max;
8143 else
8145
8147 {
8148 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8149 if (new_item)
8150 {
8151 new_item.SetResultOfSplit(true);
8152 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8154 new_item.
SetQuantity(split_quantity_new,
false,
true);
8155 }
8156 }
8157 }
8158 else if (destination_entity && slot_id == -1)
8159 {
8160 if (quantity > stack_max)
8161 split_quantity_new = stack_max;
8162 else
8163 split_quantity_new = quantity;
8164
8166 {
8168 {
8171 }
8172
8173 if (new_item)
8174 {
8175 new_item.SetResultOfSplit(true);
8176 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8178 new_item.
SetQuantity(split_quantity_new,
false,
true);
8179 }
8180 }
8181 }
8182 else
8183 {
8184 if (stack_max != 0)
8185 {
8187 {
8189 }
8190
8192 {
8194
8195 if (new_item)
8196 {
8197 new_item.SetResultOfSplit(true);
8198 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8201 new_item.PlaceOnSurface();
8202 }
8203 }
8204 }
8205 }
8206 }
8207
8209 {
8211 {
8212 if (ScriptInputUserData.CanStoreInputUserData())
8213 {
8214 ScriptInputUserData ctx = new ScriptInputUserData;
8219 dst.WriteToContext(ctx);
8221 }
8222 }
8223 else if (!
GetGame().IsMultiplayer())
8224 {
8226 }
8227 }
8228
8230 {
8232 {
8233 if (ScriptInputUserData.CanStoreInputUserData())
8234 {
8235 ScriptInputUserData ctx = new ScriptInputUserData;
8240 ctx.
Write(destination_entity);
8246 }
8247 }
8248 else if (!
GetGame().IsMultiplayer())
8249 {
8251 }
8252 }
8253
8255 {
8257 }
8258
8260 {
8262 float split_quantity_new;
8264 if (dst.IsValid())
8265 {
8266 int slot_id = dst.GetSlot();
8268
8269 if (quantity > stack_max)
8270 split_quantity_new = stack_max;
8271 else
8272 split_quantity_new = quantity;
8273
8275 {
8277
8278 if (new_item)
8279 {
8280 new_item.SetResultOfSplit(true);
8281 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8283 new_item.
SetQuantity(split_quantity_new,
false,
true);
8284 }
8285
8286 return new_item;
8287 }
8288 }
8289
8290 return null;
8291 }
8292
8294 {
8296 float split_quantity_new;
8298 if (destination_entity)
8299 {
8301 if (quantity > stackable)
8302 split_quantity_new = stackable;
8303 else
8304 split_quantity_new = quantity;
8305
8307 {
8308 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8309 if (new_item)
8310 {
8311 new_item.SetResultOfSplit(true);
8312 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8314 new_item.
SetQuantity(split_quantity_new,
false,
true);
8315 }
8316 }
8317 }
8318 }
8319
8321 {
8323 {
8324 if (ScriptInputUserData.CanStoreInputUserData())
8325 {
8326 ScriptInputUserData ctx = new ScriptInputUserData;
8331 ItemBase destination_entity =
this;
8332 ctx.
Write(destination_entity);
8336 }
8337 }
8338 else if (!
GetGame().IsMultiplayer())
8339 {
8341 }
8342 }
8343
8345 {
8347 float split_quantity_new;
8349 if (player)
8350 {
8352 if (quantity > stackable)
8353 split_quantity_new = stackable;
8354 else
8355 split_quantity_new = quantity;
8356
8358 {
8359 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8360 new_item =
ItemBase.Cast(in_hands);
8361 if (new_item)
8362 {
8363 new_item.SetResultOfSplit(true);
8364 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8366 new_item.SetQuantity(split_quantity_new, false, true);
8367 }
8368 }
8369 }
8370 }
8371
8373 {
8375 float split_quantity_new = Math.Floor(quantity * 0.5);
8376
8378 return;
8379
8381
8382 if (new_item)
8383 {
8384 if (new_item.GetQuantityMax() < split_quantity_new)
8385 {
8386 split_quantity_new = new_item.GetQuantityMax();
8387 }
8388
8389 new_item.SetResultOfSplit(true);
8390 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8391
8393 {
8396 }
8397 else
8398 {
8400 new_item.
SetQuantity(split_quantity_new,
false,
true);
8401 }
8402 }
8403 }
8404
8406 {
8408 float split_quantity_new = Math.Floor(quantity / 2);
8409
8411 return;
8412
8413 InventoryLocation invloc = new InventoryLocation;
8415
8417 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8418
8419 if (new_item)
8420 {
8421 if (new_item.GetQuantityMax() < split_quantity_new)
8422 {
8423 split_quantity_new = new_item.GetQuantityMax();
8424 }
8426 {
8429 }
8430 else if (split_quantity_new > 1)
8431 {
8433 new_item.
SetQuantity(split_quantity_new,
false,
true);
8434 }
8435 }
8436 }
8437
8440 {
8441 SetWeightDirty();
8443
8444 if (parent)
8445 parent.OnAttachmentQuantityChangedEx(this, delta);
8446
8448 {
8450 {
8452 }
8454 {
8455 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8457 }
8458 }
8459
8460 }
8461
8464 {
8465
8466 }
8467
8470 {
8472 }
8473
8475 {
8476 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8477
8479 {
8480 if (newLevel == GameConstants.STATE_RUINED)
8481 {
8483 EntityAI parent = GetHierarchyParent();
8484 if (parent && parent.IsFireplace())
8485 {
8486 CargoBase cargo = GetInventory().GetCargo();
8487 if (cargo)
8488 {
8490 {
8492 }
8493 }
8494 }
8495 }
8496
8498 {
8499
8501 return;
8502 }
8503
8504 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8505 {
8507 }
8508 }
8509 }
8510
8511
8513 {
8514 super.OnRightClick();
8515
8517 {
8519 {
8520 if (ScriptInputUserData.CanStoreInputUserData())
8521 {
8522 EntityAI root = GetHierarchyRoot();
8523 Man playerOwner = GetHierarchyRootPlayer();
8524 InventoryLocation dst = new InventoryLocation;
8525
8526
8527 if (!playerOwner && root && root == this)
8528 {
8530 }
8531 else
8532 {
8533
8534 GetInventory().GetCurrentInventoryLocation(dst);
8536 {
8539 {
8541 }
8542 else
8543 {
8545
8546
8547 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8548 {
8550 }
8551 else
8552 {
8553 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8554 }
8555 }
8556 }
8557 }
8558
8559 ScriptInputUserData ctx = new ScriptInputUserData;
8567 }
8568 }
8569 else if (!
GetGame().IsMultiplayer())
8570 {
8572 }
8573 }
8574 }
8575
8577 {
8578 if (root)
8579 {
8580 vector m4[4];
8581 root.GetTransform(m4);
8582 dst.SetGround(this, m4);
8583 }
8584 else
8585 {
8586 GetInventory().GetCurrentInventoryLocation(dst);
8587 }
8588 }
8589
8590 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8591 {
8592
8593 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8594 return false;
8595
8596 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8597 return false;
8598
8599
8601 return false;
8602
8603
8604 Magazine mag = Magazine.Cast(this);
8605 if (mag)
8606 {
8607 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8608 return false;
8609
8610 if (stack_max_limit)
8611 {
8612 Magazine other_mag = Magazine.Cast(other_item);
8613 if (other_item)
8614 {
8615 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8616 return false;
8617 }
8618
8619 }
8620 }
8621 else
8622 {
8623
8625 return false;
8626
8628 return false;
8629 }
8630
8631 PlayerBase player = null;
8632 if (CastTo(player, GetHierarchyRootPlayer()))
8633 {
8634 if (player.GetInventory().HasAttachment(this))
8635 return false;
8636
8637 if (player.IsItemsToDelete())
8638 return false;
8639 }
8640
8641 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8642 return false;
8643
8644 int slotID;
8646 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8647 return false;
8648
8649 return true;
8650 }
8651
8653 {
8655 }
8656
8658 {
8659 return m_IsResultOfSplit;
8660 }
8661
8663 {
8664 m_IsResultOfSplit = value;
8665 }
8666
8668 {
8670 }
8671
8673 {
8674 float other_item_quantity = other_item.GetQuantity();
8675 float this_free_space;
8676
8678
8680
8681 if (other_item_quantity > this_free_space)
8682 {
8683 return this_free_space;
8684 }
8685 else
8686 {
8687 return other_item_quantity;
8688 }
8689 }
8690
8692 {
8694 }
8695
8697 {
8699 return;
8700
8701 if (!IsMagazine() && other_item)
8702 {
8704 if (quantity_used != 0)
8705 {
8706 float hp1 = GetHealth01("","");
8707 float hp2 = other_item.GetHealth01("","");
8708 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8709 hpResult = hpResult / (
GetQuantity() + quantity_used);
8710
8711 hpResult *= GetMaxHealth();
8712 Math.Round(hpResult);
8713 SetHealth("", "Health", hpResult);
8714
8716 other_item.AddQuantity(-quantity_used);
8717 }
8718 }
8720 }
8721
8723 {
8724 #ifdef SERVER
8725 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8726 GetHierarchyParent().IncreaseLifetimeUp();
8727 #endif
8728 };
8729
8731 {
8732 PlayerBase p = PlayerBase.Cast(player);
8733
8734 array<int> recipesIds = p.m_Recipes;
8735 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8736 if (moduleRecipesManager)
8737 {
8738 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8739 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8740 }
8741
8742 for (int i = 0;i < recipesIds.Count(); i++)
8743 {
8744 int key = recipesIds.Get(i);
8745 string recipeName = moduleRecipesManager.GetRecipeName(key);
8747 }
8748 }
8749
8750
8751 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8752 {
8753 super.GetDebugActions(outputList);
8754
8755
8761
8762
8767
8772
8773
8777
8778
8780 {
8784 }
8785
8788
8789
8793
8795
8796 InventoryLocation loc = new InventoryLocation();
8797 GetInventory().GetCurrentInventoryLocation(loc);
8799 {
8800 if (Gizmo_IsSupported())
8803 }
8804
8806 }
8807
8808
8809
8810
8812 {
8813 super.OnAction(action_id, player, ctx);
8814
8816 {
8817 switch (action_id)
8818 {
8821 return true;
8824 return true;
8825 }
8826 }
8827
8829 {
8830 switch (action_id)
8831 {
8833 Delete();
8834 return true;
8835 }
8836 }
8837
8838 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8839 {
8840 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8841 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8842 PlayerBase p = PlayerBase.Cast(player);
8843 if (
EActions.RECIPES_RANGE_START < 1000)
8844 {
8845 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8846 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8847 }
8848 }
8849 #ifndef SERVER
8850 else if (action_id ==
EActions.WATCH_PLAYER)
8851 {
8852 PluginDeveloper.SetDeveloperItemClientEx(player);
8853 }
8854 #endif
8856 {
8857 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8858 {
8859 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8860 OnDebugButtonPressServer(id + 1);
8861 }
8862
8863 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8864 {
8865 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8867 }
8868
8869 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8870 {
8871 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8873 }
8874
8875 else if (action_id ==
EActions.ADD_QUANTITY)
8876 {
8877 if (IsMagazine())
8878 {
8879 Magazine mag = Magazine.Cast(this);
8880 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8881 }
8882 else
8883 {
8885 }
8886
8887 if (m_EM)
8888 {
8889 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8890 }
8891
8892 }
8893
8894 else if (action_id ==
EActions.REMOVE_QUANTITY)
8895 {
8896 if (IsMagazine())
8897 {
8898 Magazine mag2 = Magazine.Cast(this);
8899 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8900 }
8901 else
8902 {
8904 }
8905 if (m_EM)
8906 {
8907 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8908 }
8909
8910 }
8911
8912 else if (action_id ==
EActions.SET_QUANTITY_0)
8913 {
8915
8916 if (m_EM)
8917 {
8918 m_EM.SetEnergy(0);
8919 }
8920 }
8921
8922 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8923 {
8925
8926 if (m_EM)
8927 {
8928 m_EM.SetEnergy(m_EM.GetEnergyMax());
8929 }
8930 }
8931
8932 else if (action_id ==
EActions.ADD_HEALTH)
8933 {
8934 AddHealth("","",GetMaxHealth("","Health")/5);
8935 }
8936 else if (action_id ==
EActions.REMOVE_HEALTH)
8937 {
8938 AddHealth("","",-GetMaxHealth("","Health")/5);
8939 }
8940 else if (action_id ==
EActions.DESTROY_HEALTH)
8941 {
8942 SetHealth01("","",0);
8943 }
8944 else if (action_id ==
EActions.WATCH_ITEM)
8945 {
8947 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8948 #ifdef DEVELOPER
8949 SetDebugDeveloper_item(this);
8950 #endif
8951 }
8952
8953 else if (action_id ==
EActions.ADD_TEMPERATURE)
8954 {
8955 AddTemperature(20);
8956
8957 }
8958
8959 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8960 {
8961 AddTemperature(-20);
8962
8963 }
8964
8965 else if (action_id ==
EActions.FLIP_FROZEN)
8966 {
8967 SetFrozen(!GetIsFrozen());
8968
8969 }
8970
8971 else if (action_id ==
EActions.ADD_WETNESS)
8972 {
8974
8975 }
8976
8977 else if (action_id ==
EActions.REMOVE_WETNESS)
8978 {
8980
8981 }
8982
8983 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8984 {
8987
8988
8989 }
8990
8991 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8992 {
8995 }
8996
8997 else if (action_id ==
EActions.MAKE_SPECIAL)
8998 {
8999 auto debugParams = DebugSpawnParams.WithPlayer(player);
9000 OnDebugSpawnEx(debugParams);
9001 }
9002
9003 }
9004
9005
9006 return false;
9007 }
9008
9009
9010
9011
9015
9018
9019
9020
9022 {
9023 return false;
9024 }
9025
9026
9028 {
9029 return true;
9030 }
9031
9032
9034 {
9035 return true;
9036 }
9037
9038
9039
9041 {
9042 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9044 }
9045
9048 {
9049 return null;
9050 }
9051
9053 {
9054 return false;
9055 }
9056
9058 {
9059 return false;
9060 }
9061
9065
9066
9068 {
9069 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9070 return module_repairing.CanRepair(this, item_repair_kit);
9071 }
9072
9073
9074 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9075 {
9076 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9077 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9078 }
9079
9080
9082 {
9083
9084
9085
9086
9087
9088
9089
9090
9091 return 1;
9092 }
9093
9094
9095
9097 {
9099 }
9100
9101
9102
9104 {
9106 }
9107
9108
9117 {
9118 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9119
9120 if (player)
9121 {
9122 player.MessageStatus(text);
9123 }
9124 }
9125
9126
9135 {
9136 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9137
9138 if (player)
9139 {
9140 player.MessageAction(text);
9141 }
9142 }
9143
9144
9153 {
9154 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9155
9156 if (player)
9157 {
9158 player.MessageFriendly(text);
9159 }
9160 }
9161
9162
9171 {
9172 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9173
9174 if (player)
9175 {
9176 player.MessageImportant(text);
9177 }
9178 }
9179
9181 {
9182 return true;
9183 }
9184
9185
9186 override bool KindOf(
string tag)
9187 {
9188 bool found = false;
9189 string item_name = this.
GetType();
9192
9193 int array_size = item_tag_array.Count();
9194 for (int i = 0; i < array_size; i++)
9195 {
9196 if (item_tag_array.Get(i) == tag)
9197 {
9198 found = true;
9199 break;
9200 }
9201 }
9202 return found;
9203 }
9204
9205
9207 {
9208
9209 super.OnRPC(sender, rpc_type,ctx);
9210
9211
9212 switch (rpc_type)
9213 {
9214 #ifndef SERVER
9215 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9216 Param2<bool, string> p = new Param2<bool, string>(false, "");
9217
9219 return;
9220
9221 bool play = p.param1;
9222 string soundSet = p.param2;
9223
9224 if (play)
9225 {
9227 {
9229 {
9231 }
9232 }
9233 else
9234 {
9236 }
9237 }
9238 else
9239 {
9241 }
9242
9243 break;
9244 #endif
9245
9246 }
9247
9249 {
9251 }
9252 }
9253
9254
9255
9256
9258 {
9259 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9260 return plugin.GetID(
name);
9261 }
9262
9264 {
9265 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9266 return plugin.GetName(id);
9267 }
9268
9271 {
9272
9273
9274 int varFlags;
9275 if (!ctx.
Read(varFlags))
9276 return;
9277
9278 if (varFlags & ItemVariableFlags.FLOAT)
9279 {
9281 }
9282 }
9283
9285 {
9286
9287 super.SerializeNumericalVars(floats_out);
9288
9289
9290
9292 {
9294 }
9295
9297 {
9299 }
9300
9302 {
9304 }
9305
9307 {
9312 }
9313
9315 {
9317 }
9318 }
9319
9321 {
9322
9323 super.DeSerializeNumericalVars(floats);
9324
9325
9326 int index = 0;
9327 int mask = Math.Round(floats.Get(index));
9328
9329 index++;
9330
9332 {
9334 {
9336 }
9337 else
9338 {
9339 float quantity = floats.Get(index);
9341 }
9342 index++;
9343 }
9344
9346 {
9347 float wet = floats.Get(index);
9349 index++;
9350 }
9351
9353 {
9354 int liquidtype = Math.Round(floats.Get(index));
9356 index++;
9357 }
9358
9360 {
9362 index++;
9364 index++;
9366 index++;
9368 index++;
9369 }
9370
9372 {
9373 int cleanness = Math.Round(floats.Get(index));
9375 index++;
9376 }
9377 }
9378
9380 {
9381 super.WriteVarsToCTX(ctx);
9382
9383
9385 {
9387 }
9388
9390 {
9392 }
9393
9395 {
9397 }
9398
9400 {
9401 int r,g,b,a;
9407 }
9408
9410 {
9412 }
9413 }
9414
9416 {
9417 if (!super.ReadVarsFromCTX(ctx,version))
9418 return false;
9419
9420 int intValue;
9421 float value;
9422
9423 if (version < 140)
9424 {
9425 if (!ctx.
Read(intValue))
9426 return false;
9427
9428 m_VariablesMask = intValue;
9429 }
9430
9432 {
9433 if (!ctx.
Read(value))
9434 return false;
9435
9437 {
9439 }
9440 else
9441 {
9443 }
9444 }
9445
9446 if (version < 140)
9447 {
9449 {
9450 if (!ctx.
Read(value))
9451 return false;
9452 SetTemperatureDirect(value);
9453 }
9454 }
9455
9457 {
9458 if (!ctx.
Read(value))
9459 return false;
9461 }
9462
9464 {
9465 if (!ctx.
Read(intValue))
9466 return false;
9468 }
9469
9471 {
9472 int r,g,b,a;
9474 return false;
9476 return false;
9478 return false;
9480 return false;
9481
9483 }
9484
9486 {
9487 if (!ctx.
Read(intValue))
9488 return false;
9490 }
9491
9492 if (version >= 138 && version < 140)
9493 {
9495 {
9496 if (!ctx.
Read(intValue))
9497 return false;
9498 SetFrozen(intValue);
9499 }
9500 }
9501
9502 return true;
9503 }
9504
9505
9507 {
9510 {
9512 }
9513
9514 if (!super.OnStoreLoad(ctx, version))
9515 {
9517 return false;
9518 }
9519
9520 if (version >= 114)
9521 {
9522 bool hasQuickBarIndexSaved;
9523
9524 if (!ctx.
Read(hasQuickBarIndexSaved))
9525 {
9527 return false;
9528 }
9529
9530 if (hasQuickBarIndexSaved)
9531 {
9532 int itmQBIndex;
9533
9534
9535 if (!ctx.
Read(itmQBIndex))
9536 {
9538 return false;
9539 }
9540
9541 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9542 if (itmQBIndex != -1 && parentPlayer)
9543 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9544 }
9545 }
9546 else
9547 {
9548
9549 PlayerBase player;
9550 int itemQBIndex;
9551 if (version ==
int.
MAX)
9552 {
9553 if (!ctx.
Read(itemQBIndex))
9554 {
9556 return false;
9557 }
9558 }
9559 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9560 {
9561
9562 if (!ctx.
Read(itemQBIndex))
9563 {
9565 return false;
9566 }
9567 if (itemQBIndex != -1 && player)
9568 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9569 }
9570 }
9571
9572 if (version < 140)
9573 {
9574
9575 if (!LoadVariables(ctx, version))
9576 {
9578 return false;
9579 }
9580 }
9581
9582
9584 {
9586 return false;
9587 }
9588 if (version >= 132)
9589 {
9591 if (raib)
9592 {
9594 {
9596 return false;
9597 }
9598 }
9599 }
9600
9602 return true;
9603 }
9604
9605
9606
9608 {
9609 super.OnStoreSave(ctx);
9610
9611 PlayerBase player;
9612 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9613 {
9615
9616 int itemQBIndex = -1;
9617 itemQBIndex = player.FindQuickBarEntityIndex(this);
9618 ctx.
Write(itemQBIndex);
9619 }
9620 else
9621 {
9623 }
9624
9626
9628 if (raib)
9629 {
9631 }
9632 }
9633
9634
9636 {
9637 super.AfterStoreLoad();
9638
9640 {
9642 }
9643
9645 {
9648 }
9649 }
9650
9652 {
9653 super.EEOnAfterLoad();
9654
9656 {
9658 }
9659
9662 }
9663
9665 {
9666 return false;
9667 }
9668
9669
9670
9672 {
9674 {
9675 #ifdef PLATFORM_CONSOLE
9676
9678 {
9680 if (menu)
9681 {
9683 }
9684 }
9685 #endif
9686 }
9687
9689 {
9692 }
9693
9695 {
9696 SetWeightDirty();
9698 }
9700 {
9703 }
9704
9706 {
9709 }
9711 {
9714 }
9715
9716 super.OnVariablesSynchronized();
9717 }
9718
9719
9720
9722 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9723 {
9724 if (!IsServerCheck(allow_client))
9725 return false;
9726
9728 return false;
9729
9732
9733 if (value <= (min + 0.001))
9734 value = min;
9735
9736 if (value == min)
9737 {
9738 if (destroy_config)
9739 {
9740 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9741 if (dstr)
9742 {
9744 this.Delete();
9745 return true;
9746 }
9747 }
9748 else if (destroy_forced)
9749 {
9751 this.Delete();
9752 return true;
9753 }
9754
9756 }
9757
9760
9762 {
9764
9765 if (delta)
9767 }
9768
9770
9771 return false;
9772 }
9773
9774
9776 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9777 {
9779 }
9780
9782 {
9785 }
9786
9788 {
9791 }
9792
9794 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9795 {
9796 float value_clamped = Math.Clamp(value, 0, 1);
9798 SetQuantity(result, destroy_config, destroy_forced);
9799 }
9800
9801
9804 {
9806 }
9807
9809 {
9811 }
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9823 {
9824 int slot = -1;
9825 if (GetInventory())
9826 {
9827 InventoryLocation il = new InventoryLocation;
9828 GetInventory().GetCurrentInventoryLocation(il);
9830 }
9831
9833 }
9834
9836 {
9837 float quantity_max = 0;
9838
9840 {
9841 if (attSlotID != -1)
9842 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9843
9844 if (quantity_max <= 0)
9846 }
9847
9848 if (quantity_max <= 0)
9850
9851 return quantity_max;
9852 }
9853
9855 {
9857 }
9858
9860 {
9862 }
9863
9864
9866 {
9868 }
9869
9871 {
9873 }
9874
9876 {
9878 }
9879
9880
9882 {
9883
9884 float weightEx = GetWeightEx();
9885 float special = GetInventoryAndCargoWeight();
9886 return weightEx - special;
9887 }
9888
9889
9891 {
9893 }
9894
9896 {
9898 {
9899 #ifdef DEVELOPER
9900 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9901 {
9902 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9904 }
9905 #endif
9906
9908 }
9909 else if (HasEnergyManager())
9910 {
9911 #ifdef DEVELOPER
9912 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9913 {
9914 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9915 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9916 }
9917 #endif
9918 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9919 }
9920 else
9921 {
9922 #ifdef DEVELOPER
9923 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9924 {
9925 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9926 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9927 }
9928 #endif
9929 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9930 }
9931 }
9932
9935 {
9936 int item_count = 0;
9938
9939 if (GetInventory().GetCargo() != NULL)
9940 {
9941 item_count = GetInventory().GetCargo().GetItemCount();
9942 }
9943
9944 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9945 {
9946 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9947 if (item)
9948 item_count += item.GetNumberOfItems();
9949 }
9950 return item_count;
9951 }
9952
9955 {
9956 float weight = 0;
9957 float wetness = 1;
9958 if (include_wetness)
9961 {
9962 weight = wetness * m_ConfigWeight;
9963 }
9965 {
9966 weight = 1;
9967 }
9968 return weight;
9969 }
9970
9971
9972
9974 {
9975 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9976 {
9977 GameInventory inv = GetInventory();
9978 array<EntityAI> items = new array<EntityAI>;
9980 for (int i = 0; i < items.Count(); i++)
9981 {
9983 if (item)
9984 {
9986 }
9987 }
9988 }
9989 }
9990
9991
9992
9993
9995 {
9996 float energy = 0;
9997 if (HasEnergyManager())
9998 {
9999 energy = GetCompEM().GetEnergy();
10000 }
10001 return energy;
10002 }
10003
10004
10006 {
10007 super.OnEnergyConsumed();
10008
10010 }
10011
10013 {
10014 super.OnEnergyAdded();
10015
10017 }
10018
10019
10021 {
10022 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10023 {
10025 {
10026 float energy_0to1 = GetCompEM().GetEnergy0To1();
10028 }
10029 }
10030 }
10031
10032
10034 {
10035 return ConfigGetFloat("heatIsolation");
10036 }
10037
10039 {
10041 }
10042
10044 {
10045 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10046 if (
GetGame().ConfigIsExisting(paramPath))
10048
10049 return 0.0;
10050 }
10051
10053 {
10054 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10055 if (
GetGame().ConfigIsExisting(paramPath))
10057
10058 return 0.0;
10059 }
10060
10061 override void SetWet(
float value,
bool allow_client =
false)
10062 {
10063 if (!IsServerCheck(allow_client))
10064 return;
10065
10068
10070
10071 m_VarWet = Math.Clamp(value, min, max);
10072
10074 {
10077 }
10078 }
10079
10080 override void AddWet(
float value)
10081 {
10083 }
10084
10086 {
10088 }
10089
10091 {
10093 }
10094
10096 {
10098 }
10099
10101 {
10103 }
10104
10106 {
10108 }
10109
10110 override void OnWetChanged(
float newVal,
float oldVal)
10111 {
10114 if (newLevel != oldLevel)
10115 {
10117 }
10118 }
10119
10121 {
10122 SetWeightDirty();
10123 }
10124
10126 {
10127 return GetWetLevelInternal(
m_VarWet);
10128 }
10129
10130
10131
10133 {
10135 }
10136
10138 {
10140 }
10141
10143 {
10145 }
10146
10148 {
10150 }
10151
10152
10153
10155 {
10156 if (ConfigIsExisting("itemModelLength"))
10157 {
10158 return ConfigGetFloat("itemModelLength");
10159 }
10160 return 0;
10161 }
10162
10164 {
10165 if (ConfigIsExisting("itemAttachOffset"))
10166 {
10167 return ConfigGetFloat("itemAttachOffset");
10168 }
10169 return 0;
10170 }
10171
10172 override void SetCleanness(
int value,
bool allow_client =
false)
10173 {
10174 if (!IsServerCheck(allow_client))
10175 return;
10176
10178
10180
10183 }
10184
10186 {
10188 }
10189
10191 {
10192 return true;
10193 }
10194
10195
10196
10197
10199 {
10201 }
10202
10204 {
10206 }
10207
10208
10209
10210
10211 override void SetColor(
int r,
int g,
int b,
int a)
10212 {
10218 }
10220 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10221 {
10226 }
10227
10229 {
10231 }
10232
10235 {
10236 int r,g,b,a;
10238 r = r/255;
10239 g = g/255;
10240 b = b/255;
10241 a = a/255;
10242 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10243 }
10244
10245
10246
10247 override void SetLiquidType(
int value,
bool allow_client =
false)
10248 {
10249 if (!IsServerCheck(allow_client))
10250 return;
10251
10256 }
10257
10259 {
10260 return ConfigGetInt("varLiquidTypeInit");
10261 }
10262
10264 {
10266 }
10267
10269 {
10271 SetFrozen(false);
10272 }
10273
10276 {
10277 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10278 }
10279
10280
10283 {
10284 PlayerBase nplayer;
10285 if (PlayerBase.CastTo(nplayer, player))
10286 {
10288
10289 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10290 }
10291 }
10292
10293
10296 {
10297 PlayerBase nplayer;
10298 if (PlayerBase.CastTo(nplayer,player))
10299 {
10300
10301 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10302
10303 }
10304
10305
10306 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10307
10308
10309 if (HasEnergyManager())
10310 {
10311 GetCompEM().UpdatePlugState();
10312 }
10313 }
10314
10315
10317 {
10318 super.OnPlacementStarted(player);
10319
10321 }
10322
10323 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10324 {
10326 {
10327 m_AdminLog.OnPlacementComplete(player,
this);
10328 }
10329
10330 super.OnPlacementComplete(player, position, orientation);
10331 }
10332
10333
10334
10335
10336
10338 {
10340 {
10341 return true;
10342 }
10343 else
10344 {
10345 return false;
10346 }
10347 }
10348
10349
10351 {
10353 {
10355 }
10356 }
10357
10358
10360 {
10362 }
10363
10365 {
10367 }
10368
10369 override void InsertAgent(
int agent,
float count = 1)
10370 {
10371 if (count < 1)
10372 return;
10373
10375 }
10376
10379 {
10381 }
10382
10383
10385 {
10387 }
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10431 {
10433 return false;
10434 return true;
10435 }
10436
10438 {
10439
10441 }
10442
10443
10446 {
10447 super.CheckForRoofLimited(timeTresholdMS);
10448
10450 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10451 {
10452 m_PreviousRoofTestTime = time;
10453 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10454 }
10455 }
10456
10457
10459 {
10461 {
10462 return 0;
10463 }
10464
10465 if (GetInventory().GetAttachmentSlotsCount() != 0)
10466 {
10467 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10468 if (filter)
10469 return filter.GetProtectionLevel(type, false, system);
10470 else
10471 return 0;
10472 }
10473
10474 string subclassPath, entryName;
10475
10476 switch (type)
10477 {
10479 entryName = "biological";
10480 break;
10482 entryName = "chemical";
10483 break;
10484 default:
10485 entryName = "biological";
10486 break;
10487 }
10488
10489 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10490
10492 }
10493
10494
10495
10498 {
10499 if (!IsMagazine())
10501
10503 }
10504
10505
10506
10507
10508
10513 {
10514 return true;
10515 }
10516
10518 {
10520 }
10521
10522
10523
10524
10525
10527 {
10528 if (parent)
10529 {
10530 if (parent.IsInherited(DayZInfected))
10531 return true;
10532
10533 if (!parent.IsRuined())
10534 return true;
10535 }
10536
10537 return true;
10538 }
10539
10541 {
10542 if (!super.CanPutAsAttachment(parent))
10543 {
10544 return false;
10545 }
10546
10547 if (!IsRuined() && !parent.IsRuined())
10548 {
10549 return true;
10550 }
10551
10552 return false;
10553 }
10554
10556 {
10557
10558
10559
10560
10561 return super.CanReceiveItemIntoCargo(item);
10562 }
10563
10565 {
10566
10567
10568
10569
10570 GameInventory attachmentInv = attachment.GetInventory();
10572 {
10573 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10574 return false;
10575 }
10576
10577 InventoryLocation loc = new InventoryLocation();
10578 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10579 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10580 return false;
10581
10582 return super.CanReceiveAttachment(attachment, slotId);
10583 }
10584
10586 {
10587 if (!super.CanReleaseAttachment(attachment))
10588 return false;
10589
10590 return GetInventory().AreChildrenAccessible();
10591 }
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10614 {
10615 int id = muzzle_owner.GetMuzzleID();
10616 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10617
10618 if (WPOF_array)
10619 {
10620 for (int i = 0; i < WPOF_array.Count(); i++)
10621 {
10622 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10623
10624 if (WPOF)
10625 {
10626 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10627 }
10628 }
10629 }
10630 }
10631
10632
10634 {
10635 int id = muzzle_owner.GetMuzzleID();
10637
10638 if (WPOBE_array)
10639 {
10640 for (int i = 0; i < WPOBE_array.Count(); i++)
10641 {
10642 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10643
10644 if (WPOBE)
10645 {
10646 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10647 }
10648 }
10649 }
10650 }
10651
10652
10654 {
10655 int id = muzzle_owner.GetMuzzleID();
10656 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10657
10658 if (WPOOH_array)
10659 {
10660 for (int i = 0; i < WPOOH_array.Count(); i++)
10661 {
10662 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10663
10664 if (WPOOH)
10665 {
10666 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10667 }
10668 }
10669 }
10670 }
10671
10672
10674 {
10675 int id = muzzle_owner.GetMuzzleID();
10676 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10677
10678 if (WPOOH_array)
10679 {
10680 for (int i = 0; i < WPOOH_array.Count(); i++)
10681 {
10682 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10683
10684 if (WPOOH)
10685 {
10686 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10687 }
10688 }
10689 }
10690 }
10691
10692
10694 {
10695 int id = muzzle_owner.GetMuzzleID();
10696 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10697
10698 if (WPOOH_array)
10699 {
10700 for (int i = 0; i < WPOOH_array.Count(); i++)
10701 {
10702 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10703
10704 if (WPOOH)
10705 {
10706 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10707 }
10708 }
10709 }
10710 }
10711
10712
10713
10715 {
10717 {
10718 return true;
10719 }
10720
10721 return false;
10722 }
10723
10725 {
10727 {
10728 return true;
10729 }
10730
10731 return false;
10732 }
10733
10735 {
10737 {
10738 return true;
10739 }
10740
10741 return false;
10742 }
10743
10745 {
10746 return false;
10747 }
10748
10751 {
10752 return UATimeSpent.DEFAULT_DEPLOY;
10753 }
10754
10755
10756
10757
10759 {
10761 SetSynchDirty();
10762 }
10763
10765 {
10767 }
10768
10769
10771 {
10772 return false;
10773 }
10774
10777 {
10778 string att_type = "None";
10779
10780 if (ConfigIsExisting("soundAttType"))
10781 {
10782 att_type = ConfigGetString("soundAttType");
10783 }
10784
10786 }
10787
10789 {
10791 }
10792
10793
10794
10795
10796
10802
10804 {
10807
10809 }
10810
10811
10813 {
10815 return;
10816
10818
10821
10824
10825 SoundParameters params = new SoundParameters();
10829 }
10830
10831
10833 {
10835 return;
10836
10838 SetSynchDirty();
10839
10842 }
10843
10844
10846 {
10848 return;
10849
10851 SetSynchDirty();
10852
10855 }
10856
10858 {
10860 }
10861
10863 {
10865 }
10866
10869 {
10870 if (!
GetGame().IsDedicatedServer())
10871 {
10872 if (ConfigIsExisting("attachSoundSet"))
10873 {
10874 string cfg_path = "";
10875 string soundset = "";
10876 string type_name =
GetType();
10877
10880 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10881 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10882
10883 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10884 {
10885 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10886 {
10887 if (cfg_slot_array[i] == slot_type)
10888 {
10889 soundset = cfg_soundset_array[i];
10890 break;
10891 }
10892 }
10893 }
10894
10895 if (soundset != "")
10896 {
10897 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10899 }
10900 }
10901 }
10902 }
10903
10905 {
10906
10907 }
10908
10909 void OnApply(PlayerBase player);
10910
10912 {
10913 return 1.0;
10914 };
10915
10917 {
10919 }
10920
10922 {
10924 }
10925
10927
10929 {
10930 SetDynamicPhysicsLifeTime(0.01);
10932 }
10933
10935 {
10936 array<string> zone_names = new array<string>;
10937 GetDamageZones(zone_names);
10938 for (int i = 0; i < zone_names.Count(); i++)
10939 {
10940 SetHealthMax(zone_names.Get(i),"Health");
10941 }
10942 SetHealthMax("","Health");
10943 }
10944
10947 {
10948 float global_health = GetHealth01("","Health");
10949 array<string> zones = new array<string>;
10950 GetDamageZones(zones);
10951
10952 for (int i = 0; i < zones.Count(); i++)
10953 {
10954 SetHealth01(zones.Get(i),"Health",global_health);
10955 }
10956 }
10957
10960 {
10961 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10962 }
10963
10965 {
10966 if (!hasRootAsPlayer)
10967 {
10968 if (refParentIB)
10969 {
10970
10971 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10972 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10973
10974 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10975 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10976
10979 }
10980 else
10981 {
10982
10985 }
10986 }
10987 }
10988
10990 {
10992 {
10993 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10994 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10995 {
10996 float heatPermCoef = 1.0;
10998 while (ent)
10999 {
11000 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11001 ent = ent.GetHierarchyParent();
11002 }
11003
11004 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11005 }
11006 }
11007 }
11008
11010 {
11011
11012 EntityAI parent = GetHierarchyParent();
11013 if (!parent)
11014 {
11015 hasParent = false;
11016 hasRootAsPlayer = false;
11017 }
11018 else
11019 {
11020 hasParent = true;
11021 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11022 refParentIB =
ItemBase.Cast(parent);
11023 }
11024 }
11025
11026 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11027 {
11028
11029 }
11030
11032 {
11033
11034 return false;
11035 }
11036
11038 {
11039
11040
11041 return false;
11042 }
11043
11045 {
11046
11047 return false;
11048 }
11049
11052 {
11053 return !GetIsFrozen() &&
IsOpen();
11054 }
11055
11057 {
11058 bool hasParent = false, hasRootAsPlayer = false;
11060
11061 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11062 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11063
11064 if (wwtu || foodDecay)
11065 {
11069
11070 if (processWetness || processTemperature || processDecay)
11071 {
11073
11074 if (processWetness)
11075 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11076
11077 if (processTemperature)
11079
11080 if (processDecay)
11081 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11082 }
11083 }
11084 }
11085
11088 {
11090 }
11091
11093 {
11096
11097 return super.GetTemperatureFreezeThreshold();
11098 }
11099
11101 {
11104
11105 return super.GetTemperatureThawThreshold();
11106 }
11107
11109 {
11112
11113 return super.GetItemOverheatThreshold();
11114 }
11115
11117 {
11119 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11120
11121 return super.GetTemperatureFreezeTime();
11122 }
11123
11125 {
11127 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11128
11129 return super.GetTemperatureThawTime();
11130 }
11131
11136
11138 {
11139 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11140 }
11141
11143 {
11144 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11145 }
11146
11149 {
11151 }
11152
11154 {
11156 }
11157
11159 {
11161 }
11162
11165 {
11166 return null;
11167 }
11168
11171 {
11172 return false;
11173 }
11174
11176 {
11178 {
11181 if (!trg)
11182 {
11184 explosive = this;
11185 }
11186
11187 explosive.PairRemote(trg);
11189
11190 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11191 trg.SetPersistentPairID(persistentID);
11192 explosive.SetPersistentPairID(persistentID);
11193
11194 return true;
11195 }
11196 return false;
11197 }
11198
11201 {
11202 float ret = 1.0;
11205 ret *= GetHealth01();
11206
11207 return ret;
11208 }
11209
11210 #ifdef DEVELOPER
11211 override void SetDebugItem()
11212 {
11213 super.SetDebugItem();
11214 _itemBase = this;
11215 }
11216
11218 {
11219 string text = super.GetDebugText();
11220
11222 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11223
11224 return text;
11225 }
11226 #endif
11227
11229 {
11230 return true;
11231 }
11232
11234
11236
11238 {
11241 }
11242
11243
11251
11267}
11268
11270{
11272 if (entity)
11273 {
11274 bool is_item = entity.IsInherited(
ItemBase);
11275 if (is_item && full_quantity)
11276 {
11279 }
11280 }
11281 else
11282 {
11284 return NULL;
11285 }
11286 return entity;
11287}
11288
11290{
11291 if (item)
11292 {
11293 if (health > 0)
11294 item.SetHealth("", "", health);
11295
11296 if (item.CanHaveTemperature())
11297 {
11299 if (item.CanFreeze())
11300 item.SetFrozen(false);
11301 }
11302
11303 if (item.HasEnergyManager())
11304 {
11305 if (quantity >= 0)
11306 {
11307 item.GetCompEM().SetEnergy0To1(quantity);
11308 }
11309 else
11310 {
11312 }
11313 }
11314 else if (item.IsMagazine())
11315 {
11316 Magazine mag = Magazine.Cast(item);
11317 if (quantity >= 0)
11318 {
11319 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11320 }
11321 else
11322 {
11324 }
11325
11326 }
11327 else
11328 {
11329 if (quantity >= 0)
11330 {
11331 item.SetQuantityNormalized(quantity, false);
11332 }
11333 else
11334 {
11336 }
11337
11338 }
11339 }
11340}
11341
11342#ifdef DEVELOPER
11344#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.