6312{
6314 {
6315 return true;
6316 }
6317};
6318
6319
6320
6322{
6326
6328
6331
6332
6333
6334
6335
6344
6350
6355
6360
6381 protected bool m_IsResultOfSplit
6382
6384
6389
6390
6391
6393
6397
6398
6399
6401
6404
6405
6406
6412
6413
6421
6424
6425
6427
6428
6430
6431
6436
6437
6442
6443
6445
6446
6448 {
6453
6454 if (!
GetGame().IsDedicatedServer())
6455 {
6457 {
6459
6461 {
6463 }
6464 }
6465
6468 }
6469
6470 m_OldLocation = null;
6471
6473 {
6475 }
6476
6477 if (ConfigIsExisting("headSelectionsToHide"))
6478 {
6481 }
6482
6484 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6485 {
6487 }
6488
6490
6491 m_IsResultOfSplit = false;
6492
6494 }
6495
6497 {
6498 super.InitItemVariables();
6499
6505 m_Count = ConfigGetInt(
"count");
6506
6509
6514
6517
6522
6534
6538
6539
6542 if (ConfigIsExisting("canBeSplit"))
6543 {
6546 }
6547
6549 if (ConfigIsExisting("itemBehaviour"))
6551
6552
6555 RegisterNetSyncVariableInt("m_VarLiquidType");
6556 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6557
6558 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6559 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6560 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6561
6562 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6563 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6564 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6565 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6566
6567 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6568 RegisterNetSyncVariableBool("m_IsTakeable");
6569 RegisterNetSyncVariableBool("m_IsHologram");
6570
6573 {
6576 }
6577
6579
6581 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6583
6584 }
6585
6587 {
6589 }
6590
6592 {
6595 {
6600 }
6601 }
6602
6603 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6604 {
6606 {
6609 }
6610
6612 }
6613
6615 {
6621 }
6622
6624
6626 {
6628
6629 if (!action)
6630 {
6631 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6632 return;
6633 }
6634
6636 if (!ai)
6637 {
6639 return;
6640 }
6641
6643 if (!action_array)
6644 {
6645 action_array = new array<ActionBase_Basic>;
6647 }
6648 if (LogManager.IsActionLogEnable())
6649 {
6650 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6651 }
6652
6653 if (action_array.Find(action) != -1)
6654 {
6655 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6656 }
6657 else
6658 {
6659 action_array.Insert(action);
6660 }
6661 }
6662
6664 {
6666 ActionBase action = player.GetActionManager().GetAction(actionName);
6669
6670 if (action_array)
6671 {
6672 action_array.RemoveItem(action);
6673 }
6674 }
6675
6676
6677
6679 {
6680 ActionOverrideData overrideData = new ActionOverrideData();
6684
6686 if (!actionMap)
6687 {
6690 }
6691
6692 actionMap.Insert(this.
Type(), overrideData);
6693
6694 }
6695
6697
6699
6700
6702 {
6705
6708
6709 string config_to_search = "CfgVehicles";
6710 string muzzle_owner_config;
6711
6713 {
6714 if (IsInherited(Weapon))
6715 config_to_search = "CfgWeapons";
6716
6717 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6718
6719 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6720
6722
6723 if (config_OnFire_subclass_count > 0)
6724 {
6725 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6726
6727 for (int i = 0; i < config_OnFire_subclass_count; i++)
6728 {
6729 string particle_class = "";
6731 string config_OnFire_entry = config_OnFire_class + particle_class;
6732 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6733 WPOF_array.Insert(WPOF);
6734 }
6735
6736
6738 }
6739 }
6740
6742 {
6743 config_to_search = "CfgWeapons";
6744 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6745
6746 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6747
6749
6750 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6751 {
6752 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6753
6754 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6755 {
6756 string particle_class2 = "";
6758 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6759 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6760 WPOBE_array.Insert(WPOBE);
6761 }
6762
6763
6765 }
6766 }
6767 }
6768
6769
6771 {
6774
6776 {
6777 string config_to_search = "CfgVehicles";
6778
6779 if (IsInherited(Weapon))
6780 config_to_search = "CfgWeapons";
6781
6782 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6783 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6784
6785 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6786 {
6787
6789
6791 {
6793 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6795 return;
6796 }
6797
6800
6801
6802
6804 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6805
6806 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6807 {
6808 string particle_class = "";
6810 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6812
6813 if (entry_type == CT_CLASS)
6814 {
6815 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6816 WPOOH_array.Insert(WPOF);
6817 }
6818 }
6819
6820
6822 }
6823 }
6824 }
6825
6827 {
6829 }
6830
6832 {
6834 {
6836
6839
6842
6843 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6844 }
6845 }
6846
6848 {
6850 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6851
6853 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6854
6856 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6857
6859 {
6861 }
6862 }
6863
6865 {
6867 }
6868
6870 {
6873 else
6875
6877 {
6880 }
6881 else
6882 {
6885
6888 }
6889
6891 }
6892
6894 {
6896 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6897 }
6898
6900 {
6902 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6904 }
6905
6907 {
6909 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6910 }
6911
6913 {
6916
6917 OverheatingParticle OP = new OverheatingParticle();
6922
6924 }
6925
6927 {
6930
6931 return -1;
6932 }
6933
6935 {
6937 {
6940
6941 for (int i = count; i > 0; --i)
6942 {
6943 int id = i - 1;
6946
6949
6950 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6951 {
6952 if (p)
6953 {
6956 }
6957 }
6958 }
6959 }
6960 }
6961
6963 {
6965 {
6967 {
6968 int id = i - 1;
6970
6971 if (OP)
6972 {
6974
6975 if (p)
6976 {
6978 }
6979
6980 delete OP;
6981 }
6982 }
6983
6986 }
6987 }
6988
6991 {
6992 return 0.0;
6993 }
6994
6995
6997 {
6998 return 250;
6999 }
7000
7002 {
7003 return 0;
7004 }
7005
7008 {
7010 return true;
7011
7012 return false;
7013 }
7014
7017 {
7020
7022 {
7024 }
7025 else
7026 {
7027
7029 }
7030
7032 }
7033
7040 {
7041 return -1;
7042 }
7043
7044
7045
7046
7048 {
7050 {
7052 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7053
7054 if (r_index >= 0)
7055 {
7056 InventoryLocation r_il = new InventoryLocation;
7057 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7058
7059 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7062 {
7063 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7064 }
7066 {
7067 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7068 }
7069
7070 }
7071
7072 player.GetHumanInventory().ClearUserReservedLocation(this);
7073 }
7074
7077 }
7078
7079
7080
7081
7083 {
7084 return ItemBase.m_DebugActionsMask;
7085 }
7086
7088 {
7089 return ItemBase.m_DebugActionsMask & mask;
7090 }
7091
7093 {
7094 ItemBase.m_DebugActionsMask = mask;
7095 }
7096
7098 {
7099 ItemBase.m_DebugActionsMask |= mask;
7100 }
7101
7103 {
7104 ItemBase.m_DebugActionsMask &= ~mask;
7105 }
7106
7108 {
7110 {
7112 }
7113 else
7114 {
7116 }
7117 }
7118
7119
7121 {
7122 if (GetEconomyProfile())
7123 {
7124 float q_max = GetEconomyProfile().GetQuantityMax();
7125 if (q_max > 0)
7126 {
7127 float q_min = GetEconomyProfile().GetQuantityMin();
7128 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7129
7131 {
7132 ComponentEnergyManager comp = GetCompEM();
7134 {
7136 }
7137 }
7139 {
7141
7142 }
7143
7144 }
7145 }
7146 }
7147
7150 {
7151 EntityAI parent = GetHierarchyParent();
7152
7153 if (parent)
7154 {
7155 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7156 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7157 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7158 }
7159 }
7160
7163 {
7164 EntityAI parent = GetHierarchyParent();
7165
7166 if (parent)
7167 {
7168 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7169 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7170 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7171 }
7172 }
7173
7175 {
7176
7177
7178
7179
7181
7183 {
7184 if (ScriptInputUserData.CanStoreInputUserData())
7185 {
7186 ScriptInputUserData ctx = new ScriptInputUserData;
7192 ctx.
Write(use_stack_max);
7195
7197 {
7198 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7199 }
7200 }
7201 }
7202 else if (!
GetGame().IsMultiplayer())
7203 {
7205 }
7206 }
7207
7209 {
7211 }
7212
7214 {
7216 }
7217
7219 {
7221 }
7222
7224 {
7225
7226 return false;
7227 }
7228
7230 {
7231 return false;
7232 }
7233
7237 {
7238 return false;
7239 }
7240
7242 {
7243 return "";
7244 }
7245
7247
7249 {
7250 return false;
7251 }
7252
7254 {
7255 return true;
7256 }
7257
7258
7259
7261 {
7262 return true;
7263 }
7264
7266 {
7267 return true;
7268 }
7269
7271 {
7272 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7274 }
7275
7277 {
7279 }
7280
7282 {
7284 if (!is_being_placed)
7286 SetSynchDirty();
7287 }
7288
7289
7291
7293 {
7295 }
7296
7298 {
7300 }
7301
7303 {
7304 return 1;
7305 }
7306
7308 {
7309 return false;
7310 }
7311
7313 {
7315 SetSynchDirty();
7316 }
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7353 {
7354 super.OnMovedInsideCargo(container);
7355
7356 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7357 }
7358
7359 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7360 {
7361 super.EEItemLocationChanged(oldLoc,newLoc);
7362
7363 PlayerBase new_player = null;
7364 PlayerBase old_player = null;
7365
7366 if (newLoc.GetParent())
7367 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7368
7369 if (oldLoc.GetParent())
7370 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7371
7373 {
7374 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7375
7376 if (r_index >= 0)
7377 {
7378 InventoryLocation r_il = new InventoryLocation;
7379 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7380
7381 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7384 {
7385 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7386 }
7388 {
7389 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7390 }
7391
7392 }
7393 }
7394
7396 {
7397 if (new_player)
7398 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7399
7400 if (new_player == old_player)
7401 {
7402
7403 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7404 {
7406 {
7407 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7408 {
7409 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7410 }
7411 }
7412 else
7413 {
7414 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7415 }
7416 }
7417
7418 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7419 {
7420 int type = oldLoc.GetType();
7422 {
7423 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7424 }
7426 {
7427 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7428 }
7429 }
7430 if (!m_OldLocation)
7431 {
7432 m_OldLocation = new InventoryLocation;
7433 }
7434 m_OldLocation.Copy(oldLoc);
7435 }
7436 else
7437 {
7438 if (m_OldLocation)
7439 {
7440 m_OldLocation.Reset();
7441 }
7442 }
7443
7445 }
7446 else
7447 {
7448 if (new_player)
7449 {
7450 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7451 if (res_index >= 0)
7452 {
7453 InventoryLocation il = new InventoryLocation;
7454 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7456 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7459 {
7460 il.
GetParent().GetOnReleaseLock().Invoke(it);
7461 }
7463 {
7465 }
7466
7467 }
7468 }
7470 {
7471
7473 }
7474
7475 if (m_OldLocation)
7476 {
7477 m_OldLocation.Reset();
7478 }
7479 }
7480 }
7481
7482 override void EOnContact(IEntity other, Contact extra)
7483 {
7485 {
7486 int liquidType = -1;
7488 if (impactSpeed > 0.0)
7489 {
7491 #ifndef SERVER
7493 #else
7495 SetSynchDirty();
7496 #endif
7498 }
7499 }
7500
7501 #ifdef SERVER
7502 if (GetCompEM() && GetCompEM().IsPlugged())
7503 {
7504 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7505 GetCompEM().UnplugThis();
7506 }
7507 #endif
7508 }
7509
7511
7513 {
7515 }
7516
7518 {
7519
7520 }
7521
7523 {
7524 super.OnItemLocationChanged(old_owner, new_owner);
7525
7526 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7527 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7528
7529 if (!relatedPlayer && playerNew)
7530 relatedPlayer = playerNew;
7531
7532 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7533 {
7535 if (actionMgr)
7536 {
7537 ActionBase currentAction = actionMgr.GetRunningAction();
7538 if (currentAction)
7540 }
7541 }
7542
7543 Man ownerPlayerOld = null;
7544 Man ownerPlayerNew = null;
7545
7546 if (old_owner)
7547 {
7548 if (old_owner.
IsMan())
7549 {
7550 ownerPlayerOld = Man.Cast(old_owner);
7551 }
7552 else
7553 {
7554 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7555 }
7556 }
7557 else
7558 {
7560 {
7562
7563 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7564 {
7565 GetCompEM().UnplugThis();
7566 }
7567 }
7568 }
7569
7570 if (new_owner)
7571 {
7572 if (new_owner.
IsMan())
7573 {
7574 ownerPlayerNew = Man.Cast(new_owner);
7575 }
7576 else
7577 {
7578 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7579 }
7580 }
7581
7582 if (ownerPlayerOld != ownerPlayerNew)
7583 {
7584 if (ownerPlayerOld)
7585 {
7586 array<EntityAI> subItemsExit = new array<EntityAI>;
7588 for (int i = 0; i < subItemsExit.Count(); i++)
7589 {
7592 }
7593 }
7594
7595 if (ownerPlayerNew)
7596 {
7597 array<EntityAI> subItemsEnter = new array<EntityAI>;
7599 for (int j = 0; j < subItemsEnter.Count(); j++)
7600 {
7603 }
7604 }
7605 }
7606 else if (ownerPlayerNew != null)
7607 {
7608 PlayerBase nplayer;
7609 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7610 {
7611 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7613 for (int k = 0; k < subItemsUpdate.Count(); k++)
7614 {
7616 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7617 }
7618 }
7619 }
7620
7621 if (old_owner)
7622 old_owner.OnChildItemRemoved(this);
7623 if (new_owner)
7624 new_owner.OnChildItemReceived(this);
7625 }
7626
7627
7629 {
7630 super.EEDelete(parent);
7631 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7632 if (player)
7633 {
7635
7636 if (player.IsAlive())
7637 {
7638 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7639 if (r_index >= 0)
7640 {
7641 InventoryLocation r_il = new InventoryLocation;
7642 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7643
7644 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7647 {
7648 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7649 }
7651 {
7652 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7653 }
7654
7655 }
7656
7657 player.RemoveQuickBarEntityShortcut(this);
7658 }
7659 }
7660 }
7661
7663 {
7664 super.EEKilled(killer);
7665
7668 {
7669 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7670 {
7671 if (IsMagazine())
7672 {
7673 if (Magazine.Cast(this).GetAmmoCount() > 0)
7674 {
7676 }
7677 }
7678 else
7679 {
7681 }
7682 }
7683 }
7684 }
7685
7687 {
7688 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7689
7690 super.OnWasAttached(parent, slot_id);
7691
7694
7696 }
7697
7699 {
7700 super.OnWasDetached(parent, slot_id);
7701
7704 }
7705
7707 {
7708 int idx;
7711
7712 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7713 if (inventory_slots.Count() < 1)
7714 {
7715 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7716 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7717 }
7718 else
7719 {
7720 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7721 }
7722
7723 idx = inventory_slots.Find(slot);
7724 if (idx < 0)
7725 return "";
7726
7727 return attach_types.Get(idx);
7728 }
7729
7731 {
7732 int idx = -1;
7733 string slot;
7734
7737
7738 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7739 if (inventory_slots.Count() < 1)
7740 {
7741 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7742 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7743 }
7744 else
7745 {
7746 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7747 if (detach_types.Count() < 1)
7748 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7749 }
7750
7751 for (int i = 0; i < inventory_slots.Count(); i++)
7752 {
7753 slot = inventory_slots.Get(i);
7754 }
7755
7756 if (slot != "")
7757 {
7758 if (detach_types.Count() == 1)
7759 idx = 0;
7760 else
7761 idx = inventory_slots.Find(slot);
7762 }
7763 if (idx < 0)
7764 return "";
7765
7766 return detach_types.Get(idx);
7767 }
7768
7770 {
7771
7773
7774
7775 float min_time = 1;
7776 float max_time = 3;
7777 float delay = Math.RandomFloat(min_time, max_time);
7778
7779 explode_timer.Run(delay, this, "DoAmmoExplosion");
7780 }
7781
7783 {
7784 Magazine magazine = Magazine.Cast(this);
7785 int pop_sounds_count = 6;
7786 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7787
7788
7789 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7790 string sound_name = pop_sounds[ sound_idx ];
7792
7793
7794 magazine.ServerAddAmmoCount(-1);
7795
7796
7797 float min_temp_to_explode = 100;
7798
7799 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7800 {
7802 }
7803 }
7804
7805
7806 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7807 {
7808 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7809
7810 const int CHANCE_DAMAGE_CARGO = 4;
7811 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7812 const int CHANCE_DAMAGE_NOTHING = 2;
7813
7815 {
7816 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7817 int chances;
7818 int rnd;
7819
7820 if (GetInventory().GetCargo())
7821 {
7822 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7823 rnd = Math.RandomInt(0,chances);
7824
7825 if (rnd < CHANCE_DAMAGE_CARGO)
7826 {
7828 }
7829 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7830 {
7832 }
7833 }
7834 else
7835 {
7836 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7837 rnd = Math.RandomInt(0,chances);
7838
7839 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7840 {
7842 }
7843 }
7844 }
7845 }
7846
7848 {
7849 if (GetInventory().GetCargo())
7850 {
7851 int item_count = GetInventory().GetCargo().GetItemCount();
7852 if (item_count > 0)
7853 {
7854 int random_pick = Math.RandomInt(0, item_count);
7856 if (!item.IsExplosive())
7857 {
7858 item.AddHealth("","",damage);
7859 return true;
7860 }
7861 }
7862 }
7863 return false;
7864 }
7865
7867 {
7868 int attachment_count = GetInventory().AttachmentCount();
7869 if (attachment_count > 0)
7870 {
7871 int random_pick = Math.RandomInt(0, attachment_count);
7872 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7873 if (!attachment.IsExplosive())
7874 {
7875 attachment.AddHealth("","",damage);
7876 return true;
7877 }
7878 }
7879 return false;
7880 }
7881
7883 {
7885 }
7886
7888 {
7890 return GetInventory().CanRemoveEntity();
7891
7892 return false;
7893 }
7894
7896 {
7898 return;
7899
7901 {
7902 if (ScriptInputUserData.CanStoreInputUserData())
7903 {
7904 ScriptInputUserData ctx = new ScriptInputUserData;
7909 ctx.
Write(destination_entity);
7913 }
7914 }
7915 else if (!
GetGame().IsMultiplayer())
7916 {
7918 }
7919 }
7920
7922 {
7924 return;
7925
7926 float split_quantity_new;
7930 InventoryLocation loc = new InventoryLocation;
7931
7932 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7933 {
7935 split_quantity_new = stack_max;
7936 else
7938
7939 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7940 if (new_item)
7941 {
7942 new_item.SetResultOfSplit(true);
7943 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7945 new_item.SetQuantity(split_quantity_new);
7946 }
7947 }
7948 else if (destination_entity && slot_id == -1)
7949 {
7950 if (quantity > stack_max)
7951 split_quantity_new = stack_max;
7952 else
7953 split_quantity_new = quantity;
7954
7956 {
7959 }
7960
7961 if (new_item)
7962 {
7963 new_item.SetResultOfSplit(true);
7964 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7966 new_item.SetQuantity(split_quantity_new);
7967 }
7968 }
7969 else
7970 {
7971 if (stack_max != 0)
7972 {
7974 {
7976 }
7977
7978 if (split_quantity_new == 0)
7979 {
7980 if (!
GetGame().IsMultiplayer())
7981 player.PhysicalPredictiveDropItem(this);
7982 else
7983 player.ServerDropEntity(this);
7984 return;
7985 }
7986
7988
7989 if (new_item)
7990 {
7991 new_item.SetResultOfSplit(true);
7992 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7994 new_item.SetQuantity(stack_max);
7995 new_item.PlaceOnSurface();
7996 }
7997 }
7998 }
7999 }
8000
8002 {
8004 return;
8005
8006 float split_quantity_new;
8010 InventoryLocation loc = new InventoryLocation;
8011
8012 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8013 {
8015 split_quantity_new = stack_max;
8016 else
8018
8019 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8020 if (new_item)
8021 {
8022 new_item.SetResultOfSplit(true);
8023 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8025 new_item.SetQuantity(split_quantity_new);
8026 }
8027 }
8028 else if (destination_entity && slot_id == -1)
8029 {
8030 if (quantity > stack_max)
8031 split_quantity_new = stack_max;
8032 else
8033 split_quantity_new = quantity;
8034
8036 {
8039 }
8040
8041 if (new_item)
8042 {
8043 new_item.SetResultOfSplit(true);
8044 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8046 new_item.SetQuantity(split_quantity_new);
8047 }
8048 }
8049 else
8050 {
8051 if (stack_max != 0)
8052 {
8054 {
8056 }
8057
8059
8060 if (new_item)
8061 {
8062 new_item.SetResultOfSplit(true);
8063 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8065 new_item.SetQuantity(stack_max);
8066 new_item.PlaceOnSurface();
8067 }
8068 }
8069 }
8070 }
8071
8073 {
8075 return;
8076
8078 {
8079 if (ScriptInputUserData.CanStoreInputUserData())
8080 {
8081 ScriptInputUserData ctx = new ScriptInputUserData;
8086 dst.WriteToContext(ctx);
8088 }
8089 }
8090 else if (!
GetGame().IsMultiplayer())
8091 {
8093 }
8094 }
8095
8097 {
8099 return;
8100
8102 {
8103 if (ScriptInputUserData.CanStoreInputUserData())
8104 {
8105 ScriptInputUserData ctx = new ScriptInputUserData;
8110 ctx.
Write(destination_entity);
8116 }
8117 }
8118 else if (!
GetGame().IsMultiplayer())
8119 {
8121 }
8122 }
8123
8125 {
8127 }
8128
8130 {
8132 return this;
8133
8135 float split_quantity_new;
8137 if (dst.IsValid())
8138 {
8139 int slot_id = dst.GetSlot();
8141
8142 if (quantity > stack_max)
8143 split_quantity_new = stack_max;
8144 else
8145 split_quantity_new = quantity;
8146
8148
8149 if (new_item)
8150 {
8151 new_item.SetResultOfSplit(true);
8152 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8155 }
8156
8157 return new_item;
8158 }
8159
8160 return null;
8161 }
8162
8164 {
8166 return;
8167
8169 float split_quantity_new;
8171 if (destination_entity)
8172 {
8174 if (quantity > stackable)
8175 split_quantity_new = stackable;
8176 else
8177 split_quantity_new = quantity;
8178
8179 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8180 if (new_item)
8181 {
8182 new_item.SetResultOfSplit(true);
8183 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8185 new_item.SetQuantity(split_quantity_new);
8186 }
8187 }
8188 }
8189
8191 {
8193 return;
8194
8196 {
8197 if (ScriptInputUserData.CanStoreInputUserData())
8198 {
8199 ScriptInputUserData ctx = new ScriptInputUserData;
8204 ItemBase destination_entity =
this;
8205 ctx.
Write(destination_entity);
8209 }
8210 }
8211 else if (!
GetGame().IsMultiplayer())
8212 {
8214 }
8215 }
8216
8218 {
8220 return;
8221
8223 float split_quantity_new;
8225 if (player)
8226 {
8228 if (quantity > stackable)
8229 split_quantity_new = stackable;
8230 else
8231 split_quantity_new = quantity;
8232
8233 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8234 new_item =
ItemBase.Cast(in_hands);
8235 if (new_item)
8236 {
8237 new_item.SetResultOfSplit(true);
8238 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8240 new_item.SetQuantity(split_quantity_new);
8241 }
8242 }
8243 }
8244
8246 {
8248 return;
8249
8251 float split_quantity_new = Math.Floor(quantity * 0.5);
8252
8254
8255 if (new_item)
8256 {
8257 if (new_item.GetQuantityMax() < split_quantity_new)
8258 {
8259 split_quantity_new = new_item.GetQuantityMax();
8260 }
8261
8262 new_item.SetResultOfSplit(true);
8263 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8264
8266 {
8269 }
8270 else
8271 {
8274 }
8275 }
8276 }
8277
8279 {
8281 return;
8282
8284 float split_quantity_new = Math.Floor(quantity / 2);
8285
8286 InventoryLocation invloc = new InventoryLocation;
8288
8290 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8291
8292 if (new_item)
8293 {
8294 if (new_item.GetQuantityMax() < split_quantity_new)
8295 {
8296 split_quantity_new = new_item.GetQuantityMax();
8297 }
8299 {
8302 }
8303 else
8304 {
8307 }
8308 }
8309 }
8310
8313 {
8314 SetWeightDirty();
8316
8317 if (parent)
8318 parent.OnAttachmentQuantityChangedEx(this, delta);
8319
8321 {
8323 {
8325 }
8327 {
8328 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8330 }
8331 }
8332
8333 }
8334
8337 {
8338
8339 }
8340
8343 {
8345 }
8346
8348 {
8349 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8350
8352 {
8353 if (newLevel == GameConstants.STATE_RUINED)
8354 {
8356 EntityAI parent = GetHierarchyParent();
8357 if (parent && parent.IsFireplace())
8358 {
8359 CargoBase cargo = GetInventory().GetCargo();
8360 if (cargo)
8361 {
8363 {
8365 }
8366 }
8367 }
8368 }
8369
8371 {
8372
8374 return;
8375 }
8376
8377 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8378 {
8380 }
8381 }
8382 }
8383
8384
8386 {
8387 super.OnRightClick();
8388
8390 {
8392 {
8393 if (ScriptInputUserData.CanStoreInputUserData())
8394 {
8395 vector m4[4];
8397
8398 EntityAI root = GetHierarchyRoot();
8399
8400 InventoryLocation dst = new InventoryLocation;
8402 {
8403 if (root)
8404 {
8405 root.GetTransform(m4);
8407 }
8408 else
8409 GetInventory().GetCurrentInventoryLocation(dst);
8410 }
8411 else
8412 {
8414
8415
8416 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8417 {
8418 if (root)
8419 {
8420 root.GetTransform(m4);
8422 }
8423 else
8424 GetInventory().GetCurrentInventoryLocation(dst);
8425 }
8426 else
8427 {
8428 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8429 }
8430 }
8431
8432 ScriptInputUserData ctx = new ScriptInputUserData;
8440 }
8441 }
8442 else if (!
GetGame().IsMultiplayer())
8443 {
8445 }
8446 }
8447 }
8448
8449 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8450 {
8451
8452 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8453 return false;
8454
8455 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8456 return false;
8457
8458
8460 return false;
8461
8462
8463 Magazine mag = Magazine.Cast(this);
8464 if (mag)
8465 {
8466 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8467 return false;
8468
8469 if (stack_max_limit)
8470 {
8471 Magazine other_mag = Magazine.Cast(other_item);
8472 if (other_item)
8473 {
8474 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8475 return false;
8476 }
8477
8478 }
8479 }
8480 else
8481 {
8482
8484 return false;
8485
8487 return false;
8488 }
8489
8490 PlayerBase player = null;
8491 if (CastTo(player, GetHierarchyRootPlayer()))
8492 {
8493 if (player.GetInventory().HasAttachment(this))
8494 return false;
8495
8496 if (player.IsItemsToDelete())
8497 return false;
8498 }
8499
8500 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8501 return false;
8502
8503 int slotID;
8505 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8506 return false;
8507
8508 return true;
8509 }
8510
8512 {
8514 }
8515
8517 {
8518 return m_IsResultOfSplit;
8519 }
8520
8522 {
8523 m_IsResultOfSplit = value;
8524 }
8525
8527 {
8529 }
8530
8532 {
8533 float other_item_quantity = other_item.GetQuantity();
8534 float this_free_space;
8535
8537
8539
8540 if (other_item_quantity > this_free_space)
8541 {
8542 return this_free_space;
8543 }
8544 else
8545 {
8546 return other_item_quantity;
8547 }
8548 }
8549
8551 {
8553 }
8554
8556 {
8558 return;
8559
8560 if (!IsMagazine() && other_item)
8561 {
8563 if (quantity_used != 0)
8564 {
8565 float hp1 = GetHealth01("","");
8566 float hp2 = other_item.GetHealth01("","");
8567 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8568 hpResult = hpResult / (
GetQuantity() + quantity_used);
8569
8570 hpResult *= GetMaxHealth();
8571 Math.Round(hpResult);
8572 SetHealth("", "Health", hpResult);
8573
8575 other_item.AddQuantity(-quantity_used);
8576 }
8577 }
8579 }
8580
8582 {
8583 #ifdef SERVER
8584 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8585 GetHierarchyParent().IncreaseLifetimeUp();
8586 #endif
8587 };
8588
8590 {
8591 PlayerBase p = PlayerBase.Cast(player);
8592
8593 array<int> recipesIds = p.m_Recipes;
8594 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8595 if (moduleRecipesManager)
8596 {
8597 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8598 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8599 }
8600
8601 for (int i = 0;i < recipesIds.Count(); i++)
8602 {
8603 int key = recipesIds.Get(i);
8604 string recipeName = moduleRecipesManager.GetRecipeName(key);
8606 }
8607 }
8608
8609
8610 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8611 {
8612 super.GetDebugActions(outputList);
8613
8614
8619
8620
8624
8628
8629
8632
8633
8635 {
8638 }
8639
8641
8644
8648 }
8649
8650
8651
8652
8654 {
8655 super.OnAction(action_id, player, ctx);
8656 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8657 {
8658 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8659 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8660 PlayerBase p = PlayerBase.Cast(player);
8661 if (
EActions.RECIPES_RANGE_START < 1000)
8662 {
8663 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8664 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8665 }
8666 }
8667 #ifndef SERVER
8668 else if (action_id ==
EActions.WATCH_PLAYER)
8669 {
8670 PluginDeveloper.SetDeveloperItemClientEx(player);
8671 }
8672 #endif
8674 {
8675 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8676 {
8677 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8678 OnDebugButtonPressServer(id + 1);
8679 }
8680
8681 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8682 {
8683 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8685 }
8686
8687 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8688 {
8689 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8691 }
8692
8693 else if (action_id ==
EActions.ADD_QUANTITY)
8694 {
8695 if (IsMagazine())
8696 {
8697 Magazine mag = Magazine.Cast(this);
8698 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8699 }
8700 else
8701 {
8703 }
8704
8705 if (m_EM)
8706 {
8707 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8708 }
8709
8710 }
8711
8712 else if (action_id ==
EActions.REMOVE_QUANTITY)
8713 {
8714 if (IsMagazine())
8715 {
8716 Magazine mag2 = Magazine.Cast(this);
8717 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8718 }
8719 else
8720 {
8722 }
8723 if (m_EM)
8724 {
8725 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8726 }
8727
8728 }
8729
8730 else if (action_id ==
EActions.SET_QUANTITY_0)
8731 {
8733
8734 if (m_EM)
8735 {
8736 m_EM.SetEnergy(0);
8737 }
8738 }
8739
8740 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8741 {
8743
8744 if (m_EM)
8745 {
8746 m_EM.SetEnergy(m_EM.GetEnergyMax());
8747 }
8748 }
8749
8750 else if (action_id ==
EActions.ADD_HEALTH)
8751 {
8752 AddHealth("","",GetMaxHealth("","Health")/5);
8753 }
8754 else if (action_id ==
EActions.REMOVE_HEALTH)
8755 {
8756 AddHealth("","",-GetMaxHealth("","Health")/5);
8757 }
8758 else if (action_id ==
EActions.DESTROY_HEALTH)
8759 {
8760 SetHealth01("","",0);
8761 }
8762 else if (action_id ==
EActions.WATCH_ITEM)
8763 {
8765 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8766 #ifdef DEVELOPER
8767 SetDebugDeveloper_item(this);
8768 #endif
8769 }
8770
8771 else if (action_id ==
EActions.ADD_TEMPERATURE)
8772 {
8773 AddTemperature(20);
8774
8775 }
8776
8777 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8778 {
8779 AddTemperature(-20);
8780
8781 }
8782
8783 else if (action_id ==
EActions.FLIP_FROZEN)
8784 {
8785 SetFrozen(!GetIsFrozen());
8786
8787 }
8788
8789 else if (action_id ==
EActions.ADD_WETNESS)
8790 {
8792
8793 }
8794
8795 else if (action_id ==
EActions.REMOVE_WETNESS)
8796 {
8798
8799 }
8800
8801 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8802 {
8805
8806
8807 }
8808
8809 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8810 {
8813 }
8814
8815 else if (action_id ==
EActions.MAKE_SPECIAL)
8816 {
8817 auto debugParams = DebugSpawnParams.WithPlayer(player);
8818 OnDebugSpawnEx(debugParams);
8819 }
8820
8821 else if (action_id ==
EActions.DELETE)
8822 {
8823 Delete();
8824 }
8825
8826 }
8827
8828
8829 return false;
8830 }
8831
8832
8833
8834
8838
8841
8842
8843
8845 {
8846 return false;
8847 }
8848
8849
8851 {
8852 return true;
8853 }
8854
8855
8857 {
8858 return true;
8859 }
8860
8861
8862
8864 {
8865 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8867 }
8868
8871 {
8872 return null;
8873 }
8874
8876 {
8877 return false;
8878 }
8879
8881 {
8882 return false;
8883 }
8884
8888
8889
8891 {
8892 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8893 return module_repairing.CanRepair(this, item_repair_kit);
8894 }
8895
8896
8897 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8898 {
8899 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8900 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8901 }
8902
8903
8905 {
8906
8907
8908
8909
8910
8911
8912
8913
8914 return 1;
8915 }
8916
8917
8918
8920 {
8922 }
8923
8924
8925
8927 {
8929 }
8930
8931
8940 {
8941 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8942
8943 if (player)
8944 {
8945 player.MessageStatus(text);
8946 }
8947 }
8948
8949
8958 {
8959 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8960
8961 if (player)
8962 {
8963 player.MessageAction(text);
8964 }
8965 }
8966
8967
8976 {
8977 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8978
8979 if (player)
8980 {
8981 player.MessageFriendly(text);
8982 }
8983 }
8984
8985
8994 {
8995 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8996
8997 if (player)
8998 {
8999 player.MessageImportant(text);
9000 }
9001 }
9002
9004 {
9005 return true;
9006 }
9007
9008
9009 override bool KindOf(
string tag)
9010 {
9011 bool found = false;
9012 string item_name = this.
GetType();
9015
9016 int array_size = item_tag_array.Count();
9017 for (int i = 0; i < array_size; i++)
9018 {
9019 if (item_tag_array.Get(i) == tag)
9020 {
9021 found = true;
9022 break;
9023 }
9024 }
9025 return found;
9026 }
9027
9028
9030 {
9031
9032 super.OnRPC(sender, rpc_type,ctx);
9033
9034
9035 switch (rpc_type)
9036 {
9037 #ifndef SERVER
9038 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9039 Param2<bool, string> p = new Param2<bool, string>(false, "");
9040
9042 return;
9043
9044 bool play = p.param1;
9045 string soundSet = p.param2;
9046
9047 if (play)
9048 {
9050 {
9052 {
9054 }
9055 }
9056 else
9057 {
9059 }
9060 }
9061 else
9062 {
9064 }
9065
9066 break;
9067 #endif
9068
9069 }
9070
9072 {
9074 }
9075 }
9076
9077
9078
9079
9081 {
9082 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9083 return plugin.GetID(
name);
9084 }
9085
9087 {
9088 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9089 return plugin.GetName(id);
9090 }
9091
9094 {
9095
9096
9097 int varFlags;
9098 if (!ctx.
Read(varFlags))
9099 return;
9100
9101 if (varFlags & ItemVariableFlags.FLOAT)
9102 {
9104 }
9105 }
9106
9108 {
9109
9110 super.SerializeNumericalVars(floats_out);
9111
9112
9113
9115 {
9117 }
9118
9120 {
9122 }
9123
9125 {
9127 }
9128
9130 {
9135 }
9136
9138 {
9140 }
9141 }
9142
9144 {
9145
9146 super.DeSerializeNumericalVars(floats);
9147
9148
9149 int index = 0;
9150 int mask = Math.Round(floats.Get(index));
9151
9152 index++;
9153
9155 {
9157 {
9159 }
9160 else
9161 {
9162 float quantity = floats.Get(index);
9164 }
9165 index++;
9166 }
9167
9169 {
9170 float wet = floats.Get(index);
9172 index++;
9173 }
9174
9176 {
9177 int liquidtype = Math.Round(floats.Get(index));
9179 index++;
9180 }
9181
9183 {
9185 index++;
9187 index++;
9189 index++;
9191 index++;
9192 }
9193
9195 {
9196 int cleanness = Math.Round(floats.Get(index));
9198 index++;
9199 }
9200 }
9201
9203 {
9204 super.WriteVarsToCTX(ctx);
9205
9206
9208 {
9210 }
9211
9213 {
9215 }
9216
9218 {
9220 }
9221
9223 {
9224 int r,g,b,a;
9230 }
9231
9233 {
9235 }
9236 }
9237
9239 {
9240 if (!super.ReadVarsFromCTX(ctx,version))
9241 return false;
9242
9243 int intValue;
9244 float value;
9245
9246 if (version < 140)
9247 {
9248 if (!ctx.
Read(intValue))
9249 return false;
9250
9251 m_VariablesMask = intValue;
9252 }
9253
9255 {
9256 if (!ctx.
Read(value))
9257 return false;
9258
9260 {
9262 }
9263 else
9264 {
9266 }
9267 }
9268
9269 if (version < 140)
9270 {
9272 {
9273 if (!ctx.
Read(value))
9274 return false;
9275 SetTemperatureDirect(value);
9276 }
9277 }
9278
9280 {
9281 if (!ctx.
Read(value))
9282 return false;
9284 }
9285
9287 {
9288 if (!ctx.
Read(intValue))
9289 return false;
9291 }
9292
9294 {
9295 int r,g,b,a;
9297 return false;
9299 return false;
9301 return false;
9303 return false;
9304
9306 }
9307
9309 {
9310 if (!ctx.
Read(intValue))
9311 return false;
9313 }
9314
9315 if (version >= 138 && version < 140)
9316 {
9318 {
9319 if (!ctx.
Read(intValue))
9320 return false;
9321 SetFrozen(intValue);
9322 }
9323 }
9324
9325 return true;
9326 }
9327
9328
9330 {
9333 {
9335 }
9336
9337 if (!super.OnStoreLoad(ctx, version))
9338 {
9340 return false;
9341 }
9342
9343 if (version >= 114)
9344 {
9345 bool hasQuickBarIndexSaved;
9346
9347 if (!ctx.
Read(hasQuickBarIndexSaved))
9348 {
9350 return false;
9351 }
9352
9353 if (hasQuickBarIndexSaved)
9354 {
9355 int itmQBIndex;
9356
9357
9358 if (!ctx.
Read(itmQBIndex))
9359 {
9361 return false;
9362 }
9363
9364 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9365 if (itmQBIndex != -1 && parentPlayer)
9366 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9367 }
9368 }
9369 else
9370 {
9371
9372 PlayerBase player;
9373 int itemQBIndex;
9374 if (version ==
int.
MAX)
9375 {
9376 if (!ctx.
Read(itemQBIndex))
9377 {
9379 return false;
9380 }
9381 }
9382 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9383 {
9384
9385 if (!ctx.
Read(itemQBIndex))
9386 {
9388 return false;
9389 }
9390 if (itemQBIndex != -1 && player)
9391 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9392 }
9393 }
9394
9395 if (version < 140)
9396 {
9397
9398 if (!LoadVariables(ctx, version))
9399 {
9401 return false;
9402 }
9403 }
9404
9405
9407 {
9409 return false;
9410 }
9411 if (version >= 132)
9412 {
9414 if (raib)
9415 {
9417 {
9419 return false;
9420 }
9421 }
9422 }
9423
9425 return true;
9426 }
9427
9428
9429
9431 {
9432 super.OnStoreSave(ctx);
9433
9434 PlayerBase player;
9435 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9436 {
9438
9439 int itemQBIndex = -1;
9440 itemQBIndex = player.FindQuickBarEntityIndex(this);
9441 ctx.
Write(itemQBIndex);
9442 }
9443 else
9444 {
9446 }
9447
9449
9451 if (raib)
9452 {
9454 }
9455 }
9456
9457
9459 {
9460 super.AfterStoreLoad();
9461
9463 {
9465 }
9466
9468 {
9471 }
9472 }
9473
9475 {
9476 super.EEOnAfterLoad();
9477
9479 {
9481 }
9482
9485 }
9486
9488 {
9489 return false;
9490 }
9491
9492
9493
9495 {
9497 {
9498 #ifdef PLATFORM_CONSOLE
9499
9501 {
9503 if (menu)
9504 {
9506 }
9507 }
9508 #endif
9509 }
9510
9512 {
9515 }
9516
9518 {
9519 SetWeightDirty();
9521 }
9523 {
9526 }
9527
9529 {
9532 }
9534 {
9537 }
9538
9539 super.OnVariablesSynchronized();
9540 }
9541
9542
9543
9545 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9546 {
9547 if (!IsServerCheck(allow_client))
9548 return false;
9549
9551 return false;
9552
9555
9556 if (value <= (min + 0.001))
9557 value = min;
9558
9559 if (value == min)
9560 {
9561 if (destroy_config)
9562 {
9563 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9564 if (dstr)
9565 {
9567 this.Delete();
9568 return true;
9569 }
9570 }
9571 else if (destroy_forced)
9572 {
9574 this.Delete();
9575 return true;
9576 }
9577
9579 }
9580
9583
9585 {
9587
9588 if (delta)
9590 }
9591
9593
9594 return false;
9595 }
9596
9597
9599 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9600 {
9602 }
9603
9605 {
9608 }
9609
9611 {
9614 }
9615
9618 {
9619 float value_clamped = Math.Clamp(value, 0, 1);
9621 SetQuantity(result, destroy_config, destroy_forced);
9622 }
9623
9624
9627 {
9629 }
9630
9632 {
9634 }
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9646 {
9647 int slot = -1;
9648 if (GetInventory())
9649 {
9650 InventoryLocation il = new InventoryLocation;
9651 GetInventory().GetCurrentInventoryLocation(il);
9653 }
9654
9656 }
9657
9659 {
9660 float quantity_max = 0;
9661
9663 {
9664 if (attSlotID != -1)
9665 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9666
9667 if (quantity_max <= 0)
9669 }
9670
9671 if (quantity_max <= 0)
9673
9674 return quantity_max;
9675 }
9676
9678 {
9680 }
9681
9683 {
9685 }
9686
9687
9689 {
9691 }
9692
9694 {
9696 }
9697
9699 {
9701 }
9702
9703
9705 {
9706
9707 float weightEx = GetWeightEx();
9708 float special = GetInventoryAndCargoWeight();
9709 return weightEx - special;
9710 }
9711
9712
9714 {
9716 }
9717
9719 {
9721 {
9722 #ifdef DEVELOPER
9723 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9724 {
9725 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9727 }
9728 #endif
9729
9731 }
9732 else if (HasEnergyManager())
9733 {
9734 #ifdef DEVELOPER
9735 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9736 {
9737 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9738 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9739 }
9740 #endif
9741 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9742 }
9743 else
9744 {
9745 #ifdef DEVELOPER
9746 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9747 {
9748 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9749 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9750 }
9751 #endif
9752 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9753 }
9754 }
9755
9758 {
9759 int item_count = 0;
9761
9762 if (GetInventory().GetCargo() != NULL)
9763 {
9764 item_count = GetInventory().GetCargo().GetItemCount();
9765 }
9766
9767 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9768 {
9769 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9770 if (item)
9771 item_count += item.GetNumberOfItems();
9772 }
9773 return item_count;
9774 }
9775
9778 {
9779 float weight = 0;
9780 float wetness = 1;
9781 if (include_wetness)
9784 {
9785 weight = wetness * m_ConfigWeight;
9786 }
9788 {
9789 weight = 1;
9790 }
9791 return weight;
9792 }
9793
9794
9795
9797 {
9798 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9799 {
9800 GameInventory inv = GetInventory();
9801 array<EntityAI> items = new array<EntityAI>;
9803 for (int i = 0; i < items.Count(); i++)
9804 {
9806 if (item)
9807 {
9809 }
9810 }
9811 }
9812 }
9813
9814
9815
9816
9818 {
9819 float energy = 0;
9820 if (HasEnergyManager())
9821 {
9822 energy = GetCompEM().GetEnergy();
9823 }
9824 return energy;
9825 }
9826
9827
9829 {
9830 super.OnEnergyConsumed();
9831
9833 }
9834
9836 {
9837 super.OnEnergyAdded();
9838
9840 }
9841
9842
9844 {
9845 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9846 {
9848 {
9849 float energy_0to1 = GetCompEM().GetEnergy0To1();
9851 }
9852 }
9853 }
9854
9855
9857 {
9858 return ConfigGetFloat("heatIsolation");
9859 }
9860
9862 {
9864 }
9865
9867 {
9868 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9869 if (
GetGame().ConfigIsExisting(paramPath))
9871
9872 return 0.0;
9873 }
9874
9876 {
9877 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9878 if (
GetGame().ConfigIsExisting(paramPath))
9880
9881 return 0.0;
9882 }
9883
9884 override void SetWet(
float value,
bool allow_client =
false)
9885 {
9886 if (!IsServerCheck(allow_client))
9887 return;
9888
9891
9893
9894 m_VarWet = Math.Clamp(value, min, max);
9895
9897 {
9900 }
9901 }
9902
9903 override void AddWet(
float value)
9904 {
9906 }
9907
9909 {
9911 }
9912
9914 {
9916 }
9917
9919 {
9921 }
9922
9924 {
9926 }
9927
9929 {
9931 }
9932
9934 {
9937 if (newLevel != oldLevel)
9938 {
9940 }
9941 }
9942
9944 {
9945 SetWeightDirty();
9946 }
9947
9949 {
9950 return GetWetLevelInternal(
m_VarWet);
9951 }
9952
9953
9954
9956 {
9958 }
9959
9961 {
9963 }
9964
9966 {
9968 }
9969
9971 {
9973 }
9974
9975
9976
9978 {
9979 if (ConfigIsExisting("itemModelLength"))
9980 {
9981 return ConfigGetFloat("itemModelLength");
9982 }
9983 return 0;
9984 }
9985
9987 {
9988 if (ConfigIsExisting("itemAttachOffset"))
9989 {
9990 return ConfigGetFloat("itemAttachOffset");
9991 }
9992 return 0;
9993 }
9994
9995 override void SetCleanness(
int value,
bool allow_client =
false)
9996 {
9997 if (!IsServerCheck(allow_client))
9998 return;
9999
10001
10003
10006 }
10007
10009 {
10011 }
10012
10014 {
10015 return true;
10016 }
10017
10018
10019
10020
10022 {
10024 }
10025
10027 {
10029 }
10030
10031
10032
10033
10034 override void SetColor(
int r,
int g,
int b,
int a)
10035 {
10041 }
10043 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10044 {
10049 }
10050
10052 {
10054 }
10055
10058 {
10059 int r,g,b,a;
10061 r = r/255;
10062 g = g/255;
10063 b = b/255;
10064 a = a/255;
10065 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10066 }
10067
10068
10069
10070 override void SetLiquidType(
int value,
bool allow_client =
false)
10071 {
10072 if (!IsServerCheck(allow_client))
10073 return;
10074
10079 }
10080
10082 {
10083 return ConfigGetInt("varLiquidTypeInit");
10084 }
10085
10087 {
10089 }
10090
10092 {
10094 SetFrozen(false);
10095 }
10096
10099 {
10100 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10101 }
10102
10103
10106 {
10107 PlayerBase nplayer;
10108 if (PlayerBase.CastTo(nplayer, player))
10109 {
10111
10112 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10113 }
10114 }
10115
10116
10119 {
10120 PlayerBase nplayer;
10121 if (PlayerBase.CastTo(nplayer,player))
10122 {
10123
10124 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10125
10126 }
10127
10128
10129 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10130
10131
10132 if (HasEnergyManager())
10133 {
10134 GetCompEM().UpdatePlugState();
10135 }
10136 }
10137
10138
10140 {
10141 super.OnPlacementStarted(player);
10142
10144 }
10145
10146 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10147 {
10149 {
10150 m_AdminLog.OnPlacementComplete(player,
this);
10151 }
10152
10153 super.OnPlacementComplete(player, position, orientation);
10154 }
10155
10156
10157
10158
10159
10161 {
10163 {
10164 return true;
10165 }
10166 else
10167 {
10168 return false;
10169 }
10170 }
10171
10172
10174 {
10176 {
10178 }
10179 }
10180
10181
10183 {
10185 }
10186
10188 {
10190 }
10191
10192 override void InsertAgent(
int agent,
float count = 1)
10193 {
10194 if (count < 1)
10195 return;
10196
10198 }
10199
10202 {
10204 }
10205
10206
10208 {
10210 }
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10254 {
10256 return false;
10257 return true;
10258 }
10259
10261 {
10262
10264 }
10265
10266
10269 {
10270 super.CheckForRoofLimited(timeTresholdMS);
10271
10273 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10274 {
10275 m_PreviousRoofTestTime = time;
10276 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10277 }
10278 }
10279
10280
10282 {
10284 {
10285 return 0;
10286 }
10287
10288 if (GetInventory().GetAttachmentSlotsCount() != 0)
10289 {
10290 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10291 if (filter)
10292 return filter.GetProtectionLevel(type, false, system);
10293 else
10294 return 0;
10295 }
10296
10297 string subclassPath, entryName;
10298
10299 switch (type)
10300 {
10302 entryName = "biological";
10303 break;
10305 entryName = "chemical";
10306 break;
10307 default:
10308 entryName = "biological";
10309 break;
10310 }
10311
10312 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10313
10315 }
10316
10317
10318
10321 {
10322 if (!IsMagazine())
10324
10326 }
10327
10328
10329
10330
10331
10336 {
10337 return true;
10338 }
10339
10341 {
10343 }
10344
10345
10346
10347
10348
10350 {
10351 if (parent)
10352 {
10353 if (parent.IsInherited(DayZInfected))
10354 return true;
10355
10356 if (!parent.IsRuined())
10357 return true;
10358 }
10359
10360 return true;
10361 }
10362
10364 {
10365 if (!super.CanPutAsAttachment(parent))
10366 {
10367 return false;
10368 }
10369
10370 if (!IsRuined() && !parent.IsRuined())
10371 {
10372 return true;
10373 }
10374
10375 return false;
10376 }
10377
10379 {
10380
10381
10382
10383
10384 return super.CanReceiveItemIntoCargo(item);
10385 }
10386
10388 {
10389
10390
10391
10392
10393 GameInventory attachmentInv = attachment.GetInventory();
10395 {
10396 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10397 return false;
10398 }
10399
10400 InventoryLocation loc = new InventoryLocation();
10401 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10402 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10403 return false;
10404
10405 return super.CanReceiveAttachment(attachment, slotId);
10406 }
10407
10409 {
10410 if (!super.CanReleaseAttachment(attachment))
10411 return false;
10412
10413 return GetInventory().AreChildrenAccessible();
10414 }
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10437 {
10438 int id = muzzle_owner.GetMuzzleID();
10439 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10440
10441 if (WPOF_array)
10442 {
10443 for (int i = 0; i < WPOF_array.Count(); i++)
10444 {
10445 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10446
10447 if (WPOF)
10448 {
10449 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10450 }
10451 }
10452 }
10453 }
10454
10455
10457 {
10458 int id = muzzle_owner.GetMuzzleID();
10460
10461 if (WPOBE_array)
10462 {
10463 for (int i = 0; i < WPOBE_array.Count(); i++)
10464 {
10465 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10466
10467 if (WPOBE)
10468 {
10469 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10470 }
10471 }
10472 }
10473 }
10474
10475
10477 {
10478 int id = muzzle_owner.GetMuzzleID();
10479 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10480
10481 if (WPOOH_array)
10482 {
10483 for (int i = 0; i < WPOOH_array.Count(); i++)
10484 {
10485 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10486
10487 if (WPOOH)
10488 {
10489 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10490 }
10491 }
10492 }
10493 }
10494
10495
10497 {
10498 int id = muzzle_owner.GetMuzzleID();
10499 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10500
10501 if (WPOOH_array)
10502 {
10503 for (int i = 0; i < WPOOH_array.Count(); i++)
10504 {
10505 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10506
10507 if (WPOOH)
10508 {
10509 WPOOH.OnUpdate(weapon, 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.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10530 }
10531 }
10532 }
10533 }
10534
10535
10536
10538 {
10540 {
10541 return true;
10542 }
10543
10544 return false;
10545 }
10546
10548 {
10550 {
10551 return true;
10552 }
10553
10554 return false;
10555 }
10556
10558 {
10560 {
10561 return true;
10562 }
10563
10564 return false;
10565 }
10566
10568 {
10569 return false;
10570 }
10571
10574 {
10575 return UATimeSpent.DEFAULT_DEPLOY;
10576 }
10577
10578
10579
10580
10582 {
10584 SetSynchDirty();
10585 }
10586
10588 {
10590 }
10591
10592
10594 {
10595 return false;
10596 }
10597
10600 {
10601 string att_type = "None";
10602
10603 if (ConfigIsExisting("soundAttType"))
10604 {
10605 att_type = ConfigGetString("soundAttType");
10606 }
10607
10609 }
10610
10612 {
10614 }
10615
10616
10617
10618
10619
10623
10625 {
10628
10630 }
10631
10632
10634 {
10636 return;
10637
10639
10642
10645
10646 SoundParameters params = new SoundParameters();
10650 }
10651
10652
10654 {
10656 return;
10657
10659 SetSynchDirty();
10660
10663 }
10664
10665
10667 {
10669 return;
10670
10672 SetSynchDirty();
10673
10676 }
10677
10679 {
10681 }
10682
10684 {
10686 }
10687
10690 {
10691 if (!
GetGame().IsDedicatedServer())
10692 {
10693 if (ConfigIsExisting("attachSoundSet"))
10694 {
10695 string cfg_path = "";
10696 string soundset = "";
10697 string type_name =
GetType();
10698
10701 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10702 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10703
10704 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10705 {
10706 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10707 {
10708 if (cfg_slot_array[i] == slot_type)
10709 {
10710 soundset = cfg_soundset_array[i];
10711 break;
10712 }
10713 }
10714 }
10715
10716 if (soundset != "")
10717 {
10718 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10720 }
10721 }
10722 }
10723 }
10724
10726 {
10727
10728 }
10729
10730 void OnApply(PlayerBase player);
10731
10733 {
10734 return 1.0;
10735 };
10736
10738 {
10740 }
10741
10743 {
10745 }
10746
10748
10750 {
10751 SetDynamicPhysicsLifeTime(0.01);
10753 }
10754
10756 {
10757 array<string> zone_names = new array<string>;
10758 GetDamageZones(zone_names);
10759 for (int i = 0; i < zone_names.Count(); i++)
10760 {
10761 SetHealthMax(zone_names.Get(i),"Health");
10762 }
10763 SetHealthMax("","Health");
10764 }
10765
10768 {
10769 float global_health = GetHealth01("","Health");
10770 array<string> zones = new array<string>;
10771 GetDamageZones(zones);
10772
10773 for (int i = 0; i < zones.Count(); i++)
10774 {
10775 SetHealth01(zones.Get(i),"Health",global_health);
10776 }
10777 }
10778
10781 {
10782 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10783 }
10784
10786 {
10787 if (!hasRootAsPlayer)
10788 {
10789 if (refParentIB)
10790 {
10791
10792 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10793 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10794
10795 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10796 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10797
10800 }
10801 else
10802 {
10803
10806 }
10807 }
10808 }
10809
10811 {
10813 {
10814 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10815 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10816 {
10817 float heatPermCoef = 1.0;
10819 while (ent)
10820 {
10821 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10822 ent = ent.GetHierarchyParent();
10823 }
10824
10825 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10826 }
10827 }
10828 }
10829
10831 {
10832
10833 EntityAI parent = GetHierarchyParent();
10834 if (!parent)
10835 {
10836 hasParent = false;
10837 hasRootAsPlayer = false;
10838 }
10839 else
10840 {
10841 hasParent = true;
10842 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10843 refParentIB =
ItemBase.Cast(parent);
10844 }
10845 }
10846
10847 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10848 {
10849
10850 }
10851
10853 {
10854
10855 return false;
10856 }
10857
10859 {
10860
10861
10862 return false;
10863 }
10864
10866 {
10867
10868 return false;
10869 }
10870
10873 {
10874 return !GetIsFrozen() &&
IsOpen();
10875 }
10876
10878 {
10879 bool hasParent = false, hasRootAsPlayer = false;
10881
10882 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10883 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10884
10885 if (wwtu || foodDecay)
10886 {
10890
10891 if (processWetness || processTemperature || processDecay)
10892 {
10894
10895 if (processWetness)
10896 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10897
10898 if (processTemperature)
10900
10901 if (processDecay)
10902 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10903 }
10904 }
10905 }
10906
10909 {
10911 }
10912
10914 {
10917
10918 return super.GetTemperatureFreezeThreshold();
10919 }
10920
10922 {
10925
10926 return super.GetTemperatureThawThreshold();
10927 }
10928
10930 {
10933
10934 return super.GetItemOverheatThreshold();
10935 }
10936
10938 {
10940 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10941
10942 return super.GetTemperatureFreezeTime();
10943 }
10944
10946 {
10948 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10949
10950 return super.GetTemperatureThawTime();
10951 }
10952
10957
10959 {
10960 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10961 }
10962
10964 {
10965 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10966 }
10967
10970 {
10972 }
10973
10975 {
10977 }
10978
10980 {
10982 }
10983
10986 {
10987 return null;
10988 }
10989
10992 {
10993 return false;
10994 }
10995
10997 {
10999 {
11002 if (!trg)
11003 {
11005 explosive = this;
11006 }
11007
11008 explosive.PairRemote(trg);
11010
11011 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11012 trg.SetPersistentPairID(persistentID);
11013 explosive.SetPersistentPairID(persistentID);
11014
11015 return true;
11016 }
11017 return false;
11018 }
11019
11022 {
11023 float ret = 1.0;
11026 ret *= GetHealth01();
11027
11028 return ret;
11029 }
11030
11031 #ifdef DEVELOPER
11032 override void SetDebugItem()
11033 {
11034 super.SetDebugItem();
11035 _itemBase = this;
11036 }
11037
11039 {
11040 string text = super.GetDebugText();
11041
11043 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11044
11045 return text;
11046 }
11047 #endif
11048
11050 {
11051 return true;
11052 }
11053
11055
11057
11059 {
11062 }
11063
11064
11072
11088}
11089
11091{
11093 if (entity)
11094 {
11095 bool is_item = entity.IsInherited(
ItemBase);
11096 if (is_item && full_quantity)
11097 {
11100 }
11101 }
11102 else
11103 {
11105 return NULL;
11106 }
11107 return entity;
11108}
11109
11111{
11112 if (item)
11113 {
11114 if (health > 0)
11115 item.SetHealth("", "", health);
11116
11117 if (item.CanHaveTemperature())
11118 {
11120 if (item.CanFreeze())
11121 item.SetFrozen(false);
11122 }
11123
11124 if (item.HasEnergyManager())
11125 {
11126 if (quantity >= 0)
11127 {
11128 item.GetCompEM().SetEnergy0To1(quantity);
11129 }
11130 else
11131 {
11133 }
11134 }
11135 else if (item.IsMagazine())
11136 {
11137 Magazine mag = Magazine.Cast(item);
11138 if (quantity >= 0)
11139 {
11140 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11141 }
11142 else
11143 {
11145 }
11146
11147 }
11148 else
11149 {
11150 if (quantity >= 0)
11151 {
11152 item.SetQuantityNormalized(quantity, false);
11153 }
11154 else
11155 {
11157 }
11158
11159 }
11160 }
11161}
11162
11163#ifdef DEVELOPER
11165#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.