7474{
7476 {
7477 return true;
7478 }
7479};
7480
7481
7482
7484{
7488
7490
7493
7494
7495
7496
7497
7506
7512
7517
7522
7543 protected bool m_IsResultOfSplit
7544
7546
7551
7552
7553
7555
7559
7560
7561
7563
7566
7567
7568
7574
7575
7583
7586
7587
7589
7590
7592
7593
7598
7599
7604
7605
7607
7608
7610 {
7615
7616 if (!
GetGame().IsDedicatedServer())
7617 {
7619 {
7621
7623 {
7625 }
7626 }
7627
7630 }
7631
7632 m_OldLocation = null;
7633
7635 {
7637 }
7638
7639 if (ConfigIsExisting("headSelectionsToHide"))
7640 {
7643 }
7644
7646 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7647 {
7649 }
7650
7652
7653 m_IsResultOfSplit = false;
7654
7656 }
7657
7659 {
7660 super.InitItemVariables();
7661
7667 m_Count = ConfigGetInt(
"count");
7668
7671
7676
7679
7684
7696
7700
7701
7704 if (ConfigIsExisting("canBeSplit"))
7705 {
7708 }
7709
7711 if (ConfigIsExisting("itemBehaviour"))
7713
7714
7717 RegisterNetSyncVariableInt("m_VarLiquidType");
7718 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7719
7720 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7721 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7722 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7723
7724 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7725 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7726 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7727 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7728
7729 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7730 RegisterNetSyncVariableBool("m_IsTakeable");
7731 RegisterNetSyncVariableBool("m_IsHologram");
7732
7735 {
7738 }
7739
7741
7743 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7745
7746 }
7747
7749 {
7751 }
7752
7754 {
7757 {
7762 }
7763 }
7764
7765 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7766 {
7768 {
7771 }
7772
7774 }
7775
7777 {
7783 }
7784
7786
7788 {
7790
7791 if (!action)
7792 {
7793 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7794 return;
7795 }
7796
7798 if (!ai)
7799 {
7801 return;
7802 }
7803
7805 if (!action_array)
7806 {
7807 action_array = new array<ActionBase_Basic>;
7809 }
7810 if (LogManager.IsActionLogEnable())
7811 {
7812 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7813 }
7814
7815 if (action_array.Find(action) != -1)
7816 {
7817 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7818 }
7819 else
7820 {
7821 action_array.Insert(action);
7822 }
7823 }
7824
7826 {
7828 ActionBase action = player.GetActionManager().GetAction(actionName);
7831
7832 if (action_array)
7833 {
7834 action_array.RemoveItem(action);
7835 }
7836 }
7837
7838
7839
7841 {
7842 ActionOverrideData overrideData = new ActionOverrideData();
7846
7848 if (!actionMap)
7849 {
7852 }
7853
7854 actionMap.Insert(this.
Type(), overrideData);
7855
7856 }
7857
7859
7861
7862
7864 {
7867
7870
7871 string config_to_search = "CfgVehicles";
7872 string muzzle_owner_config;
7873
7875 {
7876 if (IsInherited(Weapon))
7877 config_to_search = "CfgWeapons";
7878
7879 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7880
7881 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7882
7884
7885 if (config_OnFire_subclass_count > 0)
7886 {
7887 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7888
7889 for (int i = 0; i < config_OnFire_subclass_count; i++)
7890 {
7891 string particle_class = "";
7893 string config_OnFire_entry = config_OnFire_class + particle_class;
7894 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7895 WPOF_array.Insert(WPOF);
7896 }
7897
7898
7900 }
7901 }
7902
7904 {
7905 config_to_search = "CfgWeapons";
7906 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7907
7908 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7909
7911
7912 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7913 {
7914 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7915
7916 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7917 {
7918 string particle_class2 = "";
7920 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7921 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7922 WPOBE_array.Insert(WPOBE);
7923 }
7924
7925
7927 }
7928 }
7929 }
7930
7931
7933 {
7936
7938 {
7939 string config_to_search = "CfgVehicles";
7940
7941 if (IsInherited(Weapon))
7942 config_to_search = "CfgWeapons";
7943
7944 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7945 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7946
7947 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7948 {
7949
7951
7953 {
7955 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7957 return;
7958 }
7959
7962
7963
7964
7966 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7967
7968 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7969 {
7970 string particle_class = "";
7972 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7974
7975 if (entry_type == CT_CLASS)
7976 {
7977 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7978 WPOOH_array.Insert(WPOF);
7979 }
7980 }
7981
7982
7984 }
7985 }
7986 }
7987
7989 {
7991 }
7992
7994 {
7996 {
7998
8001
8004
8005 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8006 }
8007 }
8008
8010 {
8012 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8013
8015 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8016
8018 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8019
8021 {
8023 }
8024 }
8025
8027 {
8029 }
8030
8032 {
8035 else
8037
8039 {
8042 }
8043 else
8044 {
8047
8050 }
8051
8053 }
8054
8056 {
8058 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8059 }
8060
8062 {
8064 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8066 }
8067
8069 {
8071 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8072 }
8073
8075 {
8078
8079 OverheatingParticle OP = new OverheatingParticle();
8084
8086 }
8087
8089 {
8092
8093 return -1;
8094 }
8095
8097 {
8099 {
8102
8103 for (int i = count; i > 0; --i)
8104 {
8105 int id = i - 1;
8108
8111
8112 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8113 {
8114 if (p)
8115 {
8118 }
8119 }
8120 }
8121 }
8122 }
8123
8125 {
8127 {
8129 {
8130 int id = i - 1;
8132
8133 if (OP)
8134 {
8136
8137 if (p)
8138 {
8140 }
8141
8142 delete OP;
8143 }
8144 }
8145
8148 }
8149 }
8150
8153 {
8154 return 0.0;
8155 }
8156
8157
8159 {
8160 return 250;
8161 }
8162
8164 {
8165 return 0;
8166 }
8167
8170 {
8172 return true;
8173
8174 return false;
8175 }
8176
8179 {
8182
8184 {
8186 }
8187 else
8188 {
8189
8191 }
8192
8194 }
8195
8202 {
8203 return -1;
8204 }
8205
8206
8207
8208
8210 {
8212 {
8214 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8215
8216 if (r_index >= 0)
8217 {
8218 InventoryLocation r_il = new InventoryLocation;
8219 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8220
8221 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8224 {
8225 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8226 }
8228 {
8229 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8230 }
8231
8232 }
8233
8234 player.GetHumanInventory().ClearUserReservedLocation(this);
8235 }
8236
8239 }
8240
8241
8242
8243
8245 {
8246 return ItemBase.m_DebugActionsMask;
8247 }
8248
8250 {
8251 return ItemBase.m_DebugActionsMask & mask;
8252 }
8253
8255 {
8256 ItemBase.m_DebugActionsMask = mask;
8257 }
8258
8260 {
8261 ItemBase.m_DebugActionsMask |= mask;
8262 }
8263
8265 {
8266 ItemBase.m_DebugActionsMask &= ~mask;
8267 }
8268
8270 {
8272 {
8274 }
8275 else
8276 {
8278 }
8279 }
8280
8281
8283 {
8284 if (GetEconomyProfile())
8285 {
8286 float q_max = GetEconomyProfile().GetQuantityMax();
8287 if (q_max > 0)
8288 {
8289 float q_min = GetEconomyProfile().GetQuantityMin();
8290 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8291
8293 {
8294 ComponentEnergyManager comp = GetCompEM();
8296 {
8298 }
8299 }
8301 {
8303
8304 }
8305
8306 }
8307 }
8308 }
8309
8312 {
8313 EntityAI parent = GetHierarchyParent();
8314
8315 if (parent)
8316 {
8317 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8318 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8319 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8320 }
8321 }
8322
8325 {
8326 EntityAI parent = GetHierarchyParent();
8327
8328 if (parent)
8329 {
8330 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8331 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8332 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8333 }
8334 }
8335
8337 {
8338
8339
8340
8341
8343
8345 {
8346 if (ScriptInputUserData.CanStoreInputUserData())
8347 {
8348 ScriptInputUserData ctx = new ScriptInputUserData;
8354 ctx.
Write(use_stack_max);
8357
8359 {
8360 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8361 }
8362 }
8363 }
8364 else if (!
GetGame().IsMultiplayer())
8365 {
8367 }
8368 }
8369
8371 {
8373 }
8374
8376 {
8378 }
8379
8381 {
8383 }
8384
8386 {
8387
8388 return false;
8389 }
8390
8392 {
8393 return false;
8394 }
8395
8399 {
8400 return false;
8401 }
8402
8404 {
8405 return "";
8406 }
8407
8409
8411 {
8412 return false;
8413 }
8414
8416 {
8417 return true;
8418 }
8419
8420
8421
8423 {
8424 return true;
8425 }
8426
8428 {
8429 return true;
8430 }
8431
8433 {
8434 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8436 }
8437
8439 {
8441 }
8442
8444 {
8446 if (!is_being_placed)
8448 SetSynchDirty();
8449 }
8450
8451
8453
8455 {
8457 }
8458
8460 {
8462 }
8463
8465 {
8466 return 1;
8467 }
8468
8470 {
8471 return false;
8472 }
8473
8475 {
8477 SetSynchDirty();
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
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8515 {
8516 super.OnMovedInsideCargo(container);
8517
8518 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8519 }
8520
8521 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8522 {
8523 super.EEItemLocationChanged(oldLoc,newLoc);
8524
8525 PlayerBase new_player = null;
8526 PlayerBase old_player = null;
8527
8528 if (newLoc.GetParent())
8529 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8530
8531 if (oldLoc.GetParent())
8532 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8533
8535 {
8536 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8537
8538 if (r_index >= 0)
8539 {
8540 InventoryLocation r_il = new InventoryLocation;
8541 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8542
8543 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8546 {
8547 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8548 }
8550 {
8551 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8552 }
8553
8554 }
8555 }
8556
8558 {
8559 if (new_player)
8560 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8561
8562 if (new_player == old_player)
8563 {
8564
8565 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8566 {
8568 {
8569 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8570 {
8571 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8572 }
8573 }
8574 else
8575 {
8576 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8577 }
8578 }
8579
8580 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8581 {
8582 int type = oldLoc.GetType();
8584 {
8585 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8586 }
8588 {
8589 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8590 }
8591 }
8592 if (!m_OldLocation)
8593 {
8594 m_OldLocation = new InventoryLocation;
8595 }
8596 m_OldLocation.Copy(oldLoc);
8597 }
8598 else
8599 {
8600 if (m_OldLocation)
8601 {
8602 m_OldLocation.Reset();
8603 }
8604 }
8605
8607 }
8608 else
8609 {
8610 if (new_player)
8611 {
8612 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8613 if (res_index >= 0)
8614 {
8615 InventoryLocation il = new InventoryLocation;
8616 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8618 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8621 {
8622 il.
GetParent().GetOnReleaseLock().Invoke(it);
8623 }
8625 {
8627 }
8628
8629 }
8630 }
8632 {
8633
8635 }
8636
8637 if (m_OldLocation)
8638 {
8639 m_OldLocation.Reset();
8640 }
8641 }
8642 }
8643
8644 override void EOnContact(IEntity other, Contact extra)
8645 {
8647 {
8648 int liquidType = -1;
8650 if (impactSpeed > 0.0)
8651 {
8653 #ifndef SERVER
8655 #else
8657 SetSynchDirty();
8658 #endif
8660 }
8661 }
8662
8663 #ifdef SERVER
8664 if (GetCompEM() && GetCompEM().IsPlugged())
8665 {
8666 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8667 GetCompEM().UnplugThis();
8668 }
8669 #endif
8670 }
8671
8673
8675 {
8677 }
8678
8680 {
8681
8682 }
8683
8685 {
8686 super.OnItemLocationChanged(old_owner, new_owner);
8687
8688 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8689 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8690
8691 if (!relatedPlayer && playerNew)
8692 relatedPlayer = playerNew;
8693
8694 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8695 {
8697 if (actionMgr)
8698 {
8699 ActionBase currentAction = actionMgr.GetRunningAction();
8700 if (currentAction)
8702 }
8703 }
8704
8705 Man ownerPlayerOld = null;
8706 Man ownerPlayerNew = null;
8707
8708 if (old_owner)
8709 {
8710 if (old_owner.
IsMan())
8711 {
8712 ownerPlayerOld = Man.Cast(old_owner);
8713 }
8714 else
8715 {
8716 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8717 }
8718 }
8719 else
8720 {
8722 {
8724
8725 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8726 {
8727 GetCompEM().UnplugThis();
8728 }
8729 }
8730 }
8731
8732 if (new_owner)
8733 {
8734 if (new_owner.
IsMan())
8735 {
8736 ownerPlayerNew = Man.Cast(new_owner);
8737 }
8738 else
8739 {
8740 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8741 }
8742 }
8743
8744 if (ownerPlayerOld != ownerPlayerNew)
8745 {
8746 if (ownerPlayerOld)
8747 {
8748 array<EntityAI> subItemsExit = new array<EntityAI>;
8750 for (int i = 0; i < subItemsExit.Count(); i++)
8751 {
8754 }
8755 }
8756
8757 if (ownerPlayerNew)
8758 {
8759 array<EntityAI> subItemsEnter = new array<EntityAI>;
8761 for (int j = 0; j < subItemsEnter.Count(); j++)
8762 {
8765 }
8766 }
8767 }
8768 else if (ownerPlayerNew != null)
8769 {
8770 PlayerBase nplayer;
8771 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8772 {
8773 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8775 for (int k = 0; k < subItemsUpdate.Count(); k++)
8776 {
8778 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8779 }
8780 }
8781 }
8782
8783 if (old_owner)
8784 old_owner.OnChildItemRemoved(this);
8785 if (new_owner)
8786 new_owner.OnChildItemReceived(this);
8787 }
8788
8789
8791 {
8792 super.EEDelete(parent);
8793 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8794 if (player)
8795 {
8797
8798 if (player.IsAlive())
8799 {
8800 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8801 if (r_index >= 0)
8802 {
8803 InventoryLocation r_il = new InventoryLocation;
8804 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8805
8806 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8809 {
8810 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8811 }
8813 {
8814 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8815 }
8816
8817 }
8818
8819 player.RemoveQuickBarEntityShortcut(this);
8820 }
8821 }
8822 }
8823
8825 {
8826 super.EEKilled(killer);
8827
8830 {
8831 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8832 {
8833 if (IsMagazine())
8834 {
8835 if (Magazine.Cast(this).GetAmmoCount() > 0)
8836 {
8838 }
8839 }
8840 else
8841 {
8843 }
8844 }
8845 }
8846 }
8847
8849 {
8850 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8851
8852 super.OnWasAttached(parent, slot_id);
8853
8856
8858 }
8859
8861 {
8862 super.OnWasDetached(parent, slot_id);
8863
8866 }
8867
8869 {
8870 int idx;
8873
8874 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8875 if (inventory_slots.Count() < 1)
8876 {
8877 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8878 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8879 }
8880 else
8881 {
8882 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8883 }
8884
8885 idx = inventory_slots.Find(slot);
8886 if (idx < 0)
8887 return "";
8888
8889 return attach_types.Get(idx);
8890 }
8891
8893 {
8894 int idx = -1;
8895 string slot;
8896
8899
8900 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8901 if (inventory_slots.Count() < 1)
8902 {
8903 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8904 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8905 }
8906 else
8907 {
8908 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8909 if (detach_types.Count() < 1)
8910 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8911 }
8912
8913 for (int i = 0; i < inventory_slots.Count(); i++)
8914 {
8915 slot = inventory_slots.Get(i);
8916 }
8917
8918 if (slot != "")
8919 {
8920 if (detach_types.Count() == 1)
8921 idx = 0;
8922 else
8923 idx = inventory_slots.Find(slot);
8924 }
8925 if (idx < 0)
8926 return "";
8927
8928 return detach_types.Get(idx);
8929 }
8930
8932 {
8933
8935
8936
8937 float min_time = 1;
8938 float max_time = 3;
8939 float delay = Math.RandomFloat(min_time, max_time);
8940
8941 explode_timer.Run(delay, this, "DoAmmoExplosion");
8942 }
8943
8945 {
8946 Magazine magazine = Magazine.Cast(this);
8947 int pop_sounds_count = 6;
8948 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8949
8950
8951 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8952 string sound_name = pop_sounds[ sound_idx ];
8954
8955
8956 magazine.ServerAddAmmoCount(-1);
8957
8958
8959 float min_temp_to_explode = 100;
8960
8961 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8962 {
8964 }
8965 }
8966
8967
8968 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8969 {
8970 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8971
8972 const int CHANCE_DAMAGE_CARGO = 4;
8973 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8974 const int CHANCE_DAMAGE_NOTHING = 2;
8975
8977 {
8978 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8979 int chances;
8980 int rnd;
8981
8982 if (GetInventory().GetCargo())
8983 {
8984 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8985 rnd = Math.RandomInt(0,chances);
8986
8987 if (rnd < CHANCE_DAMAGE_CARGO)
8988 {
8990 }
8991 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8992 {
8994 }
8995 }
8996 else
8997 {
8998 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8999 rnd = Math.RandomInt(0,chances);
9000
9001 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9002 {
9004 }
9005 }
9006 }
9007 }
9008
9010 {
9011 if (GetInventory().GetCargo())
9012 {
9013 int item_count = GetInventory().GetCargo().GetItemCount();
9014 if (item_count > 0)
9015 {
9016 int random_pick = Math.RandomInt(0, item_count);
9018 if (!item.IsExplosive())
9019 {
9020 item.AddHealth("","",damage);
9021 return true;
9022 }
9023 }
9024 }
9025 return false;
9026 }
9027
9029 {
9030 int attachment_count = GetInventory().AttachmentCount();
9031 if (attachment_count > 0)
9032 {
9033 int random_pick = Math.RandomInt(0, attachment_count);
9034 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9035 if (!attachment.IsExplosive())
9036 {
9037 attachment.AddHealth("","",damage);
9038 return true;
9039 }
9040 }
9041 return false;
9042 }
9043
9045 {
9047 }
9048
9050 {
9052 return GetInventory().CanRemoveEntity();
9053
9054 return false;
9055 }
9056
9058 {
9060 return;
9061
9063 {
9064 if (ScriptInputUserData.CanStoreInputUserData())
9065 {
9066 ScriptInputUserData ctx = new ScriptInputUserData;
9071 ctx.
Write(destination_entity);
9075 }
9076 }
9077 else if (!
GetGame().IsMultiplayer())
9078 {
9080 }
9081 }
9082
9084 {
9086 return;
9087
9088 float split_quantity_new;
9092 InventoryLocation loc = new InventoryLocation;
9093
9094 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9095 {
9097 split_quantity_new = stack_max;
9098 else
9100
9101 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9102 if (new_item)
9103 {
9104 new_item.SetResultOfSplit(true);
9105 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9107 new_item.SetQuantity(split_quantity_new);
9108 }
9109 }
9110 else if (destination_entity && slot_id == -1)
9111 {
9112 if (quantity > stack_max)
9113 split_quantity_new = stack_max;
9114 else
9115 split_quantity_new = quantity;
9116
9118 {
9121 }
9122
9123 if (new_item)
9124 {
9125 new_item.SetResultOfSplit(true);
9126 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9128 new_item.SetQuantity(split_quantity_new);
9129 }
9130 }
9131 else
9132 {
9133 if (stack_max != 0)
9134 {
9136 {
9138 }
9139
9140 if (split_quantity_new == 0)
9141 {
9142 if (!
GetGame().IsMultiplayer())
9143 player.PhysicalPredictiveDropItem(this);
9144 else
9145 player.ServerDropEntity(this);
9146 return;
9147 }
9148
9150
9151 if (new_item)
9152 {
9153 new_item.SetResultOfSplit(true);
9154 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9156 new_item.SetQuantity(stack_max);
9157 new_item.PlaceOnSurface();
9158 }
9159 }
9160 }
9161 }
9162
9164 {
9166 return;
9167
9168 float split_quantity_new;
9172 InventoryLocation loc = new InventoryLocation;
9173
9174 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9175 {
9177 split_quantity_new = stack_max;
9178 else
9180
9181 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9182 if (new_item)
9183 {
9184 new_item.SetResultOfSplit(true);
9185 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9187 new_item.SetQuantity(split_quantity_new);
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 {
9201 }
9202
9203 if (new_item)
9204 {
9205 new_item.SetResultOfSplit(true);
9206 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9208 new_item.SetQuantity(split_quantity_new);
9209 }
9210 }
9211 else
9212 {
9213 if (stack_max != 0)
9214 {
9216 {
9218 }
9219
9221
9222 if (new_item)
9223 {
9224 new_item.SetResultOfSplit(true);
9225 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9227 new_item.SetQuantity(stack_max);
9228 new_item.PlaceOnSurface();
9229 }
9230 }
9231 }
9232 }
9233
9235 {
9237 return;
9238
9240 {
9241 if (ScriptInputUserData.CanStoreInputUserData())
9242 {
9243 ScriptInputUserData ctx = new ScriptInputUserData;
9248 dst.WriteToContext(ctx);
9250 }
9251 }
9252 else if (!
GetGame().IsMultiplayer())
9253 {
9255 }
9256 }
9257
9259 {
9261 return;
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 return this;
9295
9297 float split_quantity_new;
9299 if (dst.IsValid())
9300 {
9301 int slot_id = dst.GetSlot();
9303
9304 if (quantity > stack_max)
9305 split_quantity_new = stack_max;
9306 else
9307 split_quantity_new = quantity;
9308
9310
9311 if (new_item)
9312 {
9313 new_item.SetResultOfSplit(true);
9314 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9317 }
9318
9319 return new_item;
9320 }
9321
9322 return null;
9323 }
9324
9326 {
9328 return;
9329
9331 float split_quantity_new;
9333 if (destination_entity)
9334 {
9336 if (quantity > stackable)
9337 split_quantity_new = stackable;
9338 else
9339 split_quantity_new = quantity;
9340
9341 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9342 if (new_item)
9343 {
9344 new_item.SetResultOfSplit(true);
9345 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9347 new_item.SetQuantity(split_quantity_new);
9348 }
9349 }
9350 }
9351
9353 {
9355 return;
9356
9358 {
9359 if (ScriptInputUserData.CanStoreInputUserData())
9360 {
9361 ScriptInputUserData ctx = new ScriptInputUserData;
9366 ItemBase destination_entity =
this;
9367 ctx.
Write(destination_entity);
9371 }
9372 }
9373 else if (!
GetGame().IsMultiplayer())
9374 {
9376 }
9377 }
9378
9380 {
9382 return;
9383
9385 float split_quantity_new;
9387 if (player)
9388 {
9390 if (quantity > stackable)
9391 split_quantity_new = stackable;
9392 else
9393 split_quantity_new = quantity;
9394
9395 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9396 new_item =
ItemBase.Cast(in_hands);
9397 if (new_item)
9398 {
9399 new_item.SetResultOfSplit(true);
9400 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9402 new_item.SetQuantity(split_quantity_new);
9403 }
9404 }
9405 }
9406
9408 {
9410 return;
9411
9413 float split_quantity_new = Math.Floor(quantity * 0.5);
9414
9416
9417 if (new_item)
9418 {
9419 if (new_item.GetQuantityMax() < split_quantity_new)
9420 {
9421 split_quantity_new = new_item.GetQuantityMax();
9422 }
9423
9424 new_item.SetResultOfSplit(true);
9425 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9426
9428 {
9431 }
9432 else
9433 {
9436 }
9437 }
9438 }
9439
9441 {
9443 return;
9444
9446 float split_quantity_new = Math.Floor(quantity / 2);
9447
9448 InventoryLocation invloc = new InventoryLocation;
9450
9452 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9453
9454 if (new_item)
9455 {
9456 if (new_item.GetQuantityMax() < split_quantity_new)
9457 {
9458 split_quantity_new = new_item.GetQuantityMax();
9459 }
9461 {
9464 }
9465 else
9466 {
9469 }
9470 }
9471 }
9472
9475 {
9476 SetWeightDirty();
9478
9479 if (parent)
9480 parent.OnAttachmentQuantityChangedEx(this, delta);
9481
9483 {
9485 {
9487 }
9489 {
9490 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9492 }
9493 }
9494
9495 }
9496
9499 {
9500
9501 }
9502
9505 {
9507 }
9508
9510 {
9511 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9512
9514 {
9515 if (newLevel == GameConstants.STATE_RUINED)
9516 {
9518 EntityAI parent = GetHierarchyParent();
9519 if (parent && parent.IsFireplace())
9520 {
9521 CargoBase cargo = GetInventory().GetCargo();
9522 if (cargo)
9523 {
9525 {
9527 }
9528 }
9529 }
9530 }
9531
9533 {
9534
9536 return;
9537 }
9538
9539 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9540 {
9542 }
9543 }
9544 }
9545
9546
9548 {
9549 super.OnRightClick();
9550
9552 {
9554 {
9555 if (ScriptInputUserData.CanStoreInputUserData())
9556 {
9557 vector m4[4];
9559
9560 EntityAI root = GetHierarchyRoot();
9561
9562 InventoryLocation dst = new InventoryLocation;
9564 {
9565 if (root)
9566 {
9567 root.GetTransform(m4);
9569 }
9570 else
9571 GetInventory().GetCurrentInventoryLocation(dst);
9572 }
9573 else
9574 {
9576
9577
9578 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9579 {
9580 if (root)
9581 {
9582 root.GetTransform(m4);
9584 }
9585 else
9586 GetInventory().GetCurrentInventoryLocation(dst);
9587 }
9588 else
9589 {
9590 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9591 }
9592 }
9593
9594 ScriptInputUserData ctx = new ScriptInputUserData;
9602 }
9603 }
9604 else if (!
GetGame().IsMultiplayer())
9605 {
9607 }
9608 }
9609 }
9610
9611 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9612 {
9613
9614 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9615 return false;
9616
9617 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9618 return false;
9619
9620
9622 return false;
9623
9624
9625 Magazine mag = Magazine.Cast(this);
9626 if (mag)
9627 {
9628 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9629 return false;
9630
9631 if (stack_max_limit)
9632 {
9633 Magazine other_mag = Magazine.Cast(other_item);
9634 if (other_item)
9635 {
9636 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9637 return false;
9638 }
9639
9640 }
9641 }
9642 else
9643 {
9644
9646 return false;
9647
9649 return false;
9650 }
9651
9652 PlayerBase player = null;
9653 if (CastTo(player, GetHierarchyRootPlayer()))
9654 {
9655 if (player.GetInventory().HasAttachment(this))
9656 return false;
9657
9658 if (player.IsItemsToDelete())
9659 return false;
9660 }
9661
9662 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9663 return false;
9664
9665 int slotID;
9667 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9668 return false;
9669
9670 return true;
9671 }
9672
9674 {
9676 }
9677
9679 {
9680 return m_IsResultOfSplit;
9681 }
9682
9684 {
9685 m_IsResultOfSplit = value;
9686 }
9687
9689 {
9691 }
9692
9694 {
9695 float other_item_quantity = other_item.GetQuantity();
9696 float this_free_space;
9697
9699
9701
9702 if (other_item_quantity > this_free_space)
9703 {
9704 return this_free_space;
9705 }
9706 else
9707 {
9708 return other_item_quantity;
9709 }
9710 }
9711
9713 {
9715 }
9716
9718 {
9720 return;
9721
9722 if (!IsMagazine() && other_item)
9723 {
9725 if (quantity_used != 0)
9726 {
9727 float hp1 = GetHealth01("","");
9728 float hp2 = other_item.GetHealth01("","");
9729 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9730 hpResult = hpResult / (
GetQuantity() + quantity_used);
9731
9732 hpResult *= GetMaxHealth();
9733 Math.Round(hpResult);
9734 SetHealth("", "Health", hpResult);
9735
9737 other_item.AddQuantity(-quantity_used);
9738 }
9739 }
9741 }
9742
9744 {
9745 #ifdef SERVER
9746 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9747 GetHierarchyParent().IncreaseLifetimeUp();
9748 #endif
9749 };
9750
9752 {
9753 PlayerBase p = PlayerBase.Cast(player);
9754
9755 array<int> recipesIds = p.m_Recipes;
9756 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9757 if (moduleRecipesManager)
9758 {
9759 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9760 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9761 }
9762
9763 for (int i = 0;i < recipesIds.Count(); i++)
9764 {
9765 int key = recipesIds.Get(i);
9766 string recipeName = moduleRecipesManager.GetRecipeName(key);
9768 }
9769 }
9770
9771
9772 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9773 {
9774 super.GetDebugActions(outputList);
9775
9776
9781
9782
9786
9790
9791
9794
9795
9797 {
9800 }
9801
9803
9806
9810 }
9811
9812
9813
9814
9816 {
9817 super.OnAction(action_id, player, ctx);
9818 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9819 {
9820 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9821 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9822 PlayerBase p = PlayerBase.Cast(player);
9823 if (
EActions.RECIPES_RANGE_START < 1000)
9824 {
9825 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9826 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9827 }
9828 }
9829 #ifndef SERVER
9830 else if (action_id ==
EActions.WATCH_PLAYER)
9831 {
9832 PluginDeveloper.SetDeveloperItemClientEx(player);
9833 }
9834 #endif
9836 {
9837 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9838 {
9839 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9840 OnDebugButtonPressServer(id + 1);
9841 }
9842
9843 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9844 {
9845 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9847 }
9848
9849 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9850 {
9851 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9853 }
9854
9855 else if (action_id ==
EActions.ADD_QUANTITY)
9856 {
9857 if (IsMagazine())
9858 {
9859 Magazine mag = Magazine.Cast(this);
9860 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9861 }
9862 else
9863 {
9865 }
9866
9867 if (m_EM)
9868 {
9869 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9870 }
9871
9872 }
9873
9874 else if (action_id ==
EActions.REMOVE_QUANTITY)
9875 {
9876 if (IsMagazine())
9877 {
9878 Magazine mag2 = Magazine.Cast(this);
9879 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9880 }
9881 else
9882 {
9884 }
9885 if (m_EM)
9886 {
9887 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9888 }
9889
9890 }
9891
9892 else if (action_id ==
EActions.SET_QUANTITY_0)
9893 {
9895
9896 if (m_EM)
9897 {
9898 m_EM.SetEnergy(0);
9899 }
9900 }
9901
9902 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9903 {
9905
9906 if (m_EM)
9907 {
9908 m_EM.SetEnergy(m_EM.GetEnergyMax());
9909 }
9910 }
9911
9912 else if (action_id ==
EActions.ADD_HEALTH)
9913 {
9914 AddHealth("","",GetMaxHealth("","Health")/5);
9915 }
9916 else if (action_id ==
EActions.REMOVE_HEALTH)
9917 {
9918 AddHealth("","",-GetMaxHealth("","Health")/5);
9919 }
9920 else if (action_id ==
EActions.DESTROY_HEALTH)
9921 {
9922 SetHealth01("","",0);
9923 }
9924 else if (action_id ==
EActions.WATCH_ITEM)
9925 {
9927 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9928 #ifdef DEVELOPER
9929 SetDebugDeveloper_item(this);
9930 #endif
9931 }
9932
9933 else if (action_id ==
EActions.ADD_TEMPERATURE)
9934 {
9935 AddTemperature(20);
9936
9937 }
9938
9939 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9940 {
9941 AddTemperature(-20);
9942
9943 }
9944
9945 else if (action_id ==
EActions.FLIP_FROZEN)
9946 {
9947 SetFrozen(!GetIsFrozen());
9948
9949 }
9950
9951 else if (action_id ==
EActions.ADD_WETNESS)
9952 {
9954
9955 }
9956
9957 else if (action_id ==
EActions.REMOVE_WETNESS)
9958 {
9960
9961 }
9962
9963 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9964 {
9967
9968
9969 }
9970
9971 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9972 {
9975 }
9976
9977 else if (action_id ==
EActions.MAKE_SPECIAL)
9978 {
9979 auto debugParams = DebugSpawnParams.WithPlayer(player);
9980 OnDebugSpawnEx(debugParams);
9981 }
9982
9983 else if (action_id ==
EActions.DELETE)
9984 {
9985 Delete();
9986 }
9987
9988 }
9989
9990
9991 return false;
9992 }
9993
9994
9995
9996
10000
10003
10004
10005
10007 {
10008 return false;
10009 }
10010
10011
10013 {
10014 return true;
10015 }
10016
10017
10019 {
10020 return true;
10021 }
10022
10023
10024
10026 {
10027 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10029 }
10030
10033 {
10034 return null;
10035 }
10036
10038 {
10039 return false;
10040 }
10041
10043 {
10044 return false;
10045 }
10046
10050
10051
10053 {
10054 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10055 return module_repairing.CanRepair(this, item_repair_kit);
10056 }
10057
10058
10059 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10060 {
10061 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10062 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10063 }
10064
10065
10067 {
10068
10069
10070
10071
10072
10073
10074
10075
10076 return 1;
10077 }
10078
10079
10080
10082 {
10084 }
10085
10086
10087
10089 {
10091 }
10092
10093
10102 {
10103 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10104
10105 if (player)
10106 {
10107 player.MessageStatus(text);
10108 }
10109 }
10110
10111
10120 {
10121 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10122
10123 if (player)
10124 {
10125 player.MessageAction(text);
10126 }
10127 }
10128
10129
10138 {
10139 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10140
10141 if (player)
10142 {
10143 player.MessageFriendly(text);
10144 }
10145 }
10146
10147
10156 {
10157 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10158
10159 if (player)
10160 {
10161 player.MessageImportant(text);
10162 }
10163 }
10164
10166 {
10167 return true;
10168 }
10169
10170
10171 override bool KindOf(
string tag)
10172 {
10173 bool found = false;
10174 string item_name = this.
GetType();
10177
10178 int array_size = item_tag_array.Count();
10179 for (int i = 0; i < array_size; i++)
10180 {
10181 if (item_tag_array.Get(i) == tag)
10182 {
10183 found = true;
10184 break;
10185 }
10186 }
10187 return found;
10188 }
10189
10190
10192 {
10193
10194 super.OnRPC(sender, rpc_type,ctx);
10195
10196
10197 switch (rpc_type)
10198 {
10199 #ifndef SERVER
10200 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10201 Param2<bool, string> p = new Param2<bool, string>(false, "");
10202
10204 return;
10205
10206 bool play = p.param1;
10207 string soundSet = p.param2;
10208
10209 if (play)
10210 {
10212 {
10214 {
10216 }
10217 }
10218 else
10219 {
10221 }
10222 }
10223 else
10224 {
10226 }
10227
10228 break;
10229 #endif
10230
10231 }
10232
10234 {
10236 }
10237 }
10238
10239
10240
10241
10243 {
10244 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10245 return plugin.GetID(
name);
10246 }
10247
10249 {
10250 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10251 return plugin.GetName(id);
10252 }
10253
10256 {
10257
10258
10259 int varFlags;
10260 if (!ctx.
Read(varFlags))
10261 return;
10262
10263 if (varFlags & ItemVariableFlags.FLOAT)
10264 {
10266 }
10267 }
10268
10270 {
10271
10272 super.SerializeNumericalVars(floats_out);
10273
10274
10275
10277 {
10279 }
10280
10282 {
10284 }
10285
10287 {
10289 }
10290
10292 {
10297 }
10298
10300 {
10302 }
10303 }
10304
10306 {
10307
10308 super.DeSerializeNumericalVars(floats);
10309
10310
10311 int index = 0;
10312 int mask = Math.Round(floats.Get(index));
10313
10314 index++;
10315
10317 {
10319 {
10321 }
10322 else
10323 {
10324 float quantity = floats.Get(index);
10325 SetQuantity(quantity,
true,
false,
false,
false);
10326 }
10327 index++;
10328 }
10329
10331 {
10332 float wet = floats.Get(index);
10334 index++;
10335 }
10336
10338 {
10339 int liquidtype = Math.Round(floats.Get(index));
10341 index++;
10342 }
10343
10345 {
10347 index++;
10349 index++;
10351 index++;
10353 index++;
10354 }
10355
10357 {
10358 int cleanness = Math.Round(floats.Get(index));
10360 index++;
10361 }
10362 }
10363
10365 {
10366 super.WriteVarsToCTX(ctx);
10367
10368
10370 {
10372 }
10373
10375 {
10377 }
10378
10380 {
10382 }
10383
10385 {
10386 int r,g,b,a;
10392 }
10393
10395 {
10397 }
10398 }
10399
10401 {
10402 if (!super.ReadVarsFromCTX(ctx,version))
10403 return false;
10404
10405 int intValue;
10406 float value;
10407
10408 if (version < 140)
10409 {
10410 if (!ctx.
Read(intValue))
10411 return false;
10412
10413 m_VariablesMask = intValue;
10414 }
10415
10417 {
10418 if (!ctx.
Read(value))
10419 return false;
10420
10422 {
10424 }
10425 else
10426 {
10428 }
10429 }
10430
10431 if (version < 140)
10432 {
10434 {
10435 if (!ctx.
Read(value))
10436 return false;
10437 SetTemperatureDirect(value);
10438 }
10439 }
10440
10442 {
10443 if (!ctx.
Read(value))
10444 return false;
10446 }
10447
10449 {
10450 if (!ctx.
Read(intValue))
10451 return false;
10453 }
10454
10456 {
10457 int r,g,b,a;
10459 return false;
10461 return false;
10463 return false;
10465 return false;
10466
10468 }
10469
10471 {
10472 if (!ctx.
Read(intValue))
10473 return false;
10475 }
10476
10477 if (version >= 138 && version < 140)
10478 {
10480 {
10481 if (!ctx.
Read(intValue))
10482 return false;
10483 SetFrozen(intValue);
10484 }
10485 }
10486
10487 return true;
10488 }
10489
10490
10492 {
10495 {
10497 }
10498
10499 if (!super.OnStoreLoad(ctx, version))
10500 {
10502 return false;
10503 }
10504
10505 if (version >= 114)
10506 {
10507 bool hasQuickBarIndexSaved;
10508
10509 if (!ctx.
Read(hasQuickBarIndexSaved))
10510 {
10512 return false;
10513 }
10514
10515 if (hasQuickBarIndexSaved)
10516 {
10517 int itmQBIndex;
10518
10519
10520 if (!ctx.
Read(itmQBIndex))
10521 {
10523 return false;
10524 }
10525
10526 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10527 if (itmQBIndex != -1 && parentPlayer)
10528 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10529 }
10530 }
10531 else
10532 {
10533
10534 PlayerBase player;
10535 int itemQBIndex;
10536 if (version ==
int.
MAX)
10537 {
10538 if (!ctx.
Read(itemQBIndex))
10539 {
10541 return false;
10542 }
10543 }
10544 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10545 {
10546
10547 if (!ctx.
Read(itemQBIndex))
10548 {
10550 return false;
10551 }
10552 if (itemQBIndex != -1 && player)
10553 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10554 }
10555 }
10556
10557 if (version < 140)
10558 {
10559
10560 if (!LoadVariables(ctx, version))
10561 {
10563 return false;
10564 }
10565 }
10566
10567
10569 {
10571 return false;
10572 }
10573 if (version >= 132)
10574 {
10576 if (raib)
10577 {
10579 {
10581 return false;
10582 }
10583 }
10584 }
10585
10587 return true;
10588 }
10589
10590
10591
10593 {
10594 super.OnStoreSave(ctx);
10595
10596 PlayerBase player;
10597 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10598 {
10600
10601 int itemQBIndex = -1;
10602 itemQBIndex = player.FindQuickBarEntityIndex(this);
10603 ctx.
Write(itemQBIndex);
10604 }
10605 else
10606 {
10608 }
10609
10611
10613 if (raib)
10614 {
10616 }
10617 }
10618
10619
10621 {
10622 super.AfterStoreLoad();
10623
10625 {
10627 }
10628
10630 {
10633 }
10634 }
10635
10637 {
10638 super.EEOnAfterLoad();
10639
10641 {
10643 }
10644
10647 }
10648
10650 {
10651 return false;
10652 }
10653
10654
10655
10657 {
10659 {
10660 #ifdef PLATFORM_CONSOLE
10661
10663 {
10665 if (menu)
10666 {
10668 }
10669 }
10670 #endif
10671 }
10672
10674 {
10677 }
10678
10680 {
10681 SetWeightDirty();
10683 }
10685 {
10688 }
10689
10691 {
10694 }
10696 {
10699 }
10700
10701 super.OnVariablesSynchronized();
10702 }
10703
10704
10705
10707 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10708 {
10709 if (!IsServerCheck(allow_client))
10710 return false;
10711
10713 return false;
10714
10717
10718 if (value <= (min + 0.001))
10719 value = min;
10720
10721 if (value == min)
10722 {
10723 if (destroy_config)
10724 {
10725 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10726 if (dstr)
10727 {
10729 this.Delete();
10730 return true;
10731 }
10732 }
10733 else if (destroy_forced)
10734 {
10736 this.Delete();
10737 return true;
10738 }
10739
10741 }
10742
10745
10747 {
10749
10750 if (delta)
10752 }
10753
10755
10756 return false;
10757 }
10758
10759
10761 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10762 {
10764 }
10765
10767 {
10770 }
10771
10773 {
10776 }
10777
10780 {
10781 float value_clamped = Math.Clamp(value, 0, 1);
10783 SetQuantity(result, destroy_config, destroy_forced);
10784 }
10785
10786
10789 {
10791 }
10792
10794 {
10796 }
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10808 {
10809 int slot = -1;
10810 if (GetInventory())
10811 {
10812 InventoryLocation il = new InventoryLocation;
10813 GetInventory().GetCurrentInventoryLocation(il);
10815 }
10816
10818 }
10819
10821 {
10822 float quantity_max = 0;
10823
10825 {
10826 if (attSlotID != -1)
10827 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10828
10829 if (quantity_max <= 0)
10831 }
10832
10833 if (quantity_max <= 0)
10835
10836 return quantity_max;
10837 }
10838
10840 {
10842 }
10843
10845 {
10847 }
10848
10849
10851 {
10853 }
10854
10856 {
10858 }
10859
10861 {
10863 }
10864
10865
10867 {
10868
10869 float weightEx = GetWeightEx();
10870 float special = GetInventoryAndCargoWeight();
10871 return weightEx - special;
10872 }
10873
10874
10876 {
10878 }
10879
10881 {
10883 {
10884 #ifdef DEVELOPER
10885 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10886 {
10887 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10889 }
10890 #endif
10891
10892 return GetQuantity() * GetConfigWeightModified();
10893 }
10894 else if (HasEnergyManager())
10895 {
10896 #ifdef DEVELOPER
10897 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10898 {
10899 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10900 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10901 }
10902 #endif
10903 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10904 }
10905 else
10906 {
10907 #ifdef DEVELOPER
10908 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10909 {
10910 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10911 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10912 }
10913 #endif
10914 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10915 }
10916 }
10917
10920 {
10921 int item_count = 0;
10923
10924 if (GetInventory().GetCargo() != NULL)
10925 {
10926 item_count = GetInventory().GetCargo().GetItemCount();
10927 }
10928
10929 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10930 {
10931 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10932 if (item)
10933 item_count += item.GetNumberOfItems();
10934 }
10935 return item_count;
10936 }
10937
10940 {
10941 float weight = 0;
10942 float wetness = 1;
10943 if (include_wetness)
10946 {
10947 weight = wetness * m_ConfigWeight;
10948 }
10950 {
10951 weight = 1;
10952 }
10953 return weight;
10954 }
10955
10956
10957
10959 {
10960 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10961 {
10962 GameInventory inv = GetInventory();
10963 array<EntityAI> items = new array<EntityAI>;
10965 for (int i = 0; i < items.Count(); i++)
10966 {
10968 if (item)
10969 {
10971 }
10972 }
10973 }
10974 }
10975
10976
10977
10978
10980 {
10981 float energy = 0;
10982 if (HasEnergyManager())
10983 {
10984 energy = GetCompEM().GetEnergy();
10985 }
10986 return energy;
10987 }
10988
10989
10991 {
10992 super.OnEnergyConsumed();
10993
10995 }
10996
10998 {
10999 super.OnEnergyAdded();
11000
11002 }
11003
11004
11006 {
11007 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11008 {
11010 {
11011 float energy_0to1 = GetCompEM().GetEnergy0To1();
11013 }
11014 }
11015 }
11016
11017
11019 {
11020 return ConfigGetFloat("heatIsolation");
11021 }
11022
11024 {
11026 }
11027
11029 {
11030 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11031 if (
GetGame().ConfigIsExisting(paramPath))
11033
11034 return 0.0;
11035 }
11036
11038 {
11039 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11040 if (
GetGame().ConfigIsExisting(paramPath))
11042
11043 return 0.0;
11044 }
11045
11046 override void SetWet(
float value,
bool allow_client =
false)
11047 {
11048 if (!IsServerCheck(allow_client))
11049 return;
11050
11053
11055
11056 m_VarWet = Math.Clamp(value, min, max);
11057
11059 {
11062 }
11063 }
11064
11065 override void AddWet(
float value)
11066 {
11068 }
11069
11071 {
11073 }
11074
11076 {
11078 }
11079
11081 {
11083 }
11084
11086 {
11088 }
11089
11091 {
11093 }
11094
11095 override void OnWetChanged(
float newVal,
float oldVal)
11096 {
11099 if (newLevel != oldLevel)
11100 {
11102 }
11103 }
11104
11106 {
11107 SetWeightDirty();
11108 }
11109
11111 {
11112 return GetWetLevelInternal(
m_VarWet);
11113 }
11114
11115
11116
11118 {
11120 }
11121
11123 {
11125 }
11126
11128 {
11130 }
11131
11133 {
11135 }
11136
11137
11138
11140 {
11141 if (ConfigIsExisting("itemModelLength"))
11142 {
11143 return ConfigGetFloat("itemModelLength");
11144 }
11145 return 0;
11146 }
11147
11149 {
11150 if (ConfigIsExisting("itemAttachOffset"))
11151 {
11152 return ConfigGetFloat("itemAttachOffset");
11153 }
11154 return 0;
11155 }
11156
11157 override void SetCleanness(
int value,
bool allow_client =
false)
11158 {
11159 if (!IsServerCheck(allow_client))
11160 return;
11161
11163
11165
11168 }
11169
11171 {
11173 }
11174
11176 {
11177 return true;
11178 }
11179
11180
11181
11182
11184 {
11186 }
11187
11189 {
11191 }
11192
11193
11194
11195
11196 override void SetColor(
int r,
int g,
int b,
int a)
11197 {
11203 }
11205 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11206 {
11211 }
11212
11214 {
11216 }
11217
11220 {
11221 int r,g,b,a;
11223 r = r/255;
11224 g = g/255;
11225 b = b/255;
11226 a = a/255;
11227 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11228 }
11229
11230
11231
11232 override void SetLiquidType(
int value,
bool allow_client =
false)
11233 {
11234 if (!IsServerCheck(allow_client))
11235 return;
11236
11241 }
11242
11244 {
11245 return ConfigGetInt("varLiquidTypeInit");
11246 }
11247
11249 {
11251 }
11252
11254 {
11256 SetFrozen(false);
11257 }
11258
11261 {
11262 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11263 }
11264
11265
11268 {
11269 PlayerBase nplayer;
11270 if (PlayerBase.CastTo(nplayer, player))
11271 {
11273
11274 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11275 }
11276 }
11277
11278
11281 {
11282 PlayerBase nplayer;
11283 if (PlayerBase.CastTo(nplayer,player))
11284 {
11285
11286 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11287
11288 }
11289
11290
11291 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11292
11293
11294 if (HasEnergyManager())
11295 {
11296 GetCompEM().UpdatePlugState();
11297 }
11298 }
11299
11300
11302 {
11303 super.OnPlacementStarted(player);
11304
11306 }
11307
11308 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11309 {
11311 {
11312 m_AdminLog.OnPlacementComplete(player,
this);
11313 }
11314
11315 super.OnPlacementComplete(player, position, orientation);
11316 }
11317
11318
11319
11320
11321
11323 {
11325 {
11326 return true;
11327 }
11328 else
11329 {
11330 return false;
11331 }
11332 }
11333
11334
11336 {
11338 {
11340 }
11341 }
11342
11343
11345 {
11347 }
11348
11350 {
11352 }
11353
11354 override void InsertAgent(
int agent,
float count = 1)
11355 {
11356 if (count < 1)
11357 return;
11358
11360 }
11361
11364 {
11366 }
11367
11368
11370 {
11372 }
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11416 {
11418 return false;
11419 return true;
11420 }
11421
11423 {
11424
11426 }
11427
11428
11431 {
11432 super.CheckForRoofLimited(timeTresholdMS);
11433
11435 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11436 {
11437 m_PreviousRoofTestTime = time;
11438 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11439 }
11440 }
11441
11442
11444 {
11446 {
11447 return 0;
11448 }
11449
11450 if (GetInventory().GetAttachmentSlotsCount() != 0)
11451 {
11452 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11453 if (filter)
11454 return filter.GetProtectionLevel(type, false, system);
11455 else
11456 return 0;
11457 }
11458
11459 string subclassPath, entryName;
11460
11461 switch (type)
11462 {
11464 entryName = "biological";
11465 break;
11467 entryName = "chemical";
11468 break;
11469 default:
11470 entryName = "biological";
11471 break;
11472 }
11473
11474 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11475
11477 }
11478
11479
11480
11483 {
11484 if (!IsMagazine())
11486
11488 }
11489
11490
11491
11492
11493
11498 {
11499 return true;
11500 }
11501
11503 {
11505 }
11506
11507
11508
11509
11510
11512 {
11513 if (parent)
11514 {
11515 if (parent.IsInherited(DayZInfected))
11516 return true;
11517
11518 if (!parent.IsRuined())
11519 return true;
11520 }
11521
11522 return true;
11523 }
11524
11526 {
11527 if (!super.CanPutAsAttachment(parent))
11528 {
11529 return false;
11530 }
11531
11532 if (!IsRuined() && !parent.IsRuined())
11533 {
11534 return true;
11535 }
11536
11537 return false;
11538 }
11539
11541 {
11542
11543
11544
11545
11546 return super.CanReceiveItemIntoCargo(item);
11547 }
11548
11550 {
11551
11552
11553
11554
11555 GameInventory attachmentInv = attachment.GetInventory();
11557 {
11558 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11559 return false;
11560 }
11561
11562 InventoryLocation loc = new InventoryLocation();
11563 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11564 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11565 return false;
11566
11567 return super.CanReceiveAttachment(attachment, slotId);
11568 }
11569
11571 {
11572 if (!super.CanReleaseAttachment(attachment))
11573 return false;
11574
11575 return GetInventory().AreChildrenAccessible();
11576 }
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11599 {
11600 int id = muzzle_owner.GetMuzzleID();
11601 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11602
11603 if (WPOF_array)
11604 {
11605 for (int i = 0; i < WPOF_array.Count(); i++)
11606 {
11607 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11608
11609 if (WPOF)
11610 {
11611 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11612 }
11613 }
11614 }
11615 }
11616
11617
11619 {
11620 int id = muzzle_owner.GetMuzzleID();
11622
11623 if (WPOBE_array)
11624 {
11625 for (int i = 0; i < WPOBE_array.Count(); i++)
11626 {
11627 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11628
11629 if (WPOBE)
11630 {
11631 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11632 }
11633 }
11634 }
11635 }
11636
11637
11639 {
11640 int id = muzzle_owner.GetMuzzleID();
11641 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11642
11643 if (WPOOH_array)
11644 {
11645 for (int i = 0; i < WPOOH_array.Count(); i++)
11646 {
11647 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11648
11649 if (WPOOH)
11650 {
11651 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11652 }
11653 }
11654 }
11655 }
11656
11657
11659 {
11660 int id = muzzle_owner.GetMuzzleID();
11661 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11662
11663 if (WPOOH_array)
11664 {
11665 for (int i = 0; i < WPOOH_array.Count(); i++)
11666 {
11667 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11668
11669 if (WPOOH)
11670 {
11671 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11672 }
11673 }
11674 }
11675 }
11676
11677
11679 {
11680 int id = muzzle_owner.GetMuzzleID();
11681 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11682
11683 if (WPOOH_array)
11684 {
11685 for (int i = 0; i < WPOOH_array.Count(); i++)
11686 {
11687 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11688
11689 if (WPOOH)
11690 {
11691 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11692 }
11693 }
11694 }
11695 }
11696
11697
11698
11700 {
11702 {
11703 return true;
11704 }
11705
11706 return false;
11707 }
11708
11710 {
11712 {
11713 return true;
11714 }
11715
11716 return false;
11717 }
11718
11720 {
11722 {
11723 return true;
11724 }
11725
11726 return false;
11727 }
11728
11730 {
11731 return false;
11732 }
11733
11736 {
11737 return UATimeSpent.DEFAULT_DEPLOY;
11738 }
11739
11740
11741
11742
11744 {
11746 SetSynchDirty();
11747 }
11748
11750 {
11752 }
11753
11754
11756 {
11757 return false;
11758 }
11759
11762 {
11763 string att_type = "None";
11764
11765 if (ConfigIsExisting("soundAttType"))
11766 {
11767 att_type = ConfigGetString("soundAttType");
11768 }
11769
11771 }
11772
11774 {
11776 }
11777
11778
11779
11780
11781
11785
11787 {
11790
11792 }
11793
11794
11796 {
11798 return;
11799
11801
11804
11807
11808 SoundParameters params = new SoundParameters();
11812 }
11813
11814
11816 {
11818 return;
11819
11821 SetSynchDirty();
11822
11825 }
11826
11827
11829 {
11831 return;
11832
11834 SetSynchDirty();
11835
11838 }
11839
11841 {
11843 }
11844
11846 {
11848 }
11849
11852 {
11853 if (!
GetGame().IsDedicatedServer())
11854 {
11855 if (ConfigIsExisting("attachSoundSet"))
11856 {
11857 string cfg_path = "";
11858 string soundset = "";
11859 string type_name =
GetType();
11860
11863 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11864 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11865
11866 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11867 {
11868 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11869 {
11870 if (cfg_slot_array[i] == slot_type)
11871 {
11872 soundset = cfg_soundset_array[i];
11873 break;
11874 }
11875 }
11876 }
11877
11878 if (soundset != "")
11879 {
11880 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11882 }
11883 }
11884 }
11885 }
11886
11888 {
11889
11890 }
11891
11892 void OnApply(PlayerBase player);
11893
11895 {
11896 return 1.0;
11897 };
11898
11900 {
11902 }
11903
11905 {
11907 }
11908
11910
11912 {
11913 SetDynamicPhysicsLifeTime(0.01);
11915 }
11916
11918 {
11919 array<string> zone_names = new array<string>;
11920 GetDamageZones(zone_names);
11921 for (int i = 0; i < zone_names.Count(); i++)
11922 {
11923 SetHealthMax(zone_names.Get(i),"Health");
11924 }
11925 SetHealthMax("","Health");
11926 }
11927
11930 {
11931 float global_health = GetHealth01("","Health");
11932 array<string> zones = new array<string>;
11933 GetDamageZones(zones);
11934
11935 for (int i = 0; i < zones.Count(); i++)
11936 {
11937 SetHealth01(zones.Get(i),"Health",global_health);
11938 }
11939 }
11940
11943 {
11944 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11945 }
11946
11948 {
11949 if (!hasRootAsPlayer)
11950 {
11951 if (refParentIB)
11952 {
11953
11954 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11955 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11956
11957 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11958 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11959
11962 }
11963 else
11964 {
11965
11968 }
11969 }
11970 }
11971
11973 {
11975 {
11976 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11977 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11978 {
11979 float heatPermCoef = 1.0;
11981 while (ent)
11982 {
11983 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11984 ent = ent.GetHierarchyParent();
11985 }
11986
11987 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11988 }
11989 }
11990 }
11991
11993 {
11994
11995 EntityAI parent = GetHierarchyParent();
11996 if (!parent)
11997 {
11998 hasParent = false;
11999 hasRootAsPlayer = false;
12000 }
12001 else
12002 {
12003 hasParent = true;
12004 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12005 refParentIB =
ItemBase.Cast(parent);
12006 }
12007 }
12008
12009 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12010 {
12011
12012 }
12013
12015 {
12016
12017 return false;
12018 }
12019
12021 {
12022
12023
12024 return false;
12025 }
12026
12028 {
12029
12030 return false;
12031 }
12032
12035 {
12036 return !GetIsFrozen() &&
IsOpen();
12037 }
12038
12040 {
12041 bool hasParent = false, hasRootAsPlayer = false;
12043
12044 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12045 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12046
12047 if (wwtu || foodDecay)
12048 {
12052
12053 if (processWetness || processTemperature || processDecay)
12054 {
12056
12057 if (processWetness)
12058 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12059
12060 if (processTemperature)
12062
12063 if (processDecay)
12064 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12065 }
12066 }
12067 }
12068
12071 {
12073 }
12074
12076 {
12079
12080 return super.GetTemperatureFreezeThreshold();
12081 }
12082
12084 {
12087
12088 return super.GetTemperatureThawThreshold();
12089 }
12090
12092 {
12095
12096 return super.GetItemOverheatThreshold();
12097 }
12098
12100 {
12102 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12103
12104 return super.GetTemperatureFreezeTime();
12105 }
12106
12108 {
12110 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12111
12112 return super.GetTemperatureThawTime();
12113 }
12114
12119
12121 {
12122 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12123 }
12124
12126 {
12127 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12128 }
12129
12132 {
12134 }
12135
12137 {
12139 }
12140
12142 {
12144 }
12145
12148 {
12149 return null;
12150 }
12151
12154 {
12155 return false;
12156 }
12157
12159 {
12161 {
12164 if (!trg)
12165 {
12167 explosive = this;
12168 }
12169
12170 explosive.PairRemote(trg);
12172
12173 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12174 trg.SetPersistentPairID(persistentID);
12175 explosive.SetPersistentPairID(persistentID);
12176
12177 return true;
12178 }
12179 return false;
12180 }
12181
12184 {
12185 float ret = 1.0;
12188 ret *= GetHealth01();
12189
12190 return ret;
12191 }
12192
12193 #ifdef DEVELOPER
12194 override void SetDebugItem()
12195 {
12196 super.SetDebugItem();
12197 _itemBase = this;
12198 }
12199
12201 {
12202 string text = super.GetDebugText();
12203
12205 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12206
12207 return text;
12208 }
12209 #endif
12210
12212 {
12213 return true;
12214 }
12215
12217
12219
12221 {
12224 }
12225
12226
12234
12250}
12251
12253{
12255 if (entity)
12256 {
12257 bool is_item = entity.IsInherited(
ItemBase);
12258 if (is_item && full_quantity)
12259 {
12262 }
12263 }
12264 else
12265 {
12267 return NULL;
12268 }
12269 return entity;
12270}
12271
12273{
12274 if (item)
12275 {
12276 if (health > 0)
12277 item.SetHealth("", "", health);
12278
12279 if (item.CanHaveTemperature())
12280 {
12282 if (item.CanFreeze())
12283 item.SetFrozen(false);
12284 }
12285
12286 if (item.HasEnergyManager())
12287 {
12288 if (quantity >= 0)
12289 {
12290 item.GetCompEM().SetEnergy0To1(quantity);
12291 }
12292 else
12293 {
12295 }
12296 }
12297 else if (item.IsMagazine())
12298 {
12299 Magazine mag = Magazine.Cast(item);
12300 if (quantity >= 0)
12301 {
12302 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12303 }
12304 else
12305 {
12307 }
12308
12309 }
12310 else
12311 {
12312 if (quantity >= 0)
12313 {
12314 item.SetQuantityNormalized(quantity, false);
12315 }
12316 else
12317 {
12319 }
12320
12321 }
12322 }
12323}
12324
12325#ifdef DEVELOPER
12327#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.