7451{
7453 {
7454 return true;
7455 }
7456};
7457
7458
7459
7461{
7465
7467
7470
7471
7472
7473
7474
7483
7489
7494
7499
7520 protected bool m_IsResultOfSplit
7521
7523
7528
7529
7530
7532
7536
7537
7538
7540
7543
7544
7545
7551
7552
7560
7563
7564
7566
7567
7569
7570
7575
7576
7581
7582
7584
7585
7587 {
7592
7593 if (!
GetGame().IsDedicatedServer())
7594 {
7596 {
7598
7600 {
7602 }
7603 }
7604
7607 }
7608
7609 m_OldLocation = null;
7610
7612 {
7614 }
7615
7616 if (ConfigIsExisting("headSelectionsToHide"))
7617 {
7620 }
7621
7623 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7624 {
7626 }
7627
7629
7630 m_IsResultOfSplit = false;
7631
7633 }
7634
7636 {
7637 super.InitItemVariables();
7638
7644 m_Count = ConfigGetInt(
"count");
7645
7648
7653
7656
7661
7673
7677
7678
7681 if (ConfigIsExisting("canBeSplit"))
7682 {
7685 }
7686
7688 if (ConfigIsExisting("itemBehaviour"))
7690
7691
7694 RegisterNetSyncVariableInt("m_VarLiquidType");
7695 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7696
7697 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7698 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7699 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7700
7701 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7702 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7703 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7704 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7705
7706 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7707 RegisterNetSyncVariableBool("m_IsTakeable");
7708 RegisterNetSyncVariableBool("m_IsHologram");
7709
7712 {
7715 }
7716
7718
7720 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7722
7723 }
7724
7726 {
7728 }
7729
7731 {
7734 {
7739 }
7740 }
7741
7742 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7743 {
7745 {
7748 }
7749
7751 }
7752
7754 {
7760 }
7761
7763
7765 {
7767
7768 if (!action)
7769 {
7770 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7771 return;
7772 }
7773
7775 if (!ai)
7776 {
7778 return;
7779 }
7780
7782 if (!action_array)
7783 {
7784 action_array = new array<ActionBase_Basic>;
7786 }
7787 if (LogManager.IsActionLogEnable())
7788 {
7789 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7790 }
7791
7792 if (action_array.Find(action) != -1)
7793 {
7794 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7795 }
7796 else
7797 {
7798 action_array.Insert(action);
7799 }
7800 }
7801
7803 {
7805 ActionBase action = player.GetActionManager().GetAction(actionName);
7808
7809 if (action_array)
7810 {
7811 action_array.RemoveItem(action);
7812 }
7813 }
7814
7815
7816
7818 {
7819 ActionOverrideData overrideData = new ActionOverrideData();
7823
7825 if (!actionMap)
7826 {
7829 }
7830
7831 actionMap.Insert(this.
Type(), overrideData);
7832
7833 }
7834
7836
7838
7839
7841 {
7844
7847
7848 string config_to_search = "CfgVehicles";
7849 string muzzle_owner_config;
7850
7852 {
7853 if (IsInherited(Weapon))
7854 config_to_search = "CfgWeapons";
7855
7856 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7857
7858 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7859
7861
7862 if (config_OnFire_subclass_count > 0)
7863 {
7864 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7865
7866 for (int i = 0; i < config_OnFire_subclass_count; i++)
7867 {
7868 string particle_class = "";
7870 string config_OnFire_entry = config_OnFire_class + particle_class;
7871 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7872 WPOF_array.Insert(WPOF);
7873 }
7874
7875
7877 }
7878 }
7879
7881 {
7882 config_to_search = "CfgWeapons";
7883 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7884
7885 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7886
7888
7889 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7890 {
7891 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7892
7893 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7894 {
7895 string particle_class2 = "";
7897 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7898 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7899 WPOBE_array.Insert(WPOBE);
7900 }
7901
7902
7904 }
7905 }
7906 }
7907
7908
7910 {
7913
7915 {
7916 string config_to_search = "CfgVehicles";
7917
7918 if (IsInherited(Weapon))
7919 config_to_search = "CfgWeapons";
7920
7921 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7922 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7923
7924 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7925 {
7926
7928
7930 {
7932 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7934 return;
7935 }
7936
7939
7940
7941
7943 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7944
7945 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7946 {
7947 string particle_class = "";
7949 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7951
7952 if (entry_type == CT_CLASS)
7953 {
7954 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7955 WPOOH_array.Insert(WPOF);
7956 }
7957 }
7958
7959
7961 }
7962 }
7963 }
7964
7966 {
7968 }
7969
7971 {
7973 {
7975
7978
7981
7982 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7983 }
7984 }
7985
7987 {
7989 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7990
7992 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7993
7995 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7996
7998 {
8000 }
8001 }
8002
8004 {
8006 }
8007
8009 {
8012 else
8014
8016 {
8019 }
8020 else
8021 {
8024
8027 }
8028
8030 }
8031
8033 {
8035 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8036 }
8037
8039 {
8041 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8043 }
8044
8046 {
8048 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8049 }
8050
8052 {
8055
8056 OverheatingParticle OP = new OverheatingParticle();
8061
8063 }
8064
8066 {
8069
8070 return -1;
8071 }
8072
8074 {
8076 {
8079
8080 for (int i = count; i > 0; --i)
8081 {
8082 int id = i - 1;
8085
8088
8089 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8090 {
8091 if (p)
8092 {
8095 }
8096 }
8097 }
8098 }
8099 }
8100
8102 {
8104 {
8106 {
8107 int id = i - 1;
8109
8110 if (OP)
8111 {
8113
8114 if (p)
8115 {
8117 }
8118
8119 delete OP;
8120 }
8121 }
8122
8125 }
8126 }
8127
8130 {
8131 return 0.0;
8132 }
8133
8134
8136 {
8137 return 250;
8138 }
8139
8141 {
8142 return 0;
8143 }
8144
8147 {
8149 return true;
8150
8151 return false;
8152 }
8153
8156 {
8159
8161 {
8163 }
8164 else
8165 {
8166
8168 }
8169
8171 }
8172
8179 {
8180 return -1;
8181 }
8182
8183
8184
8185
8187 {
8189 {
8191 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8192
8193 if (r_index >= 0)
8194 {
8195 InventoryLocation r_il = new InventoryLocation;
8196 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8197
8198 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8201 {
8202 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8203 }
8205 {
8206 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8207 }
8208
8209 }
8210
8211 player.GetHumanInventory().ClearUserReservedLocation(this);
8212 }
8213
8216 }
8217
8218
8219
8220
8222 {
8223 return ItemBase.m_DebugActionsMask;
8224 }
8225
8227 {
8228 return ItemBase.m_DebugActionsMask & mask;
8229 }
8230
8232 {
8233 ItemBase.m_DebugActionsMask = mask;
8234 }
8235
8237 {
8238 ItemBase.m_DebugActionsMask |= mask;
8239 }
8240
8242 {
8243 ItemBase.m_DebugActionsMask &= ~mask;
8244 }
8245
8247 {
8249 {
8251 }
8252 else
8253 {
8255 }
8256 }
8257
8258
8260 {
8261 if (GetEconomyProfile())
8262 {
8263 float q_max = GetEconomyProfile().GetQuantityMax();
8264 if (q_max > 0)
8265 {
8266 float q_min = GetEconomyProfile().GetQuantityMin();
8267 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8268
8270 {
8271 ComponentEnergyManager comp = GetCompEM();
8273 {
8275 }
8276 }
8278 {
8280
8281 }
8282
8283 }
8284 }
8285 }
8286
8289 {
8290 EntityAI parent = GetHierarchyParent();
8291
8292 if (parent)
8293 {
8294 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8295 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8296 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8297 }
8298 }
8299
8302 {
8303 EntityAI parent = GetHierarchyParent();
8304
8305 if (parent)
8306 {
8307 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8308 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8309 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8310 }
8311 }
8312
8314 {
8315
8316
8317
8318
8320
8322 {
8323 if (ScriptInputUserData.CanStoreInputUserData())
8324 {
8325 ScriptInputUserData ctx = new ScriptInputUserData;
8331 ctx.
Write(use_stack_max);
8334
8336 {
8337 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8338 }
8339 }
8340 }
8341 else if (!
GetGame().IsMultiplayer())
8342 {
8344 }
8345 }
8346
8348 {
8350 }
8351
8353 {
8355 }
8356
8358 {
8360 }
8361
8363 {
8364
8365 return false;
8366 }
8367
8369 {
8370 return false;
8371 }
8372
8376 {
8377 return false;
8378 }
8379
8381 {
8382 return "";
8383 }
8384
8386
8388 {
8389 return false;
8390 }
8391
8393 {
8394 return true;
8395 }
8396
8397
8398
8400 {
8401 return true;
8402 }
8403
8405 {
8406 return true;
8407 }
8408
8410 {
8411 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8413 }
8414
8416 {
8418 }
8419
8421 {
8423 if (!is_being_placed)
8425 SetSynchDirty();
8426 }
8427
8428
8430
8432 {
8434 }
8435
8437 {
8439 }
8440
8442 {
8443 return 1;
8444 }
8445
8447 {
8448 return false;
8449 }
8450
8452 {
8454 SetSynchDirty();
8455 }
8456
8457
8458
8459
8460
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
8492 {
8493 super.OnMovedInsideCargo(container);
8494
8495 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8496 }
8497
8498 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8499 {
8500 super.EEItemLocationChanged(oldLoc,newLoc);
8501
8502 PlayerBase new_player = null;
8503 PlayerBase old_player = null;
8504
8505 if (newLoc.GetParent())
8506 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8507
8508 if (oldLoc.GetParent())
8509 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8510
8512 {
8513 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8514
8515 if (r_index >= 0)
8516 {
8517 InventoryLocation r_il = new InventoryLocation;
8518 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8519
8520 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8523 {
8524 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8525 }
8527 {
8528 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8529 }
8530
8531 }
8532 }
8533
8535 {
8536 if (new_player)
8537 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8538
8539 if (new_player == old_player)
8540 {
8541
8542 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8543 {
8545 {
8546 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8547 {
8548 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8549 }
8550 }
8551 else
8552 {
8553 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8554 }
8555 }
8556
8557 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8558 {
8559 int type = oldLoc.GetType();
8561 {
8562 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8563 }
8565 {
8566 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8567 }
8568 }
8569 if (!m_OldLocation)
8570 {
8571 m_OldLocation = new InventoryLocation;
8572 }
8573 m_OldLocation.Copy(oldLoc);
8574 }
8575 else
8576 {
8577 if (m_OldLocation)
8578 {
8579 m_OldLocation.Reset();
8580 }
8581 }
8582
8584 }
8585 else
8586 {
8587 if (new_player)
8588 {
8589 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8590 if (res_index >= 0)
8591 {
8592 InventoryLocation il = new InventoryLocation;
8593 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8595 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8598 {
8599 il.
GetParent().GetOnReleaseLock().Invoke(it);
8600 }
8602 {
8604 }
8605
8606 }
8607 }
8609 {
8610
8612 }
8613
8614 if (m_OldLocation)
8615 {
8616 m_OldLocation.Reset();
8617 }
8618 }
8619 }
8620
8621 override void EOnContact(IEntity other, Contact extra)
8622 {
8624 {
8625 int liquidType = -1;
8627 if (impactSpeed > 0.0)
8628 {
8630 #ifndef SERVER
8632 #else
8634 SetSynchDirty();
8635 #endif
8637 }
8638 }
8639
8640 #ifdef SERVER
8641 if (GetCompEM() && GetCompEM().IsPlugged())
8642 {
8643 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8644 GetCompEM().UnplugThis();
8645 }
8646 #endif
8647 }
8648
8650
8652 {
8654 }
8655
8657 {
8658
8659 }
8660
8662 {
8663 super.OnItemLocationChanged(old_owner, new_owner);
8664
8665 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8666 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8667
8668 if (!relatedPlayer && playerNew)
8669 relatedPlayer = playerNew;
8670
8671 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8672 {
8674 if (actionMgr)
8675 {
8676 ActionBase currentAction = actionMgr.GetRunningAction();
8677 if (currentAction)
8679 }
8680 }
8681
8682 Man ownerPlayerOld = null;
8683 Man ownerPlayerNew = null;
8684
8685 if (old_owner)
8686 {
8687 if (old_owner.
IsMan())
8688 {
8689 ownerPlayerOld = Man.Cast(old_owner);
8690 }
8691 else
8692 {
8693 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8694 }
8695 }
8696 else
8697 {
8699 {
8701
8702 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8703 {
8704 GetCompEM().UnplugThis();
8705 }
8706 }
8707 }
8708
8709 if (new_owner)
8710 {
8711 if (new_owner.
IsMan())
8712 {
8713 ownerPlayerNew = Man.Cast(new_owner);
8714 }
8715 else
8716 {
8717 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8718 }
8719 }
8720
8721 if (ownerPlayerOld != ownerPlayerNew)
8722 {
8723 if (ownerPlayerOld)
8724 {
8725 array<EntityAI> subItemsExit = new array<EntityAI>;
8727 for (int i = 0; i < subItemsExit.Count(); i++)
8728 {
8731 }
8732 }
8733
8734 if (ownerPlayerNew)
8735 {
8736 array<EntityAI> subItemsEnter = new array<EntityAI>;
8738 for (int j = 0; j < subItemsEnter.Count(); j++)
8739 {
8742 }
8743 }
8744 }
8745 else if (ownerPlayerNew != null)
8746 {
8747 PlayerBase nplayer;
8748 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8749 {
8750 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8752 for (int k = 0; k < subItemsUpdate.Count(); k++)
8753 {
8755 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8756 }
8757 }
8758 }
8759
8760 if (old_owner)
8761 old_owner.OnChildItemRemoved(this);
8762 if (new_owner)
8763 new_owner.OnChildItemReceived(this);
8764 }
8765
8766
8768 {
8769 super.EEDelete(parent);
8770 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8771 if (player)
8772 {
8774
8775 if (player.IsAlive())
8776 {
8777 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8778 if (r_index >= 0)
8779 {
8780 InventoryLocation r_il = new InventoryLocation;
8781 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8782
8783 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8786 {
8787 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8788 }
8790 {
8791 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8792 }
8793
8794 }
8795
8796 player.RemoveQuickBarEntityShortcut(this);
8797 }
8798 }
8799 }
8800
8802 {
8803 super.EEKilled(killer);
8804
8807 {
8808 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8809 {
8810 if (IsMagazine())
8811 {
8812 if (Magazine.Cast(this).GetAmmoCount() > 0)
8813 {
8815 }
8816 }
8817 else
8818 {
8820 }
8821 }
8822 }
8823 }
8824
8826 {
8827 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8828
8829 super.OnWasAttached(parent, slot_id);
8830
8833
8835 }
8836
8838 {
8839 super.OnWasDetached(parent, slot_id);
8840
8843 }
8844
8846 {
8847 int idx;
8850
8851 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8852 if (inventory_slots.Count() < 1)
8853 {
8854 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8855 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8856 }
8857 else
8858 {
8859 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8860 }
8861
8862 idx = inventory_slots.Find(slot);
8863 if (idx < 0)
8864 return "";
8865
8866 return attach_types.Get(idx);
8867 }
8868
8870 {
8871 int idx = -1;
8872 string slot;
8873
8876
8877 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8878 if (inventory_slots.Count() < 1)
8879 {
8880 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8881 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8882 }
8883 else
8884 {
8885 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8886 if (detach_types.Count() < 1)
8887 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8888 }
8889
8890 for (int i = 0; i < inventory_slots.Count(); i++)
8891 {
8892 slot = inventory_slots.Get(i);
8893 }
8894
8895 if (slot != "")
8896 {
8897 if (detach_types.Count() == 1)
8898 idx = 0;
8899 else
8900 idx = inventory_slots.Find(slot);
8901 }
8902 if (idx < 0)
8903 return "";
8904
8905 return detach_types.Get(idx);
8906 }
8907
8909 {
8910
8912
8913
8914 float min_time = 1;
8915 float max_time = 3;
8916 float delay = Math.RandomFloat(min_time, max_time);
8917
8918 explode_timer.Run(delay, this, "DoAmmoExplosion");
8919 }
8920
8922 {
8923 Magazine magazine = Magazine.Cast(this);
8924 int pop_sounds_count = 6;
8925 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8926
8927
8928 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8929 string sound_name = pop_sounds[ sound_idx ];
8931
8932
8933 magazine.ServerAddAmmoCount(-1);
8934
8935
8936 float min_temp_to_explode = 100;
8937
8938 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8939 {
8941 }
8942 }
8943
8944
8945 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8946 {
8947 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8948
8949 const int CHANCE_DAMAGE_CARGO = 4;
8950 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8951 const int CHANCE_DAMAGE_NOTHING = 2;
8952
8954 {
8955 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8956 int chances;
8957 int rnd;
8958
8959 if (GetInventory().GetCargo())
8960 {
8961 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8962 rnd = Math.RandomInt(0,chances);
8963
8964 if (rnd < CHANCE_DAMAGE_CARGO)
8965 {
8967 }
8968 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8969 {
8971 }
8972 }
8973 else
8974 {
8975 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8976 rnd = Math.RandomInt(0,chances);
8977
8978 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8979 {
8981 }
8982 }
8983 }
8984 }
8985
8987 {
8988 if (GetInventory().GetCargo())
8989 {
8990 int item_count = GetInventory().GetCargo().GetItemCount();
8991 if (item_count > 0)
8992 {
8993 int random_pick = Math.RandomInt(0, item_count);
8995 if (!item.IsExplosive())
8996 {
8997 item.AddHealth("","",damage);
8998 return true;
8999 }
9000 }
9001 }
9002 return false;
9003 }
9004
9006 {
9007 int attachment_count = GetInventory().AttachmentCount();
9008 if (attachment_count > 0)
9009 {
9010 int random_pick = Math.RandomInt(0, attachment_count);
9011 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9012 if (!attachment.IsExplosive())
9013 {
9014 attachment.AddHealth("","",damage);
9015 return true;
9016 }
9017 }
9018 return false;
9019 }
9020
9022 {
9024 }
9025
9027 {
9029 return GetInventory().CanRemoveEntity();
9030
9031 return false;
9032 }
9033
9035 {
9036
9038 return false;
9039
9040
9042 return false;
9043
9044
9045
9047 if (delta == 0)
9048 return false;
9049
9050
9051 return true;
9052 }
9053
9055 {
9057 {
9058 if (ScriptInputUserData.CanStoreInputUserData())
9059 {
9060 ScriptInputUserData ctx = new ScriptInputUserData;
9065 ctx.
Write(destination_entity);
9069 }
9070 }
9071 else if (!
GetGame().IsMultiplayer())
9072 {
9074 }
9075 }
9076
9078 {
9079 float split_quantity_new;
9083 InventoryLocation loc = new InventoryLocation;
9084
9085 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9086 {
9088 split_quantity_new = stack_max;
9089 else
9091
9093 {
9094 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9095 if (new_item)
9096 {
9097 new_item.SetResultOfSplit(true);
9098 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9100 new_item.
SetQuantity(split_quantity_new,
false,
true);
9101 }
9102 }
9103 }
9104 else if (destination_entity && slot_id == -1)
9105 {
9106 if (quantity > stack_max)
9107 split_quantity_new = stack_max;
9108 else
9109 split_quantity_new = quantity;
9110
9112 {
9114 {
9117 }
9118
9119 if (new_item)
9120 {
9121 new_item.SetResultOfSplit(true);
9122 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9124 new_item.
SetQuantity(split_quantity_new,
false,
true);
9125 }
9126 }
9127 }
9128 else
9129 {
9130 if (stack_max != 0)
9131 {
9133 {
9135 }
9136
9137 if (split_quantity_new == 0)
9138 {
9139 if (!
GetGame().IsMultiplayer())
9140 player.PhysicalPredictiveDropItem(this);
9141 else
9142 player.ServerDropEntity(this);
9143 return;
9144 }
9145
9147 {
9149
9150 if (new_item)
9151 {
9152 new_item.SetResultOfSplit(true);
9153 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9156 new_item.PlaceOnSurface();
9157 }
9158 }
9159 }
9160 }
9161 }
9162
9164 {
9165 float split_quantity_new;
9169 InventoryLocation loc = new InventoryLocation;
9170
9171 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9172 {
9174 split_quantity_new = stack_max;
9175 else
9177
9179 {
9180 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9181 if (new_item)
9182 {
9183 new_item.SetResultOfSplit(true);
9184 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9186 new_item.
SetQuantity(split_quantity_new,
false,
true);
9187 }
9188 }
9189 }
9190 else if (destination_entity && slot_id == -1)
9191 {
9192 if (quantity > stack_max)
9193 split_quantity_new = stack_max;
9194 else
9195 split_quantity_new = quantity;
9196
9198 {
9200 {
9203 }
9204
9205 if (new_item)
9206 {
9207 new_item.SetResultOfSplit(true);
9208 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9210 new_item.
SetQuantity(split_quantity_new,
false,
true);
9211 }
9212 }
9213 }
9214 else
9215 {
9216 if (stack_max != 0)
9217 {
9219 {
9221 }
9222
9224 {
9226
9227 if (new_item)
9228 {
9229 new_item.SetResultOfSplit(true);
9230 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9233 new_item.PlaceOnSurface();
9234 }
9235 }
9236 }
9237 }
9238 }
9239
9241 {
9243 {
9244 if (ScriptInputUserData.CanStoreInputUserData())
9245 {
9246 ScriptInputUserData ctx = new ScriptInputUserData;
9251 dst.WriteToContext(ctx);
9253 }
9254 }
9255 else if (!
GetGame().IsMultiplayer())
9256 {
9258 }
9259 }
9260
9262 {
9264 {
9265 if (ScriptInputUserData.CanStoreInputUserData())
9266 {
9267 ScriptInputUserData ctx = new ScriptInputUserData;
9272 ctx.
Write(destination_entity);
9278 }
9279 }
9280 else if (!
GetGame().IsMultiplayer())
9281 {
9283 }
9284 }
9285
9287 {
9289 }
9290
9292 {
9294 float split_quantity_new;
9296 if (dst.IsValid())
9297 {
9298 int slot_id = dst.GetSlot();
9300
9301 if (quantity > stack_max)
9302 split_quantity_new = stack_max;
9303 else
9304 split_quantity_new = quantity;
9305
9307 {
9309
9310 if (new_item)
9311 {
9312 new_item.SetResultOfSplit(true);
9313 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9315 new_item.
SetQuantity(split_quantity_new,
false,
true);
9316 }
9317
9318 return new_item;
9319 }
9320 }
9321
9322 return null;
9323 }
9324
9326 {
9328 float split_quantity_new;
9330 if (destination_entity)
9331 {
9333 if (quantity > stackable)
9334 split_quantity_new = stackable;
9335 else
9336 split_quantity_new = quantity;
9337
9339 {
9340 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9341 if (new_item)
9342 {
9343 new_item.SetResultOfSplit(true);
9344 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9346 new_item.
SetQuantity(split_quantity_new,
false,
true);
9347 }
9348 }
9349 }
9350 }
9351
9353 {
9355 {
9356 if (ScriptInputUserData.CanStoreInputUserData())
9357 {
9358 ScriptInputUserData ctx = new ScriptInputUserData;
9363 ItemBase destination_entity =
this;
9364 ctx.
Write(destination_entity);
9368 }
9369 }
9370 else if (!
GetGame().IsMultiplayer())
9371 {
9373 }
9374 }
9375
9377 {
9379 float split_quantity_new;
9381 if (player)
9382 {
9384 if (quantity > stackable)
9385 split_quantity_new = stackable;
9386 else
9387 split_quantity_new = quantity;
9388
9390 {
9391 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9392 new_item =
ItemBase.Cast(in_hands);
9393 if (new_item)
9394 {
9395 new_item.SetResultOfSplit(true);
9396 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9398 new_item.SetQuantity(split_quantity_new, false, true);
9399 }
9400 }
9401 }
9402 }
9403
9405 {
9407 float split_quantity_new = Math.Floor(quantity * 0.5);
9408
9410 return;
9411
9413
9414 if (new_item)
9415 {
9416 if (new_item.GetQuantityMax() < split_quantity_new)
9417 {
9418 split_quantity_new = new_item.GetQuantityMax();
9419 }
9420
9421 new_item.SetResultOfSplit(true);
9422 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9423
9425 {
9428 }
9429 else
9430 {
9432 new_item.
SetQuantity(split_quantity_new,
false,
true);
9433 }
9434 }
9435 }
9436
9438 {
9440 float split_quantity_new = Math.Floor(quantity / 2);
9441
9443 return;
9444
9445 InventoryLocation invloc = new InventoryLocation;
9447
9449 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9450
9451 if (new_item)
9452 {
9453 if (new_item.GetQuantityMax() < split_quantity_new)
9454 {
9455 split_quantity_new = new_item.GetQuantityMax();
9456 }
9458 {
9461 }
9462 else if (split_quantity_new > 1)
9463 {
9465 new_item.
SetQuantity(split_quantity_new,
false,
true);
9466 }
9467 }
9468 }
9469
9472 {
9473 SetWeightDirty();
9475
9476 if (parent)
9477 parent.OnAttachmentQuantityChangedEx(this, delta);
9478
9480 {
9482 {
9484 }
9486 {
9487 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9489 }
9490 }
9491
9492 }
9493
9496 {
9497
9498 }
9499
9502 {
9504 }
9505
9507 {
9508 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9509
9511 {
9512 if (newLevel == GameConstants.STATE_RUINED)
9513 {
9515 EntityAI parent = GetHierarchyParent();
9516 if (parent && parent.IsFireplace())
9517 {
9518 CargoBase cargo = GetInventory().GetCargo();
9519 if (cargo)
9520 {
9522 {
9524 }
9525 }
9526 }
9527 }
9528
9530 {
9531
9533 return;
9534 }
9535
9536 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9537 {
9539 }
9540 }
9541 }
9542
9543
9545 {
9546 super.OnRightClick();
9547
9549 {
9551 {
9552 if (ScriptInputUserData.CanStoreInputUserData())
9553 {
9554 EntityAI root = GetHierarchyRoot();
9555 Man playerOwner = GetHierarchyRootPlayer();
9556 InventoryLocation dst = new InventoryLocation;
9557
9558
9559 if (!playerOwner && root && root == this)
9560 {
9562 }
9563 else
9564 {
9565
9566 GetInventory().GetCurrentInventoryLocation(dst);
9568 {
9571 {
9573 }
9574 else
9575 {
9577
9578
9579 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9580 {
9582 }
9583 else
9584 {
9585 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9586 }
9587 }
9588 }
9589 }
9590
9591 ScriptInputUserData ctx = new ScriptInputUserData;
9599 }
9600 }
9601 else if (!
GetGame().IsMultiplayer())
9602 {
9604 }
9605 }
9606 }
9607
9609 {
9610 if (root)
9611 {
9612 vector m4[4];
9613 root.GetTransform(m4);
9614 dst.SetGround(this, m4);
9615 }
9616 else
9617 {
9618 GetInventory().GetCurrentInventoryLocation(dst);
9619 }
9620 }
9621
9622 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9623 {
9624
9625 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9626 return false;
9627
9628 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9629 return false;
9630
9631
9633 return false;
9634
9635
9636 Magazine mag = Magazine.Cast(this);
9637 if (mag)
9638 {
9639 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9640 return false;
9641
9642 if (stack_max_limit)
9643 {
9644 Magazine other_mag = Magazine.Cast(other_item);
9645 if (other_item)
9646 {
9647 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9648 return false;
9649 }
9650
9651 }
9652 }
9653 else
9654 {
9655
9657 return false;
9658
9660 return false;
9661 }
9662
9663 PlayerBase player = null;
9664 if (CastTo(player, GetHierarchyRootPlayer()))
9665 {
9666 if (player.GetInventory().HasAttachment(this))
9667 return false;
9668
9669 if (player.IsItemsToDelete())
9670 return false;
9671 }
9672
9673 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9674 return false;
9675
9676 int slotID;
9678 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9679 return false;
9680
9681 return true;
9682 }
9683
9685 {
9687 }
9688
9690 {
9691 return m_IsResultOfSplit;
9692 }
9693
9695 {
9696 m_IsResultOfSplit = value;
9697 }
9698
9700 {
9702 }
9703
9705 {
9706 float other_item_quantity = other_item.GetQuantity();
9707 float this_free_space;
9708
9710
9712
9713 if (other_item_quantity > this_free_space)
9714 {
9715 return this_free_space;
9716 }
9717 else
9718 {
9719 return other_item_quantity;
9720 }
9721 }
9722
9724 {
9726 }
9727
9729 {
9731 return;
9732
9733 if (!IsMagazine() && other_item)
9734 {
9736 if (quantity_used != 0)
9737 {
9738 float hp1 = GetHealth01("","");
9739 float hp2 = other_item.GetHealth01("","");
9740 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9741 hpResult = hpResult / (
GetQuantity() + quantity_used);
9742
9743 hpResult *= GetMaxHealth();
9744 Math.Round(hpResult);
9745 SetHealth("", "Health", hpResult);
9746
9748 other_item.AddQuantity(-quantity_used);
9749 }
9750 }
9752 }
9753
9755 {
9756 #ifdef SERVER
9757 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9758 GetHierarchyParent().IncreaseLifetimeUp();
9759 #endif
9760 };
9761
9763 {
9764 PlayerBase p = PlayerBase.Cast(player);
9765
9766 array<int> recipesIds = p.m_Recipes;
9767 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9768 if (moduleRecipesManager)
9769 {
9770 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9771 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9772 }
9773
9774 for (int i = 0;i < recipesIds.Count(); i++)
9775 {
9776 int key = recipesIds.Get(i);
9777 string recipeName = moduleRecipesManager.GetRecipeName(key);
9779 }
9780 }
9781
9782
9783 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9784 {
9785 super.GetDebugActions(outputList);
9786
9787
9793
9794
9799
9804
9805
9809
9810
9812 {
9816 }
9817
9820
9821
9825
9827
9828 InventoryLocation loc = new InventoryLocation();
9829 GetInventory().GetCurrentInventoryLocation(loc);
9831 {
9832 if (Gizmo_IsSupported())
9835 }
9836
9838 }
9839
9840
9841
9842
9844 {
9845 super.OnAction(action_id, player, ctx);
9846
9848 {
9849 switch (action_id)
9850 {
9853 return true;
9856 return true;
9857 }
9858 }
9859
9861 {
9862 switch (action_id)
9863 {
9865 Delete();
9866 return true;
9867 }
9868 }
9869
9870 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9871 {
9872 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9873 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9874 PlayerBase p = PlayerBase.Cast(player);
9875 if (
EActions.RECIPES_RANGE_START < 1000)
9876 {
9877 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9878 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9879 }
9880 }
9881 #ifndef SERVER
9882 else if (action_id ==
EActions.WATCH_PLAYER)
9883 {
9884 PluginDeveloper.SetDeveloperItemClientEx(player);
9885 }
9886 #endif
9888 {
9889 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9890 {
9891 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9892 OnDebugButtonPressServer(id + 1);
9893 }
9894
9895 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9896 {
9897 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9899 }
9900
9901 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9902 {
9903 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9905 }
9906
9907 else if (action_id ==
EActions.ADD_QUANTITY)
9908 {
9909 if (IsMagazine())
9910 {
9911 Magazine mag = Magazine.Cast(this);
9912 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9913 }
9914 else
9915 {
9917 }
9918
9919 if (m_EM)
9920 {
9921 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9922 }
9923
9924 }
9925
9926 else if (action_id ==
EActions.REMOVE_QUANTITY)
9927 {
9928 if (IsMagazine())
9929 {
9930 Magazine mag2 = Magazine.Cast(this);
9931 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9932 }
9933 else
9934 {
9936 }
9937 if (m_EM)
9938 {
9939 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9940 }
9941
9942 }
9943
9944 else if (action_id ==
EActions.SET_QUANTITY_0)
9945 {
9947
9948 if (m_EM)
9949 {
9950 m_EM.SetEnergy(0);
9951 }
9952 }
9953
9954 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9955 {
9957
9958 if (m_EM)
9959 {
9960 m_EM.SetEnergy(m_EM.GetEnergyMax());
9961 }
9962 }
9963
9964 else if (action_id ==
EActions.ADD_HEALTH)
9965 {
9966 AddHealth("","",GetMaxHealth("","Health")/5);
9967 }
9968 else if (action_id ==
EActions.REMOVE_HEALTH)
9969 {
9970 AddHealth("","",-GetMaxHealth("","Health")/5);
9971 }
9972 else if (action_id ==
EActions.DESTROY_HEALTH)
9973 {
9974 SetHealth01("","",0);
9975 }
9976 else if (action_id ==
EActions.WATCH_ITEM)
9977 {
9979 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9980 #ifdef DEVELOPER
9981 SetDebugDeveloper_item(this);
9982 #endif
9983 }
9984
9985 else if (action_id ==
EActions.ADD_TEMPERATURE)
9986 {
9987 AddTemperature(20);
9988
9989 }
9990
9991 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9992 {
9993 AddTemperature(-20);
9994
9995 }
9996
9997 else if (action_id ==
EActions.FLIP_FROZEN)
9998 {
9999 SetFrozen(!GetIsFrozen());
10000
10001 }
10002
10003 else if (action_id ==
EActions.ADD_WETNESS)
10004 {
10006
10007 }
10008
10009 else if (action_id ==
EActions.REMOVE_WETNESS)
10010 {
10012
10013 }
10014
10015 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10016 {
10019
10020
10021 }
10022
10023 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10024 {
10027 }
10028
10029 else if (action_id ==
EActions.MAKE_SPECIAL)
10030 {
10031 auto debugParams = DebugSpawnParams.WithPlayer(player);
10032 OnDebugSpawnEx(debugParams);
10033 }
10034
10035 }
10036
10037
10038 return false;
10039 }
10040
10041
10042
10043
10047
10050
10051
10052
10054 {
10055 return false;
10056 }
10057
10058
10060 {
10061 return true;
10062 }
10063
10064
10066 {
10067 return true;
10068 }
10069
10070
10071
10073 {
10074 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10076 }
10077
10080 {
10081 return null;
10082 }
10083
10085 {
10086 return false;
10087 }
10088
10090 {
10091 return false;
10092 }
10093
10097
10098
10100 {
10101 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10102 return module_repairing.CanRepair(this, item_repair_kit);
10103 }
10104
10105
10106 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10107 {
10108 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10109 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10110 }
10111
10112
10114 {
10115
10116
10117
10118
10119
10120
10121
10122
10123 return 1;
10124 }
10125
10126
10127
10129 {
10131 }
10132
10133
10134
10136 {
10138 }
10139
10140
10149 {
10150 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10151
10152 if (player)
10153 {
10154 player.MessageStatus(text);
10155 }
10156 }
10157
10158
10167 {
10168 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10169
10170 if (player)
10171 {
10172 player.MessageAction(text);
10173 }
10174 }
10175
10176
10185 {
10186 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10187
10188 if (player)
10189 {
10190 player.MessageFriendly(text);
10191 }
10192 }
10193
10194
10203 {
10204 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10205
10206 if (player)
10207 {
10208 player.MessageImportant(text);
10209 }
10210 }
10211
10213 {
10214 return true;
10215 }
10216
10217
10218 override bool KindOf(
string tag)
10219 {
10220 bool found = false;
10221 string item_name = this.
GetType();
10224
10225 int array_size = item_tag_array.Count();
10226 for (int i = 0; i < array_size; i++)
10227 {
10228 if (item_tag_array.Get(i) == tag)
10229 {
10230 found = true;
10231 break;
10232 }
10233 }
10234 return found;
10235 }
10236
10237
10239 {
10240
10241 super.OnRPC(sender, rpc_type,ctx);
10242
10243
10244 switch (rpc_type)
10245 {
10246 #ifndef SERVER
10247 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10248 Param2<bool, string> p = new Param2<bool, string>(false, "");
10249
10251 return;
10252
10253 bool play = p.param1;
10254 string soundSet = p.param2;
10255
10256 if (play)
10257 {
10259 {
10261 {
10263 }
10264 }
10265 else
10266 {
10268 }
10269 }
10270 else
10271 {
10273 }
10274
10275 break;
10276 #endif
10277
10278 }
10279
10281 {
10283 }
10284 }
10285
10286
10287
10288
10290 {
10291 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10292 return plugin.GetID(
name);
10293 }
10294
10296 {
10297 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10298 return plugin.GetName(id);
10299 }
10300
10303 {
10304
10305
10306 int varFlags;
10307 if (!ctx.
Read(varFlags))
10308 return;
10309
10310 if (varFlags & ItemVariableFlags.FLOAT)
10311 {
10313 }
10314 }
10315
10317 {
10318
10319 super.SerializeNumericalVars(floats_out);
10320
10321
10322
10324 {
10326 }
10327
10329 {
10331 }
10332
10334 {
10336 }
10337
10339 {
10344 }
10345
10347 {
10349 }
10350 }
10351
10353 {
10354
10355 super.DeSerializeNumericalVars(floats);
10356
10357
10358 int index = 0;
10359 int mask = Math.Round(floats.Get(index));
10360
10361 index++;
10362
10364 {
10366 {
10368 }
10369 else
10370 {
10371 float quantity = floats.Get(index);
10372 SetQuantity(quantity,
true,
false,
false,
false);
10373 }
10374 index++;
10375 }
10376
10378 {
10379 float wet = floats.Get(index);
10381 index++;
10382 }
10383
10385 {
10386 int liquidtype = Math.Round(floats.Get(index));
10388 index++;
10389 }
10390
10392 {
10394 index++;
10396 index++;
10398 index++;
10400 index++;
10401 }
10402
10404 {
10405 int cleanness = Math.Round(floats.Get(index));
10407 index++;
10408 }
10409 }
10410
10412 {
10413 super.WriteVarsToCTX(ctx);
10414
10415
10417 {
10419 }
10420
10422 {
10424 }
10425
10427 {
10429 }
10430
10432 {
10433 int r,g,b,a;
10439 }
10440
10442 {
10444 }
10445 }
10446
10448 {
10449 if (!super.ReadVarsFromCTX(ctx,version))
10450 return false;
10451
10452 int intValue;
10453 float value;
10454
10455 if (version < 140)
10456 {
10457 if (!ctx.
Read(intValue))
10458 return false;
10459
10460 m_VariablesMask = intValue;
10461 }
10462
10464 {
10465 if (!ctx.
Read(value))
10466 return false;
10467
10469 {
10471 }
10472 else
10473 {
10475 }
10476 }
10477
10478 if (version < 140)
10479 {
10481 {
10482 if (!ctx.
Read(value))
10483 return false;
10484 SetTemperatureDirect(value);
10485 }
10486 }
10487
10489 {
10490 if (!ctx.
Read(value))
10491 return false;
10493 }
10494
10496 {
10497 if (!ctx.
Read(intValue))
10498 return false;
10500 }
10501
10503 {
10504 int r,g,b,a;
10506 return false;
10508 return false;
10510 return false;
10512 return false;
10513
10515 }
10516
10518 {
10519 if (!ctx.
Read(intValue))
10520 return false;
10522 }
10523
10524 if (version >= 138 && version < 140)
10525 {
10527 {
10528 if (!ctx.
Read(intValue))
10529 return false;
10530 SetFrozen(intValue);
10531 }
10532 }
10533
10534 return true;
10535 }
10536
10537
10539 {
10542 {
10544 }
10545
10546 if (!super.OnStoreLoad(ctx, version))
10547 {
10549 return false;
10550 }
10551
10552 if (version >= 114)
10553 {
10554 bool hasQuickBarIndexSaved;
10555
10556 if (!ctx.
Read(hasQuickBarIndexSaved))
10557 {
10559 return false;
10560 }
10561
10562 if (hasQuickBarIndexSaved)
10563 {
10564 int itmQBIndex;
10565
10566
10567 if (!ctx.
Read(itmQBIndex))
10568 {
10570 return false;
10571 }
10572
10573 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10574 if (itmQBIndex != -1 && parentPlayer)
10575 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10576 }
10577 }
10578 else
10579 {
10580
10581 PlayerBase player;
10582 int itemQBIndex;
10583 if (version ==
int.
MAX)
10584 {
10585 if (!ctx.
Read(itemQBIndex))
10586 {
10588 return false;
10589 }
10590 }
10591 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10592 {
10593
10594 if (!ctx.
Read(itemQBIndex))
10595 {
10597 return false;
10598 }
10599 if (itemQBIndex != -1 && player)
10600 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10601 }
10602 }
10603
10604 if (version < 140)
10605 {
10606
10607 if (!LoadVariables(ctx, version))
10608 {
10610 return false;
10611 }
10612 }
10613
10614
10616 {
10618 return false;
10619 }
10620 if (version >= 132)
10621 {
10623 if (raib)
10624 {
10626 {
10628 return false;
10629 }
10630 }
10631 }
10632
10634 return true;
10635 }
10636
10637
10638
10640 {
10641 super.OnStoreSave(ctx);
10642
10643 PlayerBase player;
10644 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10645 {
10647
10648 int itemQBIndex = -1;
10649 itemQBIndex = player.FindQuickBarEntityIndex(this);
10650 ctx.
Write(itemQBIndex);
10651 }
10652 else
10653 {
10655 }
10656
10658
10660 if (raib)
10661 {
10663 }
10664 }
10665
10666
10668 {
10669 super.AfterStoreLoad();
10670
10672 {
10674 }
10675
10677 {
10680 }
10681 }
10682
10684 {
10685 super.EEOnAfterLoad();
10686
10688 {
10690 }
10691
10694 }
10695
10697 {
10698 return false;
10699 }
10700
10701
10702
10704 {
10706 {
10707 #ifdef PLATFORM_CONSOLE
10708
10710 {
10712 if (menu)
10713 {
10715 }
10716 }
10717 #endif
10718 }
10719
10721 {
10724 }
10725
10727 {
10728 SetWeightDirty();
10730 }
10732 {
10735 }
10736
10738 {
10741 }
10743 {
10746 }
10747
10748 super.OnVariablesSynchronized();
10749 }
10750
10751
10752
10754 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10755 {
10756 if (!IsServerCheck(allow_client))
10757 return false;
10758
10760 return false;
10761
10764
10765 if (value <= (min + 0.001))
10766 value = min;
10767
10768 if (value == min)
10769 {
10770 if (destroy_config)
10771 {
10772 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10773 if (dstr)
10774 {
10776 this.Delete();
10777 return true;
10778 }
10779 }
10780 else if (destroy_forced)
10781 {
10783 this.Delete();
10784 return true;
10785 }
10786
10788 }
10789
10792
10794 {
10796
10797 if (delta)
10799 }
10800
10802
10803 return false;
10804 }
10805
10806
10808 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10809 {
10811 }
10812
10814 {
10817 }
10818
10820 {
10823 }
10824
10826 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10827 {
10828 float value_clamped = Math.Clamp(value, 0, 1);
10830 SetQuantity(result, destroy_config, destroy_forced);
10831 }
10832
10833
10836 {
10838 }
10839
10841 {
10843 }
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10855 {
10856 int slot = -1;
10857 if (GetInventory())
10858 {
10859 InventoryLocation il = new InventoryLocation;
10860 GetInventory().GetCurrentInventoryLocation(il);
10862 }
10863
10865 }
10866
10868 {
10869 float quantity_max = 0;
10870
10872 {
10873 if (attSlotID != -1)
10874 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10875
10876 if (quantity_max <= 0)
10878 }
10879
10880 if (quantity_max <= 0)
10882
10883 return quantity_max;
10884 }
10885
10887 {
10889 }
10890
10892 {
10894 }
10895
10896
10898 {
10900 }
10901
10903 {
10905 }
10906
10908 {
10910 }
10911
10912
10914 {
10915
10916 float weightEx = GetWeightEx();
10917 float special = GetInventoryAndCargoWeight();
10918 return weightEx - special;
10919 }
10920
10921
10923 {
10925 }
10926
10928 {
10930 {
10931 #ifdef DEVELOPER
10932 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10933 {
10934 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10936 }
10937 #endif
10938
10939 return GetQuantity() * GetConfigWeightModified();
10940 }
10941 else if (HasEnergyManager())
10942 {
10943 #ifdef DEVELOPER
10944 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10945 {
10946 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10947 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10948 }
10949 #endif
10950 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10951 }
10952 else
10953 {
10954 #ifdef DEVELOPER
10955 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10956 {
10957 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10958 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10959 }
10960 #endif
10961 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10962 }
10963 }
10964
10967 {
10968 int item_count = 0;
10970
10971 if (GetInventory().GetCargo() != NULL)
10972 {
10973 item_count = GetInventory().GetCargo().GetItemCount();
10974 }
10975
10976 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10977 {
10978 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10979 if (item)
10980 item_count += item.GetNumberOfItems();
10981 }
10982 return item_count;
10983 }
10984
10987 {
10988 float weight = 0;
10989 float wetness = 1;
10990 if (include_wetness)
10993 {
10994 weight = wetness * m_ConfigWeight;
10995 }
10997 {
10998 weight = 1;
10999 }
11000 return weight;
11001 }
11002
11003
11004
11006 {
11007 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11008 {
11009 GameInventory inv = GetInventory();
11010 array<EntityAI> items = new array<EntityAI>;
11012 for (int i = 0; i < items.Count(); i++)
11013 {
11015 if (item)
11016 {
11018 }
11019 }
11020 }
11021 }
11022
11023
11024
11025
11027 {
11028 float energy = 0;
11029 if (HasEnergyManager())
11030 {
11031 energy = GetCompEM().GetEnergy();
11032 }
11033 return energy;
11034 }
11035
11036
11038 {
11039 super.OnEnergyConsumed();
11040
11042 }
11043
11045 {
11046 super.OnEnergyAdded();
11047
11049 }
11050
11051
11053 {
11054 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11055 {
11057 {
11058 float energy_0to1 = GetCompEM().GetEnergy0To1();
11060 }
11061 }
11062 }
11063
11064
11066 {
11067 return ConfigGetFloat("heatIsolation");
11068 }
11069
11071 {
11073 }
11074
11076 {
11077 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11078 if (
GetGame().ConfigIsExisting(paramPath))
11080
11081 return 0.0;
11082 }
11083
11085 {
11086 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11087 if (
GetGame().ConfigIsExisting(paramPath))
11089
11090 return 0.0;
11091 }
11092
11093 override void SetWet(
float value,
bool allow_client =
false)
11094 {
11095 if (!IsServerCheck(allow_client))
11096 return;
11097
11100
11102
11103 m_VarWet = Math.Clamp(value, min, max);
11104
11106 {
11109 }
11110 }
11111
11112 override void AddWet(
float value)
11113 {
11115 }
11116
11118 {
11120 }
11121
11123 {
11125 }
11126
11128 {
11130 }
11131
11133 {
11135 }
11136
11138 {
11140 }
11141
11142 override void OnWetChanged(
float newVal,
float oldVal)
11143 {
11146 if (newLevel != oldLevel)
11147 {
11149 }
11150 }
11151
11153 {
11154 SetWeightDirty();
11155 }
11156
11158 {
11159 return GetWetLevelInternal(
m_VarWet);
11160 }
11161
11162
11163
11165 {
11167 }
11168
11170 {
11172 }
11173
11175 {
11177 }
11178
11180 {
11182 }
11183
11184
11185
11187 {
11188 if (ConfigIsExisting("itemModelLength"))
11189 {
11190 return ConfigGetFloat("itemModelLength");
11191 }
11192 return 0;
11193 }
11194
11196 {
11197 if (ConfigIsExisting("itemAttachOffset"))
11198 {
11199 return ConfigGetFloat("itemAttachOffset");
11200 }
11201 return 0;
11202 }
11203
11204 override void SetCleanness(
int value,
bool allow_client =
false)
11205 {
11206 if (!IsServerCheck(allow_client))
11207 return;
11208
11210
11212
11215 }
11216
11218 {
11220 }
11221
11223 {
11224 return true;
11225 }
11226
11227
11228
11229
11231 {
11233 }
11234
11236 {
11238 }
11239
11240
11241
11242
11243 override void SetColor(
int r,
int g,
int b,
int a)
11244 {
11250 }
11252 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11253 {
11258 }
11259
11261 {
11263 }
11264
11267 {
11268 int r,g,b,a;
11270 r = r/255;
11271 g = g/255;
11272 b = b/255;
11273 a = a/255;
11274 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11275 }
11276
11277
11278
11279 override void SetLiquidType(
int value,
bool allow_client =
false)
11280 {
11281 if (!IsServerCheck(allow_client))
11282 return;
11283
11288 }
11289
11291 {
11292 return ConfigGetInt("varLiquidTypeInit");
11293 }
11294
11296 {
11298 }
11299
11301 {
11303 SetFrozen(false);
11304 }
11305
11308 {
11309 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11310 }
11311
11312
11315 {
11316 PlayerBase nplayer;
11317 if (PlayerBase.CastTo(nplayer, player))
11318 {
11320
11321 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11322 }
11323 }
11324
11325
11328 {
11329 PlayerBase nplayer;
11330 if (PlayerBase.CastTo(nplayer,player))
11331 {
11332
11333 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11334
11335 }
11336
11337
11338 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11339
11340
11341 if (HasEnergyManager())
11342 {
11343 GetCompEM().UpdatePlugState();
11344 }
11345 }
11346
11347
11349 {
11350 super.OnPlacementStarted(player);
11351
11353 }
11354
11355 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11356 {
11358 {
11359 m_AdminLog.OnPlacementComplete(player,
this);
11360 }
11361
11362 super.OnPlacementComplete(player, position, orientation);
11363 }
11364
11365
11366
11367
11368
11370 {
11372 {
11373 return true;
11374 }
11375 else
11376 {
11377 return false;
11378 }
11379 }
11380
11381
11383 {
11385 {
11387 }
11388 }
11389
11390
11392 {
11394 }
11395
11397 {
11399 }
11400
11401 override void InsertAgent(
int agent,
float count = 1)
11402 {
11403 if (count < 1)
11404 return;
11405
11407 }
11408
11411 {
11413 }
11414
11415
11417 {
11419 }
11420
11421
11422
11423
11424
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
11463 {
11465 return false;
11466 return true;
11467 }
11468
11470 {
11471
11473 }
11474
11475
11478 {
11479 super.CheckForRoofLimited(timeTresholdMS);
11480
11482 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11483 {
11484 m_PreviousRoofTestTime = time;
11485 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11486 }
11487 }
11488
11489
11491 {
11493 {
11494 return 0;
11495 }
11496
11497 if (GetInventory().GetAttachmentSlotsCount() != 0)
11498 {
11499 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11500 if (filter)
11501 return filter.GetProtectionLevel(type, false, system);
11502 else
11503 return 0;
11504 }
11505
11506 string subclassPath, entryName;
11507
11508 switch (type)
11509 {
11511 entryName = "biological";
11512 break;
11514 entryName = "chemical";
11515 break;
11516 default:
11517 entryName = "biological";
11518 break;
11519 }
11520
11521 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11522
11524 }
11525
11526
11527
11530 {
11531 if (!IsMagazine())
11533
11535 }
11536
11537
11538
11539
11540
11545 {
11546 return true;
11547 }
11548
11550 {
11552 }
11553
11554
11555
11556
11557
11559 {
11560 if (parent)
11561 {
11562 if (parent.IsInherited(DayZInfected))
11563 return true;
11564
11565 if (!parent.IsRuined())
11566 return true;
11567 }
11568
11569 return true;
11570 }
11571
11573 {
11574 if (!super.CanPutAsAttachment(parent))
11575 {
11576 return false;
11577 }
11578
11579 if (!IsRuined() && !parent.IsRuined())
11580 {
11581 return true;
11582 }
11583
11584 return false;
11585 }
11586
11588 {
11589
11590
11591
11592
11593 return super.CanReceiveItemIntoCargo(item);
11594 }
11595
11597 {
11598
11599
11600
11601
11602 GameInventory attachmentInv = attachment.GetInventory();
11604 {
11605 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11606 return false;
11607 }
11608
11609 InventoryLocation loc = new InventoryLocation();
11610 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11611 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11612 return false;
11613
11614 return super.CanReceiveAttachment(attachment, slotId);
11615 }
11616
11618 {
11619 if (!super.CanReleaseAttachment(attachment))
11620 return false;
11621
11622 return GetInventory().AreChildrenAccessible();
11623 }
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11646 {
11647 int id = muzzle_owner.GetMuzzleID();
11648 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11649
11650 if (WPOF_array)
11651 {
11652 for (int i = 0; i < WPOF_array.Count(); i++)
11653 {
11654 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11655
11656 if (WPOF)
11657 {
11658 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11659 }
11660 }
11661 }
11662 }
11663
11664
11666 {
11667 int id = muzzle_owner.GetMuzzleID();
11669
11670 if (WPOBE_array)
11671 {
11672 for (int i = 0; i < WPOBE_array.Count(); i++)
11673 {
11674 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11675
11676 if (WPOBE)
11677 {
11678 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11679 }
11680 }
11681 }
11682 }
11683
11684
11686 {
11687 int id = muzzle_owner.GetMuzzleID();
11688 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11689
11690 if (WPOOH_array)
11691 {
11692 for (int i = 0; i < WPOOH_array.Count(); i++)
11693 {
11694 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11695
11696 if (WPOOH)
11697 {
11698 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11699 }
11700 }
11701 }
11702 }
11703
11704
11706 {
11707 int id = muzzle_owner.GetMuzzleID();
11708 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11709
11710 if (WPOOH_array)
11711 {
11712 for (int i = 0; i < WPOOH_array.Count(); i++)
11713 {
11714 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11715
11716 if (WPOOH)
11717 {
11718 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11719 }
11720 }
11721 }
11722 }
11723
11724
11726 {
11727 int id = muzzle_owner.GetMuzzleID();
11728 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11729
11730 if (WPOOH_array)
11731 {
11732 for (int i = 0; i < WPOOH_array.Count(); i++)
11733 {
11734 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11735
11736 if (WPOOH)
11737 {
11738 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11739 }
11740 }
11741 }
11742 }
11743
11744
11745
11747 {
11749 {
11750 return true;
11751 }
11752
11753 return false;
11754 }
11755
11757 {
11759 {
11760 return true;
11761 }
11762
11763 return false;
11764 }
11765
11767 {
11769 {
11770 return true;
11771 }
11772
11773 return false;
11774 }
11775
11777 {
11778 return false;
11779 }
11780
11783 {
11784 return UATimeSpent.DEFAULT_DEPLOY;
11785 }
11786
11787
11788
11789
11791 {
11793 SetSynchDirty();
11794 }
11795
11797 {
11799 }
11800
11801
11803 {
11804 return false;
11805 }
11806
11809 {
11810 string att_type = "None";
11811
11812 if (ConfigIsExisting("soundAttType"))
11813 {
11814 att_type = ConfigGetString("soundAttType");
11815 }
11816
11818 }
11819
11821 {
11823 }
11824
11825
11826
11827
11828
11834
11836 {
11839
11841 }
11842
11843
11845 {
11847 return;
11848
11850
11853
11856
11857 SoundParameters params = new SoundParameters();
11861 }
11862
11863
11865 {
11867 return;
11868
11870 SetSynchDirty();
11871
11874 }
11875
11876
11878 {
11880 return;
11881
11883 SetSynchDirty();
11884
11887 }
11888
11890 {
11892 }
11893
11895 {
11897 }
11898
11901 {
11902 if (!
GetGame().IsDedicatedServer())
11903 {
11904 if (ConfigIsExisting("attachSoundSet"))
11905 {
11906 string cfg_path = "";
11907 string soundset = "";
11908 string type_name =
GetType();
11909
11912 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11913 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11914
11915 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11916 {
11917 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11918 {
11919 if (cfg_slot_array[i] == slot_type)
11920 {
11921 soundset = cfg_soundset_array[i];
11922 break;
11923 }
11924 }
11925 }
11926
11927 if (soundset != "")
11928 {
11929 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11931 }
11932 }
11933 }
11934 }
11935
11937 {
11938
11939 }
11940
11941 void OnApply(PlayerBase player);
11942
11944 {
11945 return 1.0;
11946 };
11947
11949 {
11951 }
11952
11954 {
11956 }
11957
11959
11961 {
11962 SetDynamicPhysicsLifeTime(0.01);
11964 }
11965
11967 {
11968 array<string> zone_names = new array<string>;
11969 GetDamageZones(zone_names);
11970 for (int i = 0; i < zone_names.Count(); i++)
11971 {
11972 SetHealthMax(zone_names.Get(i),"Health");
11973 }
11974 SetHealthMax("","Health");
11975 }
11976
11979 {
11980 float global_health = GetHealth01("","Health");
11981 array<string> zones = new array<string>;
11982 GetDamageZones(zones);
11983
11984 for (int i = 0; i < zones.Count(); i++)
11985 {
11986 SetHealth01(zones.Get(i),"Health",global_health);
11987 }
11988 }
11989
11992 {
11993 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11994 }
11995
11997 {
11998 if (!hasRootAsPlayer)
11999 {
12000 if (refParentIB)
12001 {
12002
12003 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12004 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12005
12006 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12007 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12008
12011 }
12012 else
12013 {
12014
12017 }
12018 }
12019 }
12020
12022 {
12024 {
12025 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12026 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12027 {
12028 float heatPermCoef = 1.0;
12030 while (ent)
12031 {
12032 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12033 ent = ent.GetHierarchyParent();
12034 }
12035
12036 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12037 }
12038 }
12039 }
12040
12042 {
12043
12044 EntityAI parent = GetHierarchyParent();
12045 if (!parent)
12046 {
12047 hasParent = false;
12048 hasRootAsPlayer = false;
12049 }
12050 else
12051 {
12052 hasParent = true;
12053 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12054 refParentIB =
ItemBase.Cast(parent);
12055 }
12056 }
12057
12058 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12059 {
12060
12061 }
12062
12064 {
12065
12066 return false;
12067 }
12068
12070 {
12071
12072
12073 return false;
12074 }
12075
12077 {
12078
12079 return false;
12080 }
12081
12084 {
12085 return !GetIsFrozen() &&
IsOpen();
12086 }
12087
12089 {
12090 bool hasParent = false, hasRootAsPlayer = false;
12092
12093 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12094 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12095
12096 if (wwtu || foodDecay)
12097 {
12101
12102 if (processWetness || processTemperature || processDecay)
12103 {
12105
12106 if (processWetness)
12107 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12108
12109 if (processTemperature)
12111
12112 if (processDecay)
12113 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12114 }
12115 }
12116 }
12117
12120 {
12122 }
12123
12125 {
12128
12129 return super.GetTemperatureFreezeThreshold();
12130 }
12131
12133 {
12136
12137 return super.GetTemperatureThawThreshold();
12138 }
12139
12141 {
12144
12145 return super.GetItemOverheatThreshold();
12146 }
12147
12149 {
12151 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12152
12153 return super.GetTemperatureFreezeTime();
12154 }
12155
12157 {
12159 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12160
12161 return super.GetTemperatureThawTime();
12162 }
12163
12168
12170 {
12171 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12172 }
12173
12175 {
12176 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12177 }
12178
12181 {
12183 }
12184
12186 {
12188 }
12189
12191 {
12193 }
12194
12197 {
12198 return null;
12199 }
12200
12203 {
12204 return false;
12205 }
12206
12208 {
12210 {
12213 if (!trg)
12214 {
12216 explosive = this;
12217 }
12218
12219 explosive.PairRemote(trg);
12221
12222 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12223 trg.SetPersistentPairID(persistentID);
12224 explosive.SetPersistentPairID(persistentID);
12225
12226 return true;
12227 }
12228 return false;
12229 }
12230
12233 {
12234 float ret = 1.0;
12237 ret *= GetHealth01();
12238
12239 return ret;
12240 }
12241
12242 #ifdef DEVELOPER
12243 override void SetDebugItem()
12244 {
12245 super.SetDebugItem();
12246 _itemBase = this;
12247 }
12248
12250 {
12251 string text = super.GetDebugText();
12252
12254 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12255
12256 return text;
12257 }
12258 #endif
12259
12261 {
12262 return true;
12263 }
12264
12266
12268
12270 {
12273 }
12274
12275
12283
12299}
12300
12302{
12304 if (entity)
12305 {
12306 bool is_item = entity.IsInherited(
ItemBase);
12307 if (is_item && full_quantity)
12308 {
12311 }
12312 }
12313 else
12314 {
12316 return NULL;
12317 }
12318 return entity;
12319}
12320
12322{
12323 if (item)
12324 {
12325 if (health > 0)
12326 item.SetHealth("", "", health);
12327
12328 if (item.CanHaveTemperature())
12329 {
12331 if (item.CanFreeze())
12332 item.SetFrozen(false);
12333 }
12334
12335 if (item.HasEnergyManager())
12336 {
12337 if (quantity >= 0)
12338 {
12339 item.GetCompEM().SetEnergy0To1(quantity);
12340 }
12341 else
12342 {
12344 }
12345 }
12346 else if (item.IsMagazine())
12347 {
12348 Magazine mag = Magazine.Cast(item);
12349 if (quantity >= 0)
12350 {
12351 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12352 }
12353 else
12354 {
12356 }
12357
12358 }
12359 else
12360 {
12361 if (quantity >= 0)
12362 {
12363 item.SetQuantityNormalized(quantity, false);
12364 }
12365 else
12366 {
12368 }
12369
12370 }
12371 }
12372}
12373
12374#ifdef DEVELOPER
12376#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.