7384{
7386 {
7387 return true;
7388 }
7389};
7390
7391
7392
7394{
7398
7400
7403
7404
7405
7406
7407
7416
7422
7427
7432
7453 protected bool m_IsResultOfSplit
7454
7456
7461
7462
7463
7465
7469
7470
7471
7473
7476
7477
7478
7484
7485
7493
7496
7497
7499
7500
7502
7503
7508
7509
7514
7515
7517
7518
7520 {
7525
7526 if (!
GetGame().IsDedicatedServer())
7527 {
7529 {
7531
7533 {
7535 }
7536 }
7537
7540 }
7541
7542 m_OldLocation = null;
7543
7545 {
7547 }
7548
7549 if (ConfigIsExisting("headSelectionsToHide"))
7550 {
7553 }
7554
7556 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7557 {
7559 }
7560
7562
7563 m_IsResultOfSplit = false;
7564
7566 }
7567
7569 {
7570 super.InitItemVariables();
7571
7577 m_Count = ConfigGetInt(
"count");
7578
7581
7586
7589
7594
7606
7610
7611
7614 if (ConfigIsExisting("canBeSplit"))
7615 {
7618 }
7619
7621 if (ConfigIsExisting("itemBehaviour"))
7623
7624
7627 RegisterNetSyncVariableInt("m_VarLiquidType");
7628 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7629
7630 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7631 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7632 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7633
7634 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7635 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7636 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7637 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7638
7639 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7640 RegisterNetSyncVariableBool("m_IsTakeable");
7641 RegisterNetSyncVariableBool("m_IsHologram");
7642
7645 {
7648 }
7649
7651
7653 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7655
7656 }
7657
7659 {
7661 }
7662
7664 {
7667 {
7672 }
7673 }
7674
7675 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7676 {
7678 {
7681 }
7682
7684 }
7685
7687 {
7693 }
7694
7696
7698 {
7700
7701 if (!action)
7702 {
7703 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7704 return;
7705 }
7706
7708 if (!ai)
7709 {
7711 return;
7712 }
7713
7715 if (!action_array)
7716 {
7717 action_array = new array<ActionBase_Basic>;
7719 }
7720 if (LogManager.IsActionLogEnable())
7721 {
7722 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7723 }
7724
7725 if (action_array.Find(action) != -1)
7726 {
7727 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7728 }
7729 else
7730 {
7731 action_array.Insert(action);
7732 }
7733 }
7734
7736 {
7738 ActionBase action = player.GetActionManager().GetAction(actionName);
7741
7742 if (action_array)
7743 {
7744 action_array.RemoveItem(action);
7745 }
7746 }
7747
7748
7749
7751 {
7752 ActionOverrideData overrideData = new ActionOverrideData();
7756
7758 if (!actionMap)
7759 {
7762 }
7763
7764 actionMap.Insert(this.
Type(), overrideData);
7765
7766 }
7767
7769
7771
7772
7774 {
7777
7780
7781 string config_to_search = "CfgVehicles";
7782 string muzzle_owner_config;
7783
7785 {
7786 if (IsInherited(Weapon))
7787 config_to_search = "CfgWeapons";
7788
7789 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7790
7791 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7792
7794
7795 if (config_OnFire_subclass_count > 0)
7796 {
7797 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7798
7799 for (int i = 0; i < config_OnFire_subclass_count; i++)
7800 {
7801 string particle_class = "";
7803 string config_OnFire_entry = config_OnFire_class + particle_class;
7804 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7805 WPOF_array.Insert(WPOF);
7806 }
7807
7808
7810 }
7811 }
7812
7814 {
7815 config_to_search = "CfgWeapons";
7816 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7817
7818 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7819
7821
7822 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7823 {
7824 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7825
7826 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7827 {
7828 string particle_class2 = "";
7830 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7831 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7832 WPOBE_array.Insert(WPOBE);
7833 }
7834
7835
7837 }
7838 }
7839 }
7840
7841
7843 {
7846
7848 {
7849 string config_to_search = "CfgVehicles";
7850
7851 if (IsInherited(Weapon))
7852 config_to_search = "CfgWeapons";
7853
7854 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7855 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7856
7857 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7858 {
7859
7861
7863 {
7865 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7867 return;
7868 }
7869
7872
7873
7874
7876 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7877
7878 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7879 {
7880 string particle_class = "";
7882 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7884
7885 if (entry_type == CT_CLASS)
7886 {
7887 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7888 WPOOH_array.Insert(WPOF);
7889 }
7890 }
7891
7892
7894 }
7895 }
7896 }
7897
7899 {
7901 }
7902
7904 {
7906 {
7908
7911
7914
7915 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7916 }
7917 }
7918
7920 {
7922 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7923
7925 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7926
7928 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7929
7931 {
7933 }
7934 }
7935
7937 {
7939 }
7940
7942 {
7945 else
7947
7949 {
7952 }
7953 else
7954 {
7957
7960 }
7961
7963 }
7964
7966 {
7968 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7969 }
7970
7972 {
7974 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7976 }
7977
7979 {
7981 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7982 }
7983
7985 {
7988
7989 OverheatingParticle OP = new OverheatingParticle();
7994
7996 }
7997
7999 {
8002
8003 return -1;
8004 }
8005
8007 {
8009 {
8012
8013 for (int i = count; i > 0; --i)
8014 {
8015 int id = i - 1;
8018
8021
8022 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8023 {
8024 if (p)
8025 {
8028 }
8029 }
8030 }
8031 }
8032 }
8033
8035 {
8037 {
8039 {
8040 int id = i - 1;
8042
8043 if (OP)
8044 {
8046
8047 if (p)
8048 {
8050 }
8051
8052 delete OP;
8053 }
8054 }
8055
8058 }
8059 }
8060
8063 {
8064 return 0.0;
8065 }
8066
8067
8069 {
8070 return 250;
8071 }
8072
8074 {
8075 return 0;
8076 }
8077
8080 {
8082 return true;
8083
8084 return false;
8085 }
8086
8089 {
8092
8094 {
8096 }
8097 else
8098 {
8099
8101 }
8102
8104 }
8105
8112 {
8113 return -1;
8114 }
8115
8116
8117
8118
8120 {
8122 {
8124 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8125
8126 if (r_index >= 0)
8127 {
8128 InventoryLocation r_il = new InventoryLocation;
8129 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8130
8131 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8134 {
8135 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8136 }
8138 {
8139 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8140 }
8141
8142 }
8143
8144 player.GetHumanInventory().ClearUserReservedLocation(this);
8145 }
8146
8149 }
8150
8151
8152
8153
8155 {
8156 return ItemBase.m_DebugActionsMask;
8157 }
8158
8160 {
8161 return ItemBase.m_DebugActionsMask & mask;
8162 }
8163
8165 {
8166 ItemBase.m_DebugActionsMask = mask;
8167 }
8168
8170 {
8171 ItemBase.m_DebugActionsMask |= mask;
8172 }
8173
8175 {
8176 ItemBase.m_DebugActionsMask &= ~mask;
8177 }
8178
8180 {
8182 {
8184 }
8185 else
8186 {
8188 }
8189 }
8190
8191
8193 {
8194 if (GetEconomyProfile())
8195 {
8196 float q_max = GetEconomyProfile().GetQuantityMax();
8197 if (q_max > 0)
8198 {
8199 float q_min = GetEconomyProfile().GetQuantityMin();
8200 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8201
8203 {
8204 ComponentEnergyManager comp = GetCompEM();
8206 {
8208 }
8209 }
8211 {
8213
8214 }
8215
8216 }
8217 }
8218 }
8219
8222 {
8223 EntityAI parent = GetHierarchyParent();
8224
8225 if (parent)
8226 {
8227 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8228 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8229 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8230 }
8231 }
8232
8235 {
8236 EntityAI parent = GetHierarchyParent();
8237
8238 if (parent)
8239 {
8240 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8241 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8242 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8243 }
8244 }
8245
8247 {
8248
8249
8250
8251
8253
8255 {
8256 if (ScriptInputUserData.CanStoreInputUserData())
8257 {
8258 ScriptInputUserData ctx = new ScriptInputUserData;
8264 ctx.
Write(use_stack_max);
8267
8269 {
8270 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8271 }
8272 }
8273 }
8274 else if (!
GetGame().IsMultiplayer())
8275 {
8277 }
8278 }
8279
8281 {
8283 }
8284
8286 {
8288 }
8289
8291 {
8293 }
8294
8296 {
8297
8298 return false;
8299 }
8300
8302 {
8303 return false;
8304 }
8305
8309 {
8310 return false;
8311 }
8312
8314 {
8315 return "";
8316 }
8317
8319
8321 {
8322 return false;
8323 }
8324
8326 {
8327 return true;
8328 }
8329
8330
8331
8333 {
8334 return true;
8335 }
8336
8338 {
8339 return true;
8340 }
8341
8343 {
8344 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8346 }
8347
8349 {
8351 }
8352
8354 {
8356 if (!is_being_placed)
8358 SetSynchDirty();
8359 }
8360
8361
8363
8365 {
8367 }
8368
8370 {
8372 }
8373
8375 {
8376 return 1;
8377 }
8378
8380 {
8381 return false;
8382 }
8383
8385 {
8387 SetSynchDirty();
8388 }
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8425 {
8426 super.OnMovedInsideCargo(container);
8427
8428 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8429 }
8430
8431 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8432 {
8433 super.EEItemLocationChanged(oldLoc,newLoc);
8434
8435 PlayerBase new_player = null;
8436 PlayerBase old_player = null;
8437
8438 if (newLoc.GetParent())
8439 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8440
8441 if (oldLoc.GetParent())
8442 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8443
8445 {
8446 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8447
8448 if (r_index >= 0)
8449 {
8450 InventoryLocation r_il = new InventoryLocation;
8451 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8452
8453 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8456 {
8457 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8458 }
8460 {
8461 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8462 }
8463
8464 }
8465 }
8466
8468 {
8469 if (new_player)
8470 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8471
8472 if (new_player == old_player)
8473 {
8474
8475 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8476 {
8478 {
8479 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8480 {
8481 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8482 }
8483 }
8484 else
8485 {
8486 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8487 }
8488 }
8489
8490 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8491 {
8492 int type = oldLoc.GetType();
8494 {
8495 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8496 }
8498 {
8499 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8500 }
8501 }
8502 if (!m_OldLocation)
8503 {
8504 m_OldLocation = new InventoryLocation;
8505 }
8506 m_OldLocation.Copy(oldLoc);
8507 }
8508 else
8509 {
8510 if (m_OldLocation)
8511 {
8512 m_OldLocation.Reset();
8513 }
8514 }
8515
8517 }
8518 else
8519 {
8520 if (new_player)
8521 {
8522 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8523 if (res_index >= 0)
8524 {
8525 InventoryLocation il = new InventoryLocation;
8526 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8528 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8531 {
8532 il.
GetParent().GetOnReleaseLock().Invoke(it);
8533 }
8535 {
8537 }
8538
8539 }
8540 }
8542 {
8543
8545 }
8546
8547 if (m_OldLocation)
8548 {
8549 m_OldLocation.Reset();
8550 }
8551 }
8552 }
8553
8554 override void EOnContact(IEntity other, Contact extra)
8555 {
8557 {
8558 int liquidType = -1;
8560 if (impactSpeed > 0.0)
8561 {
8563 #ifndef SERVER
8565 #else
8567 SetSynchDirty();
8568 #endif
8570 }
8571 }
8572
8573 #ifdef SERVER
8574 if (GetCompEM() && GetCompEM().IsPlugged())
8575 {
8576 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8577 GetCompEM().UnplugThis();
8578 }
8579 #endif
8580 }
8581
8583
8585 {
8587 }
8588
8590 {
8591
8592 }
8593
8595 {
8596 super.OnItemLocationChanged(old_owner, new_owner);
8597
8598 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8599 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8600
8601 if (!relatedPlayer && playerNew)
8602 relatedPlayer = playerNew;
8603
8604 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8605 {
8607 if (actionMgr)
8608 {
8609 ActionBase currentAction = actionMgr.GetRunningAction();
8610 if (currentAction)
8612 }
8613 }
8614
8615 Man ownerPlayerOld = null;
8616 Man ownerPlayerNew = null;
8617
8618 if (old_owner)
8619 {
8620 if (old_owner.
IsMan())
8621 {
8622 ownerPlayerOld = Man.Cast(old_owner);
8623 }
8624 else
8625 {
8626 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8627 }
8628 }
8629 else
8630 {
8632 {
8634
8635 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8636 {
8637 GetCompEM().UnplugThis();
8638 }
8639 }
8640 }
8641
8642 if (new_owner)
8643 {
8644 if (new_owner.
IsMan())
8645 {
8646 ownerPlayerNew = Man.Cast(new_owner);
8647 }
8648 else
8649 {
8650 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8651 }
8652 }
8653
8654 if (ownerPlayerOld != ownerPlayerNew)
8655 {
8656 if (ownerPlayerOld)
8657 {
8658 array<EntityAI> subItemsExit = new array<EntityAI>;
8660 for (int i = 0; i < subItemsExit.Count(); i++)
8661 {
8664 }
8665 }
8666
8667 if (ownerPlayerNew)
8668 {
8669 array<EntityAI> subItemsEnter = new array<EntityAI>;
8671 for (int j = 0; j < subItemsEnter.Count(); j++)
8672 {
8675 }
8676 }
8677 }
8678 else if (ownerPlayerNew != null)
8679 {
8680 PlayerBase nplayer;
8681 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8682 {
8683 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8685 for (int k = 0; k < subItemsUpdate.Count(); k++)
8686 {
8688 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8689 }
8690 }
8691 }
8692
8693 if (old_owner)
8694 old_owner.OnChildItemRemoved(this);
8695 if (new_owner)
8696 new_owner.OnChildItemReceived(this);
8697 }
8698
8699
8701 {
8702 super.EEDelete(parent);
8703 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8704 if (player)
8705 {
8707
8708 if (player.IsAlive())
8709 {
8710 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8711 if (r_index >= 0)
8712 {
8713 InventoryLocation r_il = new InventoryLocation;
8714 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8715
8716 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8719 {
8720 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8721 }
8723 {
8724 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8725 }
8726
8727 }
8728
8729 player.RemoveQuickBarEntityShortcut(this);
8730 }
8731 }
8732 }
8733
8735 {
8736 super.EEKilled(killer);
8737
8740 {
8741 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8742 {
8743 if (IsMagazine())
8744 {
8745 if (Magazine.Cast(this).GetAmmoCount() > 0)
8746 {
8748 }
8749 }
8750 else
8751 {
8753 }
8754 }
8755 }
8756 }
8757
8759 {
8760 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8761
8762 super.OnWasAttached(parent, slot_id);
8763
8766
8768 }
8769
8771 {
8772 super.OnWasDetached(parent, slot_id);
8773
8776 }
8777
8779 {
8780 int idx;
8783
8784 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8785 if (inventory_slots.Count() < 1)
8786 {
8787 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8788 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8789 }
8790 else
8791 {
8792 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8793 }
8794
8795 idx = inventory_slots.Find(slot);
8796 if (idx < 0)
8797 return "";
8798
8799 return attach_types.Get(idx);
8800 }
8801
8803 {
8804 int idx = -1;
8805 string slot;
8806
8809
8810 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8811 if (inventory_slots.Count() < 1)
8812 {
8813 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8814 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8815 }
8816 else
8817 {
8818 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8819 if (detach_types.Count() < 1)
8820 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8821 }
8822
8823 for (int i = 0; i < inventory_slots.Count(); i++)
8824 {
8825 slot = inventory_slots.Get(i);
8826 }
8827
8828 if (slot != "")
8829 {
8830 if (detach_types.Count() == 1)
8831 idx = 0;
8832 else
8833 idx = inventory_slots.Find(slot);
8834 }
8835 if (idx < 0)
8836 return "";
8837
8838 return detach_types.Get(idx);
8839 }
8840
8842 {
8843
8845
8846
8847 float min_time = 1;
8848 float max_time = 3;
8849 float delay = Math.RandomFloat(min_time, max_time);
8850
8851 explode_timer.Run(delay, this, "DoAmmoExplosion");
8852 }
8853
8855 {
8856 Magazine magazine = Magazine.Cast(this);
8857 int pop_sounds_count = 6;
8858 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8859
8860
8861 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8862 string sound_name = pop_sounds[ sound_idx ];
8864
8865
8866 magazine.ServerAddAmmoCount(-1);
8867
8868
8869 float min_temp_to_explode = 100;
8870
8871 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8872 {
8874 }
8875 }
8876
8877
8878 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8879 {
8880 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8881
8882 const int CHANCE_DAMAGE_CARGO = 4;
8883 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8884 const int CHANCE_DAMAGE_NOTHING = 2;
8885
8887 {
8888 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8889 int chances;
8890 int rnd;
8891
8892 if (GetInventory().GetCargo())
8893 {
8894 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8895 rnd = Math.RandomInt(0,chances);
8896
8897 if (rnd < CHANCE_DAMAGE_CARGO)
8898 {
8900 }
8901 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8902 {
8904 }
8905 }
8906 else
8907 {
8908 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8909 rnd = Math.RandomInt(0,chances);
8910
8911 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8912 {
8914 }
8915 }
8916 }
8917 }
8918
8920 {
8921 if (GetInventory().GetCargo())
8922 {
8923 int item_count = GetInventory().GetCargo().GetItemCount();
8924 if (item_count > 0)
8925 {
8926 int random_pick = Math.RandomInt(0, item_count);
8928 if (!item.IsExplosive())
8929 {
8930 item.AddHealth("","",damage);
8931 return true;
8932 }
8933 }
8934 }
8935 return false;
8936 }
8937
8939 {
8940 int attachment_count = GetInventory().AttachmentCount();
8941 if (attachment_count > 0)
8942 {
8943 int random_pick = Math.RandomInt(0, attachment_count);
8944 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8945 if (!attachment.IsExplosive())
8946 {
8947 attachment.AddHealth("","",damage);
8948 return true;
8949 }
8950 }
8951 return false;
8952 }
8953
8955 {
8957 }
8958
8960 {
8962 return GetInventory().CanRemoveEntity();
8963
8964 return false;
8965 }
8966
8968 {
8970 return;
8971
8973 {
8974 if (ScriptInputUserData.CanStoreInputUserData())
8975 {
8976 ScriptInputUserData ctx = new ScriptInputUserData;
8981 ctx.
Write(destination_entity);
8985 }
8986 }
8987 else if (!
GetGame().IsMultiplayer())
8988 {
8990 }
8991 }
8992
8994 {
8996 return;
8997
8998 float split_quantity_new;
9002 InventoryLocation loc = new InventoryLocation;
9003
9004 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9005 {
9007 split_quantity_new = stack_max;
9008 else
9010
9011 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9012 if (new_item)
9013 {
9014 new_item.SetResultOfSplit(true);
9015 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9017 new_item.SetQuantity(split_quantity_new);
9018 }
9019 }
9020 else if (destination_entity && slot_id == -1)
9021 {
9022 if (quantity > stack_max)
9023 split_quantity_new = stack_max;
9024 else
9025 split_quantity_new = quantity;
9026
9028 {
9031 }
9032
9033 if (new_item)
9034 {
9035 new_item.SetResultOfSplit(true);
9036 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9038 new_item.SetQuantity(split_quantity_new);
9039 }
9040 }
9041 else
9042 {
9043 if (stack_max != 0)
9044 {
9046 {
9048 }
9049
9050 if (split_quantity_new == 0)
9051 {
9052 if (!
GetGame().IsMultiplayer())
9053 player.PhysicalPredictiveDropItem(this);
9054 else
9055 player.ServerDropEntity(this);
9056 return;
9057 }
9058
9060
9061 if (new_item)
9062 {
9063 new_item.SetResultOfSplit(true);
9064 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9066 new_item.SetQuantity(stack_max);
9067 new_item.PlaceOnSurface();
9068 }
9069 }
9070 }
9071 }
9072
9074 {
9076 return;
9077
9078 float split_quantity_new;
9082 InventoryLocation loc = new InventoryLocation;
9083
9084 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9085 {
9087 split_quantity_new = stack_max;
9088 else
9090
9091 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9092 if (new_item)
9093 {
9094 new_item.SetResultOfSplit(true);
9095 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9097 new_item.SetQuantity(split_quantity_new);
9098 }
9099 }
9100 else if (destination_entity && slot_id == -1)
9101 {
9102 if (quantity > stack_max)
9103 split_quantity_new = stack_max;
9104 else
9105 split_quantity_new = quantity;
9106
9108 {
9111 }
9112
9113 if (new_item)
9114 {
9115 new_item.SetResultOfSplit(true);
9116 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9118 new_item.SetQuantity(split_quantity_new);
9119 }
9120 }
9121 else
9122 {
9123 if (stack_max != 0)
9124 {
9126 {
9128 }
9129
9131
9132 if (new_item)
9133 {
9134 new_item.SetResultOfSplit(true);
9135 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9137 new_item.SetQuantity(stack_max);
9138 new_item.PlaceOnSurface();
9139 }
9140 }
9141 }
9142 }
9143
9145 {
9147 return;
9148
9150 {
9151 if (ScriptInputUserData.CanStoreInputUserData())
9152 {
9153 ScriptInputUserData ctx = new ScriptInputUserData;
9158 dst.WriteToContext(ctx);
9160 }
9161 }
9162 else if (!
GetGame().IsMultiplayer())
9163 {
9165 }
9166 }
9167
9169 {
9171 return;
9172
9174 {
9175 if (ScriptInputUserData.CanStoreInputUserData())
9176 {
9177 ScriptInputUserData ctx = new ScriptInputUserData;
9182 ctx.
Write(destination_entity);
9188 }
9189 }
9190 else if (!
GetGame().IsMultiplayer())
9191 {
9193 }
9194 }
9195
9197 {
9199 }
9200
9202 {
9204 return this;
9205
9207 float split_quantity_new;
9209 if (dst.IsValid())
9210 {
9211 int slot_id = dst.GetSlot();
9213
9214 if (quantity > stack_max)
9215 split_quantity_new = stack_max;
9216 else
9217 split_quantity_new = quantity;
9218
9220
9221 if (new_item)
9222 {
9223 new_item.SetResultOfSplit(true);
9224 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9227 }
9228
9229 return new_item;
9230 }
9231
9232 return null;
9233 }
9234
9236 {
9238 return;
9239
9241 float split_quantity_new;
9243 if (destination_entity)
9244 {
9246 if (quantity > stackable)
9247 split_quantity_new = stackable;
9248 else
9249 split_quantity_new = quantity;
9250
9251 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9252 if (new_item)
9253 {
9254 new_item.SetResultOfSplit(true);
9255 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9257 new_item.SetQuantity(split_quantity_new);
9258 }
9259 }
9260 }
9261
9263 {
9265 return;
9266
9268 {
9269 if (ScriptInputUserData.CanStoreInputUserData())
9270 {
9271 ScriptInputUserData ctx = new ScriptInputUserData;
9276 ItemBase destination_entity =
this;
9277 ctx.
Write(destination_entity);
9281 }
9282 }
9283 else if (!
GetGame().IsMultiplayer())
9284 {
9286 }
9287 }
9288
9290 {
9292 return;
9293
9295 float split_quantity_new;
9297 if (player)
9298 {
9300 if (quantity > stackable)
9301 split_quantity_new = stackable;
9302 else
9303 split_quantity_new = quantity;
9304
9305 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9306 new_item =
ItemBase.Cast(in_hands);
9307 if (new_item)
9308 {
9309 new_item.SetResultOfSplit(true);
9310 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9312 new_item.SetQuantity(split_quantity_new);
9313 }
9314 }
9315 }
9316
9318 {
9320 return;
9321
9323 float split_quantity_new = Math.Floor(quantity * 0.5);
9324
9326
9327 if (new_item)
9328 {
9329 if (new_item.GetQuantityMax() < split_quantity_new)
9330 {
9331 split_quantity_new = new_item.GetQuantityMax();
9332 }
9333
9334 new_item.SetResultOfSplit(true);
9335 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9336
9338 {
9341 }
9342 else
9343 {
9346 }
9347 }
9348 }
9349
9351 {
9353 return;
9354
9356 float split_quantity_new = Math.Floor(quantity / 2);
9357
9358 InventoryLocation invloc = new InventoryLocation;
9360
9362 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9363
9364 if (new_item)
9365 {
9366 if (new_item.GetQuantityMax() < split_quantity_new)
9367 {
9368 split_quantity_new = new_item.GetQuantityMax();
9369 }
9371 {
9374 }
9375 else
9376 {
9379 }
9380 }
9381 }
9382
9385 {
9386 SetWeightDirty();
9388
9389 if (parent)
9390 parent.OnAttachmentQuantityChangedEx(this, delta);
9391
9393 {
9395 {
9397 }
9399 {
9400 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9402 }
9403 }
9404
9405 }
9406
9409 {
9410
9411 }
9412
9415 {
9417 }
9418
9420 {
9421 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9422
9424 {
9425 if (newLevel == GameConstants.STATE_RUINED)
9426 {
9428 EntityAI parent = GetHierarchyParent();
9429 if (parent && parent.IsFireplace())
9430 {
9431 CargoBase cargo = GetInventory().GetCargo();
9432 if (cargo)
9433 {
9435 {
9437 }
9438 }
9439 }
9440 }
9441
9443 {
9444
9446 return;
9447 }
9448
9449 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9450 {
9452 }
9453 }
9454 }
9455
9456
9458 {
9459 super.OnRightClick();
9460
9462 {
9464 {
9465 if (ScriptInputUserData.CanStoreInputUserData())
9466 {
9467 vector m4[4];
9469
9470 EntityAI root = GetHierarchyRoot();
9471
9472 InventoryLocation dst = new InventoryLocation;
9474 {
9475 if (root)
9476 {
9477 root.GetTransform(m4);
9479 }
9480 else
9481 GetInventory().GetCurrentInventoryLocation(dst);
9482 }
9483 else
9484 {
9486
9487
9488 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9489 {
9490 if (root)
9491 {
9492 root.GetTransform(m4);
9494 }
9495 else
9496 GetInventory().GetCurrentInventoryLocation(dst);
9497 }
9498 else
9499 {
9500 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9501 }
9502 }
9503
9504 ScriptInputUserData ctx = new ScriptInputUserData;
9512 }
9513 }
9514 else if (!
GetGame().IsMultiplayer())
9515 {
9517 }
9518 }
9519 }
9520
9521 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9522 {
9523
9524 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9525 return false;
9526
9527 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9528 return false;
9529
9530
9532 return false;
9533
9534
9535 Magazine mag = Magazine.Cast(this);
9536 if (mag)
9537 {
9538 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9539 return false;
9540
9541 if (stack_max_limit)
9542 {
9543 Magazine other_mag = Magazine.Cast(other_item);
9544 if (other_item)
9545 {
9546 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9547 return false;
9548 }
9549
9550 }
9551 }
9552 else
9553 {
9554
9556 return false;
9557
9559 return false;
9560 }
9561
9562 PlayerBase player = null;
9563 if (CastTo(player, GetHierarchyRootPlayer()))
9564 {
9565 if (player.GetInventory().HasAttachment(this))
9566 return false;
9567
9568 if (player.IsItemsToDelete())
9569 return false;
9570 }
9571
9572 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9573 return false;
9574
9575 int slotID;
9577 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9578 return false;
9579
9580 return true;
9581 }
9582
9584 {
9586 }
9587
9589 {
9590 return m_IsResultOfSplit;
9591 }
9592
9594 {
9595 m_IsResultOfSplit = value;
9596 }
9597
9599 {
9601 }
9602
9604 {
9605 float other_item_quantity = other_item.GetQuantity();
9606 float this_free_space;
9607
9609
9611
9612 if (other_item_quantity > this_free_space)
9613 {
9614 return this_free_space;
9615 }
9616 else
9617 {
9618 return other_item_quantity;
9619 }
9620 }
9621
9623 {
9625 }
9626
9628 {
9630 return;
9631
9632 if (!IsMagazine() && other_item)
9633 {
9635 if (quantity_used != 0)
9636 {
9637 float hp1 = GetHealth01("","");
9638 float hp2 = other_item.GetHealth01("","");
9639 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9640 hpResult = hpResult / (
GetQuantity() + quantity_used);
9641
9642 hpResult *= GetMaxHealth();
9643 Math.Round(hpResult);
9644 SetHealth("", "Health", hpResult);
9645
9647 other_item.AddQuantity(-quantity_used);
9648 }
9649 }
9651 }
9652
9654 {
9655 #ifdef SERVER
9656 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9657 GetHierarchyParent().IncreaseLifetimeUp();
9658 #endif
9659 };
9660
9662 {
9663 PlayerBase p = PlayerBase.Cast(player);
9664
9665 array<int> recipesIds = p.m_Recipes;
9666 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9667 if (moduleRecipesManager)
9668 {
9669 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9670 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9671 }
9672
9673 for (int i = 0;i < recipesIds.Count(); i++)
9674 {
9675 int key = recipesIds.Get(i);
9676 string recipeName = moduleRecipesManager.GetRecipeName(key);
9678 }
9679 }
9680
9681
9682 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9683 {
9684 super.GetDebugActions(outputList);
9685
9686
9691
9692
9696
9700
9701
9704
9705
9707 {
9710 }
9711
9713
9716
9720 }
9721
9722
9723
9724
9726 {
9727 super.OnAction(action_id, player, ctx);
9728 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9729 {
9730 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9731 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9732 PlayerBase p = PlayerBase.Cast(player);
9733 if (
EActions.RECIPES_RANGE_START < 1000)
9734 {
9735 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9736 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9737 }
9738 }
9739 #ifndef SERVER
9740 else if (action_id ==
EActions.WATCH_PLAYER)
9741 {
9742 PluginDeveloper.SetDeveloperItemClientEx(player);
9743 }
9744 #endif
9746 {
9747 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9748 {
9749 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9750 OnDebugButtonPressServer(id + 1);
9751 }
9752
9753 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9754 {
9755 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9757 }
9758
9759 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9760 {
9761 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9763 }
9764
9765 else if (action_id ==
EActions.ADD_QUANTITY)
9766 {
9767 if (IsMagazine())
9768 {
9769 Magazine mag = Magazine.Cast(this);
9770 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9771 }
9772 else
9773 {
9775 }
9776
9777 if (m_EM)
9778 {
9779 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9780 }
9781
9782 }
9783
9784 else if (action_id ==
EActions.REMOVE_QUANTITY)
9785 {
9786 if (IsMagazine())
9787 {
9788 Magazine mag2 = Magazine.Cast(this);
9789 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9790 }
9791 else
9792 {
9794 }
9795 if (m_EM)
9796 {
9797 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9798 }
9799
9800 }
9801
9802 else if (action_id ==
EActions.SET_QUANTITY_0)
9803 {
9805
9806 if (m_EM)
9807 {
9808 m_EM.SetEnergy(0);
9809 }
9810 }
9811
9812 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9813 {
9815
9816 if (m_EM)
9817 {
9818 m_EM.SetEnergy(m_EM.GetEnergyMax());
9819 }
9820 }
9821
9822 else if (action_id ==
EActions.ADD_HEALTH)
9823 {
9824 AddHealth("","",GetMaxHealth("","Health")/5);
9825 }
9826 else if (action_id ==
EActions.REMOVE_HEALTH)
9827 {
9828 AddHealth("","",-GetMaxHealth("","Health")/5);
9829 }
9830 else if (action_id ==
EActions.DESTROY_HEALTH)
9831 {
9832 SetHealth01("","",0);
9833 }
9834 else if (action_id ==
EActions.WATCH_ITEM)
9835 {
9837 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9838 #ifdef DEVELOPER
9839 SetDebugDeveloper_item(this);
9840 #endif
9841 }
9842
9843 else if (action_id ==
EActions.ADD_TEMPERATURE)
9844 {
9845 AddTemperature(20);
9846
9847 }
9848
9849 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9850 {
9851 AddTemperature(-20);
9852
9853 }
9854
9855 else if (action_id ==
EActions.FLIP_FROZEN)
9856 {
9857 SetFrozen(!GetIsFrozen());
9858
9859 }
9860
9861 else if (action_id ==
EActions.ADD_WETNESS)
9862 {
9864
9865 }
9866
9867 else if (action_id ==
EActions.REMOVE_WETNESS)
9868 {
9870
9871 }
9872
9873 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9874 {
9877
9878
9879 }
9880
9881 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9882 {
9885 }
9886
9887 else if (action_id ==
EActions.MAKE_SPECIAL)
9888 {
9889 auto debugParams = DebugSpawnParams.WithPlayer(player);
9890 OnDebugSpawnEx(debugParams);
9891 }
9892
9893 else if (action_id ==
EActions.DELETE)
9894 {
9895 Delete();
9896 }
9897
9898 }
9899
9900
9901 return false;
9902 }
9903
9904
9905
9906
9910
9913
9914
9915
9917 {
9918 return false;
9919 }
9920
9921
9923 {
9924 return true;
9925 }
9926
9927
9929 {
9930 return true;
9931 }
9932
9933
9934
9936 {
9937 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9939 }
9940
9943 {
9944 return null;
9945 }
9946
9948 {
9949 return false;
9950 }
9951
9953 {
9954 return false;
9955 }
9956
9960
9961
9963 {
9964 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9965 return module_repairing.CanRepair(this, item_repair_kit);
9966 }
9967
9968
9969 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9970 {
9971 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9972 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9973 }
9974
9975
9977 {
9978
9979
9980
9981
9982
9983
9984
9985
9986 return 1;
9987 }
9988
9989
9990
9992 {
9994 }
9995
9996
9997
9999 {
10001 }
10002
10003
10012 {
10013 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10014
10015 if (player)
10016 {
10017 player.MessageStatus(text);
10018 }
10019 }
10020
10021
10030 {
10031 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10032
10033 if (player)
10034 {
10035 player.MessageAction(text);
10036 }
10037 }
10038
10039
10048 {
10049 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10050
10051 if (player)
10052 {
10053 player.MessageFriendly(text);
10054 }
10055 }
10056
10057
10066 {
10067 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10068
10069 if (player)
10070 {
10071 player.MessageImportant(text);
10072 }
10073 }
10074
10076 {
10077 return true;
10078 }
10079
10080
10081 override bool KindOf(
string tag)
10082 {
10083 bool found = false;
10084 string item_name = this.
GetType();
10087
10088 int array_size = item_tag_array.Count();
10089 for (int i = 0; i < array_size; i++)
10090 {
10091 if (item_tag_array.Get(i) == tag)
10092 {
10093 found = true;
10094 break;
10095 }
10096 }
10097 return found;
10098 }
10099
10100
10102 {
10103
10104 super.OnRPC(sender, rpc_type,ctx);
10105
10106
10107 switch (rpc_type)
10108 {
10109 #ifndef SERVER
10110 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10111 Param2<bool, string> p = new Param2<bool, string>(false, "");
10112
10114 return;
10115
10116 bool play = p.param1;
10117 string soundSet = p.param2;
10118
10119 if (play)
10120 {
10122 {
10124 {
10126 }
10127 }
10128 else
10129 {
10131 }
10132 }
10133 else
10134 {
10136 }
10137
10138 break;
10139 #endif
10140
10141 }
10142
10144 {
10146 }
10147 }
10148
10149
10150
10151
10153 {
10154 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10155 return plugin.GetID(
name);
10156 }
10157
10159 {
10160 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10161 return plugin.GetName(id);
10162 }
10163
10166 {
10167
10168
10169 int varFlags;
10170 if (!ctx.
Read(varFlags))
10171 return;
10172
10173 if (varFlags & ItemVariableFlags.FLOAT)
10174 {
10176 }
10177 }
10178
10180 {
10181
10182 super.SerializeNumericalVars(floats_out);
10183
10184
10185
10187 {
10189 }
10190
10192 {
10194 }
10195
10197 {
10199 }
10200
10202 {
10207 }
10208
10210 {
10212 }
10213 }
10214
10216 {
10217
10218 super.DeSerializeNumericalVars(floats);
10219
10220
10221 int index = 0;
10222 int mask = Math.Round(floats.Get(index));
10223
10224 index++;
10225
10227 {
10229 {
10231 }
10232 else
10233 {
10234 float quantity = floats.Get(index);
10235 SetQuantity(quantity,
true,
false,
false,
false);
10236 }
10237 index++;
10238 }
10239
10241 {
10242 float wet = floats.Get(index);
10244 index++;
10245 }
10246
10248 {
10249 int liquidtype = Math.Round(floats.Get(index));
10251 index++;
10252 }
10253
10255 {
10257 index++;
10259 index++;
10261 index++;
10263 index++;
10264 }
10265
10267 {
10268 int cleanness = Math.Round(floats.Get(index));
10270 index++;
10271 }
10272 }
10273
10275 {
10276 super.WriteVarsToCTX(ctx);
10277
10278
10280 {
10282 }
10283
10285 {
10287 }
10288
10290 {
10292 }
10293
10295 {
10296 int r,g,b,a;
10302 }
10303
10305 {
10307 }
10308 }
10309
10311 {
10312 if (!super.ReadVarsFromCTX(ctx,version))
10313 return false;
10314
10315 int intValue;
10316 float value;
10317
10318 if (version < 140)
10319 {
10320 if (!ctx.
Read(intValue))
10321 return false;
10322
10323 m_VariablesMask = intValue;
10324 }
10325
10327 {
10328 if (!ctx.
Read(value))
10329 return false;
10330
10332 {
10334 }
10335 else
10336 {
10338 }
10339 }
10340
10341 if (version < 140)
10342 {
10344 {
10345 if (!ctx.
Read(value))
10346 return false;
10347 SetTemperatureDirect(value);
10348 }
10349 }
10350
10352 {
10353 if (!ctx.
Read(value))
10354 return false;
10356 }
10357
10359 {
10360 if (!ctx.
Read(intValue))
10361 return false;
10363 }
10364
10366 {
10367 int r,g,b,a;
10369 return false;
10371 return false;
10373 return false;
10375 return false;
10376
10378 }
10379
10381 {
10382 if (!ctx.
Read(intValue))
10383 return false;
10385 }
10386
10387 if (version >= 138 && version < 140)
10388 {
10390 {
10391 if (!ctx.
Read(intValue))
10392 return false;
10393 SetFrozen(intValue);
10394 }
10395 }
10396
10397 return true;
10398 }
10399
10400
10402 {
10405 {
10407 }
10408
10409 if (!super.OnStoreLoad(ctx, version))
10410 {
10412 return false;
10413 }
10414
10415 if (version >= 114)
10416 {
10417 bool hasQuickBarIndexSaved;
10418
10419 if (!ctx.
Read(hasQuickBarIndexSaved))
10420 {
10422 return false;
10423 }
10424
10425 if (hasQuickBarIndexSaved)
10426 {
10427 int itmQBIndex;
10428
10429
10430 if (!ctx.
Read(itmQBIndex))
10431 {
10433 return false;
10434 }
10435
10436 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10437 if (itmQBIndex != -1 && parentPlayer)
10438 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10439 }
10440 }
10441 else
10442 {
10443
10444 PlayerBase player;
10445 int itemQBIndex;
10446 if (version ==
int.
MAX)
10447 {
10448 if (!ctx.
Read(itemQBIndex))
10449 {
10451 return false;
10452 }
10453 }
10454 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10455 {
10456
10457 if (!ctx.
Read(itemQBIndex))
10458 {
10460 return false;
10461 }
10462 if (itemQBIndex != -1 && player)
10463 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10464 }
10465 }
10466
10467 if (version < 140)
10468 {
10469
10470 if (!LoadVariables(ctx, version))
10471 {
10473 return false;
10474 }
10475 }
10476
10477
10479 {
10481 return false;
10482 }
10483 if (version >= 132)
10484 {
10486 if (raib)
10487 {
10489 {
10491 return false;
10492 }
10493 }
10494 }
10495
10497 return true;
10498 }
10499
10500
10501
10503 {
10504 super.OnStoreSave(ctx);
10505
10506 PlayerBase player;
10507 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10508 {
10510
10511 int itemQBIndex = -1;
10512 itemQBIndex = player.FindQuickBarEntityIndex(this);
10513 ctx.
Write(itemQBIndex);
10514 }
10515 else
10516 {
10518 }
10519
10521
10523 if (raib)
10524 {
10526 }
10527 }
10528
10529
10531 {
10532 super.AfterStoreLoad();
10533
10535 {
10537 }
10538
10540 {
10543 }
10544 }
10545
10547 {
10548 super.EEOnAfterLoad();
10549
10551 {
10553 }
10554
10557 }
10558
10560 {
10561 return false;
10562 }
10563
10564
10565
10567 {
10569 {
10570 #ifdef PLATFORM_CONSOLE
10571
10573 {
10575 if (menu)
10576 {
10578 }
10579 }
10580 #endif
10581 }
10582
10584 {
10587 }
10588
10590 {
10591 SetWeightDirty();
10593 }
10595 {
10598 }
10599
10601 {
10604 }
10606 {
10609 }
10610
10611 super.OnVariablesSynchronized();
10612 }
10613
10614
10615
10617 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10618 {
10619 if (!IsServerCheck(allow_client))
10620 return false;
10621
10623 return false;
10624
10627
10628 if (value <= (min + 0.001))
10629 value = min;
10630
10631 if (value == min)
10632 {
10633 if (destroy_config)
10634 {
10635 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10636 if (dstr)
10637 {
10639 this.Delete();
10640 return true;
10641 }
10642 }
10643 else if (destroy_forced)
10644 {
10646 this.Delete();
10647 return true;
10648 }
10649
10651 }
10652
10655
10657 {
10659
10660 if (delta)
10662 }
10663
10665
10666 return false;
10667 }
10668
10669
10671 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10672 {
10674 }
10675
10677 {
10680 }
10681
10683 {
10686 }
10687
10690 {
10691 float value_clamped = Math.Clamp(value, 0, 1);
10693 SetQuantity(result, destroy_config, destroy_forced);
10694 }
10695
10696
10699 {
10701 }
10702
10704 {
10706 }
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10718 {
10719 int slot = -1;
10720 if (GetInventory())
10721 {
10722 InventoryLocation il = new InventoryLocation;
10723 GetInventory().GetCurrentInventoryLocation(il);
10725 }
10726
10728 }
10729
10731 {
10732 float quantity_max = 0;
10733
10735 {
10736 if (attSlotID != -1)
10737 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10738
10739 if (quantity_max <= 0)
10741 }
10742
10743 if (quantity_max <= 0)
10745
10746 return quantity_max;
10747 }
10748
10750 {
10752 }
10753
10755 {
10757 }
10758
10759
10761 {
10763 }
10764
10766 {
10768 }
10769
10771 {
10773 }
10774
10775
10777 {
10778
10779 float weightEx = GetWeightEx();
10780 float special = GetInventoryAndCargoWeight();
10781 return weightEx - special;
10782 }
10783
10784
10786 {
10788 }
10789
10791 {
10793 {
10794 #ifdef DEVELOPER
10795 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10796 {
10797 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10799 }
10800 #endif
10801
10802 return GetQuantity() * GetConfigWeightModified();
10803 }
10804 else if (HasEnergyManager())
10805 {
10806 #ifdef DEVELOPER
10807 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10808 {
10809 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10810 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10811 }
10812 #endif
10813 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10814 }
10815 else
10816 {
10817 #ifdef DEVELOPER
10818 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10819 {
10820 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10821 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10822 }
10823 #endif
10824 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10825 }
10826 }
10827
10830 {
10831 int item_count = 0;
10833
10834 if (GetInventory().GetCargo() != NULL)
10835 {
10836 item_count = GetInventory().GetCargo().GetItemCount();
10837 }
10838
10839 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10840 {
10841 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10842 if (item)
10843 item_count += item.GetNumberOfItems();
10844 }
10845 return item_count;
10846 }
10847
10850 {
10851 float weight = 0;
10852 float wetness = 1;
10853 if (include_wetness)
10856 {
10857 weight = wetness * m_ConfigWeight;
10858 }
10860 {
10861 weight = 1;
10862 }
10863 return weight;
10864 }
10865
10866
10867
10869 {
10870 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10871 {
10872 GameInventory inv = GetInventory();
10873 array<EntityAI> items = new array<EntityAI>;
10875 for (int i = 0; i < items.Count(); i++)
10876 {
10878 if (item)
10879 {
10881 }
10882 }
10883 }
10884 }
10885
10886
10887
10888
10890 {
10891 float energy = 0;
10892 if (HasEnergyManager())
10893 {
10894 energy = GetCompEM().GetEnergy();
10895 }
10896 return energy;
10897 }
10898
10899
10901 {
10902 super.OnEnergyConsumed();
10903
10905 }
10906
10908 {
10909 super.OnEnergyAdded();
10910
10912 }
10913
10914
10916 {
10917 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10918 {
10920 {
10921 float energy_0to1 = GetCompEM().GetEnergy0To1();
10923 }
10924 }
10925 }
10926
10927
10929 {
10930 return ConfigGetFloat("heatIsolation");
10931 }
10932
10934 {
10936 }
10937
10939 {
10940 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10941 if (
GetGame().ConfigIsExisting(paramPath))
10943
10944 return 0.0;
10945 }
10946
10948 {
10949 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10950 if (
GetGame().ConfigIsExisting(paramPath))
10952
10953 return 0.0;
10954 }
10955
10956 override void SetWet(
float value,
bool allow_client =
false)
10957 {
10958 if (!IsServerCheck(allow_client))
10959 return;
10960
10963
10965
10966 m_VarWet = Math.Clamp(value, min, max);
10967
10969 {
10972 }
10973 }
10974
10975 override void AddWet(
float value)
10976 {
10978 }
10979
10981 {
10983 }
10984
10986 {
10988 }
10989
10991 {
10993 }
10994
10996 {
10998 }
10999
11001 {
11003 }
11004
11005 override void OnWetChanged(
float newVal,
float oldVal)
11006 {
11009 if (newLevel != oldLevel)
11010 {
11012 }
11013 }
11014
11016 {
11017 SetWeightDirty();
11018 }
11019
11021 {
11022 return GetWetLevelInternal(
m_VarWet);
11023 }
11024
11025
11026
11028 {
11030 }
11031
11033 {
11035 }
11036
11038 {
11040 }
11041
11043 {
11045 }
11046
11047
11048
11050 {
11051 if (ConfigIsExisting("itemModelLength"))
11052 {
11053 return ConfigGetFloat("itemModelLength");
11054 }
11055 return 0;
11056 }
11057
11059 {
11060 if (ConfigIsExisting("itemAttachOffset"))
11061 {
11062 return ConfigGetFloat("itemAttachOffset");
11063 }
11064 return 0;
11065 }
11066
11067 override void SetCleanness(
int value,
bool allow_client =
false)
11068 {
11069 if (!IsServerCheck(allow_client))
11070 return;
11071
11073
11075
11078 }
11079
11081 {
11083 }
11084
11086 {
11087 return true;
11088 }
11089
11090
11091
11092
11094 {
11096 }
11097
11099 {
11101 }
11102
11103
11104
11105
11106 override void SetColor(
int r,
int g,
int b,
int a)
11107 {
11113 }
11115 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11116 {
11121 }
11122
11124 {
11126 }
11127
11130 {
11131 int r,g,b,a;
11133 r = r/255;
11134 g = g/255;
11135 b = b/255;
11136 a = a/255;
11137 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11138 }
11139
11140
11141
11142 override void SetLiquidType(
int value,
bool allow_client =
false)
11143 {
11144 if (!IsServerCheck(allow_client))
11145 return;
11146
11151 }
11152
11154 {
11155 return ConfigGetInt("varLiquidTypeInit");
11156 }
11157
11159 {
11161 }
11162
11164 {
11166 SetFrozen(false);
11167 }
11168
11171 {
11172 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11173 }
11174
11175
11178 {
11179 PlayerBase nplayer;
11180 if (PlayerBase.CastTo(nplayer, player))
11181 {
11183
11184 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11185 }
11186 }
11187
11188
11191 {
11192 PlayerBase nplayer;
11193 if (PlayerBase.CastTo(nplayer,player))
11194 {
11195
11196 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11197
11198 }
11199
11200
11201 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11202
11203
11204 if (HasEnergyManager())
11205 {
11206 GetCompEM().UpdatePlugState();
11207 }
11208 }
11209
11210
11212 {
11213 super.OnPlacementStarted(player);
11214
11216 }
11217
11218 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11219 {
11221 {
11222 m_AdminLog.OnPlacementComplete(player,
this);
11223 }
11224
11225 super.OnPlacementComplete(player, position, orientation);
11226 }
11227
11228
11229
11230
11231
11233 {
11235 {
11236 return true;
11237 }
11238 else
11239 {
11240 return false;
11241 }
11242 }
11243
11244
11246 {
11248 {
11250 }
11251 }
11252
11253
11255 {
11257 }
11258
11260 {
11262 }
11263
11264 override void InsertAgent(
int agent,
float count = 1)
11265 {
11266 if (count < 1)
11267 return;
11268
11270 }
11271
11274 {
11276 }
11277
11278
11280 {
11282 }
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11326 {
11328 return false;
11329 return true;
11330 }
11331
11333 {
11334
11336 }
11337
11338
11341 {
11342 super.CheckForRoofLimited(timeTresholdMS);
11343
11345 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11346 {
11347 m_PreviousRoofTestTime = time;
11348 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11349 }
11350 }
11351
11352
11354 {
11356 {
11357 return 0;
11358 }
11359
11360 if (GetInventory().GetAttachmentSlotsCount() != 0)
11361 {
11362 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11363 if (filter)
11364 return filter.GetProtectionLevel(type, false, system);
11365 else
11366 return 0;
11367 }
11368
11369 string subclassPath, entryName;
11370
11371 switch (type)
11372 {
11374 entryName = "biological";
11375 break;
11377 entryName = "chemical";
11378 break;
11379 default:
11380 entryName = "biological";
11381 break;
11382 }
11383
11384 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11385
11387 }
11388
11389
11390
11393 {
11394 if (!IsMagazine())
11396
11398 }
11399
11400
11401
11402
11403
11408 {
11409 return true;
11410 }
11411
11413 {
11415 }
11416
11417
11418
11419
11420
11422 {
11423 if (parent)
11424 {
11425 if (parent.IsInherited(DayZInfected))
11426 return true;
11427
11428 if (!parent.IsRuined())
11429 return true;
11430 }
11431
11432 return true;
11433 }
11434
11436 {
11437 if (!super.CanPutAsAttachment(parent))
11438 {
11439 return false;
11440 }
11441
11442 if (!IsRuined() && !parent.IsRuined())
11443 {
11444 return true;
11445 }
11446
11447 return false;
11448 }
11449
11451 {
11452
11453
11454
11455
11456 return super.CanReceiveItemIntoCargo(item);
11457 }
11458
11460 {
11461
11462
11463
11464
11465 GameInventory attachmentInv = attachment.GetInventory();
11467 {
11468 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11469 return false;
11470 }
11471
11472 InventoryLocation loc = new InventoryLocation();
11473 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11474 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11475 return false;
11476
11477 return super.CanReceiveAttachment(attachment, slotId);
11478 }
11479
11481 {
11482 if (!super.CanReleaseAttachment(attachment))
11483 return false;
11484
11485 return GetInventory().AreChildrenAccessible();
11486 }
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11509 {
11510 int id = muzzle_owner.GetMuzzleID();
11511 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11512
11513 if (WPOF_array)
11514 {
11515 for (int i = 0; i < WPOF_array.Count(); i++)
11516 {
11517 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11518
11519 if (WPOF)
11520 {
11521 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11522 }
11523 }
11524 }
11525 }
11526
11527
11529 {
11530 int id = muzzle_owner.GetMuzzleID();
11532
11533 if (WPOBE_array)
11534 {
11535 for (int i = 0; i < WPOBE_array.Count(); i++)
11536 {
11537 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11538
11539 if (WPOBE)
11540 {
11541 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11542 }
11543 }
11544 }
11545 }
11546
11547
11549 {
11550 int id = muzzle_owner.GetMuzzleID();
11551 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11552
11553 if (WPOOH_array)
11554 {
11555 for (int i = 0; i < WPOOH_array.Count(); i++)
11556 {
11557 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11558
11559 if (WPOOH)
11560 {
11561 WPOOH.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.OnUpdate(weapon, 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.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11602 }
11603 }
11604 }
11605 }
11606
11607
11608
11610 {
11612 {
11613 return true;
11614 }
11615
11616 return false;
11617 }
11618
11620 {
11622 {
11623 return true;
11624 }
11625
11626 return false;
11627 }
11628
11630 {
11632 {
11633 return true;
11634 }
11635
11636 return false;
11637 }
11638
11640 {
11641 return false;
11642 }
11643
11646 {
11647 return UATimeSpent.DEFAULT_DEPLOY;
11648 }
11649
11650
11651
11652
11654 {
11656 SetSynchDirty();
11657 }
11658
11660 {
11662 }
11663
11664
11666 {
11667 return false;
11668 }
11669
11672 {
11673 string att_type = "None";
11674
11675 if (ConfigIsExisting("soundAttType"))
11676 {
11677 att_type = ConfigGetString("soundAttType");
11678 }
11679
11681 }
11682
11684 {
11686 }
11687
11688
11689
11690
11691
11695
11697 {
11700
11702 }
11703
11704
11706 {
11708 return;
11709
11711
11714
11717
11718 SoundParameters params = new SoundParameters();
11722 }
11723
11724
11726 {
11728 return;
11729
11731 SetSynchDirty();
11732
11735 }
11736
11737
11739 {
11741 return;
11742
11744 SetSynchDirty();
11745
11748 }
11749
11751 {
11753 }
11754
11756 {
11758 }
11759
11762 {
11763 if (!
GetGame().IsDedicatedServer())
11764 {
11765 if (ConfigIsExisting("attachSoundSet"))
11766 {
11767 string cfg_path = "";
11768 string soundset = "";
11769 string type_name =
GetType();
11770
11773 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11774 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11775
11776 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11777 {
11778 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11779 {
11780 if (cfg_slot_array[i] == slot_type)
11781 {
11782 soundset = cfg_soundset_array[i];
11783 break;
11784 }
11785 }
11786 }
11787
11788 if (soundset != "")
11789 {
11790 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11792 }
11793 }
11794 }
11795 }
11796
11798 {
11799
11800 }
11801
11802 void OnApply(PlayerBase player);
11803
11805 {
11806 return 1.0;
11807 };
11808
11810 {
11812 }
11813
11815 {
11817 }
11818
11820
11822 {
11823 SetDynamicPhysicsLifeTime(0.01);
11825 }
11826
11828 {
11829 array<string> zone_names = new array<string>;
11830 GetDamageZones(zone_names);
11831 for (int i = 0; i < zone_names.Count(); i++)
11832 {
11833 SetHealthMax(zone_names.Get(i),"Health");
11834 }
11835 SetHealthMax("","Health");
11836 }
11837
11840 {
11841 float global_health = GetHealth01("","Health");
11842 array<string> zones = new array<string>;
11843 GetDamageZones(zones);
11844
11845 for (int i = 0; i < zones.Count(); i++)
11846 {
11847 SetHealth01(zones.Get(i),"Health",global_health);
11848 }
11849 }
11850
11853 {
11854 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11855 }
11856
11858 {
11859 if (!hasRootAsPlayer)
11860 {
11861 if (refParentIB)
11862 {
11863
11864 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11865 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11866
11867 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11868 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11869
11872 }
11873 else
11874 {
11875
11878 }
11879 }
11880 }
11881
11883 {
11885 {
11886 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11887 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11888 {
11889 float heatPermCoef = 1.0;
11891 while (ent)
11892 {
11893 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11894 ent = ent.GetHierarchyParent();
11895 }
11896
11897 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11898 }
11899 }
11900 }
11901
11903 {
11904
11905 EntityAI parent = GetHierarchyParent();
11906 if (!parent)
11907 {
11908 hasParent = false;
11909 hasRootAsPlayer = false;
11910 }
11911 else
11912 {
11913 hasParent = true;
11914 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11915 refParentIB =
ItemBase.Cast(parent);
11916 }
11917 }
11918
11919 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11920 {
11921
11922 }
11923
11925 {
11926
11927 return false;
11928 }
11929
11931 {
11932
11933
11934 return false;
11935 }
11936
11938 {
11939
11940 return false;
11941 }
11942
11945 {
11946 return !GetIsFrozen() &&
IsOpen();
11947 }
11948
11950 {
11951 bool hasParent = false, hasRootAsPlayer = false;
11953
11954 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11955 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11956
11957 if (wwtu || foodDecay)
11958 {
11962
11963 if (processWetness || processTemperature || processDecay)
11964 {
11966
11967 if (processWetness)
11968 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11969
11970 if (processTemperature)
11972
11973 if (processDecay)
11974 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11975 }
11976 }
11977 }
11978
11981 {
11983 }
11984
11986 {
11989
11990 return super.GetTemperatureFreezeThreshold();
11991 }
11992
11994 {
11997
11998 return super.GetTemperatureThawThreshold();
11999 }
12000
12002 {
12005
12006 return super.GetItemOverheatThreshold();
12007 }
12008
12010 {
12012 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12013
12014 return super.GetTemperatureFreezeTime();
12015 }
12016
12018 {
12020 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12021
12022 return super.GetTemperatureThawTime();
12023 }
12024
12029
12031 {
12032 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12033 }
12034
12036 {
12037 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12038 }
12039
12042 {
12044 }
12045
12047 {
12049 }
12050
12052 {
12054 }
12055
12058 {
12059 return null;
12060 }
12061
12064 {
12065 return false;
12066 }
12067
12069 {
12071 {
12074 if (!trg)
12075 {
12077 explosive = this;
12078 }
12079
12080 explosive.PairRemote(trg);
12082
12083 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12084 trg.SetPersistentPairID(persistentID);
12085 explosive.SetPersistentPairID(persistentID);
12086
12087 return true;
12088 }
12089 return false;
12090 }
12091
12094 {
12095 float ret = 1.0;
12098 ret *= GetHealth01();
12099
12100 return ret;
12101 }
12102
12103 #ifdef DEVELOPER
12104 override void SetDebugItem()
12105 {
12106 super.SetDebugItem();
12107 _itemBase = this;
12108 }
12109
12111 {
12112 string text = super.GetDebugText();
12113
12115 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12116
12117 return text;
12118 }
12119 #endif
12120
12122 {
12123 return true;
12124 }
12125
12127
12129
12131 {
12134 }
12135
12136
12144
12160}
12161
12163{
12165 if (entity)
12166 {
12167 bool is_item = entity.IsInherited(
ItemBase);
12168 if (is_item && full_quantity)
12169 {
12172 }
12173 }
12174 else
12175 {
12177 return NULL;
12178 }
12179 return entity;
12180}
12181
12183{
12184 if (item)
12185 {
12186 if (health > 0)
12187 item.SetHealth("", "", health);
12188
12189 if (item.CanHaveTemperature())
12190 {
12192 if (item.CanFreeze())
12193 item.SetFrozen(false);
12194 }
12195
12196 if (item.HasEnergyManager())
12197 {
12198 if (quantity >= 0)
12199 {
12200 item.GetCompEM().SetEnergy0To1(quantity);
12201 }
12202 else
12203 {
12205 }
12206 }
12207 else if (item.IsMagazine())
12208 {
12209 Magazine mag = Magazine.Cast(item);
12210 if (quantity >= 0)
12211 {
12212 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12213 }
12214 else
12215 {
12217 }
12218
12219 }
12220 else
12221 {
12222 if (quantity >= 0)
12223 {
12224 item.SetQuantityNormalized(quantity, false);
12225 }
12226 else
12227 {
12229 }
12230
12231 }
12232 }
12233}
12234
12235#ifdef DEVELOPER
12237#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.