7463{
7465 {
7466 return true;
7467 }
7468};
7469
7470
7471
7473{
7477
7479
7482
7483
7484
7485
7486
7495
7501
7506
7511
7532 protected bool m_IsResultOfSplit
7533
7535
7540
7541
7542
7544
7548
7549
7550
7552
7555
7556
7557
7563
7564
7572
7575
7576
7578
7579
7581
7582
7587
7588
7593
7594
7596
7597
7599 {
7604
7605 if (!
GetGame().IsDedicatedServer())
7606 {
7608 {
7610
7612 {
7614 }
7615 }
7616
7619 }
7620
7621 m_OldLocation = null;
7622
7624 {
7626 }
7627
7628 if (ConfigIsExisting("headSelectionsToHide"))
7629 {
7632 }
7633
7635 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7636 {
7638 }
7639
7641
7642 m_IsResultOfSplit = false;
7643
7645 }
7646
7648 {
7649 super.InitItemVariables();
7650
7656 m_Count = ConfigGetInt(
"count");
7657
7660
7665
7668
7673
7685
7689
7690
7693 if (ConfigIsExisting("canBeSplit"))
7694 {
7697 }
7698
7700 if (ConfigIsExisting("itemBehaviour"))
7702
7703
7706 RegisterNetSyncVariableInt("m_VarLiquidType");
7707 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7708
7709 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7710 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7711 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7712
7713 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7714 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7715 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7716 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7717
7718 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7719 RegisterNetSyncVariableBool("m_IsTakeable");
7720 RegisterNetSyncVariableBool("m_IsHologram");
7721
7724 {
7727 }
7728
7730
7732 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7734
7735 }
7736
7738 {
7740 }
7741
7743 {
7746 {
7751 }
7752 }
7753
7754 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7755 {
7757 {
7760 }
7761
7763 }
7764
7766 {
7772 }
7773
7775
7777 {
7779
7780 if (!action)
7781 {
7782 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7783 return;
7784 }
7785
7787 if (!ai)
7788 {
7790 return;
7791 }
7792
7794 if (!action_array)
7795 {
7796 action_array = new array<ActionBase_Basic>;
7798 }
7799 if (LogManager.IsActionLogEnable())
7800 {
7801 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7802 }
7803
7804 if (action_array.Find(action) != -1)
7805 {
7806 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7807 }
7808 else
7809 {
7810 action_array.Insert(action);
7811 }
7812 }
7813
7815 {
7817 ActionBase action = player.GetActionManager().GetAction(actionName);
7820
7821 if (action_array)
7822 {
7823 action_array.RemoveItem(action);
7824 }
7825 }
7826
7827
7828
7830 {
7831 ActionOverrideData overrideData = new ActionOverrideData();
7835
7837 if (!actionMap)
7838 {
7841 }
7842
7843 actionMap.Insert(this.
Type(), overrideData);
7844
7845 }
7846
7848
7850
7851
7853 {
7856
7859
7860 string config_to_search = "CfgVehicles";
7861 string muzzle_owner_config;
7862
7864 {
7865 if (IsInherited(Weapon))
7866 config_to_search = "CfgWeapons";
7867
7868 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7869
7870 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7871
7873
7874 if (config_OnFire_subclass_count > 0)
7875 {
7876 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7877
7878 for (int i = 0; i < config_OnFire_subclass_count; i++)
7879 {
7880 string particle_class = "";
7882 string config_OnFire_entry = config_OnFire_class + particle_class;
7883 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7884 WPOF_array.Insert(WPOF);
7885 }
7886
7887
7889 }
7890 }
7891
7893 {
7894 config_to_search = "CfgWeapons";
7895 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7896
7897 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7898
7900
7901 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7902 {
7903 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7904
7905 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7906 {
7907 string particle_class2 = "";
7909 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7910 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7911 WPOBE_array.Insert(WPOBE);
7912 }
7913
7914
7916 }
7917 }
7918 }
7919
7920
7922 {
7925
7927 {
7928 string config_to_search = "CfgVehicles";
7929
7930 if (IsInherited(Weapon))
7931 config_to_search = "CfgWeapons";
7932
7933 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7934 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7935
7936 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7937 {
7938
7940
7942 {
7944 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7946 return;
7947 }
7948
7951
7952
7953
7955 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7956
7957 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7958 {
7959 string particle_class = "";
7961 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7963
7964 if (entry_type == CT_CLASS)
7965 {
7966 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7967 WPOOH_array.Insert(WPOF);
7968 }
7969 }
7970
7971
7973 }
7974 }
7975 }
7976
7978 {
7980 }
7981
7983 {
7985 {
7987
7990
7993
7994 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7995 }
7996 }
7997
7999 {
8001 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8002
8004 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8005
8007 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8008
8010 {
8012 }
8013 }
8014
8016 {
8018 }
8019
8021 {
8024 else
8026
8028 {
8031 }
8032 else
8033 {
8036
8039 }
8040
8042 }
8043
8045 {
8047 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8048 }
8049
8051 {
8053 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8055 }
8056
8058 {
8060 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8061 }
8062
8064 {
8067
8068 OverheatingParticle OP = new OverheatingParticle();
8073
8075 }
8076
8078 {
8081
8082 return -1;
8083 }
8084
8086 {
8088 {
8091
8092 for (int i = count; i > 0; --i)
8093 {
8094 int id = i - 1;
8097
8100
8101 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8102 {
8103 if (p)
8104 {
8107 }
8108 }
8109 }
8110 }
8111 }
8112
8114 {
8116 {
8118 {
8119 int id = i - 1;
8121
8122 if (OP)
8123 {
8125
8126 if (p)
8127 {
8129 }
8130
8131 delete OP;
8132 }
8133 }
8134
8137 }
8138 }
8139
8142 {
8143 return 0.0;
8144 }
8145
8146
8148 {
8149 return 250;
8150 }
8151
8153 {
8154 return 0;
8155 }
8156
8159 {
8161 return true;
8162
8163 return false;
8164 }
8165
8168 {
8171
8173 {
8175 }
8176 else
8177 {
8178
8180 }
8181
8183 }
8184
8191 {
8192 return -1;
8193 }
8194
8195
8196
8197
8199 {
8201 {
8203 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8204
8205 if (r_index >= 0)
8206 {
8207 InventoryLocation r_il = new InventoryLocation;
8208 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8209
8210 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8213 {
8214 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8215 }
8217 {
8218 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8219 }
8220
8221 }
8222
8223 player.GetHumanInventory().ClearUserReservedLocation(this);
8224 }
8225
8228 }
8229
8230
8231
8232
8234 {
8235 return ItemBase.m_DebugActionsMask;
8236 }
8237
8239 {
8240 return ItemBase.m_DebugActionsMask & mask;
8241 }
8242
8244 {
8245 ItemBase.m_DebugActionsMask = mask;
8246 }
8247
8249 {
8250 ItemBase.m_DebugActionsMask |= mask;
8251 }
8252
8254 {
8255 ItemBase.m_DebugActionsMask &= ~mask;
8256 }
8257
8259 {
8261 {
8263 }
8264 else
8265 {
8267 }
8268 }
8269
8270
8272 {
8273 if (GetEconomyProfile())
8274 {
8275 float q_max = GetEconomyProfile().GetQuantityMax();
8276 if (q_max > 0)
8277 {
8278 float q_min = GetEconomyProfile().GetQuantityMin();
8279 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8280
8282 {
8283 ComponentEnergyManager comp = GetCompEM();
8285 {
8287 }
8288 }
8290 {
8292
8293 }
8294
8295 }
8296 }
8297 }
8298
8301 {
8302 EntityAI parent = GetHierarchyParent();
8303
8304 if (parent)
8305 {
8306 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8307 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8308 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8309 }
8310 }
8311
8314 {
8315 EntityAI parent = GetHierarchyParent();
8316
8317 if (parent)
8318 {
8319 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8320 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8321 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8322 }
8323 }
8324
8326 {
8327
8328
8329
8330
8332
8334 {
8335 if (ScriptInputUserData.CanStoreInputUserData())
8336 {
8337 ScriptInputUserData ctx = new ScriptInputUserData;
8343 ctx.
Write(use_stack_max);
8346
8348 {
8349 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8350 }
8351 }
8352 }
8353 else if (!
GetGame().IsMultiplayer())
8354 {
8356 }
8357 }
8358
8360 {
8362 }
8363
8365 {
8367 }
8368
8370 {
8372 }
8373
8375 {
8376
8377 return false;
8378 }
8379
8381 {
8382 return false;
8383 }
8384
8388 {
8389 return false;
8390 }
8391
8393 {
8394 return "";
8395 }
8396
8398
8400 {
8401 return false;
8402 }
8403
8405 {
8406 return true;
8407 }
8408
8409
8410
8412 {
8413 return true;
8414 }
8415
8417 {
8418 return true;
8419 }
8420
8422 {
8423 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8425 }
8426
8428 {
8430 }
8431
8433 {
8435 if (!is_being_placed)
8437 SetSynchDirty();
8438 }
8439
8440
8442
8444 {
8446 }
8447
8449 {
8451 }
8452
8454 {
8455 return 1;
8456 }
8457
8459 {
8460 return false;
8461 }
8462
8464 {
8466 SetSynchDirty();
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
8497
8498
8499
8500
8501
8502
8504 {
8505 super.OnMovedInsideCargo(container);
8506
8507 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8508 }
8509
8510 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8511 {
8512 super.EEItemLocationChanged(oldLoc,newLoc);
8513
8514 PlayerBase new_player = null;
8515 PlayerBase old_player = null;
8516
8517 if (newLoc.GetParent())
8518 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8519
8520 if (oldLoc.GetParent())
8521 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8522
8524 {
8525 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8526
8527 if (r_index >= 0)
8528 {
8529 InventoryLocation r_il = new InventoryLocation;
8530 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8531
8532 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8535 {
8536 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8537 }
8539 {
8540 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8541 }
8542
8543 }
8544 }
8545
8547 {
8548 if (new_player)
8549 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8550
8551 if (new_player == old_player)
8552 {
8553
8554 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8555 {
8557 {
8558 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8559 {
8560 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8561 }
8562 }
8563 else
8564 {
8565 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8566 }
8567 }
8568
8569 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8570 {
8571 int type = oldLoc.GetType();
8573 {
8574 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8575 }
8577 {
8578 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8579 }
8580 }
8581 if (!m_OldLocation)
8582 {
8583 m_OldLocation = new InventoryLocation;
8584 }
8585 m_OldLocation.Copy(oldLoc);
8586 }
8587 else
8588 {
8589 if (m_OldLocation)
8590 {
8591 m_OldLocation.Reset();
8592 }
8593 }
8594
8596 }
8597 else
8598 {
8599 if (new_player)
8600 {
8601 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8602 if (res_index >= 0)
8603 {
8604 InventoryLocation il = new InventoryLocation;
8605 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8607 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8610 {
8611 il.
GetParent().GetOnReleaseLock().Invoke(it);
8612 }
8614 {
8616 }
8617
8618 }
8619 }
8621 {
8622
8624 }
8625
8626 if (m_OldLocation)
8627 {
8628 m_OldLocation.Reset();
8629 }
8630 }
8631 }
8632
8633 override void EOnContact(IEntity other, Contact extra)
8634 {
8636 {
8637 int liquidType = -1;
8639 if (impactSpeed > 0.0)
8640 {
8642 #ifndef SERVER
8644 #else
8646 SetSynchDirty();
8647 #endif
8649 }
8650 }
8651
8652 #ifdef SERVER
8653 if (GetCompEM() && GetCompEM().IsPlugged())
8654 {
8655 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8656 GetCompEM().UnplugThis();
8657 }
8658 #endif
8659 }
8660
8662
8664 {
8666 }
8667
8669 {
8670
8671 }
8672
8674 {
8675 super.OnItemLocationChanged(old_owner, new_owner);
8676
8677 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8678 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8679
8680 if (!relatedPlayer && playerNew)
8681 relatedPlayer = playerNew;
8682
8683 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8684 {
8686 if (actionMgr)
8687 {
8688 ActionBase currentAction = actionMgr.GetRunningAction();
8689 if (currentAction)
8691 }
8692 }
8693
8694 Man ownerPlayerOld = null;
8695 Man ownerPlayerNew = null;
8696
8697 if (old_owner)
8698 {
8699 if (old_owner.
IsMan())
8700 {
8701 ownerPlayerOld = Man.Cast(old_owner);
8702 }
8703 else
8704 {
8705 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8706 }
8707 }
8708 else
8709 {
8711 {
8713
8714 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8715 {
8716 GetCompEM().UnplugThis();
8717 }
8718 }
8719 }
8720
8721 if (new_owner)
8722 {
8723 if (new_owner.
IsMan())
8724 {
8725 ownerPlayerNew = Man.Cast(new_owner);
8726 }
8727 else
8728 {
8729 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8730 }
8731 }
8732
8733 if (ownerPlayerOld != ownerPlayerNew)
8734 {
8735 if (ownerPlayerOld)
8736 {
8737 array<EntityAI> subItemsExit = new array<EntityAI>;
8739 for (int i = 0; i < subItemsExit.Count(); i++)
8740 {
8743 }
8744 }
8745
8746 if (ownerPlayerNew)
8747 {
8748 array<EntityAI> subItemsEnter = new array<EntityAI>;
8750 for (int j = 0; j < subItemsEnter.Count(); j++)
8751 {
8754 }
8755 }
8756 }
8757 else if (ownerPlayerNew != null)
8758 {
8759 PlayerBase nplayer;
8760 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8761 {
8762 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8764 for (int k = 0; k < subItemsUpdate.Count(); k++)
8765 {
8767 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8768 }
8769 }
8770 }
8771
8772 if (old_owner)
8773 old_owner.OnChildItemRemoved(this);
8774 if (new_owner)
8775 new_owner.OnChildItemReceived(this);
8776 }
8777
8778
8780 {
8781 super.EEDelete(parent);
8782 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8783 if (player)
8784 {
8786
8787 if (player.IsAlive())
8788 {
8789 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8790 if (r_index >= 0)
8791 {
8792 InventoryLocation r_il = new InventoryLocation;
8793 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8794
8795 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8798 {
8799 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8800 }
8802 {
8803 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8804 }
8805
8806 }
8807
8808 player.RemoveQuickBarEntityShortcut(this);
8809 }
8810 }
8811 }
8812
8814 {
8815 super.EEKilled(killer);
8816
8819 {
8820 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8821 {
8822 if (IsMagazine())
8823 {
8824 if (Magazine.Cast(this).GetAmmoCount() > 0)
8825 {
8827 }
8828 }
8829 else
8830 {
8832 }
8833 }
8834 }
8835 }
8836
8838 {
8839 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8840
8841 super.OnWasAttached(parent, slot_id);
8842
8845
8847 }
8848
8850 {
8851 super.OnWasDetached(parent, slot_id);
8852
8855 }
8856
8858 {
8859 int idx;
8862
8863 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8864 if (inventory_slots.Count() < 1)
8865 {
8866 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8867 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8868 }
8869 else
8870 {
8871 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8872 }
8873
8874 idx = inventory_slots.Find(slot);
8875 if (idx < 0)
8876 return "";
8877
8878 return attach_types.Get(idx);
8879 }
8880
8882 {
8883 int idx = -1;
8884 string slot;
8885
8888
8889 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8890 if (inventory_slots.Count() < 1)
8891 {
8892 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8893 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8894 }
8895 else
8896 {
8897 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8898 if (detach_types.Count() < 1)
8899 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8900 }
8901
8902 for (int i = 0; i < inventory_slots.Count(); i++)
8903 {
8904 slot = inventory_slots.Get(i);
8905 }
8906
8907 if (slot != "")
8908 {
8909 if (detach_types.Count() == 1)
8910 idx = 0;
8911 else
8912 idx = inventory_slots.Find(slot);
8913 }
8914 if (idx < 0)
8915 return "";
8916
8917 return detach_types.Get(idx);
8918 }
8919
8921 {
8922
8924
8925
8926 float min_time = 1;
8927 float max_time = 3;
8928 float delay = Math.RandomFloat(min_time, max_time);
8929
8930 explode_timer.Run(delay, this, "DoAmmoExplosion");
8931 }
8932
8934 {
8935 Magazine magazine = Magazine.Cast(this);
8936 int pop_sounds_count = 6;
8937 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8938
8939
8940 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8941 string sound_name = pop_sounds[ sound_idx ];
8943
8944
8945 magazine.ServerAddAmmoCount(-1);
8946
8947
8948 float min_temp_to_explode = 100;
8949
8950 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8951 {
8953 }
8954 }
8955
8956
8957 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8958 {
8959 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8960
8961 const int CHANCE_DAMAGE_CARGO = 4;
8962 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8963 const int CHANCE_DAMAGE_NOTHING = 2;
8964
8966 {
8967 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8968 int chances;
8969 int rnd;
8970
8971 if (GetInventory().GetCargo())
8972 {
8973 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8974 rnd = Math.RandomInt(0,chances);
8975
8976 if (rnd < CHANCE_DAMAGE_CARGO)
8977 {
8979 }
8980 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8981 {
8983 }
8984 }
8985 else
8986 {
8987 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8988 rnd = Math.RandomInt(0,chances);
8989
8990 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8991 {
8993 }
8994 }
8995 }
8996 }
8997
8999 {
9000 if (GetInventory().GetCargo())
9001 {
9002 int item_count = GetInventory().GetCargo().GetItemCount();
9003 if (item_count > 0)
9004 {
9005 int random_pick = Math.RandomInt(0, item_count);
9007 if (!item.IsExplosive())
9008 {
9009 item.AddHealth("","",damage);
9010 return true;
9011 }
9012 }
9013 }
9014 return false;
9015 }
9016
9018 {
9019 int attachment_count = GetInventory().AttachmentCount();
9020 if (attachment_count > 0)
9021 {
9022 int random_pick = Math.RandomInt(0, attachment_count);
9023 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9024 if (!attachment.IsExplosive())
9025 {
9026 attachment.AddHealth("","",damage);
9027 return true;
9028 }
9029 }
9030 return false;
9031 }
9032
9034 {
9036 }
9037
9039 {
9041 return GetInventory().CanRemoveEntity();
9042
9043 return false;
9044 }
9045
9047 {
9048
9050 return false;
9051
9052
9054 return false;
9055
9056
9057
9059 if (delta == 0)
9060 return false;
9061
9062
9063 return true;
9064 }
9065
9067 {
9069 {
9070 if (ScriptInputUserData.CanStoreInputUserData())
9071 {
9072 ScriptInputUserData ctx = new ScriptInputUserData;
9077 ctx.
Write(destination_entity);
9081 }
9082 }
9083 else if (!
GetGame().IsMultiplayer())
9084 {
9086 }
9087 }
9088
9090 {
9091 float split_quantity_new;
9095 InventoryLocation loc = new InventoryLocation;
9096
9097 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9098 {
9100 split_quantity_new = stack_max;
9101 else
9103
9105 {
9106 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9107 if (new_item)
9108 {
9109 new_item.SetResultOfSplit(true);
9110 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9112 new_item.
SetQuantity(split_quantity_new,
false,
true);
9113 }
9114 }
9115 }
9116 else if (destination_entity && slot_id == -1)
9117 {
9118 if (quantity > stack_max)
9119 split_quantity_new = stack_max;
9120 else
9121 split_quantity_new = quantity;
9122
9124 {
9126 {
9129 }
9130
9131 if (new_item)
9132 {
9133 new_item.SetResultOfSplit(true);
9134 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9136 new_item.
SetQuantity(split_quantity_new,
false,
true);
9137 }
9138 }
9139 }
9140 else
9141 {
9142 if (stack_max != 0)
9143 {
9145 {
9147 }
9148
9149 if (split_quantity_new == 0)
9150 {
9151 if (!
GetGame().IsMultiplayer())
9152 player.PhysicalPredictiveDropItem(this);
9153 else
9154 player.ServerDropEntity(this);
9155 return;
9156 }
9157
9159 {
9161
9162 if (new_item)
9163 {
9164 new_item.SetResultOfSplit(true);
9165 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9168 new_item.PlaceOnSurface();
9169 }
9170 }
9171 }
9172 }
9173 }
9174
9176 {
9177 float split_quantity_new;
9181 InventoryLocation loc = new InventoryLocation;
9182
9183 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9184 {
9186 split_quantity_new = stack_max;
9187 else
9189
9191 {
9192 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9193 if (new_item)
9194 {
9195 new_item.SetResultOfSplit(true);
9196 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9198 new_item.
SetQuantity(split_quantity_new,
false,
true);
9199 }
9200 }
9201 }
9202 else if (destination_entity && slot_id == -1)
9203 {
9204 if (quantity > stack_max)
9205 split_quantity_new = stack_max;
9206 else
9207 split_quantity_new = quantity;
9208
9210 {
9212 {
9215 }
9216
9217 if (new_item)
9218 {
9219 new_item.SetResultOfSplit(true);
9220 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9222 new_item.
SetQuantity(split_quantity_new,
false,
true);
9223 }
9224 }
9225 }
9226 else
9227 {
9228 if (stack_max != 0)
9229 {
9231 {
9233 }
9234
9236 {
9238
9239 if (new_item)
9240 {
9241 new_item.SetResultOfSplit(true);
9242 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9245 new_item.PlaceOnSurface();
9246 }
9247 }
9248 }
9249 }
9250 }
9251
9253 {
9255 {
9256 if (ScriptInputUserData.CanStoreInputUserData())
9257 {
9258 ScriptInputUserData ctx = new ScriptInputUserData;
9263 dst.WriteToContext(ctx);
9265 }
9266 }
9267 else if (!
GetGame().IsMultiplayer())
9268 {
9270 }
9271 }
9272
9274 {
9276 {
9277 if (ScriptInputUserData.CanStoreInputUserData())
9278 {
9279 ScriptInputUserData ctx = new ScriptInputUserData;
9284 ctx.
Write(destination_entity);
9290 }
9291 }
9292 else if (!
GetGame().IsMultiplayer())
9293 {
9295 }
9296 }
9297
9299 {
9301 }
9302
9304 {
9306 float split_quantity_new;
9308 if (dst.IsValid())
9309 {
9310 int slot_id = dst.GetSlot();
9312
9313 if (quantity > stack_max)
9314 split_quantity_new = stack_max;
9315 else
9316 split_quantity_new = quantity;
9317
9319 {
9321
9322 if (new_item)
9323 {
9324 new_item.SetResultOfSplit(true);
9325 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9327 new_item.
SetQuantity(split_quantity_new,
false,
true);
9328 }
9329
9330 return new_item;
9331 }
9332 }
9333
9334 return null;
9335 }
9336
9338 {
9340 float split_quantity_new;
9342 if (destination_entity)
9343 {
9345 if (quantity > stackable)
9346 split_quantity_new = stackable;
9347 else
9348 split_quantity_new = quantity;
9349
9351 {
9352 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9353 if (new_item)
9354 {
9355 new_item.SetResultOfSplit(true);
9356 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9358 new_item.
SetQuantity(split_quantity_new,
false,
true);
9359 }
9360 }
9361 }
9362 }
9363
9365 {
9367 {
9368 if (ScriptInputUserData.CanStoreInputUserData())
9369 {
9370 ScriptInputUserData ctx = new ScriptInputUserData;
9375 ItemBase destination_entity =
this;
9376 ctx.
Write(destination_entity);
9380 }
9381 }
9382 else if (!
GetGame().IsMultiplayer())
9383 {
9385 }
9386 }
9387
9389 {
9391 float split_quantity_new;
9393 if (player)
9394 {
9396 if (quantity > stackable)
9397 split_quantity_new = stackable;
9398 else
9399 split_quantity_new = quantity;
9400
9402 {
9403 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9404 new_item =
ItemBase.Cast(in_hands);
9405 if (new_item)
9406 {
9407 new_item.SetResultOfSplit(true);
9408 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9410 new_item.SetQuantity(split_quantity_new, false, true);
9411 }
9412 }
9413 }
9414 }
9415
9417 {
9419 float split_quantity_new = Math.Floor(quantity * 0.5);
9420
9422 return;
9423
9425
9426 if (new_item)
9427 {
9428 if (new_item.GetQuantityMax() < split_quantity_new)
9429 {
9430 split_quantity_new = new_item.GetQuantityMax();
9431 }
9432
9433 new_item.SetResultOfSplit(true);
9434 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9435
9437 {
9440 }
9441 else
9442 {
9444 new_item.
SetQuantity(split_quantity_new,
false,
true);
9445 }
9446 }
9447 }
9448
9450 {
9452 float split_quantity_new = Math.Floor(quantity / 2);
9453
9455 return;
9456
9457 InventoryLocation invloc = new InventoryLocation;
9459
9461 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9462
9463 if (new_item)
9464 {
9465 if (new_item.GetQuantityMax() < split_quantity_new)
9466 {
9467 split_quantity_new = new_item.GetQuantityMax();
9468 }
9470 {
9473 }
9474 else if (split_quantity_new > 1)
9475 {
9477 new_item.
SetQuantity(split_quantity_new,
false,
true);
9478 }
9479 }
9480 }
9481
9484 {
9485 SetWeightDirty();
9487
9488 if (parent)
9489 parent.OnAttachmentQuantityChangedEx(this, delta);
9490
9492 {
9494 {
9496 }
9498 {
9499 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9501 }
9502 }
9503
9504 }
9505
9508 {
9509
9510 }
9511
9514 {
9516 }
9517
9519 {
9520 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9521
9523 {
9524 if (newLevel == GameConstants.STATE_RUINED)
9525 {
9527 EntityAI parent = GetHierarchyParent();
9528 if (parent && parent.IsFireplace())
9529 {
9530 CargoBase cargo = GetInventory().GetCargo();
9531 if (cargo)
9532 {
9534 {
9536 }
9537 }
9538 }
9539 }
9540
9542 {
9543
9545 return;
9546 }
9547
9548 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9549 {
9551 }
9552 }
9553 }
9554
9555
9557 {
9558 super.OnRightClick();
9559
9561 {
9563 {
9564 if (ScriptInputUserData.CanStoreInputUserData())
9565 {
9566 EntityAI root = GetHierarchyRoot();
9567 Man playerOwner = GetHierarchyRootPlayer();
9568 InventoryLocation dst = new InventoryLocation;
9569
9570
9571 if (!playerOwner && root && root == this)
9572 {
9574 }
9575 else
9576 {
9577
9578 GetInventory().GetCurrentInventoryLocation(dst);
9580 {
9583 {
9585 }
9586 else
9587 {
9589
9590
9591 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9592 {
9594 }
9595 else
9596 {
9597 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9598 }
9599 }
9600 }
9601 }
9602
9603 ScriptInputUserData ctx = new ScriptInputUserData;
9611 }
9612 }
9613 else if (!
GetGame().IsMultiplayer())
9614 {
9616 }
9617 }
9618 }
9619
9621 {
9622 if (root)
9623 {
9624 vector m4[4];
9625 root.GetTransform(m4);
9626 dst.SetGround(this, m4);
9627 }
9628 else
9629 {
9630 GetInventory().GetCurrentInventoryLocation(dst);
9631 }
9632 }
9633
9634 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9635 {
9636
9637 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9638 return false;
9639
9640 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9641 return false;
9642
9643
9645 return false;
9646
9647
9648 Magazine mag = Magazine.Cast(this);
9649 if (mag)
9650 {
9651 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9652 return false;
9653
9654 if (stack_max_limit)
9655 {
9656 Magazine other_mag = Magazine.Cast(other_item);
9657 if (other_item)
9658 {
9659 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9660 return false;
9661 }
9662
9663 }
9664 }
9665 else
9666 {
9667
9669 return false;
9670
9672 return false;
9673 }
9674
9675 PlayerBase player = null;
9676 if (CastTo(player, GetHierarchyRootPlayer()))
9677 {
9678 if (player.GetInventory().HasAttachment(this))
9679 return false;
9680
9681 if (player.IsItemsToDelete())
9682 return false;
9683 }
9684
9685 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9686 return false;
9687
9688 int slotID;
9690 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9691 return false;
9692
9693 return true;
9694 }
9695
9697 {
9699 }
9700
9702 {
9703 return m_IsResultOfSplit;
9704 }
9705
9707 {
9708 m_IsResultOfSplit = value;
9709 }
9710
9712 {
9714 }
9715
9717 {
9718 float other_item_quantity = other_item.GetQuantity();
9719 float this_free_space;
9720
9722
9724
9725 if (other_item_quantity > this_free_space)
9726 {
9727 return this_free_space;
9728 }
9729 else
9730 {
9731 return other_item_quantity;
9732 }
9733 }
9734
9736 {
9738 }
9739
9741 {
9743 return;
9744
9745 if (!IsMagazine() && other_item)
9746 {
9748 if (quantity_used != 0)
9749 {
9750 float hp1 = GetHealth01("","");
9751 float hp2 = other_item.GetHealth01("","");
9752 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9753 hpResult = hpResult / (
GetQuantity() + quantity_used);
9754
9755 hpResult *= GetMaxHealth();
9756 Math.Round(hpResult);
9757 SetHealth("", "Health", hpResult);
9758
9760 other_item.AddQuantity(-quantity_used);
9761 }
9762 }
9764 }
9765
9767 {
9768 #ifdef SERVER
9769 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9770 GetHierarchyParent().IncreaseLifetimeUp();
9771 #endif
9772 };
9773
9775 {
9776 PlayerBase p = PlayerBase.Cast(player);
9777
9778 array<int> recipesIds = p.m_Recipes;
9779 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9780 if (moduleRecipesManager)
9781 {
9782 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9783 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9784 }
9785
9786 for (int i = 0;i < recipesIds.Count(); i++)
9787 {
9788 int key = recipesIds.Get(i);
9789 string recipeName = moduleRecipesManager.GetRecipeName(key);
9791 }
9792 }
9793
9794
9795 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9796 {
9797 super.GetDebugActions(outputList);
9798
9799
9805
9806
9811
9816
9817
9821
9822
9824 {
9828 }
9829
9832
9833
9837
9839
9840 InventoryLocation loc = new InventoryLocation();
9841 GetInventory().GetCurrentInventoryLocation(loc);
9843 {
9844 if (Gizmo_IsSupported())
9847 }
9848
9850 }
9851
9852
9853
9854
9856 {
9857 super.OnAction(action_id, player, ctx);
9858
9860 {
9861 switch (action_id)
9862 {
9865 return true;
9868 return true;
9869 }
9870 }
9871
9873 {
9874 switch (action_id)
9875 {
9877 Delete();
9878 return true;
9879 }
9880 }
9881
9882 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9883 {
9884 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9885 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9886 PlayerBase p = PlayerBase.Cast(player);
9887 if (
EActions.RECIPES_RANGE_START < 1000)
9888 {
9889 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9890 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9891 }
9892 }
9893 #ifndef SERVER
9894 else if (action_id ==
EActions.WATCH_PLAYER)
9895 {
9896 PluginDeveloper.SetDeveloperItemClientEx(player);
9897 }
9898 #endif
9900 {
9901 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9902 {
9903 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9904 OnDebugButtonPressServer(id + 1);
9905 }
9906
9907 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9908 {
9909 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9911 }
9912
9913 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9914 {
9915 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9917 }
9918
9919 else if (action_id ==
EActions.ADD_QUANTITY)
9920 {
9921 if (IsMagazine())
9922 {
9923 Magazine mag = Magazine.Cast(this);
9924 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9925 }
9926 else
9927 {
9929 }
9930
9931 if (m_EM)
9932 {
9933 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9934 }
9935
9936 }
9937
9938 else if (action_id ==
EActions.REMOVE_QUANTITY)
9939 {
9940 if (IsMagazine())
9941 {
9942 Magazine mag2 = Magazine.Cast(this);
9943 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9944 }
9945 else
9946 {
9948 }
9949 if (m_EM)
9950 {
9951 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9952 }
9953
9954 }
9955
9956 else if (action_id ==
EActions.SET_QUANTITY_0)
9957 {
9959
9960 if (m_EM)
9961 {
9962 m_EM.SetEnergy(0);
9963 }
9964 }
9965
9966 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9967 {
9969
9970 if (m_EM)
9971 {
9972 m_EM.SetEnergy(m_EM.GetEnergyMax());
9973 }
9974 }
9975
9976 else if (action_id ==
EActions.ADD_HEALTH)
9977 {
9978 AddHealth("","",GetMaxHealth("","Health")/5);
9979 }
9980 else if (action_id ==
EActions.REMOVE_HEALTH)
9981 {
9982 AddHealth("","",-GetMaxHealth("","Health")/5);
9983 }
9984 else if (action_id ==
EActions.DESTROY_HEALTH)
9985 {
9986 SetHealth01("","",0);
9987 }
9988 else if (action_id ==
EActions.WATCH_ITEM)
9989 {
9991 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9992 #ifdef DEVELOPER
9993 SetDebugDeveloper_item(this);
9994 #endif
9995 }
9996
9997 else if (action_id ==
EActions.ADD_TEMPERATURE)
9998 {
9999 AddTemperature(20);
10000
10001 }
10002
10003 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10004 {
10005 AddTemperature(-20);
10006
10007 }
10008
10009 else if (action_id ==
EActions.FLIP_FROZEN)
10010 {
10011 SetFrozen(!GetIsFrozen());
10012
10013 }
10014
10015 else if (action_id ==
EActions.ADD_WETNESS)
10016 {
10018
10019 }
10020
10021 else if (action_id ==
EActions.REMOVE_WETNESS)
10022 {
10024
10025 }
10026
10027 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10028 {
10031
10032
10033 }
10034
10035 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10036 {
10039 }
10040
10041 else if (action_id ==
EActions.MAKE_SPECIAL)
10042 {
10043 auto debugParams = DebugSpawnParams.WithPlayer(player);
10044 OnDebugSpawnEx(debugParams);
10045 }
10046
10047 }
10048
10049
10050 return false;
10051 }
10052
10053
10054
10055
10059
10062
10063
10064
10066 {
10067 return false;
10068 }
10069
10070
10072 {
10073 return true;
10074 }
10075
10076
10078 {
10079 return true;
10080 }
10081
10082
10083
10085 {
10086 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10088 }
10089
10092 {
10093 return null;
10094 }
10095
10097 {
10098 return false;
10099 }
10100
10102 {
10103 return false;
10104 }
10105
10109
10110
10112 {
10113 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10114 return module_repairing.CanRepair(this, item_repair_kit);
10115 }
10116
10117
10118 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10119 {
10120 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10121 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10122 }
10123
10124
10126 {
10127
10128
10129
10130
10131
10132
10133
10134
10135 return 1;
10136 }
10137
10138
10139
10141 {
10143 }
10144
10145
10146
10148 {
10150 }
10151
10152
10161 {
10162 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10163
10164 if (player)
10165 {
10166 player.MessageStatus(text);
10167 }
10168 }
10169
10170
10179 {
10180 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10181
10182 if (player)
10183 {
10184 player.MessageAction(text);
10185 }
10186 }
10187
10188
10197 {
10198 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10199
10200 if (player)
10201 {
10202 player.MessageFriendly(text);
10203 }
10204 }
10205
10206
10215 {
10216 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10217
10218 if (player)
10219 {
10220 player.MessageImportant(text);
10221 }
10222 }
10223
10225 {
10226 return true;
10227 }
10228
10229
10230 override bool KindOf(
string tag)
10231 {
10232 bool found = false;
10233 string item_name = this.
GetType();
10236
10237 int array_size = item_tag_array.Count();
10238 for (int i = 0; i < array_size; i++)
10239 {
10240 if (item_tag_array.Get(i) == tag)
10241 {
10242 found = true;
10243 break;
10244 }
10245 }
10246 return found;
10247 }
10248
10249
10251 {
10252
10253 super.OnRPC(sender, rpc_type,ctx);
10254
10255
10256 switch (rpc_type)
10257 {
10258 #ifndef SERVER
10259 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10260 Param2<bool, string> p = new Param2<bool, string>(false, "");
10261
10263 return;
10264
10265 bool play = p.param1;
10266 string soundSet = p.param2;
10267
10268 if (play)
10269 {
10271 {
10273 {
10275 }
10276 }
10277 else
10278 {
10280 }
10281 }
10282 else
10283 {
10285 }
10286
10287 break;
10288 #endif
10289
10290 }
10291
10293 {
10295 }
10296 }
10297
10298
10299
10300
10302 {
10303 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10304 return plugin.GetID(
name);
10305 }
10306
10308 {
10309 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10310 return plugin.GetName(id);
10311 }
10312
10315 {
10316
10317
10318 int varFlags;
10319 if (!ctx.
Read(varFlags))
10320 return;
10321
10322 if (varFlags & ItemVariableFlags.FLOAT)
10323 {
10325 }
10326 }
10327
10329 {
10330
10331 super.SerializeNumericalVars(floats_out);
10332
10333
10334
10336 {
10338 }
10339
10341 {
10343 }
10344
10346 {
10348 }
10349
10351 {
10356 }
10357
10359 {
10361 }
10362 }
10363
10365 {
10366
10367 super.DeSerializeNumericalVars(floats);
10368
10369
10370 int index = 0;
10371 int mask = Math.Round(floats.Get(index));
10372
10373 index++;
10374
10376 {
10378 {
10380 }
10381 else
10382 {
10383 float quantity = floats.Get(index);
10384 SetQuantity(quantity,
true,
false,
false,
false);
10385 }
10386 index++;
10387 }
10388
10390 {
10391 float wet = floats.Get(index);
10393 index++;
10394 }
10395
10397 {
10398 int liquidtype = Math.Round(floats.Get(index));
10400 index++;
10401 }
10402
10404 {
10406 index++;
10408 index++;
10410 index++;
10412 index++;
10413 }
10414
10416 {
10417 int cleanness = Math.Round(floats.Get(index));
10419 index++;
10420 }
10421 }
10422
10424 {
10425 super.WriteVarsToCTX(ctx);
10426
10427
10429 {
10431 }
10432
10434 {
10436 }
10437
10439 {
10441 }
10442
10444 {
10445 int r,g,b,a;
10451 }
10452
10454 {
10456 }
10457 }
10458
10460 {
10461 if (!super.ReadVarsFromCTX(ctx,version))
10462 return false;
10463
10464 int intValue;
10465 float value;
10466
10467 if (version < 140)
10468 {
10469 if (!ctx.
Read(intValue))
10470 return false;
10471
10472 m_VariablesMask = intValue;
10473 }
10474
10476 {
10477 if (!ctx.
Read(value))
10478 return false;
10479
10481 {
10483 }
10484 else
10485 {
10487 }
10488 }
10489
10490 if (version < 140)
10491 {
10493 {
10494 if (!ctx.
Read(value))
10495 return false;
10496 SetTemperatureDirect(value);
10497 }
10498 }
10499
10501 {
10502 if (!ctx.
Read(value))
10503 return false;
10505 }
10506
10508 {
10509 if (!ctx.
Read(intValue))
10510 return false;
10512 }
10513
10515 {
10516 int r,g,b,a;
10518 return false;
10520 return false;
10522 return false;
10524 return false;
10525
10527 }
10528
10530 {
10531 if (!ctx.
Read(intValue))
10532 return false;
10534 }
10535
10536 if (version >= 138 && version < 140)
10537 {
10539 {
10540 if (!ctx.
Read(intValue))
10541 return false;
10542 SetFrozen(intValue);
10543 }
10544 }
10545
10546 return true;
10547 }
10548
10549
10551 {
10554 {
10556 }
10557
10558 if (!super.OnStoreLoad(ctx, version))
10559 {
10561 return false;
10562 }
10563
10564 if (version >= 114)
10565 {
10566 bool hasQuickBarIndexSaved;
10567
10568 if (!ctx.
Read(hasQuickBarIndexSaved))
10569 {
10571 return false;
10572 }
10573
10574 if (hasQuickBarIndexSaved)
10575 {
10576 int itmQBIndex;
10577
10578
10579 if (!ctx.
Read(itmQBIndex))
10580 {
10582 return false;
10583 }
10584
10585 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10586 if (itmQBIndex != -1 && parentPlayer)
10587 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10588 }
10589 }
10590 else
10591 {
10592
10593 PlayerBase player;
10594 int itemQBIndex;
10595 if (version ==
int.
MAX)
10596 {
10597 if (!ctx.
Read(itemQBIndex))
10598 {
10600 return false;
10601 }
10602 }
10603 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10604 {
10605
10606 if (!ctx.
Read(itemQBIndex))
10607 {
10609 return false;
10610 }
10611 if (itemQBIndex != -1 && player)
10612 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10613 }
10614 }
10615
10616 if (version < 140)
10617 {
10618
10619 if (!LoadVariables(ctx, version))
10620 {
10622 return false;
10623 }
10624 }
10625
10626
10628 {
10630 return false;
10631 }
10632 if (version >= 132)
10633 {
10635 if (raib)
10636 {
10638 {
10640 return false;
10641 }
10642 }
10643 }
10644
10646 return true;
10647 }
10648
10649
10650
10652 {
10653 super.OnStoreSave(ctx);
10654
10655 PlayerBase player;
10656 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10657 {
10659
10660 int itemQBIndex = -1;
10661 itemQBIndex = player.FindQuickBarEntityIndex(this);
10662 ctx.
Write(itemQBIndex);
10663 }
10664 else
10665 {
10667 }
10668
10670
10672 if (raib)
10673 {
10675 }
10676 }
10677
10678
10680 {
10681 super.AfterStoreLoad();
10682
10684 {
10686 }
10687
10689 {
10692 }
10693 }
10694
10696 {
10697 super.EEOnAfterLoad();
10698
10700 {
10702 }
10703
10706 }
10707
10709 {
10710 return false;
10711 }
10712
10713
10714
10716 {
10718 {
10719 #ifdef PLATFORM_CONSOLE
10720
10722 {
10724 if (menu)
10725 {
10727 }
10728 }
10729 #endif
10730 }
10731
10733 {
10736 }
10737
10739 {
10740 SetWeightDirty();
10742 }
10744 {
10747 }
10748
10750 {
10753 }
10755 {
10758 }
10759
10760 super.OnVariablesSynchronized();
10761 }
10762
10763
10764
10766 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10767 {
10768 if (!IsServerCheck(allow_client))
10769 return false;
10770
10772 return false;
10773
10776
10777 if (value <= (min + 0.001))
10778 value = min;
10779
10780 if (value == min)
10781 {
10782 if (destroy_config)
10783 {
10784 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10785 if (dstr)
10786 {
10788 this.Delete();
10789 return true;
10790 }
10791 }
10792 else if (destroy_forced)
10793 {
10795 this.Delete();
10796 return true;
10797 }
10798
10800 }
10801
10804
10806 {
10808
10809 if (delta)
10811 }
10812
10814
10815 return false;
10816 }
10817
10818
10820 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10821 {
10823 }
10824
10826 {
10829 }
10830
10832 {
10835 }
10836
10838 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10839 {
10840 float value_clamped = Math.Clamp(value, 0, 1);
10842 SetQuantity(result, destroy_config, destroy_forced);
10843 }
10844
10845
10848 {
10850 }
10851
10853 {
10855 }
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10867 {
10868 int slot = -1;
10869 if (GetInventory())
10870 {
10871 InventoryLocation il = new InventoryLocation;
10872 GetInventory().GetCurrentInventoryLocation(il);
10874 }
10875
10877 }
10878
10880 {
10881 float quantity_max = 0;
10882
10884 {
10885 if (attSlotID != -1)
10886 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10887
10888 if (quantity_max <= 0)
10890 }
10891
10892 if (quantity_max <= 0)
10894
10895 return quantity_max;
10896 }
10897
10899 {
10901 }
10902
10904 {
10906 }
10907
10908
10910 {
10912 }
10913
10915 {
10917 }
10918
10920 {
10922 }
10923
10924
10926 {
10927
10928 float weightEx = GetWeightEx();
10929 float special = GetInventoryAndCargoWeight();
10930 return weightEx - special;
10931 }
10932
10933
10935 {
10937 }
10938
10940 {
10942 {
10943 #ifdef DEVELOPER
10944 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10945 {
10946 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10948 }
10949 #endif
10950
10951 return GetQuantity() * GetConfigWeightModified();
10952 }
10953 else if (HasEnergyManager())
10954 {
10955 #ifdef DEVELOPER
10956 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10957 {
10958 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10959 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10960 }
10961 #endif
10962 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10963 }
10964 else
10965 {
10966 #ifdef DEVELOPER
10967 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10968 {
10969 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10970 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10971 }
10972 #endif
10973 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10974 }
10975 }
10976
10979 {
10980 int item_count = 0;
10982
10983 if (GetInventory().GetCargo() != NULL)
10984 {
10985 item_count = GetInventory().GetCargo().GetItemCount();
10986 }
10987
10988 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10989 {
10990 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10991 if (item)
10992 item_count += item.GetNumberOfItems();
10993 }
10994 return item_count;
10995 }
10996
10999 {
11000 float weight = 0;
11001 float wetness = 1;
11002 if (include_wetness)
11005 {
11006 weight = wetness * m_ConfigWeight;
11007 }
11009 {
11010 weight = 1;
11011 }
11012 return weight;
11013 }
11014
11015
11016
11018 {
11019 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11020 {
11021 GameInventory inv = GetInventory();
11022 array<EntityAI> items = new array<EntityAI>;
11024 for (int i = 0; i < items.Count(); i++)
11025 {
11027 if (item)
11028 {
11030 }
11031 }
11032 }
11033 }
11034
11035
11036
11037
11039 {
11040 float energy = 0;
11041 if (HasEnergyManager())
11042 {
11043 energy = GetCompEM().GetEnergy();
11044 }
11045 return energy;
11046 }
11047
11048
11050 {
11051 super.OnEnergyConsumed();
11052
11054 }
11055
11057 {
11058 super.OnEnergyAdded();
11059
11061 }
11062
11063
11065 {
11066 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11067 {
11069 {
11070 float energy_0to1 = GetCompEM().GetEnergy0To1();
11072 }
11073 }
11074 }
11075
11076
11078 {
11079 return ConfigGetFloat("heatIsolation");
11080 }
11081
11083 {
11085 }
11086
11088 {
11089 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11090 if (
GetGame().ConfigIsExisting(paramPath))
11092
11093 return 0.0;
11094 }
11095
11097 {
11098 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11099 if (
GetGame().ConfigIsExisting(paramPath))
11101
11102 return 0.0;
11103 }
11104
11105 override void SetWet(
float value,
bool allow_client =
false)
11106 {
11107 if (!IsServerCheck(allow_client))
11108 return;
11109
11112
11114
11115 m_VarWet = Math.Clamp(value, min, max);
11116
11118 {
11121 }
11122 }
11123
11124 override void AddWet(
float value)
11125 {
11127 }
11128
11130 {
11132 }
11133
11135 {
11137 }
11138
11140 {
11142 }
11143
11145 {
11147 }
11148
11150 {
11152 }
11153
11154 override void OnWetChanged(
float newVal,
float oldVal)
11155 {
11158 if (newLevel != oldLevel)
11159 {
11161 }
11162 }
11163
11165 {
11166 SetWeightDirty();
11167 }
11168
11170 {
11171 return GetWetLevelInternal(
m_VarWet);
11172 }
11173
11174
11175
11177 {
11179 }
11180
11182 {
11184 }
11185
11187 {
11189 }
11190
11192 {
11194 }
11195
11196
11197
11199 {
11200 if (ConfigIsExisting("itemModelLength"))
11201 {
11202 return ConfigGetFloat("itemModelLength");
11203 }
11204 return 0;
11205 }
11206
11208 {
11209 if (ConfigIsExisting("itemAttachOffset"))
11210 {
11211 return ConfigGetFloat("itemAttachOffset");
11212 }
11213 return 0;
11214 }
11215
11216 override void SetCleanness(
int value,
bool allow_client =
false)
11217 {
11218 if (!IsServerCheck(allow_client))
11219 return;
11220
11222
11224
11227 }
11228
11230 {
11232 }
11233
11235 {
11236 return true;
11237 }
11238
11239
11240
11241
11243 {
11245 }
11246
11248 {
11250 }
11251
11252
11253
11254
11255 override void SetColor(
int r,
int g,
int b,
int a)
11256 {
11262 }
11264 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11265 {
11270 }
11271
11273 {
11275 }
11276
11279 {
11280 int r,g,b,a;
11282 r = r/255;
11283 g = g/255;
11284 b = b/255;
11285 a = a/255;
11286 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11287 }
11288
11289
11290
11291 override void SetLiquidType(
int value,
bool allow_client =
false)
11292 {
11293 if (!IsServerCheck(allow_client))
11294 return;
11295
11300 }
11301
11303 {
11304 return ConfigGetInt("varLiquidTypeInit");
11305 }
11306
11308 {
11310 }
11311
11313 {
11315 SetFrozen(false);
11316 }
11317
11320 {
11321 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11322 }
11323
11324
11327 {
11328 PlayerBase nplayer;
11329 if (PlayerBase.CastTo(nplayer, player))
11330 {
11332
11333 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11334 }
11335 }
11336
11337
11340 {
11341 PlayerBase nplayer;
11342 if (PlayerBase.CastTo(nplayer,player))
11343 {
11344
11345 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11346
11347 }
11348
11349
11350 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11351
11352
11353 if (HasEnergyManager())
11354 {
11355 GetCompEM().UpdatePlugState();
11356 }
11357 }
11358
11359
11361 {
11362 super.OnPlacementStarted(player);
11363
11365 }
11366
11367 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11368 {
11370 {
11371 m_AdminLog.OnPlacementComplete(player,
this);
11372 }
11373
11374 super.OnPlacementComplete(player, position, orientation);
11375 }
11376
11377
11378
11379
11380
11382 {
11384 {
11385 return true;
11386 }
11387 else
11388 {
11389 return false;
11390 }
11391 }
11392
11393
11395 {
11397 {
11399 }
11400 }
11401
11402
11404 {
11406 }
11407
11409 {
11411 }
11412
11413 override void InsertAgent(
int agent,
float count = 1)
11414 {
11415 if (count < 1)
11416 return;
11417
11419 }
11420
11423 {
11425 }
11426
11427
11429 {
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
11468
11469
11470
11471
11472
11473
11475 {
11477 return false;
11478 return true;
11479 }
11480
11482 {
11483
11485 }
11486
11487
11490 {
11491 super.CheckForRoofLimited(timeTresholdMS);
11492
11494 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11495 {
11496 m_PreviousRoofTestTime = time;
11497 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11498 }
11499 }
11500
11501
11503 {
11505 {
11506 return 0;
11507 }
11508
11509 if (GetInventory().GetAttachmentSlotsCount() != 0)
11510 {
11511 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11512 if (filter)
11513 return filter.GetProtectionLevel(type, false, system);
11514 else
11515 return 0;
11516 }
11517
11518 string subclassPath, entryName;
11519
11520 switch (type)
11521 {
11523 entryName = "biological";
11524 break;
11526 entryName = "chemical";
11527 break;
11528 default:
11529 entryName = "biological";
11530 break;
11531 }
11532
11533 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11534
11536 }
11537
11538
11539
11542 {
11543 if (!IsMagazine())
11545
11547 }
11548
11549
11550
11551
11552
11557 {
11558 return true;
11559 }
11560
11562 {
11564 }
11565
11566
11567
11568
11569
11571 {
11572 if (parent)
11573 {
11574 if (parent.IsInherited(DayZInfected))
11575 return true;
11576
11577 if (!parent.IsRuined())
11578 return true;
11579 }
11580
11581 return true;
11582 }
11583
11585 {
11586 if (!super.CanPutAsAttachment(parent))
11587 {
11588 return false;
11589 }
11590
11591 if (!IsRuined() && !parent.IsRuined())
11592 {
11593 return true;
11594 }
11595
11596 return false;
11597 }
11598
11600 {
11601
11602
11603
11604
11605 return super.CanReceiveItemIntoCargo(item);
11606 }
11607
11609 {
11610
11611
11612
11613
11614 GameInventory attachmentInv = attachment.GetInventory();
11616 {
11617 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11618 return false;
11619 }
11620
11621 InventoryLocation loc = new InventoryLocation();
11622 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11623 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11624 return false;
11625
11626 return super.CanReceiveAttachment(attachment, slotId);
11627 }
11628
11630 {
11631 if (!super.CanReleaseAttachment(attachment))
11632 return false;
11633
11634 return GetInventory().AreChildrenAccessible();
11635 }
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11658 {
11659 int id = muzzle_owner.GetMuzzleID();
11660 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11661
11662 if (WPOF_array)
11663 {
11664 for (int i = 0; i < WPOF_array.Count(); i++)
11665 {
11666 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11667
11668 if (WPOF)
11669 {
11670 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11671 }
11672 }
11673 }
11674 }
11675
11676
11678 {
11679 int id = muzzle_owner.GetMuzzleID();
11681
11682 if (WPOBE_array)
11683 {
11684 for (int i = 0; i < WPOBE_array.Count(); i++)
11685 {
11686 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11687
11688 if (WPOBE)
11689 {
11690 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11691 }
11692 }
11693 }
11694 }
11695
11696
11698 {
11699 int id = muzzle_owner.GetMuzzleID();
11700 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11701
11702 if (WPOOH_array)
11703 {
11704 for (int i = 0; i < WPOOH_array.Count(); i++)
11705 {
11706 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11707
11708 if (WPOOH)
11709 {
11710 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11711 }
11712 }
11713 }
11714 }
11715
11716
11718 {
11719 int id = muzzle_owner.GetMuzzleID();
11720 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11721
11722 if (WPOOH_array)
11723 {
11724 for (int i = 0; i < WPOOH_array.Count(); i++)
11725 {
11726 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11727
11728 if (WPOOH)
11729 {
11730 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11731 }
11732 }
11733 }
11734 }
11735
11736
11738 {
11739 int id = muzzle_owner.GetMuzzleID();
11740 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11741
11742 if (WPOOH_array)
11743 {
11744 for (int i = 0; i < WPOOH_array.Count(); i++)
11745 {
11746 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11747
11748 if (WPOOH)
11749 {
11750 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11751 }
11752 }
11753 }
11754 }
11755
11756
11757
11759 {
11761 {
11762 return true;
11763 }
11764
11765 return false;
11766 }
11767
11769 {
11771 {
11772 return true;
11773 }
11774
11775 return false;
11776 }
11777
11779 {
11781 {
11782 return true;
11783 }
11784
11785 return false;
11786 }
11787
11789 {
11790 return false;
11791 }
11792
11795 {
11796 return UATimeSpent.DEFAULT_DEPLOY;
11797 }
11798
11799
11800
11801
11803 {
11805 SetSynchDirty();
11806 }
11807
11809 {
11811 }
11812
11813
11815 {
11816 return false;
11817 }
11818
11821 {
11822 string att_type = "None";
11823
11824 if (ConfigIsExisting("soundAttType"))
11825 {
11826 att_type = ConfigGetString("soundAttType");
11827 }
11828
11830 }
11831
11833 {
11835 }
11836
11837
11838
11839
11840
11846
11848 {
11851
11853 }
11854
11855
11857 {
11859 return;
11860
11862
11865
11868
11869 SoundParameters params = new SoundParameters();
11873 }
11874
11875
11877 {
11879 return;
11880
11882 SetSynchDirty();
11883
11886 }
11887
11888
11890 {
11892 return;
11893
11895 SetSynchDirty();
11896
11899 }
11900
11902 {
11904 }
11905
11907 {
11909 }
11910
11913 {
11914 if (!
GetGame().IsDedicatedServer())
11915 {
11916 if (ConfigIsExisting("attachSoundSet"))
11917 {
11918 string cfg_path = "";
11919 string soundset = "";
11920 string type_name =
GetType();
11921
11924 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11925 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11926
11927 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11928 {
11929 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11930 {
11931 if (cfg_slot_array[i] == slot_type)
11932 {
11933 soundset = cfg_soundset_array[i];
11934 break;
11935 }
11936 }
11937 }
11938
11939 if (soundset != "")
11940 {
11941 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11943 }
11944 }
11945 }
11946 }
11947
11949 {
11950
11951 }
11952
11953 void OnApply(PlayerBase player);
11954
11956 {
11957 return 1.0;
11958 };
11959
11961 {
11963 }
11964
11966 {
11968 }
11969
11971
11973 {
11974 SetDynamicPhysicsLifeTime(0.01);
11976 }
11977
11979 {
11980 array<string> zone_names = new array<string>;
11981 GetDamageZones(zone_names);
11982 for (int i = 0; i < zone_names.Count(); i++)
11983 {
11984 SetHealthMax(zone_names.Get(i),"Health");
11985 }
11986 SetHealthMax("","Health");
11987 }
11988
11991 {
11992 float global_health = GetHealth01("","Health");
11993 array<string> zones = new array<string>;
11994 GetDamageZones(zones);
11995
11996 for (int i = 0; i < zones.Count(); i++)
11997 {
11998 SetHealth01(zones.Get(i),"Health",global_health);
11999 }
12000 }
12001
12004 {
12005 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12006 }
12007
12009 {
12010 if (!hasRootAsPlayer)
12011 {
12012 if (refParentIB)
12013 {
12014
12015 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12016 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12017
12018 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12019 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12020
12023 }
12024 else
12025 {
12026
12029 }
12030 }
12031 }
12032
12034 {
12036 {
12037 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12038 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12039 {
12040 float heatPermCoef = 1.0;
12042 while (ent)
12043 {
12044 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12045 ent = ent.GetHierarchyParent();
12046 }
12047
12048 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12049 }
12050 }
12051 }
12052
12054 {
12055
12056 EntityAI parent = GetHierarchyParent();
12057 if (!parent)
12058 {
12059 hasParent = false;
12060 hasRootAsPlayer = false;
12061 }
12062 else
12063 {
12064 hasParent = true;
12065 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12066 refParentIB =
ItemBase.Cast(parent);
12067 }
12068 }
12069
12070 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12071 {
12072
12073 }
12074
12076 {
12077
12078 return false;
12079 }
12080
12082 {
12083
12084
12085 return false;
12086 }
12087
12089 {
12090
12091 return false;
12092 }
12093
12096 {
12097 return !GetIsFrozen() &&
IsOpen();
12098 }
12099
12101 {
12102 bool hasParent = false, hasRootAsPlayer = false;
12104
12105 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12106 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12107
12108 if (wwtu || foodDecay)
12109 {
12113
12114 if (processWetness || processTemperature || processDecay)
12115 {
12117
12118 if (processWetness)
12119 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12120
12121 if (processTemperature)
12123
12124 if (processDecay)
12125 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12126 }
12127 }
12128 }
12129
12132 {
12134 }
12135
12137 {
12140
12141 return super.GetTemperatureFreezeThreshold();
12142 }
12143
12145 {
12148
12149 return super.GetTemperatureThawThreshold();
12150 }
12151
12153 {
12156
12157 return super.GetItemOverheatThreshold();
12158 }
12159
12161 {
12163 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12164
12165 return super.GetTemperatureFreezeTime();
12166 }
12167
12169 {
12171 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12172
12173 return super.GetTemperatureThawTime();
12174 }
12175
12180
12182 {
12183 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12184 }
12185
12187 {
12188 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12189 }
12190
12193 {
12195 }
12196
12198 {
12200 }
12201
12203 {
12205 }
12206
12209 {
12210 return null;
12211 }
12212
12215 {
12216 return false;
12217 }
12218
12220 {
12222 {
12225 if (!trg)
12226 {
12228 explosive = this;
12229 }
12230
12231 explosive.PairRemote(trg);
12233
12234 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12235 trg.SetPersistentPairID(persistentID);
12236 explosive.SetPersistentPairID(persistentID);
12237
12238 return true;
12239 }
12240 return false;
12241 }
12242
12245 {
12246 float ret = 1.0;
12249 ret *= GetHealth01();
12250
12251 return ret;
12252 }
12253
12254 #ifdef DEVELOPER
12255 override void SetDebugItem()
12256 {
12257 super.SetDebugItem();
12258 _itemBase = this;
12259 }
12260
12262 {
12263 string text = super.GetDebugText();
12264
12266 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12267
12268 return text;
12269 }
12270 #endif
12271
12273 {
12274 return true;
12275 }
12276
12278
12280
12282 {
12285 }
12286
12287
12295
12311}
12312
12314{
12316 if (entity)
12317 {
12318 bool is_item = entity.IsInherited(
ItemBase);
12319 if (is_item && full_quantity)
12320 {
12323 }
12324 }
12325 else
12326 {
12328 return NULL;
12329 }
12330 return entity;
12331}
12332
12334{
12335 if (item)
12336 {
12337 if (health > 0)
12338 item.SetHealth("", "", health);
12339
12340 if (item.CanHaveTemperature())
12341 {
12343 if (item.CanFreeze())
12344 item.SetFrozen(false);
12345 }
12346
12347 if (item.HasEnergyManager())
12348 {
12349 if (quantity >= 0)
12350 {
12351 item.GetCompEM().SetEnergy0To1(quantity);
12352 }
12353 else
12354 {
12356 }
12357 }
12358 else if (item.IsMagazine())
12359 {
12360 Magazine mag = Magazine.Cast(item);
12361 if (quantity >= 0)
12362 {
12363 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12364 }
12365 else
12366 {
12368 }
12369
12370 }
12371 else
12372 {
12373 if (quantity >= 0)
12374 {
12375 item.SetQuantityNormalized(quantity, false);
12376 }
12377 else
12378 {
12380 }
12381
12382 }
12383 }
12384}
12385
12386#ifdef DEVELOPER
12388#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.