6343{
6345 {
6346 return true;
6347 }
6348};
6349
6350
6351
6353{
6357
6359
6362
6363
6364
6365
6366
6375
6381
6386
6391
6412 protected bool m_IsResultOfSplit
6413
6415
6420
6421
6422
6424
6428
6429
6430
6432
6435
6436
6437
6443
6444
6452
6455
6456
6458
6459
6461
6462
6467
6468
6473
6474
6476
6477
6479 {
6484
6485 if (!
GetGame().IsDedicatedServer())
6486 {
6488 {
6490
6492 {
6494 }
6495 }
6496
6499 }
6500
6501 m_OldLocation = null;
6502
6504 {
6506 }
6507
6508 if (ConfigIsExisting("headSelectionsToHide"))
6509 {
6512 }
6513
6515 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6516 {
6518 }
6519
6521
6522 m_IsResultOfSplit = false;
6523
6525 }
6526
6528 {
6529 super.InitItemVariables();
6530
6536 m_Count = ConfigGetInt(
"count");
6537
6540
6545
6548
6553
6565
6569
6570
6573 if (ConfigIsExisting("canBeSplit"))
6574 {
6577 }
6578
6580 if (ConfigIsExisting("itemBehaviour"))
6582
6583
6586 RegisterNetSyncVariableInt("m_VarLiquidType");
6587 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6588
6589 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6590 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6591 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6592
6593 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6594 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6595 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6596 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6597
6598 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6599 RegisterNetSyncVariableBool("m_IsTakeable");
6600 RegisterNetSyncVariableBool("m_IsHologram");
6601
6604 {
6607 }
6608
6610
6612 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6614
6615 }
6616
6618 {
6620 }
6621
6623 {
6626 {
6631 }
6632 }
6633
6634 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6635 {
6637 {
6640 }
6641
6643 }
6644
6646 {
6652 }
6653
6655
6657 {
6659
6660 if (!action)
6661 {
6662 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6663 return;
6664 }
6665
6667 if (!ai)
6668 {
6670 return;
6671 }
6672
6674 if (!action_array)
6675 {
6676 action_array = new array<ActionBase_Basic>;
6678 }
6679 if (LogManager.IsActionLogEnable())
6680 {
6681 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6682 }
6683
6684 if (action_array.Find(action) != -1)
6685 {
6686 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6687 }
6688 else
6689 {
6690 action_array.Insert(action);
6691 }
6692 }
6693
6695 {
6697 ActionBase action = player.GetActionManager().GetAction(actionName);
6700
6701 if (action_array)
6702 {
6703 action_array.RemoveItem(action);
6704 }
6705 }
6706
6707
6708
6710 {
6711 ActionOverrideData overrideData = new ActionOverrideData();
6715
6717 if (!actionMap)
6718 {
6721 }
6722
6723 actionMap.Insert(this.
Type(), overrideData);
6724
6725 }
6726
6728
6730
6731
6733 {
6736
6739
6740 string config_to_search = "CfgVehicles";
6741 string muzzle_owner_config;
6742
6744 {
6745 if (IsInherited(Weapon))
6746 config_to_search = "CfgWeapons";
6747
6748 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6749
6750 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6751
6753
6754 if (config_OnFire_subclass_count > 0)
6755 {
6756 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6757
6758 for (int i = 0; i < config_OnFire_subclass_count; i++)
6759 {
6760 string particle_class = "";
6762 string config_OnFire_entry = config_OnFire_class + particle_class;
6763 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6764 WPOF_array.Insert(WPOF);
6765 }
6766
6767
6769 }
6770 }
6771
6773 {
6774 config_to_search = "CfgWeapons";
6775 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6776
6777 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6778
6780
6781 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6782 {
6783 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6784
6785 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6786 {
6787 string particle_class2 = "";
6789 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6790 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6791 WPOBE_array.Insert(WPOBE);
6792 }
6793
6794
6796 }
6797 }
6798 }
6799
6800
6802 {
6805
6807 {
6808 string config_to_search = "CfgVehicles";
6809
6810 if (IsInherited(Weapon))
6811 config_to_search = "CfgWeapons";
6812
6813 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6814 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6815
6816 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6817 {
6818
6820
6822 {
6824 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6826 return;
6827 }
6828
6831
6832
6833
6835 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6836
6837 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6838 {
6839 string particle_class = "";
6841 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6843
6844 if (entry_type == CT_CLASS)
6845 {
6846 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6847 WPOOH_array.Insert(WPOF);
6848 }
6849 }
6850
6851
6853 }
6854 }
6855 }
6856
6858 {
6860 }
6861
6863 {
6865 {
6867
6870
6873
6874 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6875 }
6876 }
6877
6879 {
6881 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6882
6884 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6885
6887 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6888
6890 {
6892 }
6893 }
6894
6896 {
6898 }
6899
6901 {
6904 else
6906
6908 {
6911 }
6912 else
6913 {
6916
6919 }
6920
6922 }
6923
6925 {
6927 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6928 }
6929
6931 {
6933 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6935 }
6936
6938 {
6940 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6941 }
6942
6944 {
6947
6948 OverheatingParticle OP = new OverheatingParticle();
6953
6955 }
6956
6958 {
6961
6962 return -1;
6963 }
6964
6966 {
6968 {
6971
6972 for (int i = count; i > 0; --i)
6973 {
6974 int id = i - 1;
6977
6980
6981 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6982 {
6983 if (p)
6984 {
6987 }
6988 }
6989 }
6990 }
6991 }
6992
6994 {
6996 {
6998 {
6999 int id = i - 1;
7001
7002 if (OP)
7003 {
7005
7006 if (p)
7007 {
7009 }
7010
7011 delete OP;
7012 }
7013 }
7014
7017 }
7018 }
7019
7022 {
7023 return 0.0;
7024 }
7025
7026
7028 {
7029 return 250;
7030 }
7031
7033 {
7034 return 0;
7035 }
7036
7039 {
7041 return true;
7042
7043 return false;
7044 }
7045
7048 {
7051
7053 {
7055 }
7056 else
7057 {
7058
7060 }
7061
7063 }
7064
7071 {
7072 return -1;
7073 }
7074
7075
7076
7077
7079 {
7081 {
7083 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7084
7085 if (r_index >= 0)
7086 {
7087 InventoryLocation r_il = new InventoryLocation;
7088 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7089
7090 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7093 {
7094 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7095 }
7097 {
7098 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7099 }
7100
7101 }
7102
7103 player.GetHumanInventory().ClearUserReservedLocation(this);
7104 }
7105
7108 }
7109
7110
7111
7112
7114 {
7115 return ItemBase.m_DebugActionsMask;
7116 }
7117
7119 {
7120 return ItemBase.m_DebugActionsMask & mask;
7121 }
7122
7124 {
7125 ItemBase.m_DebugActionsMask = mask;
7126 }
7127
7129 {
7130 ItemBase.m_DebugActionsMask |= mask;
7131 }
7132
7134 {
7135 ItemBase.m_DebugActionsMask &= ~mask;
7136 }
7137
7139 {
7141 {
7143 }
7144 else
7145 {
7147 }
7148 }
7149
7150
7152 {
7153 if (GetEconomyProfile())
7154 {
7155 float q_max = GetEconomyProfile().GetQuantityMax();
7156 if (q_max > 0)
7157 {
7158 float q_min = GetEconomyProfile().GetQuantityMin();
7159 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7160
7162 {
7163 ComponentEnergyManager comp = GetCompEM();
7165 {
7167 }
7168 }
7170 {
7172
7173 }
7174
7175 }
7176 }
7177 }
7178
7181 {
7182 EntityAI parent = GetHierarchyParent();
7183
7184 if (parent)
7185 {
7186 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7187 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7188 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7189 }
7190 }
7191
7194 {
7195 EntityAI parent = GetHierarchyParent();
7196
7197 if (parent)
7198 {
7199 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7200 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7201 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7202 }
7203 }
7204
7206 {
7207
7208
7209
7210
7212
7214 {
7215 if (ScriptInputUserData.CanStoreInputUserData())
7216 {
7217 ScriptInputUserData ctx = new ScriptInputUserData;
7223 ctx.
Write(use_stack_max);
7226
7228 {
7229 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7230 }
7231 }
7232 }
7233 else if (!
GetGame().IsMultiplayer())
7234 {
7236 }
7237 }
7238
7240 {
7242 }
7243
7245 {
7247 }
7248
7250 {
7252 }
7253
7255 {
7256
7257 return false;
7258 }
7259
7261 {
7262 return false;
7263 }
7264
7268 {
7269 return false;
7270 }
7271
7273 {
7274 return "";
7275 }
7276
7278
7280 {
7281 return false;
7282 }
7283
7285 {
7286 return true;
7287 }
7288
7289
7290
7292 {
7293 return true;
7294 }
7295
7297 {
7298 return true;
7299 }
7300
7302 {
7303 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7305 }
7306
7308 {
7310 }
7311
7313 {
7315 if (!is_being_placed)
7317 SetSynchDirty();
7318 }
7319
7320
7322
7324 {
7326 }
7327
7329 {
7331 }
7332
7334 {
7335 return 1;
7336 }
7337
7339 {
7340 return false;
7341 }
7342
7344 {
7346 SetSynchDirty();
7347 }
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7384 {
7385 super.OnMovedInsideCargo(container);
7386
7387 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7388 }
7389
7390 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7391 {
7392 super.EEItemLocationChanged(oldLoc,newLoc);
7393
7394 PlayerBase new_player = null;
7395 PlayerBase old_player = null;
7396
7397 if (newLoc.GetParent())
7398 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7399
7400 if (oldLoc.GetParent())
7401 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7402
7404 {
7405 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7406
7407 if (r_index >= 0)
7408 {
7409 InventoryLocation r_il = new InventoryLocation;
7410 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7411
7412 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7415 {
7416 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7417 }
7419 {
7420 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7421 }
7422
7423 }
7424 }
7425
7427 {
7428 if (new_player)
7429 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7430
7431 if (new_player == old_player)
7432 {
7433
7434 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7435 {
7437 {
7438 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7439 {
7440 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7441 }
7442 }
7443 else
7444 {
7445 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7446 }
7447 }
7448
7449 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7450 {
7451 int type = oldLoc.GetType();
7453 {
7454 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7455 }
7457 {
7458 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7459 }
7460 }
7461 if (!m_OldLocation)
7462 {
7463 m_OldLocation = new InventoryLocation;
7464 }
7465 m_OldLocation.Copy(oldLoc);
7466 }
7467 else
7468 {
7469 if (m_OldLocation)
7470 {
7471 m_OldLocation.Reset();
7472 }
7473 }
7474
7476 }
7477 else
7478 {
7479 if (new_player)
7480 {
7481 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7482 if (res_index >= 0)
7483 {
7484 InventoryLocation il = new InventoryLocation;
7485 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7487 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7490 {
7491 il.
GetParent().GetOnReleaseLock().Invoke(it);
7492 }
7494 {
7496 }
7497
7498 }
7499 }
7501 {
7502
7504 }
7505
7506 if (m_OldLocation)
7507 {
7508 m_OldLocation.Reset();
7509 }
7510 }
7511 }
7512
7513 override void EOnContact(IEntity other, Contact extra)
7514 {
7516 {
7517 int liquidType = -1;
7519 if (impactSpeed > 0.0)
7520 {
7522 #ifndef SERVER
7524 #else
7526 SetSynchDirty();
7527 #endif
7529 }
7530 }
7531
7532 #ifdef SERVER
7533 if (GetCompEM() && GetCompEM().IsPlugged())
7534 {
7535 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7536 GetCompEM().UnplugThis();
7537 }
7538 #endif
7539 }
7540
7542
7544 {
7546 }
7547
7549 {
7550
7551 }
7552
7554 {
7555 super.OnItemLocationChanged(old_owner, new_owner);
7556
7557 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7558 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7559
7560 if (!relatedPlayer && playerNew)
7561 relatedPlayer = playerNew;
7562
7563 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7564 {
7566 if (actionMgr)
7567 {
7568 ActionBase currentAction = actionMgr.GetRunningAction();
7569 if (currentAction)
7571 }
7572 }
7573
7574 Man ownerPlayerOld = null;
7575 Man ownerPlayerNew = null;
7576
7577 if (old_owner)
7578 {
7579 if (old_owner.
IsMan())
7580 {
7581 ownerPlayerOld = Man.Cast(old_owner);
7582 }
7583 else
7584 {
7585 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7586 }
7587 }
7588 else
7589 {
7591 {
7593
7594 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7595 {
7596 GetCompEM().UnplugThis();
7597 }
7598 }
7599 }
7600
7601 if (new_owner)
7602 {
7603 if (new_owner.
IsMan())
7604 {
7605 ownerPlayerNew = Man.Cast(new_owner);
7606 }
7607 else
7608 {
7609 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7610 }
7611 }
7612
7613 if (ownerPlayerOld != ownerPlayerNew)
7614 {
7615 if (ownerPlayerOld)
7616 {
7617 array<EntityAI> subItemsExit = new array<EntityAI>;
7619 for (int i = 0; i < subItemsExit.Count(); i++)
7620 {
7623 }
7624 }
7625
7626 if (ownerPlayerNew)
7627 {
7628 array<EntityAI> subItemsEnter = new array<EntityAI>;
7630 for (int j = 0; j < subItemsEnter.Count(); j++)
7631 {
7634 }
7635 }
7636 }
7637 else if (ownerPlayerNew != null)
7638 {
7639 PlayerBase nplayer;
7640 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7641 {
7642 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7644 for (int k = 0; k < subItemsUpdate.Count(); k++)
7645 {
7647 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7648 }
7649 }
7650 }
7651
7652 if (old_owner)
7653 old_owner.OnChildItemRemoved(this);
7654 if (new_owner)
7655 new_owner.OnChildItemReceived(this);
7656 }
7657
7658
7660 {
7661 super.EEDelete(parent);
7662 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7663 if (player)
7664 {
7666
7667 if (player.IsAlive())
7668 {
7669 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7670 if (r_index >= 0)
7671 {
7672 InventoryLocation r_il = new InventoryLocation;
7673 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7674
7675 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7678 {
7679 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7680 }
7682 {
7683 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7684 }
7685
7686 }
7687
7688 player.RemoveQuickBarEntityShortcut(this);
7689 }
7690 }
7691 }
7692
7694 {
7695 super.EEKilled(killer);
7696
7699 {
7700 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7701 {
7702 if (IsMagazine())
7703 {
7704 if (Magazine.Cast(this).GetAmmoCount() > 0)
7705 {
7707 }
7708 }
7709 else
7710 {
7712 }
7713 }
7714 }
7715 }
7716
7718 {
7719 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7720
7721 super.OnWasAttached(parent, slot_id);
7722
7725
7727 }
7728
7730 {
7731 super.OnWasDetached(parent, slot_id);
7732
7735 }
7736
7738 {
7739 int idx;
7742
7743 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7744 if (inventory_slots.Count() < 1)
7745 {
7746 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7747 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7748 }
7749 else
7750 {
7751 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7752 }
7753
7754 idx = inventory_slots.Find(slot);
7755 if (idx < 0)
7756 return "";
7757
7758 return attach_types.Get(idx);
7759 }
7760
7762 {
7763 int idx = -1;
7764 string slot;
7765
7768
7769 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7770 if (inventory_slots.Count() < 1)
7771 {
7772 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7773 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7774 }
7775 else
7776 {
7777 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7778 if (detach_types.Count() < 1)
7779 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7780 }
7781
7782 for (int i = 0; i < inventory_slots.Count(); i++)
7783 {
7784 slot = inventory_slots.Get(i);
7785 }
7786
7787 if (slot != "")
7788 {
7789 if (detach_types.Count() == 1)
7790 idx = 0;
7791 else
7792 idx = inventory_slots.Find(slot);
7793 }
7794 if (idx < 0)
7795 return "";
7796
7797 return detach_types.Get(idx);
7798 }
7799
7801 {
7802
7804
7805
7806 float min_time = 1;
7807 float max_time = 3;
7808 float delay = Math.RandomFloat(min_time, max_time);
7809
7810 explode_timer.Run(delay, this, "DoAmmoExplosion");
7811 }
7812
7814 {
7815 Magazine magazine = Magazine.Cast(this);
7816 int pop_sounds_count = 6;
7817 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7818
7819
7820 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7821 string sound_name = pop_sounds[ sound_idx ];
7823
7824
7825 magazine.ServerAddAmmoCount(-1);
7826
7827
7828 float min_temp_to_explode = 100;
7829
7830 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7831 {
7833 }
7834 }
7835
7836
7837 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7838 {
7839 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7840
7841 const int CHANCE_DAMAGE_CARGO = 4;
7842 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7843 const int CHANCE_DAMAGE_NOTHING = 2;
7844
7846 {
7847 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7848 int chances;
7849 int rnd;
7850
7851 if (GetInventory().GetCargo())
7852 {
7853 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7854 rnd = Math.RandomInt(0,chances);
7855
7856 if (rnd < CHANCE_DAMAGE_CARGO)
7857 {
7859 }
7860 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7861 {
7863 }
7864 }
7865 else
7866 {
7867 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7868 rnd = Math.RandomInt(0,chances);
7869
7870 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7871 {
7873 }
7874 }
7875 }
7876 }
7877
7879 {
7880 if (GetInventory().GetCargo())
7881 {
7882 int item_count = GetInventory().GetCargo().GetItemCount();
7883 if (item_count > 0)
7884 {
7885 int random_pick = Math.RandomInt(0, item_count);
7887 if (!item.IsExplosive())
7888 {
7889 item.AddHealth("","",damage);
7890 return true;
7891 }
7892 }
7893 }
7894 return false;
7895 }
7896
7898 {
7899 int attachment_count = GetInventory().AttachmentCount();
7900 if (attachment_count > 0)
7901 {
7902 int random_pick = Math.RandomInt(0, attachment_count);
7903 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7904 if (!attachment.IsExplosive())
7905 {
7906 attachment.AddHealth("","",damage);
7907 return true;
7908 }
7909 }
7910 return false;
7911 }
7912
7914 {
7916 }
7917
7919 {
7921 return GetInventory().CanRemoveEntity();
7922
7923 return false;
7924 }
7925
7927 {
7928
7930 return false;
7931
7932
7934 return false;
7935
7936
7937
7939 if (delta == 0)
7940 return false;
7941
7942
7943 return true;
7944 }
7945
7947 {
7949 {
7950 if (ScriptInputUserData.CanStoreInputUserData())
7951 {
7952 ScriptInputUserData ctx = new ScriptInputUserData;
7957 ctx.
Write(destination_entity);
7961 }
7962 }
7963 else if (!
GetGame().IsMultiplayer())
7964 {
7966 }
7967 }
7968
7970 {
7971 float split_quantity_new;
7975 InventoryLocation loc = new InventoryLocation;
7976
7977 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7978 {
7980 split_quantity_new = stack_max;
7981 else
7983
7985 {
7986 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7987 if (new_item)
7988 {
7989 new_item.SetResultOfSplit(true);
7990 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7992 new_item.
SetQuantity(split_quantity_new,
false,
true);
7993 }
7994 }
7995 }
7996 else if (destination_entity && slot_id == -1)
7997 {
7998 if (quantity > stack_max)
7999 split_quantity_new = stack_max;
8000 else
8001 split_quantity_new = quantity;
8002
8004 {
8006 {
8009 }
8010
8011 if (new_item)
8012 {
8013 new_item.SetResultOfSplit(true);
8014 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8016 new_item.
SetQuantity(split_quantity_new,
false,
true);
8017 }
8018 }
8019 }
8020 else
8021 {
8022 if (stack_max != 0)
8023 {
8025 {
8027 }
8028
8029 if (split_quantity_new == 0)
8030 {
8031 if (!
GetGame().IsMultiplayer())
8032 player.PhysicalPredictiveDropItem(this);
8033 else
8034 player.ServerDropEntity(this);
8035 return;
8036 }
8037
8039 {
8041
8042 if (new_item)
8043 {
8044 new_item.SetResultOfSplit(true);
8045 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8048 new_item.PlaceOnSurface();
8049 }
8050 }
8051 }
8052 }
8053 }
8054
8056 {
8057 float split_quantity_new;
8061 InventoryLocation loc = new InventoryLocation;
8062
8063 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8064 {
8066 split_quantity_new = stack_max;
8067 else
8069
8071 {
8072 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8073 if (new_item)
8074 {
8075 new_item.SetResultOfSplit(true);
8076 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8078 new_item.
SetQuantity(split_quantity_new,
false,
true);
8079 }
8080 }
8081 }
8082 else if (destination_entity && slot_id == -1)
8083 {
8084 if (quantity > stack_max)
8085 split_quantity_new = stack_max;
8086 else
8087 split_quantity_new = quantity;
8088
8090 {
8092 {
8095 }
8096
8097 if (new_item)
8098 {
8099 new_item.SetResultOfSplit(true);
8100 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8102 new_item.
SetQuantity(split_quantity_new,
false,
true);
8103 }
8104 }
8105 }
8106 else
8107 {
8108 if (stack_max != 0)
8109 {
8111 {
8113 }
8114
8116 {
8118
8119 if (new_item)
8120 {
8121 new_item.SetResultOfSplit(true);
8122 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8125 new_item.PlaceOnSurface();
8126 }
8127 }
8128 }
8129 }
8130 }
8131
8133 {
8135 {
8136 if (ScriptInputUserData.CanStoreInputUserData())
8137 {
8138 ScriptInputUserData ctx = new ScriptInputUserData;
8143 dst.WriteToContext(ctx);
8145 }
8146 }
8147 else if (!
GetGame().IsMultiplayer())
8148 {
8150 }
8151 }
8152
8154 {
8156 {
8157 if (ScriptInputUserData.CanStoreInputUserData())
8158 {
8159 ScriptInputUserData ctx = new ScriptInputUserData;
8164 ctx.
Write(destination_entity);
8170 }
8171 }
8172 else if (!
GetGame().IsMultiplayer())
8173 {
8175 }
8176 }
8177
8179 {
8181 }
8182
8184 {
8186 float split_quantity_new;
8188 if (dst.IsValid())
8189 {
8190 int slot_id = dst.GetSlot();
8192
8193 if (quantity > stack_max)
8194 split_quantity_new = stack_max;
8195 else
8196 split_quantity_new = quantity;
8197
8199 {
8201
8202 if (new_item)
8203 {
8204 new_item.SetResultOfSplit(true);
8205 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8207 new_item.
SetQuantity(split_quantity_new,
false,
true);
8208 }
8209
8210 return new_item;
8211 }
8212 }
8213
8214 return null;
8215 }
8216
8218 {
8220 float split_quantity_new;
8222 if (destination_entity)
8223 {
8225 if (quantity > stackable)
8226 split_quantity_new = stackable;
8227 else
8228 split_quantity_new = quantity;
8229
8231 {
8232 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8233 if (new_item)
8234 {
8235 new_item.SetResultOfSplit(true);
8236 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8238 new_item.
SetQuantity(split_quantity_new,
false,
true);
8239 }
8240 }
8241 }
8242 }
8243
8245 {
8247 {
8248 if (ScriptInputUserData.CanStoreInputUserData())
8249 {
8250 ScriptInputUserData ctx = new ScriptInputUserData;
8255 ItemBase destination_entity =
this;
8256 ctx.
Write(destination_entity);
8260 }
8261 }
8262 else if (!
GetGame().IsMultiplayer())
8263 {
8265 }
8266 }
8267
8269 {
8271 float split_quantity_new;
8273 if (player)
8274 {
8276 if (quantity > stackable)
8277 split_quantity_new = stackable;
8278 else
8279 split_quantity_new = quantity;
8280
8282 {
8283 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8284 new_item =
ItemBase.Cast(in_hands);
8285 if (new_item)
8286 {
8287 new_item.SetResultOfSplit(true);
8288 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8290 new_item.SetQuantity(split_quantity_new, false, true);
8291 }
8292 }
8293 }
8294 }
8295
8297 {
8299 float split_quantity_new = Math.Floor(quantity * 0.5);
8300
8302 return;
8303
8305
8306 if (new_item)
8307 {
8308 if (new_item.GetQuantityMax() < split_quantity_new)
8309 {
8310 split_quantity_new = new_item.GetQuantityMax();
8311 }
8312
8313 new_item.SetResultOfSplit(true);
8314 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8315
8317 {
8320 }
8321 else
8322 {
8324 new_item.
SetQuantity(split_quantity_new,
false,
true);
8325 }
8326 }
8327 }
8328
8330 {
8332 float split_quantity_new = Math.Floor(quantity / 2);
8333
8335 return;
8336
8337 InventoryLocation invloc = new InventoryLocation;
8339
8341 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8342
8343 if (new_item)
8344 {
8345 if (new_item.GetQuantityMax() < split_quantity_new)
8346 {
8347 split_quantity_new = new_item.GetQuantityMax();
8348 }
8350 {
8353 }
8354 else if (split_quantity_new > 1)
8355 {
8357 new_item.
SetQuantity(split_quantity_new,
false,
true);
8358 }
8359 }
8360 }
8361
8364 {
8365 SetWeightDirty();
8367
8368 if (parent)
8369 parent.OnAttachmentQuantityChangedEx(this, delta);
8370
8372 {
8374 {
8376 }
8378 {
8379 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8381 }
8382 }
8383
8384 }
8385
8388 {
8389
8390 }
8391
8394 {
8396 }
8397
8399 {
8400 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8401
8403 {
8404 if (newLevel == GameConstants.STATE_RUINED)
8405 {
8407 EntityAI parent = GetHierarchyParent();
8408 if (parent && parent.IsFireplace())
8409 {
8410 CargoBase cargo = GetInventory().GetCargo();
8411 if (cargo)
8412 {
8414 {
8416 }
8417 }
8418 }
8419 }
8420
8422 {
8423
8425 return;
8426 }
8427
8428 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8429 {
8431 }
8432 }
8433 }
8434
8435
8437 {
8438 super.OnRightClick();
8439
8441 {
8443 {
8444 if (ScriptInputUserData.CanStoreInputUserData())
8445 {
8446 EntityAI root = GetHierarchyRoot();
8447 Man playerOwner = GetHierarchyRootPlayer();
8448 InventoryLocation dst = new InventoryLocation;
8449
8450
8451 if (!playerOwner && root && root == this)
8452 {
8454 }
8455 else
8456 {
8457
8458 GetInventory().GetCurrentInventoryLocation(dst);
8460 {
8463 {
8465 }
8466 else
8467 {
8469
8470
8471 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8472 {
8474 }
8475 else
8476 {
8477 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8478 }
8479 }
8480 }
8481 }
8482
8483 ScriptInputUserData ctx = new ScriptInputUserData;
8491 }
8492 }
8493 else if (!
GetGame().IsMultiplayer())
8494 {
8496 }
8497 }
8498 }
8499
8501 {
8502 if (root)
8503 {
8504 vector m4[4];
8505 root.GetTransform(m4);
8506 dst.SetGround(this, m4);
8507 }
8508 else
8509 {
8510 GetInventory().GetCurrentInventoryLocation(dst);
8511 }
8512 }
8513
8514 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8515 {
8516
8517 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8518 return false;
8519
8520 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8521 return false;
8522
8523
8525 return false;
8526
8527
8528 Magazine mag = Magazine.Cast(this);
8529 if (mag)
8530 {
8531 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8532 return false;
8533
8534 if (stack_max_limit)
8535 {
8536 Magazine other_mag = Magazine.Cast(other_item);
8537 if (other_item)
8538 {
8539 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8540 return false;
8541 }
8542
8543 }
8544 }
8545 else
8546 {
8547
8549 return false;
8550
8552 return false;
8553 }
8554
8555 PlayerBase player = null;
8556 if (CastTo(player, GetHierarchyRootPlayer()))
8557 {
8558 if (player.GetInventory().HasAttachment(this))
8559 return false;
8560
8561 if (player.IsItemsToDelete())
8562 return false;
8563 }
8564
8565 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8566 return false;
8567
8568 int slotID;
8570 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8571 return false;
8572
8573 return true;
8574 }
8575
8577 {
8579 }
8580
8582 {
8583 return m_IsResultOfSplit;
8584 }
8585
8587 {
8588 m_IsResultOfSplit = value;
8589 }
8590
8592 {
8594 }
8595
8597 {
8598 float other_item_quantity = other_item.GetQuantity();
8599 float this_free_space;
8600
8602
8604
8605 if (other_item_quantity > this_free_space)
8606 {
8607 return this_free_space;
8608 }
8609 else
8610 {
8611 return other_item_quantity;
8612 }
8613 }
8614
8616 {
8618 }
8619
8621 {
8623 return;
8624
8625 if (!IsMagazine() && other_item)
8626 {
8628 if (quantity_used != 0)
8629 {
8630 float hp1 = GetHealth01("","");
8631 float hp2 = other_item.GetHealth01("","");
8632 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8633 hpResult = hpResult / (
GetQuantity() + quantity_used);
8634
8635 hpResult *= GetMaxHealth();
8636 Math.Round(hpResult);
8637 SetHealth("", "Health", hpResult);
8638
8640 other_item.AddQuantity(-quantity_used);
8641 }
8642 }
8644 }
8645
8647 {
8648 #ifdef SERVER
8649 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8650 GetHierarchyParent().IncreaseLifetimeUp();
8651 #endif
8652 };
8653
8655 {
8656 PlayerBase p = PlayerBase.Cast(player);
8657
8658 array<int> recipesIds = p.m_Recipes;
8659 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8660 if (moduleRecipesManager)
8661 {
8662 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8663 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8664 }
8665
8666 for (int i = 0;i < recipesIds.Count(); i++)
8667 {
8668 int key = recipesIds.Get(i);
8669 string recipeName = moduleRecipesManager.GetRecipeName(key);
8671 }
8672 }
8673
8674
8675 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8676 {
8677 super.GetDebugActions(outputList);
8678
8679
8685
8686
8691
8696
8697
8701
8702
8704 {
8708 }
8709
8712
8713
8717
8719
8720 InventoryLocation loc = new InventoryLocation();
8721 GetInventory().GetCurrentInventoryLocation(loc);
8723 {
8724 if (Gizmo_IsSupported())
8727 }
8728
8730 }
8731
8732
8733
8734
8736 {
8737 super.OnAction(action_id, player, ctx);
8738
8740 {
8741 switch (action_id)
8742 {
8745 return true;
8748 return true;
8749 }
8750 }
8751
8753 {
8754 switch (action_id)
8755 {
8757 Delete();
8758 return true;
8759 }
8760 }
8761
8762 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8763 {
8764 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8765 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8766 PlayerBase p = PlayerBase.Cast(player);
8767 if (
EActions.RECIPES_RANGE_START < 1000)
8768 {
8769 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8770 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8771 }
8772 }
8773 #ifndef SERVER
8774 else if (action_id ==
EActions.WATCH_PLAYER)
8775 {
8776 PluginDeveloper.SetDeveloperItemClientEx(player);
8777 }
8778 #endif
8780 {
8781 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8782 {
8783 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8784 OnDebugButtonPressServer(id + 1);
8785 }
8786
8787 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8788 {
8789 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8791 }
8792
8793 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8794 {
8795 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8797 }
8798
8799 else if (action_id ==
EActions.ADD_QUANTITY)
8800 {
8801 if (IsMagazine())
8802 {
8803 Magazine mag = Magazine.Cast(this);
8804 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8805 }
8806 else
8807 {
8809 }
8810
8811 if (m_EM)
8812 {
8813 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8814 }
8815
8816 }
8817
8818 else if (action_id ==
EActions.REMOVE_QUANTITY)
8819 {
8820 if (IsMagazine())
8821 {
8822 Magazine mag2 = Magazine.Cast(this);
8823 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8824 }
8825 else
8826 {
8828 }
8829 if (m_EM)
8830 {
8831 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8832 }
8833
8834 }
8835
8836 else if (action_id ==
EActions.SET_QUANTITY_0)
8837 {
8839
8840 if (m_EM)
8841 {
8842 m_EM.SetEnergy(0);
8843 }
8844 }
8845
8846 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8847 {
8849
8850 if (m_EM)
8851 {
8852 m_EM.SetEnergy(m_EM.GetEnergyMax());
8853 }
8854 }
8855
8856 else if (action_id ==
EActions.ADD_HEALTH)
8857 {
8858 AddHealth("","",GetMaxHealth("","Health")/5);
8859 }
8860 else if (action_id ==
EActions.REMOVE_HEALTH)
8861 {
8862 AddHealth("","",-GetMaxHealth("","Health")/5);
8863 }
8864 else if (action_id ==
EActions.DESTROY_HEALTH)
8865 {
8866 SetHealth01("","",0);
8867 }
8868 else if (action_id ==
EActions.WATCH_ITEM)
8869 {
8871 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8872 #ifdef DEVELOPER
8873 SetDebugDeveloper_item(this);
8874 #endif
8875 }
8876
8877 else if (action_id ==
EActions.ADD_TEMPERATURE)
8878 {
8879 AddTemperature(20);
8880
8881 }
8882
8883 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8884 {
8885 AddTemperature(-20);
8886
8887 }
8888
8889 else if (action_id ==
EActions.FLIP_FROZEN)
8890 {
8891 SetFrozen(!GetIsFrozen());
8892
8893 }
8894
8895 else if (action_id ==
EActions.ADD_WETNESS)
8896 {
8898
8899 }
8900
8901 else if (action_id ==
EActions.REMOVE_WETNESS)
8902 {
8904
8905 }
8906
8907 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8908 {
8911
8912
8913 }
8914
8915 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8916 {
8919 }
8920
8921 else if (action_id ==
EActions.MAKE_SPECIAL)
8922 {
8923 auto debugParams = DebugSpawnParams.WithPlayer(player);
8924 OnDebugSpawnEx(debugParams);
8925 }
8926
8927 }
8928
8929
8930 return false;
8931 }
8932
8933
8934
8935
8939
8942
8943
8944
8946 {
8947 return false;
8948 }
8949
8950
8952 {
8953 return true;
8954 }
8955
8956
8958 {
8959 return true;
8960 }
8961
8962
8963
8965 {
8966 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8968 }
8969
8972 {
8973 return null;
8974 }
8975
8977 {
8978 return false;
8979 }
8980
8982 {
8983 return false;
8984 }
8985
8989
8990
8992 {
8993 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8994 return module_repairing.CanRepair(this, item_repair_kit);
8995 }
8996
8997
8998 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8999 {
9000 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9001 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9002 }
9003
9004
9006 {
9007
9008
9009
9010
9011
9012
9013
9014
9015 return 1;
9016 }
9017
9018
9019
9021 {
9023 }
9024
9025
9026
9028 {
9030 }
9031
9032
9041 {
9042 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9043
9044 if (player)
9045 {
9046 player.MessageStatus(text);
9047 }
9048 }
9049
9050
9059 {
9060 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9061
9062 if (player)
9063 {
9064 player.MessageAction(text);
9065 }
9066 }
9067
9068
9077 {
9078 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9079
9080 if (player)
9081 {
9082 player.MessageFriendly(text);
9083 }
9084 }
9085
9086
9095 {
9096 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9097
9098 if (player)
9099 {
9100 player.MessageImportant(text);
9101 }
9102 }
9103
9105 {
9106 return true;
9107 }
9108
9109
9110 override bool KindOf(
string tag)
9111 {
9112 bool found = false;
9113 string item_name = this.
GetType();
9116
9117 int array_size = item_tag_array.Count();
9118 for (int i = 0; i < array_size; i++)
9119 {
9120 if (item_tag_array.Get(i) == tag)
9121 {
9122 found = true;
9123 break;
9124 }
9125 }
9126 return found;
9127 }
9128
9129
9131 {
9132
9133 super.OnRPC(sender, rpc_type,ctx);
9134
9135
9136 switch (rpc_type)
9137 {
9138 #ifndef SERVER
9139 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9140 Param2<bool, string> p = new Param2<bool, string>(false, "");
9141
9143 return;
9144
9145 bool play = p.param1;
9146 string soundSet = p.param2;
9147
9148 if (play)
9149 {
9151 {
9153 {
9155 }
9156 }
9157 else
9158 {
9160 }
9161 }
9162 else
9163 {
9165 }
9166
9167 break;
9168 #endif
9169
9170 }
9171
9173 {
9175 }
9176 }
9177
9178
9179
9180
9182 {
9183 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9184 return plugin.GetID(
name);
9185 }
9186
9188 {
9189 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9190 return plugin.GetName(id);
9191 }
9192
9195 {
9196
9197
9198 int varFlags;
9199 if (!ctx.
Read(varFlags))
9200 return;
9201
9202 if (varFlags & ItemVariableFlags.FLOAT)
9203 {
9205 }
9206 }
9207
9209 {
9210
9211 super.SerializeNumericalVars(floats_out);
9212
9213
9214
9216 {
9218 }
9219
9221 {
9223 }
9224
9226 {
9228 }
9229
9231 {
9236 }
9237
9239 {
9241 }
9242 }
9243
9245 {
9246
9247 super.DeSerializeNumericalVars(floats);
9248
9249
9250 int index = 0;
9251 int mask = Math.Round(floats.Get(index));
9252
9253 index++;
9254
9256 {
9258 {
9260 }
9261 else
9262 {
9263 float quantity = floats.Get(index);
9265 }
9266 index++;
9267 }
9268
9270 {
9271 float wet = floats.Get(index);
9273 index++;
9274 }
9275
9277 {
9278 int liquidtype = Math.Round(floats.Get(index));
9280 index++;
9281 }
9282
9284 {
9286 index++;
9288 index++;
9290 index++;
9292 index++;
9293 }
9294
9296 {
9297 int cleanness = Math.Round(floats.Get(index));
9299 index++;
9300 }
9301 }
9302
9304 {
9305 super.WriteVarsToCTX(ctx);
9306
9307
9309 {
9311 }
9312
9314 {
9316 }
9317
9319 {
9321 }
9322
9324 {
9325 int r,g,b,a;
9331 }
9332
9334 {
9336 }
9337 }
9338
9340 {
9341 if (!super.ReadVarsFromCTX(ctx,version))
9342 return false;
9343
9344 int intValue;
9345 float value;
9346
9347 if (version < 140)
9348 {
9349 if (!ctx.
Read(intValue))
9350 return false;
9351
9352 m_VariablesMask = intValue;
9353 }
9354
9356 {
9357 if (!ctx.
Read(value))
9358 return false;
9359
9361 {
9363 }
9364 else
9365 {
9367 }
9368 }
9369
9370 if (version < 140)
9371 {
9373 {
9374 if (!ctx.
Read(value))
9375 return false;
9376 SetTemperatureDirect(value);
9377 }
9378 }
9379
9381 {
9382 if (!ctx.
Read(value))
9383 return false;
9385 }
9386
9388 {
9389 if (!ctx.
Read(intValue))
9390 return false;
9392 }
9393
9395 {
9396 int r,g,b,a;
9398 return false;
9400 return false;
9402 return false;
9404 return false;
9405
9407 }
9408
9410 {
9411 if (!ctx.
Read(intValue))
9412 return false;
9414 }
9415
9416 if (version >= 138 && version < 140)
9417 {
9419 {
9420 if (!ctx.
Read(intValue))
9421 return false;
9422 SetFrozen(intValue);
9423 }
9424 }
9425
9426 return true;
9427 }
9428
9429
9431 {
9434 {
9436 }
9437
9438 if (!super.OnStoreLoad(ctx, version))
9439 {
9441 return false;
9442 }
9443
9444 if (version >= 114)
9445 {
9446 bool hasQuickBarIndexSaved;
9447
9448 if (!ctx.
Read(hasQuickBarIndexSaved))
9449 {
9451 return false;
9452 }
9453
9454 if (hasQuickBarIndexSaved)
9455 {
9456 int itmQBIndex;
9457
9458
9459 if (!ctx.
Read(itmQBIndex))
9460 {
9462 return false;
9463 }
9464
9465 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9466 if (itmQBIndex != -1 && parentPlayer)
9467 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9468 }
9469 }
9470 else
9471 {
9472
9473 PlayerBase player;
9474 int itemQBIndex;
9475 if (version ==
int.
MAX)
9476 {
9477 if (!ctx.
Read(itemQBIndex))
9478 {
9480 return false;
9481 }
9482 }
9483 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9484 {
9485
9486 if (!ctx.
Read(itemQBIndex))
9487 {
9489 return false;
9490 }
9491 if (itemQBIndex != -1 && player)
9492 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9493 }
9494 }
9495
9496 if (version < 140)
9497 {
9498
9499 if (!LoadVariables(ctx, version))
9500 {
9502 return false;
9503 }
9504 }
9505
9506
9508 {
9510 return false;
9511 }
9512 if (version >= 132)
9513 {
9515 if (raib)
9516 {
9518 {
9520 return false;
9521 }
9522 }
9523 }
9524
9526 return true;
9527 }
9528
9529
9530
9532 {
9533 super.OnStoreSave(ctx);
9534
9535 PlayerBase player;
9536 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9537 {
9539
9540 int itemQBIndex = -1;
9541 itemQBIndex = player.FindQuickBarEntityIndex(this);
9542 ctx.
Write(itemQBIndex);
9543 }
9544 else
9545 {
9547 }
9548
9550
9552 if (raib)
9553 {
9555 }
9556 }
9557
9558
9560 {
9561 super.AfterStoreLoad();
9562
9564 {
9566 }
9567
9569 {
9572 }
9573 }
9574
9576 {
9577 super.EEOnAfterLoad();
9578
9580 {
9582 }
9583
9586 }
9587
9589 {
9590 return false;
9591 }
9592
9593
9594
9596 {
9598 {
9599 #ifdef PLATFORM_CONSOLE
9600
9602 {
9604 if (menu)
9605 {
9607 }
9608 }
9609 #endif
9610 }
9611
9613 {
9616 }
9617
9619 {
9620 SetWeightDirty();
9622 }
9624 {
9627 }
9628
9630 {
9633 }
9635 {
9638 }
9639
9640 super.OnVariablesSynchronized();
9641 }
9642
9643
9644
9646 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9647 {
9648 if (!IsServerCheck(allow_client))
9649 return false;
9650
9652 return false;
9653
9656
9657 if (value <= (min + 0.001))
9658 value = min;
9659
9660 if (value == min)
9661 {
9662 if (destroy_config)
9663 {
9664 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9665 if (dstr)
9666 {
9668 this.Delete();
9669 return true;
9670 }
9671 }
9672 else if (destroy_forced)
9673 {
9675 this.Delete();
9676 return true;
9677 }
9678
9680 }
9681
9684
9686 {
9688
9689 if (delta)
9691 }
9692
9694
9695 return false;
9696 }
9697
9698
9700 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9701 {
9703 }
9704
9706 {
9709 }
9710
9712 {
9715 }
9716
9718 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9719 {
9720 float value_clamped = Math.Clamp(value, 0, 1);
9722 SetQuantity(result, destroy_config, destroy_forced);
9723 }
9724
9725
9728 {
9730 }
9731
9733 {
9735 }
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9747 {
9748 int slot = -1;
9749 if (GetInventory())
9750 {
9751 InventoryLocation il = new InventoryLocation;
9752 GetInventory().GetCurrentInventoryLocation(il);
9754 }
9755
9757 }
9758
9760 {
9761 float quantity_max = 0;
9762
9764 {
9765 if (attSlotID != -1)
9766 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9767
9768 if (quantity_max <= 0)
9770 }
9771
9772 if (quantity_max <= 0)
9774
9775 return quantity_max;
9776 }
9777
9779 {
9781 }
9782
9784 {
9786 }
9787
9788
9790 {
9792 }
9793
9795 {
9797 }
9798
9800 {
9802 }
9803
9804
9806 {
9807
9808 float weightEx = GetWeightEx();
9809 float special = GetInventoryAndCargoWeight();
9810 return weightEx - special;
9811 }
9812
9813
9815 {
9817 }
9818
9820 {
9822 {
9823 #ifdef DEVELOPER
9824 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9825 {
9826 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9828 }
9829 #endif
9830
9832 }
9833 else if (HasEnergyManager())
9834 {
9835 #ifdef DEVELOPER
9836 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9837 {
9838 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9839 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9840 }
9841 #endif
9842 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9843 }
9844 else
9845 {
9846 #ifdef DEVELOPER
9847 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9848 {
9849 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9850 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9851 }
9852 #endif
9853 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9854 }
9855 }
9856
9859 {
9860 int item_count = 0;
9862
9863 if (GetInventory().GetCargo() != NULL)
9864 {
9865 item_count = GetInventory().GetCargo().GetItemCount();
9866 }
9867
9868 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9869 {
9870 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9871 if (item)
9872 item_count += item.GetNumberOfItems();
9873 }
9874 return item_count;
9875 }
9876
9879 {
9880 float weight = 0;
9881 float wetness = 1;
9882 if (include_wetness)
9885 {
9886 weight = wetness * m_ConfigWeight;
9887 }
9889 {
9890 weight = 1;
9891 }
9892 return weight;
9893 }
9894
9895
9896
9898 {
9899 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9900 {
9901 GameInventory inv = GetInventory();
9902 array<EntityAI> items = new array<EntityAI>;
9904 for (int i = 0; i < items.Count(); i++)
9905 {
9907 if (item)
9908 {
9910 }
9911 }
9912 }
9913 }
9914
9915
9916
9917
9919 {
9920 float energy = 0;
9921 if (HasEnergyManager())
9922 {
9923 energy = GetCompEM().GetEnergy();
9924 }
9925 return energy;
9926 }
9927
9928
9930 {
9931 super.OnEnergyConsumed();
9932
9934 }
9935
9937 {
9938 super.OnEnergyAdded();
9939
9941 }
9942
9943
9945 {
9946 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9947 {
9949 {
9950 float energy_0to1 = GetCompEM().GetEnergy0To1();
9952 }
9953 }
9954 }
9955
9956
9958 {
9959 return ConfigGetFloat("heatIsolation");
9960 }
9961
9963 {
9965 }
9966
9968 {
9969 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9970 if (
GetGame().ConfigIsExisting(paramPath))
9972
9973 return 0.0;
9974 }
9975
9977 {
9978 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9979 if (
GetGame().ConfigIsExisting(paramPath))
9981
9982 return 0.0;
9983 }
9984
9985 override void SetWet(
float value,
bool allow_client =
false)
9986 {
9987 if (!IsServerCheck(allow_client))
9988 return;
9989
9992
9994
9995 m_VarWet = Math.Clamp(value, min, max);
9996
9998 {
10001 }
10002 }
10003
10004 override void AddWet(
float value)
10005 {
10007 }
10008
10010 {
10012 }
10013
10015 {
10017 }
10018
10020 {
10022 }
10023
10025 {
10027 }
10028
10030 {
10032 }
10033
10034 override void OnWetChanged(
float newVal,
float oldVal)
10035 {
10038 if (newLevel != oldLevel)
10039 {
10041 }
10042 }
10043
10045 {
10046 SetWeightDirty();
10047 }
10048
10050 {
10051 return GetWetLevelInternal(
m_VarWet);
10052 }
10053
10054
10055
10057 {
10059 }
10060
10062 {
10064 }
10065
10067 {
10069 }
10070
10072 {
10074 }
10075
10076
10077
10079 {
10080 if (ConfigIsExisting("itemModelLength"))
10081 {
10082 return ConfigGetFloat("itemModelLength");
10083 }
10084 return 0;
10085 }
10086
10088 {
10089 if (ConfigIsExisting("itemAttachOffset"))
10090 {
10091 return ConfigGetFloat("itemAttachOffset");
10092 }
10093 return 0;
10094 }
10095
10096 override void SetCleanness(
int value,
bool allow_client =
false)
10097 {
10098 if (!IsServerCheck(allow_client))
10099 return;
10100
10102
10104
10107 }
10108
10110 {
10112 }
10113
10115 {
10116 return true;
10117 }
10118
10119
10120
10121
10123 {
10125 }
10126
10128 {
10130 }
10131
10132
10133
10134
10135 override void SetColor(
int r,
int g,
int b,
int a)
10136 {
10142 }
10144 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10145 {
10150 }
10151
10153 {
10155 }
10156
10159 {
10160 int r,g,b,a;
10162 r = r/255;
10163 g = g/255;
10164 b = b/255;
10165 a = a/255;
10166 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10167 }
10168
10169
10170
10171 override void SetLiquidType(
int value,
bool allow_client =
false)
10172 {
10173 if (!IsServerCheck(allow_client))
10174 return;
10175
10180 }
10181
10183 {
10184 return ConfigGetInt("varLiquidTypeInit");
10185 }
10186
10188 {
10190 }
10191
10193 {
10195 SetFrozen(false);
10196 }
10197
10200 {
10201 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10202 }
10203
10204
10207 {
10208 PlayerBase nplayer;
10209 if (PlayerBase.CastTo(nplayer, player))
10210 {
10212
10213 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10214 }
10215 }
10216
10217
10220 {
10221 PlayerBase nplayer;
10222 if (PlayerBase.CastTo(nplayer,player))
10223 {
10224
10225 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10226
10227 }
10228
10229
10230 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10231
10232
10233 if (HasEnergyManager())
10234 {
10235 GetCompEM().UpdatePlugState();
10236 }
10237 }
10238
10239
10241 {
10242 super.OnPlacementStarted(player);
10243
10245 }
10246
10247 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10248 {
10250 {
10251 m_AdminLog.OnPlacementComplete(player,
this);
10252 }
10253
10254 super.OnPlacementComplete(player, position, orientation);
10255 }
10256
10257
10258
10259
10260
10262 {
10264 {
10265 return true;
10266 }
10267 else
10268 {
10269 return false;
10270 }
10271 }
10272
10273
10275 {
10277 {
10279 }
10280 }
10281
10282
10284 {
10286 }
10287
10289 {
10291 }
10292
10293 override void InsertAgent(
int agent,
float count = 1)
10294 {
10295 if (count < 1)
10296 return;
10297
10299 }
10300
10303 {
10305 }
10306
10307
10309 {
10311 }
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10355 {
10357 return false;
10358 return true;
10359 }
10360
10362 {
10363
10365 }
10366
10367
10370 {
10371 super.CheckForRoofLimited(timeTresholdMS);
10372
10374 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10375 {
10376 m_PreviousRoofTestTime = time;
10377 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10378 }
10379 }
10380
10381
10383 {
10385 {
10386 return 0;
10387 }
10388
10389 if (GetInventory().GetAttachmentSlotsCount() != 0)
10390 {
10391 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10392 if (filter)
10393 return filter.GetProtectionLevel(type, false, system);
10394 else
10395 return 0;
10396 }
10397
10398 string subclassPath, entryName;
10399
10400 switch (type)
10401 {
10403 entryName = "biological";
10404 break;
10406 entryName = "chemical";
10407 break;
10408 default:
10409 entryName = "biological";
10410 break;
10411 }
10412
10413 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10414
10416 }
10417
10418
10419
10422 {
10423 if (!IsMagazine())
10425
10427 }
10428
10429
10430
10431
10432
10437 {
10438 return true;
10439 }
10440
10442 {
10444 }
10445
10446
10447
10448
10449
10451 {
10452 if (parent)
10453 {
10454 if (parent.IsInherited(DayZInfected))
10455 return true;
10456
10457 if (!parent.IsRuined())
10458 return true;
10459 }
10460
10461 return true;
10462 }
10463
10465 {
10466 if (!super.CanPutAsAttachment(parent))
10467 {
10468 return false;
10469 }
10470
10471 if (!IsRuined() && !parent.IsRuined())
10472 {
10473 return true;
10474 }
10475
10476 return false;
10477 }
10478
10480 {
10481
10482
10483
10484
10485 return super.CanReceiveItemIntoCargo(item);
10486 }
10487
10489 {
10490
10491
10492
10493
10494 GameInventory attachmentInv = attachment.GetInventory();
10496 {
10497 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10498 return false;
10499 }
10500
10501 InventoryLocation loc = new InventoryLocation();
10502 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10503 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10504 return false;
10505
10506 return super.CanReceiveAttachment(attachment, slotId);
10507 }
10508
10510 {
10511 if (!super.CanReleaseAttachment(attachment))
10512 return false;
10513
10514 return GetInventory().AreChildrenAccessible();
10515 }
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10538 {
10539 int id = muzzle_owner.GetMuzzleID();
10540 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10541
10542 if (WPOF_array)
10543 {
10544 for (int i = 0; i < WPOF_array.Count(); i++)
10545 {
10546 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10547
10548 if (WPOF)
10549 {
10550 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10551 }
10552 }
10553 }
10554 }
10555
10556
10558 {
10559 int id = muzzle_owner.GetMuzzleID();
10561
10562 if (WPOBE_array)
10563 {
10564 for (int i = 0; i < WPOBE_array.Count(); i++)
10565 {
10566 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10567
10568 if (WPOBE)
10569 {
10570 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10571 }
10572 }
10573 }
10574 }
10575
10576
10578 {
10579 int id = muzzle_owner.GetMuzzleID();
10580 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10581
10582 if (WPOOH_array)
10583 {
10584 for (int i = 0; i < WPOOH_array.Count(); i++)
10585 {
10586 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10587
10588 if (WPOOH)
10589 {
10590 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10591 }
10592 }
10593 }
10594 }
10595
10596
10598 {
10599 int id = muzzle_owner.GetMuzzleID();
10600 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10601
10602 if (WPOOH_array)
10603 {
10604 for (int i = 0; i < WPOOH_array.Count(); i++)
10605 {
10606 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10607
10608 if (WPOOH)
10609 {
10610 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10611 }
10612 }
10613 }
10614 }
10615
10616
10618 {
10619 int id = muzzle_owner.GetMuzzleID();
10620 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10621
10622 if (WPOOH_array)
10623 {
10624 for (int i = 0; i < WPOOH_array.Count(); i++)
10625 {
10626 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10627
10628 if (WPOOH)
10629 {
10630 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10631 }
10632 }
10633 }
10634 }
10635
10636
10637
10639 {
10641 {
10642 return true;
10643 }
10644
10645 return false;
10646 }
10647
10649 {
10651 {
10652 return true;
10653 }
10654
10655 return false;
10656 }
10657
10659 {
10661 {
10662 return true;
10663 }
10664
10665 return false;
10666 }
10667
10669 {
10670 return false;
10671 }
10672
10675 {
10676 return UATimeSpent.DEFAULT_DEPLOY;
10677 }
10678
10679
10680
10681
10683 {
10685 SetSynchDirty();
10686 }
10687
10689 {
10691 }
10692
10693
10695 {
10696 return false;
10697 }
10698
10701 {
10702 string att_type = "None";
10703
10704 if (ConfigIsExisting("soundAttType"))
10705 {
10706 att_type = ConfigGetString("soundAttType");
10707 }
10708
10710 }
10711
10713 {
10715 }
10716
10717
10718
10719
10720
10726
10728 {
10731
10733 }
10734
10735
10737 {
10739 return;
10740
10742
10745
10748
10749 SoundParameters params = new SoundParameters();
10753 }
10754
10755
10757 {
10759 return;
10760
10762 SetSynchDirty();
10763
10766 }
10767
10768
10770 {
10772 return;
10773
10775 SetSynchDirty();
10776
10779 }
10780
10782 {
10784 }
10785
10787 {
10789 }
10790
10793 {
10794 if (!
GetGame().IsDedicatedServer())
10795 {
10796 if (ConfigIsExisting("attachSoundSet"))
10797 {
10798 string cfg_path = "";
10799 string soundset = "";
10800 string type_name =
GetType();
10801
10804 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10805 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10806
10807 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10808 {
10809 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10810 {
10811 if (cfg_slot_array[i] == slot_type)
10812 {
10813 soundset = cfg_soundset_array[i];
10814 break;
10815 }
10816 }
10817 }
10818
10819 if (soundset != "")
10820 {
10821 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10823 }
10824 }
10825 }
10826 }
10827
10829 {
10830
10831 }
10832
10833 void OnApply(PlayerBase player);
10834
10836 {
10837 return 1.0;
10838 };
10839
10841 {
10843 }
10844
10846 {
10848 }
10849
10851
10853 {
10854 SetDynamicPhysicsLifeTime(0.01);
10856 }
10857
10859 {
10860 array<string> zone_names = new array<string>;
10861 GetDamageZones(zone_names);
10862 for (int i = 0; i < zone_names.Count(); i++)
10863 {
10864 SetHealthMax(zone_names.Get(i),"Health");
10865 }
10866 SetHealthMax("","Health");
10867 }
10868
10871 {
10872 float global_health = GetHealth01("","Health");
10873 array<string> zones = new array<string>;
10874 GetDamageZones(zones);
10875
10876 for (int i = 0; i < zones.Count(); i++)
10877 {
10878 SetHealth01(zones.Get(i),"Health",global_health);
10879 }
10880 }
10881
10884 {
10885 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10886 }
10887
10889 {
10890 if (!hasRootAsPlayer)
10891 {
10892 if (refParentIB)
10893 {
10894
10895 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10896 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10897
10898 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10899 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10900
10903 }
10904 else
10905 {
10906
10909 }
10910 }
10911 }
10912
10914 {
10916 {
10917 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10918 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10919 {
10920 float heatPermCoef = 1.0;
10922 while (ent)
10923 {
10924 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10925 ent = ent.GetHierarchyParent();
10926 }
10927
10928 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10929 }
10930 }
10931 }
10932
10934 {
10935
10936 EntityAI parent = GetHierarchyParent();
10937 if (!parent)
10938 {
10939 hasParent = false;
10940 hasRootAsPlayer = false;
10941 }
10942 else
10943 {
10944 hasParent = true;
10945 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10946 refParentIB =
ItemBase.Cast(parent);
10947 }
10948 }
10949
10950 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10951 {
10952
10953 }
10954
10956 {
10957
10958 return false;
10959 }
10960
10962 {
10963
10964
10965 return false;
10966 }
10967
10969 {
10970
10971 return false;
10972 }
10973
10976 {
10977 return !GetIsFrozen() &&
IsOpen();
10978 }
10979
10981 {
10982 bool hasParent = false, hasRootAsPlayer = false;
10984
10985 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10986 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10987
10988 if (wwtu || foodDecay)
10989 {
10993
10994 if (processWetness || processTemperature || processDecay)
10995 {
10997
10998 if (processWetness)
10999 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11000
11001 if (processTemperature)
11003
11004 if (processDecay)
11005 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11006 }
11007 }
11008 }
11009
11012 {
11014 }
11015
11017 {
11020
11021 return super.GetTemperatureFreezeThreshold();
11022 }
11023
11025 {
11028
11029 return super.GetTemperatureThawThreshold();
11030 }
11031
11033 {
11036
11037 return super.GetItemOverheatThreshold();
11038 }
11039
11041 {
11043 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11044
11045 return super.GetTemperatureFreezeTime();
11046 }
11047
11049 {
11051 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11052
11053 return super.GetTemperatureThawTime();
11054 }
11055
11060
11062 {
11063 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11064 }
11065
11067 {
11068 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11069 }
11070
11073 {
11075 }
11076
11078 {
11080 }
11081
11083 {
11085 }
11086
11089 {
11090 return null;
11091 }
11092
11095 {
11096 return false;
11097 }
11098
11100 {
11102 {
11105 if (!trg)
11106 {
11108 explosive = this;
11109 }
11110
11111 explosive.PairRemote(trg);
11113
11114 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11115 trg.SetPersistentPairID(persistentID);
11116 explosive.SetPersistentPairID(persistentID);
11117
11118 return true;
11119 }
11120 return false;
11121 }
11122
11125 {
11126 float ret = 1.0;
11129 ret *= GetHealth01();
11130
11131 return ret;
11132 }
11133
11134 #ifdef DEVELOPER
11135 override void SetDebugItem()
11136 {
11137 super.SetDebugItem();
11138 _itemBase = this;
11139 }
11140
11142 {
11143 string text = super.GetDebugText();
11144
11146 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11147
11148 return text;
11149 }
11150 #endif
11151
11153 {
11154 return true;
11155 }
11156
11158
11160
11162 {
11165 }
11166
11167
11175
11191}
11192
11194{
11196 if (entity)
11197 {
11198 bool is_item = entity.IsInherited(
ItemBase);
11199 if (is_item && full_quantity)
11200 {
11203 }
11204 }
11205 else
11206 {
11208 return NULL;
11209 }
11210 return entity;
11211}
11212
11214{
11215 if (item)
11216 {
11217 if (health > 0)
11218 item.SetHealth("", "", health);
11219
11220 if (item.CanHaveTemperature())
11221 {
11223 if (item.CanFreeze())
11224 item.SetFrozen(false);
11225 }
11226
11227 if (item.HasEnergyManager())
11228 {
11229 if (quantity >= 0)
11230 {
11231 item.GetCompEM().SetEnergy0To1(quantity);
11232 }
11233 else
11234 {
11236 }
11237 }
11238 else if (item.IsMagazine())
11239 {
11240 Magazine mag = Magazine.Cast(item);
11241 if (quantity >= 0)
11242 {
11243 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11244 }
11245 else
11246 {
11248 }
11249
11250 }
11251 else
11252 {
11253 if (quantity >= 0)
11254 {
11255 item.SetQuantityNormalized(quantity, false);
11256 }
11257 else
11258 {
11260 }
11261
11262 }
11263 }
11264}
11265
11266#ifdef DEVELOPER
11268#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.