6352{
6354 {
6355 return true;
6356 }
6357};
6358
6359
6360
6362{
6366
6368
6371
6372
6373
6374
6375
6384
6390
6395
6400
6421 protected bool m_IsResultOfSplit
6422
6424
6429
6430
6431
6433
6437
6438
6439
6441
6444
6445
6446
6452
6453
6461
6464
6465
6467
6468
6470
6471
6476
6477
6482
6483
6485
6486
6488 {
6493
6494 if (!
GetGame().IsDedicatedServer())
6495 {
6497 {
6499
6501 {
6503 }
6504 }
6505
6508 }
6509
6510 m_OldLocation = null;
6511
6513 {
6515 }
6516
6517 if (ConfigIsExisting("headSelectionsToHide"))
6518 {
6521 }
6522
6524 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6525 {
6527 }
6528
6530
6531 m_IsResultOfSplit = false;
6532
6534 }
6535
6537 {
6538 super.InitItemVariables();
6539
6545 m_Count = ConfigGetInt(
"count");
6546
6549
6554
6557
6562
6574
6578
6579
6582 if (ConfigIsExisting("canBeSplit"))
6583 {
6586 }
6587
6589 if (ConfigIsExisting("itemBehaviour"))
6591
6592
6595 RegisterNetSyncVariableInt("m_VarLiquidType");
6596 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6597
6598 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6599 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6600 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6601
6602 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6603 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6604 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6605 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6606
6607 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6608 RegisterNetSyncVariableBool("m_IsTakeable");
6609 RegisterNetSyncVariableBool("m_IsHologram");
6610
6613 {
6616 }
6617
6619
6621 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6623
6624 }
6625
6627 {
6629 }
6630
6632 {
6635 {
6640 }
6641 }
6642
6643 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6644 {
6646 {
6649 }
6650
6652 }
6653
6655 {
6661 }
6662
6664
6666 {
6668
6669 if (!action)
6670 {
6671 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6672 return;
6673 }
6674
6676 if (!ai)
6677 {
6679 return;
6680 }
6681
6683 if (!action_array)
6684 {
6685 action_array = new array<ActionBase_Basic>;
6687 }
6688 if (LogManager.IsActionLogEnable())
6689 {
6690 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6691 }
6692
6693 if (action_array.Find(action) != -1)
6694 {
6695 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6696 }
6697 else
6698 {
6699 action_array.Insert(action);
6700 }
6701 }
6702
6704 {
6706 ActionBase action = player.GetActionManager().GetAction(actionName);
6709
6710 if (action_array)
6711 {
6712 action_array.RemoveItem(action);
6713 }
6714 }
6715
6716
6717
6719 {
6720 ActionOverrideData overrideData = new ActionOverrideData();
6724
6726 if (!actionMap)
6727 {
6730 }
6731
6732 actionMap.Insert(this.
Type(), overrideData);
6733
6734 }
6735
6737
6739
6740
6742 {
6745
6748
6749 string config_to_search = "CfgVehicles";
6750 string muzzle_owner_config;
6751
6753 {
6754 if (IsInherited(Weapon))
6755 config_to_search = "CfgWeapons";
6756
6757 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6758
6759 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6760
6762
6763 if (config_OnFire_subclass_count > 0)
6764 {
6765 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6766
6767 for (int i = 0; i < config_OnFire_subclass_count; i++)
6768 {
6769 string particle_class = "";
6771 string config_OnFire_entry = config_OnFire_class + particle_class;
6772 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6773 WPOF_array.Insert(WPOF);
6774 }
6775
6776
6778 }
6779 }
6780
6782 {
6783 config_to_search = "CfgWeapons";
6784 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6785
6786 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6787
6789
6790 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6791 {
6792 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6793
6794 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6795 {
6796 string particle_class2 = "";
6798 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6799 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6800 WPOBE_array.Insert(WPOBE);
6801 }
6802
6803
6805 }
6806 }
6807 }
6808
6809
6811 {
6814
6816 {
6817 string config_to_search = "CfgVehicles";
6818
6819 if (IsInherited(Weapon))
6820 config_to_search = "CfgWeapons";
6821
6822 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6823 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6824
6825 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6826 {
6827
6829
6831 {
6833 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6835 return;
6836 }
6837
6840
6841
6842
6844 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6845
6846 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6847 {
6848 string particle_class = "";
6850 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6852
6853 if (entry_type == CT_CLASS)
6854 {
6855 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6856 WPOOH_array.Insert(WPOF);
6857 }
6858 }
6859
6860
6862 }
6863 }
6864 }
6865
6867 {
6869 }
6870
6872 {
6874 {
6876
6879
6882
6883 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6884 }
6885 }
6886
6888 {
6890 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6891
6893 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6894
6896 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6897
6899 {
6901 }
6902 }
6903
6905 {
6907 }
6908
6910 {
6913 else
6915
6917 {
6920 }
6921 else
6922 {
6925
6928 }
6929
6931 }
6932
6934 {
6936 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6937 }
6938
6940 {
6942 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6944 }
6945
6947 {
6949 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6950 }
6951
6953 {
6956
6957 OverheatingParticle OP = new OverheatingParticle();
6962
6964 }
6965
6967 {
6970
6971 return -1;
6972 }
6973
6975 {
6977 {
6980
6981 for (int i = count; i > 0; --i)
6982 {
6983 int id = i - 1;
6986
6989
6990 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6991 {
6992 if (p)
6993 {
6996 }
6997 }
6998 }
6999 }
7000 }
7001
7003 {
7005 {
7007 {
7008 int id = i - 1;
7010
7011 if (OP)
7012 {
7014
7015 if (p)
7016 {
7018 }
7019
7020 delete OP;
7021 }
7022 }
7023
7026 }
7027 }
7028
7031 {
7032 return 0.0;
7033 }
7034
7035
7037 {
7038 return 250;
7039 }
7040
7042 {
7043 return 0;
7044 }
7045
7048 {
7050 return true;
7051
7052 return false;
7053 }
7054
7057 {
7060
7062 {
7064 }
7065 else
7066 {
7067
7069 }
7070
7072 }
7073
7080 {
7081 return -1;
7082 }
7083
7084
7085
7086
7088 {
7090 {
7092 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7093
7094 if (r_index >= 0)
7095 {
7096 InventoryLocation r_il = new InventoryLocation;
7097 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7098
7099 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7102 {
7103 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7104 }
7106 {
7107 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7108 }
7109
7110 }
7111
7112 player.GetHumanInventory().ClearUserReservedLocation(this);
7113 }
7114
7117 }
7118
7119
7120
7121
7123 {
7124 return ItemBase.m_DebugActionsMask;
7125 }
7126
7128 {
7129 return ItemBase.m_DebugActionsMask & mask;
7130 }
7131
7133 {
7134 ItemBase.m_DebugActionsMask = mask;
7135 }
7136
7138 {
7139 ItemBase.m_DebugActionsMask |= mask;
7140 }
7141
7143 {
7144 ItemBase.m_DebugActionsMask &= ~mask;
7145 }
7146
7148 {
7150 {
7152 }
7153 else
7154 {
7156 }
7157 }
7158
7159
7161 {
7162 if (GetEconomyProfile())
7163 {
7164 float q_max = GetEconomyProfile().GetQuantityMax();
7165 if (q_max > 0)
7166 {
7167 float q_min = GetEconomyProfile().GetQuantityMin();
7168 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7169
7171 {
7172 ComponentEnergyManager comp = GetCompEM();
7174 {
7176 }
7177 }
7179 {
7181
7182 }
7183
7184 }
7185 }
7186 }
7187
7190 {
7191 EntityAI parent = GetHierarchyParent();
7192
7193 if (parent)
7194 {
7195 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7196 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7197 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7198 }
7199 }
7200
7203 {
7204 EntityAI parent = GetHierarchyParent();
7205
7206 if (parent)
7207 {
7208 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7209 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7210 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7211 }
7212 }
7213
7215 {
7216
7217
7218
7219
7221
7223 {
7224 if (ScriptInputUserData.CanStoreInputUserData())
7225 {
7226 ScriptInputUserData ctx = new ScriptInputUserData;
7232 ctx.
Write(use_stack_max);
7235
7237 {
7238 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7239 }
7240 }
7241 }
7242 else if (!
GetGame().IsMultiplayer())
7243 {
7245 }
7246 }
7247
7249 {
7251 }
7252
7254 {
7256 }
7257
7259 {
7261 }
7262
7264 {
7265
7266 return false;
7267 }
7268
7270 {
7271 return false;
7272 }
7273
7277 {
7278 return false;
7279 }
7280
7282 {
7283 return "";
7284 }
7285
7287
7289 {
7290 return false;
7291 }
7292
7294 {
7295 return true;
7296 }
7297
7298
7299
7301 {
7302 return true;
7303 }
7304
7306 {
7307 return true;
7308 }
7309
7311 {
7312 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7314 }
7315
7317 {
7319 }
7320
7322 {
7324 if (!is_being_placed)
7326 SetSynchDirty();
7327 }
7328
7329
7331
7333 {
7335 }
7336
7338 {
7340 }
7341
7343 {
7344 return 1;
7345 }
7346
7348 {
7349 return false;
7350 }
7351
7353 {
7355 SetSynchDirty();
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
7383
7384
7385
7386
7387
7388
7389
7390
7391
7393 {
7394 super.OnMovedInsideCargo(container);
7395
7396 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7397 }
7398
7399 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7400 {
7401 super.EEItemLocationChanged(oldLoc,newLoc);
7402
7403 PlayerBase new_player = null;
7404 PlayerBase old_player = null;
7405
7406 if (newLoc.GetParent())
7407 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7408
7409 if (oldLoc.GetParent())
7410 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7411
7413 {
7414 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7415
7416 if (r_index >= 0)
7417 {
7418 InventoryLocation r_il = new InventoryLocation;
7419 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7420
7421 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7424 {
7425 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7426 }
7428 {
7429 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7430 }
7431
7432 }
7433 }
7434
7436 {
7437 if (new_player)
7438 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7439
7440 if (new_player == old_player)
7441 {
7442
7443 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7444 {
7446 {
7447 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7448 {
7449 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7450 }
7451 }
7452 else
7453 {
7454 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7455 }
7456 }
7457
7458 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7459 {
7460 int type = oldLoc.GetType();
7462 {
7463 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7464 }
7466 {
7467 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7468 }
7469 }
7470 if (!m_OldLocation)
7471 {
7472 m_OldLocation = new InventoryLocation;
7473 }
7474 m_OldLocation.Copy(oldLoc);
7475 }
7476 else
7477 {
7478 if (m_OldLocation)
7479 {
7480 m_OldLocation.Reset();
7481 }
7482 }
7483
7485 }
7486 else
7487 {
7488 if (new_player)
7489 {
7490 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7491 if (res_index >= 0)
7492 {
7493 InventoryLocation il = new InventoryLocation;
7494 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7496 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7499 {
7500 il.
GetParent().GetOnReleaseLock().Invoke(it);
7501 }
7503 {
7505 }
7506
7507 }
7508 }
7510 {
7511
7513 }
7514
7515 if (m_OldLocation)
7516 {
7517 m_OldLocation.Reset();
7518 }
7519 }
7520 }
7521
7522 override void EOnContact(IEntity other, Contact extra)
7523 {
7525 {
7526 int liquidType = -1;
7528 if (impactSpeed > 0.0)
7529 {
7531 #ifndef SERVER
7533 #else
7535 SetSynchDirty();
7536 #endif
7538 }
7539 }
7540
7541 #ifdef SERVER
7542 if (GetCompEM() && GetCompEM().IsPlugged())
7543 {
7544 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7545 GetCompEM().UnplugThis();
7546 }
7547 #endif
7548 }
7549
7551
7553 {
7555 }
7556
7558 {
7559
7560 }
7561
7563 {
7564 super.OnItemLocationChanged(old_owner, new_owner);
7565
7566 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7567 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7568
7569 if (!relatedPlayer && playerNew)
7570 relatedPlayer = playerNew;
7571
7572 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7573 {
7575 if (actionMgr)
7576 {
7577 ActionBase currentAction = actionMgr.GetRunningAction();
7578 if (currentAction)
7580 }
7581 }
7582
7583 Man ownerPlayerOld = null;
7584 Man ownerPlayerNew = null;
7585
7586 if (old_owner)
7587 {
7588 if (old_owner.
IsMan())
7589 {
7590 ownerPlayerOld = Man.Cast(old_owner);
7591 }
7592 else
7593 {
7594 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7595 }
7596 }
7597 else
7598 {
7600 {
7602
7603 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7604 {
7605 GetCompEM().UnplugThis();
7606 }
7607 }
7608 }
7609
7610 if (new_owner)
7611 {
7612 if (new_owner.
IsMan())
7613 {
7614 ownerPlayerNew = Man.Cast(new_owner);
7615 }
7616 else
7617 {
7618 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7619 }
7620 }
7621
7622 if (ownerPlayerOld != ownerPlayerNew)
7623 {
7624 if (ownerPlayerOld)
7625 {
7626 array<EntityAI> subItemsExit = new array<EntityAI>;
7628 for (int i = 0; i < subItemsExit.Count(); i++)
7629 {
7632 }
7633 }
7634
7635 if (ownerPlayerNew)
7636 {
7637 array<EntityAI> subItemsEnter = new array<EntityAI>;
7639 for (int j = 0; j < subItemsEnter.Count(); j++)
7640 {
7643 }
7644 }
7645 }
7646 else if (ownerPlayerNew != null)
7647 {
7648 PlayerBase nplayer;
7649 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7650 {
7651 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7653 for (int k = 0; k < subItemsUpdate.Count(); k++)
7654 {
7656 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7657 }
7658 }
7659 }
7660
7661 if (old_owner)
7662 old_owner.OnChildItemRemoved(this);
7663 if (new_owner)
7664 new_owner.OnChildItemReceived(this);
7665 }
7666
7667
7669 {
7670 super.EEDelete(parent);
7671 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7672 if (player)
7673 {
7675
7676 if (player.IsAlive())
7677 {
7678 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7679 if (r_index >= 0)
7680 {
7681 InventoryLocation r_il = new InventoryLocation;
7682 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7683
7684 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7687 {
7688 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7689 }
7691 {
7692 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7693 }
7694
7695 }
7696
7697 player.RemoveQuickBarEntityShortcut(this);
7698 }
7699 }
7700 }
7701
7703 {
7704 super.EEKilled(killer);
7705
7708 {
7709 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7710 {
7711 if (IsMagazine())
7712 {
7713 if (Magazine.Cast(this).GetAmmoCount() > 0)
7714 {
7716 }
7717 }
7718 else
7719 {
7721 }
7722 }
7723 }
7724 }
7725
7727 {
7728 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7729
7730 super.OnWasAttached(parent, slot_id);
7731
7734
7736 }
7737
7739 {
7740 super.OnWasDetached(parent, slot_id);
7741
7744 }
7745
7747 {
7748 int idx;
7751
7752 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7753 if (inventory_slots.Count() < 1)
7754 {
7755 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7756 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7757 }
7758 else
7759 {
7760 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7761 }
7762
7763 idx = inventory_slots.Find(slot);
7764 if (idx < 0)
7765 return "";
7766
7767 return attach_types.Get(idx);
7768 }
7769
7771 {
7772 int idx = -1;
7773 string slot;
7774
7777
7778 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7779 if (inventory_slots.Count() < 1)
7780 {
7781 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7782 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7783 }
7784 else
7785 {
7786 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7787 if (detach_types.Count() < 1)
7788 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7789 }
7790
7791 for (int i = 0; i < inventory_slots.Count(); i++)
7792 {
7793 slot = inventory_slots.Get(i);
7794 }
7795
7796 if (slot != "")
7797 {
7798 if (detach_types.Count() == 1)
7799 idx = 0;
7800 else
7801 idx = inventory_slots.Find(slot);
7802 }
7803 if (idx < 0)
7804 return "";
7805
7806 return detach_types.Get(idx);
7807 }
7808
7810 {
7811
7813
7814
7815 float min_time = 1;
7816 float max_time = 3;
7817 float delay = Math.RandomFloat(min_time, max_time);
7818
7819 explode_timer.Run(delay, this, "DoAmmoExplosion");
7820 }
7821
7823 {
7824 Magazine magazine = Magazine.Cast(this);
7825 int pop_sounds_count = 6;
7826 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7827
7828
7829 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7830 string sound_name = pop_sounds[ sound_idx ];
7832
7833
7834 magazine.ServerAddAmmoCount(-1);
7835
7836
7837 float min_temp_to_explode = 100;
7838
7839 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7840 {
7842 }
7843 }
7844
7845
7846 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7847 {
7848 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7849
7850 const int CHANCE_DAMAGE_CARGO = 4;
7851 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7852 const int CHANCE_DAMAGE_NOTHING = 2;
7853
7855 {
7856 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7857 int chances;
7858 int rnd;
7859
7860 if (GetInventory().GetCargo())
7861 {
7862 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7863 rnd = Math.RandomInt(0,chances);
7864
7865 if (rnd < CHANCE_DAMAGE_CARGO)
7866 {
7868 }
7869 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7870 {
7872 }
7873 }
7874 else
7875 {
7876 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7877 rnd = Math.RandomInt(0,chances);
7878
7879 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7880 {
7882 }
7883 }
7884 }
7885 }
7886
7888 {
7889 if (GetInventory().GetCargo())
7890 {
7891 int item_count = GetInventory().GetCargo().GetItemCount();
7892 if (item_count > 0)
7893 {
7894 int random_pick = Math.RandomInt(0, item_count);
7896 if (!item.IsExplosive())
7897 {
7898 item.AddHealth("","",damage);
7899 return true;
7900 }
7901 }
7902 }
7903 return false;
7904 }
7905
7907 {
7908 int attachment_count = GetInventory().AttachmentCount();
7909 if (attachment_count > 0)
7910 {
7911 int random_pick = Math.RandomInt(0, attachment_count);
7912 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7913 if (!attachment.IsExplosive())
7914 {
7915 attachment.AddHealth("","",damage);
7916 return true;
7917 }
7918 }
7919 return false;
7920 }
7921
7923 {
7925 }
7926
7928 {
7930 return GetInventory().CanRemoveEntity();
7931
7932 return false;
7933 }
7934
7936 {
7938 return;
7939
7941 {
7942 if (ScriptInputUserData.CanStoreInputUserData())
7943 {
7944 ScriptInputUserData ctx = new ScriptInputUserData;
7949 ctx.
Write(destination_entity);
7953 }
7954 }
7955 else if (!
GetGame().IsMultiplayer())
7956 {
7958 }
7959 }
7960
7962 {
7964 return;
7965
7966 float split_quantity_new;
7970 InventoryLocation loc = new InventoryLocation;
7971
7972 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7973 {
7975 split_quantity_new = stack_max;
7976 else
7978
7979 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7980 if (new_item)
7981 {
7982 new_item.SetResultOfSplit(true);
7983 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7985 new_item.SetQuantity(split_quantity_new);
7986 }
7987 }
7988 else if (destination_entity && slot_id == -1)
7989 {
7990 if (quantity > stack_max)
7991 split_quantity_new = stack_max;
7992 else
7993 split_quantity_new = quantity;
7994
7996 {
7999 }
8000
8001 if (new_item)
8002 {
8003 new_item.SetResultOfSplit(true);
8004 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8006 new_item.SetQuantity(split_quantity_new);
8007 }
8008 }
8009 else
8010 {
8011 if (stack_max != 0)
8012 {
8014 {
8016 }
8017
8018 if (split_quantity_new == 0)
8019 {
8020 if (!
GetGame().IsMultiplayer())
8021 player.PhysicalPredictiveDropItem(this);
8022 else
8023 player.ServerDropEntity(this);
8024 return;
8025 }
8026
8028
8029 if (new_item)
8030 {
8031 new_item.SetResultOfSplit(true);
8032 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8034 new_item.SetQuantity(stack_max);
8035 new_item.PlaceOnSurface();
8036 }
8037 }
8038 }
8039 }
8040
8042 {
8044 return;
8045
8046 float split_quantity_new;
8050 InventoryLocation loc = new InventoryLocation;
8051
8052 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8053 {
8055 split_quantity_new = stack_max;
8056 else
8058
8059 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8060 if (new_item)
8061 {
8062 new_item.SetResultOfSplit(true);
8063 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8065 new_item.SetQuantity(split_quantity_new);
8066 }
8067 }
8068 else if (destination_entity && slot_id == -1)
8069 {
8070 if (quantity > stack_max)
8071 split_quantity_new = stack_max;
8072 else
8073 split_quantity_new = quantity;
8074
8076 {
8079 }
8080
8081 if (new_item)
8082 {
8083 new_item.SetResultOfSplit(true);
8084 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8086 new_item.SetQuantity(split_quantity_new);
8087 }
8088 }
8089 else
8090 {
8091 if (stack_max != 0)
8092 {
8094 {
8096 }
8097
8099
8100 if (new_item)
8101 {
8102 new_item.SetResultOfSplit(true);
8103 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8105 new_item.SetQuantity(stack_max);
8106 new_item.PlaceOnSurface();
8107 }
8108 }
8109 }
8110 }
8111
8113 {
8115 return;
8116
8118 {
8119 if (ScriptInputUserData.CanStoreInputUserData())
8120 {
8121 ScriptInputUserData ctx = new ScriptInputUserData;
8126 dst.WriteToContext(ctx);
8128 }
8129 }
8130 else if (!
GetGame().IsMultiplayer())
8131 {
8133 }
8134 }
8135
8137 {
8139 return;
8140
8142 {
8143 if (ScriptInputUserData.CanStoreInputUserData())
8144 {
8145 ScriptInputUserData ctx = new ScriptInputUserData;
8150 ctx.
Write(destination_entity);
8156 }
8157 }
8158 else if (!
GetGame().IsMultiplayer())
8159 {
8161 }
8162 }
8163
8165 {
8167 }
8168
8170 {
8172 return this;
8173
8175 float split_quantity_new;
8177 if (dst.IsValid())
8178 {
8179 int slot_id = dst.GetSlot();
8181
8182 if (quantity > stack_max)
8183 split_quantity_new = stack_max;
8184 else
8185 split_quantity_new = quantity;
8186
8188
8189 if (new_item)
8190 {
8191 new_item.SetResultOfSplit(true);
8192 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8195 }
8196
8197 return new_item;
8198 }
8199
8200 return null;
8201 }
8202
8204 {
8206 return;
8207
8209 float split_quantity_new;
8211 if (destination_entity)
8212 {
8214 if (quantity > stackable)
8215 split_quantity_new = stackable;
8216 else
8217 split_quantity_new = quantity;
8218
8219 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8220 if (new_item)
8221 {
8222 new_item.SetResultOfSplit(true);
8223 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8225 new_item.SetQuantity(split_quantity_new);
8226 }
8227 }
8228 }
8229
8231 {
8233 return;
8234
8236 {
8237 if (ScriptInputUserData.CanStoreInputUserData())
8238 {
8239 ScriptInputUserData ctx = new ScriptInputUserData;
8244 ItemBase destination_entity =
this;
8245 ctx.
Write(destination_entity);
8249 }
8250 }
8251 else if (!
GetGame().IsMultiplayer())
8252 {
8254 }
8255 }
8256
8258 {
8260 return;
8261
8263 float split_quantity_new;
8265 if (player)
8266 {
8268 if (quantity > stackable)
8269 split_quantity_new = stackable;
8270 else
8271 split_quantity_new = quantity;
8272
8273 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8274 new_item =
ItemBase.Cast(in_hands);
8275 if (new_item)
8276 {
8277 new_item.SetResultOfSplit(true);
8278 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8280 new_item.SetQuantity(split_quantity_new);
8281 }
8282 }
8283 }
8284
8286 {
8288 return;
8289
8291 float split_quantity_new = Math.Floor(quantity * 0.5);
8292
8294
8295 if (new_item)
8296 {
8297 if (new_item.GetQuantityMax() < split_quantity_new)
8298 {
8299 split_quantity_new = new_item.GetQuantityMax();
8300 }
8301
8302 new_item.SetResultOfSplit(true);
8303 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8304
8306 {
8309 }
8310 else
8311 {
8314 }
8315 }
8316 }
8317
8319 {
8321 return;
8322
8324 float split_quantity_new = Math.Floor(quantity / 2);
8325
8326 InventoryLocation invloc = new InventoryLocation;
8328
8330 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8331
8332 if (new_item)
8333 {
8334 if (new_item.GetQuantityMax() < split_quantity_new)
8335 {
8336 split_quantity_new = new_item.GetQuantityMax();
8337 }
8339 {
8342 }
8343 else
8344 {
8347 }
8348 }
8349 }
8350
8353 {
8354 SetWeightDirty();
8356
8357 if (parent)
8358 parent.OnAttachmentQuantityChangedEx(this, delta);
8359
8361 {
8363 {
8365 }
8367 {
8368 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8370 }
8371 }
8372
8373 }
8374
8377 {
8378
8379 }
8380
8383 {
8385 }
8386
8388 {
8389 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8390
8392 {
8393 if (newLevel == GameConstants.STATE_RUINED)
8394 {
8396 EntityAI parent = GetHierarchyParent();
8397 if (parent && parent.IsFireplace())
8398 {
8399 CargoBase cargo = GetInventory().GetCargo();
8400 if (cargo)
8401 {
8403 {
8405 }
8406 }
8407 }
8408 }
8409
8411 {
8412
8414 return;
8415 }
8416
8417 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8418 {
8420 }
8421 }
8422 }
8423
8424
8426 {
8427 super.OnRightClick();
8428
8430 {
8432 {
8433 if (ScriptInputUserData.CanStoreInputUserData())
8434 {
8435 vector m4[4];
8437
8438 EntityAI root = GetHierarchyRoot();
8439
8440 InventoryLocation dst = new InventoryLocation;
8442 {
8443 if (root)
8444 {
8445 root.GetTransform(m4);
8447 }
8448 else
8449 GetInventory().GetCurrentInventoryLocation(dst);
8450 }
8451 else
8452 {
8454
8455
8456 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8457 {
8458 if (root)
8459 {
8460 root.GetTransform(m4);
8462 }
8463 else
8464 GetInventory().GetCurrentInventoryLocation(dst);
8465 }
8466 else
8467 {
8468 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8469 }
8470 }
8471
8472 ScriptInputUserData ctx = new ScriptInputUserData;
8480 }
8481 }
8482 else if (!
GetGame().IsMultiplayer())
8483 {
8485 }
8486 }
8487 }
8488
8489 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8490 {
8491
8492 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8493 return false;
8494
8495 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8496 return false;
8497
8498
8500 return false;
8501
8502
8503 Magazine mag = Magazine.Cast(this);
8504 if (mag)
8505 {
8506 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8507 return false;
8508
8509 if (stack_max_limit)
8510 {
8511 Magazine other_mag = Magazine.Cast(other_item);
8512 if (other_item)
8513 {
8514 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8515 return false;
8516 }
8517
8518 }
8519 }
8520 else
8521 {
8522
8524 return false;
8525
8527 return false;
8528 }
8529
8530 PlayerBase player = null;
8531 if (CastTo(player, GetHierarchyRootPlayer()))
8532 {
8533 if (player.GetInventory().HasAttachment(this))
8534 return false;
8535
8536 if (player.IsItemsToDelete())
8537 return false;
8538 }
8539
8540 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8541 return false;
8542
8543 int slotID;
8545 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8546 return false;
8547
8548 return true;
8549 }
8550
8552 {
8554 }
8555
8557 {
8558 return m_IsResultOfSplit;
8559 }
8560
8562 {
8563 m_IsResultOfSplit = value;
8564 }
8565
8567 {
8569 }
8570
8572 {
8573 float other_item_quantity = other_item.GetQuantity();
8574 float this_free_space;
8575
8577
8579
8580 if (other_item_quantity > this_free_space)
8581 {
8582 return this_free_space;
8583 }
8584 else
8585 {
8586 return other_item_quantity;
8587 }
8588 }
8589
8591 {
8593 }
8594
8596 {
8598 return;
8599
8600 if (!IsMagazine() && other_item)
8601 {
8603 if (quantity_used != 0)
8604 {
8605 float hp1 = GetHealth01("","");
8606 float hp2 = other_item.GetHealth01("","");
8607 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8608 hpResult = hpResult / (
GetQuantity() + quantity_used);
8609
8610 hpResult *= GetMaxHealth();
8611 Math.Round(hpResult);
8612 SetHealth("", "Health", hpResult);
8613
8615 other_item.AddQuantity(-quantity_used);
8616 }
8617 }
8619 }
8620
8622 {
8623 #ifdef SERVER
8624 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8625 GetHierarchyParent().IncreaseLifetimeUp();
8626 #endif
8627 };
8628
8630 {
8631 PlayerBase p = PlayerBase.Cast(player);
8632
8633 array<int> recipesIds = p.m_Recipes;
8634 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8635 if (moduleRecipesManager)
8636 {
8637 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8638 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8639 }
8640
8641 for (int i = 0;i < recipesIds.Count(); i++)
8642 {
8643 int key = recipesIds.Get(i);
8644 string recipeName = moduleRecipesManager.GetRecipeName(key);
8646 }
8647 }
8648
8649
8650 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8651 {
8652 super.GetDebugActions(outputList);
8653
8654
8659
8660
8664
8668
8669
8672
8673
8675 {
8678 }
8679
8681
8684
8688 }
8689
8690
8691
8692
8694 {
8695 super.OnAction(action_id, player, ctx);
8696 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8697 {
8698 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8699 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8700 PlayerBase p = PlayerBase.Cast(player);
8701 if (
EActions.RECIPES_RANGE_START < 1000)
8702 {
8703 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8704 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8705 }
8706 }
8707 #ifndef SERVER
8708 else if (action_id ==
EActions.WATCH_PLAYER)
8709 {
8710 PluginDeveloper.SetDeveloperItemClientEx(player);
8711 }
8712 #endif
8714 {
8715 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8716 {
8717 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8718 OnDebugButtonPressServer(id + 1);
8719 }
8720
8721 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8722 {
8723 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8725 }
8726
8727 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8728 {
8729 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8731 }
8732
8733 else if (action_id ==
EActions.ADD_QUANTITY)
8734 {
8735 if (IsMagazine())
8736 {
8737 Magazine mag = Magazine.Cast(this);
8738 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8739 }
8740 else
8741 {
8743 }
8744
8745 if (m_EM)
8746 {
8747 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8748 }
8749
8750 }
8751
8752 else if (action_id ==
EActions.REMOVE_QUANTITY)
8753 {
8754 if (IsMagazine())
8755 {
8756 Magazine mag2 = Magazine.Cast(this);
8757 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8758 }
8759 else
8760 {
8762 }
8763 if (m_EM)
8764 {
8765 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8766 }
8767
8768 }
8769
8770 else if (action_id ==
EActions.SET_QUANTITY_0)
8771 {
8773
8774 if (m_EM)
8775 {
8776 m_EM.SetEnergy(0);
8777 }
8778 }
8779
8780 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8781 {
8783
8784 if (m_EM)
8785 {
8786 m_EM.SetEnergy(m_EM.GetEnergyMax());
8787 }
8788 }
8789
8790 else if (action_id ==
EActions.ADD_HEALTH)
8791 {
8792 AddHealth("","",GetMaxHealth("","Health")/5);
8793 }
8794 else if (action_id ==
EActions.REMOVE_HEALTH)
8795 {
8796 AddHealth("","",-GetMaxHealth("","Health")/5);
8797 }
8798 else if (action_id ==
EActions.DESTROY_HEALTH)
8799 {
8800 SetHealth01("","",0);
8801 }
8802 else if (action_id ==
EActions.WATCH_ITEM)
8803 {
8805 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8806 #ifdef DEVELOPER
8807 SetDebugDeveloper_item(this);
8808 #endif
8809 }
8810
8811 else if (action_id ==
EActions.ADD_TEMPERATURE)
8812 {
8813 AddTemperature(20);
8814
8815 }
8816
8817 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8818 {
8819 AddTemperature(-20);
8820
8821 }
8822
8823 else if (action_id ==
EActions.FLIP_FROZEN)
8824 {
8825 SetFrozen(!GetIsFrozen());
8826
8827 }
8828
8829 else if (action_id ==
EActions.ADD_WETNESS)
8830 {
8832
8833 }
8834
8835 else if (action_id ==
EActions.REMOVE_WETNESS)
8836 {
8838
8839 }
8840
8841 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8842 {
8845
8846
8847 }
8848
8849 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8850 {
8853 }
8854
8855 else if (action_id ==
EActions.MAKE_SPECIAL)
8856 {
8857 auto debugParams = DebugSpawnParams.WithPlayer(player);
8858 OnDebugSpawnEx(debugParams);
8859 }
8860
8861 else if (action_id ==
EActions.DELETE)
8862 {
8863 Delete();
8864 }
8865
8866 }
8867
8868
8869 return false;
8870 }
8871
8872
8873
8874
8878
8881
8882
8883
8885 {
8886 return false;
8887 }
8888
8889
8891 {
8892 return true;
8893 }
8894
8895
8897 {
8898 return true;
8899 }
8900
8901
8902
8904 {
8905 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8907 }
8908
8911 {
8912 return null;
8913 }
8914
8916 {
8917 return false;
8918 }
8919
8921 {
8922 return false;
8923 }
8924
8928
8929
8931 {
8932 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8933 return module_repairing.CanRepair(this, item_repair_kit);
8934 }
8935
8936
8937 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8938 {
8939 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8940 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8941 }
8942
8943
8945 {
8946
8947
8948
8949
8950
8951
8952
8953
8954 return 1;
8955 }
8956
8957
8958
8960 {
8962 }
8963
8964
8965
8967 {
8969 }
8970
8971
8980 {
8981 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8982
8983 if (player)
8984 {
8985 player.MessageStatus(text);
8986 }
8987 }
8988
8989
8998 {
8999 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9000
9001 if (player)
9002 {
9003 player.MessageAction(text);
9004 }
9005 }
9006
9007
9016 {
9017 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9018
9019 if (player)
9020 {
9021 player.MessageFriendly(text);
9022 }
9023 }
9024
9025
9034 {
9035 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9036
9037 if (player)
9038 {
9039 player.MessageImportant(text);
9040 }
9041 }
9042
9044 {
9045 return true;
9046 }
9047
9048
9049 override bool KindOf(
string tag)
9050 {
9051 bool found = false;
9052 string item_name = this.
GetType();
9055
9056 int array_size = item_tag_array.Count();
9057 for (int i = 0; i < array_size; i++)
9058 {
9059 if (item_tag_array.Get(i) == tag)
9060 {
9061 found = true;
9062 break;
9063 }
9064 }
9065 return found;
9066 }
9067
9068
9070 {
9071
9072 super.OnRPC(sender, rpc_type,ctx);
9073
9074
9075 switch (rpc_type)
9076 {
9077 #ifndef SERVER
9078 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9079 Param2<bool, string> p = new Param2<bool, string>(false, "");
9080
9082 return;
9083
9084 bool play = p.param1;
9085 string soundSet = p.param2;
9086
9087 if (play)
9088 {
9090 {
9092 {
9094 }
9095 }
9096 else
9097 {
9099 }
9100 }
9101 else
9102 {
9104 }
9105
9106 break;
9107 #endif
9108
9109 }
9110
9112 {
9114 }
9115 }
9116
9117
9118
9119
9121 {
9122 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9123 return plugin.GetID(
name);
9124 }
9125
9127 {
9128 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9129 return plugin.GetName(id);
9130 }
9131
9134 {
9135
9136
9137 int varFlags;
9138 if (!ctx.
Read(varFlags))
9139 return;
9140
9141 if (varFlags & ItemVariableFlags.FLOAT)
9142 {
9144 }
9145 }
9146
9148 {
9149
9150 super.SerializeNumericalVars(floats_out);
9151
9152
9153
9155 {
9157 }
9158
9160 {
9162 }
9163
9165 {
9167 }
9168
9170 {
9175 }
9176
9178 {
9180 }
9181 }
9182
9184 {
9185
9186 super.DeSerializeNumericalVars(floats);
9187
9188
9189 int index = 0;
9190 int mask = Math.Round(floats.Get(index));
9191
9192 index++;
9193
9195 {
9197 {
9199 }
9200 else
9201 {
9202 float quantity = floats.Get(index);
9204 }
9205 index++;
9206 }
9207
9209 {
9210 float wet = floats.Get(index);
9212 index++;
9213 }
9214
9216 {
9217 int liquidtype = Math.Round(floats.Get(index));
9219 index++;
9220 }
9221
9223 {
9225 index++;
9227 index++;
9229 index++;
9231 index++;
9232 }
9233
9235 {
9236 int cleanness = Math.Round(floats.Get(index));
9238 index++;
9239 }
9240 }
9241
9243 {
9244 super.WriteVarsToCTX(ctx);
9245
9246
9248 {
9250 }
9251
9253 {
9255 }
9256
9258 {
9260 }
9261
9263 {
9264 int r,g,b,a;
9270 }
9271
9273 {
9275 }
9276 }
9277
9279 {
9280 if (!super.ReadVarsFromCTX(ctx,version))
9281 return false;
9282
9283 int intValue;
9284 float value;
9285
9286 if (version < 140)
9287 {
9288 if (!ctx.
Read(intValue))
9289 return false;
9290
9291 m_VariablesMask = intValue;
9292 }
9293
9295 {
9296 if (!ctx.
Read(value))
9297 return false;
9298
9300 {
9302 }
9303 else
9304 {
9306 }
9307 }
9308
9309 if (version < 140)
9310 {
9312 {
9313 if (!ctx.
Read(value))
9314 return false;
9315 SetTemperatureDirect(value);
9316 }
9317 }
9318
9320 {
9321 if (!ctx.
Read(value))
9322 return false;
9324 }
9325
9327 {
9328 if (!ctx.
Read(intValue))
9329 return false;
9331 }
9332
9334 {
9335 int r,g,b,a;
9337 return false;
9339 return false;
9341 return false;
9343 return false;
9344
9346 }
9347
9349 {
9350 if (!ctx.
Read(intValue))
9351 return false;
9353 }
9354
9355 if (version >= 138 && version < 140)
9356 {
9358 {
9359 if (!ctx.
Read(intValue))
9360 return false;
9361 SetFrozen(intValue);
9362 }
9363 }
9364
9365 return true;
9366 }
9367
9368
9370 {
9373 {
9375 }
9376
9377 if (!super.OnStoreLoad(ctx, version))
9378 {
9380 return false;
9381 }
9382
9383 if (version >= 114)
9384 {
9385 bool hasQuickBarIndexSaved;
9386
9387 if (!ctx.
Read(hasQuickBarIndexSaved))
9388 {
9390 return false;
9391 }
9392
9393 if (hasQuickBarIndexSaved)
9394 {
9395 int itmQBIndex;
9396
9397
9398 if (!ctx.
Read(itmQBIndex))
9399 {
9401 return false;
9402 }
9403
9404 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9405 if (itmQBIndex != -1 && parentPlayer)
9406 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9407 }
9408 }
9409 else
9410 {
9411
9412 PlayerBase player;
9413 int itemQBIndex;
9414 if (version ==
int.
MAX)
9415 {
9416 if (!ctx.
Read(itemQBIndex))
9417 {
9419 return false;
9420 }
9421 }
9422 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9423 {
9424
9425 if (!ctx.
Read(itemQBIndex))
9426 {
9428 return false;
9429 }
9430 if (itemQBIndex != -1 && player)
9431 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9432 }
9433 }
9434
9435 if (version < 140)
9436 {
9437
9438 if (!LoadVariables(ctx, version))
9439 {
9441 return false;
9442 }
9443 }
9444
9445
9447 {
9449 return false;
9450 }
9451 if (version >= 132)
9452 {
9454 if (raib)
9455 {
9457 {
9459 return false;
9460 }
9461 }
9462 }
9463
9465 return true;
9466 }
9467
9468
9469
9471 {
9472 super.OnStoreSave(ctx);
9473
9474 PlayerBase player;
9475 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9476 {
9478
9479 int itemQBIndex = -1;
9480 itemQBIndex = player.FindQuickBarEntityIndex(this);
9481 ctx.
Write(itemQBIndex);
9482 }
9483 else
9484 {
9486 }
9487
9489
9491 if (raib)
9492 {
9494 }
9495 }
9496
9497
9499 {
9500 super.AfterStoreLoad();
9501
9503 {
9505 }
9506
9508 {
9511 }
9512 }
9513
9515 {
9516 super.EEOnAfterLoad();
9517
9519 {
9521 }
9522
9525 }
9526
9528 {
9529 return false;
9530 }
9531
9532
9533
9535 {
9537 {
9538 #ifdef PLATFORM_CONSOLE
9539
9541 {
9543 if (menu)
9544 {
9546 }
9547 }
9548 #endif
9549 }
9550
9552 {
9555 }
9556
9558 {
9559 SetWeightDirty();
9561 }
9563 {
9566 }
9567
9569 {
9572 }
9574 {
9577 }
9578
9579 super.OnVariablesSynchronized();
9580 }
9581
9582
9583
9585 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9586 {
9587 if (!IsServerCheck(allow_client))
9588 return false;
9589
9591 return false;
9592
9595
9596 if (value <= (min + 0.001))
9597 value = min;
9598
9599 if (value == min)
9600 {
9601 if (destroy_config)
9602 {
9603 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9604 if (dstr)
9605 {
9607 this.Delete();
9608 return true;
9609 }
9610 }
9611 else if (destroy_forced)
9612 {
9614 this.Delete();
9615 return true;
9616 }
9617
9619 }
9620
9623
9625 {
9627
9628 if (delta)
9630 }
9631
9633
9634 return false;
9635 }
9636
9637
9639 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9640 {
9642 }
9643
9645 {
9648 }
9649
9651 {
9654 }
9655
9658 {
9659 float value_clamped = Math.Clamp(value, 0, 1);
9661 SetQuantity(result, destroy_config, destroy_forced);
9662 }
9663
9664
9667 {
9669 }
9670
9672 {
9674 }
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9686 {
9687 int slot = -1;
9688 if (GetInventory())
9689 {
9690 InventoryLocation il = new InventoryLocation;
9691 GetInventory().GetCurrentInventoryLocation(il);
9693 }
9694
9696 }
9697
9699 {
9700 float quantity_max = 0;
9701
9703 {
9704 if (attSlotID != -1)
9705 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9706
9707 if (quantity_max <= 0)
9709 }
9710
9711 if (quantity_max <= 0)
9713
9714 return quantity_max;
9715 }
9716
9718 {
9720 }
9721
9723 {
9725 }
9726
9727
9729 {
9731 }
9732
9734 {
9736 }
9737
9739 {
9741 }
9742
9743
9745 {
9746
9747 float weightEx = GetWeightEx();
9748 float special = GetInventoryAndCargoWeight();
9749 return weightEx - special;
9750 }
9751
9752
9754 {
9756 }
9757
9759 {
9761 {
9762 #ifdef DEVELOPER
9763 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9764 {
9765 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9767 }
9768 #endif
9769
9771 }
9772 else if (HasEnergyManager())
9773 {
9774 #ifdef DEVELOPER
9775 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9776 {
9777 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9778 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9779 }
9780 #endif
9781 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9782 }
9783 else
9784 {
9785 #ifdef DEVELOPER
9786 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9787 {
9788 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9789 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9790 }
9791 #endif
9792 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9793 }
9794 }
9795
9798 {
9799 int item_count = 0;
9801
9802 if (GetInventory().GetCargo() != NULL)
9803 {
9804 item_count = GetInventory().GetCargo().GetItemCount();
9805 }
9806
9807 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9808 {
9809 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9810 if (item)
9811 item_count += item.GetNumberOfItems();
9812 }
9813 return item_count;
9814 }
9815
9818 {
9819 float weight = 0;
9820 float wetness = 1;
9821 if (include_wetness)
9824 {
9825 weight = wetness * m_ConfigWeight;
9826 }
9828 {
9829 weight = 1;
9830 }
9831 return weight;
9832 }
9833
9834
9835
9837 {
9838 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9839 {
9840 GameInventory inv = GetInventory();
9841 array<EntityAI> items = new array<EntityAI>;
9843 for (int i = 0; i < items.Count(); i++)
9844 {
9846 if (item)
9847 {
9849 }
9850 }
9851 }
9852 }
9853
9854
9855
9856
9858 {
9859 float energy = 0;
9860 if (HasEnergyManager())
9861 {
9862 energy = GetCompEM().GetEnergy();
9863 }
9864 return energy;
9865 }
9866
9867
9869 {
9870 super.OnEnergyConsumed();
9871
9873 }
9874
9876 {
9877 super.OnEnergyAdded();
9878
9880 }
9881
9882
9884 {
9885 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9886 {
9888 {
9889 float energy_0to1 = GetCompEM().GetEnergy0To1();
9891 }
9892 }
9893 }
9894
9895
9897 {
9898 return ConfigGetFloat("heatIsolation");
9899 }
9900
9902 {
9904 }
9905
9907 {
9908 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9909 if (
GetGame().ConfigIsExisting(paramPath))
9911
9912 return 0.0;
9913 }
9914
9916 {
9917 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9918 if (
GetGame().ConfigIsExisting(paramPath))
9920
9921 return 0.0;
9922 }
9923
9924 override void SetWet(
float value,
bool allow_client =
false)
9925 {
9926 if (!IsServerCheck(allow_client))
9927 return;
9928
9931
9933
9934 m_VarWet = Math.Clamp(value, min, max);
9935
9937 {
9940 }
9941 }
9942
9943 override void AddWet(
float value)
9944 {
9946 }
9947
9949 {
9951 }
9952
9954 {
9956 }
9957
9959 {
9961 }
9962
9964 {
9966 }
9967
9969 {
9971 }
9972
9974 {
9977 if (newLevel != oldLevel)
9978 {
9980 }
9981 }
9982
9984 {
9985 SetWeightDirty();
9986 }
9987
9989 {
9990 return GetWetLevelInternal(
m_VarWet);
9991 }
9992
9993
9994
9996 {
9998 }
9999
10001 {
10003 }
10004
10006 {
10008 }
10009
10011 {
10013 }
10014
10015
10016
10018 {
10019 if (ConfigIsExisting("itemModelLength"))
10020 {
10021 return ConfigGetFloat("itemModelLength");
10022 }
10023 return 0;
10024 }
10025
10027 {
10028 if (ConfigIsExisting("itemAttachOffset"))
10029 {
10030 return ConfigGetFloat("itemAttachOffset");
10031 }
10032 return 0;
10033 }
10034
10035 override void SetCleanness(
int value,
bool allow_client =
false)
10036 {
10037 if (!IsServerCheck(allow_client))
10038 return;
10039
10041
10043
10046 }
10047
10049 {
10051 }
10052
10054 {
10055 return true;
10056 }
10057
10058
10059
10060
10062 {
10064 }
10065
10067 {
10069 }
10070
10071
10072
10073
10074 override void SetColor(
int r,
int g,
int b,
int a)
10075 {
10081 }
10083 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10084 {
10089 }
10090
10092 {
10094 }
10095
10098 {
10099 int r,g,b,a;
10101 r = r/255;
10102 g = g/255;
10103 b = b/255;
10104 a = a/255;
10105 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10106 }
10107
10108
10109
10110 override void SetLiquidType(
int value,
bool allow_client =
false)
10111 {
10112 if (!IsServerCheck(allow_client))
10113 return;
10114
10119 }
10120
10122 {
10123 return ConfigGetInt("varLiquidTypeInit");
10124 }
10125
10127 {
10129 }
10130
10132 {
10134 SetFrozen(false);
10135 }
10136
10139 {
10140 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10141 }
10142
10143
10146 {
10147 PlayerBase nplayer;
10148 if (PlayerBase.CastTo(nplayer, player))
10149 {
10151
10152 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10153 }
10154 }
10155
10156
10159 {
10160 PlayerBase nplayer;
10161 if (PlayerBase.CastTo(nplayer,player))
10162 {
10163
10164 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10165
10166 }
10167
10168
10169 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10170
10171
10172 if (HasEnergyManager())
10173 {
10174 GetCompEM().UpdatePlugState();
10175 }
10176 }
10177
10178
10180 {
10181 super.OnPlacementStarted(player);
10182
10184 }
10185
10186 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10187 {
10189 {
10190 m_AdminLog.OnPlacementComplete(player,
this);
10191 }
10192
10193 super.OnPlacementComplete(player, position, orientation);
10194 }
10195
10196
10197
10198
10199
10201 {
10203 {
10204 return true;
10205 }
10206 else
10207 {
10208 return false;
10209 }
10210 }
10211
10212
10214 {
10216 {
10218 }
10219 }
10220
10221
10223 {
10225 }
10226
10228 {
10230 }
10231
10232 override void InsertAgent(
int agent,
float count = 1)
10233 {
10234 if (count < 1)
10235 return;
10236
10238 }
10239
10242 {
10244 }
10245
10246
10248 {
10250 }
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10294 {
10296 return false;
10297 return true;
10298 }
10299
10301 {
10302
10304 }
10305
10306
10309 {
10310 super.CheckForRoofLimited(timeTresholdMS);
10311
10313 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10314 {
10315 m_PreviousRoofTestTime = time;
10316 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10317 }
10318 }
10319
10320
10322 {
10324 {
10325 return 0;
10326 }
10327
10328 if (GetInventory().GetAttachmentSlotsCount() != 0)
10329 {
10330 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10331 if (filter)
10332 return filter.GetProtectionLevel(type, false, system);
10333 else
10334 return 0;
10335 }
10336
10337 string subclassPath, entryName;
10338
10339 switch (type)
10340 {
10342 entryName = "biological";
10343 break;
10345 entryName = "chemical";
10346 break;
10347 default:
10348 entryName = "biological";
10349 break;
10350 }
10351
10352 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10353
10355 }
10356
10357
10358
10361 {
10362 if (!IsMagazine())
10364
10366 }
10367
10368
10369
10370
10371
10376 {
10377 return true;
10378 }
10379
10381 {
10383 }
10384
10385
10386
10387
10388
10390 {
10391 if (parent)
10392 {
10393 if (parent.IsInherited(DayZInfected))
10394 return true;
10395
10396 if (!parent.IsRuined())
10397 return true;
10398 }
10399
10400 return true;
10401 }
10402
10404 {
10405 if (!super.CanPutAsAttachment(parent))
10406 {
10407 return false;
10408 }
10409
10410 if (!IsRuined() && !parent.IsRuined())
10411 {
10412 return true;
10413 }
10414
10415 return false;
10416 }
10417
10419 {
10420
10421
10422
10423
10424 return super.CanReceiveItemIntoCargo(item);
10425 }
10426
10428 {
10429
10430
10431
10432
10433 GameInventory attachmentInv = attachment.GetInventory();
10435 {
10436 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10437 return false;
10438 }
10439
10440 InventoryLocation loc = new InventoryLocation();
10441 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10442 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10443 return false;
10444
10445 return super.CanReceiveAttachment(attachment, slotId);
10446 }
10447
10449 {
10450 if (!super.CanReleaseAttachment(attachment))
10451 return false;
10452
10453 return GetInventory().AreChildrenAccessible();
10454 }
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10477 {
10478 int id = muzzle_owner.GetMuzzleID();
10479 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10480
10481 if (WPOF_array)
10482 {
10483 for (int i = 0; i < WPOF_array.Count(); i++)
10484 {
10485 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10486
10487 if (WPOF)
10488 {
10489 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10490 }
10491 }
10492 }
10493 }
10494
10495
10497 {
10498 int id = muzzle_owner.GetMuzzleID();
10500
10501 if (WPOBE_array)
10502 {
10503 for (int i = 0; i < WPOBE_array.Count(); i++)
10504 {
10505 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10506
10507 if (WPOBE)
10508 {
10509 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10510 }
10511 }
10512 }
10513 }
10514
10515
10517 {
10518 int id = muzzle_owner.GetMuzzleID();
10519 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10520
10521 if (WPOOH_array)
10522 {
10523 for (int i = 0; i < WPOOH_array.Count(); i++)
10524 {
10525 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10526
10527 if (WPOOH)
10528 {
10529 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10530 }
10531 }
10532 }
10533 }
10534
10535
10537 {
10538 int id = muzzle_owner.GetMuzzleID();
10539 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10540
10541 if (WPOOH_array)
10542 {
10543 for (int i = 0; i < WPOOH_array.Count(); i++)
10544 {
10545 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10546
10547 if (WPOOH)
10548 {
10549 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10550 }
10551 }
10552 }
10553 }
10554
10555
10557 {
10558 int id = muzzle_owner.GetMuzzleID();
10559 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10560
10561 if (WPOOH_array)
10562 {
10563 for (int i = 0; i < WPOOH_array.Count(); i++)
10564 {
10565 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10566
10567 if (WPOOH)
10568 {
10569 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10570 }
10571 }
10572 }
10573 }
10574
10575
10576
10578 {
10580 {
10581 return true;
10582 }
10583
10584 return false;
10585 }
10586
10588 {
10590 {
10591 return true;
10592 }
10593
10594 return false;
10595 }
10596
10598 {
10600 {
10601 return true;
10602 }
10603
10604 return false;
10605 }
10606
10608 {
10609 return false;
10610 }
10611
10614 {
10615 return UATimeSpent.DEFAULT_DEPLOY;
10616 }
10617
10618
10619
10620
10622 {
10624 SetSynchDirty();
10625 }
10626
10628 {
10630 }
10631
10632
10634 {
10635 return false;
10636 }
10637
10640 {
10641 string att_type = "None";
10642
10643 if (ConfigIsExisting("soundAttType"))
10644 {
10645 att_type = ConfigGetString("soundAttType");
10646 }
10647
10649 }
10650
10652 {
10654 }
10655
10656
10657
10658
10659
10663
10665 {
10668
10670 }
10671
10672
10674 {
10676 return;
10677
10679
10682
10685
10686 SoundParameters params = new SoundParameters();
10690 }
10691
10692
10694 {
10696 return;
10697
10699 SetSynchDirty();
10700
10703 }
10704
10705
10707 {
10709 return;
10710
10712 SetSynchDirty();
10713
10716 }
10717
10719 {
10721 }
10722
10724 {
10726 }
10727
10730 {
10731 if (!
GetGame().IsDedicatedServer())
10732 {
10733 if (ConfigIsExisting("attachSoundSet"))
10734 {
10735 string cfg_path = "";
10736 string soundset = "";
10737 string type_name =
GetType();
10738
10741 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10742 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10743
10744 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10745 {
10746 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10747 {
10748 if (cfg_slot_array[i] == slot_type)
10749 {
10750 soundset = cfg_soundset_array[i];
10751 break;
10752 }
10753 }
10754 }
10755
10756 if (soundset != "")
10757 {
10758 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10760 }
10761 }
10762 }
10763 }
10764
10766 {
10767
10768 }
10769
10770 void OnApply(PlayerBase player);
10771
10773 {
10774 return 1.0;
10775 };
10776
10778 {
10780 }
10781
10783 {
10785 }
10786
10788
10790 {
10791 SetDynamicPhysicsLifeTime(0.01);
10793 }
10794
10796 {
10797 array<string> zone_names = new array<string>;
10798 GetDamageZones(zone_names);
10799 for (int i = 0; i < zone_names.Count(); i++)
10800 {
10801 SetHealthMax(zone_names.Get(i),"Health");
10802 }
10803 SetHealthMax("","Health");
10804 }
10805
10808 {
10809 float global_health = GetHealth01("","Health");
10810 array<string> zones = new array<string>;
10811 GetDamageZones(zones);
10812
10813 for (int i = 0; i < zones.Count(); i++)
10814 {
10815 SetHealth01(zones.Get(i),"Health",global_health);
10816 }
10817 }
10818
10821 {
10822 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10823 }
10824
10826 {
10827 if (!hasRootAsPlayer)
10828 {
10829 if (refParentIB)
10830 {
10831
10832 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10833 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10834
10835 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10836 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10837
10840 }
10841 else
10842 {
10843
10846 }
10847 }
10848 }
10849
10851 {
10853 {
10854 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10855 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10856 {
10857 float heatPermCoef = 1.0;
10859 while (ent)
10860 {
10861 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10862 ent = ent.GetHierarchyParent();
10863 }
10864
10865 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10866 }
10867 }
10868 }
10869
10871 {
10872
10873 EntityAI parent = GetHierarchyParent();
10874 if (!parent)
10875 {
10876 hasParent = false;
10877 hasRootAsPlayer = false;
10878 }
10879 else
10880 {
10881 hasParent = true;
10882 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10883 refParentIB =
ItemBase.Cast(parent);
10884 }
10885 }
10886
10887 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10888 {
10889
10890 }
10891
10893 {
10894
10895 return false;
10896 }
10897
10899 {
10900
10901
10902 return false;
10903 }
10904
10906 {
10907
10908 return false;
10909 }
10910
10913 {
10914 return !GetIsFrozen() &&
IsOpen();
10915 }
10916
10918 {
10919 bool hasParent = false, hasRootAsPlayer = false;
10921
10922 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10923 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10924
10925 if (wwtu || foodDecay)
10926 {
10930
10931 if (processWetness || processTemperature || processDecay)
10932 {
10934
10935 if (processWetness)
10936 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10937
10938 if (processTemperature)
10940
10941 if (processDecay)
10942 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10943 }
10944 }
10945 }
10946
10949 {
10951 }
10952
10954 {
10957
10958 return super.GetTemperatureFreezeThreshold();
10959 }
10960
10962 {
10965
10966 return super.GetTemperatureThawThreshold();
10967 }
10968
10970 {
10973
10974 return super.GetItemOverheatThreshold();
10975 }
10976
10978 {
10980 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10981
10982 return super.GetTemperatureFreezeTime();
10983 }
10984
10986 {
10988 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10989
10990 return super.GetTemperatureThawTime();
10991 }
10992
10997
10999 {
11000 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11001 }
11002
11004 {
11005 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11006 }
11007
11010 {
11012 }
11013
11015 {
11017 }
11018
11020 {
11022 }
11023
11026 {
11027 return null;
11028 }
11029
11032 {
11033 return false;
11034 }
11035
11037 {
11039 {
11042 if (!trg)
11043 {
11045 explosive = this;
11046 }
11047
11048 explosive.PairRemote(trg);
11050
11051 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11052 trg.SetPersistentPairID(persistentID);
11053 explosive.SetPersistentPairID(persistentID);
11054
11055 return true;
11056 }
11057 return false;
11058 }
11059
11062 {
11063 float ret = 1.0;
11066 ret *= GetHealth01();
11067
11068 return ret;
11069 }
11070
11071 #ifdef DEVELOPER
11072 override void SetDebugItem()
11073 {
11074 super.SetDebugItem();
11075 _itemBase = this;
11076 }
11077
11079 {
11080 string text = super.GetDebugText();
11081
11083 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11084
11085 return text;
11086 }
11087 #endif
11088
11090 {
11091 return true;
11092 }
11093
11095
11097
11099 {
11102 }
11103
11104
11112
11128}
11129
11131{
11133 if (entity)
11134 {
11135 bool is_item = entity.IsInherited(
ItemBase);
11136 if (is_item && full_quantity)
11137 {
11140 }
11141 }
11142 else
11143 {
11145 return NULL;
11146 }
11147 return entity;
11148}
11149
11151{
11152 if (item)
11153 {
11154 if (health > 0)
11155 item.SetHealth("", "", health);
11156
11157 if (item.CanHaveTemperature())
11158 {
11160 if (item.CanFreeze())
11161 item.SetFrozen(false);
11162 }
11163
11164 if (item.HasEnergyManager())
11165 {
11166 if (quantity >= 0)
11167 {
11168 item.GetCompEM().SetEnergy0To1(quantity);
11169 }
11170 else
11171 {
11173 }
11174 }
11175 else if (item.IsMagazine())
11176 {
11177 Magazine mag = Magazine.Cast(item);
11178 if (quantity >= 0)
11179 {
11180 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11181 }
11182 else
11183 {
11185 }
11186
11187 }
11188 else
11189 {
11190 if (quantity >= 0)
11191 {
11192 item.SetQuantityNormalized(quantity, false);
11193 }
11194 else
11195 {
11197 }
11198
11199 }
11200 }
11201}
11202
11203#ifdef DEVELOPER
11205#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.