7369{
7371 {
7372 return true;
7373 }
7374};
7375
7376
7377
7379{
7383
7385
7388
7389
7390
7391
7392
7401
7407
7412
7417
7438 protected bool m_IsResultOfSplit
7439
7441
7446
7447
7448
7450
7454
7455
7456
7458
7461
7462
7463
7469
7470
7478
7481
7482
7484
7485
7487
7488
7493
7494
7499
7500
7502
7503
7505 {
7510
7511 if (!
GetGame().IsDedicatedServer())
7512 {
7514 {
7516
7518 {
7520 }
7521 }
7522
7525 }
7526
7527 m_OldLocation = null;
7528
7530 {
7532 }
7533
7534 if (ConfigIsExisting("headSelectionsToHide"))
7535 {
7538 }
7539
7541 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7542 {
7544 }
7545
7547
7548 m_IsResultOfSplit = false;
7549
7551 }
7552
7554 {
7555 super.InitItemVariables();
7556
7562 m_Count = ConfigGetInt(
"count");
7563
7566
7571
7574
7579
7591
7595
7596
7599 if (ConfigIsExisting("canBeSplit"))
7600 {
7603 }
7604
7606 if (ConfigIsExisting("itemBehaviour"))
7608
7609
7612 RegisterNetSyncVariableInt("m_VarLiquidType");
7613 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7614
7615 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7616 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7617 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7618
7619 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7620 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7621 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7622 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7623
7624 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7625 RegisterNetSyncVariableBool("m_IsTakeable");
7626 RegisterNetSyncVariableBool("m_IsHologram");
7627
7630 {
7633 }
7634
7636
7638 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7640
7641 }
7642
7644 {
7646 }
7647
7649 {
7652 {
7657 }
7658 }
7659
7660 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7661 {
7663 {
7666 }
7667
7669 }
7670
7672 {
7678 }
7679
7681
7683 {
7685
7686 if (!action)
7687 {
7688 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7689 return;
7690 }
7691
7693 if (!ai)
7694 {
7696 return;
7697 }
7698
7700 if (!action_array)
7701 {
7702 action_array = new array<ActionBase_Basic>;
7704 }
7705 if (LogManager.IsActionLogEnable())
7706 {
7707 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7708 }
7709
7710 if (action_array.Find(action) != -1)
7711 {
7712 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7713 }
7714 else
7715 {
7716 action_array.Insert(action);
7717 }
7718 }
7719
7721 {
7723 ActionBase action = player.GetActionManager().GetAction(actionName);
7726
7727 if (action_array)
7728 {
7729 action_array.RemoveItem(action);
7730 }
7731 }
7732
7733
7734
7736 {
7737 ActionOverrideData overrideData = new ActionOverrideData();
7741
7743 if (!actionMap)
7744 {
7747 }
7748
7749 actionMap.Insert(this.
Type(), overrideData);
7750
7751 }
7752
7754
7756
7757
7759 {
7762
7765
7766 string config_to_search = "CfgVehicles";
7767 string muzzle_owner_config;
7768
7770 {
7771 if (IsInherited(Weapon))
7772 config_to_search = "CfgWeapons";
7773
7774 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7775
7776 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7777
7779
7780 if (config_OnFire_subclass_count > 0)
7781 {
7782 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7783
7784 for (int i = 0; i < config_OnFire_subclass_count; i++)
7785 {
7786 string particle_class = "";
7788 string config_OnFire_entry = config_OnFire_class + particle_class;
7789 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7790 WPOF_array.Insert(WPOF);
7791 }
7792
7793
7795 }
7796 }
7797
7799 {
7800 config_to_search = "CfgWeapons";
7801 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7802
7803 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7804
7806
7807 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7808 {
7809 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7810
7811 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7812 {
7813 string particle_class2 = "";
7815 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7816 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7817 WPOBE_array.Insert(WPOBE);
7818 }
7819
7820
7822 }
7823 }
7824 }
7825
7826
7828 {
7831
7833 {
7834 string config_to_search = "CfgVehicles";
7835
7836 if (IsInherited(Weapon))
7837 config_to_search = "CfgWeapons";
7838
7839 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7840 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7841
7842 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7843 {
7844
7846
7848 {
7850 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7852 return;
7853 }
7854
7857
7858
7859
7861 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7862
7863 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7864 {
7865 string particle_class = "";
7867 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7869
7870 if (entry_type == CT_CLASS)
7871 {
7872 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7873 WPOOH_array.Insert(WPOF);
7874 }
7875 }
7876
7877
7879 }
7880 }
7881 }
7882
7884 {
7886 }
7887
7889 {
7891 {
7893
7896
7899
7900 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7901 }
7902 }
7903
7905 {
7907 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7908
7910 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7911
7913 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7914
7916 {
7918 }
7919 }
7920
7922 {
7924 }
7925
7927 {
7930 else
7932
7934 {
7937 }
7938 else
7939 {
7942
7945 }
7946
7948 }
7949
7951 {
7953 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7954 }
7955
7957 {
7959 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7961 }
7962
7964 {
7966 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7967 }
7968
7970 {
7973
7974 OverheatingParticle OP = new OverheatingParticle();
7979
7981 }
7982
7984 {
7987
7988 return -1;
7989 }
7990
7992 {
7994 {
7997
7998 for (int i = count; i > 0; --i)
7999 {
8000 int id = i - 1;
8003
8006
8007 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8008 {
8009 if (p)
8010 {
8013 }
8014 }
8015 }
8016 }
8017 }
8018
8020 {
8022 {
8024 {
8025 int id = i - 1;
8027
8028 if (OP)
8029 {
8031
8032 if (p)
8033 {
8035 }
8036
8037 delete OP;
8038 }
8039 }
8040
8043 }
8044 }
8045
8048 {
8049 return 0.0;
8050 }
8051
8052
8054 {
8055 return 250;
8056 }
8057
8059 {
8060 return 0;
8061 }
8062
8065 {
8067 return true;
8068
8069 return false;
8070 }
8071
8074 {
8077
8079 {
8081 }
8082 else
8083 {
8084
8086 }
8087
8089 }
8090
8097 {
8098 return -1;
8099 }
8100
8101
8102
8103
8105 {
8107 {
8109 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8110
8111 if (r_index >= 0)
8112 {
8113 InventoryLocation r_il = new InventoryLocation;
8114 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8115
8116 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8119 {
8120 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8121 }
8123 {
8124 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8125 }
8126
8127 }
8128
8129 player.GetHumanInventory().ClearUserReservedLocation(this);
8130 }
8131
8134 }
8135
8136
8137
8138
8140 {
8141 return ItemBase.m_DebugActionsMask;
8142 }
8143
8145 {
8146 return ItemBase.m_DebugActionsMask & mask;
8147 }
8148
8150 {
8151 ItemBase.m_DebugActionsMask = mask;
8152 }
8153
8155 {
8156 ItemBase.m_DebugActionsMask |= mask;
8157 }
8158
8160 {
8161 ItemBase.m_DebugActionsMask &= ~mask;
8162 }
8163
8165 {
8167 {
8169 }
8170 else
8171 {
8173 }
8174 }
8175
8176
8178 {
8179 if (GetEconomyProfile())
8180 {
8181 float q_max = GetEconomyProfile().GetQuantityMax();
8182 if (q_max > 0)
8183 {
8184 float q_min = GetEconomyProfile().GetQuantityMin();
8185 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8186
8188 {
8189 ComponentEnergyManager comp = GetCompEM();
8191 {
8193 }
8194 }
8196 {
8198
8199 }
8200
8201 }
8202 }
8203 }
8204
8207 {
8208 EntityAI parent = GetHierarchyParent();
8209
8210 if (parent)
8211 {
8212 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8213 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8214 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8215 }
8216 }
8217
8220 {
8221 EntityAI parent = GetHierarchyParent();
8222
8223 if (parent)
8224 {
8225 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8226 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8227 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8228 }
8229 }
8230
8232 {
8233
8234
8235
8236
8238
8240 {
8241 if (ScriptInputUserData.CanStoreInputUserData())
8242 {
8243 ScriptInputUserData ctx = new ScriptInputUserData;
8249 ctx.
Write(use_stack_max);
8252
8254 {
8255 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8256 }
8257 }
8258 }
8259 else if (!
GetGame().IsMultiplayer())
8260 {
8262 }
8263 }
8264
8266 {
8268 }
8269
8271 {
8273 }
8274
8276 {
8278 }
8279
8281 {
8282
8283 return false;
8284 }
8285
8287 {
8288 return false;
8289 }
8290
8294 {
8295 return false;
8296 }
8297
8299 {
8300 return "";
8301 }
8302
8304
8306 {
8307 return false;
8308 }
8309
8311 {
8312 return true;
8313 }
8314
8315
8316
8318 {
8319 return true;
8320 }
8321
8323 {
8324 return true;
8325 }
8326
8328 {
8329 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8331 }
8332
8334 {
8336 }
8337
8339 {
8341 if (!is_being_placed)
8343 SetSynchDirty();
8344 }
8345
8346
8348
8350 {
8352 }
8353
8355 {
8357 }
8358
8360 {
8361 return 1;
8362 }
8363
8365 {
8366 return false;
8367 }
8368
8370 {
8372 SetSynchDirty();
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
8402
8403
8404
8405
8406
8407
8408
8410 {
8411 super.OnMovedInsideCargo(container);
8412
8413 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8414 }
8415
8416 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8417 {
8418 super.EEItemLocationChanged(oldLoc,newLoc);
8419
8420 PlayerBase new_player = null;
8421 PlayerBase old_player = null;
8422
8423 if (newLoc.GetParent())
8424 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8425
8426 if (oldLoc.GetParent())
8427 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8428
8430 {
8431 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8432
8433 if (r_index >= 0)
8434 {
8435 InventoryLocation r_il = new InventoryLocation;
8436 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8437
8438 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8441 {
8442 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8443 }
8445 {
8446 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8447 }
8448
8449 }
8450 }
8451
8453 {
8454 if (new_player)
8455 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8456
8457 if (new_player == old_player)
8458 {
8459
8460 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8461 {
8463 {
8464 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8465 {
8466 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8467 }
8468 }
8469 else
8470 {
8471 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8472 }
8473 }
8474
8475 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8476 {
8477 int type = oldLoc.GetType();
8479 {
8480 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8481 }
8483 {
8484 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8485 }
8486 }
8487 if (!m_OldLocation)
8488 {
8489 m_OldLocation = new InventoryLocation;
8490 }
8491 m_OldLocation.Copy(oldLoc);
8492 }
8493 else
8494 {
8495 if (m_OldLocation)
8496 {
8497 m_OldLocation.Reset();
8498 }
8499 }
8500
8502 }
8503 else
8504 {
8505 if (new_player)
8506 {
8507 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8508 if (res_index >= 0)
8509 {
8510 InventoryLocation il = new InventoryLocation;
8511 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8513 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8516 {
8517 il.
GetParent().GetOnReleaseLock().Invoke(it);
8518 }
8520 {
8522 }
8523
8524 }
8525 }
8527 {
8528
8530 }
8531
8532 if (m_OldLocation)
8533 {
8534 m_OldLocation.Reset();
8535 }
8536 }
8537 }
8538
8539 override void EOnContact(IEntity other, Contact extra)
8540 {
8542 {
8543 int liquidType = -1;
8545 if (impactSpeed > 0.0)
8546 {
8548 #ifndef SERVER
8550 #else
8552 SetSynchDirty();
8553 #endif
8555 }
8556 }
8557
8558 #ifdef SERVER
8559 if (GetCompEM() && GetCompEM().IsPlugged())
8560 {
8561 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8562 GetCompEM().UnplugThis();
8563 }
8564 #endif
8565 }
8566
8568
8570 {
8572 }
8573
8575 {
8576
8577 }
8578
8580 {
8581 super.OnItemLocationChanged(old_owner, new_owner);
8582
8583 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8584 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8585
8586 if (!relatedPlayer && playerNew)
8587 relatedPlayer = playerNew;
8588
8589 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8590 {
8592 if (actionMgr)
8593 {
8594 ActionBase currentAction = actionMgr.GetRunningAction();
8595 if (currentAction)
8597 }
8598 }
8599
8600 Man ownerPlayerOld = null;
8601 Man ownerPlayerNew = null;
8602
8603 if (old_owner)
8604 {
8605 if (old_owner.
IsMan())
8606 {
8607 ownerPlayerOld = Man.Cast(old_owner);
8608 }
8609 else
8610 {
8611 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8612 }
8613 }
8614 else
8615 {
8617 {
8619
8620 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8621 {
8622 GetCompEM().UnplugThis();
8623 }
8624 }
8625 }
8626
8627 if (new_owner)
8628 {
8629 if (new_owner.
IsMan())
8630 {
8631 ownerPlayerNew = Man.Cast(new_owner);
8632 }
8633 else
8634 {
8635 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8636 }
8637 }
8638
8639 if (ownerPlayerOld != ownerPlayerNew)
8640 {
8641 if (ownerPlayerOld)
8642 {
8643 array<EntityAI> subItemsExit = new array<EntityAI>;
8645 for (int i = 0; i < subItemsExit.Count(); i++)
8646 {
8649 }
8650 }
8651
8652 if (ownerPlayerNew)
8653 {
8654 array<EntityAI> subItemsEnter = new array<EntityAI>;
8656 for (int j = 0; j < subItemsEnter.Count(); j++)
8657 {
8660 }
8661 }
8662 }
8663 else if (ownerPlayerNew != null)
8664 {
8665 PlayerBase nplayer;
8666 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8667 {
8668 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8670 for (int k = 0; k < subItemsUpdate.Count(); k++)
8671 {
8673 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8674 }
8675 }
8676 }
8677
8678 if (old_owner)
8679 old_owner.OnChildItemRemoved(this);
8680 if (new_owner)
8681 new_owner.OnChildItemReceived(this);
8682 }
8683
8684
8686 {
8687 super.EEDelete(parent);
8688 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8689 if (player)
8690 {
8692
8693 if (player.IsAlive())
8694 {
8695 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8696 if (r_index >= 0)
8697 {
8698 InventoryLocation r_il = new InventoryLocation;
8699 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8700
8701 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8704 {
8705 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8706 }
8708 {
8709 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8710 }
8711
8712 }
8713
8714 player.RemoveQuickBarEntityShortcut(this);
8715 }
8716 }
8717 }
8718
8720 {
8721 super.EEKilled(killer);
8722
8725 {
8726 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8727 {
8728 if (IsMagazine())
8729 {
8730 if (Magazine.Cast(this).GetAmmoCount() > 0)
8731 {
8733 }
8734 }
8735 else
8736 {
8738 }
8739 }
8740 }
8741 }
8742
8744 {
8745 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8746
8747 super.OnWasAttached(parent, slot_id);
8748
8751
8753 }
8754
8756 {
8757 super.OnWasDetached(parent, slot_id);
8758
8761 }
8762
8764 {
8765 int idx;
8768
8769 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8770 if (inventory_slots.Count() < 1)
8771 {
8772 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8773 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8774 }
8775 else
8776 {
8777 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8778 }
8779
8780 idx = inventory_slots.Find(slot);
8781 if (idx < 0)
8782 return "";
8783
8784 return attach_types.Get(idx);
8785 }
8786
8788 {
8789 int idx = -1;
8790 string slot;
8791
8794
8795 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8796 if (inventory_slots.Count() < 1)
8797 {
8798 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8799 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8800 }
8801 else
8802 {
8803 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8804 if (detach_types.Count() < 1)
8805 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8806 }
8807
8808 for (int i = 0; i < inventory_slots.Count(); i++)
8809 {
8810 slot = inventory_slots.Get(i);
8811 }
8812
8813 if (slot != "")
8814 {
8815 if (detach_types.Count() == 1)
8816 idx = 0;
8817 else
8818 idx = inventory_slots.Find(slot);
8819 }
8820 if (idx < 0)
8821 return "";
8822
8823 return detach_types.Get(idx);
8824 }
8825
8827 {
8828
8830
8831
8832 float min_time = 1;
8833 float max_time = 3;
8834 float delay = Math.RandomFloat(min_time, max_time);
8835
8836 explode_timer.Run(delay, this, "DoAmmoExplosion");
8837 }
8838
8840 {
8841 Magazine magazine = Magazine.Cast(this);
8842 int pop_sounds_count = 6;
8843 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8844
8845
8846 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8847 string sound_name = pop_sounds[ sound_idx ];
8849
8850
8851 magazine.ServerAddAmmoCount(-1);
8852
8853
8854 float min_temp_to_explode = 100;
8855
8856 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8857 {
8859 }
8860 }
8861
8862
8863 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8864 {
8865 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8866
8867 const int CHANCE_DAMAGE_CARGO = 4;
8868 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8869 const int CHANCE_DAMAGE_NOTHING = 2;
8870
8872 {
8873 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8874 int chances;
8875 int rnd;
8876
8877 if (GetInventory().GetCargo())
8878 {
8879 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8880 rnd = Math.RandomInt(0,chances);
8881
8882 if (rnd < CHANCE_DAMAGE_CARGO)
8883 {
8885 }
8886 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8887 {
8889 }
8890 }
8891 else
8892 {
8893 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8894 rnd = Math.RandomInt(0,chances);
8895
8896 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8897 {
8899 }
8900 }
8901 }
8902 }
8903
8905 {
8906 if (GetInventory().GetCargo())
8907 {
8908 int item_count = GetInventory().GetCargo().GetItemCount();
8909 if (item_count > 0)
8910 {
8911 int random_pick = Math.RandomInt(0, item_count);
8913 if (!item.IsExplosive())
8914 {
8915 item.AddHealth("","",damage);
8916 return true;
8917 }
8918 }
8919 }
8920 return false;
8921 }
8922
8924 {
8925 int attachment_count = GetInventory().AttachmentCount();
8926 if (attachment_count > 0)
8927 {
8928 int random_pick = Math.RandomInt(0, attachment_count);
8929 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8930 if (!attachment.IsExplosive())
8931 {
8932 attachment.AddHealth("","",damage);
8933 return true;
8934 }
8935 }
8936 return false;
8937 }
8938
8940 {
8942 }
8943
8945 {
8947 return GetInventory().CanRemoveEntity();
8948
8949 return false;
8950 }
8951
8953 {
8955 return;
8956
8958 {
8959 if (ScriptInputUserData.CanStoreInputUserData())
8960 {
8961 ScriptInputUserData ctx = new ScriptInputUserData;
8966 ctx.
Write(destination_entity);
8970 }
8971 }
8972 else if (!
GetGame().IsMultiplayer())
8973 {
8975 }
8976 }
8977
8979 {
8981 return;
8982
8983 float split_quantity_new;
8987 InventoryLocation loc = new InventoryLocation;
8988
8989 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8990 {
8992 split_quantity_new = stack_max;
8993 else
8995
8996 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8997 if (new_item)
8998 {
8999 new_item.SetResultOfSplit(true);
9000 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9002 new_item.SetQuantity(split_quantity_new);
9003 }
9004 }
9005 else if (destination_entity && slot_id == -1)
9006 {
9007 if (quantity > stack_max)
9008 split_quantity_new = stack_max;
9009 else
9010 split_quantity_new = quantity;
9011
9013 {
9016 }
9017
9018 if (new_item)
9019 {
9020 new_item.SetResultOfSplit(true);
9021 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9023 new_item.SetQuantity(split_quantity_new);
9024 }
9025 }
9026 else
9027 {
9028 if (stack_max != 0)
9029 {
9031 {
9033 }
9034
9035 if (split_quantity_new == 0)
9036 {
9037 if (!
GetGame().IsMultiplayer())
9038 player.PhysicalPredictiveDropItem(this);
9039 else
9040 player.ServerDropEntity(this);
9041 return;
9042 }
9043
9045
9046 if (new_item)
9047 {
9048 new_item.SetResultOfSplit(true);
9049 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9051 new_item.SetQuantity(stack_max);
9052 new_item.PlaceOnSurface();
9053 }
9054 }
9055 }
9056 }
9057
9059 {
9061 return;
9062
9063 float split_quantity_new;
9067 InventoryLocation loc = new InventoryLocation;
9068
9069 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9070 {
9072 split_quantity_new = stack_max;
9073 else
9075
9076 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9077 if (new_item)
9078 {
9079 new_item.SetResultOfSplit(true);
9080 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9082 new_item.SetQuantity(split_quantity_new);
9083 }
9084 }
9085 else if (destination_entity && slot_id == -1)
9086 {
9087 if (quantity > stack_max)
9088 split_quantity_new = stack_max;
9089 else
9090 split_quantity_new = quantity;
9091
9093 {
9096 }
9097
9098 if (new_item)
9099 {
9100 new_item.SetResultOfSplit(true);
9101 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9103 new_item.SetQuantity(split_quantity_new);
9104 }
9105 }
9106 else
9107 {
9108 if (stack_max != 0)
9109 {
9111 {
9113 }
9114
9116
9117 if (new_item)
9118 {
9119 new_item.SetResultOfSplit(true);
9120 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9122 new_item.SetQuantity(stack_max);
9123 new_item.PlaceOnSurface();
9124 }
9125 }
9126 }
9127 }
9128
9130 {
9132 return;
9133
9135 {
9136 if (ScriptInputUserData.CanStoreInputUserData())
9137 {
9138 ScriptInputUserData ctx = new ScriptInputUserData;
9143 dst.WriteToContext(ctx);
9145 }
9146 }
9147 else if (!
GetGame().IsMultiplayer())
9148 {
9150 }
9151 }
9152
9154 {
9156 return;
9157
9159 {
9160 if (ScriptInputUserData.CanStoreInputUserData())
9161 {
9162 ScriptInputUserData ctx = new ScriptInputUserData;
9167 ctx.
Write(destination_entity);
9173 }
9174 }
9175 else if (!
GetGame().IsMultiplayer())
9176 {
9178 }
9179 }
9180
9182 {
9184 }
9185
9187 {
9189 return this;
9190
9192 float split_quantity_new;
9194 if (dst.IsValid())
9195 {
9196 int slot_id = dst.GetSlot();
9198
9199 if (quantity > stack_max)
9200 split_quantity_new = stack_max;
9201 else
9202 split_quantity_new = quantity;
9203
9205
9206 if (new_item)
9207 {
9208 new_item.SetResultOfSplit(true);
9209 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9212 }
9213
9214 return new_item;
9215 }
9216
9217 return null;
9218 }
9219
9221 {
9223 return;
9224
9226 float split_quantity_new;
9228 if (destination_entity)
9229 {
9231 if (quantity > stackable)
9232 split_quantity_new = stackable;
9233 else
9234 split_quantity_new = quantity;
9235
9236 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9237 if (new_item)
9238 {
9239 new_item.SetResultOfSplit(true);
9240 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9242 new_item.SetQuantity(split_quantity_new);
9243 }
9244 }
9245 }
9246
9248 {
9250 return;
9251
9253 {
9254 if (ScriptInputUserData.CanStoreInputUserData())
9255 {
9256 ScriptInputUserData ctx = new ScriptInputUserData;
9261 ItemBase destination_entity =
this;
9262 ctx.
Write(destination_entity);
9266 }
9267 }
9268 else if (!
GetGame().IsMultiplayer())
9269 {
9271 }
9272 }
9273
9275 {
9277 return;
9278
9280 float split_quantity_new;
9282 if (player)
9283 {
9285 if (quantity > stackable)
9286 split_quantity_new = stackable;
9287 else
9288 split_quantity_new = quantity;
9289
9290 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9291 new_item =
ItemBase.Cast(in_hands);
9292 if (new_item)
9293 {
9294 new_item.SetResultOfSplit(true);
9295 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9297 new_item.SetQuantity(split_quantity_new);
9298 }
9299 }
9300 }
9301
9303 {
9305 return;
9306
9308 float split_quantity_new = Math.Floor(quantity * 0.5);
9309
9311
9312 if (new_item)
9313 {
9314 if (new_item.GetQuantityMax() < split_quantity_new)
9315 {
9316 split_quantity_new = new_item.GetQuantityMax();
9317 }
9318
9319 new_item.SetResultOfSplit(true);
9320 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9321
9323 {
9326 }
9327 else
9328 {
9331 }
9332 }
9333 }
9334
9336 {
9338 return;
9339
9341 float split_quantity_new = Math.Floor(quantity / 2);
9342
9343 InventoryLocation invloc = new InventoryLocation;
9345
9347 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9348
9349 if (new_item)
9350 {
9351 if (new_item.GetQuantityMax() < split_quantity_new)
9352 {
9353 split_quantity_new = new_item.GetQuantityMax();
9354 }
9356 {
9359 }
9360 else
9361 {
9364 }
9365 }
9366 }
9367
9370 {
9371 SetWeightDirty();
9373
9374 if (parent)
9375 parent.OnAttachmentQuantityChangedEx(this, delta);
9376
9378 {
9380 {
9382 }
9384 {
9385 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9387 }
9388 }
9389
9390 }
9391
9394 {
9395
9396 }
9397
9400 {
9402 }
9403
9405 {
9406 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9407
9409 {
9410 if (newLevel == GameConstants.STATE_RUINED)
9411 {
9413 EntityAI parent = GetHierarchyParent();
9414 if (parent && parent.IsFireplace())
9415 {
9416 CargoBase cargo = GetInventory().GetCargo();
9417 if (cargo)
9418 {
9420 {
9422 }
9423 }
9424 }
9425 }
9426
9428 {
9429
9431 return;
9432 }
9433
9434 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9435 {
9437 }
9438 }
9439 }
9440
9441
9443 {
9444 super.OnRightClick();
9445
9447 {
9449 {
9450 if (ScriptInputUserData.CanStoreInputUserData())
9451 {
9452 vector m4[4];
9454
9455 EntityAI root = GetHierarchyRoot();
9456
9457 InventoryLocation dst = new InventoryLocation;
9459 {
9460 if (root)
9461 {
9462 root.GetTransform(m4);
9464 }
9465 else
9466 GetInventory().GetCurrentInventoryLocation(dst);
9467 }
9468 else
9469 {
9471
9472
9473 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9474 {
9475 if (root)
9476 {
9477 root.GetTransform(m4);
9479 }
9480 else
9481 GetInventory().GetCurrentInventoryLocation(dst);
9482 }
9483 else
9484 {
9485 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9486 }
9487 }
9488
9489 ScriptInputUserData ctx = new ScriptInputUserData;
9497 }
9498 }
9499 else if (!
GetGame().IsMultiplayer())
9500 {
9502 }
9503 }
9504 }
9505
9506 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9507 {
9508
9509 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9510 return false;
9511
9512 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9513 return false;
9514
9515
9517 return false;
9518
9519
9520 Magazine mag = Magazine.Cast(this);
9521 if (mag)
9522 {
9523 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9524 return false;
9525
9526 if (stack_max_limit)
9527 {
9528 Magazine other_mag = Magazine.Cast(other_item);
9529 if (other_item)
9530 {
9531 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9532 return false;
9533 }
9534
9535 }
9536 }
9537 else
9538 {
9539
9541 return false;
9542
9544 return false;
9545 }
9546
9547 PlayerBase player = null;
9548 if (CastTo(player, GetHierarchyRootPlayer()))
9549 {
9550 if (player.GetInventory().HasAttachment(this))
9551 return false;
9552
9553 if (player.IsItemsToDelete())
9554 return false;
9555 }
9556
9557 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9558 return false;
9559
9560 int slotID;
9562 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9563 return false;
9564
9565 return true;
9566 }
9567
9569 {
9571 }
9572
9574 {
9575 return m_IsResultOfSplit;
9576 }
9577
9579 {
9580 m_IsResultOfSplit = value;
9581 }
9582
9584 {
9586 }
9587
9589 {
9590 float other_item_quantity = other_item.GetQuantity();
9591 float this_free_space;
9592
9594
9596
9597 if (other_item_quantity > this_free_space)
9598 {
9599 return this_free_space;
9600 }
9601 else
9602 {
9603 return other_item_quantity;
9604 }
9605 }
9606
9608 {
9610 }
9611
9613 {
9615 return;
9616
9617 if (!IsMagazine() && other_item)
9618 {
9620 if (quantity_used != 0)
9621 {
9622 float hp1 = GetHealth01("","");
9623 float hp2 = other_item.GetHealth01("","");
9624 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9625 hpResult = hpResult / (
GetQuantity() + quantity_used);
9626
9627 hpResult *= GetMaxHealth();
9628 Math.Round(hpResult);
9629 SetHealth("", "Health", hpResult);
9630
9632 other_item.AddQuantity(-quantity_used);
9633 }
9634 }
9636 }
9637
9639 {
9640 #ifdef SERVER
9641 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9642 GetHierarchyParent().IncreaseLifetimeUp();
9643 #endif
9644 };
9645
9647 {
9648 PlayerBase p = PlayerBase.Cast(player);
9649
9650 array<int> recipesIds = p.m_Recipes;
9651 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9652 if (moduleRecipesManager)
9653 {
9654 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9655 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9656 }
9657
9658 for (int i = 0;i < recipesIds.Count(); i++)
9659 {
9660 int key = recipesIds.Get(i);
9661 string recipeName = moduleRecipesManager.GetRecipeName(key);
9663 }
9664 }
9665
9666
9667 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9668 {
9669 super.GetDebugActions(outputList);
9670
9671
9676
9677
9681
9685
9686
9689
9690
9692 {
9695 }
9696
9698
9701
9705 }
9706
9707
9708
9709
9711 {
9712 super.OnAction(action_id, player, ctx);
9713 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9714 {
9715 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9716 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9717 PlayerBase p = PlayerBase.Cast(player);
9718 if (
EActions.RECIPES_RANGE_START < 1000)
9719 {
9720 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9721 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9722 }
9723 }
9724 #ifndef SERVER
9725 else if (action_id ==
EActions.WATCH_PLAYER)
9726 {
9727 PluginDeveloper.SetDeveloperItemClientEx(player);
9728 }
9729 #endif
9731 {
9732 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9733 {
9734 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9735 OnDebugButtonPressServer(id + 1);
9736 }
9737
9738 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9739 {
9740 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9742 }
9743
9744 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9745 {
9746 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9748 }
9749
9750 else if (action_id ==
EActions.ADD_QUANTITY)
9751 {
9752 if (IsMagazine())
9753 {
9754 Magazine mag = Magazine.Cast(this);
9755 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9756 }
9757 else
9758 {
9760 }
9761
9762 if (m_EM)
9763 {
9764 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9765 }
9766
9767 }
9768
9769 else if (action_id ==
EActions.REMOVE_QUANTITY)
9770 {
9771 if (IsMagazine())
9772 {
9773 Magazine mag2 = Magazine.Cast(this);
9774 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9775 }
9776 else
9777 {
9779 }
9780 if (m_EM)
9781 {
9782 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9783 }
9784
9785 }
9786
9787 else if (action_id ==
EActions.SET_QUANTITY_0)
9788 {
9790
9791 if (m_EM)
9792 {
9793 m_EM.SetEnergy(0);
9794 }
9795 }
9796
9797 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9798 {
9800
9801 if (m_EM)
9802 {
9803 m_EM.SetEnergy(m_EM.GetEnergyMax());
9804 }
9805 }
9806
9807 else if (action_id ==
EActions.ADD_HEALTH)
9808 {
9809 AddHealth("","",GetMaxHealth("","Health")/5);
9810 }
9811 else if (action_id ==
EActions.REMOVE_HEALTH)
9812 {
9813 AddHealth("","",-GetMaxHealth("","Health")/5);
9814 }
9815 else if (action_id ==
EActions.DESTROY_HEALTH)
9816 {
9817 SetHealth01("","",0);
9818 }
9819 else if (action_id ==
EActions.WATCH_ITEM)
9820 {
9822 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9823 #ifdef DEVELOPER
9824 SetDebugDeveloper_item(this);
9825 #endif
9826 }
9827
9828 else if (action_id ==
EActions.ADD_TEMPERATURE)
9829 {
9830 AddTemperature(20);
9831
9832 }
9833
9834 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9835 {
9836 AddTemperature(-20);
9837
9838 }
9839
9840 else if (action_id ==
EActions.FLIP_FROZEN)
9841 {
9842 SetFrozen(!GetIsFrozen());
9843
9844 }
9845
9846 else if (action_id ==
EActions.ADD_WETNESS)
9847 {
9849
9850 }
9851
9852 else if (action_id ==
EActions.REMOVE_WETNESS)
9853 {
9855
9856 }
9857
9858 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9859 {
9862
9863
9864 }
9865
9866 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9867 {
9870 }
9871
9872 else if (action_id ==
EActions.MAKE_SPECIAL)
9873 {
9874 auto debugParams = DebugSpawnParams.WithPlayer(player);
9875 OnDebugSpawnEx(debugParams);
9876 }
9877
9878 else if (action_id ==
EActions.DELETE)
9879 {
9880 Delete();
9881 }
9882
9883 }
9884
9885
9886 return false;
9887 }
9888
9889
9890
9891
9895
9898
9899
9900
9902 {
9903 return false;
9904 }
9905
9906
9908 {
9909 return true;
9910 }
9911
9912
9914 {
9915 return true;
9916 }
9917
9918
9919
9921 {
9922 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9924 }
9925
9928 {
9929 return null;
9930 }
9931
9933 {
9934 return false;
9935 }
9936
9938 {
9939 return false;
9940 }
9941
9945
9946
9948 {
9949 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9950 return module_repairing.CanRepair(this, item_repair_kit);
9951 }
9952
9953
9954 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9955 {
9956 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9957 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9958 }
9959
9960
9962 {
9963
9964
9965
9966
9967
9968
9969
9970
9971 return 1;
9972 }
9973
9974
9975
9977 {
9979 }
9980
9981
9982
9984 {
9986 }
9987
9988
9997 {
9998 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9999
10000 if (player)
10001 {
10002 player.MessageStatus(text);
10003 }
10004 }
10005
10006
10015 {
10016 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10017
10018 if (player)
10019 {
10020 player.MessageAction(text);
10021 }
10022 }
10023
10024
10033 {
10034 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10035
10036 if (player)
10037 {
10038 player.MessageFriendly(text);
10039 }
10040 }
10041
10042
10051 {
10052 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10053
10054 if (player)
10055 {
10056 player.MessageImportant(text);
10057 }
10058 }
10059
10061 {
10062 return true;
10063 }
10064
10065
10066 override bool KindOf(
string tag)
10067 {
10068 bool found = false;
10069 string item_name = this.
GetType();
10072
10073 int array_size = item_tag_array.Count();
10074 for (int i = 0; i < array_size; i++)
10075 {
10076 if (item_tag_array.Get(i) == tag)
10077 {
10078 found = true;
10079 break;
10080 }
10081 }
10082 return found;
10083 }
10084
10085
10087 {
10088
10089 super.OnRPC(sender, rpc_type,ctx);
10090
10091
10092 switch (rpc_type)
10093 {
10094 #ifndef SERVER
10095 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10096 Param2<bool, string> p = new Param2<bool, string>(false, "");
10097
10099 return;
10100
10101 bool play = p.param1;
10102 string soundSet = p.param2;
10103
10104 if (play)
10105 {
10107 {
10109 {
10111 }
10112 }
10113 else
10114 {
10116 }
10117 }
10118 else
10119 {
10121 }
10122
10123 break;
10124 #endif
10125
10126 }
10127
10129 {
10131 }
10132 }
10133
10134
10135
10136
10138 {
10139 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10140 return plugin.GetID(
name);
10141 }
10142
10144 {
10145 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10146 return plugin.GetName(id);
10147 }
10148
10151 {
10152
10153
10154 int varFlags;
10155 if (!ctx.
Read(varFlags))
10156 return;
10157
10158 if (varFlags & ItemVariableFlags.FLOAT)
10159 {
10161 }
10162 }
10163
10165 {
10166
10167 super.SerializeNumericalVars(floats_out);
10168
10169
10170
10172 {
10174 }
10175
10177 {
10179 }
10180
10182 {
10184 }
10185
10187 {
10192 }
10193
10195 {
10197 }
10198 }
10199
10201 {
10202
10203 super.DeSerializeNumericalVars(floats);
10204
10205
10206 int index = 0;
10207 int mask = Math.Round(floats.Get(index));
10208
10209 index++;
10210
10212 {
10214 {
10216 }
10217 else
10218 {
10219 float quantity = floats.Get(index);
10220 SetQuantity(quantity,
true,
false,
false,
false);
10221 }
10222 index++;
10223 }
10224
10226 {
10227 float wet = floats.Get(index);
10229 index++;
10230 }
10231
10233 {
10234 int liquidtype = Math.Round(floats.Get(index));
10236 index++;
10237 }
10238
10240 {
10242 index++;
10244 index++;
10246 index++;
10248 index++;
10249 }
10250
10252 {
10253 int cleanness = Math.Round(floats.Get(index));
10255 index++;
10256 }
10257 }
10258
10260 {
10261 super.WriteVarsToCTX(ctx);
10262
10263
10265 {
10267 }
10268
10270 {
10272 }
10273
10275 {
10277 }
10278
10280 {
10281 int r,g,b,a;
10287 }
10288
10290 {
10292 }
10293 }
10294
10296 {
10297 if (!super.ReadVarsFromCTX(ctx,version))
10298 return false;
10299
10300 int intValue;
10301 float value;
10302
10303 if (version < 140)
10304 {
10305 if (!ctx.
Read(intValue))
10306 return false;
10307
10308 m_VariablesMask = intValue;
10309 }
10310
10312 {
10313 if (!ctx.
Read(value))
10314 return false;
10315
10317 {
10319 }
10320 else
10321 {
10323 }
10324 }
10325
10326 if (version < 140)
10327 {
10329 {
10330 if (!ctx.
Read(value))
10331 return false;
10332 SetTemperatureDirect(value);
10333 }
10334 }
10335
10337 {
10338 if (!ctx.
Read(value))
10339 return false;
10341 }
10342
10344 {
10345 if (!ctx.
Read(intValue))
10346 return false;
10348 }
10349
10351 {
10352 int r,g,b,a;
10354 return false;
10356 return false;
10358 return false;
10360 return false;
10361
10363 }
10364
10366 {
10367 if (!ctx.
Read(intValue))
10368 return false;
10370 }
10371
10372 if (version >= 138 && version < 140)
10373 {
10375 {
10376 if (!ctx.
Read(intValue))
10377 return false;
10378 SetFrozen(intValue);
10379 }
10380 }
10381
10382 return true;
10383 }
10384
10385
10387 {
10390 {
10392 }
10393
10394 if (!super.OnStoreLoad(ctx, version))
10395 {
10397 return false;
10398 }
10399
10400 if (version >= 114)
10401 {
10402 bool hasQuickBarIndexSaved;
10403
10404 if (!ctx.
Read(hasQuickBarIndexSaved))
10405 {
10407 return false;
10408 }
10409
10410 if (hasQuickBarIndexSaved)
10411 {
10412 int itmQBIndex;
10413
10414
10415 if (!ctx.
Read(itmQBIndex))
10416 {
10418 return false;
10419 }
10420
10421 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10422 if (itmQBIndex != -1 && parentPlayer)
10423 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10424 }
10425 }
10426 else
10427 {
10428
10429 PlayerBase player;
10430 int itemQBIndex;
10431 if (version ==
int.
MAX)
10432 {
10433 if (!ctx.
Read(itemQBIndex))
10434 {
10436 return false;
10437 }
10438 }
10439 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10440 {
10441
10442 if (!ctx.
Read(itemQBIndex))
10443 {
10445 return false;
10446 }
10447 if (itemQBIndex != -1 && player)
10448 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10449 }
10450 }
10451
10452 if (version < 140)
10453 {
10454
10455 if (!LoadVariables(ctx, version))
10456 {
10458 return false;
10459 }
10460 }
10461
10462
10464 {
10466 return false;
10467 }
10468 if (version >= 132)
10469 {
10471 if (raib)
10472 {
10474 {
10476 return false;
10477 }
10478 }
10479 }
10480
10482 return true;
10483 }
10484
10485
10486
10488 {
10489 super.OnStoreSave(ctx);
10490
10491 PlayerBase player;
10492 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10493 {
10495
10496 int itemQBIndex = -1;
10497 itemQBIndex = player.FindQuickBarEntityIndex(this);
10498 ctx.
Write(itemQBIndex);
10499 }
10500 else
10501 {
10503 }
10504
10506
10508 if (raib)
10509 {
10511 }
10512 }
10513
10514
10516 {
10517 super.AfterStoreLoad();
10518
10520 {
10522 }
10523
10525 {
10528 }
10529 }
10530
10532 {
10533 super.EEOnAfterLoad();
10534
10536 {
10538 }
10539
10542 }
10543
10545 {
10546 return false;
10547 }
10548
10549
10550
10552 {
10554 {
10555 #ifdef PLATFORM_CONSOLE
10556
10558 {
10560 if (menu)
10561 {
10563 }
10564 }
10565 #endif
10566 }
10567
10569 {
10572 }
10573
10575 {
10576 SetWeightDirty();
10578 }
10580 {
10583 }
10584
10586 {
10589 }
10591 {
10594 }
10595
10596 super.OnVariablesSynchronized();
10597 }
10598
10599
10600
10602 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10603 {
10604 if (!IsServerCheck(allow_client))
10605 return false;
10606
10608 return false;
10609
10612
10613 if (value <= (min + 0.001))
10614 value = min;
10615
10616 if (value == min)
10617 {
10618 if (destroy_config)
10619 {
10620 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10621 if (dstr)
10622 {
10624 this.Delete();
10625 return true;
10626 }
10627 }
10628 else if (destroy_forced)
10629 {
10631 this.Delete();
10632 return true;
10633 }
10634
10636 }
10637
10640
10642 {
10644
10645 if (delta)
10647 }
10648
10650
10651 return false;
10652 }
10653
10654
10656 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10657 {
10659 }
10660
10662 {
10665 }
10666
10668 {
10671 }
10672
10675 {
10676 float value_clamped = Math.Clamp(value, 0, 1);
10678 SetQuantity(result, destroy_config, destroy_forced);
10679 }
10680
10681
10684 {
10686 }
10687
10689 {
10691 }
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10703 {
10704 int slot = -1;
10705 if (GetInventory())
10706 {
10707 InventoryLocation il = new InventoryLocation;
10708 GetInventory().GetCurrentInventoryLocation(il);
10710 }
10711
10713 }
10714
10716 {
10717 float quantity_max = 0;
10718
10720 {
10721 if (attSlotID != -1)
10722 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10723
10724 if (quantity_max <= 0)
10726 }
10727
10728 if (quantity_max <= 0)
10730
10731 return quantity_max;
10732 }
10733
10735 {
10737 }
10738
10740 {
10742 }
10743
10744
10746 {
10748 }
10749
10751 {
10753 }
10754
10756 {
10758 }
10759
10760
10762 {
10763
10764 float weightEx = GetWeightEx();
10765 float special = GetInventoryAndCargoWeight();
10766 return weightEx - special;
10767 }
10768
10769
10771 {
10773 }
10774
10776 {
10778 {
10779 #ifdef DEVELOPER
10780 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10781 {
10782 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10784 }
10785 #endif
10786
10787 return GetQuantity() * GetConfigWeightModified();
10788 }
10789 else if (HasEnergyManager())
10790 {
10791 #ifdef DEVELOPER
10792 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10793 {
10794 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10795 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10796 }
10797 #endif
10798 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10799 }
10800 else
10801 {
10802 #ifdef DEVELOPER
10803 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10804 {
10805 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10806 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10807 }
10808 #endif
10809 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10810 }
10811 }
10812
10815 {
10816 int item_count = 0;
10818
10819 if (GetInventory().GetCargo() != NULL)
10820 {
10821 item_count = GetInventory().GetCargo().GetItemCount();
10822 }
10823
10824 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10825 {
10826 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10827 if (item)
10828 item_count += item.GetNumberOfItems();
10829 }
10830 return item_count;
10831 }
10832
10835 {
10836 float weight = 0;
10837 float wetness = 1;
10838 if (include_wetness)
10841 {
10842 weight = wetness * m_ConfigWeight;
10843 }
10845 {
10846 weight = 1;
10847 }
10848 return weight;
10849 }
10850
10851
10852
10854 {
10855 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10856 {
10857 GameInventory inv = GetInventory();
10858 array<EntityAI> items = new array<EntityAI>;
10860 for (int i = 0; i < items.Count(); i++)
10861 {
10863 if (item)
10864 {
10866 }
10867 }
10868 }
10869 }
10870
10871
10872
10873
10875 {
10876 float energy = 0;
10877 if (HasEnergyManager())
10878 {
10879 energy = GetCompEM().GetEnergy();
10880 }
10881 return energy;
10882 }
10883
10884
10886 {
10887 super.OnEnergyConsumed();
10888
10890 }
10891
10893 {
10894 super.OnEnergyAdded();
10895
10897 }
10898
10899
10901 {
10902 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10903 {
10905 {
10906 float energy_0to1 = GetCompEM().GetEnergy0To1();
10908 }
10909 }
10910 }
10911
10912
10914 {
10915 return ConfigGetFloat("heatIsolation");
10916 }
10917
10919 {
10921 }
10922
10924 {
10925 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10926 if (
GetGame().ConfigIsExisting(paramPath))
10928
10929 return 0.0;
10930 }
10931
10933 {
10934 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10935 if (
GetGame().ConfigIsExisting(paramPath))
10937
10938 return 0.0;
10939 }
10940
10941 override void SetWet(
float value,
bool allow_client =
false)
10942 {
10943 if (!IsServerCheck(allow_client))
10944 return;
10945
10948
10950
10951 m_VarWet = Math.Clamp(value, min, max);
10952
10954 {
10957 }
10958 }
10959
10960 override void AddWet(
float value)
10961 {
10963 }
10964
10966 {
10968 }
10969
10971 {
10973 }
10974
10976 {
10978 }
10979
10981 {
10983 }
10984
10986 {
10988 }
10989
10990 override void OnWetChanged(
float newVal,
float oldVal)
10991 {
10994 if (newLevel != oldLevel)
10995 {
10997 }
10998 }
10999
11001 {
11002 SetWeightDirty();
11003 }
11004
11006 {
11007 return GetWetLevelInternal(
m_VarWet);
11008 }
11009
11010
11011
11013 {
11015 }
11016
11018 {
11020 }
11021
11023 {
11025 }
11026
11028 {
11030 }
11031
11032
11033
11035 {
11036 if (ConfigIsExisting("itemModelLength"))
11037 {
11038 return ConfigGetFloat("itemModelLength");
11039 }
11040 return 0;
11041 }
11042
11044 {
11045 if (ConfigIsExisting("itemAttachOffset"))
11046 {
11047 return ConfigGetFloat("itemAttachOffset");
11048 }
11049 return 0;
11050 }
11051
11052 override void SetCleanness(
int value,
bool allow_client =
false)
11053 {
11054 if (!IsServerCheck(allow_client))
11055 return;
11056
11058
11060
11063 }
11064
11066 {
11068 }
11069
11071 {
11072 return true;
11073 }
11074
11075
11076
11077
11079 {
11081 }
11082
11084 {
11086 }
11087
11088
11089
11090
11091 override void SetColor(
int r,
int g,
int b,
int a)
11092 {
11098 }
11100 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11101 {
11106 }
11107
11109 {
11111 }
11112
11115 {
11116 int r,g,b,a;
11118 r = r/255;
11119 g = g/255;
11120 b = b/255;
11121 a = a/255;
11122 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11123 }
11124
11125
11126
11127 override void SetLiquidType(
int value,
bool allow_client =
false)
11128 {
11129 if (!IsServerCheck(allow_client))
11130 return;
11131
11136 }
11137
11139 {
11140 return ConfigGetInt("varLiquidTypeInit");
11141 }
11142
11144 {
11146 }
11147
11149 {
11151 SetFrozen(false);
11152 }
11153
11156 {
11157 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11158 }
11159
11160
11163 {
11164 PlayerBase nplayer;
11165 if (PlayerBase.CastTo(nplayer, player))
11166 {
11168
11169 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11170 }
11171 }
11172
11173
11176 {
11177 PlayerBase nplayer;
11178 if (PlayerBase.CastTo(nplayer,player))
11179 {
11180
11181 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11182
11183 }
11184
11185
11186 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11187
11188
11189 if (HasEnergyManager())
11190 {
11191 GetCompEM().UpdatePlugState();
11192 }
11193 }
11194
11195
11197 {
11198 super.OnPlacementStarted(player);
11199
11201 }
11202
11203 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11204 {
11206 {
11207 m_AdminLog.OnPlacementComplete(player,
this);
11208 }
11209
11210 super.OnPlacementComplete(player, position, orientation);
11211 }
11212
11213
11214
11215
11216
11218 {
11220 {
11221 return true;
11222 }
11223 else
11224 {
11225 return false;
11226 }
11227 }
11228
11229
11231 {
11233 {
11235 }
11236 }
11237
11238
11240 {
11242 }
11243
11245 {
11247 }
11248
11249 override void InsertAgent(
int agent,
float count = 1)
11250 {
11251 if (count < 1)
11252 return;
11253
11255 }
11256
11259 {
11261 }
11262
11263
11265 {
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
11303
11304
11305
11306
11307
11308
11309
11311 {
11313 return false;
11314 return true;
11315 }
11316
11318 {
11319
11321 }
11322
11323
11326 {
11327 super.CheckForRoofLimited(timeTresholdMS);
11328
11330 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11331 {
11332 m_PreviousRoofTestTime = time;
11333 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11334 }
11335 }
11336
11337
11339 {
11341 {
11342 return 0;
11343 }
11344
11345 if (GetInventory().GetAttachmentSlotsCount() != 0)
11346 {
11347 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11348 if (filter)
11349 return filter.GetProtectionLevel(type, false, system);
11350 else
11351 return 0;
11352 }
11353
11354 string subclassPath, entryName;
11355
11356 switch (type)
11357 {
11359 entryName = "biological";
11360 break;
11362 entryName = "chemical";
11363 break;
11364 default:
11365 entryName = "biological";
11366 break;
11367 }
11368
11369 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11370
11372 }
11373
11374
11375
11378 {
11379 if (!IsMagazine())
11381
11383 }
11384
11385
11386
11387
11388
11393 {
11394 return true;
11395 }
11396
11398 {
11400 }
11401
11402
11403
11404
11405
11407 {
11408 if (parent)
11409 {
11410 if (parent.IsInherited(DayZInfected))
11411 return true;
11412
11413 if (!parent.IsRuined())
11414 return true;
11415 }
11416
11417 return true;
11418 }
11419
11421 {
11422 if (!super.CanPutAsAttachment(parent))
11423 {
11424 return false;
11425 }
11426
11427 if (!IsRuined() && !parent.IsRuined())
11428 {
11429 return true;
11430 }
11431
11432 return false;
11433 }
11434
11436 {
11437
11438
11439
11440
11441 return super.CanReceiveItemIntoCargo(item);
11442 }
11443
11445 {
11446
11447
11448
11449
11450 GameInventory attachmentInv = attachment.GetInventory();
11452 {
11453 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11454 return false;
11455 }
11456
11457 InventoryLocation loc = new InventoryLocation();
11458 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11459 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11460 return false;
11461
11462 return super.CanReceiveAttachment(attachment, slotId);
11463 }
11464
11466 {
11467 if (!super.CanReleaseAttachment(attachment))
11468 return false;
11469
11470 return GetInventory().AreChildrenAccessible();
11471 }
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11494 {
11495 int id = muzzle_owner.GetMuzzleID();
11496 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11497
11498 if (WPOF_array)
11499 {
11500 for (int i = 0; i < WPOF_array.Count(); i++)
11501 {
11502 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11503
11504 if (WPOF)
11505 {
11506 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11507 }
11508 }
11509 }
11510 }
11511
11512
11514 {
11515 int id = muzzle_owner.GetMuzzleID();
11517
11518 if (WPOBE_array)
11519 {
11520 for (int i = 0; i < WPOBE_array.Count(); i++)
11521 {
11522 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11523
11524 if (WPOBE)
11525 {
11526 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11527 }
11528 }
11529 }
11530 }
11531
11532
11534 {
11535 int id = muzzle_owner.GetMuzzleID();
11536 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11537
11538 if (WPOOH_array)
11539 {
11540 for (int i = 0; i < WPOOH_array.Count(); i++)
11541 {
11542 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11543
11544 if (WPOOH)
11545 {
11546 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11547 }
11548 }
11549 }
11550 }
11551
11552
11554 {
11555 int id = muzzle_owner.GetMuzzleID();
11556 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11557
11558 if (WPOOH_array)
11559 {
11560 for (int i = 0; i < WPOOH_array.Count(); i++)
11561 {
11562 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11563
11564 if (WPOOH)
11565 {
11566 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11567 }
11568 }
11569 }
11570 }
11571
11572
11574 {
11575 int id = muzzle_owner.GetMuzzleID();
11576 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11577
11578 if (WPOOH_array)
11579 {
11580 for (int i = 0; i < WPOOH_array.Count(); i++)
11581 {
11582 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11583
11584 if (WPOOH)
11585 {
11586 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11587 }
11588 }
11589 }
11590 }
11591
11592
11593
11595 {
11597 {
11598 return true;
11599 }
11600
11601 return false;
11602 }
11603
11605 {
11607 {
11608 return true;
11609 }
11610
11611 return false;
11612 }
11613
11615 {
11617 {
11618 return true;
11619 }
11620
11621 return false;
11622 }
11623
11625 {
11626 return false;
11627 }
11628
11631 {
11632 return UATimeSpent.DEFAULT_DEPLOY;
11633 }
11634
11635
11636
11637
11639 {
11641 SetSynchDirty();
11642 }
11643
11645 {
11647 }
11648
11649
11651 {
11652 return false;
11653 }
11654
11657 {
11658 string att_type = "None";
11659
11660 if (ConfigIsExisting("soundAttType"))
11661 {
11662 att_type = ConfigGetString("soundAttType");
11663 }
11664
11666 }
11667
11669 {
11671 }
11672
11673
11674
11675
11676
11680
11682 {
11685
11687 }
11688
11689
11691 {
11693 return;
11694
11696
11699
11702
11703 SoundParameters params = new SoundParameters();
11707 }
11708
11709
11711 {
11713 return;
11714
11716 SetSynchDirty();
11717
11720 }
11721
11722
11724 {
11726 return;
11727
11729 SetSynchDirty();
11730
11733 }
11734
11736 {
11738 }
11739
11741 {
11743 }
11744
11747 {
11748 if (!
GetGame().IsDedicatedServer())
11749 {
11750 if (ConfigIsExisting("attachSoundSet"))
11751 {
11752 string cfg_path = "";
11753 string soundset = "";
11754 string type_name =
GetType();
11755
11758 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11759 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11760
11761 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11762 {
11763 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11764 {
11765 if (cfg_slot_array[i] == slot_type)
11766 {
11767 soundset = cfg_soundset_array[i];
11768 break;
11769 }
11770 }
11771 }
11772
11773 if (soundset != "")
11774 {
11775 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11777 }
11778 }
11779 }
11780 }
11781
11783 {
11784
11785 }
11786
11787 void OnApply(PlayerBase player);
11788
11790 {
11791 return 1.0;
11792 };
11793
11795 {
11797 }
11798
11800 {
11802 }
11803
11805
11807 {
11808 SetDynamicPhysicsLifeTime(0.01);
11810 }
11811
11813 {
11814 array<string> zone_names = new array<string>;
11815 GetDamageZones(zone_names);
11816 for (int i = 0; i < zone_names.Count(); i++)
11817 {
11818 SetHealthMax(zone_names.Get(i),"Health");
11819 }
11820 SetHealthMax("","Health");
11821 }
11822
11825 {
11826 float global_health = GetHealth01("","Health");
11827 array<string> zones = new array<string>;
11828 GetDamageZones(zones);
11829
11830 for (int i = 0; i < zones.Count(); i++)
11831 {
11832 SetHealth01(zones.Get(i),"Health",global_health);
11833 }
11834 }
11835
11838 {
11839 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11840 }
11841
11843 {
11844 if (!hasRootAsPlayer)
11845 {
11846 if (refParentIB)
11847 {
11848
11849 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11850 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11851
11852 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11853 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11854
11857 }
11858 else
11859 {
11860
11863 }
11864 }
11865 }
11866
11868 {
11870 {
11871 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11872 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11873 {
11874 float heatPermCoef = 1.0;
11876 while (ent)
11877 {
11878 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11879 ent = ent.GetHierarchyParent();
11880 }
11881
11882 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11883 }
11884 }
11885 }
11886
11888 {
11889
11890 EntityAI parent = GetHierarchyParent();
11891 if (!parent)
11892 {
11893 hasParent = false;
11894 hasRootAsPlayer = false;
11895 }
11896 else
11897 {
11898 hasParent = true;
11899 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11900 refParentIB =
ItemBase.Cast(parent);
11901 }
11902 }
11903
11904 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11905 {
11906
11907 }
11908
11910 {
11911
11912 return false;
11913 }
11914
11916 {
11917
11918
11919 return false;
11920 }
11921
11923 {
11924
11925 return false;
11926 }
11927
11930 {
11931 return !GetIsFrozen() &&
IsOpen();
11932 }
11933
11935 {
11936 bool hasParent = false, hasRootAsPlayer = false;
11938
11939 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11940 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11941
11942 if (wwtu || foodDecay)
11943 {
11947
11948 if (processWetness || processTemperature || processDecay)
11949 {
11951
11952 if (processWetness)
11953 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11954
11955 if (processTemperature)
11957
11958 if (processDecay)
11959 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11960 }
11961 }
11962 }
11963
11966 {
11968 }
11969
11971 {
11974
11975 return super.GetTemperatureFreezeThreshold();
11976 }
11977
11979 {
11982
11983 return super.GetTemperatureThawThreshold();
11984 }
11985
11987 {
11990
11991 return super.GetItemOverheatThreshold();
11992 }
11993
11995 {
11997 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11998
11999 return super.GetTemperatureFreezeTime();
12000 }
12001
12003 {
12005 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12006
12007 return super.GetTemperatureThawTime();
12008 }
12009
12014
12016 {
12017 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12018 }
12019
12021 {
12022 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12023 }
12024
12027 {
12029 }
12030
12032 {
12034 }
12035
12037 {
12039 }
12040
12043 {
12044 return null;
12045 }
12046
12049 {
12050 return false;
12051 }
12052
12054 {
12056 {
12059 if (!trg)
12060 {
12062 explosive = this;
12063 }
12064
12065 explosive.PairRemote(trg);
12067
12068 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12069 trg.SetPersistentPairID(persistentID);
12070 explosive.SetPersistentPairID(persistentID);
12071
12072 return true;
12073 }
12074 return false;
12075 }
12076
12079 {
12080 float ret = 1.0;
12083 ret *= GetHealth01();
12084
12085 return ret;
12086 }
12087
12088 #ifdef DEVELOPER
12089 override void SetDebugItem()
12090 {
12091 super.SetDebugItem();
12092 _itemBase = this;
12093 }
12094
12096 {
12097 string text = super.GetDebugText();
12098
12100 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12101
12102 return text;
12103 }
12104 #endif
12105
12107 {
12108 return true;
12109 }
12110
12112
12114
12116 {
12119 }
12120
12121
12129
12145}
12146
12148{
12150 if (entity)
12151 {
12152 bool is_item = entity.IsInherited(
ItemBase);
12153 if (is_item && full_quantity)
12154 {
12157 }
12158 }
12159 else
12160 {
12162 return NULL;
12163 }
12164 return entity;
12165}
12166
12168{
12169 if (item)
12170 {
12171 if (health > 0)
12172 item.SetHealth("", "", health);
12173
12174 if (item.CanHaveTemperature())
12175 {
12177 if (item.CanFreeze())
12178 item.SetFrozen(false);
12179 }
12180
12181 if (item.HasEnergyManager())
12182 {
12183 if (quantity >= 0)
12184 {
12185 item.GetCompEM().SetEnergy0To1(quantity);
12186 }
12187 else
12188 {
12190 }
12191 }
12192 else if (item.IsMagazine())
12193 {
12194 Magazine mag = Magazine.Cast(item);
12195 if (quantity >= 0)
12196 {
12197 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12198 }
12199 else
12200 {
12202 }
12203
12204 }
12205 else
12206 {
12207 if (quantity >= 0)
12208 {
12209 item.SetQuantityNormalized(quantity, false);
12210 }
12211 else
12212 {
12214 }
12215
12216 }
12217 }
12218}
12219
12220#ifdef DEVELOPER
12222#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.