6386{
6388 {
6389 return true;
6390 }
6391};
6392
6393
6394
6396{
6400
6402
6405
6406
6407
6408
6409
6418
6424
6429
6434
6455 protected bool m_IsResultOfSplit
6456
6458
6463
6464
6465
6467
6471
6472
6473
6475
6478
6479
6480
6486
6487
6495
6498
6499
6501
6502
6504
6505
6510
6511
6516
6517
6519
6520
6522 {
6527
6528 if (!
GetGame().IsDedicatedServer())
6529 {
6531 {
6533
6535 {
6537 }
6538 }
6539
6542 }
6543
6544 m_OldLocation = null;
6545
6547 {
6549 }
6550
6551 if (ConfigIsExisting("headSelectionsToHide"))
6552 {
6555 }
6556
6558 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6559 {
6561 }
6562
6564
6565 m_IsResultOfSplit = false;
6566
6568 }
6569
6571 {
6572 super.InitItemVariables();
6573
6579 m_Count = ConfigGetInt(
"count");
6580
6583
6588
6591
6596
6608
6612
6613
6616 if (ConfigIsExisting("canBeSplit"))
6617 {
6620 }
6621
6623 if (ConfigIsExisting("itemBehaviour"))
6625
6626
6629 RegisterNetSyncVariableInt("m_VarLiquidType");
6630 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6631
6632 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6633 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6634 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6635
6636 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6637 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6638 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6639 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6640
6641 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6642 RegisterNetSyncVariableBool("m_IsTakeable");
6643 RegisterNetSyncVariableBool("m_IsHologram");
6644
6647 {
6650 }
6651
6653
6655 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6657
6658 }
6659
6661 {
6663 }
6664
6666 {
6669 {
6674 }
6675 }
6676
6677 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6678 {
6680 {
6683 }
6684
6686 }
6687
6689 {
6695 }
6696
6698
6700 {
6702
6703 if (!action)
6704 {
6705 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6706 return;
6707 }
6708
6710 if (!ai)
6711 {
6713 return;
6714 }
6715
6717 if (!action_array)
6718 {
6719 action_array = new array<ActionBase_Basic>;
6721 }
6722 if (LogManager.IsActionLogEnable())
6723 {
6724 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6725 }
6726
6727 if (action_array.Find(action) != -1)
6728 {
6729 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6730 }
6731 else
6732 {
6733 action_array.Insert(action);
6734 }
6735 }
6736
6738 {
6740 ActionBase action = player.GetActionManager().GetAction(actionName);
6743
6744 if (action_array)
6745 {
6746 action_array.RemoveItem(action);
6747 }
6748 }
6749
6750
6751
6753 {
6754 ActionOverrideData overrideData = new ActionOverrideData();
6758
6760 if (!actionMap)
6761 {
6764 }
6765
6766 actionMap.Insert(this.
Type(), overrideData);
6767
6768 }
6769
6771
6773
6774
6776 {
6779
6782
6783 string config_to_search = "CfgVehicles";
6784 string muzzle_owner_config;
6785
6787 {
6788 if (IsInherited(Weapon))
6789 config_to_search = "CfgWeapons";
6790
6791 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6792
6793 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6794
6796
6797 if (config_OnFire_subclass_count > 0)
6798 {
6799 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6800
6801 for (int i = 0; i < config_OnFire_subclass_count; i++)
6802 {
6803 string particle_class = "";
6805 string config_OnFire_entry = config_OnFire_class + particle_class;
6806 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6807 WPOF_array.Insert(WPOF);
6808 }
6809
6810
6812 }
6813 }
6814
6816 {
6817 config_to_search = "CfgWeapons";
6818 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6819
6820 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6821
6823
6824 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6825 {
6826 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6827
6828 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6829 {
6830 string particle_class2 = "";
6832 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6833 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6834 WPOBE_array.Insert(WPOBE);
6835 }
6836
6837
6839 }
6840 }
6841 }
6842
6843
6845 {
6848
6850 {
6851 string config_to_search = "CfgVehicles";
6852
6853 if (IsInherited(Weapon))
6854 config_to_search = "CfgWeapons";
6855
6856 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6857 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6858
6859 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6860 {
6861
6863
6865 {
6867 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6869 return;
6870 }
6871
6874
6875
6876
6878 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6879
6880 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6881 {
6882 string particle_class = "";
6884 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6886
6887 if (entry_type == CT_CLASS)
6888 {
6889 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6890 WPOOH_array.Insert(WPOF);
6891 }
6892 }
6893
6894
6896 }
6897 }
6898 }
6899
6901 {
6903 }
6904
6906 {
6908 {
6910
6913
6916
6917 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6918 }
6919 }
6920
6922 {
6924 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6925
6927 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6928
6930 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6931
6933 {
6935 }
6936 }
6937
6939 {
6941 }
6942
6944 {
6947 else
6949
6951 {
6954 }
6955 else
6956 {
6959
6962 }
6963
6965 }
6966
6968 {
6970 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6971 }
6972
6974 {
6976 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6978 }
6979
6981 {
6983 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6984 }
6985
6987 {
6990
6991 OverheatingParticle OP = new OverheatingParticle();
6996
6998 }
6999
7001 {
7004
7005 return -1;
7006 }
7007
7009 {
7011 {
7014
7015 for (int i = count; i > 0; --i)
7016 {
7017 int id = i - 1;
7020
7023
7024 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7025 {
7026 if (p)
7027 {
7030 }
7031 }
7032 }
7033 }
7034 }
7035
7037 {
7039 {
7041 {
7042 int id = i - 1;
7044
7045 if (OP)
7046 {
7048
7049 if (p)
7050 {
7052 }
7053
7054 delete OP;
7055 }
7056 }
7057
7060 }
7061 }
7062
7065 {
7066 return 0.0;
7067 }
7068
7069
7071 {
7072 return 250;
7073 }
7074
7076 {
7077 return 0;
7078 }
7079
7082 {
7084 return true;
7085
7086 return false;
7087 }
7088
7091 {
7094
7096 {
7098 }
7099 else
7100 {
7101
7103 }
7104
7106 }
7107
7114 {
7115 return -1;
7116 }
7117
7118
7119
7120
7122 {
7124 {
7126 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7127
7128 if (r_index >= 0)
7129 {
7130 InventoryLocation r_il = new InventoryLocation;
7131 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7132
7133 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7136 {
7137 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7138 }
7140 {
7141 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7142 }
7143
7144 }
7145
7146 player.GetHumanInventory().ClearUserReservedLocation(this);
7147 }
7148
7151 }
7152
7153
7154
7155
7157 {
7158 return ItemBase.m_DebugActionsMask;
7159 }
7160
7162 {
7163 return ItemBase.m_DebugActionsMask & mask;
7164 }
7165
7167 {
7168 ItemBase.m_DebugActionsMask = mask;
7169 }
7170
7172 {
7173 ItemBase.m_DebugActionsMask |= mask;
7174 }
7175
7177 {
7178 ItemBase.m_DebugActionsMask &= ~mask;
7179 }
7180
7182 {
7184 {
7186 }
7187 else
7188 {
7190 }
7191 }
7192
7193
7195 {
7196 if (GetEconomyProfile())
7197 {
7198 float q_max = GetEconomyProfile().GetQuantityMax();
7199 if (q_max > 0)
7200 {
7201 float q_min = GetEconomyProfile().GetQuantityMin();
7202 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7203
7205 {
7206 ComponentEnergyManager comp = GetCompEM();
7208 {
7210 }
7211 }
7213 {
7215
7216 }
7217
7218 }
7219 }
7220 }
7221
7224 {
7225 EntityAI parent = GetHierarchyParent();
7226
7227 if (parent)
7228 {
7229 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7230 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7231 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7232 }
7233 }
7234
7237 {
7238 EntityAI parent = GetHierarchyParent();
7239
7240 if (parent)
7241 {
7242 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7243 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7244 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7245 }
7246 }
7247
7249 {
7250
7251
7252
7253
7255
7257 {
7258 if (ScriptInputUserData.CanStoreInputUserData())
7259 {
7260 ScriptInputUserData ctx = new ScriptInputUserData;
7266 ctx.
Write(use_stack_max);
7269
7271 {
7272 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7273 }
7274 }
7275 }
7276 else if (!
GetGame().IsMultiplayer())
7277 {
7279 }
7280 }
7281
7283 {
7285 }
7286
7288 {
7290 }
7291
7293 {
7295 }
7296
7298 {
7299
7300 return false;
7301 }
7302
7304 {
7305 return false;
7306 }
7307
7311 {
7312 return false;
7313 }
7314
7316 {
7317 return "";
7318 }
7319
7321
7323 {
7324 return false;
7325 }
7326
7328 {
7329 return true;
7330 }
7331
7332
7333
7335 {
7336 return true;
7337 }
7338
7340 {
7341 return true;
7342 }
7343
7345 {
7346 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7348 }
7349
7351 {
7353 }
7354
7356 {
7358 if (!is_being_placed)
7360 SetSynchDirty();
7361 }
7362
7363
7365
7367 {
7369 }
7370
7372 {
7374 }
7375
7377 {
7378 return 1;
7379 }
7380
7382 {
7383 return false;
7384 }
7385
7387 {
7389 SetSynchDirty();
7390 }
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7427 {
7428 super.OnMovedInsideCargo(container);
7429
7430 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7431 }
7432
7433 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7434 {
7435 super.EEItemLocationChanged(oldLoc,newLoc);
7436
7437 PlayerBase new_player = null;
7438 PlayerBase old_player = null;
7439
7440 if (newLoc.GetParent())
7441 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7442
7443 if (oldLoc.GetParent())
7444 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7445
7447 {
7448 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7449
7450 if (r_index >= 0)
7451 {
7452 InventoryLocation r_il = new InventoryLocation;
7453 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7454
7455 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7458 {
7459 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7460 }
7462 {
7463 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7464 }
7465
7466 }
7467 }
7468
7470 {
7471 if (new_player)
7472 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7473
7474 if (new_player == old_player)
7475 {
7476
7477 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7478 {
7480 {
7481 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7482 {
7483 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7484 }
7485 }
7486 else
7487 {
7488 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7489 }
7490 }
7491
7492 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7493 {
7494 int type = oldLoc.GetType();
7496 {
7497 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7498 }
7500 {
7501 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7502 }
7503 }
7504 if (!m_OldLocation)
7505 {
7506 m_OldLocation = new InventoryLocation;
7507 }
7508 m_OldLocation.Copy(oldLoc);
7509 }
7510 else
7511 {
7512 if (m_OldLocation)
7513 {
7514 m_OldLocation.Reset();
7515 }
7516 }
7517
7519 }
7520 else
7521 {
7522 if (new_player)
7523 {
7524 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7525 if (res_index >= 0)
7526 {
7527 InventoryLocation il = new InventoryLocation;
7528 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7530 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7533 {
7534 il.
GetParent().GetOnReleaseLock().Invoke(it);
7535 }
7537 {
7539 }
7540
7541 }
7542 }
7544 {
7545
7547 }
7548
7549 if (m_OldLocation)
7550 {
7551 m_OldLocation.Reset();
7552 }
7553 }
7554 }
7555
7556 override void EOnContact(IEntity other, Contact extra)
7557 {
7559 {
7560 int liquidType = -1;
7562 if (impactSpeed > 0.0)
7563 {
7565 #ifndef SERVER
7567 #else
7569 SetSynchDirty();
7570 #endif
7572 }
7573 }
7574
7575 #ifdef SERVER
7576 if (GetCompEM() && GetCompEM().IsPlugged())
7577 {
7578 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7579 GetCompEM().UnplugThis();
7580 }
7581 #endif
7582 }
7583
7585
7587 {
7589 }
7590
7592 {
7593
7594 }
7595
7597 {
7598 super.OnItemLocationChanged(old_owner, new_owner);
7599
7600 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7601 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7602
7603 if (!relatedPlayer && playerNew)
7604 relatedPlayer = playerNew;
7605
7606 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7607 {
7609 if (actionMgr)
7610 {
7611 ActionBase currentAction = actionMgr.GetRunningAction();
7612 if (currentAction)
7614 }
7615 }
7616
7617 Man ownerPlayerOld = null;
7618 Man ownerPlayerNew = null;
7619
7620 if (old_owner)
7621 {
7622 if (old_owner.
IsMan())
7623 {
7624 ownerPlayerOld = Man.Cast(old_owner);
7625 }
7626 else
7627 {
7628 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7629 }
7630 }
7631 else
7632 {
7634 {
7636
7637 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7638 {
7639 GetCompEM().UnplugThis();
7640 }
7641 }
7642 }
7643
7644 if (new_owner)
7645 {
7646 if (new_owner.
IsMan())
7647 {
7648 ownerPlayerNew = Man.Cast(new_owner);
7649 }
7650 else
7651 {
7652 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7653 }
7654 }
7655
7656 if (ownerPlayerOld != ownerPlayerNew)
7657 {
7658 if (ownerPlayerOld)
7659 {
7660 array<EntityAI> subItemsExit = new array<EntityAI>;
7662 for (int i = 0; i < subItemsExit.Count(); i++)
7663 {
7666 }
7667 }
7668
7669 if (ownerPlayerNew)
7670 {
7671 array<EntityAI> subItemsEnter = new array<EntityAI>;
7673 for (int j = 0; j < subItemsEnter.Count(); j++)
7674 {
7677 }
7678 }
7679 }
7680 else if (ownerPlayerNew != null)
7681 {
7682 PlayerBase nplayer;
7683 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7684 {
7685 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7687 for (int k = 0; k < subItemsUpdate.Count(); k++)
7688 {
7690 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7691 }
7692 }
7693 }
7694
7695 if (old_owner)
7696 old_owner.OnChildItemRemoved(this);
7697 if (new_owner)
7698 new_owner.OnChildItemReceived(this);
7699 }
7700
7701
7703 {
7704 super.EEDelete(parent);
7705 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7706 if (player)
7707 {
7709
7710 if (player.IsAlive())
7711 {
7712 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7713 if (r_index >= 0)
7714 {
7715 InventoryLocation r_il = new InventoryLocation;
7716 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7717
7718 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7721 {
7722 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7723 }
7725 {
7726 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7727 }
7728
7729 }
7730
7731 player.RemoveQuickBarEntityShortcut(this);
7732 }
7733 }
7734 }
7735
7737 {
7738 super.EEKilled(killer);
7739
7742 {
7743 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7744 {
7745 if (IsMagazine())
7746 {
7747 if (Magazine.Cast(this).GetAmmoCount() > 0)
7748 {
7750 }
7751 }
7752 else
7753 {
7755 }
7756 }
7757 }
7758 }
7759
7761 {
7762 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7763
7764 super.OnWasAttached(parent, slot_id);
7765
7768
7770 }
7771
7773 {
7774 super.OnWasDetached(parent, slot_id);
7775
7778 }
7779
7781 {
7782 int idx;
7785
7786 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7787 if (inventory_slots.Count() < 1)
7788 {
7789 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7790 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7791 }
7792 else
7793 {
7794 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7795 }
7796
7797 idx = inventory_slots.Find(slot);
7798 if (idx < 0)
7799 return "";
7800
7801 return attach_types.Get(idx);
7802 }
7803
7805 {
7806 int idx = -1;
7807 string slot;
7808
7811
7812 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7813 if (inventory_slots.Count() < 1)
7814 {
7815 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7816 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7817 }
7818 else
7819 {
7820 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7821 if (detach_types.Count() < 1)
7822 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7823 }
7824
7825 for (int i = 0; i < inventory_slots.Count(); i++)
7826 {
7827 slot = inventory_slots.Get(i);
7828 }
7829
7830 if (slot != "")
7831 {
7832 if (detach_types.Count() == 1)
7833 idx = 0;
7834 else
7835 idx = inventory_slots.Find(slot);
7836 }
7837 if (idx < 0)
7838 return "";
7839
7840 return detach_types.Get(idx);
7841 }
7842
7844 {
7845
7847
7848
7849 float min_time = 1;
7850 float max_time = 3;
7851 float delay = Math.RandomFloat(min_time, max_time);
7852
7853 explode_timer.Run(delay, this, "DoAmmoExplosion");
7854 }
7855
7857 {
7858 Magazine magazine = Magazine.Cast(this);
7859 int pop_sounds_count = 6;
7860 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7861
7862
7863 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7864 string sound_name = pop_sounds[ sound_idx ];
7866
7867
7868 magazine.ServerAddAmmoCount(-1);
7869
7870
7871 float min_temp_to_explode = 100;
7872
7873 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7874 {
7876 }
7877 }
7878
7879
7880 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7881 {
7882 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7883
7884 const int CHANCE_DAMAGE_CARGO = 4;
7885 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7886 const int CHANCE_DAMAGE_NOTHING = 2;
7887
7889 {
7890 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7891 int chances;
7892 int rnd;
7893
7894 if (GetInventory().GetCargo())
7895 {
7896 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7897 rnd = Math.RandomInt(0,chances);
7898
7899 if (rnd < CHANCE_DAMAGE_CARGO)
7900 {
7902 }
7903 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7904 {
7906 }
7907 }
7908 else
7909 {
7910 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7911 rnd = Math.RandomInt(0,chances);
7912
7913 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7914 {
7916 }
7917 }
7918 }
7919 }
7920
7922 {
7923 if (GetInventory().GetCargo())
7924 {
7925 int item_count = GetInventory().GetCargo().GetItemCount();
7926 if (item_count > 0)
7927 {
7928 int random_pick = Math.RandomInt(0, item_count);
7930 if (!item.IsExplosive())
7931 {
7932 item.AddHealth("","",damage);
7933 return true;
7934 }
7935 }
7936 }
7937 return false;
7938 }
7939
7941 {
7942 int attachment_count = GetInventory().AttachmentCount();
7943 if (attachment_count > 0)
7944 {
7945 int random_pick = Math.RandomInt(0, attachment_count);
7946 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7947 if (!attachment.IsExplosive())
7948 {
7949 attachment.AddHealth("","",damage);
7950 return true;
7951 }
7952 }
7953 return false;
7954 }
7955
7957 {
7959 }
7960
7962 {
7964 return GetInventory().CanRemoveEntity();
7965
7966 return false;
7967 }
7968
7970 {
7972 return;
7973
7975 {
7976 if (ScriptInputUserData.CanStoreInputUserData())
7977 {
7978 ScriptInputUserData ctx = new ScriptInputUserData;
7983 ctx.
Write(destination_entity);
7987 }
7988 }
7989 else if (!
GetGame().IsMultiplayer())
7990 {
7992 }
7993 }
7994
7996 {
7998 return;
7999
8000 float split_quantity_new;
8004 InventoryLocation loc = new InventoryLocation;
8005
8006 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8007 {
8009 split_quantity_new = stack_max;
8010 else
8012
8013 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8014 if (new_item)
8015 {
8016 new_item.SetResultOfSplit(true);
8017 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8019 new_item.SetQuantity(split_quantity_new);
8020 }
8021 }
8022 else if (destination_entity && slot_id == -1)
8023 {
8024 if (quantity > stack_max)
8025 split_quantity_new = stack_max;
8026 else
8027 split_quantity_new = quantity;
8028
8030 {
8033 }
8034
8035 if (new_item)
8036 {
8037 new_item.SetResultOfSplit(true);
8038 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8040 new_item.SetQuantity(split_quantity_new);
8041 }
8042 }
8043 else
8044 {
8045 if (stack_max != 0)
8046 {
8048 {
8050 }
8051
8052 if (split_quantity_new == 0)
8053 {
8054 if (!
GetGame().IsMultiplayer())
8055 player.PhysicalPredictiveDropItem(this);
8056 else
8057 player.ServerDropEntity(this);
8058 return;
8059 }
8060
8062
8063 if (new_item)
8064 {
8065 new_item.SetResultOfSplit(true);
8066 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8068 new_item.SetQuantity(stack_max);
8069 new_item.PlaceOnSurface();
8070 }
8071 }
8072 }
8073 }
8074
8076 {
8078 return;
8079
8080 float split_quantity_new;
8084 InventoryLocation loc = new InventoryLocation;
8085
8086 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8087 {
8089 split_quantity_new = stack_max;
8090 else
8092
8093 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8094 if (new_item)
8095 {
8096 new_item.SetResultOfSplit(true);
8097 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8099 new_item.SetQuantity(split_quantity_new);
8100 }
8101 }
8102 else if (destination_entity && slot_id == -1)
8103 {
8104 if (quantity > stack_max)
8105 split_quantity_new = stack_max;
8106 else
8107 split_quantity_new = quantity;
8108
8110 {
8113 }
8114
8115 if (new_item)
8116 {
8117 new_item.SetResultOfSplit(true);
8118 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8120 new_item.SetQuantity(split_quantity_new);
8121 }
8122 }
8123 else
8124 {
8125 if (stack_max != 0)
8126 {
8128 {
8130 }
8131
8133
8134 if (new_item)
8135 {
8136 new_item.SetResultOfSplit(true);
8137 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8139 new_item.SetQuantity(stack_max);
8140 new_item.PlaceOnSurface();
8141 }
8142 }
8143 }
8144 }
8145
8147 {
8149 return;
8150
8152 {
8153 if (ScriptInputUserData.CanStoreInputUserData())
8154 {
8155 ScriptInputUserData ctx = new ScriptInputUserData;
8160 dst.WriteToContext(ctx);
8162 }
8163 }
8164 else if (!
GetGame().IsMultiplayer())
8165 {
8167 }
8168 }
8169
8171 {
8173 return;
8174
8176 {
8177 if (ScriptInputUserData.CanStoreInputUserData())
8178 {
8179 ScriptInputUserData ctx = new ScriptInputUserData;
8184 ctx.
Write(destination_entity);
8190 }
8191 }
8192 else if (!
GetGame().IsMultiplayer())
8193 {
8195 }
8196 }
8197
8199 {
8201 }
8202
8204 {
8206 return this;
8207
8209 float split_quantity_new;
8211 if (dst.IsValid())
8212 {
8213 int slot_id = dst.GetSlot();
8215
8216 if (quantity > stack_max)
8217 split_quantity_new = stack_max;
8218 else
8219 split_quantity_new = quantity;
8220
8222
8223 if (new_item)
8224 {
8225 new_item.SetResultOfSplit(true);
8226 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8229 }
8230
8231 return new_item;
8232 }
8233
8234 return null;
8235 }
8236
8238 {
8240 return;
8241
8243 float split_quantity_new;
8245 if (destination_entity)
8246 {
8248 if (quantity > stackable)
8249 split_quantity_new = stackable;
8250 else
8251 split_quantity_new = quantity;
8252
8253 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8254 if (new_item)
8255 {
8256 new_item.SetResultOfSplit(true);
8257 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8259 new_item.SetQuantity(split_quantity_new);
8260 }
8261 }
8262 }
8263
8265 {
8267 return;
8268
8270 {
8271 if (ScriptInputUserData.CanStoreInputUserData())
8272 {
8273 ScriptInputUserData ctx = new ScriptInputUserData;
8278 ItemBase destination_entity =
this;
8279 ctx.
Write(destination_entity);
8283 }
8284 }
8285 else if (!
GetGame().IsMultiplayer())
8286 {
8288 }
8289 }
8290
8292 {
8294 return;
8295
8297 float split_quantity_new;
8299 if (player)
8300 {
8302 if (quantity > stackable)
8303 split_quantity_new = stackable;
8304 else
8305 split_quantity_new = quantity;
8306
8307 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8308 new_item =
ItemBase.Cast(in_hands);
8309 if (new_item)
8310 {
8311 new_item.SetResultOfSplit(true);
8312 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8314 new_item.SetQuantity(split_quantity_new);
8315 }
8316 }
8317 }
8318
8320 {
8322 return;
8323
8325 float split_quantity_new = Math.Floor(quantity * 0.5);
8326
8328
8329 if (new_item)
8330 {
8331 if (new_item.GetQuantityMax() < split_quantity_new)
8332 {
8333 split_quantity_new = new_item.GetQuantityMax();
8334 }
8335
8336 new_item.SetResultOfSplit(true);
8337 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8338
8340 {
8343 }
8344 else
8345 {
8348 }
8349 }
8350 }
8351
8353 {
8355 return;
8356
8358 float split_quantity_new = Math.Floor(quantity / 2);
8359
8360 InventoryLocation invloc = new InventoryLocation;
8362
8364 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8365
8366 if (new_item)
8367 {
8368 if (new_item.GetQuantityMax() < split_quantity_new)
8369 {
8370 split_quantity_new = new_item.GetQuantityMax();
8371 }
8373 {
8376 }
8377 else
8378 {
8381 }
8382 }
8383 }
8384
8387 {
8388 SetWeightDirty();
8390
8391 if (parent)
8392 parent.OnAttachmentQuantityChangedEx(this, delta);
8393
8395 {
8397 {
8399 }
8401 {
8402 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8404 }
8405 }
8406
8407 }
8408
8411 {
8412
8413 }
8414
8417 {
8419 }
8420
8422 {
8423 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8424
8426 {
8427 if (newLevel == GameConstants.STATE_RUINED)
8428 {
8430 EntityAI parent = GetHierarchyParent();
8431 if (parent && parent.IsFireplace())
8432 {
8433 CargoBase cargo = GetInventory().GetCargo();
8434 if (cargo)
8435 {
8437 {
8439 }
8440 }
8441 }
8442 }
8443
8445 {
8446
8448 return;
8449 }
8450
8451 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8452 {
8454 }
8455 }
8456 }
8457
8458
8460 {
8461 super.OnRightClick();
8462
8464 {
8466 {
8467 if (ScriptInputUserData.CanStoreInputUserData())
8468 {
8469 vector m4[4];
8471
8472 EntityAI root = GetHierarchyRoot();
8473
8474 InventoryLocation dst = new InventoryLocation;
8476 {
8477 if (root)
8478 {
8479 root.GetTransform(m4);
8481 }
8482 else
8483 GetInventory().GetCurrentInventoryLocation(dst);
8484 }
8485 else
8486 {
8488
8489
8490 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8491 {
8492 if (root)
8493 {
8494 root.GetTransform(m4);
8496 }
8497 else
8498 GetInventory().GetCurrentInventoryLocation(dst);
8499 }
8500 else
8501 {
8502 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8503 }
8504 }
8505
8506 ScriptInputUserData ctx = new ScriptInputUserData;
8514 }
8515 }
8516 else if (!
GetGame().IsMultiplayer())
8517 {
8519 }
8520 }
8521 }
8522
8523 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8524 {
8525
8526 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8527 return false;
8528
8529 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8530 return false;
8531
8532
8534 return false;
8535
8536
8537 Magazine mag = Magazine.Cast(this);
8538 if (mag)
8539 {
8540 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8541 return false;
8542
8543 if (stack_max_limit)
8544 {
8545 Magazine other_mag = Magazine.Cast(other_item);
8546 if (other_item)
8547 {
8548 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8549 return false;
8550 }
8551
8552 }
8553 }
8554 else
8555 {
8556
8558 return false;
8559
8561 return false;
8562 }
8563
8564 PlayerBase player = null;
8565 if (CastTo(player, GetHierarchyRootPlayer()))
8566 {
8567 if (player.GetInventory().HasAttachment(this))
8568 return false;
8569
8570 if (player.IsItemsToDelete())
8571 return false;
8572 }
8573
8574 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8575 return false;
8576
8577 int slotID;
8579 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8580 return false;
8581
8582 return true;
8583 }
8584
8586 {
8588 }
8589
8591 {
8592 return m_IsResultOfSplit;
8593 }
8594
8596 {
8597 m_IsResultOfSplit = value;
8598 }
8599
8601 {
8603 }
8604
8606 {
8607 float other_item_quantity = other_item.GetQuantity();
8608 float this_free_space;
8609
8611
8613
8614 if (other_item_quantity > this_free_space)
8615 {
8616 return this_free_space;
8617 }
8618 else
8619 {
8620 return other_item_quantity;
8621 }
8622 }
8623
8625 {
8627 }
8628
8630 {
8632 return;
8633
8634 if (!IsMagazine() && other_item)
8635 {
8637 if (quantity_used != 0)
8638 {
8639 float hp1 = GetHealth01("","");
8640 float hp2 = other_item.GetHealth01("","");
8641 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8642 hpResult = hpResult / (
GetQuantity() + quantity_used);
8643
8644 hpResult *= GetMaxHealth();
8645 Math.Round(hpResult);
8646 SetHealth("", "Health", hpResult);
8647
8649 other_item.AddQuantity(-quantity_used);
8650 }
8651 }
8653 }
8654
8656 {
8657 #ifdef SERVER
8658 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8659 GetHierarchyParent().IncreaseLifetimeUp();
8660 #endif
8661 };
8662
8664 {
8665 PlayerBase p = PlayerBase.Cast(player);
8666
8667 array<int> recipesIds = p.m_Recipes;
8668 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8669 if (moduleRecipesManager)
8670 {
8671 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8672 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8673 }
8674
8675 for (int i = 0;i < recipesIds.Count(); i++)
8676 {
8677 int key = recipesIds.Get(i);
8678 string recipeName = moduleRecipesManager.GetRecipeName(key);
8680 }
8681 }
8682
8683
8684 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8685 {
8686 super.GetDebugActions(outputList);
8687
8688
8693
8694
8698
8702
8703
8706
8707
8709 {
8712 }
8713
8715
8718
8722 }
8723
8724
8725
8726
8728 {
8729 super.OnAction(action_id, player, ctx);
8730 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8731 {
8732 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8733 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8734 PlayerBase p = PlayerBase.Cast(player);
8735 if (
EActions.RECIPES_RANGE_START < 1000)
8736 {
8737 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8738 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8739 }
8740 }
8741 #ifndef SERVER
8742 else if (action_id ==
EActions.WATCH_PLAYER)
8743 {
8744 PluginDeveloper.SetDeveloperItemClientEx(player);
8745 }
8746 #endif
8748 {
8749 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8750 {
8751 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8752 OnDebugButtonPressServer(id + 1);
8753 }
8754
8755 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8756 {
8757 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8759 }
8760
8761 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8762 {
8763 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8765 }
8766
8767 else if (action_id ==
EActions.ADD_QUANTITY)
8768 {
8769 if (IsMagazine())
8770 {
8771 Magazine mag = Magazine.Cast(this);
8772 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8773 }
8774 else
8775 {
8777 }
8778
8779 if (m_EM)
8780 {
8781 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8782 }
8783
8784 }
8785
8786 else if (action_id ==
EActions.REMOVE_QUANTITY)
8787 {
8788 if (IsMagazine())
8789 {
8790 Magazine mag2 = Magazine.Cast(this);
8791 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8792 }
8793 else
8794 {
8796 }
8797 if (m_EM)
8798 {
8799 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8800 }
8801
8802 }
8803
8804 else if (action_id ==
EActions.SET_QUANTITY_0)
8805 {
8807
8808 if (m_EM)
8809 {
8810 m_EM.SetEnergy(0);
8811 }
8812 }
8813
8814 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8815 {
8817
8818 if (m_EM)
8819 {
8820 m_EM.SetEnergy(m_EM.GetEnergyMax());
8821 }
8822 }
8823
8824 else if (action_id ==
EActions.ADD_HEALTH)
8825 {
8826 AddHealth("","",GetMaxHealth("","Health")/5);
8827 }
8828 else if (action_id ==
EActions.REMOVE_HEALTH)
8829 {
8830 AddHealth("","",-GetMaxHealth("","Health")/5);
8831 }
8832 else if (action_id ==
EActions.DESTROY_HEALTH)
8833 {
8834 SetHealth01("","",0);
8835 }
8836 else if (action_id ==
EActions.WATCH_ITEM)
8837 {
8839 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8840 #ifdef DEVELOPER
8841 SetDebugDeveloper_item(this);
8842 #endif
8843 }
8844
8845 else if (action_id ==
EActions.ADD_TEMPERATURE)
8846 {
8847 AddTemperature(20);
8848
8849 }
8850
8851 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8852 {
8853 AddTemperature(-20);
8854
8855 }
8856
8857 else if (action_id ==
EActions.FLIP_FROZEN)
8858 {
8859 SetFrozen(!GetIsFrozen());
8860
8861 }
8862
8863 else if (action_id ==
EActions.ADD_WETNESS)
8864 {
8866
8867 }
8868
8869 else if (action_id ==
EActions.REMOVE_WETNESS)
8870 {
8872
8873 }
8874
8875 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8876 {
8879
8880
8881 }
8882
8883 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8884 {
8887 }
8888
8889 else if (action_id ==
EActions.MAKE_SPECIAL)
8890 {
8891 auto debugParams = DebugSpawnParams.WithPlayer(player);
8892 OnDebugSpawnEx(debugParams);
8893 }
8894
8895 else if (action_id ==
EActions.DELETE)
8896 {
8897 Delete();
8898 }
8899
8900 }
8901
8902
8903 return false;
8904 }
8905
8906
8907
8908
8912
8915
8916
8917
8919 {
8920 return false;
8921 }
8922
8923
8925 {
8926 return true;
8927 }
8928
8929
8931 {
8932 return true;
8933 }
8934
8935
8936
8938 {
8939 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8941 }
8942
8945 {
8946 return null;
8947 }
8948
8950 {
8951 return false;
8952 }
8953
8955 {
8956 return false;
8957 }
8958
8962
8963
8965 {
8966 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8967 return module_repairing.CanRepair(this, item_repair_kit);
8968 }
8969
8970
8971 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8972 {
8973 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8974 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8975 }
8976
8977
8979 {
8980
8981
8982
8983
8984
8985
8986
8987
8988 return 1;
8989 }
8990
8991
8992
8994 {
8996 }
8997
8998
8999
9001 {
9003 }
9004
9005
9014 {
9015 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9016
9017 if (player)
9018 {
9019 player.MessageStatus(text);
9020 }
9021 }
9022
9023
9032 {
9033 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9034
9035 if (player)
9036 {
9037 player.MessageAction(text);
9038 }
9039 }
9040
9041
9050 {
9051 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9052
9053 if (player)
9054 {
9055 player.MessageFriendly(text);
9056 }
9057 }
9058
9059
9068 {
9069 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9070
9071 if (player)
9072 {
9073 player.MessageImportant(text);
9074 }
9075 }
9076
9078 {
9079 return true;
9080 }
9081
9082
9083 override bool KindOf(
string tag)
9084 {
9085 bool found = false;
9086 string item_name = this.
GetType();
9089
9090 int array_size = item_tag_array.Count();
9091 for (int i = 0; i < array_size; i++)
9092 {
9093 if (item_tag_array.Get(i) == tag)
9094 {
9095 found = true;
9096 break;
9097 }
9098 }
9099 return found;
9100 }
9101
9102
9104 {
9105
9106 super.OnRPC(sender, rpc_type,ctx);
9107
9108
9109 switch (rpc_type)
9110 {
9111 #ifndef SERVER
9112 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9113 Param2<bool, string> p = new Param2<bool, string>(false, "");
9114
9116 return;
9117
9118 bool play = p.param1;
9119 string soundSet = p.param2;
9120
9121 if (play)
9122 {
9124 {
9126 {
9128 }
9129 }
9130 else
9131 {
9133 }
9134 }
9135 else
9136 {
9138 }
9139
9140 break;
9141 #endif
9142
9143 }
9144
9146 {
9148 }
9149 }
9150
9151
9152
9153
9155 {
9156 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9157 return plugin.GetID(
name);
9158 }
9159
9161 {
9162 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9163 return plugin.GetName(id);
9164 }
9165
9168 {
9169
9170
9171 int varFlags;
9172 if (!ctx.
Read(varFlags))
9173 return;
9174
9175 if (varFlags & ItemVariableFlags.FLOAT)
9176 {
9178 }
9179 }
9180
9182 {
9183
9184 super.SerializeNumericalVars(floats_out);
9185
9186
9187
9189 {
9191 }
9192
9194 {
9196 }
9197
9199 {
9201 }
9202
9204 {
9209 }
9210
9212 {
9214 }
9215 }
9216
9218 {
9219
9220 super.DeSerializeNumericalVars(floats);
9221
9222
9223 int index = 0;
9224 int mask = Math.Round(floats.Get(index));
9225
9226 index++;
9227
9229 {
9231 {
9233 }
9234 else
9235 {
9236 float quantity = floats.Get(index);
9238 }
9239 index++;
9240 }
9241
9243 {
9244 float wet = floats.Get(index);
9246 index++;
9247 }
9248
9250 {
9251 int liquidtype = Math.Round(floats.Get(index));
9253 index++;
9254 }
9255
9257 {
9259 index++;
9261 index++;
9263 index++;
9265 index++;
9266 }
9267
9269 {
9270 int cleanness = Math.Round(floats.Get(index));
9272 index++;
9273 }
9274 }
9275
9277 {
9278 super.WriteVarsToCTX(ctx);
9279
9280
9282 {
9284 }
9285
9287 {
9289 }
9290
9292 {
9294 }
9295
9297 {
9298 int r,g,b,a;
9304 }
9305
9307 {
9309 }
9310 }
9311
9313 {
9314 if (!super.ReadVarsFromCTX(ctx,version))
9315 return false;
9316
9317 int intValue;
9318 float value;
9319
9320 if (version < 140)
9321 {
9322 if (!ctx.
Read(intValue))
9323 return false;
9324
9325 m_VariablesMask = intValue;
9326 }
9327
9329 {
9330 if (!ctx.
Read(value))
9331 return false;
9332
9334 {
9336 }
9337 else
9338 {
9340 }
9341 }
9342
9343 if (version < 140)
9344 {
9346 {
9347 if (!ctx.
Read(value))
9348 return false;
9349 SetTemperatureDirect(value);
9350 }
9351 }
9352
9354 {
9355 if (!ctx.
Read(value))
9356 return false;
9358 }
9359
9361 {
9362 if (!ctx.
Read(intValue))
9363 return false;
9365 }
9366
9368 {
9369 int r,g,b,a;
9371 return false;
9373 return false;
9375 return false;
9377 return false;
9378
9380 }
9381
9383 {
9384 if (!ctx.
Read(intValue))
9385 return false;
9387 }
9388
9389 if (version >= 138 && version < 140)
9390 {
9392 {
9393 if (!ctx.
Read(intValue))
9394 return false;
9395 SetFrozen(intValue);
9396 }
9397 }
9398
9399 return true;
9400 }
9401
9402
9404 {
9407 {
9409 }
9410
9411 if (!super.OnStoreLoad(ctx, version))
9412 {
9414 return false;
9415 }
9416
9417 if (version >= 114)
9418 {
9419 bool hasQuickBarIndexSaved;
9420
9421 if (!ctx.
Read(hasQuickBarIndexSaved))
9422 {
9424 return false;
9425 }
9426
9427 if (hasQuickBarIndexSaved)
9428 {
9429 int itmQBIndex;
9430
9431
9432 if (!ctx.
Read(itmQBIndex))
9433 {
9435 return false;
9436 }
9437
9438 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9439 if (itmQBIndex != -1 && parentPlayer)
9440 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9441 }
9442 }
9443 else
9444 {
9445
9446 PlayerBase player;
9447 int itemQBIndex;
9448 if (version ==
int.
MAX)
9449 {
9450 if (!ctx.
Read(itemQBIndex))
9451 {
9453 return false;
9454 }
9455 }
9456 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9457 {
9458
9459 if (!ctx.
Read(itemQBIndex))
9460 {
9462 return false;
9463 }
9464 if (itemQBIndex != -1 && player)
9465 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9466 }
9467 }
9468
9469 if (version < 140)
9470 {
9471
9472 if (!LoadVariables(ctx, version))
9473 {
9475 return false;
9476 }
9477 }
9478
9479
9481 {
9483 return false;
9484 }
9485 if (version >= 132)
9486 {
9488 if (raib)
9489 {
9491 {
9493 return false;
9494 }
9495 }
9496 }
9497
9499 return true;
9500 }
9501
9502
9503
9505 {
9506 super.OnStoreSave(ctx);
9507
9508 PlayerBase player;
9509 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9510 {
9512
9513 int itemQBIndex = -1;
9514 itemQBIndex = player.FindQuickBarEntityIndex(this);
9515 ctx.
Write(itemQBIndex);
9516 }
9517 else
9518 {
9520 }
9521
9523
9525 if (raib)
9526 {
9528 }
9529 }
9530
9531
9533 {
9534 super.AfterStoreLoad();
9535
9537 {
9539 }
9540
9542 {
9545 }
9546 }
9547
9549 {
9550 super.EEOnAfterLoad();
9551
9553 {
9555 }
9556
9559 }
9560
9562 {
9563 return false;
9564 }
9565
9566
9567
9569 {
9571 {
9572 #ifdef PLATFORM_CONSOLE
9573
9575 {
9577 if (menu)
9578 {
9580 }
9581 }
9582 #endif
9583 }
9584
9586 {
9589 }
9590
9592 {
9593 SetWeightDirty();
9595 }
9597 {
9600 }
9601
9603 {
9606 }
9608 {
9611 }
9612
9613 super.OnVariablesSynchronized();
9614 }
9615
9616
9617
9619 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9620 {
9621 if (!IsServerCheck(allow_client))
9622 return false;
9623
9625 return false;
9626
9629
9630 if (value <= (min + 0.001))
9631 value = min;
9632
9633 if (value == min)
9634 {
9635 if (destroy_config)
9636 {
9637 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9638 if (dstr)
9639 {
9641 this.Delete();
9642 return true;
9643 }
9644 }
9645 else if (destroy_forced)
9646 {
9648 this.Delete();
9649 return true;
9650 }
9651
9653 }
9654
9657
9659 {
9661
9662 if (delta)
9664 }
9665
9667
9668 return false;
9669 }
9670
9671
9673 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9674 {
9676 }
9677
9679 {
9682 }
9683
9685 {
9688 }
9689
9692 {
9693 float value_clamped = Math.Clamp(value, 0, 1);
9695 SetQuantity(result, destroy_config, destroy_forced);
9696 }
9697
9698
9701 {
9703 }
9704
9706 {
9708 }
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9720 {
9721 int slot = -1;
9722 if (GetInventory())
9723 {
9724 InventoryLocation il = new InventoryLocation;
9725 GetInventory().GetCurrentInventoryLocation(il);
9727 }
9728
9730 }
9731
9733 {
9734 float quantity_max = 0;
9735
9737 {
9738 if (attSlotID != -1)
9739 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9740
9741 if (quantity_max <= 0)
9743 }
9744
9745 if (quantity_max <= 0)
9747
9748 return quantity_max;
9749 }
9750
9752 {
9754 }
9755
9757 {
9759 }
9760
9761
9763 {
9765 }
9766
9768 {
9770 }
9771
9773 {
9775 }
9776
9777
9779 {
9780
9781 float weightEx = GetWeightEx();
9782 float special = GetInventoryAndCargoWeight();
9783 return weightEx - special;
9784 }
9785
9786
9788 {
9790 }
9791
9793 {
9795 {
9796 #ifdef DEVELOPER
9797 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9798 {
9799 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9801 }
9802 #endif
9803
9805 }
9806 else if (HasEnergyManager())
9807 {
9808 #ifdef DEVELOPER
9809 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9810 {
9811 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9812 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9813 }
9814 #endif
9815 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9816 }
9817 else
9818 {
9819 #ifdef DEVELOPER
9820 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9821 {
9822 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9823 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9824 }
9825 #endif
9826 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9827 }
9828 }
9829
9832 {
9833 int item_count = 0;
9835
9836 if (GetInventory().GetCargo() != NULL)
9837 {
9838 item_count = GetInventory().GetCargo().GetItemCount();
9839 }
9840
9841 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9842 {
9843 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9844 if (item)
9845 item_count += item.GetNumberOfItems();
9846 }
9847 return item_count;
9848 }
9849
9852 {
9853 float weight = 0;
9854 float wetness = 1;
9855 if (include_wetness)
9858 {
9859 weight = wetness * m_ConfigWeight;
9860 }
9862 {
9863 weight = 1;
9864 }
9865 return weight;
9866 }
9867
9868
9869
9871 {
9872 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9873 {
9874 GameInventory inv = GetInventory();
9875 array<EntityAI> items = new array<EntityAI>;
9877 for (int i = 0; i < items.Count(); i++)
9878 {
9880 if (item)
9881 {
9883 }
9884 }
9885 }
9886 }
9887
9888
9889
9890
9892 {
9893 float energy = 0;
9894 if (HasEnergyManager())
9895 {
9896 energy = GetCompEM().GetEnergy();
9897 }
9898 return energy;
9899 }
9900
9901
9903 {
9904 super.OnEnergyConsumed();
9905
9907 }
9908
9910 {
9911 super.OnEnergyAdded();
9912
9914 }
9915
9916
9918 {
9919 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9920 {
9922 {
9923 float energy_0to1 = GetCompEM().GetEnergy0To1();
9925 }
9926 }
9927 }
9928
9929
9931 {
9932 return ConfigGetFloat("heatIsolation");
9933 }
9934
9936 {
9938 }
9939
9941 {
9942 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9943 if (
GetGame().ConfigIsExisting(paramPath))
9945
9946 return 0.0;
9947 }
9948
9950 {
9951 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9952 if (
GetGame().ConfigIsExisting(paramPath))
9954
9955 return 0.0;
9956 }
9957
9958 override void SetWet(
float value,
bool allow_client =
false)
9959 {
9960 if (!IsServerCheck(allow_client))
9961 return;
9962
9965
9967
9968 m_VarWet = Math.Clamp(value, min, max);
9969
9971 {
9974 }
9975 }
9976
9977 override void AddWet(
float value)
9978 {
9980 }
9981
9983 {
9985 }
9986
9988 {
9990 }
9991
9993 {
9995 }
9996
9998 {
10000 }
10001
10003 {
10005 }
10006
10007 override void OnWetChanged(
float newVal,
float oldVal)
10008 {
10011 if (newLevel != oldLevel)
10012 {
10014 }
10015 }
10016
10018 {
10019 SetWeightDirty();
10020 }
10021
10023 {
10024 return GetWetLevelInternal(
m_VarWet);
10025 }
10026
10027
10028
10030 {
10032 }
10033
10035 {
10037 }
10038
10040 {
10042 }
10043
10045 {
10047 }
10048
10049
10050
10052 {
10053 if (ConfigIsExisting("itemModelLength"))
10054 {
10055 return ConfigGetFloat("itemModelLength");
10056 }
10057 return 0;
10058 }
10059
10061 {
10062 if (ConfigIsExisting("itemAttachOffset"))
10063 {
10064 return ConfigGetFloat("itemAttachOffset");
10065 }
10066 return 0;
10067 }
10068
10069 override void SetCleanness(
int value,
bool allow_client =
false)
10070 {
10071 if (!IsServerCheck(allow_client))
10072 return;
10073
10075
10077
10080 }
10081
10083 {
10085 }
10086
10088 {
10089 return true;
10090 }
10091
10092
10093
10094
10096 {
10098 }
10099
10101 {
10103 }
10104
10105
10106
10107
10108 override void SetColor(
int r,
int g,
int b,
int a)
10109 {
10115 }
10117 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10118 {
10123 }
10124
10126 {
10128 }
10129
10132 {
10133 int r,g,b,a;
10135 r = r/255;
10136 g = g/255;
10137 b = b/255;
10138 a = a/255;
10139 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10140 }
10141
10142
10143
10144 override void SetLiquidType(
int value,
bool allow_client =
false)
10145 {
10146 if (!IsServerCheck(allow_client))
10147 return;
10148
10153 }
10154
10156 {
10157 return ConfigGetInt("varLiquidTypeInit");
10158 }
10159
10161 {
10163 }
10164
10166 {
10168 SetFrozen(false);
10169 }
10170
10173 {
10174 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10175 }
10176
10177
10180 {
10181 PlayerBase nplayer;
10182 if (PlayerBase.CastTo(nplayer, player))
10183 {
10185
10186 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10187 }
10188 }
10189
10190
10193 {
10194 PlayerBase nplayer;
10195 if (PlayerBase.CastTo(nplayer,player))
10196 {
10197
10198 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10199
10200 }
10201
10202
10203 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10204
10205
10206 if (HasEnergyManager())
10207 {
10208 GetCompEM().UpdatePlugState();
10209 }
10210 }
10211
10212
10214 {
10215 super.OnPlacementStarted(player);
10216
10218 }
10219
10220 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10221 {
10223 {
10224 m_AdminLog.OnPlacementComplete(player,
this);
10225 }
10226
10227 super.OnPlacementComplete(player, position, orientation);
10228 }
10229
10230
10231
10232
10233
10235 {
10237 {
10238 return true;
10239 }
10240 else
10241 {
10242 return false;
10243 }
10244 }
10245
10246
10248 {
10250 {
10252 }
10253 }
10254
10255
10257 {
10259 }
10260
10262 {
10264 }
10265
10266 override void InsertAgent(
int agent,
float count = 1)
10267 {
10268 if (count < 1)
10269 return;
10270
10272 }
10273
10276 {
10278 }
10279
10280
10282 {
10284 }
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10328 {
10330 return false;
10331 return true;
10332 }
10333
10335 {
10336
10338 }
10339
10340
10343 {
10344 super.CheckForRoofLimited(timeTresholdMS);
10345
10347 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10348 {
10349 m_PreviousRoofTestTime = time;
10350 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10351 }
10352 }
10353
10354
10356 {
10358 {
10359 return 0;
10360 }
10361
10362 if (GetInventory().GetAttachmentSlotsCount() != 0)
10363 {
10364 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10365 if (filter)
10366 return filter.GetProtectionLevel(type, false, system);
10367 else
10368 return 0;
10369 }
10370
10371 string subclassPath, entryName;
10372
10373 switch (type)
10374 {
10376 entryName = "biological";
10377 break;
10379 entryName = "chemical";
10380 break;
10381 default:
10382 entryName = "biological";
10383 break;
10384 }
10385
10386 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10387
10389 }
10390
10391
10392
10395 {
10396 if (!IsMagazine())
10398
10400 }
10401
10402
10403
10404
10405
10410 {
10411 return true;
10412 }
10413
10415 {
10417 }
10418
10419
10420
10421
10422
10424 {
10425 if (parent)
10426 {
10427 if (parent.IsInherited(DayZInfected))
10428 return true;
10429
10430 if (!parent.IsRuined())
10431 return true;
10432 }
10433
10434 return true;
10435 }
10436
10438 {
10439 if (!super.CanPutAsAttachment(parent))
10440 {
10441 return false;
10442 }
10443
10444 if (!IsRuined() && !parent.IsRuined())
10445 {
10446 return true;
10447 }
10448
10449 return false;
10450 }
10451
10453 {
10454
10455
10456
10457
10458 return super.CanReceiveItemIntoCargo(item);
10459 }
10460
10462 {
10463
10464
10465
10466
10467 GameInventory attachmentInv = attachment.GetInventory();
10469 {
10470 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10471 return false;
10472 }
10473
10474 InventoryLocation loc = new InventoryLocation();
10475 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10476 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10477 return false;
10478
10479 return super.CanReceiveAttachment(attachment, slotId);
10480 }
10481
10483 {
10484 if (!super.CanReleaseAttachment(attachment))
10485 return false;
10486
10487 return GetInventory().AreChildrenAccessible();
10488 }
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10511 {
10512 int id = muzzle_owner.GetMuzzleID();
10513 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10514
10515 if (WPOF_array)
10516 {
10517 for (int i = 0; i < WPOF_array.Count(); i++)
10518 {
10519 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10520
10521 if (WPOF)
10522 {
10523 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10524 }
10525 }
10526 }
10527 }
10528
10529
10531 {
10532 int id = muzzle_owner.GetMuzzleID();
10534
10535 if (WPOBE_array)
10536 {
10537 for (int i = 0; i < WPOBE_array.Count(); i++)
10538 {
10539 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10540
10541 if (WPOBE)
10542 {
10543 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10544 }
10545 }
10546 }
10547 }
10548
10549
10551 {
10552 int id = muzzle_owner.GetMuzzleID();
10553 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10554
10555 if (WPOOH_array)
10556 {
10557 for (int i = 0; i < WPOOH_array.Count(); i++)
10558 {
10559 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10560
10561 if (WPOOH)
10562 {
10563 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10564 }
10565 }
10566 }
10567 }
10568
10569
10571 {
10572 int id = muzzle_owner.GetMuzzleID();
10573 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10574
10575 if (WPOOH_array)
10576 {
10577 for (int i = 0; i < WPOOH_array.Count(); i++)
10578 {
10579 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10580
10581 if (WPOOH)
10582 {
10583 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10584 }
10585 }
10586 }
10587 }
10588
10589
10591 {
10592 int id = muzzle_owner.GetMuzzleID();
10593 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10594
10595 if (WPOOH_array)
10596 {
10597 for (int i = 0; i < WPOOH_array.Count(); i++)
10598 {
10599 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10600
10601 if (WPOOH)
10602 {
10603 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10604 }
10605 }
10606 }
10607 }
10608
10609
10610
10612 {
10614 {
10615 return true;
10616 }
10617
10618 return false;
10619 }
10620
10622 {
10624 {
10625 return true;
10626 }
10627
10628 return false;
10629 }
10630
10632 {
10634 {
10635 return true;
10636 }
10637
10638 return false;
10639 }
10640
10642 {
10643 return false;
10644 }
10645
10648 {
10649 return UATimeSpent.DEFAULT_DEPLOY;
10650 }
10651
10652
10653
10654
10656 {
10658 SetSynchDirty();
10659 }
10660
10662 {
10664 }
10665
10666
10668 {
10669 return false;
10670 }
10671
10674 {
10675 string att_type = "None";
10676
10677 if (ConfigIsExisting("soundAttType"))
10678 {
10679 att_type = ConfigGetString("soundAttType");
10680 }
10681
10683 }
10684
10686 {
10688 }
10689
10690
10691
10692
10693
10697
10699 {
10702
10704 }
10705
10706
10708 {
10710 return;
10711
10713
10716
10719
10720 SoundParameters params = new SoundParameters();
10724 }
10725
10726
10728 {
10730 return;
10731
10733 SetSynchDirty();
10734
10737 }
10738
10739
10741 {
10743 return;
10744
10746 SetSynchDirty();
10747
10750 }
10751
10753 {
10755 }
10756
10758 {
10760 }
10761
10764 {
10765 if (!
GetGame().IsDedicatedServer())
10766 {
10767 if (ConfigIsExisting("attachSoundSet"))
10768 {
10769 string cfg_path = "";
10770 string soundset = "";
10771 string type_name =
GetType();
10772
10775 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10776 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10777
10778 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10779 {
10780 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10781 {
10782 if (cfg_slot_array[i] == slot_type)
10783 {
10784 soundset = cfg_soundset_array[i];
10785 break;
10786 }
10787 }
10788 }
10789
10790 if (soundset != "")
10791 {
10792 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10794 }
10795 }
10796 }
10797 }
10798
10800 {
10801
10802 }
10803
10804 void OnApply(PlayerBase player);
10805
10807 {
10808 return 1.0;
10809 };
10810
10812 {
10814 }
10815
10817 {
10819 }
10820
10822
10824 {
10825 SetDynamicPhysicsLifeTime(0.01);
10827 }
10828
10830 {
10831 array<string> zone_names = new array<string>;
10832 GetDamageZones(zone_names);
10833 for (int i = 0; i < zone_names.Count(); i++)
10834 {
10835 SetHealthMax(zone_names.Get(i),"Health");
10836 }
10837 SetHealthMax("","Health");
10838 }
10839
10842 {
10843 float global_health = GetHealth01("","Health");
10844 array<string> zones = new array<string>;
10845 GetDamageZones(zones);
10846
10847 for (int i = 0; i < zones.Count(); i++)
10848 {
10849 SetHealth01(zones.Get(i),"Health",global_health);
10850 }
10851 }
10852
10855 {
10856 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10857 }
10858
10860 {
10861 if (!hasRootAsPlayer)
10862 {
10863 if (refParentIB)
10864 {
10865
10866 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10867 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10868
10869 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10870 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10871
10874 }
10875 else
10876 {
10877
10880 }
10881 }
10882 }
10883
10885 {
10887 {
10888 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10889 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10890 {
10891 float heatPermCoef = 1.0;
10893 while (ent)
10894 {
10895 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10896 ent = ent.GetHierarchyParent();
10897 }
10898
10899 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10900 }
10901 }
10902 }
10903
10905 {
10906
10907 EntityAI parent = GetHierarchyParent();
10908 if (!parent)
10909 {
10910 hasParent = false;
10911 hasRootAsPlayer = false;
10912 }
10913 else
10914 {
10915 hasParent = true;
10916 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10917 refParentIB =
ItemBase.Cast(parent);
10918 }
10919 }
10920
10921 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10922 {
10923
10924 }
10925
10927 {
10928
10929 return false;
10930 }
10931
10933 {
10934
10935
10936 return false;
10937 }
10938
10940 {
10941
10942 return false;
10943 }
10944
10947 {
10948 return !GetIsFrozen() &&
IsOpen();
10949 }
10950
10952 {
10953 bool hasParent = false, hasRootAsPlayer = false;
10955
10956 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10957 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10958
10959 if (wwtu || foodDecay)
10960 {
10964
10965 if (processWetness || processTemperature || processDecay)
10966 {
10968
10969 if (processWetness)
10970 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10971
10972 if (processTemperature)
10974
10975 if (processDecay)
10976 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10977 }
10978 }
10979 }
10980
10983 {
10985 }
10986
10988 {
10991
10992 return super.GetTemperatureFreezeThreshold();
10993 }
10994
10996 {
10999
11000 return super.GetTemperatureThawThreshold();
11001 }
11002
11004 {
11007
11008 return super.GetItemOverheatThreshold();
11009 }
11010
11012 {
11014 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11015
11016 return super.GetTemperatureFreezeTime();
11017 }
11018
11020 {
11022 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11023
11024 return super.GetTemperatureThawTime();
11025 }
11026
11031
11033 {
11034 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11035 }
11036
11038 {
11039 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11040 }
11041
11044 {
11046 }
11047
11049 {
11051 }
11052
11054 {
11056 }
11057
11060 {
11061 return null;
11062 }
11063
11066 {
11067 return false;
11068 }
11069
11071 {
11073 {
11076 if (!trg)
11077 {
11079 explosive = this;
11080 }
11081
11082 explosive.PairRemote(trg);
11084
11085 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11086 trg.SetPersistentPairID(persistentID);
11087 explosive.SetPersistentPairID(persistentID);
11088
11089 return true;
11090 }
11091 return false;
11092 }
11093
11096 {
11097 float ret = 1.0;
11100 ret *= GetHealth01();
11101
11102 return ret;
11103 }
11104
11105 #ifdef DEVELOPER
11106 override void SetDebugItem()
11107 {
11108 super.SetDebugItem();
11109 _itemBase = this;
11110 }
11111
11113 {
11114 string text = super.GetDebugText();
11115
11117 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11118
11119 return text;
11120 }
11121 #endif
11122
11124 {
11125 return true;
11126 }
11127
11129
11131
11133 {
11136 }
11137
11138
11146
11162}
11163
11165{
11167 if (entity)
11168 {
11169 bool is_item = entity.IsInherited(
ItemBase);
11170 if (is_item && full_quantity)
11171 {
11174 }
11175 }
11176 else
11177 {
11179 return NULL;
11180 }
11181 return entity;
11182}
11183
11185{
11186 if (item)
11187 {
11188 if (health > 0)
11189 item.SetHealth("", "", health);
11190
11191 if (item.CanHaveTemperature())
11192 {
11194 if (item.CanFreeze())
11195 item.SetFrozen(false);
11196 }
11197
11198 if (item.HasEnergyManager())
11199 {
11200 if (quantity >= 0)
11201 {
11202 item.GetCompEM().SetEnergy0To1(quantity);
11203 }
11204 else
11205 {
11207 }
11208 }
11209 else if (item.IsMagazine())
11210 {
11211 Magazine mag = Magazine.Cast(item);
11212 if (quantity >= 0)
11213 {
11214 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11215 }
11216 else
11217 {
11219 }
11220
11221 }
11222 else
11223 {
11224 if (quantity >= 0)
11225 {
11226 item.SetQuantityNormalized(quantity, false);
11227 }
11228 else
11229 {
11231 }
11232
11233 }
11234 }
11235}
11236
11237#ifdef DEVELOPER
11239#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
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 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...
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)
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)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
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()
override int GetLiquidType()
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)
void Open()
Implementations only.
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 EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
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 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 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
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
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 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 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.