7362{
7364 {
7365 return true;
7366 }
7367};
7368
7369
7370
7372{
7376
7378
7381
7382
7383
7384
7385
7394
7400
7405
7410
7431 protected bool m_IsResultOfSplit
7432
7434
7439
7440
7441
7443
7447
7448
7449
7451
7454
7455
7456
7462
7463
7471
7474
7475
7477
7478
7480
7481
7486
7487
7492
7493
7495
7496
7498 {
7503
7504 if (!
GetGame().IsDedicatedServer())
7505 {
7507 {
7509
7511 {
7513 }
7514 }
7515
7518 }
7519
7520 m_OldLocation = null;
7521
7523 {
7525 }
7526
7527 if (ConfigIsExisting("headSelectionsToHide"))
7528 {
7531 }
7532
7534 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7535 {
7537 }
7538
7540
7541 m_IsResultOfSplit = false;
7542
7544 }
7545
7547 {
7548 super.InitItemVariables();
7549
7555 m_Count = ConfigGetInt(
"count");
7556
7559
7564
7567
7572
7584
7588
7589
7592 if (ConfigIsExisting("canBeSplit"))
7593 {
7596 }
7597
7599 if (ConfigIsExisting("itemBehaviour"))
7601
7602
7605 RegisterNetSyncVariableInt("m_VarLiquidType");
7606 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7607
7608 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7609 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7610 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7611
7612 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7613 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7614 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7615 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7616
7617 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7618 RegisterNetSyncVariableBool("m_IsTakeable");
7619 RegisterNetSyncVariableBool("m_IsHologram");
7620
7623 {
7626 }
7627
7629
7631 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7633
7634 }
7635
7637 {
7639 }
7640
7642 {
7645 {
7650 }
7651 }
7652
7653 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7654 {
7656 {
7659 }
7660
7662 }
7663
7665 {
7671 }
7672
7674
7676 {
7678
7679 if (!action)
7680 {
7681 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7682 return;
7683 }
7684
7686 if (!ai)
7687 {
7689 return;
7690 }
7691
7693 if (!action_array)
7694 {
7695 action_array = new array<ActionBase_Basic>;
7697 }
7698 if (LogManager.IsActionLogEnable())
7699 {
7700 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7701 }
7702
7703 if (action_array.Find(action) != -1)
7704 {
7705 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7706 }
7707 else
7708 {
7709 action_array.Insert(action);
7710 }
7711 }
7712
7714 {
7716 ActionBase action = player.GetActionManager().GetAction(actionName);
7719
7720 if (action_array)
7721 {
7722 action_array.RemoveItem(action);
7723 }
7724 }
7725
7726
7727
7729 {
7730 ActionOverrideData overrideData = new ActionOverrideData();
7734
7736 if (!actionMap)
7737 {
7740 }
7741
7742 actionMap.Insert(this.
Type(), overrideData);
7743
7744 }
7745
7747
7749
7750
7752 {
7755
7758
7759 string config_to_search = "CfgVehicles";
7760 string muzzle_owner_config;
7761
7763 {
7764 if (IsInherited(Weapon))
7765 config_to_search = "CfgWeapons";
7766
7767 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7768
7769 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7770
7772
7773 if (config_OnFire_subclass_count > 0)
7774 {
7775 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7776
7777 for (int i = 0; i < config_OnFire_subclass_count; i++)
7778 {
7779 string particle_class = "";
7781 string config_OnFire_entry = config_OnFire_class + particle_class;
7782 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7783 WPOF_array.Insert(WPOF);
7784 }
7785
7786
7788 }
7789 }
7790
7792 {
7793 config_to_search = "CfgWeapons";
7794 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7795
7796 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7797
7799
7800 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7801 {
7802 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7803
7804 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7805 {
7806 string particle_class2 = "";
7808 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7809 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7810 WPOBE_array.Insert(WPOBE);
7811 }
7812
7813
7815 }
7816 }
7817 }
7818
7819
7821 {
7824
7826 {
7827 string config_to_search = "CfgVehicles";
7828
7829 if (IsInherited(Weapon))
7830 config_to_search = "CfgWeapons";
7831
7832 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7833 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7834
7835 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7836 {
7837
7839
7841 {
7843 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7845 return;
7846 }
7847
7850
7851
7852
7854 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7855
7856 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7857 {
7858 string particle_class = "";
7860 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7862
7863 if (entry_type == CT_CLASS)
7864 {
7865 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7866 WPOOH_array.Insert(WPOF);
7867 }
7868 }
7869
7870
7872 }
7873 }
7874 }
7875
7877 {
7879 }
7880
7882 {
7884 {
7886
7889
7892
7893 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7894 }
7895 }
7896
7898 {
7900 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7901
7903 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7904
7906 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7907
7909 {
7911 }
7912 }
7913
7915 {
7917 }
7918
7920 {
7923 else
7925
7927 {
7930 }
7931 else
7932 {
7935
7938 }
7939
7941 }
7942
7944 {
7946 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7947 }
7948
7950 {
7952 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7954 }
7955
7957 {
7959 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7960 }
7961
7963 {
7966
7967 OverheatingParticle OP = new OverheatingParticle();
7972
7974 }
7975
7977 {
7980
7981 return -1;
7982 }
7983
7985 {
7987 {
7990
7991 for (int i = count; i > 0; --i)
7992 {
7993 int id = i - 1;
7996
7999
8000 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8001 {
8002 if (p)
8003 {
8006 }
8007 }
8008 }
8009 }
8010 }
8011
8013 {
8015 {
8017 {
8018 int id = i - 1;
8020
8021 if (OP)
8022 {
8024
8025 if (p)
8026 {
8028 }
8029
8030 delete OP;
8031 }
8032 }
8033
8036 }
8037 }
8038
8041 {
8042 return 0.0;
8043 }
8044
8045
8047 {
8048 return 250;
8049 }
8050
8052 {
8053 return 0;
8054 }
8055
8058 {
8060 return true;
8061
8062 return false;
8063 }
8064
8067 {
8070
8072 {
8074 }
8075 else
8076 {
8077
8079 }
8080
8082 }
8083
8090 {
8091 return -1;
8092 }
8093
8094
8095
8096
8098 {
8100 {
8102 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8103
8104 if (r_index >= 0)
8105 {
8106 InventoryLocation r_il = new InventoryLocation;
8107 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8108
8109 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8112 {
8113 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8114 }
8116 {
8117 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8118 }
8119
8120 }
8121
8122 player.GetHumanInventory().ClearUserReservedLocation(this);
8123 }
8124
8127 }
8128
8129
8130
8131
8133 {
8134 return ItemBase.m_DebugActionsMask;
8135 }
8136
8138 {
8139 return ItemBase.m_DebugActionsMask & mask;
8140 }
8141
8143 {
8144 ItemBase.m_DebugActionsMask = mask;
8145 }
8146
8148 {
8149 ItemBase.m_DebugActionsMask |= mask;
8150 }
8151
8153 {
8154 ItemBase.m_DebugActionsMask &= ~mask;
8155 }
8156
8158 {
8160 {
8162 }
8163 else
8164 {
8166 }
8167 }
8168
8169
8171 {
8172 if (GetEconomyProfile())
8173 {
8174 float q_max = GetEconomyProfile().GetQuantityMax();
8175 if (q_max > 0)
8176 {
8177 float q_min = GetEconomyProfile().GetQuantityMin();
8178 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8179
8181 {
8182 ComponentEnergyManager comp = GetCompEM();
8184 {
8186 }
8187 }
8189 {
8191
8192 }
8193
8194 }
8195 }
8196 }
8197
8200 {
8201 EntityAI parent = GetHierarchyParent();
8202
8203 if (parent)
8204 {
8205 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8206 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8207 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8208 }
8209 }
8210
8213 {
8214 EntityAI parent = GetHierarchyParent();
8215
8216 if (parent)
8217 {
8218 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8219 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8220 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8221 }
8222 }
8223
8225 {
8226
8227
8228
8229
8231
8233 {
8234 if (ScriptInputUserData.CanStoreInputUserData())
8235 {
8236 ScriptInputUserData ctx = new ScriptInputUserData;
8242 ctx.
Write(use_stack_max);
8245
8247 {
8248 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8249 }
8250 }
8251 }
8252 else if (!
GetGame().IsMultiplayer())
8253 {
8255 }
8256 }
8257
8259 {
8261 }
8262
8264 {
8266 }
8267
8269 {
8271 }
8272
8274 {
8275
8276 return false;
8277 }
8278
8280 {
8281 return false;
8282 }
8283
8287 {
8288 return false;
8289 }
8290
8292 {
8293 return "";
8294 }
8295
8297
8299 {
8300 return false;
8301 }
8302
8304 {
8305 return true;
8306 }
8307
8308
8309
8311 {
8312 return true;
8313 }
8314
8316 {
8317 return true;
8318 }
8319
8321 {
8322 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8324 }
8325
8327 {
8329 }
8330
8332 {
8334 if (!is_being_placed)
8336 SetSynchDirty();
8337 }
8338
8339
8341
8343 {
8345 }
8346
8348 {
8350 }
8351
8353 {
8354 return 1;
8355 }
8356
8358 {
8359 return false;
8360 }
8361
8363 {
8365 SetSynchDirty();
8366 }
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8403 {
8404 super.OnMovedInsideCargo(container);
8405
8406 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8407 }
8408
8409 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8410 {
8411 super.EEItemLocationChanged(oldLoc,newLoc);
8412
8413 PlayerBase new_player = null;
8414 PlayerBase old_player = null;
8415
8416 if (newLoc.GetParent())
8417 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8418
8419 if (oldLoc.GetParent())
8420 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8421
8423 {
8424 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8425
8426 if (r_index >= 0)
8427 {
8428 InventoryLocation r_il = new InventoryLocation;
8429 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8430
8431 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8434 {
8435 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8436 }
8438 {
8439 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8440 }
8441
8442 }
8443 }
8444
8446 {
8447 if (new_player)
8448 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8449
8450 if (new_player == old_player)
8451 {
8452
8453 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8454 {
8456 {
8457 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8458 {
8459 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8460 }
8461 }
8462 else
8463 {
8464 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8465 }
8466 }
8467
8468 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8469 {
8470 int type = oldLoc.GetType();
8472 {
8473 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8474 }
8476 {
8477 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8478 }
8479 }
8480 if (!m_OldLocation)
8481 {
8482 m_OldLocation = new InventoryLocation;
8483 }
8484 m_OldLocation.Copy(oldLoc);
8485 }
8486 else
8487 {
8488 if (m_OldLocation)
8489 {
8490 m_OldLocation.Reset();
8491 }
8492 }
8493
8495 }
8496 else
8497 {
8498 if (new_player)
8499 {
8500 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8501 if (res_index >= 0)
8502 {
8503 InventoryLocation il = new InventoryLocation;
8504 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8506 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8509 {
8510 il.
GetParent().GetOnReleaseLock().Invoke(it);
8511 }
8513 {
8515 }
8516
8517 }
8518 }
8520 {
8521
8523 }
8524
8525 if (m_OldLocation)
8526 {
8527 m_OldLocation.Reset();
8528 }
8529 }
8530 }
8531
8532 override void EOnContact(IEntity other, Contact extra)
8533 {
8535 {
8536 int liquidType = -1;
8538 if (impactSpeed > 0.0)
8539 {
8541 #ifndef SERVER
8543 #else
8545 SetSynchDirty();
8546 #endif
8548 }
8549 }
8550
8551 #ifdef SERVER
8552 if (GetCompEM() && GetCompEM().IsPlugged())
8553 {
8554 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8555 GetCompEM().UnplugThis();
8556 }
8557 #endif
8558 }
8559
8561
8563 {
8565 }
8566
8568 {
8569
8570 }
8571
8573 {
8574 super.OnItemLocationChanged(old_owner, new_owner);
8575
8576 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8577 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8578
8579 if (!relatedPlayer && playerNew)
8580 relatedPlayer = playerNew;
8581
8582 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8583 {
8585 if (actionMgr)
8586 {
8587 ActionBase currentAction = actionMgr.GetRunningAction();
8588 if (currentAction)
8590 }
8591 }
8592
8593 Man ownerPlayerOld = null;
8594 Man ownerPlayerNew = null;
8595
8596 if (old_owner)
8597 {
8598 if (old_owner.
IsMan())
8599 {
8600 ownerPlayerOld = Man.Cast(old_owner);
8601 }
8602 else
8603 {
8604 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8605 }
8606 }
8607 else
8608 {
8610 {
8612
8613 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8614 {
8615 GetCompEM().UnplugThis();
8616 }
8617 }
8618 }
8619
8620 if (new_owner)
8621 {
8622 if (new_owner.
IsMan())
8623 {
8624 ownerPlayerNew = Man.Cast(new_owner);
8625 }
8626 else
8627 {
8628 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8629 }
8630 }
8631
8632 if (ownerPlayerOld != ownerPlayerNew)
8633 {
8634 if (ownerPlayerOld)
8635 {
8636 array<EntityAI> subItemsExit = new array<EntityAI>;
8638 for (int i = 0; i < subItemsExit.Count(); i++)
8639 {
8642 }
8643 }
8644
8645 if (ownerPlayerNew)
8646 {
8647 array<EntityAI> subItemsEnter = new array<EntityAI>;
8649 for (int j = 0; j < subItemsEnter.Count(); j++)
8650 {
8653 }
8654 }
8655 }
8656 else if (ownerPlayerNew != null)
8657 {
8658 PlayerBase nplayer;
8659 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8660 {
8661 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8663 for (int k = 0; k < subItemsUpdate.Count(); k++)
8664 {
8666 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8667 }
8668 }
8669 }
8670
8671 if (old_owner)
8672 old_owner.OnChildItemRemoved(this);
8673 if (new_owner)
8674 new_owner.OnChildItemReceived(this);
8675 }
8676
8677
8679 {
8680 super.EEDelete(parent);
8681 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8682 if (player)
8683 {
8685
8686 if (player.IsAlive())
8687 {
8688 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8689 if (r_index >= 0)
8690 {
8691 InventoryLocation r_il = new InventoryLocation;
8692 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8693
8694 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8697 {
8698 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8699 }
8701 {
8702 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8703 }
8704
8705 }
8706
8707 player.RemoveQuickBarEntityShortcut(this);
8708 }
8709 }
8710 }
8711
8713 {
8714 super.EEKilled(killer);
8715
8718 {
8719 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8720 {
8721 if (IsMagazine())
8722 {
8723 if (Magazine.Cast(this).GetAmmoCount() > 0)
8724 {
8726 }
8727 }
8728 else
8729 {
8731 }
8732 }
8733 }
8734 }
8735
8737 {
8738 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8739
8740 super.OnWasAttached(parent, slot_id);
8741
8744
8746 }
8747
8749 {
8750 super.OnWasDetached(parent, slot_id);
8751
8754 }
8755
8757 {
8758 int idx;
8761
8762 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8763 if (inventory_slots.Count() < 1)
8764 {
8765 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8766 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8767 }
8768 else
8769 {
8770 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8771 }
8772
8773 idx = inventory_slots.Find(slot);
8774 if (idx < 0)
8775 return "";
8776
8777 return attach_types.Get(idx);
8778 }
8779
8781 {
8782 int idx = -1;
8783 string slot;
8784
8787
8788 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8789 if (inventory_slots.Count() < 1)
8790 {
8791 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8792 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8793 }
8794 else
8795 {
8796 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8797 if (detach_types.Count() < 1)
8798 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8799 }
8800
8801 for (int i = 0; i < inventory_slots.Count(); i++)
8802 {
8803 slot = inventory_slots.Get(i);
8804 }
8805
8806 if (slot != "")
8807 {
8808 if (detach_types.Count() == 1)
8809 idx = 0;
8810 else
8811 idx = inventory_slots.Find(slot);
8812 }
8813 if (idx < 0)
8814 return "";
8815
8816 return detach_types.Get(idx);
8817 }
8818
8820 {
8821
8823
8824
8825 float min_time = 1;
8826 float max_time = 3;
8827 float delay = Math.RandomFloat(min_time, max_time);
8828
8829 explode_timer.Run(delay, this, "DoAmmoExplosion");
8830 }
8831
8833 {
8834 Magazine magazine = Magazine.Cast(this);
8835 int pop_sounds_count = 6;
8836 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8837
8838
8839 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8840 string sound_name = pop_sounds[ sound_idx ];
8842
8843
8844 magazine.ServerAddAmmoCount(-1);
8845
8846
8847 float min_temp_to_explode = 100;
8848
8849 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8850 {
8852 }
8853 }
8854
8855
8856 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8857 {
8858 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8859
8860 const int CHANCE_DAMAGE_CARGO = 4;
8861 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8862 const int CHANCE_DAMAGE_NOTHING = 2;
8863
8865 {
8866 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8867 int chances;
8868 int rnd;
8869
8870 if (GetInventory().GetCargo())
8871 {
8872 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8873 rnd = Math.RandomInt(0,chances);
8874
8875 if (rnd < CHANCE_DAMAGE_CARGO)
8876 {
8878 }
8879 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8880 {
8882 }
8883 }
8884 else
8885 {
8886 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8887 rnd = Math.RandomInt(0,chances);
8888
8889 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8890 {
8892 }
8893 }
8894 }
8895 }
8896
8898 {
8899 if (GetInventory().GetCargo())
8900 {
8901 int item_count = GetInventory().GetCargo().GetItemCount();
8902 if (item_count > 0)
8903 {
8904 int random_pick = Math.RandomInt(0, item_count);
8906 if (!item.IsExplosive())
8907 {
8908 item.AddHealth("","",damage);
8909 return true;
8910 }
8911 }
8912 }
8913 return false;
8914 }
8915
8917 {
8918 int attachment_count = GetInventory().AttachmentCount();
8919 if (attachment_count > 0)
8920 {
8921 int random_pick = Math.RandomInt(0, attachment_count);
8922 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8923 if (!attachment.IsExplosive())
8924 {
8925 attachment.AddHealth("","",damage);
8926 return true;
8927 }
8928 }
8929 return false;
8930 }
8931
8933 {
8935 }
8936
8938 {
8940 return GetInventory().CanRemoveEntity();
8941
8942 return false;
8943 }
8944
8946 {
8948 return;
8949
8951 {
8952 if (ScriptInputUserData.CanStoreInputUserData())
8953 {
8954 ScriptInputUserData ctx = new ScriptInputUserData;
8959 ctx.
Write(destination_entity);
8963 }
8964 }
8965 else if (!
GetGame().IsMultiplayer())
8966 {
8968 }
8969 }
8970
8972 {
8974 return;
8975
8976 float split_quantity_new;
8980 InventoryLocation loc = new InventoryLocation;
8981
8982 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8983 {
8985 split_quantity_new = stack_max;
8986 else
8988
8989 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8990 if (new_item)
8991 {
8992 new_item.SetResultOfSplit(true);
8993 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8995 new_item.SetQuantity(split_quantity_new);
8996 }
8997 }
8998 else if (destination_entity && slot_id == -1)
8999 {
9000 if (quantity > stack_max)
9001 split_quantity_new = stack_max;
9002 else
9003 split_quantity_new = quantity;
9004
9006 {
9009 }
9010
9011 if (new_item)
9012 {
9013 new_item.SetResultOfSplit(true);
9014 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9016 new_item.SetQuantity(split_quantity_new);
9017 }
9018 }
9019 else
9020 {
9021 if (stack_max != 0)
9022 {
9024 {
9026 }
9027
9028 if (split_quantity_new == 0)
9029 {
9030 if (!
GetGame().IsMultiplayer())
9031 player.PhysicalPredictiveDropItem(this);
9032 else
9033 player.ServerDropEntity(this);
9034 return;
9035 }
9036
9038
9039 if (new_item)
9040 {
9041 new_item.SetResultOfSplit(true);
9042 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9044 new_item.SetQuantity(stack_max);
9045 new_item.PlaceOnSurface();
9046 }
9047 }
9048 }
9049 }
9050
9052 {
9054 return;
9055
9056 float split_quantity_new;
9060 InventoryLocation loc = new InventoryLocation;
9061
9062 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9063 {
9065 split_quantity_new = stack_max;
9066 else
9068
9069 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9070 if (new_item)
9071 {
9072 new_item.SetResultOfSplit(true);
9073 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9075 new_item.SetQuantity(split_quantity_new);
9076 }
9077 }
9078 else if (destination_entity && slot_id == -1)
9079 {
9080 if (quantity > stack_max)
9081 split_quantity_new = stack_max;
9082 else
9083 split_quantity_new = quantity;
9084
9086 {
9089 }
9090
9091 if (new_item)
9092 {
9093 new_item.SetResultOfSplit(true);
9094 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9096 new_item.SetQuantity(split_quantity_new);
9097 }
9098 }
9099 else
9100 {
9101 if (stack_max != 0)
9102 {
9104 {
9106 }
9107
9109
9110 if (new_item)
9111 {
9112 new_item.SetResultOfSplit(true);
9113 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9115 new_item.SetQuantity(stack_max);
9116 new_item.PlaceOnSurface();
9117 }
9118 }
9119 }
9120 }
9121
9123 {
9125 return;
9126
9128 {
9129 if (ScriptInputUserData.CanStoreInputUserData())
9130 {
9131 ScriptInputUserData ctx = new ScriptInputUserData;
9136 dst.WriteToContext(ctx);
9138 }
9139 }
9140 else if (!
GetGame().IsMultiplayer())
9141 {
9143 }
9144 }
9145
9147 {
9149 return;
9150
9152 {
9153 if (ScriptInputUserData.CanStoreInputUserData())
9154 {
9155 ScriptInputUserData ctx = new ScriptInputUserData;
9160 ctx.
Write(destination_entity);
9166 }
9167 }
9168 else if (!
GetGame().IsMultiplayer())
9169 {
9171 }
9172 }
9173
9175 {
9177 }
9178
9180 {
9182 return this;
9183
9185 float split_quantity_new;
9187 if (dst.IsValid())
9188 {
9189 int slot_id = dst.GetSlot();
9191
9192 if (quantity > stack_max)
9193 split_quantity_new = stack_max;
9194 else
9195 split_quantity_new = quantity;
9196
9198
9199 if (new_item)
9200 {
9201 new_item.SetResultOfSplit(true);
9202 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9205 }
9206
9207 return new_item;
9208 }
9209
9210 return null;
9211 }
9212
9214 {
9216 return;
9217
9219 float split_quantity_new;
9221 if (destination_entity)
9222 {
9224 if (quantity > stackable)
9225 split_quantity_new = stackable;
9226 else
9227 split_quantity_new = quantity;
9228
9229 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9230 if (new_item)
9231 {
9232 new_item.SetResultOfSplit(true);
9233 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9235 new_item.SetQuantity(split_quantity_new);
9236 }
9237 }
9238 }
9239
9241 {
9243 return;
9244
9246 {
9247 if (ScriptInputUserData.CanStoreInputUserData())
9248 {
9249 ScriptInputUserData ctx = new ScriptInputUserData;
9254 ItemBase destination_entity =
this;
9255 ctx.
Write(destination_entity);
9259 }
9260 }
9261 else if (!
GetGame().IsMultiplayer())
9262 {
9264 }
9265 }
9266
9268 {
9270 return;
9271
9273 float split_quantity_new;
9275 if (player)
9276 {
9278 if (quantity > stackable)
9279 split_quantity_new = stackable;
9280 else
9281 split_quantity_new = quantity;
9282
9283 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9284 new_item =
ItemBase.Cast(in_hands);
9285 if (new_item)
9286 {
9287 new_item.SetResultOfSplit(true);
9288 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9290 new_item.SetQuantity(split_quantity_new);
9291 }
9292 }
9293 }
9294
9296 {
9298 return;
9299
9301 float split_quantity_new = Math.Floor(quantity * 0.5);
9302
9304
9305 if (new_item)
9306 {
9307 if (new_item.GetQuantityMax() < split_quantity_new)
9308 {
9309 split_quantity_new = new_item.GetQuantityMax();
9310 }
9311
9312 new_item.SetResultOfSplit(true);
9313 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9314
9316 {
9319 }
9320 else
9321 {
9324 }
9325 }
9326 }
9327
9329 {
9331 return;
9332
9334 float split_quantity_new = Math.Floor(quantity / 2);
9335
9336 InventoryLocation invloc = new InventoryLocation;
9338
9340 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9341
9342 if (new_item)
9343 {
9344 if (new_item.GetQuantityMax() < split_quantity_new)
9345 {
9346 split_quantity_new = new_item.GetQuantityMax();
9347 }
9349 {
9352 }
9353 else
9354 {
9357 }
9358 }
9359 }
9360
9363 {
9364 SetWeightDirty();
9366
9367 if (parent)
9368 parent.OnAttachmentQuantityChangedEx(this, delta);
9369
9371 {
9373 {
9375 }
9377 {
9378 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9380 }
9381 }
9382
9383 }
9384
9387 {
9388
9389 }
9390
9393 {
9395 }
9396
9398 {
9399 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9400
9402 {
9403 if (newLevel == GameConstants.STATE_RUINED)
9404 {
9406 EntityAI parent = GetHierarchyParent();
9407 if (parent && parent.IsFireplace())
9408 {
9409 CargoBase cargo = GetInventory().GetCargo();
9410 if (cargo)
9411 {
9413 {
9415 }
9416 }
9417 }
9418 }
9419
9421 {
9422
9424 return;
9425 }
9426
9427 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9428 {
9430 }
9431 }
9432 }
9433
9434
9436 {
9437 super.OnRightClick();
9438
9440 {
9442 {
9443 if (ScriptInputUserData.CanStoreInputUserData())
9444 {
9445 vector m4[4];
9447
9448 EntityAI root = GetHierarchyRoot();
9449
9450 InventoryLocation dst = new InventoryLocation;
9452 {
9453 if (root)
9454 {
9455 root.GetTransform(m4);
9457 }
9458 else
9459 GetInventory().GetCurrentInventoryLocation(dst);
9460 }
9461 else
9462 {
9464
9465
9466 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9467 {
9468 if (root)
9469 {
9470 root.GetTransform(m4);
9472 }
9473 else
9474 GetInventory().GetCurrentInventoryLocation(dst);
9475 }
9476 else
9477 {
9478 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9479 }
9480 }
9481
9482 ScriptInputUserData ctx = new ScriptInputUserData;
9490 }
9491 }
9492 else if (!
GetGame().IsMultiplayer())
9493 {
9495 }
9496 }
9497 }
9498
9499 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9500 {
9501
9502 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9503 return false;
9504
9505 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9506 return false;
9507
9508
9510 return false;
9511
9512
9513 Magazine mag = Magazine.Cast(this);
9514 if (mag)
9515 {
9516 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9517 return false;
9518
9519 if (stack_max_limit)
9520 {
9521 Magazine other_mag = Magazine.Cast(other_item);
9522 if (other_item)
9523 {
9524 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9525 return false;
9526 }
9527
9528 }
9529 }
9530 else
9531 {
9532
9534 return false;
9535
9537 return false;
9538 }
9539
9540 PlayerBase player = null;
9541 if (CastTo(player, GetHierarchyRootPlayer()))
9542 {
9543 if (player.GetInventory().HasAttachment(this))
9544 return false;
9545
9546 if (player.IsItemsToDelete())
9547 return false;
9548 }
9549
9550 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9551 return false;
9552
9553 int slotID;
9555 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9556 return false;
9557
9558 return true;
9559 }
9560
9562 {
9564 }
9565
9567 {
9568 return m_IsResultOfSplit;
9569 }
9570
9572 {
9573 m_IsResultOfSplit = value;
9574 }
9575
9577 {
9579 }
9580
9582 {
9583 float other_item_quantity = other_item.GetQuantity();
9584 float this_free_space;
9585
9587
9589
9590 if (other_item_quantity > this_free_space)
9591 {
9592 return this_free_space;
9593 }
9594 else
9595 {
9596 return other_item_quantity;
9597 }
9598 }
9599
9601 {
9603 }
9604
9606 {
9608 return;
9609
9610 if (!IsMagazine() && other_item)
9611 {
9613 if (quantity_used != 0)
9614 {
9615 float hp1 = GetHealth01("","");
9616 float hp2 = other_item.GetHealth01("","");
9617 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9618 hpResult = hpResult / (
GetQuantity() + quantity_used);
9619
9620 hpResult *= GetMaxHealth();
9621 Math.Round(hpResult);
9622 SetHealth("", "Health", hpResult);
9623
9625 other_item.AddQuantity(-quantity_used);
9626 }
9627 }
9629 }
9630
9632 {
9633 #ifdef SERVER
9634 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9635 GetHierarchyParent().IncreaseLifetimeUp();
9636 #endif
9637 };
9638
9640 {
9641 PlayerBase p = PlayerBase.Cast(player);
9642
9643 array<int> recipesIds = p.m_Recipes;
9644 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9645 if (moduleRecipesManager)
9646 {
9647 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9648 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9649 }
9650
9651 for (int i = 0;i < recipesIds.Count(); i++)
9652 {
9653 int key = recipesIds.Get(i);
9654 string recipeName = moduleRecipesManager.GetRecipeName(key);
9656 }
9657 }
9658
9659
9660 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9661 {
9662 super.GetDebugActions(outputList);
9663
9664
9669
9670
9674
9678
9679
9682
9683
9685 {
9688 }
9689
9691
9694
9698 }
9699
9700
9701
9702
9704 {
9705 super.OnAction(action_id, player, ctx);
9706 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9707 {
9708 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9709 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9710 PlayerBase p = PlayerBase.Cast(player);
9711 if (
EActions.RECIPES_RANGE_START < 1000)
9712 {
9713 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9714 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9715 }
9716 }
9717 #ifndef SERVER
9718 else if (action_id ==
EActions.WATCH_PLAYER)
9719 {
9720 PluginDeveloper.SetDeveloperItemClientEx(player);
9721 }
9722 #endif
9724 {
9725 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9726 {
9727 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9728 OnDebugButtonPressServer(id + 1);
9729 }
9730
9731 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9732 {
9733 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9735 }
9736
9737 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9738 {
9739 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9741 }
9742
9743 else if (action_id ==
EActions.ADD_QUANTITY)
9744 {
9745 if (IsMagazine())
9746 {
9747 Magazine mag = Magazine.Cast(this);
9748 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9749 }
9750 else
9751 {
9753 }
9754
9755 if (m_EM)
9756 {
9757 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9758 }
9759
9760 }
9761
9762 else if (action_id ==
EActions.REMOVE_QUANTITY)
9763 {
9764 if (IsMagazine())
9765 {
9766 Magazine mag2 = Magazine.Cast(this);
9767 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9768 }
9769 else
9770 {
9772 }
9773 if (m_EM)
9774 {
9775 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9776 }
9777
9778 }
9779
9780 else if (action_id ==
EActions.SET_QUANTITY_0)
9781 {
9783
9784 if (m_EM)
9785 {
9786 m_EM.SetEnergy(0);
9787 }
9788 }
9789
9790 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9791 {
9793
9794 if (m_EM)
9795 {
9796 m_EM.SetEnergy(m_EM.GetEnergyMax());
9797 }
9798 }
9799
9800 else if (action_id ==
EActions.ADD_HEALTH)
9801 {
9802 AddHealth("","",GetMaxHealth("","Health")/5);
9803 }
9804 else if (action_id ==
EActions.REMOVE_HEALTH)
9805 {
9806 AddHealth("","",-GetMaxHealth("","Health")/5);
9807 }
9808 else if (action_id ==
EActions.DESTROY_HEALTH)
9809 {
9810 SetHealth01("","",0);
9811 }
9812 else if (action_id ==
EActions.WATCH_ITEM)
9813 {
9815 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9816 #ifdef DEVELOPER
9817 SetDebugDeveloper_item(this);
9818 #endif
9819 }
9820
9821 else if (action_id ==
EActions.ADD_TEMPERATURE)
9822 {
9823 AddTemperature(20);
9824
9825 }
9826
9827 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9828 {
9829 AddTemperature(-20);
9830
9831 }
9832
9833 else if (action_id ==
EActions.FLIP_FROZEN)
9834 {
9835 SetFrozen(!GetIsFrozen());
9836
9837 }
9838
9839 else if (action_id ==
EActions.ADD_WETNESS)
9840 {
9842
9843 }
9844
9845 else if (action_id ==
EActions.REMOVE_WETNESS)
9846 {
9848
9849 }
9850
9851 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9852 {
9855
9856
9857 }
9858
9859 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9860 {
9863 }
9864
9865 else if (action_id ==
EActions.MAKE_SPECIAL)
9866 {
9867 auto debugParams = DebugSpawnParams.WithPlayer(player);
9868 OnDebugSpawnEx(debugParams);
9869 }
9870
9871 else if (action_id ==
EActions.DELETE)
9872 {
9873 Delete();
9874 }
9875
9876 }
9877
9878
9879 return false;
9880 }
9881
9882
9883
9884
9888
9891
9892
9893
9895 {
9896 return false;
9897 }
9898
9899
9901 {
9902 return true;
9903 }
9904
9905
9907 {
9908 return true;
9909 }
9910
9911
9912
9914 {
9915 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9917 }
9918
9921 {
9922 return null;
9923 }
9924
9926 {
9927 return false;
9928 }
9929
9931 {
9932 return false;
9933 }
9934
9938
9939
9941 {
9942 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9943 return module_repairing.CanRepair(this, item_repair_kit);
9944 }
9945
9946
9947 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9948 {
9949 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9950 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9951 }
9952
9953
9955 {
9956
9957
9958
9959
9960
9961
9962
9963
9964 return 1;
9965 }
9966
9967
9968
9970 {
9972 }
9973
9974
9975
9977 {
9979 }
9980
9981
9990 {
9991 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9992
9993 if (player)
9994 {
9995 player.MessageStatus(text);
9996 }
9997 }
9998
9999
10008 {
10009 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10010
10011 if (player)
10012 {
10013 player.MessageAction(text);
10014 }
10015 }
10016
10017
10026 {
10027 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10028
10029 if (player)
10030 {
10031 player.MessageFriendly(text);
10032 }
10033 }
10034
10035
10044 {
10045 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10046
10047 if (player)
10048 {
10049 player.MessageImportant(text);
10050 }
10051 }
10052
10054 {
10055 return true;
10056 }
10057
10058
10059 override bool KindOf(
string tag)
10060 {
10061 bool found = false;
10062 string item_name = this.
GetType();
10065
10066 int array_size = item_tag_array.Count();
10067 for (int i = 0; i < array_size; i++)
10068 {
10069 if (item_tag_array.Get(i) == tag)
10070 {
10071 found = true;
10072 break;
10073 }
10074 }
10075 return found;
10076 }
10077
10078
10080 {
10081
10082 super.OnRPC(sender, rpc_type,ctx);
10083
10084
10085 switch (rpc_type)
10086 {
10087 #ifndef SERVER
10088 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10089 Param2<bool, string> p = new Param2<bool, string>(false, "");
10090
10092 return;
10093
10094 bool play = p.param1;
10095 string soundSet = p.param2;
10096
10097 if (play)
10098 {
10100 {
10102 {
10104 }
10105 }
10106 else
10107 {
10109 }
10110 }
10111 else
10112 {
10114 }
10115
10116 break;
10117 #endif
10118
10119 }
10120
10122 {
10124 }
10125 }
10126
10127
10128
10129
10131 {
10132 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10133 return plugin.GetID(
name);
10134 }
10135
10137 {
10138 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10139 return plugin.GetName(id);
10140 }
10141
10144 {
10145
10146
10147 int varFlags;
10148 if (!ctx.
Read(varFlags))
10149 return;
10150
10151 if (varFlags & ItemVariableFlags.FLOAT)
10152 {
10154 }
10155 }
10156
10158 {
10159
10160 super.SerializeNumericalVars(floats_out);
10161
10162
10163
10165 {
10167 }
10168
10170 {
10172 }
10173
10175 {
10177 }
10178
10180 {
10185 }
10186
10188 {
10190 }
10191 }
10192
10194 {
10195
10196 super.DeSerializeNumericalVars(floats);
10197
10198
10199 int index = 0;
10200 int mask = Math.Round(floats.Get(index));
10201
10202 index++;
10203
10205 {
10207 {
10209 }
10210 else
10211 {
10212 float quantity = floats.Get(index);
10213 SetQuantity(quantity,
true,
false,
false,
false);
10214 }
10215 index++;
10216 }
10217
10219 {
10220 float wet = floats.Get(index);
10222 index++;
10223 }
10224
10226 {
10227 int liquidtype = Math.Round(floats.Get(index));
10229 index++;
10230 }
10231
10233 {
10235 index++;
10237 index++;
10239 index++;
10241 index++;
10242 }
10243
10245 {
10246 int cleanness = Math.Round(floats.Get(index));
10248 index++;
10249 }
10250 }
10251
10253 {
10254 super.WriteVarsToCTX(ctx);
10255
10256
10258 {
10260 }
10261
10263 {
10265 }
10266
10268 {
10270 }
10271
10273 {
10274 int r,g,b,a;
10280 }
10281
10283 {
10285 }
10286 }
10287
10289 {
10290 if (!super.ReadVarsFromCTX(ctx,version))
10291 return false;
10292
10293 int intValue;
10294 float value;
10295
10296 if (version < 140)
10297 {
10298 if (!ctx.
Read(intValue))
10299 return false;
10300
10301 m_VariablesMask = intValue;
10302 }
10303
10305 {
10306 if (!ctx.
Read(value))
10307 return false;
10308
10310 {
10312 }
10313 else
10314 {
10316 }
10317 }
10318
10319 if (version < 140)
10320 {
10322 {
10323 if (!ctx.
Read(value))
10324 return false;
10325 SetTemperatureDirect(value);
10326 }
10327 }
10328
10330 {
10331 if (!ctx.
Read(value))
10332 return false;
10334 }
10335
10337 {
10338 if (!ctx.
Read(intValue))
10339 return false;
10341 }
10342
10344 {
10345 int r,g,b,a;
10347 return false;
10349 return false;
10351 return false;
10353 return false;
10354
10356 }
10357
10359 {
10360 if (!ctx.
Read(intValue))
10361 return false;
10363 }
10364
10365 if (version >= 138 && version < 140)
10366 {
10368 {
10369 if (!ctx.
Read(intValue))
10370 return false;
10371 SetFrozen(intValue);
10372 }
10373 }
10374
10375 return true;
10376 }
10377
10378
10380 {
10383 {
10385 }
10386
10387 if (!super.OnStoreLoad(ctx, version))
10388 {
10390 return false;
10391 }
10392
10393 if (version >= 114)
10394 {
10395 bool hasQuickBarIndexSaved;
10396
10397 if (!ctx.
Read(hasQuickBarIndexSaved))
10398 {
10400 return false;
10401 }
10402
10403 if (hasQuickBarIndexSaved)
10404 {
10405 int itmQBIndex;
10406
10407
10408 if (!ctx.
Read(itmQBIndex))
10409 {
10411 return false;
10412 }
10413
10414 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10415 if (itmQBIndex != -1 && parentPlayer)
10416 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10417 }
10418 }
10419 else
10420 {
10421
10422 PlayerBase player;
10423 int itemQBIndex;
10424 if (version ==
int.
MAX)
10425 {
10426 if (!ctx.
Read(itemQBIndex))
10427 {
10429 return false;
10430 }
10431 }
10432 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10433 {
10434
10435 if (!ctx.
Read(itemQBIndex))
10436 {
10438 return false;
10439 }
10440 if (itemQBIndex != -1 && player)
10441 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10442 }
10443 }
10444
10445 if (version < 140)
10446 {
10447
10448 if (!LoadVariables(ctx, version))
10449 {
10451 return false;
10452 }
10453 }
10454
10455
10457 {
10459 return false;
10460 }
10461 if (version >= 132)
10462 {
10464 if (raib)
10465 {
10467 {
10469 return false;
10470 }
10471 }
10472 }
10473
10475 return true;
10476 }
10477
10478
10479
10481 {
10482 super.OnStoreSave(ctx);
10483
10484 PlayerBase player;
10485 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10486 {
10488
10489 int itemQBIndex = -1;
10490 itemQBIndex = player.FindQuickBarEntityIndex(this);
10491 ctx.
Write(itemQBIndex);
10492 }
10493 else
10494 {
10496 }
10497
10499
10501 if (raib)
10502 {
10504 }
10505 }
10506
10507
10509 {
10510 super.AfterStoreLoad();
10511
10513 {
10515 }
10516
10518 {
10521 }
10522 }
10523
10525 {
10526 super.EEOnAfterLoad();
10527
10529 {
10531 }
10532
10535 }
10536
10538 {
10539 return false;
10540 }
10541
10542
10543
10545 {
10547 {
10548 #ifdef PLATFORM_CONSOLE
10549
10551 {
10553 if (menu)
10554 {
10556 }
10557 }
10558 #endif
10559 }
10560
10562 {
10565 }
10566
10568 {
10569 SetWeightDirty();
10571 }
10573 {
10576 }
10577
10579 {
10582 }
10584 {
10587 }
10588
10589 super.OnVariablesSynchronized();
10590 }
10591
10592
10593
10595 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10596 {
10597 if (!IsServerCheck(allow_client))
10598 return false;
10599
10601 return false;
10602
10605
10606 if (value <= (min + 0.001))
10607 value = min;
10608
10609 if (value == min)
10610 {
10611 if (destroy_config)
10612 {
10613 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10614 if (dstr)
10615 {
10617 this.Delete();
10618 return true;
10619 }
10620 }
10621 else if (destroy_forced)
10622 {
10624 this.Delete();
10625 return true;
10626 }
10627
10629 }
10630
10633
10635 {
10637
10638 if (delta)
10640 }
10641
10643
10644 return false;
10645 }
10646
10647
10649 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10650 {
10652 }
10653
10655 {
10658 }
10659
10661 {
10664 }
10665
10668 {
10669 float value_clamped = Math.Clamp(value, 0, 1);
10671 SetQuantity(result, destroy_config, destroy_forced);
10672 }
10673
10674
10677 {
10679 }
10680
10682 {
10684 }
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10696 {
10697 int slot = -1;
10698 if (GetInventory())
10699 {
10700 InventoryLocation il = new InventoryLocation;
10701 GetInventory().GetCurrentInventoryLocation(il);
10703 }
10704
10706 }
10707
10709 {
10710 float quantity_max = 0;
10711
10713 {
10714 if (attSlotID != -1)
10715 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10716
10717 if (quantity_max <= 0)
10719 }
10720
10721 if (quantity_max <= 0)
10723
10724 return quantity_max;
10725 }
10726
10728 {
10730 }
10731
10733 {
10735 }
10736
10737
10739 {
10741 }
10742
10744 {
10746 }
10747
10749 {
10751 }
10752
10753
10755 {
10756
10757 float weightEx = GetWeightEx();
10758 float special = GetInventoryAndCargoWeight();
10759 return weightEx - special;
10760 }
10761
10762
10764 {
10766 }
10767
10769 {
10771 {
10772 #ifdef DEVELOPER
10773 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10774 {
10775 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10777 }
10778 #endif
10779
10780 return GetQuantity() * GetConfigWeightModified();
10781 }
10782 else if (HasEnergyManager())
10783 {
10784 #ifdef DEVELOPER
10785 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10786 {
10787 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10788 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10789 }
10790 #endif
10791 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10792 }
10793 else
10794 {
10795 #ifdef DEVELOPER
10796 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10797 {
10798 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10799 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10800 }
10801 #endif
10802 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10803 }
10804 }
10805
10808 {
10809 int item_count = 0;
10811
10812 if (GetInventory().GetCargo() != NULL)
10813 {
10814 item_count = GetInventory().GetCargo().GetItemCount();
10815 }
10816
10817 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10818 {
10819 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10820 if (item)
10821 item_count += item.GetNumberOfItems();
10822 }
10823 return item_count;
10824 }
10825
10828 {
10829 float weight = 0;
10830 float wetness = 1;
10831 if (include_wetness)
10834 {
10835 weight = wetness * m_ConfigWeight;
10836 }
10838 {
10839 weight = 1;
10840 }
10841 return weight;
10842 }
10843
10844
10845
10847 {
10848 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10849 {
10850 GameInventory inv = GetInventory();
10851 array<EntityAI> items = new array<EntityAI>;
10853 for (int i = 0; i < items.Count(); i++)
10854 {
10856 if (item)
10857 {
10859 }
10860 }
10861 }
10862 }
10863
10864
10865
10866
10868 {
10869 float energy = 0;
10870 if (HasEnergyManager())
10871 {
10872 energy = GetCompEM().GetEnergy();
10873 }
10874 return energy;
10875 }
10876
10877
10879 {
10880 super.OnEnergyConsumed();
10881
10883 }
10884
10886 {
10887 super.OnEnergyAdded();
10888
10890 }
10891
10892
10894 {
10895 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10896 {
10898 {
10899 float energy_0to1 = GetCompEM().GetEnergy0To1();
10901 }
10902 }
10903 }
10904
10905
10907 {
10908 return ConfigGetFloat("heatIsolation");
10909 }
10910
10912 {
10914 }
10915
10917 {
10918 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10919 if (
GetGame().ConfigIsExisting(paramPath))
10921
10922 return 0.0;
10923 }
10924
10926 {
10927 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10928 if (
GetGame().ConfigIsExisting(paramPath))
10930
10931 return 0.0;
10932 }
10933
10934 override void SetWet(
float value,
bool allow_client =
false)
10935 {
10936 if (!IsServerCheck(allow_client))
10937 return;
10938
10941
10943
10944 m_VarWet = Math.Clamp(value, min, max);
10945
10947 {
10950 }
10951 }
10952
10953 override void AddWet(
float value)
10954 {
10956 }
10957
10959 {
10961 }
10962
10964 {
10966 }
10967
10969 {
10971 }
10972
10974 {
10976 }
10977
10979 {
10981 }
10982
10983 override void OnWetChanged(
float newVal,
float oldVal)
10984 {
10987 if (newLevel != oldLevel)
10988 {
10990 }
10991 }
10992
10994 {
10995 SetWeightDirty();
10996 }
10997
10999 {
11000 return GetWetLevelInternal(
m_VarWet);
11001 }
11002
11003
11004
11006 {
11008 }
11009
11011 {
11013 }
11014
11016 {
11018 }
11019
11021 {
11023 }
11024
11025
11026
11028 {
11029 if (ConfigIsExisting("itemModelLength"))
11030 {
11031 return ConfigGetFloat("itemModelLength");
11032 }
11033 return 0;
11034 }
11035
11037 {
11038 if (ConfigIsExisting("itemAttachOffset"))
11039 {
11040 return ConfigGetFloat("itemAttachOffset");
11041 }
11042 return 0;
11043 }
11044
11045 override void SetCleanness(
int value,
bool allow_client =
false)
11046 {
11047 if (!IsServerCheck(allow_client))
11048 return;
11049
11051
11053
11056 }
11057
11059 {
11061 }
11062
11064 {
11065 return true;
11066 }
11067
11068
11069
11070
11072 {
11074 }
11075
11077 {
11079 }
11080
11081
11082
11083
11084 override void SetColor(
int r,
int g,
int b,
int a)
11085 {
11091 }
11093 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11094 {
11099 }
11100
11102 {
11104 }
11105
11108 {
11109 int r,g,b,a;
11111 r = r/255;
11112 g = g/255;
11113 b = b/255;
11114 a = a/255;
11115 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11116 }
11117
11118
11119
11120 override void SetLiquidType(
int value,
bool allow_client =
false)
11121 {
11122 if (!IsServerCheck(allow_client))
11123 return;
11124
11129 }
11130
11132 {
11133 return ConfigGetInt("varLiquidTypeInit");
11134 }
11135
11137 {
11139 }
11140
11142 {
11144 SetFrozen(false);
11145 }
11146
11149 {
11150 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11151 }
11152
11153
11156 {
11157 PlayerBase nplayer;
11158 if (PlayerBase.CastTo(nplayer, player))
11159 {
11161
11162 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11163 }
11164 }
11165
11166
11169 {
11170 PlayerBase nplayer;
11171 if (PlayerBase.CastTo(nplayer,player))
11172 {
11173
11174 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11175
11176 }
11177
11178
11179 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11180
11181
11182 if (HasEnergyManager())
11183 {
11184 GetCompEM().UpdatePlugState();
11185 }
11186 }
11187
11188
11190 {
11191 super.OnPlacementStarted(player);
11192
11194 }
11195
11196 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11197 {
11199 {
11200 m_AdminLog.OnPlacementComplete(player,
this);
11201 }
11202
11203 super.OnPlacementComplete(player, position, orientation);
11204 }
11205
11206
11207
11208
11209
11211 {
11213 {
11214 return true;
11215 }
11216 else
11217 {
11218 return false;
11219 }
11220 }
11221
11222
11224 {
11226 {
11228 }
11229 }
11230
11231
11233 {
11235 }
11236
11238 {
11240 }
11241
11242 override void InsertAgent(
int agent,
float count = 1)
11243 {
11244 if (count < 1)
11245 return;
11246
11248 }
11249
11252 {
11254 }
11255
11256
11258 {
11260 }
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11304 {
11306 return false;
11307 return true;
11308 }
11309
11311 {
11312
11314 }
11315
11316
11319 {
11320 super.CheckForRoofLimited(timeTresholdMS);
11321
11323 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11324 {
11325 m_PreviousRoofTestTime = time;
11326 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11327 }
11328 }
11329
11330
11332 {
11334 {
11335 return 0;
11336 }
11337
11338 if (GetInventory().GetAttachmentSlotsCount() != 0)
11339 {
11340 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11341 if (filter)
11342 return filter.GetProtectionLevel(type, false, system);
11343 else
11344 return 0;
11345 }
11346
11347 string subclassPath, entryName;
11348
11349 switch (type)
11350 {
11352 entryName = "biological";
11353 break;
11355 entryName = "chemical";
11356 break;
11357 default:
11358 entryName = "biological";
11359 break;
11360 }
11361
11362 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11363
11365 }
11366
11367
11368
11371 {
11372 if (!IsMagazine())
11374
11376 }
11377
11378
11379
11380
11381
11386 {
11387 return true;
11388 }
11389
11391 {
11393 }
11394
11395
11396
11397
11398
11400 {
11401 if (parent)
11402 {
11403 if (parent.IsInherited(DayZInfected))
11404 return true;
11405
11406 if (!parent.IsRuined())
11407 return true;
11408 }
11409
11410 return true;
11411 }
11412
11414 {
11415 if (!super.CanPutAsAttachment(parent))
11416 {
11417 return false;
11418 }
11419
11420 if (!IsRuined() && !parent.IsRuined())
11421 {
11422 return true;
11423 }
11424
11425 return false;
11426 }
11427
11429 {
11430
11431
11432
11433
11434 return super.CanReceiveItemIntoCargo(item);
11435 }
11436
11438 {
11439
11440
11441
11442
11443 GameInventory attachmentInv = attachment.GetInventory();
11445 {
11446 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11447 return false;
11448 }
11449
11450 InventoryLocation loc = new InventoryLocation();
11451 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11452 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11453 return false;
11454
11455 return super.CanReceiveAttachment(attachment, slotId);
11456 }
11457
11459 {
11460 if (!super.CanReleaseAttachment(attachment))
11461 return false;
11462
11463 return GetInventory().AreChildrenAccessible();
11464 }
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11487 {
11488 int id = muzzle_owner.GetMuzzleID();
11489 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11490
11491 if (WPOF_array)
11492 {
11493 for (int i = 0; i < WPOF_array.Count(); i++)
11494 {
11495 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11496
11497 if (WPOF)
11498 {
11499 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11500 }
11501 }
11502 }
11503 }
11504
11505
11507 {
11508 int id = muzzle_owner.GetMuzzleID();
11510
11511 if (WPOBE_array)
11512 {
11513 for (int i = 0; i < WPOBE_array.Count(); i++)
11514 {
11515 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11516
11517 if (WPOBE)
11518 {
11519 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11520 }
11521 }
11522 }
11523 }
11524
11525
11527 {
11528 int id = muzzle_owner.GetMuzzleID();
11529 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11530
11531 if (WPOOH_array)
11532 {
11533 for (int i = 0; i < WPOOH_array.Count(); i++)
11534 {
11535 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11536
11537 if (WPOOH)
11538 {
11539 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11540 }
11541 }
11542 }
11543 }
11544
11545
11547 {
11548 int id = muzzle_owner.GetMuzzleID();
11549 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11550
11551 if (WPOOH_array)
11552 {
11553 for (int i = 0; i < WPOOH_array.Count(); i++)
11554 {
11555 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11556
11557 if (WPOOH)
11558 {
11559 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11560 }
11561 }
11562 }
11563 }
11564
11565
11567 {
11568 int id = muzzle_owner.GetMuzzleID();
11569 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11570
11571 if (WPOOH_array)
11572 {
11573 for (int i = 0; i < WPOOH_array.Count(); i++)
11574 {
11575 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11576
11577 if (WPOOH)
11578 {
11579 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11580 }
11581 }
11582 }
11583 }
11584
11585
11586
11588 {
11590 {
11591 return true;
11592 }
11593
11594 return false;
11595 }
11596
11598 {
11600 {
11601 return true;
11602 }
11603
11604 return false;
11605 }
11606
11608 {
11610 {
11611 return true;
11612 }
11613
11614 return false;
11615 }
11616
11618 {
11619 return false;
11620 }
11621
11624 {
11625 return UATimeSpent.DEFAULT_DEPLOY;
11626 }
11627
11628
11629
11630
11632 {
11634 SetSynchDirty();
11635 }
11636
11638 {
11640 }
11641
11642
11644 {
11645 return false;
11646 }
11647
11650 {
11651 string att_type = "None";
11652
11653 if (ConfigIsExisting("soundAttType"))
11654 {
11655 att_type = ConfigGetString("soundAttType");
11656 }
11657
11659 }
11660
11662 {
11664 }
11665
11666
11667
11668
11669
11673
11675 {
11678
11680 }
11681
11682
11684 {
11686 return;
11687
11689
11692
11695
11696 SoundParameters params = new SoundParameters();
11700 }
11701
11702
11704 {
11706 return;
11707
11709 SetSynchDirty();
11710
11713 }
11714
11715
11717 {
11719 return;
11720
11722 SetSynchDirty();
11723
11726 }
11727
11729 {
11731 }
11732
11734 {
11736 }
11737
11740 {
11741 if (!
GetGame().IsDedicatedServer())
11742 {
11743 if (ConfigIsExisting("attachSoundSet"))
11744 {
11745 string cfg_path = "";
11746 string soundset = "";
11747 string type_name =
GetType();
11748
11751 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11752 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11753
11754 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11755 {
11756 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11757 {
11758 if (cfg_slot_array[i] == slot_type)
11759 {
11760 soundset = cfg_soundset_array[i];
11761 break;
11762 }
11763 }
11764 }
11765
11766 if (soundset != "")
11767 {
11768 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11770 }
11771 }
11772 }
11773 }
11774
11776 {
11777
11778 }
11779
11780 void OnApply(PlayerBase player);
11781
11783 {
11784 return 1.0;
11785 };
11786
11788 {
11790 }
11791
11793 {
11795 }
11796
11798
11800 {
11801 SetDynamicPhysicsLifeTime(0.01);
11803 }
11804
11806 {
11807 array<string> zone_names = new array<string>;
11808 GetDamageZones(zone_names);
11809 for (int i = 0; i < zone_names.Count(); i++)
11810 {
11811 SetHealthMax(zone_names.Get(i),"Health");
11812 }
11813 SetHealthMax("","Health");
11814 }
11815
11818 {
11819 float global_health = GetHealth01("","Health");
11820 array<string> zones = new array<string>;
11821 GetDamageZones(zones);
11822
11823 for (int i = 0; i < zones.Count(); i++)
11824 {
11825 SetHealth01(zones.Get(i),"Health",global_health);
11826 }
11827 }
11828
11831 {
11832 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11833 }
11834
11836 {
11837 if (!hasRootAsPlayer)
11838 {
11839 if (refParentIB)
11840 {
11841
11842 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11843 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11844
11845 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11846 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11847
11850 }
11851 else
11852 {
11853
11856 }
11857 }
11858 }
11859
11861 {
11863 {
11864 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11865 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11866 {
11867 float heatPermCoef = 1.0;
11869 while (ent)
11870 {
11871 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11872 ent = ent.GetHierarchyParent();
11873 }
11874
11875 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11876 }
11877 }
11878 }
11879
11881 {
11882
11883 EntityAI parent = GetHierarchyParent();
11884 if (!parent)
11885 {
11886 hasParent = false;
11887 hasRootAsPlayer = false;
11888 }
11889 else
11890 {
11891 hasParent = true;
11892 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11893 refParentIB =
ItemBase.Cast(parent);
11894 }
11895 }
11896
11897 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11898 {
11899
11900 }
11901
11903 {
11904
11905 return false;
11906 }
11907
11909 {
11910
11911
11912 return false;
11913 }
11914
11916 {
11917
11918 return false;
11919 }
11920
11923 {
11924 return !GetIsFrozen() &&
IsOpen();
11925 }
11926
11928 {
11929 bool hasParent = false, hasRootAsPlayer = false;
11931
11932 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11933 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11934
11935 if (wwtu || foodDecay)
11936 {
11940
11941 if (processWetness || processTemperature || processDecay)
11942 {
11944
11945 if (processWetness)
11946 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11947
11948 if (processTemperature)
11950
11951 if (processDecay)
11952 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11953 }
11954 }
11955 }
11956
11959 {
11961 }
11962
11964 {
11967
11968 return super.GetTemperatureFreezeThreshold();
11969 }
11970
11972 {
11975
11976 return super.GetTemperatureThawThreshold();
11977 }
11978
11980 {
11983
11984 return super.GetItemOverheatThreshold();
11985 }
11986
11988 {
11990 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11991
11992 return super.GetTemperatureFreezeTime();
11993 }
11994
11996 {
11998 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11999
12000 return super.GetTemperatureThawTime();
12001 }
12002
12007
12009 {
12010 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12011 }
12012
12014 {
12015 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12016 }
12017
12020 {
12022 }
12023
12025 {
12027 }
12028
12030 {
12032 }
12033
12036 {
12037 return null;
12038 }
12039
12042 {
12043 return false;
12044 }
12045
12047 {
12049 {
12052 if (!trg)
12053 {
12055 explosive = this;
12056 }
12057
12058 explosive.PairRemote(trg);
12060
12061 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12062 trg.SetPersistentPairID(persistentID);
12063 explosive.SetPersistentPairID(persistentID);
12064
12065 return true;
12066 }
12067 return false;
12068 }
12069
12072 {
12073 float ret = 1.0;
12076 ret *= GetHealth01();
12077
12078 return ret;
12079 }
12080
12081 #ifdef DEVELOPER
12082 override void SetDebugItem()
12083 {
12084 super.SetDebugItem();
12085 _itemBase = this;
12086 }
12087
12089 {
12090 string text = super.GetDebugText();
12091
12093 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12094
12095 return text;
12096 }
12097 #endif
12098
12100 {
12101 return true;
12102 }
12103
12105
12107
12109 {
12112 }
12113
12114
12122
12138}
12139
12141{
12143 if (entity)
12144 {
12145 bool is_item = entity.IsInherited(
ItemBase);
12146 if (is_item && full_quantity)
12147 {
12150 }
12151 }
12152 else
12153 {
12155 return NULL;
12156 }
12157 return entity;
12158}
12159
12161{
12162 if (item)
12163 {
12164 if (health > 0)
12165 item.SetHealth("", "", health);
12166
12167 if (item.CanHaveTemperature())
12168 {
12170 if (item.CanFreeze())
12171 item.SetFrozen(false);
12172 }
12173
12174 if (item.HasEnergyManager())
12175 {
12176 if (quantity >= 0)
12177 {
12178 item.GetCompEM().SetEnergy0To1(quantity);
12179 }
12180 else
12181 {
12183 }
12184 }
12185 else if (item.IsMagazine())
12186 {
12187 Magazine mag = Magazine.Cast(item);
12188 if (quantity >= 0)
12189 {
12190 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12191 }
12192 else
12193 {
12195 }
12196
12197 }
12198 else
12199 {
12200 if (quantity >= 0)
12201 {
12202 item.SetQuantityNormalized(quantity, false);
12203 }
12204 else
12205 {
12207 }
12208
12209 }
12210 }
12211}
12212
12213#ifdef DEVELOPER
12215#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.