7457{
7459 {
7460 return true;
7461 }
7462};
7463
7464
7465
7467{
7471
7473
7476
7477
7478
7479
7480
7489
7495
7500
7505
7526 protected bool m_IsResultOfSplit
7527
7529
7534
7535
7536
7538
7542
7543
7544
7546
7549
7550
7551
7557
7558
7566
7569
7570
7572
7573
7575
7576
7581
7582
7587
7588
7590
7591
7593 {
7598
7599 if (!
GetGame().IsDedicatedServer())
7600 {
7602 {
7604
7606 {
7608 }
7609 }
7610
7613 }
7614
7615 m_OldLocation = null;
7616
7618 {
7620 }
7621
7622 if (ConfigIsExisting("headSelectionsToHide"))
7623 {
7626 }
7627
7629 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7630 {
7632 }
7633
7635
7636 m_IsResultOfSplit = false;
7637
7639 }
7640
7642 {
7643 super.InitItemVariables();
7644
7650 m_Count = ConfigGetInt(
"count");
7651
7654
7659
7662
7667
7679
7683
7684
7687 if (ConfigIsExisting("canBeSplit"))
7688 {
7691 }
7692
7694 if (ConfigIsExisting("itemBehaviour"))
7696
7697
7700 RegisterNetSyncVariableInt("m_VarLiquidType");
7701 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7702
7703 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7704 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7705 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7706
7707 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7708 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7709 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7710 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7711
7712 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7713 RegisterNetSyncVariableBool("m_IsTakeable");
7714 RegisterNetSyncVariableBool("m_IsHologram");
7715
7718 {
7721 }
7722
7724
7726 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7728
7729 }
7730
7732 {
7734 }
7735
7737 {
7740 {
7745 }
7746 }
7747
7748 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7749 {
7751 {
7754 }
7755
7757 }
7758
7760 {
7766 }
7767
7769
7771 {
7773
7774 if (!action)
7775 {
7776 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7777 return;
7778 }
7779
7781 if (!ai)
7782 {
7784 return;
7785 }
7786
7788 if (!action_array)
7789 {
7790 action_array = new array<ActionBase_Basic>;
7792 }
7793 if (LogManager.IsActionLogEnable())
7794 {
7795 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7796 }
7797
7798 if (action_array.Find(action) != -1)
7799 {
7800 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7801 }
7802 else
7803 {
7804 action_array.Insert(action);
7805 }
7806 }
7807
7809 {
7811 ActionBase action = player.GetActionManager().GetAction(actionName);
7814
7815 if (action_array)
7816 {
7817 action_array.RemoveItem(action);
7818 }
7819 }
7820
7821
7822
7824 {
7825 ActionOverrideData overrideData = new ActionOverrideData();
7829
7831 if (!actionMap)
7832 {
7835 }
7836
7837 actionMap.Insert(this.
Type(), overrideData);
7838
7839 }
7840
7842
7844
7845
7847 {
7850
7853
7854 string config_to_search = "CfgVehicles";
7855 string muzzle_owner_config;
7856
7858 {
7859 if (IsInherited(Weapon))
7860 config_to_search = "CfgWeapons";
7861
7862 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7863
7864 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7865
7867
7868 if (config_OnFire_subclass_count > 0)
7869 {
7870 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7871
7872 for (int i = 0; i < config_OnFire_subclass_count; i++)
7873 {
7874 string particle_class = "";
7876 string config_OnFire_entry = config_OnFire_class + particle_class;
7877 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7878 WPOF_array.Insert(WPOF);
7879 }
7880
7881
7883 }
7884 }
7885
7887 {
7888 config_to_search = "CfgWeapons";
7889 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7890
7891 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7892
7894
7895 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7896 {
7897 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7898
7899 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7900 {
7901 string particle_class2 = "";
7903 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7904 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7905 WPOBE_array.Insert(WPOBE);
7906 }
7907
7908
7910 }
7911 }
7912 }
7913
7914
7916 {
7919
7921 {
7922 string config_to_search = "CfgVehicles";
7923
7924 if (IsInherited(Weapon))
7925 config_to_search = "CfgWeapons";
7926
7927 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7928 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7929
7930 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7931 {
7932
7934
7936 {
7938 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7940 return;
7941 }
7942
7945
7946
7947
7949 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7950
7951 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7952 {
7953 string particle_class = "";
7955 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7957
7958 if (entry_type == CT_CLASS)
7959 {
7960 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7961 WPOOH_array.Insert(WPOF);
7962 }
7963 }
7964
7965
7967 }
7968 }
7969 }
7970
7972 {
7974 }
7975
7977 {
7979 {
7981
7984
7987
7988 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7989 }
7990 }
7991
7993 {
7995 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7996
7998 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7999
8001 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8002
8004 {
8006 }
8007 }
8008
8010 {
8012 }
8013
8015 {
8018 else
8020
8022 {
8025 }
8026 else
8027 {
8030
8033 }
8034
8036 }
8037
8039 {
8041 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8042 }
8043
8045 {
8047 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8049 }
8050
8052 {
8054 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8055 }
8056
8058 {
8061
8062 OverheatingParticle OP = new OverheatingParticle();
8067
8069 }
8070
8072 {
8075
8076 return -1;
8077 }
8078
8080 {
8082 {
8085
8086 for (int i = count; i > 0; --i)
8087 {
8088 int id = i - 1;
8091
8094
8095 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8096 {
8097 if (p)
8098 {
8101 }
8102 }
8103 }
8104 }
8105 }
8106
8108 {
8110 {
8112 {
8113 int id = i - 1;
8115
8116 if (OP)
8117 {
8119
8120 if (p)
8121 {
8123 }
8124
8125 delete OP;
8126 }
8127 }
8128
8131 }
8132 }
8133
8136 {
8137 return 0.0;
8138 }
8139
8140
8142 {
8143 return 250;
8144 }
8145
8147 {
8148 return 0;
8149 }
8150
8153 {
8155 return true;
8156
8157 return false;
8158 }
8159
8162 {
8165
8167 {
8169 }
8170 else
8171 {
8172
8174 }
8175
8177 }
8178
8185 {
8186 return -1;
8187 }
8188
8189
8190
8191
8193 {
8195 {
8197 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8198
8199 if (r_index >= 0)
8200 {
8201 InventoryLocation r_il = new InventoryLocation;
8202 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8203
8204 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8207 {
8208 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8209 }
8211 {
8212 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8213 }
8214
8215 }
8216
8217 player.GetHumanInventory().ClearUserReservedLocation(this);
8218 }
8219
8222 }
8223
8224
8225
8226
8228 {
8229 return ItemBase.m_DebugActionsMask;
8230 }
8231
8233 {
8234 return ItemBase.m_DebugActionsMask & mask;
8235 }
8236
8238 {
8239 ItemBase.m_DebugActionsMask = mask;
8240 }
8241
8243 {
8244 ItemBase.m_DebugActionsMask |= mask;
8245 }
8246
8248 {
8249 ItemBase.m_DebugActionsMask &= ~mask;
8250 }
8251
8253 {
8255 {
8257 }
8258 else
8259 {
8261 }
8262 }
8263
8264
8266 {
8267 if (GetEconomyProfile())
8268 {
8269 float q_max = GetEconomyProfile().GetQuantityMax();
8270 if (q_max > 0)
8271 {
8272 float q_min = GetEconomyProfile().GetQuantityMin();
8273 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8274
8276 {
8277 ComponentEnergyManager comp = GetCompEM();
8279 {
8281 }
8282 }
8284 {
8286
8287 }
8288
8289 }
8290 }
8291 }
8292
8295 {
8296 EntityAI parent = GetHierarchyParent();
8297
8298 if (parent)
8299 {
8300 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8301 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8302 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8303 }
8304 }
8305
8308 {
8309 EntityAI parent = GetHierarchyParent();
8310
8311 if (parent)
8312 {
8313 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8314 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8315 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8316 }
8317 }
8318
8320 {
8321
8322
8323
8324
8326
8328 {
8329 if (ScriptInputUserData.CanStoreInputUserData())
8330 {
8331 ScriptInputUserData ctx = new ScriptInputUserData;
8337 ctx.
Write(use_stack_max);
8340
8342 {
8343 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8344 }
8345 }
8346 }
8347 else if (!
GetGame().IsMultiplayer())
8348 {
8350 }
8351 }
8352
8354 {
8356 }
8357
8359 {
8361 }
8362
8364 {
8366 }
8367
8369 {
8370
8371 return false;
8372 }
8373
8375 {
8376 return false;
8377 }
8378
8382 {
8383 return false;
8384 }
8385
8387 {
8388 return "";
8389 }
8390
8392
8394 {
8395 return false;
8396 }
8397
8399 {
8400 return true;
8401 }
8402
8403
8404
8406 {
8407 return true;
8408 }
8409
8411 {
8412 return true;
8413 }
8414
8416 {
8417 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8419 }
8420
8422 {
8424 }
8425
8427 {
8429 if (!is_being_placed)
8431 SetSynchDirty();
8432 }
8433
8434
8436
8438 {
8440 }
8441
8443 {
8445 }
8446
8448 {
8449 return 1;
8450 }
8451
8453 {
8454 return false;
8455 }
8456
8458 {
8460 SetSynchDirty();
8461 }
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8498 {
8499 super.OnMovedInsideCargo(container);
8500
8501 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8502 }
8503
8504 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8505 {
8506 super.EEItemLocationChanged(oldLoc,newLoc);
8507
8508 PlayerBase new_player = null;
8509 PlayerBase old_player = null;
8510
8511 if (newLoc.GetParent())
8512 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8513
8514 if (oldLoc.GetParent())
8515 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8516
8518 {
8519 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8520
8521 if (r_index >= 0)
8522 {
8523 InventoryLocation r_il = new InventoryLocation;
8524 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8525
8526 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8529 {
8530 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8531 }
8533 {
8534 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8535 }
8536
8537 }
8538 }
8539
8541 {
8542 if (new_player)
8543 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8544
8545 if (new_player == old_player)
8546 {
8547
8548 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8549 {
8551 {
8552 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8553 {
8554 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8555 }
8556 }
8557 else
8558 {
8559 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8560 }
8561 }
8562
8563 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8564 {
8565 int type = oldLoc.GetType();
8567 {
8568 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8569 }
8571 {
8572 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8573 }
8574 }
8575 if (!m_OldLocation)
8576 {
8577 m_OldLocation = new InventoryLocation;
8578 }
8579 m_OldLocation.Copy(oldLoc);
8580 }
8581 else
8582 {
8583 if (m_OldLocation)
8584 {
8585 m_OldLocation.Reset();
8586 }
8587 }
8588
8590 }
8591 else
8592 {
8593 if (new_player)
8594 {
8595 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8596 if (res_index >= 0)
8597 {
8598 InventoryLocation il = new InventoryLocation;
8599 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8601 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8604 {
8605 il.
GetParent().GetOnReleaseLock().Invoke(it);
8606 }
8608 {
8610 }
8611
8612 }
8613 }
8615 {
8616
8618 }
8619
8620 if (m_OldLocation)
8621 {
8622 m_OldLocation.Reset();
8623 }
8624 }
8625 }
8626
8627 override void EOnContact(IEntity other, Contact extra)
8628 {
8630 {
8631 int liquidType = -1;
8633 if (impactSpeed > 0.0)
8634 {
8636 #ifndef SERVER
8638 #else
8640 SetSynchDirty();
8641 #endif
8643 }
8644 }
8645
8646 #ifdef SERVER
8647 if (GetCompEM() && GetCompEM().IsPlugged())
8648 {
8649 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8650 GetCompEM().UnplugThis();
8651 }
8652 #endif
8653 }
8654
8656
8658 {
8660 }
8661
8663 {
8664
8665 }
8666
8668 {
8669 super.OnItemLocationChanged(old_owner, new_owner);
8670
8671 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8672 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8673
8674 if (!relatedPlayer && playerNew)
8675 relatedPlayer = playerNew;
8676
8677 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8678 {
8680 if (actionMgr)
8681 {
8682 ActionBase currentAction = actionMgr.GetRunningAction();
8683 if (currentAction)
8685 }
8686 }
8687
8688 Man ownerPlayerOld = null;
8689 Man ownerPlayerNew = null;
8690
8691 if (old_owner)
8692 {
8693 if (old_owner.
IsMan())
8694 {
8695 ownerPlayerOld = Man.Cast(old_owner);
8696 }
8697 else
8698 {
8699 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8700 }
8701 }
8702 else
8703 {
8705 {
8707
8708 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8709 {
8710 GetCompEM().UnplugThis();
8711 }
8712 }
8713 }
8714
8715 if (new_owner)
8716 {
8717 if (new_owner.
IsMan())
8718 {
8719 ownerPlayerNew = Man.Cast(new_owner);
8720 }
8721 else
8722 {
8723 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8724 }
8725 }
8726
8727 if (ownerPlayerOld != ownerPlayerNew)
8728 {
8729 if (ownerPlayerOld)
8730 {
8731 array<EntityAI> subItemsExit = new array<EntityAI>;
8733 for (int i = 0; i < subItemsExit.Count(); i++)
8734 {
8737 }
8738 }
8739
8740 if (ownerPlayerNew)
8741 {
8742 array<EntityAI> subItemsEnter = new array<EntityAI>;
8744 for (int j = 0; j < subItemsEnter.Count(); j++)
8745 {
8748 }
8749 }
8750 }
8751 else if (ownerPlayerNew != null)
8752 {
8753 PlayerBase nplayer;
8754 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8755 {
8756 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8758 for (int k = 0; k < subItemsUpdate.Count(); k++)
8759 {
8761 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8762 }
8763 }
8764 }
8765
8766 if (old_owner)
8767 old_owner.OnChildItemRemoved(this);
8768 if (new_owner)
8769 new_owner.OnChildItemReceived(this);
8770 }
8771
8772
8774 {
8775 super.EEDelete(parent);
8776 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8777 if (player)
8778 {
8780
8781 if (player.IsAlive())
8782 {
8783 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8784 if (r_index >= 0)
8785 {
8786 InventoryLocation r_il = new InventoryLocation;
8787 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8788
8789 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8792 {
8793 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8794 }
8796 {
8797 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8798 }
8799
8800 }
8801
8802 player.RemoveQuickBarEntityShortcut(this);
8803 }
8804 }
8805 }
8806
8808 {
8809 super.EEKilled(killer);
8810
8813 {
8814 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8815 {
8816 if (IsMagazine())
8817 {
8818 if (Magazine.Cast(this).GetAmmoCount() > 0)
8819 {
8821 }
8822 }
8823 else
8824 {
8826 }
8827 }
8828 }
8829 }
8830
8832 {
8833 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8834
8835 super.OnWasAttached(parent, slot_id);
8836
8839
8841 }
8842
8844 {
8845 super.OnWasDetached(parent, slot_id);
8846
8849 }
8850
8852 {
8853 int idx;
8856
8857 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8858 if (inventory_slots.Count() < 1)
8859 {
8860 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8861 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8862 }
8863 else
8864 {
8865 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8866 }
8867
8868 idx = inventory_slots.Find(slot);
8869 if (idx < 0)
8870 return "";
8871
8872 return attach_types.Get(idx);
8873 }
8874
8876 {
8877 int idx = -1;
8878 string slot;
8879
8882
8883 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8884 if (inventory_slots.Count() < 1)
8885 {
8886 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8887 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8888 }
8889 else
8890 {
8891 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8892 if (detach_types.Count() < 1)
8893 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8894 }
8895
8896 for (int i = 0; i < inventory_slots.Count(); i++)
8897 {
8898 slot = inventory_slots.Get(i);
8899 }
8900
8901 if (slot != "")
8902 {
8903 if (detach_types.Count() == 1)
8904 idx = 0;
8905 else
8906 idx = inventory_slots.Find(slot);
8907 }
8908 if (idx < 0)
8909 return "";
8910
8911 return detach_types.Get(idx);
8912 }
8913
8915 {
8916
8918
8919
8920 float min_time = 1;
8921 float max_time = 3;
8922 float delay = Math.RandomFloat(min_time, max_time);
8923
8924 explode_timer.Run(delay, this, "DoAmmoExplosion");
8925 }
8926
8928 {
8929 Magazine magazine = Magazine.Cast(this);
8930 int pop_sounds_count = 6;
8931 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8932
8933
8934 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8935 string sound_name = pop_sounds[ sound_idx ];
8937
8938
8939 magazine.ServerAddAmmoCount(-1);
8940
8941
8942 float min_temp_to_explode = 100;
8943
8944 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8945 {
8947 }
8948 }
8949
8950
8951 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8952 {
8953 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8954
8955 const int CHANCE_DAMAGE_CARGO = 4;
8956 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8957 const int CHANCE_DAMAGE_NOTHING = 2;
8958
8960 {
8961 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8962 int chances;
8963 int rnd;
8964
8965 if (GetInventory().GetCargo())
8966 {
8967 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8968 rnd = Math.RandomInt(0,chances);
8969
8970 if (rnd < CHANCE_DAMAGE_CARGO)
8971 {
8973 }
8974 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8975 {
8977 }
8978 }
8979 else
8980 {
8981 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8982 rnd = Math.RandomInt(0,chances);
8983
8984 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8985 {
8987 }
8988 }
8989 }
8990 }
8991
8993 {
8994 if (GetInventory().GetCargo())
8995 {
8996 int item_count = GetInventory().GetCargo().GetItemCount();
8997 if (item_count > 0)
8998 {
8999 int random_pick = Math.RandomInt(0, item_count);
9001 if (!item.IsExplosive())
9002 {
9003 item.AddHealth("","",damage);
9004 return true;
9005 }
9006 }
9007 }
9008 return false;
9009 }
9010
9012 {
9013 int attachment_count = GetInventory().AttachmentCount();
9014 if (attachment_count > 0)
9015 {
9016 int random_pick = Math.RandomInt(0, attachment_count);
9017 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9018 if (!attachment.IsExplosive())
9019 {
9020 attachment.AddHealth("","",damage);
9021 return true;
9022 }
9023 }
9024 return false;
9025 }
9026
9028 {
9030 }
9031
9033 {
9035 return GetInventory().CanRemoveEntity();
9036
9037 return false;
9038 }
9039
9041 {
9042
9044 return false;
9045
9046
9048 return false;
9049
9050
9051
9053 if (delta == 0)
9054 return false;
9055
9056
9057 return true;
9058 }
9059
9061 {
9063 {
9064 if (ScriptInputUserData.CanStoreInputUserData())
9065 {
9066 ScriptInputUserData ctx = new ScriptInputUserData;
9071 ctx.
Write(destination_entity);
9075 }
9076 }
9077 else if (!
GetGame().IsMultiplayer())
9078 {
9080 }
9081 }
9082
9084 {
9085 float split_quantity_new;
9089 InventoryLocation loc = new InventoryLocation;
9090
9091 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9092 {
9094 split_quantity_new = stack_max;
9095 else
9097
9099 {
9100 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9101 if (new_item)
9102 {
9103 new_item.SetResultOfSplit(true);
9104 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9106 new_item.
SetQuantity(split_quantity_new,
false,
true);
9107 }
9108 }
9109 }
9110 else if (destination_entity && slot_id == -1)
9111 {
9112 if (quantity > stack_max)
9113 split_quantity_new = stack_max;
9114 else
9115 split_quantity_new = quantity;
9116
9118 {
9120 {
9123 }
9124
9125 if (new_item)
9126 {
9127 new_item.SetResultOfSplit(true);
9128 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9130 new_item.
SetQuantity(split_quantity_new,
false,
true);
9131 }
9132 }
9133 }
9134 else
9135 {
9136 if (stack_max != 0)
9137 {
9139 {
9141 }
9142
9143 if (split_quantity_new == 0)
9144 {
9145 if (!
GetGame().IsMultiplayer())
9146 player.PhysicalPredictiveDropItem(this);
9147 else
9148 player.ServerDropEntity(this);
9149 return;
9150 }
9151
9153 {
9155
9156 if (new_item)
9157 {
9158 new_item.SetResultOfSplit(true);
9159 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9162 new_item.PlaceOnSurface();
9163 }
9164 }
9165 }
9166 }
9167 }
9168
9170 {
9171 float split_quantity_new;
9175 InventoryLocation loc = new InventoryLocation;
9176
9177 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9178 {
9180 split_quantity_new = stack_max;
9181 else
9183
9185 {
9186 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9187 if (new_item)
9188 {
9189 new_item.SetResultOfSplit(true);
9190 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9192 new_item.
SetQuantity(split_quantity_new,
false,
true);
9193 }
9194 }
9195 }
9196 else if (destination_entity && slot_id == -1)
9197 {
9198 if (quantity > stack_max)
9199 split_quantity_new = stack_max;
9200 else
9201 split_quantity_new = quantity;
9202
9204 {
9206 {
9209 }
9210
9211 if (new_item)
9212 {
9213 new_item.SetResultOfSplit(true);
9214 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9216 new_item.
SetQuantity(split_quantity_new,
false,
true);
9217 }
9218 }
9219 }
9220 else
9221 {
9222 if (stack_max != 0)
9223 {
9225 {
9227 }
9228
9230 {
9232
9233 if (new_item)
9234 {
9235 new_item.SetResultOfSplit(true);
9236 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9239 new_item.PlaceOnSurface();
9240 }
9241 }
9242 }
9243 }
9244 }
9245
9247 {
9249 {
9250 if (ScriptInputUserData.CanStoreInputUserData())
9251 {
9252 ScriptInputUserData ctx = new ScriptInputUserData;
9257 dst.WriteToContext(ctx);
9259 }
9260 }
9261 else if (!
GetGame().IsMultiplayer())
9262 {
9264 }
9265 }
9266
9268 {
9270 {
9271 if (ScriptInputUserData.CanStoreInputUserData())
9272 {
9273 ScriptInputUserData ctx = new ScriptInputUserData;
9278 ctx.
Write(destination_entity);
9284 }
9285 }
9286 else if (!
GetGame().IsMultiplayer())
9287 {
9289 }
9290 }
9291
9293 {
9295 }
9296
9298 {
9300 float split_quantity_new;
9302 if (dst.IsValid())
9303 {
9304 int slot_id = dst.GetSlot();
9306
9307 if (quantity > stack_max)
9308 split_quantity_new = stack_max;
9309 else
9310 split_quantity_new = quantity;
9311
9313 {
9315
9316 if (new_item)
9317 {
9318 new_item.SetResultOfSplit(true);
9319 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9321 new_item.
SetQuantity(split_quantity_new,
false,
true);
9322 }
9323
9324 return new_item;
9325 }
9326 }
9327
9328 return null;
9329 }
9330
9332 {
9334 float split_quantity_new;
9336 if (destination_entity)
9337 {
9339 if (quantity > stackable)
9340 split_quantity_new = stackable;
9341 else
9342 split_quantity_new = quantity;
9343
9345 {
9346 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9347 if (new_item)
9348 {
9349 new_item.SetResultOfSplit(true);
9350 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9352 new_item.
SetQuantity(split_quantity_new,
false,
true);
9353 }
9354 }
9355 }
9356 }
9357
9359 {
9361 {
9362 if (ScriptInputUserData.CanStoreInputUserData())
9363 {
9364 ScriptInputUserData ctx = new ScriptInputUserData;
9369 ItemBase destination_entity =
this;
9370 ctx.
Write(destination_entity);
9374 }
9375 }
9376 else if (!
GetGame().IsMultiplayer())
9377 {
9379 }
9380 }
9381
9383 {
9385 float split_quantity_new;
9387 if (player)
9388 {
9390 if (quantity > stackable)
9391 split_quantity_new = stackable;
9392 else
9393 split_quantity_new = quantity;
9394
9396 {
9397 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9398 new_item =
ItemBase.Cast(in_hands);
9399 if (new_item)
9400 {
9401 new_item.SetResultOfSplit(true);
9402 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9404 new_item.SetQuantity(split_quantity_new, false, true);
9405 }
9406 }
9407 }
9408 }
9409
9411 {
9413 float split_quantity_new = Math.Floor(quantity * 0.5);
9414
9416 return;
9417
9419
9420 if (new_item)
9421 {
9422 if (new_item.GetQuantityMax() < split_quantity_new)
9423 {
9424 split_quantity_new = new_item.GetQuantityMax();
9425 }
9426
9427 new_item.SetResultOfSplit(true);
9428 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9429
9431 {
9434 }
9435 else
9436 {
9438 new_item.
SetQuantity(split_quantity_new,
false,
true);
9439 }
9440 }
9441 }
9442
9444 {
9446 float split_quantity_new = Math.Floor(quantity / 2);
9447
9449 return;
9450
9451 InventoryLocation invloc = new InventoryLocation;
9453
9455 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9456
9457 if (new_item)
9458 {
9459 if (new_item.GetQuantityMax() < split_quantity_new)
9460 {
9461 split_quantity_new = new_item.GetQuantityMax();
9462 }
9464 {
9467 }
9468 else if (split_quantity_new > 1)
9469 {
9471 new_item.
SetQuantity(split_quantity_new,
false,
true);
9472 }
9473 }
9474 }
9475
9478 {
9479 SetWeightDirty();
9481
9482 if (parent)
9483 parent.OnAttachmentQuantityChangedEx(this, delta);
9484
9486 {
9488 {
9490 }
9492 {
9493 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9495 }
9496 }
9497
9498 }
9499
9502 {
9503
9504 }
9505
9508 {
9510 }
9511
9513 {
9514 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9515
9517 {
9518 if (newLevel == GameConstants.STATE_RUINED)
9519 {
9521 EntityAI parent = GetHierarchyParent();
9522 if (parent && parent.IsFireplace())
9523 {
9524 CargoBase cargo = GetInventory().GetCargo();
9525 if (cargo)
9526 {
9528 {
9530 }
9531 }
9532 }
9533 }
9534
9536 {
9537
9539 return;
9540 }
9541
9542 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9543 {
9545 }
9546 }
9547 }
9548
9549
9551 {
9552 super.OnRightClick();
9553
9555 {
9557 {
9558 if (ScriptInputUserData.CanStoreInputUserData())
9559 {
9560 EntityAI root = GetHierarchyRoot();
9561 Man playerOwner = GetHierarchyRootPlayer();
9562 InventoryLocation dst = new InventoryLocation;
9563
9564
9565 if (!playerOwner && root && root == this)
9566 {
9568 }
9569 else
9570 {
9571
9572 GetInventory().GetCurrentInventoryLocation(dst);
9574 {
9577 {
9579 }
9580 else
9581 {
9583
9584
9585 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9586 {
9588 }
9589 else
9590 {
9591 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9592 }
9593 }
9594 }
9595 }
9596
9597 ScriptInputUserData ctx = new ScriptInputUserData;
9605 }
9606 }
9607 else if (!
GetGame().IsMultiplayer())
9608 {
9610 }
9611 }
9612 }
9613
9615 {
9616 if (root)
9617 {
9618 vector m4[4];
9619 root.GetTransform(m4);
9620 dst.SetGround(this, m4);
9621 }
9622 else
9623 {
9624 GetInventory().GetCurrentInventoryLocation(dst);
9625 }
9626 }
9627
9628 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9629 {
9630
9631 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9632 return false;
9633
9634 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9635 return false;
9636
9637
9639 return false;
9640
9641
9642 Magazine mag = Magazine.Cast(this);
9643 if (mag)
9644 {
9645 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9646 return false;
9647
9648 if (stack_max_limit)
9649 {
9650 Magazine other_mag = Magazine.Cast(other_item);
9651 if (other_item)
9652 {
9653 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9654 return false;
9655 }
9656
9657 }
9658 }
9659 else
9660 {
9661
9663 return false;
9664
9666 return false;
9667 }
9668
9669 PlayerBase player = null;
9670 if (CastTo(player, GetHierarchyRootPlayer()))
9671 {
9672 if (player.GetInventory().HasAttachment(this))
9673 return false;
9674
9675 if (player.IsItemsToDelete())
9676 return false;
9677 }
9678
9679 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9680 return false;
9681
9682 int slotID;
9684 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9685 return false;
9686
9687 return true;
9688 }
9689
9691 {
9693 }
9694
9696 {
9697 return m_IsResultOfSplit;
9698 }
9699
9701 {
9702 m_IsResultOfSplit = value;
9703 }
9704
9706 {
9708 }
9709
9711 {
9712 float other_item_quantity = other_item.GetQuantity();
9713 float this_free_space;
9714
9716
9718
9719 if (other_item_quantity > this_free_space)
9720 {
9721 return this_free_space;
9722 }
9723 else
9724 {
9725 return other_item_quantity;
9726 }
9727 }
9728
9730 {
9732 }
9733
9735 {
9737 return;
9738
9739 if (!IsMagazine() && other_item)
9740 {
9742 if (quantity_used != 0)
9743 {
9744 float hp1 = GetHealth01("","");
9745 float hp2 = other_item.GetHealth01("","");
9746 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9747 hpResult = hpResult / (
GetQuantity() + quantity_used);
9748
9749 hpResult *= GetMaxHealth();
9750 Math.Round(hpResult);
9751 SetHealth("", "Health", hpResult);
9752
9754 other_item.AddQuantity(-quantity_used);
9755 }
9756 }
9758 }
9759
9761 {
9762 #ifdef SERVER
9763 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9764 GetHierarchyParent().IncreaseLifetimeUp();
9765 #endif
9766 };
9767
9769 {
9770 PlayerBase p = PlayerBase.Cast(player);
9771
9772 array<int> recipesIds = p.m_Recipes;
9773 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9774 if (moduleRecipesManager)
9775 {
9776 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9777 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9778 }
9779
9780 for (int i = 0;i < recipesIds.Count(); i++)
9781 {
9782 int key = recipesIds.Get(i);
9783 string recipeName = moduleRecipesManager.GetRecipeName(key);
9785 }
9786 }
9787
9788
9789 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9790 {
9791 super.GetDebugActions(outputList);
9792
9793
9799
9800
9805
9810
9811
9815
9816
9818 {
9822 }
9823
9826
9827
9831
9833
9834 InventoryLocation loc = new InventoryLocation();
9835 GetInventory().GetCurrentInventoryLocation(loc);
9837 {
9838 if (Gizmo_IsSupported())
9841 }
9842
9844 }
9845
9846
9847
9848
9850 {
9851 super.OnAction(action_id, player, ctx);
9852
9854 {
9855 switch (action_id)
9856 {
9859 return true;
9862 return true;
9863 }
9864 }
9865
9867 {
9868 switch (action_id)
9869 {
9871 Delete();
9872 return true;
9873 }
9874 }
9875
9876 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9877 {
9878 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9879 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9880 PlayerBase p = PlayerBase.Cast(player);
9881 if (
EActions.RECIPES_RANGE_START < 1000)
9882 {
9883 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9884 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9885 }
9886 }
9887 #ifndef SERVER
9888 else if (action_id ==
EActions.WATCH_PLAYER)
9889 {
9890 PluginDeveloper.SetDeveloperItemClientEx(player);
9891 }
9892 #endif
9894 {
9895 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9896 {
9897 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9898 OnDebugButtonPressServer(id + 1);
9899 }
9900
9901 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9902 {
9903 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9905 }
9906
9907 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9908 {
9909 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9911 }
9912
9913 else if (action_id ==
EActions.ADD_QUANTITY)
9914 {
9915 if (IsMagazine())
9916 {
9917 Magazine mag = Magazine.Cast(this);
9918 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9919 }
9920 else
9921 {
9923 }
9924
9925 if (m_EM)
9926 {
9927 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9928 }
9929
9930 }
9931
9932 else if (action_id ==
EActions.REMOVE_QUANTITY)
9933 {
9934 if (IsMagazine())
9935 {
9936 Magazine mag2 = Magazine.Cast(this);
9937 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9938 }
9939 else
9940 {
9942 }
9943 if (m_EM)
9944 {
9945 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9946 }
9947
9948 }
9949
9950 else if (action_id ==
EActions.SET_QUANTITY_0)
9951 {
9953
9954 if (m_EM)
9955 {
9956 m_EM.SetEnergy(0);
9957 }
9958 }
9959
9960 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9961 {
9963
9964 if (m_EM)
9965 {
9966 m_EM.SetEnergy(m_EM.GetEnergyMax());
9967 }
9968 }
9969
9970 else if (action_id ==
EActions.ADD_HEALTH)
9971 {
9972 AddHealth("","",GetMaxHealth("","Health")/5);
9973 }
9974 else if (action_id ==
EActions.REMOVE_HEALTH)
9975 {
9976 AddHealth("","",-GetMaxHealth("","Health")/5);
9977 }
9978 else if (action_id ==
EActions.DESTROY_HEALTH)
9979 {
9980 SetHealth01("","",0);
9981 }
9982 else if (action_id ==
EActions.WATCH_ITEM)
9983 {
9985 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9986 #ifdef DEVELOPER
9987 SetDebugDeveloper_item(this);
9988 #endif
9989 }
9990
9991 else if (action_id ==
EActions.ADD_TEMPERATURE)
9992 {
9993 AddTemperature(20);
9994
9995 }
9996
9997 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9998 {
9999 AddTemperature(-20);
10000
10001 }
10002
10003 else if (action_id ==
EActions.FLIP_FROZEN)
10004 {
10005 SetFrozen(!GetIsFrozen());
10006
10007 }
10008
10009 else if (action_id ==
EActions.ADD_WETNESS)
10010 {
10012
10013 }
10014
10015 else if (action_id ==
EActions.REMOVE_WETNESS)
10016 {
10018
10019 }
10020
10021 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10022 {
10025
10026
10027 }
10028
10029 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10030 {
10033 }
10034
10035 else if (action_id ==
EActions.MAKE_SPECIAL)
10036 {
10037 auto debugParams = DebugSpawnParams.WithPlayer(player);
10038 OnDebugSpawnEx(debugParams);
10039 }
10040
10041 }
10042
10043
10044 return false;
10045 }
10046
10047
10048
10049
10053
10056
10057
10058
10060 {
10061 return false;
10062 }
10063
10064
10066 {
10067 return true;
10068 }
10069
10070
10072 {
10073 return true;
10074 }
10075
10076
10077
10079 {
10080 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10082 }
10083
10086 {
10087 return null;
10088 }
10089
10091 {
10092 return false;
10093 }
10094
10096 {
10097 return false;
10098 }
10099
10103
10104
10106 {
10107 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10108 return module_repairing.CanRepair(this, item_repair_kit);
10109 }
10110
10111
10112 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10113 {
10114 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10115 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10116 }
10117
10118
10120 {
10121
10122
10123
10124
10125
10126
10127
10128
10129 return 1;
10130 }
10131
10132
10133
10135 {
10137 }
10138
10139
10140
10142 {
10144 }
10145
10146
10155 {
10156 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10157
10158 if (player)
10159 {
10160 player.MessageStatus(text);
10161 }
10162 }
10163
10164
10173 {
10174 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10175
10176 if (player)
10177 {
10178 player.MessageAction(text);
10179 }
10180 }
10181
10182
10191 {
10192 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10193
10194 if (player)
10195 {
10196 player.MessageFriendly(text);
10197 }
10198 }
10199
10200
10209 {
10210 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10211
10212 if (player)
10213 {
10214 player.MessageImportant(text);
10215 }
10216 }
10217
10219 {
10220 return true;
10221 }
10222
10223
10224 override bool KindOf(
string tag)
10225 {
10226 bool found = false;
10227 string item_name = this.
GetType();
10230
10231 int array_size = item_tag_array.Count();
10232 for (int i = 0; i < array_size; i++)
10233 {
10234 if (item_tag_array.Get(i) == tag)
10235 {
10236 found = true;
10237 break;
10238 }
10239 }
10240 return found;
10241 }
10242
10243
10245 {
10246
10247 super.OnRPC(sender, rpc_type,ctx);
10248
10249
10250 switch (rpc_type)
10251 {
10252 #ifndef SERVER
10253 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10254 Param2<bool, string> p = new Param2<bool, string>(false, "");
10255
10257 return;
10258
10259 bool play = p.param1;
10260 string soundSet = p.param2;
10261
10262 if (play)
10263 {
10265 {
10267 {
10269 }
10270 }
10271 else
10272 {
10274 }
10275 }
10276 else
10277 {
10279 }
10280
10281 break;
10282 #endif
10283
10284 }
10285
10287 {
10289 }
10290 }
10291
10292
10293
10294
10296 {
10297 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10298 return plugin.GetID(
name);
10299 }
10300
10302 {
10303 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10304 return plugin.GetName(id);
10305 }
10306
10309 {
10310
10311
10312 int varFlags;
10313 if (!ctx.
Read(varFlags))
10314 return;
10315
10316 if (varFlags & ItemVariableFlags.FLOAT)
10317 {
10319 }
10320 }
10321
10323 {
10324
10325 super.SerializeNumericalVars(floats_out);
10326
10327
10328
10330 {
10332 }
10333
10335 {
10337 }
10338
10340 {
10342 }
10343
10345 {
10350 }
10351
10353 {
10355 }
10356 }
10357
10359 {
10360
10361 super.DeSerializeNumericalVars(floats);
10362
10363
10364 int index = 0;
10365 int mask = Math.Round(floats.Get(index));
10366
10367 index++;
10368
10370 {
10372 {
10374 }
10375 else
10376 {
10377 float quantity = floats.Get(index);
10378 SetQuantity(quantity,
true,
false,
false,
false);
10379 }
10380 index++;
10381 }
10382
10384 {
10385 float wet = floats.Get(index);
10387 index++;
10388 }
10389
10391 {
10392 int liquidtype = Math.Round(floats.Get(index));
10394 index++;
10395 }
10396
10398 {
10400 index++;
10402 index++;
10404 index++;
10406 index++;
10407 }
10408
10410 {
10411 int cleanness = Math.Round(floats.Get(index));
10413 index++;
10414 }
10415 }
10416
10418 {
10419 super.WriteVarsToCTX(ctx);
10420
10421
10423 {
10425 }
10426
10428 {
10430 }
10431
10433 {
10435 }
10436
10438 {
10439 int r,g,b,a;
10445 }
10446
10448 {
10450 }
10451 }
10452
10454 {
10455 if (!super.ReadVarsFromCTX(ctx,version))
10456 return false;
10457
10458 int intValue;
10459 float value;
10460
10461 if (version < 140)
10462 {
10463 if (!ctx.
Read(intValue))
10464 return false;
10465
10466 m_VariablesMask = intValue;
10467 }
10468
10470 {
10471 if (!ctx.
Read(value))
10472 return false;
10473
10475 {
10477 }
10478 else
10479 {
10481 }
10482 }
10483
10484 if (version < 140)
10485 {
10487 {
10488 if (!ctx.
Read(value))
10489 return false;
10490 SetTemperatureDirect(value);
10491 }
10492 }
10493
10495 {
10496 if (!ctx.
Read(value))
10497 return false;
10499 }
10500
10502 {
10503 if (!ctx.
Read(intValue))
10504 return false;
10506 }
10507
10509 {
10510 int r,g,b,a;
10512 return false;
10514 return false;
10516 return false;
10518 return false;
10519
10521 }
10522
10524 {
10525 if (!ctx.
Read(intValue))
10526 return false;
10528 }
10529
10530 if (version >= 138 && version < 140)
10531 {
10533 {
10534 if (!ctx.
Read(intValue))
10535 return false;
10536 SetFrozen(intValue);
10537 }
10538 }
10539
10540 return true;
10541 }
10542
10543
10545 {
10548 {
10550 }
10551
10552 if (!super.OnStoreLoad(ctx, version))
10553 {
10555 return false;
10556 }
10557
10558 if (version >= 114)
10559 {
10560 bool hasQuickBarIndexSaved;
10561
10562 if (!ctx.
Read(hasQuickBarIndexSaved))
10563 {
10565 return false;
10566 }
10567
10568 if (hasQuickBarIndexSaved)
10569 {
10570 int itmQBIndex;
10571
10572
10573 if (!ctx.
Read(itmQBIndex))
10574 {
10576 return false;
10577 }
10578
10579 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10580 if (itmQBIndex != -1 && parentPlayer)
10581 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10582 }
10583 }
10584 else
10585 {
10586
10587 PlayerBase player;
10588 int itemQBIndex;
10589 if (version ==
int.
MAX)
10590 {
10591 if (!ctx.
Read(itemQBIndex))
10592 {
10594 return false;
10595 }
10596 }
10597 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10598 {
10599
10600 if (!ctx.
Read(itemQBIndex))
10601 {
10603 return false;
10604 }
10605 if (itemQBIndex != -1 && player)
10606 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10607 }
10608 }
10609
10610 if (version < 140)
10611 {
10612
10613 if (!LoadVariables(ctx, version))
10614 {
10616 return false;
10617 }
10618 }
10619
10620
10622 {
10624 return false;
10625 }
10626 if (version >= 132)
10627 {
10629 if (raib)
10630 {
10632 {
10634 return false;
10635 }
10636 }
10637 }
10638
10640 return true;
10641 }
10642
10643
10644
10646 {
10647 super.OnStoreSave(ctx);
10648
10649 PlayerBase player;
10650 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10651 {
10653
10654 int itemQBIndex = -1;
10655 itemQBIndex = player.FindQuickBarEntityIndex(this);
10656 ctx.
Write(itemQBIndex);
10657 }
10658 else
10659 {
10661 }
10662
10664
10666 if (raib)
10667 {
10669 }
10670 }
10671
10672
10674 {
10675 super.AfterStoreLoad();
10676
10678 {
10680 }
10681
10683 {
10686 }
10687 }
10688
10690 {
10691 super.EEOnAfterLoad();
10692
10694 {
10696 }
10697
10700 }
10701
10703 {
10704 return false;
10705 }
10706
10707
10708
10710 {
10712 {
10713 #ifdef PLATFORM_CONSOLE
10714
10716 {
10718 if (menu)
10719 {
10721 }
10722 }
10723 #endif
10724 }
10725
10727 {
10730 }
10731
10733 {
10734 SetWeightDirty();
10736 }
10738 {
10741 }
10742
10744 {
10747 }
10749 {
10752 }
10753
10754 super.OnVariablesSynchronized();
10755 }
10756
10757
10758
10760 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10761 {
10762 if (!IsServerCheck(allow_client))
10763 return false;
10764
10766 return false;
10767
10770
10771 if (value <= (min + 0.001))
10772 value = min;
10773
10774 if (value == min)
10775 {
10776 if (destroy_config)
10777 {
10778 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10779 if (dstr)
10780 {
10782 this.Delete();
10783 return true;
10784 }
10785 }
10786 else if (destroy_forced)
10787 {
10789 this.Delete();
10790 return true;
10791 }
10792
10794 }
10795
10798
10800 {
10802
10803 if (delta)
10805 }
10806
10808
10809 return false;
10810 }
10811
10812
10814 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10815 {
10817 }
10818
10820 {
10823 }
10824
10826 {
10829 }
10830
10832 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10833 {
10834 float value_clamped = Math.Clamp(value, 0, 1);
10836 SetQuantity(result, destroy_config, destroy_forced);
10837 }
10838
10839
10842 {
10844 }
10845
10847 {
10849 }
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10861 {
10862 int slot = -1;
10863 if (GetInventory())
10864 {
10865 InventoryLocation il = new InventoryLocation;
10866 GetInventory().GetCurrentInventoryLocation(il);
10868 }
10869
10871 }
10872
10874 {
10875 float quantity_max = 0;
10876
10878 {
10879 if (attSlotID != -1)
10880 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10881
10882 if (quantity_max <= 0)
10884 }
10885
10886 if (quantity_max <= 0)
10888
10889 return quantity_max;
10890 }
10891
10893 {
10895 }
10896
10898 {
10900 }
10901
10902
10904 {
10906 }
10907
10909 {
10911 }
10912
10914 {
10916 }
10917
10918
10920 {
10921
10922 float weightEx = GetWeightEx();
10923 float special = GetInventoryAndCargoWeight();
10924 return weightEx - special;
10925 }
10926
10927
10929 {
10931 }
10932
10934 {
10936 {
10937 #ifdef DEVELOPER
10938 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10939 {
10940 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10942 }
10943 #endif
10944
10945 return GetQuantity() * GetConfigWeightModified();
10946 }
10947 else if (HasEnergyManager())
10948 {
10949 #ifdef DEVELOPER
10950 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10951 {
10952 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10953 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10954 }
10955 #endif
10956 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10957 }
10958 else
10959 {
10960 #ifdef DEVELOPER
10961 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10962 {
10963 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10964 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10965 }
10966 #endif
10967 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10968 }
10969 }
10970
10973 {
10974 int item_count = 0;
10976
10977 if (GetInventory().GetCargo() != NULL)
10978 {
10979 item_count = GetInventory().GetCargo().GetItemCount();
10980 }
10981
10982 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10983 {
10984 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10985 if (item)
10986 item_count += item.GetNumberOfItems();
10987 }
10988 return item_count;
10989 }
10990
10993 {
10994 float weight = 0;
10995 float wetness = 1;
10996 if (include_wetness)
10999 {
11000 weight = wetness * m_ConfigWeight;
11001 }
11003 {
11004 weight = 1;
11005 }
11006 return weight;
11007 }
11008
11009
11010
11012 {
11013 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11014 {
11015 GameInventory inv = GetInventory();
11016 array<EntityAI> items = new array<EntityAI>;
11018 for (int i = 0; i < items.Count(); i++)
11019 {
11021 if (item)
11022 {
11024 }
11025 }
11026 }
11027 }
11028
11029
11030
11031
11033 {
11034 float energy = 0;
11035 if (HasEnergyManager())
11036 {
11037 energy = GetCompEM().GetEnergy();
11038 }
11039 return energy;
11040 }
11041
11042
11044 {
11045 super.OnEnergyConsumed();
11046
11048 }
11049
11051 {
11052 super.OnEnergyAdded();
11053
11055 }
11056
11057
11059 {
11060 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11061 {
11063 {
11064 float energy_0to1 = GetCompEM().GetEnergy0To1();
11066 }
11067 }
11068 }
11069
11070
11072 {
11073 return ConfigGetFloat("heatIsolation");
11074 }
11075
11077 {
11079 }
11080
11082 {
11083 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11084 if (
GetGame().ConfigIsExisting(paramPath))
11086
11087 return 0.0;
11088 }
11089
11091 {
11092 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11093 if (
GetGame().ConfigIsExisting(paramPath))
11095
11096 return 0.0;
11097 }
11098
11099 override void SetWet(
float value,
bool allow_client =
false)
11100 {
11101 if (!IsServerCheck(allow_client))
11102 return;
11103
11106
11108
11109 m_VarWet = Math.Clamp(value, min, max);
11110
11112 {
11115 }
11116 }
11117
11118 override void AddWet(
float value)
11119 {
11121 }
11122
11124 {
11126 }
11127
11129 {
11131 }
11132
11134 {
11136 }
11137
11139 {
11141 }
11142
11144 {
11146 }
11147
11148 override void OnWetChanged(
float newVal,
float oldVal)
11149 {
11152 if (newLevel != oldLevel)
11153 {
11155 }
11156 }
11157
11159 {
11160 SetWeightDirty();
11161 }
11162
11164 {
11165 return GetWetLevelInternal(
m_VarWet);
11166 }
11167
11168
11169
11171 {
11173 }
11174
11176 {
11178 }
11179
11181 {
11183 }
11184
11186 {
11188 }
11189
11190
11191
11193 {
11194 if (ConfigIsExisting("itemModelLength"))
11195 {
11196 return ConfigGetFloat("itemModelLength");
11197 }
11198 return 0;
11199 }
11200
11202 {
11203 if (ConfigIsExisting("itemAttachOffset"))
11204 {
11205 return ConfigGetFloat("itemAttachOffset");
11206 }
11207 return 0;
11208 }
11209
11210 override void SetCleanness(
int value,
bool allow_client =
false)
11211 {
11212 if (!IsServerCheck(allow_client))
11213 return;
11214
11216
11218
11221 }
11222
11224 {
11226 }
11227
11229 {
11230 return true;
11231 }
11232
11233
11234
11235
11237 {
11239 }
11240
11242 {
11244 }
11245
11246
11247
11248
11249 override void SetColor(
int r,
int g,
int b,
int a)
11250 {
11256 }
11258 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11259 {
11264 }
11265
11267 {
11269 }
11270
11273 {
11274 int r,g,b,a;
11276 r = r/255;
11277 g = g/255;
11278 b = b/255;
11279 a = a/255;
11280 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11281 }
11282
11283
11284
11285 override void SetLiquidType(
int value,
bool allow_client =
false)
11286 {
11287 if (!IsServerCheck(allow_client))
11288 return;
11289
11294 }
11295
11297 {
11298 return ConfigGetInt("varLiquidTypeInit");
11299 }
11300
11302 {
11304 }
11305
11307 {
11309 SetFrozen(false);
11310 }
11311
11314 {
11315 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11316 }
11317
11318
11321 {
11322 PlayerBase nplayer;
11323 if (PlayerBase.CastTo(nplayer, player))
11324 {
11326
11327 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11328 }
11329 }
11330
11331
11334 {
11335 PlayerBase nplayer;
11336 if (PlayerBase.CastTo(nplayer,player))
11337 {
11338
11339 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11340
11341 }
11342
11343
11344 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11345
11346
11347 if (HasEnergyManager())
11348 {
11349 GetCompEM().UpdatePlugState();
11350 }
11351 }
11352
11353
11355 {
11356 super.OnPlacementStarted(player);
11357
11359 }
11360
11361 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11362 {
11364 {
11365 m_AdminLog.OnPlacementComplete(player,
this);
11366 }
11367
11368 super.OnPlacementComplete(player, position, orientation);
11369 }
11370
11371
11372
11373
11374
11376 {
11378 {
11379 return true;
11380 }
11381 else
11382 {
11383 return false;
11384 }
11385 }
11386
11387
11389 {
11391 {
11393 }
11394 }
11395
11396
11398 {
11400 }
11401
11403 {
11405 }
11406
11407 override void InsertAgent(
int agent,
float count = 1)
11408 {
11409 if (count < 1)
11410 return;
11411
11413 }
11414
11417 {
11419 }
11420
11421
11423 {
11425 }
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11469 {
11471 return false;
11472 return true;
11473 }
11474
11476 {
11477
11479 }
11480
11481
11484 {
11485 super.CheckForRoofLimited(timeTresholdMS);
11486
11488 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11489 {
11490 m_PreviousRoofTestTime = time;
11491 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11492 }
11493 }
11494
11495
11497 {
11499 {
11500 return 0;
11501 }
11502
11503 if (GetInventory().GetAttachmentSlotsCount() != 0)
11504 {
11505 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11506 if (filter)
11507 return filter.GetProtectionLevel(type, false, system);
11508 else
11509 return 0;
11510 }
11511
11512 string subclassPath, entryName;
11513
11514 switch (type)
11515 {
11517 entryName = "biological";
11518 break;
11520 entryName = "chemical";
11521 break;
11522 default:
11523 entryName = "biological";
11524 break;
11525 }
11526
11527 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11528
11530 }
11531
11532
11533
11536 {
11537 if (!IsMagazine())
11539
11541 }
11542
11543
11544
11545
11546
11551 {
11552 return true;
11553 }
11554
11556 {
11558 }
11559
11560
11561
11562
11563
11565 {
11566 if (parent)
11567 {
11568 if (parent.IsInherited(DayZInfected))
11569 return true;
11570
11571 if (!parent.IsRuined())
11572 return true;
11573 }
11574
11575 return true;
11576 }
11577
11579 {
11580 if (!super.CanPutAsAttachment(parent))
11581 {
11582 return false;
11583 }
11584
11585 if (!IsRuined() && !parent.IsRuined())
11586 {
11587 return true;
11588 }
11589
11590 return false;
11591 }
11592
11594 {
11595
11596
11597
11598
11599 return super.CanReceiveItemIntoCargo(item);
11600 }
11601
11603 {
11604
11605
11606
11607
11608 GameInventory attachmentInv = attachment.GetInventory();
11610 {
11611 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11612 return false;
11613 }
11614
11615 InventoryLocation loc = new InventoryLocation();
11616 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11617 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11618 return false;
11619
11620 return super.CanReceiveAttachment(attachment, slotId);
11621 }
11622
11624 {
11625 if (!super.CanReleaseAttachment(attachment))
11626 return false;
11627
11628 return GetInventory().AreChildrenAccessible();
11629 }
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11652 {
11653 int id = muzzle_owner.GetMuzzleID();
11654 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11655
11656 if (WPOF_array)
11657 {
11658 for (int i = 0; i < WPOF_array.Count(); i++)
11659 {
11660 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11661
11662 if (WPOF)
11663 {
11664 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11665 }
11666 }
11667 }
11668 }
11669
11670
11672 {
11673 int id = muzzle_owner.GetMuzzleID();
11675
11676 if (WPOBE_array)
11677 {
11678 for (int i = 0; i < WPOBE_array.Count(); i++)
11679 {
11680 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11681
11682 if (WPOBE)
11683 {
11684 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11685 }
11686 }
11687 }
11688 }
11689
11690
11692 {
11693 int id = muzzle_owner.GetMuzzleID();
11694 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11695
11696 if (WPOOH_array)
11697 {
11698 for (int i = 0; i < WPOOH_array.Count(); i++)
11699 {
11700 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11701
11702 if (WPOOH)
11703 {
11704 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11705 }
11706 }
11707 }
11708 }
11709
11710
11712 {
11713 int id = muzzle_owner.GetMuzzleID();
11714 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11715
11716 if (WPOOH_array)
11717 {
11718 for (int i = 0; i < WPOOH_array.Count(); i++)
11719 {
11720 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11721
11722 if (WPOOH)
11723 {
11724 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11725 }
11726 }
11727 }
11728 }
11729
11730
11732 {
11733 int id = muzzle_owner.GetMuzzleID();
11734 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11735
11736 if (WPOOH_array)
11737 {
11738 for (int i = 0; i < WPOOH_array.Count(); i++)
11739 {
11740 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11741
11742 if (WPOOH)
11743 {
11744 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11745 }
11746 }
11747 }
11748 }
11749
11750
11751
11753 {
11755 {
11756 return true;
11757 }
11758
11759 return false;
11760 }
11761
11763 {
11765 {
11766 return true;
11767 }
11768
11769 return false;
11770 }
11771
11773 {
11775 {
11776 return true;
11777 }
11778
11779 return false;
11780 }
11781
11783 {
11784 return false;
11785 }
11786
11789 {
11790 return UATimeSpent.DEFAULT_DEPLOY;
11791 }
11792
11793
11794
11795
11797 {
11799 SetSynchDirty();
11800 }
11801
11803 {
11805 }
11806
11807
11809 {
11810 return false;
11811 }
11812
11815 {
11816 string att_type = "None";
11817
11818 if (ConfigIsExisting("soundAttType"))
11819 {
11820 att_type = ConfigGetString("soundAttType");
11821 }
11822
11824 }
11825
11827 {
11829 }
11830
11831
11832
11833
11834
11840
11842 {
11845
11847 }
11848
11849
11851 {
11853 return;
11854
11856
11859
11862
11863 SoundParameters params = new SoundParameters();
11867 }
11868
11869
11871 {
11873 return;
11874
11876 SetSynchDirty();
11877
11880 }
11881
11882
11884 {
11886 return;
11887
11889 SetSynchDirty();
11890
11893 }
11894
11896 {
11898 }
11899
11901 {
11903 }
11904
11907 {
11908 if (!
GetGame().IsDedicatedServer())
11909 {
11910 if (ConfigIsExisting("attachSoundSet"))
11911 {
11912 string cfg_path = "";
11913 string soundset = "";
11914 string type_name =
GetType();
11915
11918 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11919 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11920
11921 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11922 {
11923 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11924 {
11925 if (cfg_slot_array[i] == slot_type)
11926 {
11927 soundset = cfg_soundset_array[i];
11928 break;
11929 }
11930 }
11931 }
11932
11933 if (soundset != "")
11934 {
11935 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11937 }
11938 }
11939 }
11940 }
11941
11943 {
11944
11945 }
11946
11947 void OnApply(PlayerBase player);
11948
11950 {
11951 return 1.0;
11952 };
11953
11955 {
11957 }
11958
11960 {
11962 }
11963
11965
11967 {
11968 SetDynamicPhysicsLifeTime(0.01);
11970 }
11971
11973 {
11974 array<string> zone_names = new array<string>;
11975 GetDamageZones(zone_names);
11976 for (int i = 0; i < zone_names.Count(); i++)
11977 {
11978 SetHealthMax(zone_names.Get(i),"Health");
11979 }
11980 SetHealthMax("","Health");
11981 }
11982
11985 {
11986 float global_health = GetHealth01("","Health");
11987 array<string> zones = new array<string>;
11988 GetDamageZones(zones);
11989
11990 for (int i = 0; i < zones.Count(); i++)
11991 {
11992 SetHealth01(zones.Get(i),"Health",global_health);
11993 }
11994 }
11995
11998 {
11999 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12000 }
12001
12003 {
12004 if (!hasRootAsPlayer)
12005 {
12006 if (refParentIB)
12007 {
12008
12009 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12010 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12011
12012 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12013 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12014
12017 }
12018 else
12019 {
12020
12023 }
12024 }
12025 }
12026
12028 {
12030 {
12031 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12032 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12033 {
12034 float heatPermCoef = 1.0;
12036 while (ent)
12037 {
12038 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12039 ent = ent.GetHierarchyParent();
12040 }
12041
12042 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12043 }
12044 }
12045 }
12046
12048 {
12049
12050 EntityAI parent = GetHierarchyParent();
12051 if (!parent)
12052 {
12053 hasParent = false;
12054 hasRootAsPlayer = false;
12055 }
12056 else
12057 {
12058 hasParent = true;
12059 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12060 refParentIB =
ItemBase.Cast(parent);
12061 }
12062 }
12063
12064 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12065 {
12066
12067 }
12068
12070 {
12071
12072 return false;
12073 }
12074
12076 {
12077
12078
12079 return false;
12080 }
12081
12083 {
12084
12085 return false;
12086 }
12087
12090 {
12091 return !GetIsFrozen() &&
IsOpen();
12092 }
12093
12095 {
12096 bool hasParent = false, hasRootAsPlayer = false;
12098
12099 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12100 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12101
12102 if (wwtu || foodDecay)
12103 {
12107
12108 if (processWetness || processTemperature || processDecay)
12109 {
12111
12112 if (processWetness)
12113 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12114
12115 if (processTemperature)
12117
12118 if (processDecay)
12119 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12120 }
12121 }
12122 }
12123
12126 {
12128 }
12129
12131 {
12134
12135 return super.GetTemperatureFreezeThreshold();
12136 }
12137
12139 {
12142
12143 return super.GetTemperatureThawThreshold();
12144 }
12145
12147 {
12150
12151 return super.GetItemOverheatThreshold();
12152 }
12153
12155 {
12157 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12158
12159 return super.GetTemperatureFreezeTime();
12160 }
12161
12163 {
12165 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12166
12167 return super.GetTemperatureThawTime();
12168 }
12169
12174
12176 {
12177 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12178 }
12179
12181 {
12182 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12183 }
12184
12187 {
12189 }
12190
12192 {
12194 }
12195
12197 {
12199 }
12200
12203 {
12204 return null;
12205 }
12206
12209 {
12210 return false;
12211 }
12212
12214 {
12216 {
12219 if (!trg)
12220 {
12222 explosive = this;
12223 }
12224
12225 explosive.PairRemote(trg);
12227
12228 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12229 trg.SetPersistentPairID(persistentID);
12230 explosive.SetPersistentPairID(persistentID);
12231
12232 return true;
12233 }
12234 return false;
12235 }
12236
12239 {
12240 float ret = 1.0;
12243 ret *= GetHealth01();
12244
12245 return ret;
12246 }
12247
12248 #ifdef DEVELOPER
12249 override void SetDebugItem()
12250 {
12251 super.SetDebugItem();
12252 _itemBase = this;
12253 }
12254
12256 {
12257 string text = super.GetDebugText();
12258
12260 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12261
12262 return text;
12263 }
12264 #endif
12265
12267 {
12268 return true;
12269 }
12270
12272
12274
12276 {
12279 }
12280
12281
12289
12305}
12306
12308{
12310 if (entity)
12311 {
12312 bool is_item = entity.IsInherited(
ItemBase);
12313 if (is_item && full_quantity)
12314 {
12317 }
12318 }
12319 else
12320 {
12322 return NULL;
12323 }
12324 return entity;
12325}
12326
12328{
12329 if (item)
12330 {
12331 if (health > 0)
12332 item.SetHealth("", "", health);
12333
12334 if (item.CanHaveTemperature())
12335 {
12337 if (item.CanFreeze())
12338 item.SetFrozen(false);
12339 }
12340
12341 if (item.HasEnergyManager())
12342 {
12343 if (quantity >= 0)
12344 {
12345 item.GetCompEM().SetEnergy0To1(quantity);
12346 }
12347 else
12348 {
12350 }
12351 }
12352 else if (item.IsMagazine())
12353 {
12354 Magazine mag = Magazine.Cast(item);
12355 if (quantity >= 0)
12356 {
12357 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12358 }
12359 else
12360 {
12362 }
12363
12364 }
12365 else
12366 {
12367 if (quantity >= 0)
12368 {
12369 item.SetQuantityNormalized(quantity, false);
12370 }
12371 else
12372 {
12374 }
12375
12376 }
12377 }
12378}
12379
12380#ifdef DEVELOPER
12382#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.