6360{
6362 {
6363 return true;
6364 }
6365};
6366
6367
6368
6370{
6374
6376
6379
6380
6381
6382
6383
6392
6398
6403
6408
6429 protected bool m_IsResultOfSplit
6430
6432
6437
6438
6439
6441
6445
6446
6447
6449
6452
6453
6454
6460
6461
6469
6472
6473
6475
6476
6478
6479
6484
6485
6490
6491
6493
6494
6496 {
6501
6502 if (!
GetGame().IsDedicatedServer())
6503 {
6505 {
6507
6509 {
6511 }
6512 }
6513
6516 }
6517
6518 m_OldLocation = null;
6519
6521 {
6523 }
6524
6525 if (ConfigIsExisting("headSelectionsToHide"))
6526 {
6529 }
6530
6532 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6533 {
6535 }
6536
6538
6539 m_IsResultOfSplit = false;
6540
6542 }
6543
6545 {
6546 super.InitItemVariables();
6547
6553 m_Count = ConfigGetInt(
"count");
6554
6557
6562
6565
6570
6582
6586
6587
6590 if (ConfigIsExisting("canBeSplit"))
6591 {
6594 }
6595
6597 if (ConfigIsExisting("itemBehaviour"))
6599
6600
6603 RegisterNetSyncVariableInt("m_VarLiquidType");
6604 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6605
6606 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6607 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6608 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6609
6610 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6611 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6612 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6613 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6614
6615 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6616 RegisterNetSyncVariableBool("m_IsTakeable");
6617 RegisterNetSyncVariableBool("m_IsHologram");
6618
6621 {
6624 }
6625
6627
6629 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6631
6632 }
6633
6635 {
6637 }
6638
6640 {
6643 {
6648 }
6649 }
6650
6651 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6652 {
6654 {
6657 }
6658
6660 }
6661
6663 {
6669 }
6670
6672
6674 {
6676
6677 if (!action)
6678 {
6679 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6680 return;
6681 }
6682
6684 if (!ai)
6685 {
6687 return;
6688 }
6689
6691 if (!action_array)
6692 {
6693 action_array = new array<ActionBase_Basic>;
6695 }
6696 if (LogManager.IsActionLogEnable())
6697 {
6698 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6699 }
6700
6701 if (action_array.Find(action) != -1)
6702 {
6703 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6704 }
6705 else
6706 {
6707 action_array.Insert(action);
6708 }
6709 }
6710
6712 {
6714 ActionBase action = player.GetActionManager().GetAction(actionName);
6717
6718 if (action_array)
6719 {
6720 action_array.RemoveItem(action);
6721 }
6722 }
6723
6724
6725
6727 {
6728 ActionOverrideData overrideData = new ActionOverrideData();
6732
6734 if (!actionMap)
6735 {
6738 }
6739
6740 actionMap.Insert(this.
Type(), overrideData);
6741
6742 }
6743
6745
6747
6748
6750 {
6753
6756
6757 string config_to_search = "CfgVehicles";
6758 string muzzle_owner_config;
6759
6761 {
6762 if (IsInherited(Weapon))
6763 config_to_search = "CfgWeapons";
6764
6765 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6766
6767 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6768
6770
6771 if (config_OnFire_subclass_count > 0)
6772 {
6773 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6774
6775 for (int i = 0; i < config_OnFire_subclass_count; i++)
6776 {
6777 string particle_class = "";
6779 string config_OnFire_entry = config_OnFire_class + particle_class;
6780 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6781 WPOF_array.Insert(WPOF);
6782 }
6783
6784
6786 }
6787 }
6788
6790 {
6791 config_to_search = "CfgWeapons";
6792 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6793
6794 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6795
6797
6798 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6799 {
6800 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6801
6802 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6803 {
6804 string particle_class2 = "";
6806 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6807 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6808 WPOBE_array.Insert(WPOBE);
6809 }
6810
6811
6813 }
6814 }
6815 }
6816
6817
6819 {
6822
6824 {
6825 string config_to_search = "CfgVehicles";
6826
6827 if (IsInherited(Weapon))
6828 config_to_search = "CfgWeapons";
6829
6830 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6831 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6832
6833 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6834 {
6835
6837
6839 {
6841 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6843 return;
6844 }
6845
6848
6849
6850
6852 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6853
6854 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6855 {
6856 string particle_class = "";
6858 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6860
6861 if (entry_type == CT_CLASS)
6862 {
6863 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6864 WPOOH_array.Insert(WPOF);
6865 }
6866 }
6867
6868
6870 }
6871 }
6872 }
6873
6875 {
6877 }
6878
6880 {
6882 {
6884
6887
6890
6891 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6892 }
6893 }
6894
6896 {
6898 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6899
6901 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6902
6904 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6905
6907 {
6909 }
6910 }
6911
6913 {
6915 }
6916
6918 {
6921 else
6923
6925 {
6928 }
6929 else
6930 {
6933
6936 }
6937
6939 }
6940
6942 {
6944 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6945 }
6946
6948 {
6950 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6952 }
6953
6955 {
6957 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6958 }
6959
6961 {
6964
6965 OverheatingParticle OP = new OverheatingParticle();
6970
6972 }
6973
6975 {
6978
6979 return -1;
6980 }
6981
6983 {
6985 {
6988
6989 for (int i = count; i > 0; --i)
6990 {
6991 int id = i - 1;
6994
6997
6998 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6999 {
7000 if (p)
7001 {
7004 }
7005 }
7006 }
7007 }
7008 }
7009
7011 {
7013 {
7015 {
7016 int id = i - 1;
7018
7019 if (OP)
7020 {
7022
7023 if (p)
7024 {
7026 }
7027
7028 delete OP;
7029 }
7030 }
7031
7034 }
7035 }
7036
7039 {
7040 return 0.0;
7041 }
7042
7043
7045 {
7046 return 250;
7047 }
7048
7050 {
7051 return 0;
7052 }
7053
7056 {
7058 return true;
7059
7060 return false;
7061 }
7062
7065 {
7068
7070 {
7072 }
7073 else
7074 {
7075
7077 }
7078
7080 }
7081
7088 {
7089 return -1;
7090 }
7091
7092
7093
7094
7096 {
7098 {
7100 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7101
7102 if (r_index >= 0)
7103 {
7104 InventoryLocation r_il = new InventoryLocation;
7105 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7106
7107 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7110 {
7111 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7112 }
7114 {
7115 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7116 }
7117
7118 }
7119
7120 player.GetHumanInventory().ClearUserReservedLocation(this);
7121 }
7122
7125 }
7126
7127
7128
7129
7131 {
7132 return ItemBase.m_DebugActionsMask;
7133 }
7134
7136 {
7137 return ItemBase.m_DebugActionsMask & mask;
7138 }
7139
7141 {
7142 ItemBase.m_DebugActionsMask = mask;
7143 }
7144
7146 {
7147 ItemBase.m_DebugActionsMask |= mask;
7148 }
7149
7151 {
7152 ItemBase.m_DebugActionsMask &= ~mask;
7153 }
7154
7156 {
7158 {
7160 }
7161 else
7162 {
7164 }
7165 }
7166
7167
7169 {
7170 if (GetEconomyProfile())
7171 {
7172 float q_max = GetEconomyProfile().GetQuantityMax();
7173 if (q_max > 0)
7174 {
7175 float q_min = GetEconomyProfile().GetQuantityMin();
7176 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7177
7179 {
7180 ComponentEnergyManager comp = GetCompEM();
7182 {
7184 }
7185 }
7187 {
7189
7190 }
7191
7192 }
7193 }
7194 }
7195
7198 {
7199 EntityAI parent = GetHierarchyParent();
7200
7201 if (parent)
7202 {
7203 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7204 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7205 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7206 }
7207 }
7208
7211 {
7212 EntityAI parent = GetHierarchyParent();
7213
7214 if (parent)
7215 {
7216 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7217 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7218 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7219 }
7220 }
7221
7223 {
7224
7225
7226
7227
7229
7231 {
7232 if (ScriptInputUserData.CanStoreInputUserData())
7233 {
7234 ScriptInputUserData ctx = new ScriptInputUserData;
7240 ctx.
Write(use_stack_max);
7243
7245 {
7246 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7247 }
7248 }
7249 }
7250 else if (!
GetGame().IsMultiplayer())
7251 {
7253 }
7254 }
7255
7257 {
7259 }
7260
7262 {
7264 }
7265
7267 {
7269 }
7270
7272 {
7273
7274 return false;
7275 }
7276
7278 {
7279 return false;
7280 }
7281
7285 {
7286 return false;
7287 }
7288
7290 {
7291 return "";
7292 }
7293
7295
7297 {
7298 return false;
7299 }
7300
7302 {
7303 return true;
7304 }
7305
7306
7307
7309 {
7310 return true;
7311 }
7312
7314 {
7315 return true;
7316 }
7317
7319 {
7320 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7322 }
7323
7325 {
7327 }
7328
7330 {
7332 if (!is_being_placed)
7334 SetSynchDirty();
7335 }
7336
7337
7339
7341 {
7343 }
7344
7346 {
7348 }
7349
7351 {
7352 return 1;
7353 }
7354
7356 {
7357 return false;
7358 }
7359
7361 {
7363 SetSynchDirty();
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
7392
7393
7394
7395
7396
7397
7398
7399
7401 {
7402 super.OnMovedInsideCargo(container);
7403
7404 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7405 }
7406
7407 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7408 {
7409 super.EEItemLocationChanged(oldLoc,newLoc);
7410
7411 PlayerBase new_player = null;
7412 PlayerBase old_player = null;
7413
7414 if (newLoc.GetParent())
7415 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7416
7417 if (oldLoc.GetParent())
7418 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7419
7421 {
7422 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7423
7424 if (r_index >= 0)
7425 {
7426 InventoryLocation r_il = new InventoryLocation;
7427 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7428
7429 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7432 {
7433 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7434 }
7436 {
7437 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7438 }
7439
7440 }
7441 }
7442
7444 {
7445 if (new_player)
7446 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7447
7448 if (new_player == old_player)
7449 {
7450
7451 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7452 {
7454 {
7455 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7456 {
7457 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7458 }
7459 }
7460 else
7461 {
7462 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7463 }
7464 }
7465
7466 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7467 {
7468 int type = oldLoc.GetType();
7470 {
7471 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7472 }
7474 {
7475 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7476 }
7477 }
7478 if (!m_OldLocation)
7479 {
7480 m_OldLocation = new InventoryLocation;
7481 }
7482 m_OldLocation.Copy(oldLoc);
7483 }
7484 else
7485 {
7486 if (m_OldLocation)
7487 {
7488 m_OldLocation.Reset();
7489 }
7490 }
7491
7493 }
7494 else
7495 {
7496 if (new_player)
7497 {
7498 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7499 if (res_index >= 0)
7500 {
7501 InventoryLocation il = new InventoryLocation;
7502 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7504 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7507 {
7508 il.
GetParent().GetOnReleaseLock().Invoke(it);
7509 }
7511 {
7513 }
7514
7515 }
7516 }
7518 {
7519
7521 }
7522
7523 if (m_OldLocation)
7524 {
7525 m_OldLocation.Reset();
7526 }
7527 }
7528 }
7529
7530 override void EOnContact(IEntity other, Contact extra)
7531 {
7533 {
7534 int liquidType = -1;
7536 if (impactSpeed > 0.0)
7537 {
7539 #ifndef SERVER
7541 #else
7543 SetSynchDirty();
7544 #endif
7546 }
7547 }
7548
7549 #ifdef SERVER
7550 if (GetCompEM() && GetCompEM().IsPlugged())
7551 {
7552 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7553 GetCompEM().UnplugThis();
7554 }
7555 #endif
7556 }
7557
7559
7561 {
7563 }
7564
7566 {
7567
7568 }
7569
7571 {
7572 super.OnItemLocationChanged(old_owner, new_owner);
7573
7574 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7575 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7576
7577 if (!relatedPlayer && playerNew)
7578 relatedPlayer = playerNew;
7579
7580 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7581 {
7583 if (actionMgr)
7584 {
7585 ActionBase currentAction = actionMgr.GetRunningAction();
7586 if (currentAction)
7588 }
7589 }
7590
7591 Man ownerPlayerOld = null;
7592 Man ownerPlayerNew = null;
7593
7594 if (old_owner)
7595 {
7596 if (old_owner.
IsMan())
7597 {
7598 ownerPlayerOld = Man.Cast(old_owner);
7599 }
7600 else
7601 {
7602 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7603 }
7604 }
7605 else
7606 {
7608 {
7610
7611 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7612 {
7613 GetCompEM().UnplugThis();
7614 }
7615 }
7616 }
7617
7618 if (new_owner)
7619 {
7620 if (new_owner.
IsMan())
7621 {
7622 ownerPlayerNew = Man.Cast(new_owner);
7623 }
7624 else
7625 {
7626 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7627 }
7628 }
7629
7630 if (ownerPlayerOld != ownerPlayerNew)
7631 {
7632 if (ownerPlayerOld)
7633 {
7634 array<EntityAI> subItemsExit = new array<EntityAI>;
7636 for (int i = 0; i < subItemsExit.Count(); i++)
7637 {
7640 }
7641 }
7642
7643 if (ownerPlayerNew)
7644 {
7645 array<EntityAI> subItemsEnter = new array<EntityAI>;
7647 for (int j = 0; j < subItemsEnter.Count(); j++)
7648 {
7651 }
7652 }
7653 }
7654 else if (ownerPlayerNew != null)
7655 {
7656 PlayerBase nplayer;
7657 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7658 {
7659 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7661 for (int k = 0; k < subItemsUpdate.Count(); k++)
7662 {
7664 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7665 }
7666 }
7667 }
7668
7669 if (old_owner)
7670 old_owner.OnChildItemRemoved(this);
7671 if (new_owner)
7672 new_owner.OnChildItemReceived(this);
7673 }
7674
7675
7677 {
7678 super.EEDelete(parent);
7679 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7680 if (player)
7681 {
7683
7684 if (player.IsAlive())
7685 {
7686 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7687 if (r_index >= 0)
7688 {
7689 InventoryLocation r_il = new InventoryLocation;
7690 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7691
7692 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7695 {
7696 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7697 }
7699 {
7700 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7701 }
7702
7703 }
7704
7705 player.RemoveQuickBarEntityShortcut(this);
7706 }
7707 }
7708 }
7709
7711 {
7712 super.EEKilled(killer);
7713
7716 {
7717 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7718 {
7719 if (IsMagazine())
7720 {
7721 if (Magazine.Cast(this).GetAmmoCount() > 0)
7722 {
7724 }
7725 }
7726 else
7727 {
7729 }
7730 }
7731 }
7732 }
7733
7735 {
7736 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7737
7738 super.OnWasAttached(parent, slot_id);
7739
7742
7744 }
7745
7747 {
7748 super.OnWasDetached(parent, slot_id);
7749
7752 }
7753
7755 {
7756 int idx;
7759
7760 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7761 if (inventory_slots.Count() < 1)
7762 {
7763 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7764 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7765 }
7766 else
7767 {
7768 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7769 }
7770
7771 idx = inventory_slots.Find(slot);
7772 if (idx < 0)
7773 return "";
7774
7775 return attach_types.Get(idx);
7776 }
7777
7779 {
7780 int idx = -1;
7781 string slot;
7782
7785
7786 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7787 if (inventory_slots.Count() < 1)
7788 {
7789 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7790 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7791 }
7792 else
7793 {
7794 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7795 if (detach_types.Count() < 1)
7796 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7797 }
7798
7799 for (int i = 0; i < inventory_slots.Count(); i++)
7800 {
7801 slot = inventory_slots.Get(i);
7802 }
7803
7804 if (slot != "")
7805 {
7806 if (detach_types.Count() == 1)
7807 idx = 0;
7808 else
7809 idx = inventory_slots.Find(slot);
7810 }
7811 if (idx < 0)
7812 return "";
7813
7814 return detach_types.Get(idx);
7815 }
7816
7818 {
7819
7821
7822
7823 float min_time = 1;
7824 float max_time = 3;
7825 float delay = Math.RandomFloat(min_time, max_time);
7826
7827 explode_timer.Run(delay, this, "DoAmmoExplosion");
7828 }
7829
7831 {
7832 Magazine magazine = Magazine.Cast(this);
7833 int pop_sounds_count = 6;
7834 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7835
7836
7837 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7838 string sound_name = pop_sounds[ sound_idx ];
7840
7841
7842 magazine.ServerAddAmmoCount(-1);
7843
7844
7845 float min_temp_to_explode = 100;
7846
7847 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7848 {
7850 }
7851 }
7852
7853
7854 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7855 {
7856 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7857
7858 const int CHANCE_DAMAGE_CARGO = 4;
7859 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7860 const int CHANCE_DAMAGE_NOTHING = 2;
7861
7863 {
7864 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7865 int chances;
7866 int rnd;
7867
7868 if (GetInventory().GetCargo())
7869 {
7870 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7871 rnd = Math.RandomInt(0,chances);
7872
7873 if (rnd < CHANCE_DAMAGE_CARGO)
7874 {
7876 }
7877 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7878 {
7880 }
7881 }
7882 else
7883 {
7884 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7885 rnd = Math.RandomInt(0,chances);
7886
7887 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7888 {
7890 }
7891 }
7892 }
7893 }
7894
7896 {
7897 if (GetInventory().GetCargo())
7898 {
7899 int item_count = GetInventory().GetCargo().GetItemCount();
7900 if (item_count > 0)
7901 {
7902 int random_pick = Math.RandomInt(0, item_count);
7904 if (!item.IsExplosive())
7905 {
7906 item.AddHealth("","",damage);
7907 return true;
7908 }
7909 }
7910 }
7911 return false;
7912 }
7913
7915 {
7916 int attachment_count = GetInventory().AttachmentCount();
7917 if (attachment_count > 0)
7918 {
7919 int random_pick = Math.RandomInt(0, attachment_count);
7920 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7921 if (!attachment.IsExplosive())
7922 {
7923 attachment.AddHealth("","",damage);
7924 return true;
7925 }
7926 }
7927 return false;
7928 }
7929
7931 {
7933 }
7934
7936 {
7938 return GetInventory().CanRemoveEntity();
7939
7940 return false;
7941 }
7942
7944 {
7946 return;
7947
7949 {
7950 if (ScriptInputUserData.CanStoreInputUserData())
7951 {
7952 ScriptInputUserData ctx = new ScriptInputUserData;
7957 ctx.
Write(destination_entity);
7961 }
7962 }
7963 else if (!
GetGame().IsMultiplayer())
7964 {
7966 }
7967 }
7968
7970 {
7972 return;
7973
7974 float split_quantity_new;
7978 InventoryLocation loc = new InventoryLocation;
7979
7980 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7981 {
7983 split_quantity_new = stack_max;
7984 else
7986
7987 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7988 if (new_item)
7989 {
7990 new_item.SetResultOfSplit(true);
7991 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7993 new_item.SetQuantity(split_quantity_new);
7994 }
7995 }
7996 else if (destination_entity && slot_id == -1)
7997 {
7998 if (quantity > stack_max)
7999 split_quantity_new = stack_max;
8000 else
8001 split_quantity_new = quantity;
8002
8004 {
8007 }
8008
8009 if (new_item)
8010 {
8011 new_item.SetResultOfSplit(true);
8012 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8014 new_item.SetQuantity(split_quantity_new);
8015 }
8016 }
8017 else
8018 {
8019 if (stack_max != 0)
8020 {
8022 {
8024 }
8025
8026 if (split_quantity_new == 0)
8027 {
8028 if (!
GetGame().IsMultiplayer())
8029 player.PhysicalPredictiveDropItem(this);
8030 else
8031 player.ServerDropEntity(this);
8032 return;
8033 }
8034
8036
8037 if (new_item)
8038 {
8039 new_item.SetResultOfSplit(true);
8040 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8042 new_item.SetQuantity(stack_max);
8043 new_item.PlaceOnSurface();
8044 }
8045 }
8046 }
8047 }
8048
8050 {
8052 return;
8053
8054 float split_quantity_new;
8058 InventoryLocation loc = new InventoryLocation;
8059
8060 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8061 {
8063 split_quantity_new = stack_max;
8064 else
8066
8067 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8068 if (new_item)
8069 {
8070 new_item.SetResultOfSplit(true);
8071 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8073 new_item.SetQuantity(split_quantity_new);
8074 }
8075 }
8076 else if (destination_entity && slot_id == -1)
8077 {
8078 if (quantity > stack_max)
8079 split_quantity_new = stack_max;
8080 else
8081 split_quantity_new = quantity;
8082
8084 {
8087 }
8088
8089 if (new_item)
8090 {
8091 new_item.SetResultOfSplit(true);
8092 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8094 new_item.SetQuantity(split_quantity_new);
8095 }
8096 }
8097 else
8098 {
8099 if (stack_max != 0)
8100 {
8102 {
8104 }
8105
8107
8108 if (new_item)
8109 {
8110 new_item.SetResultOfSplit(true);
8111 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8113 new_item.SetQuantity(stack_max);
8114 new_item.PlaceOnSurface();
8115 }
8116 }
8117 }
8118 }
8119
8121 {
8123 return;
8124
8126 {
8127 if (ScriptInputUserData.CanStoreInputUserData())
8128 {
8129 ScriptInputUserData ctx = new ScriptInputUserData;
8134 dst.WriteToContext(ctx);
8136 }
8137 }
8138 else if (!
GetGame().IsMultiplayer())
8139 {
8141 }
8142 }
8143
8145 {
8147 return;
8148
8150 {
8151 if (ScriptInputUserData.CanStoreInputUserData())
8152 {
8153 ScriptInputUserData ctx = new ScriptInputUserData;
8158 ctx.
Write(destination_entity);
8164 }
8165 }
8166 else if (!
GetGame().IsMultiplayer())
8167 {
8169 }
8170 }
8171
8173 {
8175 }
8176
8178 {
8180 return this;
8181
8183 float split_quantity_new;
8185 if (dst.IsValid())
8186 {
8187 int slot_id = dst.GetSlot();
8189
8190 if (quantity > stack_max)
8191 split_quantity_new = stack_max;
8192 else
8193 split_quantity_new = quantity;
8194
8196
8197 if (new_item)
8198 {
8199 new_item.SetResultOfSplit(true);
8200 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8203 }
8204
8205 return new_item;
8206 }
8207
8208 return null;
8209 }
8210
8212 {
8214 return;
8215
8217 float split_quantity_new;
8219 if (destination_entity)
8220 {
8222 if (quantity > stackable)
8223 split_quantity_new = stackable;
8224 else
8225 split_quantity_new = quantity;
8226
8227 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8228 if (new_item)
8229 {
8230 new_item.SetResultOfSplit(true);
8231 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8233 new_item.SetQuantity(split_quantity_new);
8234 }
8235 }
8236 }
8237
8239 {
8241 return;
8242
8244 {
8245 if (ScriptInputUserData.CanStoreInputUserData())
8246 {
8247 ScriptInputUserData ctx = new ScriptInputUserData;
8252 ItemBase destination_entity =
this;
8253 ctx.
Write(destination_entity);
8257 }
8258 }
8259 else if (!
GetGame().IsMultiplayer())
8260 {
8262 }
8263 }
8264
8266 {
8268 return;
8269
8271 float split_quantity_new;
8273 if (player)
8274 {
8276 if (quantity > stackable)
8277 split_quantity_new = stackable;
8278 else
8279 split_quantity_new = quantity;
8280
8281 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8282 new_item =
ItemBase.Cast(in_hands);
8283 if (new_item)
8284 {
8285 new_item.SetResultOfSplit(true);
8286 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8288 new_item.SetQuantity(split_quantity_new);
8289 }
8290 }
8291 }
8292
8294 {
8296 return;
8297
8299 float split_quantity_new = Math.Floor(quantity * 0.5);
8300
8302
8303 if (new_item)
8304 {
8305 if (new_item.GetQuantityMax() < split_quantity_new)
8306 {
8307 split_quantity_new = new_item.GetQuantityMax();
8308 }
8309
8310 new_item.SetResultOfSplit(true);
8311 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8312
8314 {
8317 }
8318 else
8319 {
8322 }
8323 }
8324 }
8325
8327 {
8329 return;
8330
8332 float split_quantity_new = Math.Floor(quantity / 2);
8333
8334 InventoryLocation invloc = new InventoryLocation;
8336
8338 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8339
8340 if (new_item)
8341 {
8342 if (new_item.GetQuantityMax() < split_quantity_new)
8343 {
8344 split_quantity_new = new_item.GetQuantityMax();
8345 }
8347 {
8350 }
8351 else
8352 {
8355 }
8356 }
8357 }
8358
8361 {
8362 SetWeightDirty();
8364
8365 if (parent)
8366 parent.OnAttachmentQuantityChangedEx(this, delta);
8367
8369 {
8371 {
8373 }
8375 {
8376 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8378 }
8379 }
8380
8381 }
8382
8385 {
8386
8387 }
8388
8391 {
8393 }
8394
8396 {
8397 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8398
8400 {
8401 if (newLevel == GameConstants.STATE_RUINED)
8402 {
8404 EntityAI parent = GetHierarchyParent();
8405 if (parent && parent.IsFireplace())
8406 {
8407 CargoBase cargo = GetInventory().GetCargo();
8408 if (cargo)
8409 {
8411 {
8413 }
8414 }
8415 }
8416 }
8417
8419 {
8420
8422 return;
8423 }
8424
8425 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8426 {
8428 }
8429 }
8430 }
8431
8432
8434 {
8435 super.OnRightClick();
8436
8438 {
8440 {
8441 if (ScriptInputUserData.CanStoreInputUserData())
8442 {
8443 vector m4[4];
8445
8446 EntityAI root = GetHierarchyRoot();
8447
8448 InventoryLocation dst = new InventoryLocation;
8450 {
8451 if (root)
8452 {
8453 root.GetTransform(m4);
8455 }
8456 else
8457 GetInventory().GetCurrentInventoryLocation(dst);
8458 }
8459 else
8460 {
8462
8463
8464 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8465 {
8466 if (root)
8467 {
8468 root.GetTransform(m4);
8470 }
8471 else
8472 GetInventory().GetCurrentInventoryLocation(dst);
8473 }
8474 else
8475 {
8476 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8477 }
8478 }
8479
8480 ScriptInputUserData ctx = new ScriptInputUserData;
8488 }
8489 }
8490 else if (!
GetGame().IsMultiplayer())
8491 {
8493 }
8494 }
8495 }
8496
8497 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8498 {
8499
8500 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8501 return false;
8502
8503 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8504 return false;
8505
8506
8508 return false;
8509
8510
8511 Magazine mag = Magazine.Cast(this);
8512 if (mag)
8513 {
8514 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8515 return false;
8516
8517 if (stack_max_limit)
8518 {
8519 Magazine other_mag = Magazine.Cast(other_item);
8520 if (other_item)
8521 {
8522 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8523 return false;
8524 }
8525
8526 }
8527 }
8528 else
8529 {
8530
8532 return false;
8533
8535 return false;
8536 }
8537
8538 PlayerBase player = null;
8539 if (CastTo(player, GetHierarchyRootPlayer()))
8540 {
8541 if (player.GetInventory().HasAttachment(this))
8542 return false;
8543
8544 if (player.IsItemsToDelete())
8545 return false;
8546 }
8547
8548 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8549 return false;
8550
8551 int slotID;
8553 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8554 return false;
8555
8556 return true;
8557 }
8558
8560 {
8562 }
8563
8565 {
8566 return m_IsResultOfSplit;
8567 }
8568
8570 {
8571 m_IsResultOfSplit = value;
8572 }
8573
8575 {
8577 }
8578
8580 {
8581 float other_item_quantity = other_item.GetQuantity();
8582 float this_free_space;
8583
8585
8587
8588 if (other_item_quantity > this_free_space)
8589 {
8590 return this_free_space;
8591 }
8592 else
8593 {
8594 return other_item_quantity;
8595 }
8596 }
8597
8599 {
8601 }
8602
8604 {
8606 return;
8607
8608 if (!IsMagazine() && other_item)
8609 {
8611 if (quantity_used != 0)
8612 {
8613 float hp1 = GetHealth01("","");
8614 float hp2 = other_item.GetHealth01("","");
8615 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8616 hpResult = hpResult / (
GetQuantity() + quantity_used);
8617
8618 hpResult *= GetMaxHealth();
8619 Math.Round(hpResult);
8620 SetHealth("", "Health", hpResult);
8621
8623 other_item.AddQuantity(-quantity_used);
8624 }
8625 }
8627 }
8628
8630 {
8631 #ifdef SERVER
8632 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8633 GetHierarchyParent().IncreaseLifetimeUp();
8634 #endif
8635 };
8636
8638 {
8639 PlayerBase p = PlayerBase.Cast(player);
8640
8641 array<int> recipesIds = p.m_Recipes;
8642 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8643 if (moduleRecipesManager)
8644 {
8645 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8646 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8647 }
8648
8649 for (int i = 0;i < recipesIds.Count(); i++)
8650 {
8651 int key = recipesIds.Get(i);
8652 string recipeName = moduleRecipesManager.GetRecipeName(key);
8654 }
8655 }
8656
8657
8658 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8659 {
8660 super.GetDebugActions(outputList);
8661
8662
8667
8668
8672
8676
8677
8680
8681
8683 {
8686 }
8687
8689
8692
8696 }
8697
8698
8699
8700
8702 {
8703 super.OnAction(action_id, player, ctx);
8704 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8705 {
8706 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8707 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8708 PlayerBase p = PlayerBase.Cast(player);
8709 if (
EActions.RECIPES_RANGE_START < 1000)
8710 {
8711 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8712 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8713 }
8714 }
8715 #ifndef SERVER
8716 else if (action_id ==
EActions.WATCH_PLAYER)
8717 {
8718 PluginDeveloper.SetDeveloperItemClientEx(player);
8719 }
8720 #endif
8722 {
8723 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8724 {
8725 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8726 OnDebugButtonPressServer(id + 1);
8727 }
8728
8729 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8730 {
8731 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8733 }
8734
8735 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8736 {
8737 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8739 }
8740
8741 else if (action_id ==
EActions.ADD_QUANTITY)
8742 {
8743 if (IsMagazine())
8744 {
8745 Magazine mag = Magazine.Cast(this);
8746 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8747 }
8748 else
8749 {
8751 }
8752
8753 if (m_EM)
8754 {
8755 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8756 }
8757
8758 }
8759
8760 else if (action_id ==
EActions.REMOVE_QUANTITY)
8761 {
8762 if (IsMagazine())
8763 {
8764 Magazine mag2 = Magazine.Cast(this);
8765 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8766 }
8767 else
8768 {
8770 }
8771 if (m_EM)
8772 {
8773 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8774 }
8775
8776 }
8777
8778 else if (action_id ==
EActions.SET_QUANTITY_0)
8779 {
8781
8782 if (m_EM)
8783 {
8784 m_EM.SetEnergy(0);
8785 }
8786 }
8787
8788 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8789 {
8791
8792 if (m_EM)
8793 {
8794 m_EM.SetEnergy(m_EM.GetEnergyMax());
8795 }
8796 }
8797
8798 else if (action_id ==
EActions.ADD_HEALTH)
8799 {
8800 AddHealth("","",GetMaxHealth("","Health")/5);
8801 }
8802 else if (action_id ==
EActions.REMOVE_HEALTH)
8803 {
8804 AddHealth("","",-GetMaxHealth("","Health")/5);
8805 }
8806 else if (action_id ==
EActions.DESTROY_HEALTH)
8807 {
8808 SetHealth01("","",0);
8809 }
8810 else if (action_id ==
EActions.WATCH_ITEM)
8811 {
8813 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8814 #ifdef DEVELOPER
8815 SetDebugDeveloper_item(this);
8816 #endif
8817 }
8818
8819 else if (action_id ==
EActions.ADD_TEMPERATURE)
8820 {
8821 AddTemperature(20);
8822
8823 }
8824
8825 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8826 {
8827 AddTemperature(-20);
8828
8829 }
8830
8831 else if (action_id ==
EActions.FLIP_FROZEN)
8832 {
8833 SetFrozen(!GetIsFrozen());
8834
8835 }
8836
8837 else if (action_id ==
EActions.ADD_WETNESS)
8838 {
8840
8841 }
8842
8843 else if (action_id ==
EActions.REMOVE_WETNESS)
8844 {
8846
8847 }
8848
8849 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8850 {
8853
8854
8855 }
8856
8857 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8858 {
8861 }
8862
8863 else if (action_id ==
EActions.MAKE_SPECIAL)
8864 {
8865 auto debugParams = DebugSpawnParams.WithPlayer(player);
8866 OnDebugSpawnEx(debugParams);
8867 }
8868
8869 else if (action_id ==
EActions.DELETE)
8870 {
8871 Delete();
8872 }
8873
8874 }
8875
8876
8877 return false;
8878 }
8879
8880
8881
8882
8886
8889
8890
8891
8893 {
8894 return false;
8895 }
8896
8897
8899 {
8900 return true;
8901 }
8902
8903
8905 {
8906 return true;
8907 }
8908
8909
8910
8912 {
8913 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8915 }
8916
8919 {
8920 return null;
8921 }
8922
8924 {
8925 return false;
8926 }
8927
8929 {
8930 return false;
8931 }
8932
8936
8937
8939 {
8940 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8941 return module_repairing.CanRepair(this, item_repair_kit);
8942 }
8943
8944
8945 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8946 {
8947 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8948 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8949 }
8950
8951
8953 {
8954
8955
8956
8957
8958
8959
8960
8961
8962 return 1;
8963 }
8964
8965
8966
8968 {
8970 }
8971
8972
8973
8975 {
8977 }
8978
8979
8988 {
8989 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8990
8991 if (player)
8992 {
8993 player.MessageStatus(text);
8994 }
8995 }
8996
8997
9006 {
9007 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9008
9009 if (player)
9010 {
9011 player.MessageAction(text);
9012 }
9013 }
9014
9015
9024 {
9025 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9026
9027 if (player)
9028 {
9029 player.MessageFriendly(text);
9030 }
9031 }
9032
9033
9042 {
9043 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9044
9045 if (player)
9046 {
9047 player.MessageImportant(text);
9048 }
9049 }
9050
9052 {
9053 return true;
9054 }
9055
9056
9057 override bool KindOf(
string tag)
9058 {
9059 bool found = false;
9060 string item_name = this.
GetType();
9063
9064 int array_size = item_tag_array.Count();
9065 for (int i = 0; i < array_size; i++)
9066 {
9067 if (item_tag_array.Get(i) == tag)
9068 {
9069 found = true;
9070 break;
9071 }
9072 }
9073 return found;
9074 }
9075
9076
9078 {
9079
9080 super.OnRPC(sender, rpc_type,ctx);
9081
9082
9083 switch (rpc_type)
9084 {
9085 #ifndef SERVER
9086 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9087 Param2<bool, string> p = new Param2<bool, string>(false, "");
9088
9090 return;
9091
9092 bool play = p.param1;
9093 string soundSet = p.param2;
9094
9095 if (play)
9096 {
9098 {
9100 {
9102 }
9103 }
9104 else
9105 {
9107 }
9108 }
9109 else
9110 {
9112 }
9113
9114 break;
9115 #endif
9116
9117 }
9118
9120 {
9122 }
9123 }
9124
9125
9126
9127
9129 {
9130 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9131 return plugin.GetID(
name);
9132 }
9133
9135 {
9136 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9137 return plugin.GetName(id);
9138 }
9139
9142 {
9143
9144
9145 int varFlags;
9146 if (!ctx.
Read(varFlags))
9147 return;
9148
9149 if (varFlags & ItemVariableFlags.FLOAT)
9150 {
9152 }
9153 }
9154
9156 {
9157
9158 super.SerializeNumericalVars(floats_out);
9159
9160
9161
9163 {
9165 }
9166
9168 {
9170 }
9171
9173 {
9175 }
9176
9178 {
9183 }
9184
9186 {
9188 }
9189 }
9190
9192 {
9193
9194 super.DeSerializeNumericalVars(floats);
9195
9196
9197 int index = 0;
9198 int mask = Math.Round(floats.Get(index));
9199
9200 index++;
9201
9203 {
9205 {
9207 }
9208 else
9209 {
9210 float quantity = floats.Get(index);
9212 }
9213 index++;
9214 }
9215
9217 {
9218 float wet = floats.Get(index);
9220 index++;
9221 }
9222
9224 {
9225 int liquidtype = Math.Round(floats.Get(index));
9227 index++;
9228 }
9229
9231 {
9233 index++;
9235 index++;
9237 index++;
9239 index++;
9240 }
9241
9243 {
9244 int cleanness = Math.Round(floats.Get(index));
9246 index++;
9247 }
9248 }
9249
9251 {
9252 super.WriteVarsToCTX(ctx);
9253
9254
9256 {
9258 }
9259
9261 {
9263 }
9264
9266 {
9268 }
9269
9271 {
9272 int r,g,b,a;
9278 }
9279
9281 {
9283 }
9284 }
9285
9287 {
9288 if (!super.ReadVarsFromCTX(ctx,version))
9289 return false;
9290
9291 int intValue;
9292 float value;
9293
9294 if (version < 140)
9295 {
9296 if (!ctx.
Read(intValue))
9297 return false;
9298
9299 m_VariablesMask = intValue;
9300 }
9301
9303 {
9304 if (!ctx.
Read(value))
9305 return false;
9306
9308 {
9310 }
9311 else
9312 {
9314 }
9315 }
9316
9317 if (version < 140)
9318 {
9320 {
9321 if (!ctx.
Read(value))
9322 return false;
9323 SetTemperatureDirect(value);
9324 }
9325 }
9326
9328 {
9329 if (!ctx.
Read(value))
9330 return false;
9332 }
9333
9335 {
9336 if (!ctx.
Read(intValue))
9337 return false;
9339 }
9340
9342 {
9343 int r,g,b,a;
9345 return false;
9347 return false;
9349 return false;
9351 return false;
9352
9354 }
9355
9357 {
9358 if (!ctx.
Read(intValue))
9359 return false;
9361 }
9362
9363 if (version >= 138 && version < 140)
9364 {
9366 {
9367 if (!ctx.
Read(intValue))
9368 return false;
9369 SetFrozen(intValue);
9370 }
9371 }
9372
9373 return true;
9374 }
9375
9376
9378 {
9381 {
9383 }
9384
9385 if (!super.OnStoreLoad(ctx, version))
9386 {
9388 return false;
9389 }
9390
9391 if (version >= 114)
9392 {
9393 bool hasQuickBarIndexSaved;
9394
9395 if (!ctx.
Read(hasQuickBarIndexSaved))
9396 {
9398 return false;
9399 }
9400
9401 if (hasQuickBarIndexSaved)
9402 {
9403 int itmQBIndex;
9404
9405
9406 if (!ctx.
Read(itmQBIndex))
9407 {
9409 return false;
9410 }
9411
9412 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9413 if (itmQBIndex != -1 && parentPlayer)
9414 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9415 }
9416 }
9417 else
9418 {
9419
9420 PlayerBase player;
9421 int itemQBIndex;
9422 if (version ==
int.
MAX)
9423 {
9424 if (!ctx.
Read(itemQBIndex))
9425 {
9427 return false;
9428 }
9429 }
9430 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9431 {
9432
9433 if (!ctx.
Read(itemQBIndex))
9434 {
9436 return false;
9437 }
9438 if (itemQBIndex != -1 && player)
9439 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9440 }
9441 }
9442
9443 if (version < 140)
9444 {
9445
9446 if (!LoadVariables(ctx, version))
9447 {
9449 return false;
9450 }
9451 }
9452
9453
9455 {
9457 return false;
9458 }
9459 if (version >= 132)
9460 {
9462 if (raib)
9463 {
9465 {
9467 return false;
9468 }
9469 }
9470 }
9471
9473 return true;
9474 }
9475
9476
9477
9479 {
9480 super.OnStoreSave(ctx);
9481
9482 PlayerBase player;
9483 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9484 {
9486
9487 int itemQBIndex = -1;
9488 itemQBIndex = player.FindQuickBarEntityIndex(this);
9489 ctx.
Write(itemQBIndex);
9490 }
9491 else
9492 {
9494 }
9495
9497
9499 if (raib)
9500 {
9502 }
9503 }
9504
9505
9507 {
9508 super.AfterStoreLoad();
9509
9511 {
9513 }
9514
9516 {
9519 }
9520 }
9521
9523 {
9524 super.EEOnAfterLoad();
9525
9527 {
9529 }
9530
9533 }
9534
9536 {
9537 return false;
9538 }
9539
9540
9541
9543 {
9545 {
9546 #ifdef PLATFORM_CONSOLE
9547
9549 {
9551 if (menu)
9552 {
9554 }
9555 }
9556 #endif
9557 }
9558
9560 {
9563 }
9564
9566 {
9567 SetWeightDirty();
9569 }
9571 {
9574 }
9575
9577 {
9580 }
9582 {
9585 }
9586
9587 super.OnVariablesSynchronized();
9588 }
9589
9590
9591
9593 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9594 {
9595 if (!IsServerCheck(allow_client))
9596 return false;
9597
9599 return false;
9600
9603
9604 if (value <= (min + 0.001))
9605 value = min;
9606
9607 if (value == min)
9608 {
9609 if (destroy_config)
9610 {
9611 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9612 if (dstr)
9613 {
9615 this.Delete();
9616 return true;
9617 }
9618 }
9619 else if (destroy_forced)
9620 {
9622 this.Delete();
9623 return true;
9624 }
9625
9627 }
9628
9631
9633 {
9635
9636 if (delta)
9638 }
9639
9641
9642 return false;
9643 }
9644
9645
9647 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9648 {
9650 }
9651
9653 {
9656 }
9657
9659 {
9662 }
9663
9666 {
9667 float value_clamped = Math.Clamp(value, 0, 1);
9669 SetQuantity(result, destroy_config, destroy_forced);
9670 }
9671
9672
9675 {
9677 }
9678
9680 {
9682 }
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9694 {
9695 int slot = -1;
9696 if (GetInventory())
9697 {
9698 InventoryLocation il = new InventoryLocation;
9699 GetInventory().GetCurrentInventoryLocation(il);
9701 }
9702
9704 }
9705
9707 {
9708 float quantity_max = 0;
9709
9711 {
9712 if (attSlotID != -1)
9713 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9714
9715 if (quantity_max <= 0)
9717 }
9718
9719 if (quantity_max <= 0)
9721
9722 return quantity_max;
9723 }
9724
9726 {
9728 }
9729
9731 {
9733 }
9734
9735
9737 {
9739 }
9740
9742 {
9744 }
9745
9747 {
9749 }
9750
9751
9753 {
9754
9755 float weightEx = GetWeightEx();
9756 float special = GetInventoryAndCargoWeight();
9757 return weightEx - special;
9758 }
9759
9760
9762 {
9764 }
9765
9767 {
9769 {
9770 #ifdef DEVELOPER
9771 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9772 {
9773 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9775 }
9776 #endif
9777
9779 }
9780 else if (HasEnergyManager())
9781 {
9782 #ifdef DEVELOPER
9783 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9784 {
9785 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9786 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9787 }
9788 #endif
9789 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9790 }
9791 else
9792 {
9793 #ifdef DEVELOPER
9794 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9795 {
9796 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9797 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9798 }
9799 #endif
9800 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9801 }
9802 }
9803
9806 {
9807 int item_count = 0;
9809
9810 if (GetInventory().GetCargo() != NULL)
9811 {
9812 item_count = GetInventory().GetCargo().GetItemCount();
9813 }
9814
9815 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9816 {
9817 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9818 if (item)
9819 item_count += item.GetNumberOfItems();
9820 }
9821 return item_count;
9822 }
9823
9826 {
9827 float weight = 0;
9828 float wetness = 1;
9829 if (include_wetness)
9832 {
9833 weight = wetness * m_ConfigWeight;
9834 }
9836 {
9837 weight = 1;
9838 }
9839 return weight;
9840 }
9841
9842
9843
9845 {
9846 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9847 {
9848 GameInventory inv = GetInventory();
9849 array<EntityAI> items = new array<EntityAI>;
9851 for (int i = 0; i < items.Count(); i++)
9852 {
9854 if (item)
9855 {
9857 }
9858 }
9859 }
9860 }
9861
9862
9863
9864
9866 {
9867 float energy = 0;
9868 if (HasEnergyManager())
9869 {
9870 energy = GetCompEM().GetEnergy();
9871 }
9872 return energy;
9873 }
9874
9875
9877 {
9878 super.OnEnergyConsumed();
9879
9881 }
9882
9884 {
9885 super.OnEnergyAdded();
9886
9888 }
9889
9890
9892 {
9893 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9894 {
9896 {
9897 float energy_0to1 = GetCompEM().GetEnergy0To1();
9899 }
9900 }
9901 }
9902
9903
9905 {
9906 return ConfigGetFloat("heatIsolation");
9907 }
9908
9910 {
9912 }
9913
9915 {
9916 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9917 if (
GetGame().ConfigIsExisting(paramPath))
9919
9920 return 0.0;
9921 }
9922
9924 {
9925 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9926 if (
GetGame().ConfigIsExisting(paramPath))
9928
9929 return 0.0;
9930 }
9931
9932 override void SetWet(
float value,
bool allow_client =
false)
9933 {
9934 if (!IsServerCheck(allow_client))
9935 return;
9936
9939
9941
9942 m_VarWet = Math.Clamp(value, min, max);
9943
9945 {
9948 }
9949 }
9950
9951 override void AddWet(
float value)
9952 {
9954 }
9955
9957 {
9959 }
9960
9962 {
9964 }
9965
9967 {
9969 }
9970
9972 {
9974 }
9975
9977 {
9979 }
9980
9982 {
9985 if (newLevel != oldLevel)
9986 {
9988 }
9989 }
9990
9992 {
9993 SetWeightDirty();
9994 }
9995
9997 {
9998 return GetWetLevelInternal(
m_VarWet);
9999 }
10000
10001
10002
10004 {
10006 }
10007
10009 {
10011 }
10012
10014 {
10016 }
10017
10019 {
10021 }
10022
10023
10024
10026 {
10027 if (ConfigIsExisting("itemModelLength"))
10028 {
10029 return ConfigGetFloat("itemModelLength");
10030 }
10031 return 0;
10032 }
10033
10035 {
10036 if (ConfigIsExisting("itemAttachOffset"))
10037 {
10038 return ConfigGetFloat("itemAttachOffset");
10039 }
10040 return 0;
10041 }
10042
10043 override void SetCleanness(
int value,
bool allow_client =
false)
10044 {
10045 if (!IsServerCheck(allow_client))
10046 return;
10047
10049
10051
10054 }
10055
10057 {
10059 }
10060
10062 {
10063 return true;
10064 }
10065
10066
10067
10068
10070 {
10072 }
10073
10075 {
10077 }
10078
10079
10080
10081
10082 override void SetColor(
int r,
int g,
int b,
int a)
10083 {
10089 }
10091 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10092 {
10097 }
10098
10100 {
10102 }
10103
10106 {
10107 int r,g,b,a;
10109 r = r/255;
10110 g = g/255;
10111 b = b/255;
10112 a = a/255;
10113 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10114 }
10115
10116
10117
10118 override void SetLiquidType(
int value,
bool allow_client =
false)
10119 {
10120 if (!IsServerCheck(allow_client))
10121 return;
10122
10127 }
10128
10130 {
10131 return ConfigGetInt("varLiquidTypeInit");
10132 }
10133
10135 {
10137 }
10138
10140 {
10142 SetFrozen(false);
10143 }
10144
10147 {
10148 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10149 }
10150
10151
10154 {
10155 PlayerBase nplayer;
10156 if (PlayerBase.CastTo(nplayer, player))
10157 {
10159
10160 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10161 }
10162 }
10163
10164
10167 {
10168 PlayerBase nplayer;
10169 if (PlayerBase.CastTo(nplayer,player))
10170 {
10171
10172 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10173
10174 }
10175
10176
10177 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10178
10179
10180 if (HasEnergyManager())
10181 {
10182 GetCompEM().UpdatePlugState();
10183 }
10184 }
10185
10186
10188 {
10189 super.OnPlacementStarted(player);
10190
10192 }
10193
10194 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10195 {
10197 {
10198 m_AdminLog.OnPlacementComplete(player,
this);
10199 }
10200
10201 super.OnPlacementComplete(player, position, orientation);
10202 }
10203
10204
10205
10206
10207
10209 {
10211 {
10212 return true;
10213 }
10214 else
10215 {
10216 return false;
10217 }
10218 }
10219
10220
10222 {
10224 {
10226 }
10227 }
10228
10229
10231 {
10233 }
10234
10236 {
10238 }
10239
10240 override void InsertAgent(
int agent,
float count = 1)
10241 {
10242 if (count < 1)
10243 return;
10244
10246 }
10247
10250 {
10252 }
10253
10254
10256 {
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
10293
10294
10295
10296
10297
10298
10299
10300
10302 {
10304 return false;
10305 return true;
10306 }
10307
10309 {
10310
10312 }
10313
10314
10317 {
10318 super.CheckForRoofLimited(timeTresholdMS);
10319
10321 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10322 {
10323 m_PreviousRoofTestTime = time;
10324 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10325 }
10326 }
10327
10328
10330 {
10332 {
10333 return 0;
10334 }
10335
10336 if (GetInventory().GetAttachmentSlotsCount() != 0)
10337 {
10338 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10339 if (filter)
10340 return filter.GetProtectionLevel(type, false, system);
10341 else
10342 return 0;
10343 }
10344
10345 string subclassPath, entryName;
10346
10347 switch (type)
10348 {
10350 entryName = "biological";
10351 break;
10353 entryName = "chemical";
10354 break;
10355 default:
10356 entryName = "biological";
10357 break;
10358 }
10359
10360 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10361
10363 }
10364
10365
10366
10369 {
10370 if (!IsMagazine())
10372
10374 }
10375
10376
10377
10378
10379
10384 {
10385 return true;
10386 }
10387
10389 {
10391 }
10392
10393
10394
10395
10396
10398 {
10399 if (parent)
10400 {
10401 if (parent.IsInherited(DayZInfected))
10402 return true;
10403
10404 if (!parent.IsRuined())
10405 return true;
10406 }
10407
10408 return true;
10409 }
10410
10412 {
10413 if (!super.CanPutAsAttachment(parent))
10414 {
10415 return false;
10416 }
10417
10418 if (!IsRuined() && !parent.IsRuined())
10419 {
10420 return true;
10421 }
10422
10423 return false;
10424 }
10425
10427 {
10428
10429
10430
10431
10432 return super.CanReceiveItemIntoCargo(item);
10433 }
10434
10436 {
10437
10438
10439
10440
10441 GameInventory attachmentInv = attachment.GetInventory();
10443 {
10444 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10445 return false;
10446 }
10447
10448 InventoryLocation loc = new InventoryLocation();
10449 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10450 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10451 return false;
10452
10453 return super.CanReceiveAttachment(attachment, slotId);
10454 }
10455
10457 {
10458 if (!super.CanReleaseAttachment(attachment))
10459 return false;
10460
10461 return GetInventory().AreChildrenAccessible();
10462 }
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10485 {
10486 int id = muzzle_owner.GetMuzzleID();
10487 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10488
10489 if (WPOF_array)
10490 {
10491 for (int i = 0; i < WPOF_array.Count(); i++)
10492 {
10493 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10494
10495 if (WPOF)
10496 {
10497 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10498 }
10499 }
10500 }
10501 }
10502
10503
10505 {
10506 int id = muzzle_owner.GetMuzzleID();
10508
10509 if (WPOBE_array)
10510 {
10511 for (int i = 0; i < WPOBE_array.Count(); i++)
10512 {
10513 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10514
10515 if (WPOBE)
10516 {
10517 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10518 }
10519 }
10520 }
10521 }
10522
10523
10525 {
10526 int id = muzzle_owner.GetMuzzleID();
10527 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10528
10529 if (WPOOH_array)
10530 {
10531 for (int i = 0; i < WPOOH_array.Count(); i++)
10532 {
10533 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10534
10535 if (WPOOH)
10536 {
10537 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10538 }
10539 }
10540 }
10541 }
10542
10543
10545 {
10546 int id = muzzle_owner.GetMuzzleID();
10547 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10548
10549 if (WPOOH_array)
10550 {
10551 for (int i = 0; i < WPOOH_array.Count(); i++)
10552 {
10553 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10554
10555 if (WPOOH)
10556 {
10557 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10558 }
10559 }
10560 }
10561 }
10562
10563
10565 {
10566 int id = muzzle_owner.GetMuzzleID();
10567 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10568
10569 if (WPOOH_array)
10570 {
10571 for (int i = 0; i < WPOOH_array.Count(); i++)
10572 {
10573 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10574
10575 if (WPOOH)
10576 {
10577 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10578 }
10579 }
10580 }
10581 }
10582
10583
10584
10586 {
10588 {
10589 return true;
10590 }
10591
10592 return false;
10593 }
10594
10596 {
10598 {
10599 return true;
10600 }
10601
10602 return false;
10603 }
10604
10606 {
10608 {
10609 return true;
10610 }
10611
10612 return false;
10613 }
10614
10616 {
10617 return false;
10618 }
10619
10622 {
10623 return UATimeSpent.DEFAULT_DEPLOY;
10624 }
10625
10626
10627
10628
10630 {
10632 SetSynchDirty();
10633 }
10634
10636 {
10638 }
10639
10640
10642 {
10643 return false;
10644 }
10645
10648 {
10649 string att_type = "None";
10650
10651 if (ConfigIsExisting("soundAttType"))
10652 {
10653 att_type = ConfigGetString("soundAttType");
10654 }
10655
10657 }
10658
10660 {
10662 }
10663
10664
10665
10666
10667
10671
10673 {
10676
10678 }
10679
10680
10682 {
10684 return;
10685
10687
10690
10693
10694 SoundParameters params = new SoundParameters();
10698 }
10699
10700
10702 {
10704 return;
10705
10707 SetSynchDirty();
10708
10711 }
10712
10713
10715 {
10717 return;
10718
10720 SetSynchDirty();
10721
10724 }
10725
10727 {
10729 }
10730
10732 {
10734 }
10735
10738 {
10739 if (!
GetGame().IsDedicatedServer())
10740 {
10741 if (ConfigIsExisting("attachSoundSet"))
10742 {
10743 string cfg_path = "";
10744 string soundset = "";
10745 string type_name =
GetType();
10746
10749 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10750 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10751
10752 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10753 {
10754 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10755 {
10756 if (cfg_slot_array[i] == slot_type)
10757 {
10758 soundset = cfg_soundset_array[i];
10759 break;
10760 }
10761 }
10762 }
10763
10764 if (soundset != "")
10765 {
10766 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10768 }
10769 }
10770 }
10771 }
10772
10774 {
10775
10776 }
10777
10778 void OnApply(PlayerBase player);
10779
10781 {
10782 return 1.0;
10783 };
10784
10786 {
10788 }
10789
10791 {
10793 }
10794
10796
10798 {
10799 SetDynamicPhysicsLifeTime(0.01);
10801 }
10802
10804 {
10805 array<string> zone_names = new array<string>;
10806 GetDamageZones(zone_names);
10807 for (int i = 0; i < zone_names.Count(); i++)
10808 {
10809 SetHealthMax(zone_names.Get(i),"Health");
10810 }
10811 SetHealthMax("","Health");
10812 }
10813
10816 {
10817 float global_health = GetHealth01("","Health");
10818 array<string> zones = new array<string>;
10819 GetDamageZones(zones);
10820
10821 for (int i = 0; i < zones.Count(); i++)
10822 {
10823 SetHealth01(zones.Get(i),"Health",global_health);
10824 }
10825 }
10826
10829 {
10830 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10831 }
10832
10834 {
10835 if (!hasRootAsPlayer)
10836 {
10837 if (refParentIB)
10838 {
10839
10840 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10841 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10842
10843 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10844 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10845
10848 }
10849 else
10850 {
10851
10854 }
10855 }
10856 }
10857
10859 {
10861 {
10862 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10863 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10864 {
10865 float heatPermCoef = 1.0;
10867 while (ent)
10868 {
10869 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10870 ent = ent.GetHierarchyParent();
10871 }
10872
10873 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10874 }
10875 }
10876 }
10877
10879 {
10880
10881 EntityAI parent = GetHierarchyParent();
10882 if (!parent)
10883 {
10884 hasParent = false;
10885 hasRootAsPlayer = false;
10886 }
10887 else
10888 {
10889 hasParent = true;
10890 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10891 refParentIB =
ItemBase.Cast(parent);
10892 }
10893 }
10894
10895 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10896 {
10897
10898 }
10899
10901 {
10902
10903 return false;
10904 }
10905
10907 {
10908
10909
10910 return false;
10911 }
10912
10914 {
10915
10916 return false;
10917 }
10918
10921 {
10922 return !GetIsFrozen() &&
IsOpen();
10923 }
10924
10926 {
10927 bool hasParent = false, hasRootAsPlayer = false;
10929
10930 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10931 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10932
10933 if (wwtu || foodDecay)
10934 {
10938
10939 if (processWetness || processTemperature || processDecay)
10940 {
10942
10943 if (processWetness)
10944 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10945
10946 if (processTemperature)
10948
10949 if (processDecay)
10950 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10951 }
10952 }
10953 }
10954
10957 {
10959 }
10960
10962 {
10965
10966 return super.GetTemperatureFreezeThreshold();
10967 }
10968
10970 {
10973
10974 return super.GetTemperatureThawThreshold();
10975 }
10976
10978 {
10981
10982 return super.GetItemOverheatThreshold();
10983 }
10984
10986 {
10988 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10989
10990 return super.GetTemperatureFreezeTime();
10991 }
10992
10994 {
10996 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10997
10998 return super.GetTemperatureThawTime();
10999 }
11000
11005
11007 {
11008 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11009 }
11010
11012 {
11013 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11014 }
11015
11018 {
11020 }
11021
11023 {
11025 }
11026
11028 {
11030 }
11031
11034 {
11035 return null;
11036 }
11037
11040 {
11041 return false;
11042 }
11043
11045 {
11047 {
11050 if (!trg)
11051 {
11053 explosive = this;
11054 }
11055
11056 explosive.PairRemote(trg);
11058
11059 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11060 trg.SetPersistentPairID(persistentID);
11061 explosive.SetPersistentPairID(persistentID);
11062
11063 return true;
11064 }
11065 return false;
11066 }
11067
11070 {
11071 float ret = 1.0;
11074 ret *= GetHealth01();
11075
11076 return ret;
11077 }
11078
11079 #ifdef DEVELOPER
11080 override void SetDebugItem()
11081 {
11082 super.SetDebugItem();
11083 _itemBase = this;
11084 }
11085
11087 {
11088 string text = super.GetDebugText();
11089
11091 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11092
11093 return text;
11094 }
11095 #endif
11096
11098 {
11099 return true;
11100 }
11101
11103
11105
11107 {
11110 }
11111
11112
11120
11136}
11137
11139{
11141 if (entity)
11142 {
11143 bool is_item = entity.IsInherited(
ItemBase);
11144 if (is_item && full_quantity)
11145 {
11148 }
11149 }
11150 else
11151 {
11153 return NULL;
11154 }
11155 return entity;
11156}
11157
11159{
11160 if (item)
11161 {
11162 if (health > 0)
11163 item.SetHealth("", "", health);
11164
11165 if (item.CanHaveTemperature())
11166 {
11168 if (item.CanFreeze())
11169 item.SetFrozen(false);
11170 }
11171
11172 if (item.HasEnergyManager())
11173 {
11174 if (quantity >= 0)
11175 {
11176 item.GetCompEM().SetEnergy0To1(quantity);
11177 }
11178 else
11179 {
11181 }
11182 }
11183 else if (item.IsMagazine())
11184 {
11185 Magazine mag = Magazine.Cast(item);
11186 if (quantity >= 0)
11187 {
11188 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11189 }
11190 else
11191 {
11193 }
11194
11195 }
11196 else
11197 {
11198 if (quantity >= 0)
11199 {
11200 item.SetQuantityNormalized(quantity, false);
11201 }
11202 else
11203 {
11205 }
11206
11207 }
11208 }
11209}
11210
11211#ifdef DEVELOPER
11213#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.