Send message to owner player in grey color.
7404{
7406 {
7407 return true;
7408 }
7409};
7410
7411
7412
7414{
7418
7420
7423
7424
7425
7426
7427
7436
7442
7447
7452
7473 protected bool m_IsResultOfSplit
7474
7476
7481
7482
7483
7485
7489
7490
7491
7493
7496
7497
7498
7504
7505
7513
7516
7517
7519
7520
7522
7523
7528
7529
7534
7535
7537
7538
7540 {
7545
7546 if (!
GetGame().IsDedicatedServer())
7547 {
7549 {
7551
7553 {
7555 }
7556 }
7557
7560 }
7561
7562 m_OldLocation = null;
7563
7565 {
7567 }
7568
7569 if (ConfigIsExisting("headSelectionsToHide"))
7570 {
7573 }
7574
7576 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7577 {
7579 }
7580
7582
7583 m_IsResultOfSplit = false;
7584
7586 }
7587
7589 {
7590 super.InitItemVariables();
7591
7597 m_Count = ConfigGetInt(
"count");
7598
7601
7606
7609
7614
7626
7630
7631
7634 if (ConfigIsExisting("canBeSplit"))
7635 {
7638 }
7639
7641 if (ConfigIsExisting("itemBehaviour"))
7643
7644
7647 RegisterNetSyncVariableInt("m_VarLiquidType");
7648 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7649
7650 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7651 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7652 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7653
7654 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7655 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7656 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7657 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7658
7659 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7660 RegisterNetSyncVariableBool("m_IsTakeable");
7661 RegisterNetSyncVariableBool("m_IsHologram");
7662
7665 {
7668 }
7669
7671
7673 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7675
7676 }
7677
7679 {
7681 }
7682
7684 {
7687 {
7692 }
7693 }
7694
7695 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7696 {
7698 {
7701 }
7702
7704 }
7705
7707 {
7713 }
7714
7716
7718 {
7720
7721 if (!action)
7722 {
7723 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7724 return;
7725 }
7726
7728 if (!ai)
7729 {
7731 return;
7732 }
7733
7735 if (!action_array)
7736 {
7737 action_array = new array<ActionBase_Basic>;
7739 }
7740 if (LogManager.IsActionLogEnable())
7741 {
7742 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7743 }
7744
7745 if (action_array.Find(action) != -1)
7746 {
7747 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7748 }
7749 else
7750 {
7751 action_array.Insert(action);
7752 }
7753 }
7754
7756 {
7758 ActionBase action = player.GetActionManager().GetAction(actionName);
7761
7762 if (action_array)
7763 {
7764 action_array.RemoveItem(action);
7765 }
7766 }
7767
7768
7769
7771 {
7772 ActionOverrideData overrideData = new ActionOverrideData();
7776
7778 if (!actionMap)
7779 {
7782 }
7783
7784 actionMap.Insert(this.
Type(), overrideData);
7785
7786 }
7787
7789
7791
7792
7794 {
7797
7800
7801 string config_to_search = "CfgVehicles";
7802 string muzzle_owner_config;
7803
7805 {
7806 if (IsInherited(Weapon))
7807 config_to_search = "CfgWeapons";
7808
7809 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7810
7811 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7812
7814
7815 if (config_OnFire_subclass_count > 0)
7816 {
7817 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7818
7819 for (int i = 0; i < config_OnFire_subclass_count; i++)
7820 {
7821 string particle_class = "";
7823 string config_OnFire_entry = config_OnFire_class + particle_class;
7824 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7825 WPOF_array.Insert(WPOF);
7826 }
7827
7828
7830 }
7831 }
7832
7834 {
7835 config_to_search = "CfgWeapons";
7836 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7837
7838 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7839
7841
7842 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7843 {
7844 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7845
7846 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7847 {
7848 string particle_class2 = "";
7850 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7851 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7852 WPOBE_array.Insert(WPOBE);
7853 }
7854
7855
7857 }
7858 }
7859 }
7860
7861
7863 {
7866
7868 {
7869 string config_to_search = "CfgVehicles";
7870
7871 if (IsInherited(Weapon))
7872 config_to_search = "CfgWeapons";
7873
7874 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7875 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7876
7877 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7878 {
7879
7881
7883 {
7885 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7887 return;
7888 }
7889
7892
7893
7894
7896 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7897
7898 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7899 {
7900 string particle_class = "";
7902 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7904
7905 if (entry_type == CT_CLASS)
7906 {
7907 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7908 WPOOH_array.Insert(WPOF);
7909 }
7910 }
7911
7912
7914 }
7915 }
7916 }
7917
7919 {
7921 }
7922
7924 {
7926 {
7928
7931
7934
7935 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7936 }
7937 }
7938
7940 {
7942 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7943
7945 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7946
7948 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7949
7951 {
7953 }
7954 }
7955
7957 {
7959 }
7960
7962 {
7965 else
7967
7969 {
7972 }
7973 else
7974 {
7977
7980 }
7981
7983 }
7984
7986 {
7988 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7989 }
7990
7992 {
7994 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7996 }
7997
7999 {
8001 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8002 }
8003
8005 {
8008
8009 OverheatingParticle OP = new OverheatingParticle();
8014
8016 }
8017
8019 {
8022
8023 return -1;
8024 }
8025
8027 {
8029 {
8032
8033 for (int i = count; i > 0; --i)
8034 {
8035 int id = i - 1;
8038
8041
8042 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8043 {
8044 if (p)
8045 {
8048 }
8049 }
8050 }
8051 }
8052 }
8053
8055 {
8057 {
8059 {
8060 int id = i - 1;
8062
8063 if (OP)
8064 {
8066
8067 if (p)
8068 {
8070 }
8071
8072 delete OP;
8073 }
8074 }
8075
8078 }
8079 }
8080
8083 {
8084 return 0.0;
8085 }
8086
8087
8089 {
8090 return 250;
8091 }
8092
8094 {
8095 return 0;
8096 }
8097
8100 {
8102 return true;
8103
8104 return false;
8105 }
8106
8109 {
8112
8114 {
8116 }
8117 else
8118 {
8119
8121 }
8122
8124 }
8125
8132 {
8133 return -1;
8134 }
8135
8136
8137
8138
8140 {
8142 {
8144 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8145
8146 if (r_index >= 0)
8147 {
8148 InventoryLocation r_il = new InventoryLocation;
8149 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8150
8151 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8154 {
8155 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8156 }
8158 {
8159 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8160 }
8161
8162 }
8163
8164 player.GetHumanInventory().ClearUserReservedLocation(this);
8165 }
8166
8169 }
8170
8171
8172
8173
8175 {
8176 return ItemBase.m_DebugActionsMask;
8177 }
8178
8180 {
8181 return ItemBase.m_DebugActionsMask & mask;
8182 }
8183
8185 {
8186 ItemBase.m_DebugActionsMask = mask;
8187 }
8188
8190 {
8191 ItemBase.m_DebugActionsMask |= mask;
8192 }
8193
8195 {
8196 ItemBase.m_DebugActionsMask &= ~mask;
8197 }
8198
8200 {
8202 {
8204 }
8205 else
8206 {
8208 }
8209 }
8210
8211
8213 {
8214 if (GetEconomyProfile())
8215 {
8216 float q_max = GetEconomyProfile().GetQuantityMax();
8217 if (q_max > 0)
8218 {
8219 float q_min = GetEconomyProfile().GetQuantityMin();
8220 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8221
8223 {
8224 ComponentEnergyManager comp = GetCompEM();
8226 {
8228 }
8229 }
8231 {
8233
8234 }
8235
8236 }
8237 }
8238 }
8239
8242 {
8243 EntityAI parent = GetHierarchyParent();
8244
8245 if (parent)
8246 {
8247 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8248 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8249 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8250 }
8251 }
8252
8255 {
8256 EntityAI parent = GetHierarchyParent();
8257
8258 if (parent)
8259 {
8260 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8261 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8262 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8263 }
8264 }
8265
8267 {
8268
8269
8270
8271
8273
8275 {
8276 if (ScriptInputUserData.CanStoreInputUserData())
8277 {
8278 ScriptInputUserData ctx = new ScriptInputUserData;
8284 ctx.
Write(use_stack_max);
8287
8289 {
8290 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8291 }
8292 }
8293 }
8294 else if (!
GetGame().IsMultiplayer())
8295 {
8297 }
8298 }
8299
8301 {
8303 }
8304
8306 {
8308 }
8309
8311 {
8313 }
8314
8316 {
8317
8318 return false;
8319 }
8320
8322 {
8323 return false;
8324 }
8325
8329 {
8330 return false;
8331 }
8332
8334 {
8335 return "";
8336 }
8337
8339
8341 {
8342 return false;
8343 }
8344
8346 {
8347 return true;
8348 }
8349
8350
8351
8353 {
8354 return true;
8355 }
8356
8358 {
8359 return true;
8360 }
8361
8363 {
8364 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8366 }
8367
8369 {
8371 }
8372
8374 {
8376 if (!is_being_placed)
8378 SetSynchDirty();
8379 }
8380
8381
8383
8385 {
8387 }
8388
8390 {
8392 }
8393
8395 {
8396 return 1;
8397 }
8398
8400 {
8401 return false;
8402 }
8403
8405 {
8407 SetSynchDirty();
8408 }
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8445 {
8446 super.OnMovedInsideCargo(container);
8447
8448 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8449 }
8450
8451 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8452 {
8453 super.EEItemLocationChanged(oldLoc,newLoc);
8454
8455 PlayerBase new_player = null;
8456 PlayerBase old_player = null;
8457
8458 if (newLoc.GetParent())
8459 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8460
8461 if (oldLoc.GetParent())
8462 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8463
8465 {
8466 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8467
8468 if (r_index >= 0)
8469 {
8470 InventoryLocation r_il = new InventoryLocation;
8471 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8472
8473 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8476 {
8477 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8478 }
8480 {
8481 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8482 }
8483
8484 }
8485 }
8486
8488 {
8489 if (new_player)
8490 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8491
8492 if (new_player == old_player)
8493 {
8494
8495 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8496 {
8498 {
8499 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8500 {
8501 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8502 }
8503 }
8504 else
8505 {
8506 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8507 }
8508 }
8509
8510 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8511 {
8512 int type = oldLoc.GetType();
8514 {
8515 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8516 }
8518 {
8519 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8520 }
8521 }
8522 if (!m_OldLocation)
8523 {
8524 m_OldLocation = new InventoryLocation;
8525 }
8526 m_OldLocation.Copy(oldLoc);
8527 }
8528 else
8529 {
8530 if (m_OldLocation)
8531 {
8532 m_OldLocation.Reset();
8533 }
8534 }
8535
8537 }
8538 else
8539 {
8540 if (new_player)
8541 {
8542 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8543 if (res_index >= 0)
8544 {
8545 InventoryLocation il = new InventoryLocation;
8546 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8548 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8551 {
8552 il.
GetParent().GetOnReleaseLock().Invoke(it);
8553 }
8555 {
8557 }
8558
8559 }
8560 }
8562 {
8563
8565 }
8566
8567 if (m_OldLocation)
8568 {
8569 m_OldLocation.Reset();
8570 }
8571 }
8572 }
8573
8574 override void EOnContact(IEntity other, Contact extra)
8575 {
8577 {
8578 int liquidType = -1;
8580 if (impactSpeed > 0.0)
8581 {
8583 #ifndef SERVER
8585 #else
8587 SetSynchDirty();
8588 #endif
8590 }
8591 }
8592
8593 #ifdef SERVER
8594 if (GetCompEM() && GetCompEM().IsPlugged())
8595 {
8596 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8597 GetCompEM().UnplugThis();
8598 }
8599 #endif
8600 }
8601
8603
8605 {
8607 }
8608
8610 {
8611
8612 }
8613
8615 {
8616 super.OnItemLocationChanged(old_owner, new_owner);
8617
8618 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8619 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8620
8621 if (!relatedPlayer && playerNew)
8622 relatedPlayer = playerNew;
8623
8624 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8625 {
8627 if (actionMgr)
8628 {
8629 ActionBase currentAction = actionMgr.GetRunningAction();
8630 if (currentAction)
8632 }
8633 }
8634
8635 Man ownerPlayerOld = null;
8636 Man ownerPlayerNew = null;
8637
8638 if (old_owner)
8639 {
8640 if (old_owner.
IsMan())
8641 {
8642 ownerPlayerOld = Man.Cast(old_owner);
8643 }
8644 else
8645 {
8646 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8647 }
8648 }
8649 else
8650 {
8652 {
8654
8655 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8656 {
8657 GetCompEM().UnplugThis();
8658 }
8659 }
8660 }
8661
8662 if (new_owner)
8663 {
8664 if (new_owner.
IsMan())
8665 {
8666 ownerPlayerNew = Man.Cast(new_owner);
8667 }
8668 else
8669 {
8670 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8671 }
8672 }
8673
8674 if (ownerPlayerOld != ownerPlayerNew)
8675 {
8676 if (ownerPlayerOld)
8677 {
8678 array<EntityAI> subItemsExit = new array<EntityAI>;
8680 for (int i = 0; i < subItemsExit.Count(); i++)
8681 {
8684 }
8685 }
8686
8687 if (ownerPlayerNew)
8688 {
8689 array<EntityAI> subItemsEnter = new array<EntityAI>;
8691 for (int j = 0; j < subItemsEnter.Count(); j++)
8692 {
8695 }
8696 }
8697 }
8698 else if (ownerPlayerNew != null)
8699 {
8700 PlayerBase nplayer;
8701 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8702 {
8703 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8705 for (int k = 0; k < subItemsUpdate.Count(); k++)
8706 {
8708 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8709 }
8710 }
8711 }
8712
8713 if (old_owner)
8714 old_owner.OnChildItemRemoved(this);
8715 if (new_owner)
8716 new_owner.OnChildItemReceived(this);
8717 }
8718
8719
8721 {
8722 super.EEDelete(parent);
8723 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8724 if (player)
8725 {
8727
8728 if (player.IsAlive())
8729 {
8730 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8731 if (r_index >= 0)
8732 {
8733 InventoryLocation r_il = new InventoryLocation;
8734 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8735
8736 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8739 {
8740 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8741 }
8743 {
8744 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8745 }
8746
8747 }
8748
8749 player.RemoveQuickBarEntityShortcut(this);
8750 }
8751 }
8752 }
8753
8755 {
8756 super.EEKilled(killer);
8757
8760 {
8761 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8762 {
8763 if (IsMagazine())
8764 {
8765 if (Magazine.Cast(this).GetAmmoCount() > 0)
8766 {
8768 }
8769 }
8770 else
8771 {
8773 }
8774 }
8775 }
8776 }
8777
8779 {
8780 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8781
8782 super.OnWasAttached(parent, slot_id);
8783
8786
8788 }
8789
8791 {
8792 super.OnWasDetached(parent, slot_id);
8793
8796 }
8797
8799 {
8800 int idx;
8803
8804 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8805 if (inventory_slots.Count() < 1)
8806 {
8807 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8808 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8809 }
8810 else
8811 {
8812 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8813 }
8814
8815 idx = inventory_slots.Find(slot);
8816 if (idx < 0)
8817 return "";
8818
8819 return attach_types.Get(idx);
8820 }
8821
8823 {
8824 int idx = -1;
8825 string slot;
8826
8829
8830 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8831 if (inventory_slots.Count() < 1)
8832 {
8833 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8834 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8835 }
8836 else
8837 {
8838 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8839 if (detach_types.Count() < 1)
8840 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8841 }
8842
8843 for (int i = 0; i < inventory_slots.Count(); i++)
8844 {
8845 slot = inventory_slots.Get(i);
8846 }
8847
8848 if (slot != "")
8849 {
8850 if (detach_types.Count() == 1)
8851 idx = 0;
8852 else
8853 idx = inventory_slots.Find(slot);
8854 }
8855 if (idx < 0)
8856 return "";
8857
8858 return detach_types.Get(idx);
8859 }
8860
8862 {
8863
8865
8866
8867 float min_time = 1;
8868 float max_time = 3;
8869 float delay = Math.RandomFloat(min_time, max_time);
8870
8871 explode_timer.Run(delay, this, "DoAmmoExplosion");
8872 }
8873
8875 {
8876 Magazine magazine = Magazine.Cast(this);
8877 int pop_sounds_count = 6;
8878 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8879
8880
8881 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8882 string sound_name = pop_sounds[ sound_idx ];
8884
8885
8886 magazine.ServerAddAmmoCount(-1);
8887
8888
8889 float min_temp_to_explode = 100;
8890
8891 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8892 {
8894 }
8895 }
8896
8897
8898 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8899 {
8900 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8901
8902 const int CHANCE_DAMAGE_CARGO = 4;
8903 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8904 const int CHANCE_DAMAGE_NOTHING = 2;
8905
8907 {
8908 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8909 int chances;
8910 int rnd;
8911
8912 if (GetInventory().GetCargo())
8913 {
8914 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8915 rnd = Math.RandomInt(0,chances);
8916
8917 if (rnd < CHANCE_DAMAGE_CARGO)
8918 {
8920 }
8921 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8922 {
8924 }
8925 }
8926 else
8927 {
8928 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8929 rnd = Math.RandomInt(0,chances);
8930
8931 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8932 {
8934 }
8935 }
8936 }
8937 }
8938
8940 {
8941 if (GetInventory().GetCargo())
8942 {
8943 int item_count = GetInventory().GetCargo().GetItemCount();
8944 if (item_count > 0)
8945 {
8946 int random_pick = Math.RandomInt(0, item_count);
8948 if (!item.IsExplosive())
8949 {
8950 item.AddHealth("","",damage);
8951 return true;
8952 }
8953 }
8954 }
8955 return false;
8956 }
8957
8959 {
8960 int attachment_count = GetInventory().AttachmentCount();
8961 if (attachment_count > 0)
8962 {
8963 int random_pick = Math.RandomInt(0, attachment_count);
8964 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8965 if (!attachment.IsExplosive())
8966 {
8967 attachment.AddHealth("","",damage);
8968 return true;
8969 }
8970 }
8971 return false;
8972 }
8973
8975 {
8977 }
8978
8980 {
8982 return GetInventory().CanRemoveEntity();
8983
8984 return false;
8985 }
8986
8988 {
8990 return;
8991
8993 {
8994 if (ScriptInputUserData.CanStoreInputUserData())
8995 {
8996 ScriptInputUserData ctx = new ScriptInputUserData;
9001 ctx.
Write(destination_entity);
9005 }
9006 }
9007 else if (!
GetGame().IsMultiplayer())
9008 {
9010 }
9011 }
9012
9014 {
9016 return;
9017
9018 float split_quantity_new;
9022 InventoryLocation loc = new InventoryLocation;
9023
9024 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9025 {
9027 split_quantity_new = stack_max;
9028 else
9030
9031 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9032 if (new_item)
9033 {
9034 new_item.SetResultOfSplit(true);
9035 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9037 new_item.SetQuantity(split_quantity_new);
9038 }
9039 }
9040 else if (destination_entity && slot_id == -1)
9041 {
9042 if (quantity > stack_max)
9043 split_quantity_new = stack_max;
9044 else
9045 split_quantity_new = quantity;
9046
9048 {
9051 }
9052
9053 if (new_item)
9054 {
9055 new_item.SetResultOfSplit(true);
9056 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9058 new_item.SetQuantity(split_quantity_new);
9059 }
9060 }
9061 else
9062 {
9063 if (stack_max != 0)
9064 {
9066 {
9068 }
9069
9070 if (split_quantity_new == 0)
9071 {
9072 if (!
GetGame().IsMultiplayer())
9073 player.PhysicalPredictiveDropItem(this);
9074 else
9075 player.ServerDropEntity(this);
9076 return;
9077 }
9078
9080
9081 if (new_item)
9082 {
9083 new_item.SetResultOfSplit(true);
9084 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9086 new_item.SetQuantity(stack_max);
9087 new_item.PlaceOnSurface();
9088 }
9089 }
9090 }
9091 }
9092
9094 {
9096 return;
9097
9098 float split_quantity_new;
9102 InventoryLocation loc = new InventoryLocation;
9103
9104 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9105 {
9107 split_quantity_new = stack_max;
9108 else
9110
9111 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9112 if (new_item)
9113 {
9114 new_item.SetResultOfSplit(true);
9115 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9117 new_item.SetQuantity(split_quantity_new);
9118 }
9119 }
9120 else if (destination_entity && slot_id == -1)
9121 {
9122 if (quantity > stack_max)
9123 split_quantity_new = stack_max;
9124 else
9125 split_quantity_new = quantity;
9126
9128 {
9131 }
9132
9133 if (new_item)
9134 {
9135 new_item.SetResultOfSplit(true);
9136 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9138 new_item.SetQuantity(split_quantity_new);
9139 }
9140 }
9141 else
9142 {
9143 if (stack_max != 0)
9144 {
9146 {
9148 }
9149
9151
9152 if (new_item)
9153 {
9154 new_item.SetResultOfSplit(true);
9155 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9157 new_item.SetQuantity(stack_max);
9158 new_item.PlaceOnSurface();
9159 }
9160 }
9161 }
9162 }
9163
9165 {
9167 return;
9168
9170 {
9171 if (ScriptInputUserData.CanStoreInputUserData())
9172 {
9173 ScriptInputUserData ctx = new ScriptInputUserData;
9178 dst.WriteToContext(ctx);
9180 }
9181 }
9182 else if (!
GetGame().IsMultiplayer())
9183 {
9185 }
9186 }
9187
9189 {
9191 return;
9192
9194 {
9195 if (ScriptInputUserData.CanStoreInputUserData())
9196 {
9197 ScriptInputUserData ctx = new ScriptInputUserData;
9202 ctx.
Write(destination_entity);
9208 }
9209 }
9210 else if (!
GetGame().IsMultiplayer())
9211 {
9213 }
9214 }
9215
9217 {
9219 }
9220
9222 {
9224 return this;
9225
9227 float split_quantity_new;
9229 if (dst.IsValid())
9230 {
9231 int slot_id = dst.GetSlot();
9233
9234 if (quantity > stack_max)
9235 split_quantity_new = stack_max;
9236 else
9237 split_quantity_new = quantity;
9238
9240
9241 if (new_item)
9242 {
9243 new_item.SetResultOfSplit(true);
9244 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9247 }
9248
9249 return new_item;
9250 }
9251
9252 return null;
9253 }
9254
9256 {
9258 return;
9259
9261 float split_quantity_new;
9263 if (destination_entity)
9264 {
9266 if (quantity > stackable)
9267 split_quantity_new = stackable;
9268 else
9269 split_quantity_new = quantity;
9270
9271 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9272 if (new_item)
9273 {
9274 new_item.SetResultOfSplit(true);
9275 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9277 new_item.SetQuantity(split_quantity_new);
9278 }
9279 }
9280 }
9281
9283 {
9285 return;
9286
9288 {
9289 if (ScriptInputUserData.CanStoreInputUserData())
9290 {
9291 ScriptInputUserData ctx = new ScriptInputUserData;
9296 ItemBase destination_entity =
this;
9297 ctx.
Write(destination_entity);
9301 }
9302 }
9303 else if (!
GetGame().IsMultiplayer())
9304 {
9306 }
9307 }
9308
9310 {
9312 return;
9313
9315 float split_quantity_new;
9317 if (player)
9318 {
9320 if (quantity > stackable)
9321 split_quantity_new = stackable;
9322 else
9323 split_quantity_new = quantity;
9324
9325 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9326 new_item =
ItemBase.Cast(in_hands);
9327 if (new_item)
9328 {
9329 new_item.SetResultOfSplit(true);
9330 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9332 new_item.SetQuantity(split_quantity_new);
9333 }
9334 }
9335 }
9336
9338 {
9340 return;
9341
9343 float split_quantity_new = Math.Floor(quantity * 0.5);
9344
9346
9347 if (new_item)
9348 {
9349 if (new_item.GetQuantityMax() < split_quantity_new)
9350 {
9351 split_quantity_new = new_item.GetQuantityMax();
9352 }
9353
9354 new_item.SetResultOfSplit(true);
9355 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9356
9358 {
9361 }
9362 else
9363 {
9366 }
9367 }
9368 }
9369
9371 {
9373 return;
9374
9376 float split_quantity_new = Math.Floor(quantity / 2);
9377
9378 InventoryLocation invloc = new InventoryLocation;
9380
9382 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9383
9384 if (new_item)
9385 {
9386 if (new_item.GetQuantityMax() < split_quantity_new)
9387 {
9388 split_quantity_new = new_item.GetQuantityMax();
9389 }
9391 {
9394 }
9395 else
9396 {
9399 }
9400 }
9401 }
9402
9405 {
9406 SetWeightDirty();
9408
9409 if (parent)
9410 parent.OnAttachmentQuantityChangedEx(this, delta);
9411
9413 {
9415 {
9417 }
9419 {
9420 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9422 }
9423 }
9424
9425 }
9426
9429 {
9430
9431 }
9432
9435 {
9437 }
9438
9440 {
9441 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9442
9444 {
9445 if (newLevel == GameConstants.STATE_RUINED)
9446 {
9448 EntityAI parent = GetHierarchyParent();
9449 if (parent && parent.IsFireplace())
9450 {
9451 CargoBase cargo = GetInventory().GetCargo();
9452 if (cargo)
9453 {
9455 {
9457 }
9458 }
9459 }
9460 }
9461
9463 {
9464
9466 return;
9467 }
9468
9469 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9470 {
9472 }
9473 }
9474 }
9475
9476
9478 {
9479 super.OnRightClick();
9480
9482 {
9484 {
9485 if (ScriptInputUserData.CanStoreInputUserData())
9486 {
9487 vector m4[4];
9489
9490 EntityAI root = GetHierarchyRoot();
9491
9492 InventoryLocation dst = new InventoryLocation;
9494 {
9495 if (root)
9496 {
9497 root.GetTransform(m4);
9499 }
9500 else
9501 GetInventory().GetCurrentInventoryLocation(dst);
9502 }
9503 else
9504 {
9506
9507
9508 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9509 {
9510 if (root)
9511 {
9512 root.GetTransform(m4);
9514 }
9515 else
9516 GetInventory().GetCurrentInventoryLocation(dst);
9517 }
9518 else
9519 {
9520 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9521 }
9522 }
9523
9524 ScriptInputUserData ctx = new ScriptInputUserData;
9532 }
9533 }
9534 else if (!
GetGame().IsMultiplayer())
9535 {
9537 }
9538 }
9539 }
9540
9541 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9542 {
9543
9544 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9545 return false;
9546
9547 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9548 return false;
9549
9550
9552 return false;
9553
9554
9555 Magazine mag = Magazine.Cast(this);
9556 if (mag)
9557 {
9558 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9559 return false;
9560
9561 if (stack_max_limit)
9562 {
9563 Magazine other_mag = Magazine.Cast(other_item);
9564 if (other_item)
9565 {
9566 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9567 return false;
9568 }
9569
9570 }
9571 }
9572 else
9573 {
9574
9576 return false;
9577
9579 return false;
9580 }
9581
9582 PlayerBase player = null;
9583 if (CastTo(player, GetHierarchyRootPlayer()))
9584 {
9585 if (player.GetInventory().HasAttachment(this))
9586 return false;
9587
9588 if (player.IsItemsToDelete())
9589 return false;
9590 }
9591
9592 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9593 return false;
9594
9595 int slotID;
9597 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9598 return false;
9599
9600 return true;
9601 }
9602
9604 {
9606 }
9607
9609 {
9610 return m_IsResultOfSplit;
9611 }
9612
9614 {
9615 m_IsResultOfSplit = value;
9616 }
9617
9619 {
9621 }
9622
9624 {
9625 float other_item_quantity = other_item.GetQuantity();
9626 float this_free_space;
9627
9629
9631
9632 if (other_item_quantity > this_free_space)
9633 {
9634 return this_free_space;
9635 }
9636 else
9637 {
9638 return other_item_quantity;
9639 }
9640 }
9641
9643 {
9645 }
9646
9648 {
9650 return;
9651
9652 if (!IsMagazine() && other_item)
9653 {
9655 if (quantity_used != 0)
9656 {
9657 float hp1 = GetHealth01("","");
9658 float hp2 = other_item.GetHealth01("","");
9659 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9660 hpResult = hpResult / (
GetQuantity() + quantity_used);
9661
9662 hpResult *= GetMaxHealth();
9663 Math.Round(hpResult);
9664 SetHealth("", "Health", hpResult);
9665
9667 other_item.AddQuantity(-quantity_used);
9668 }
9669 }
9671 }
9672
9674 {
9675 #ifdef SERVER
9676 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9677 GetHierarchyParent().IncreaseLifetimeUp();
9678 #endif
9679 };
9680
9682 {
9683 PlayerBase p = PlayerBase.Cast(player);
9684
9685 array<int> recipesIds = p.m_Recipes;
9686 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9687 if (moduleRecipesManager)
9688 {
9689 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9690 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9691 }
9692
9693 for (int i = 0;i < recipesIds.Count(); i++)
9694 {
9695 int key = recipesIds.Get(i);
9696 string recipeName = moduleRecipesManager.GetRecipeName(key);
9698 }
9699 }
9700
9701
9702 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9703 {
9704 super.GetDebugActions(outputList);
9705
9706
9711
9712
9716
9720
9721
9724
9725
9727 {
9730 }
9731
9733
9736
9740 }
9741
9742
9743
9744
9746 {
9747 super.OnAction(action_id, player, ctx);
9748 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9749 {
9750 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9751 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9752 PlayerBase p = PlayerBase.Cast(player);
9753 if (
EActions.RECIPES_RANGE_START < 1000)
9754 {
9755 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9756 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9757 }
9758 }
9759 #ifndef SERVER
9760 else if (action_id ==
EActions.WATCH_PLAYER)
9761 {
9762 PluginDeveloper.SetDeveloperItemClientEx(player);
9763 }
9764 #endif
9766 {
9767 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9768 {
9769 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9770 OnDebugButtonPressServer(id + 1);
9771 }
9772
9773 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9774 {
9775 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9777 }
9778
9779 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9780 {
9781 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9783 }
9784
9785 else if (action_id ==
EActions.ADD_QUANTITY)
9786 {
9787 if (IsMagazine())
9788 {
9789 Magazine mag = Magazine.Cast(this);
9790 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9791 }
9792 else
9793 {
9795 }
9796
9797 if (m_EM)
9798 {
9799 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9800 }
9801
9802 }
9803
9804 else if (action_id ==
EActions.REMOVE_QUANTITY)
9805 {
9806 if (IsMagazine())
9807 {
9808 Magazine mag2 = Magazine.Cast(this);
9809 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9810 }
9811 else
9812 {
9814 }
9815 if (m_EM)
9816 {
9817 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9818 }
9819
9820 }
9821
9822 else if (action_id ==
EActions.SET_QUANTITY_0)
9823 {
9825
9826 if (m_EM)
9827 {
9828 m_EM.SetEnergy(0);
9829 }
9830 }
9831
9832 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9833 {
9835
9836 if (m_EM)
9837 {
9838 m_EM.SetEnergy(m_EM.GetEnergyMax());
9839 }
9840 }
9841
9842 else if (action_id ==
EActions.ADD_HEALTH)
9843 {
9844 AddHealth("","",GetMaxHealth("","Health")/5);
9845 }
9846 else if (action_id ==
EActions.REMOVE_HEALTH)
9847 {
9848 AddHealth("","",-GetMaxHealth("","Health")/5);
9849 }
9850 else if (action_id ==
EActions.DESTROY_HEALTH)
9851 {
9852 SetHealth01("","",0);
9853 }
9854 else if (action_id ==
EActions.WATCH_ITEM)
9855 {
9857 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9858 #ifdef DEVELOPER
9859 SetDebugDeveloper_item(this);
9860 #endif
9861 }
9862
9863 else if (action_id ==
EActions.ADD_TEMPERATURE)
9864 {
9865 AddTemperature(20);
9866
9867 }
9868
9869 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9870 {
9871 AddTemperature(-20);
9872
9873 }
9874
9875 else if (action_id ==
EActions.FLIP_FROZEN)
9876 {
9877 SetFrozen(!GetIsFrozen());
9878
9879 }
9880
9881 else if (action_id ==
EActions.ADD_WETNESS)
9882 {
9884
9885 }
9886
9887 else if (action_id ==
EActions.REMOVE_WETNESS)
9888 {
9890
9891 }
9892
9893 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9894 {
9897
9898
9899 }
9900
9901 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9902 {
9905 }
9906
9907 else if (action_id ==
EActions.MAKE_SPECIAL)
9908 {
9909 auto debugParams = DebugSpawnParams.WithPlayer(player);
9910 OnDebugSpawnEx(debugParams);
9911 }
9912
9913 else if (action_id ==
EActions.DELETE)
9914 {
9915 Delete();
9916 }
9917
9918 }
9919
9920
9921 return false;
9922 }
9923
9924
9925
9926
9930
9933
9934
9935
9937 {
9938 return false;
9939 }
9940
9941
9943 {
9944 return true;
9945 }
9946
9947
9949 {
9950 return true;
9951 }
9952
9953
9954
9956 {
9957 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9959 }
9960
9963 {
9964 return null;
9965 }
9966
9968 {
9969 return false;
9970 }
9971
9973 {
9974 return false;
9975 }
9976
9980
9981
9983 {
9984 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9985 return module_repairing.CanRepair(this, item_repair_kit);
9986 }
9987
9988
9989 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9990 {
9991 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9992 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9993 }
9994
9995
9997 {
9998
9999
10000
10001
10002
10003
10004
10005
10006 return 1;
10007 }
10008
10009
10010
10012 {
10014 }
10015
10016
10017
10019 {
10021 }
10022
10023
10032 {
10033 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10034
10035 if (player)
10036 {
10037 player.MessageStatus(text);
10038 }
10039 }
10040
10041
10050 {
10051 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10052
10053 if (player)
10054 {
10055 player.MessageAction(text);
10056 }
10057 }
10058
10059
10068 {
10069 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10070
10071 if (player)
10072 {
10073 player.MessageFriendly(text);
10074 }
10075 }
10076
10077
10086 {
10087 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10088
10089 if (player)
10090 {
10091 player.MessageImportant(text);
10092 }
10093 }
10094
10096 {
10097 return true;
10098 }
10099
10100
10101 override bool KindOf(
string tag)
10102 {
10103 bool found = false;
10104 string item_name = this.
GetType();
10107
10108 int array_size = item_tag_array.Count();
10109 for (int i = 0; i < array_size; i++)
10110 {
10111 if (item_tag_array.Get(i) == tag)
10112 {
10113 found = true;
10114 break;
10115 }
10116 }
10117 return found;
10118 }
10119
10120
10122 {
10123
10124 super.OnRPC(sender, rpc_type,ctx);
10125
10126
10127 switch (rpc_type)
10128 {
10129 #ifndef SERVER
10130 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10131 Param2<bool, string> p = new Param2<bool, string>(false, "");
10132
10134 return;
10135
10136 bool play = p.param1;
10137 string soundSet = p.param2;
10138
10139 if (play)
10140 {
10142 {
10144 {
10146 }
10147 }
10148 else
10149 {
10151 }
10152 }
10153 else
10154 {
10156 }
10157
10158 break;
10159 #endif
10160
10161 }
10162
10164 {
10166 }
10167 }
10168
10169
10170
10171
10173 {
10174 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10175 return plugin.GetID(
name);
10176 }
10177
10179 {
10180 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10181 return plugin.GetName(id);
10182 }
10183
10186 {
10187
10188
10189 int varFlags;
10190 if (!ctx.
Read(varFlags))
10191 return;
10192
10193 if (varFlags & ItemVariableFlags.FLOAT)
10194 {
10196 }
10197 }
10198
10200 {
10201
10202 super.SerializeNumericalVars(floats_out);
10203
10204
10205
10207 {
10209 }
10210
10212 {
10214 }
10215
10217 {
10219 }
10220
10222 {
10227 }
10228
10230 {
10232 }
10233 }
10234
10236 {
10237
10238 super.DeSerializeNumericalVars(floats);
10239
10240
10241 int index = 0;
10242 int mask = Math.Round(floats.Get(index));
10243
10244 index++;
10245
10247 {
10249 {
10251 }
10252 else
10253 {
10254 float quantity = floats.Get(index);
10255 SetQuantity(quantity,
true,
false,
false,
false);
10256 }
10257 index++;
10258 }
10259
10261 {
10262 float wet = floats.Get(index);
10264 index++;
10265 }
10266
10268 {
10269 int liquidtype = Math.Round(floats.Get(index));
10271 index++;
10272 }
10273
10275 {
10277 index++;
10279 index++;
10281 index++;
10283 index++;
10284 }
10285
10287 {
10288 int cleanness = Math.Round(floats.Get(index));
10290 index++;
10291 }
10292 }
10293
10295 {
10296 super.WriteVarsToCTX(ctx);
10297
10298
10300 {
10302 }
10303
10305 {
10307 }
10308
10310 {
10312 }
10313
10315 {
10316 int r,g,b,a;
10322 }
10323
10325 {
10327 }
10328 }
10329
10331 {
10332 if (!super.ReadVarsFromCTX(ctx,version))
10333 return false;
10334
10335 int intValue;
10336 float value;
10337
10338 if (version < 140)
10339 {
10340 if (!ctx.
Read(intValue))
10341 return false;
10342
10343 m_VariablesMask = intValue;
10344 }
10345
10347 {
10348 if (!ctx.
Read(value))
10349 return false;
10350
10352 {
10354 }
10355 else
10356 {
10358 }
10359 }
10360
10361 if (version < 140)
10362 {
10364 {
10365 if (!ctx.
Read(value))
10366 return false;
10367 SetTemperatureDirect(value);
10368 }
10369 }
10370
10372 {
10373 if (!ctx.
Read(value))
10374 return false;
10376 }
10377
10379 {
10380 if (!ctx.
Read(intValue))
10381 return false;
10383 }
10384
10386 {
10387 int r,g,b,a;
10389 return false;
10391 return false;
10393 return false;
10395 return false;
10396
10398 }
10399
10401 {
10402 if (!ctx.
Read(intValue))
10403 return false;
10405 }
10406
10407 if (version >= 138 && version < 140)
10408 {
10410 {
10411 if (!ctx.
Read(intValue))
10412 return false;
10413 SetFrozen(intValue);
10414 }
10415 }
10416
10417 return true;
10418 }
10419
10420
10422 {
10425 {
10427 }
10428
10429 if (!super.OnStoreLoad(ctx, version))
10430 {
10432 return false;
10433 }
10434
10435 if (version >= 114)
10436 {
10437 bool hasQuickBarIndexSaved;
10438
10439 if (!ctx.
Read(hasQuickBarIndexSaved))
10440 {
10442 return false;
10443 }
10444
10445 if (hasQuickBarIndexSaved)
10446 {
10447 int itmQBIndex;
10448
10449
10450 if (!ctx.
Read(itmQBIndex))
10451 {
10453 return false;
10454 }
10455
10456 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10457 if (itmQBIndex != -1 && parentPlayer)
10458 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10459 }
10460 }
10461 else
10462 {
10463
10464 PlayerBase player;
10465 int itemQBIndex;
10466 if (version ==
int.
MAX)
10467 {
10468 if (!ctx.
Read(itemQBIndex))
10469 {
10471 return false;
10472 }
10473 }
10474 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10475 {
10476
10477 if (!ctx.
Read(itemQBIndex))
10478 {
10480 return false;
10481 }
10482 if (itemQBIndex != -1 && player)
10483 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10484 }
10485 }
10486
10487 if (version < 140)
10488 {
10489
10490 if (!LoadVariables(ctx, version))
10491 {
10493 return false;
10494 }
10495 }
10496
10497
10499 {
10501 return false;
10502 }
10503 if (version >= 132)
10504 {
10506 if (raib)
10507 {
10509 {
10511 return false;
10512 }
10513 }
10514 }
10515
10517 return true;
10518 }
10519
10520
10521
10523 {
10524 super.OnStoreSave(ctx);
10525
10526 PlayerBase player;
10527 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10528 {
10530
10531 int itemQBIndex = -1;
10532 itemQBIndex = player.FindQuickBarEntityIndex(this);
10533 ctx.
Write(itemQBIndex);
10534 }
10535 else
10536 {
10538 }
10539
10541
10543 if (raib)
10544 {
10546 }
10547 }
10548
10549
10551 {
10552 super.AfterStoreLoad();
10553
10555 {
10557 }
10558
10560 {
10563 }
10564 }
10565
10567 {
10568 super.EEOnAfterLoad();
10569
10571 {
10573 }
10574
10577 }
10578
10580 {
10581 return false;
10582 }
10583
10584
10585
10587 {
10589 {
10590 #ifdef PLATFORM_CONSOLE
10591
10593 {
10595 if (menu)
10596 {
10598 }
10599 }
10600 #endif
10601 }
10602
10604 {
10607 }
10608
10610 {
10611 SetWeightDirty();
10613 }
10615 {
10618 }
10619
10621 {
10624 }
10626 {
10629 }
10630
10631 super.OnVariablesSynchronized();
10632 }
10633
10634
10635
10637 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10638 {
10639 if (!IsServerCheck(allow_client))
10640 return false;
10641
10643 return false;
10644
10647
10648 if (value <= (min + 0.001))
10649 value = min;
10650
10651 if (value == min)
10652 {
10653 if (destroy_config)
10654 {
10655 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10656 if (dstr)
10657 {
10659 this.Delete();
10660 return true;
10661 }
10662 }
10663 else if (destroy_forced)
10664 {
10666 this.Delete();
10667 return true;
10668 }
10669
10671 }
10672
10675
10677 {
10679
10680 if (delta)
10682 }
10683
10685
10686 return false;
10687 }
10688
10689
10691 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10692 {
10694 }
10695
10697 {
10700 }
10701
10703 {
10706 }
10707
10710 {
10711 float value_clamped = Math.Clamp(value, 0, 1);
10713 SetQuantity(result, destroy_config, destroy_forced);
10714 }
10715
10716
10719 {
10721 }
10722
10724 {
10726 }
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10738 {
10739 int slot = -1;
10740 if (GetInventory())
10741 {
10742 InventoryLocation il = new InventoryLocation;
10743 GetInventory().GetCurrentInventoryLocation(il);
10745 }
10746
10748 }
10749
10751 {
10752 float quantity_max = 0;
10753
10755 {
10756 if (attSlotID != -1)
10757 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10758
10759 if (quantity_max <= 0)
10761 }
10762
10763 if (quantity_max <= 0)
10765
10766 return quantity_max;
10767 }
10768
10770 {
10772 }
10773
10775 {
10777 }
10778
10779
10781 {
10783 }
10784
10786 {
10788 }
10789
10791 {
10793 }
10794
10795
10797 {
10798
10799 float weightEx = GetWeightEx();
10800 float special = GetInventoryAndCargoWeight();
10801 return weightEx - special;
10802 }
10803
10804
10806 {
10808 }
10809
10811 {
10813 {
10814 #ifdef DEVELOPER
10815 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10816 {
10817 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10819 }
10820 #endif
10821
10822 return GetQuantity() * GetConfigWeightModified();
10823 }
10824 else if (HasEnergyManager())
10825 {
10826 #ifdef DEVELOPER
10827 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10828 {
10829 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10830 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10831 }
10832 #endif
10833 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10834 }
10835 else
10836 {
10837 #ifdef DEVELOPER
10838 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10839 {
10840 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10841 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10842 }
10843 #endif
10844 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10845 }
10846 }
10847
10850 {
10851 int item_count = 0;
10853
10854 if (GetInventory().GetCargo() != NULL)
10855 {
10856 item_count = GetInventory().GetCargo().GetItemCount();
10857 }
10858
10859 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10860 {
10861 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10862 if (item)
10863 item_count += item.GetNumberOfItems();
10864 }
10865 return item_count;
10866 }
10867
10870 {
10871 float weight = 0;
10872 float wetness = 1;
10873 if (include_wetness)
10876 {
10877 weight = wetness * m_ConfigWeight;
10878 }
10880 {
10881 weight = 1;
10882 }
10883 return weight;
10884 }
10885
10886
10887
10889 {
10890 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10891 {
10892 GameInventory inv = GetInventory();
10893 array<EntityAI> items = new array<EntityAI>;
10895 for (int i = 0; i < items.Count(); i++)
10896 {
10898 if (item)
10899 {
10901 }
10902 }
10903 }
10904 }
10905
10906
10907
10908
10910 {
10911 float energy = 0;
10912 if (HasEnergyManager())
10913 {
10914 energy = GetCompEM().GetEnergy();
10915 }
10916 return energy;
10917 }
10918
10919
10921 {
10922 super.OnEnergyConsumed();
10923
10925 }
10926
10928 {
10929 super.OnEnergyAdded();
10930
10932 }
10933
10934
10936 {
10937 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10938 {
10940 {
10941 float energy_0to1 = GetCompEM().GetEnergy0To1();
10943 }
10944 }
10945 }
10946
10947
10949 {
10950 return ConfigGetFloat("heatIsolation");
10951 }
10952
10954 {
10956 }
10957
10959 {
10960 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10961 if (
GetGame().ConfigIsExisting(paramPath))
10963
10964 return 0.0;
10965 }
10966
10968 {
10969 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10970 if (
GetGame().ConfigIsExisting(paramPath))
10972
10973 return 0.0;
10974 }
10975
10976 override void SetWet(
float value,
bool allow_client =
false)
10977 {
10978 if (!IsServerCheck(allow_client))
10979 return;
10980
10983
10985
10986 m_VarWet = Math.Clamp(value, min, max);
10987
10989 {
10992 }
10993 }
10994
10995 override void AddWet(
float value)
10996 {
10998 }
10999
11001 {
11003 }
11004
11006 {
11008 }
11009
11011 {
11013 }
11014
11016 {
11018 }
11019
11021 {
11023 }
11024
11025 override void OnWetChanged(
float newVal,
float oldVal)
11026 {
11029 if (newLevel != oldLevel)
11030 {
11032 }
11033 }
11034
11036 {
11037 SetWeightDirty();
11038 }
11039
11041 {
11042 return GetWetLevelInternal(
m_VarWet);
11043 }
11044
11045
11046
11048 {
11050 }
11051
11053 {
11055 }
11056
11058 {
11060 }
11061
11063 {
11065 }
11066
11067
11068
11070 {
11071 if (ConfigIsExisting("itemModelLength"))
11072 {
11073 return ConfigGetFloat("itemModelLength");
11074 }
11075 return 0;
11076 }
11077
11079 {
11080 if (ConfigIsExisting("itemAttachOffset"))
11081 {
11082 return ConfigGetFloat("itemAttachOffset");
11083 }
11084 return 0;
11085 }
11086
11087 override void SetCleanness(
int value,
bool allow_client =
false)
11088 {
11089 if (!IsServerCheck(allow_client))
11090 return;
11091
11093
11095
11098 }
11099
11101 {
11103 }
11104
11106 {
11107 return true;
11108 }
11109
11110
11111
11112
11114 {
11116 }
11117
11119 {
11121 }
11122
11123
11124
11125
11126 override void SetColor(
int r,
int g,
int b,
int a)
11127 {
11133 }
11135 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11136 {
11141 }
11142
11144 {
11146 }
11147
11150 {
11151 int r,g,b,a;
11153 r = r/255;
11154 g = g/255;
11155 b = b/255;
11156 a = a/255;
11157 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11158 }
11159
11160
11161
11162 override void SetLiquidType(
int value,
bool allow_client =
false)
11163 {
11164 if (!IsServerCheck(allow_client))
11165 return;
11166
11171 }
11172
11174 {
11175 return ConfigGetInt("varLiquidTypeInit");
11176 }
11177
11179 {
11181 }
11182
11184 {
11186 SetFrozen(false);
11187 }
11188
11191 {
11192 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11193 }
11194
11195
11198 {
11199 PlayerBase nplayer;
11200 if (PlayerBase.CastTo(nplayer, player))
11201 {
11203
11204 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11205 }
11206 }
11207
11208
11211 {
11212 PlayerBase nplayer;
11213 if (PlayerBase.CastTo(nplayer,player))
11214 {
11215
11216 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11217
11218 }
11219
11220
11221 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11222
11223
11224 if (HasEnergyManager())
11225 {
11226 GetCompEM().UpdatePlugState();
11227 }
11228 }
11229
11230
11232 {
11233 super.OnPlacementStarted(player);
11234
11236 }
11237
11238 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11239 {
11241 {
11242 m_AdminLog.OnPlacementComplete(player,
this);
11243 }
11244
11245 super.OnPlacementComplete(player, position, orientation);
11246 }
11247
11248
11249
11250
11251
11253 {
11255 {
11256 return true;
11257 }
11258 else
11259 {
11260 return false;
11261 }
11262 }
11263
11264
11266 {
11268 {
11270 }
11271 }
11272
11273
11275 {
11277 }
11278
11280 {
11282 }
11283
11284 override void InsertAgent(
int agent,
float count = 1)
11285 {
11286 if (count < 1)
11287 return;
11288
11290 }
11291
11294 {
11296 }
11297
11298
11300 {
11302 }
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11346 {
11348 return false;
11349 return true;
11350 }
11351
11353 {
11354
11356 }
11357
11358
11361 {
11362 super.CheckForRoofLimited(timeTresholdMS);
11363
11365 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11366 {
11367 m_PreviousRoofTestTime = time;
11368 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11369 }
11370 }
11371
11372
11374 {
11376 {
11377 return 0;
11378 }
11379
11380 if (GetInventory().GetAttachmentSlotsCount() != 0)
11381 {
11382 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11383 if (filter)
11384 return filter.GetProtectionLevel(type, false, system);
11385 else
11386 return 0;
11387 }
11388
11389 string subclassPath, entryName;
11390
11391 switch (type)
11392 {
11394 entryName = "biological";
11395 break;
11397 entryName = "chemical";
11398 break;
11399 default:
11400 entryName = "biological";
11401 break;
11402 }
11403
11404 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11405
11407 }
11408
11409
11410
11413 {
11414 if (!IsMagazine())
11416
11418 }
11419
11420
11421
11422
11423
11428 {
11429 return true;
11430 }
11431
11433 {
11435 }
11436
11437
11438
11439
11440
11442 {
11443 if (parent)
11444 {
11445 if (parent.IsInherited(DayZInfected))
11446 return true;
11447
11448 if (!parent.IsRuined())
11449 return true;
11450 }
11451
11452 return true;
11453 }
11454
11456 {
11457 if (!super.CanPutAsAttachment(parent))
11458 {
11459 return false;
11460 }
11461
11462 if (!IsRuined() && !parent.IsRuined())
11463 {
11464 return true;
11465 }
11466
11467 return false;
11468 }
11469
11471 {
11472
11473
11474
11475
11476 return super.CanReceiveItemIntoCargo(item);
11477 }
11478
11480 {
11481
11482
11483
11484
11485 GameInventory attachmentInv = attachment.GetInventory();
11487 {
11488 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11489 return false;
11490 }
11491
11492 InventoryLocation loc = new InventoryLocation();
11493 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11494 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11495 return false;
11496
11497 return super.CanReceiveAttachment(attachment, slotId);
11498 }
11499
11501 {
11502 if (!super.CanReleaseAttachment(attachment))
11503 return false;
11504
11505 return GetInventory().AreChildrenAccessible();
11506 }
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11529 {
11530 int id = muzzle_owner.GetMuzzleID();
11531 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11532
11533 if (WPOF_array)
11534 {
11535 for (int i = 0; i < WPOF_array.Count(); i++)
11536 {
11537 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11538
11539 if (WPOF)
11540 {
11541 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11542 }
11543 }
11544 }
11545 }
11546
11547
11549 {
11550 int id = muzzle_owner.GetMuzzleID();
11552
11553 if (WPOBE_array)
11554 {
11555 for (int i = 0; i < WPOBE_array.Count(); i++)
11556 {
11557 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11558
11559 if (WPOBE)
11560 {
11561 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11562 }
11563 }
11564 }
11565 }
11566
11567
11569 {
11570 int id = muzzle_owner.GetMuzzleID();
11571 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11572
11573 if (WPOOH_array)
11574 {
11575 for (int i = 0; i < WPOOH_array.Count(); i++)
11576 {
11577 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11578
11579 if (WPOOH)
11580 {
11581 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11582 }
11583 }
11584 }
11585 }
11586
11587
11589 {
11590 int id = muzzle_owner.GetMuzzleID();
11591 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11592
11593 if (WPOOH_array)
11594 {
11595 for (int i = 0; i < WPOOH_array.Count(); i++)
11596 {
11597 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11598
11599 if (WPOOH)
11600 {
11601 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11602 }
11603 }
11604 }
11605 }
11606
11607
11609 {
11610 int id = muzzle_owner.GetMuzzleID();
11611 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11612
11613 if (WPOOH_array)
11614 {
11615 for (int i = 0; i < WPOOH_array.Count(); i++)
11616 {
11617 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11618
11619 if (WPOOH)
11620 {
11621 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11622 }
11623 }
11624 }
11625 }
11626
11627
11628
11630 {
11632 {
11633 return true;
11634 }
11635
11636 return false;
11637 }
11638
11640 {
11642 {
11643 return true;
11644 }
11645
11646 return false;
11647 }
11648
11650 {
11652 {
11653 return true;
11654 }
11655
11656 return false;
11657 }
11658
11660 {
11661 return false;
11662 }
11663
11666 {
11667 return UATimeSpent.DEFAULT_DEPLOY;
11668 }
11669
11670
11671
11672
11674 {
11676 SetSynchDirty();
11677 }
11678
11680 {
11682 }
11683
11684
11686 {
11687 return false;
11688 }
11689
11692 {
11693 string att_type = "None";
11694
11695 if (ConfigIsExisting("soundAttType"))
11696 {
11697 att_type = ConfigGetString("soundAttType");
11698 }
11699
11701 }
11702
11704 {
11706 }
11707
11708
11709
11710
11711
11715
11717 {
11720
11722 }
11723
11724
11726 {
11728 return;
11729
11731
11734
11737
11738 SoundParameters params = new SoundParameters();
11742 }
11743
11744
11746 {
11748 return;
11749
11751 SetSynchDirty();
11752
11755 }
11756
11757
11759 {
11761 return;
11762
11764 SetSynchDirty();
11765
11768 }
11769
11771 {
11773 }
11774
11776 {
11778 }
11779
11782 {
11783 if (!
GetGame().IsDedicatedServer())
11784 {
11785 if (ConfigIsExisting("attachSoundSet"))
11786 {
11787 string cfg_path = "";
11788 string soundset = "";
11789 string type_name =
GetType();
11790
11793 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11794 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11795
11796 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11797 {
11798 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11799 {
11800 if (cfg_slot_array[i] == slot_type)
11801 {
11802 soundset = cfg_soundset_array[i];
11803 break;
11804 }
11805 }
11806 }
11807
11808 if (soundset != "")
11809 {
11810 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11812 }
11813 }
11814 }
11815 }
11816
11818 {
11819
11820 }
11821
11822 void OnApply(PlayerBase player);
11823
11825 {
11826 return 1.0;
11827 };
11828
11830 {
11832 }
11833
11835 {
11837 }
11838
11840
11842 {
11843 SetDynamicPhysicsLifeTime(0.01);
11845 }
11846
11848 {
11849 array<string> zone_names = new array<string>;
11850 GetDamageZones(zone_names);
11851 for (int i = 0; i < zone_names.Count(); i++)
11852 {
11853 SetHealthMax(zone_names.Get(i),"Health");
11854 }
11855 SetHealthMax("","Health");
11856 }
11857
11860 {
11861 float global_health = GetHealth01("","Health");
11862 array<string> zones = new array<string>;
11863 GetDamageZones(zones);
11864
11865 for (int i = 0; i < zones.Count(); i++)
11866 {
11867 SetHealth01(zones.Get(i),"Health",global_health);
11868 }
11869 }
11870
11873 {
11874 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11875 }
11876
11878 {
11879 if (!hasRootAsPlayer)
11880 {
11881 if (refParentIB)
11882 {
11883
11884 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11885 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11886
11887 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11888 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11889
11892 }
11893 else
11894 {
11895
11898 }
11899 }
11900 }
11901
11903 {
11905 {
11906 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11907 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11908 {
11909 float heatPermCoef = 1.0;
11911 while (ent)
11912 {
11913 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11914 ent = ent.GetHierarchyParent();
11915 }
11916
11917 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11918 }
11919 }
11920 }
11921
11923 {
11924
11925 EntityAI parent = GetHierarchyParent();
11926 if (!parent)
11927 {
11928 hasParent = false;
11929 hasRootAsPlayer = false;
11930 }
11931 else
11932 {
11933 hasParent = true;
11934 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11935 refParentIB =
ItemBase.Cast(parent);
11936 }
11937 }
11938
11939 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11940 {
11941
11942 }
11943
11945 {
11946
11947 return false;
11948 }
11949
11951 {
11952
11953
11954 return false;
11955 }
11956
11958 {
11959
11960 return false;
11961 }
11962
11965 {
11966 return !GetIsFrozen() &&
IsOpen();
11967 }
11968
11970 {
11971 bool hasParent = false, hasRootAsPlayer = false;
11973
11974 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11975 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11976
11977 if (wwtu || foodDecay)
11978 {
11982
11983 if (processWetness || processTemperature || processDecay)
11984 {
11986
11987 if (processWetness)
11988 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11989
11990 if (processTemperature)
11992
11993 if (processDecay)
11994 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11995 }
11996 }
11997 }
11998
12001 {
12003 }
12004
12006 {
12009
12010 return super.GetTemperatureFreezeThreshold();
12011 }
12012
12014 {
12017
12018 return super.GetTemperatureThawThreshold();
12019 }
12020
12022 {
12025
12026 return super.GetItemOverheatThreshold();
12027 }
12028
12030 {
12032 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12033
12034 return super.GetTemperatureFreezeTime();
12035 }
12036
12038 {
12040 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12041
12042 return super.GetTemperatureThawTime();
12043 }
12044
12049
12051 {
12052 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12053 }
12054
12056 {
12057 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12058 }
12059
12062 {
12064 }
12065
12067 {
12069 }
12070
12072 {
12074 }
12075
12078 {
12079 return null;
12080 }
12081
12084 {
12085 return false;
12086 }
12087
12089 {
12091 {
12094 if (!trg)
12095 {
12097 explosive = this;
12098 }
12099
12100 explosive.PairRemote(trg);
12102
12103 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12104 trg.SetPersistentPairID(persistentID);
12105 explosive.SetPersistentPairID(persistentID);
12106
12107 return true;
12108 }
12109 return false;
12110 }
12111
12114 {
12115 float ret = 1.0;
12118 ret *= GetHealth01();
12119
12120 return ret;
12121 }
12122
12123 #ifdef DEVELOPER
12124 override void SetDebugItem()
12125 {
12126 super.SetDebugItem();
12127 _itemBase = this;
12128 }
12129
12131 {
12132 string text = super.GetDebugText();
12133
12135 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12136
12137 return text;
12138 }
12139 #endif
12140
12142 {
12143 return true;
12144 }
12145
12147
12149
12151 {
12154 }
12155
12156
12164
12180}
12181
12183{
12185 if (entity)
12186 {
12187 bool is_item = entity.IsInherited(
ItemBase);
12188 if (is_item && full_quantity)
12189 {
12192 }
12193 }
12194 else
12195 {
12197 return NULL;
12198 }
12199 return entity;
12200}
12201
12203{
12204 if (item)
12205 {
12206 if (health > 0)
12207 item.SetHealth("", "", health);
12208
12209 if (item.CanHaveTemperature())
12210 {
12212 if (item.CanFreeze())
12213 item.SetFrozen(false);
12214 }
12215
12216 if (item.HasEnergyManager())
12217 {
12218 if (quantity >= 0)
12219 {
12220 item.GetCompEM().SetEnergy0To1(quantity);
12221 }
12222 else
12223 {
12225 }
12226 }
12227 else if (item.IsMagazine())
12228 {
12229 Magazine mag = Magazine.Cast(item);
12230 if (quantity >= 0)
12231 {
12232 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12233 }
12234 else
12235 {
12237 }
12238
12239 }
12240 else
12241 {
12242 if (quantity >= 0)
12243 {
12244 item.SetQuantityNormalized(quantity, false);
12245 }
12246 else
12247 {
12249 }
12250
12251 }
12252 }
12253}
12254
12255#ifdef DEVELOPER
12257#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.