7355{
7357 {
7358 return true;
7359 }
7360};
7361
7362
7363
7365{
7369
7371
7374
7375
7376
7377
7378
7387
7393
7398
7403
7424 protected bool m_IsResultOfSplit
7425
7427
7432
7433
7434
7436
7440
7441
7442
7444
7447
7448
7449
7455
7456
7464
7467
7468
7470
7471
7473
7474
7479
7480
7485
7486
7488
7489
7491 {
7496
7497 if (!
GetGame().IsDedicatedServer())
7498 {
7500 {
7502
7504 {
7506 }
7507 }
7508
7511 }
7512
7513 m_OldLocation = null;
7514
7516 {
7518 }
7519
7520 if (ConfigIsExisting("headSelectionsToHide"))
7521 {
7524 }
7525
7527 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7528 {
7530 }
7531
7533
7534 m_IsResultOfSplit = false;
7535
7537 }
7538
7540 {
7541 super.InitItemVariables();
7542
7548 m_Count = ConfigGetInt(
"count");
7549
7552
7557
7560
7565
7577
7581
7582
7585 if (ConfigIsExisting("canBeSplit"))
7586 {
7589 }
7590
7592 if (ConfigIsExisting("itemBehaviour"))
7594
7595
7598 RegisterNetSyncVariableInt("m_VarLiquidType");
7599 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7600
7601 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7602 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7603 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7604
7605 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7606 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7607 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7608 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7609
7610 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7611 RegisterNetSyncVariableBool("m_IsTakeable");
7612 RegisterNetSyncVariableBool("m_IsHologram");
7613
7616 {
7619 }
7620
7622
7624 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7626
7627 }
7628
7630 {
7632 }
7633
7635 {
7638 {
7643 }
7644 }
7645
7646 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7647 {
7649 {
7652 }
7653
7655 }
7656
7658 {
7664 }
7665
7667
7669 {
7671
7672 if (!action)
7673 {
7674 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7675 return;
7676 }
7677
7679 if (!ai)
7680 {
7682 return;
7683 }
7684
7686 if (!action_array)
7687 {
7688 action_array = new array<ActionBase_Basic>;
7690 }
7691 if (LogManager.IsActionLogEnable())
7692 {
7693 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7694 }
7695
7696 if (action_array.Find(action) != -1)
7697 {
7698 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7699 }
7700 else
7701 {
7702 action_array.Insert(action);
7703 }
7704 }
7705
7707 {
7709 ActionBase action = player.GetActionManager().GetAction(actionName);
7712
7713 if (action_array)
7714 {
7715 action_array.RemoveItem(action);
7716 }
7717 }
7718
7719
7720
7722 {
7723 ActionOverrideData overrideData = new ActionOverrideData();
7727
7729 if (!actionMap)
7730 {
7733 }
7734
7735 actionMap.Insert(this.
Type(), overrideData);
7736
7737 }
7738
7740
7742
7743
7745 {
7748
7751
7752 string config_to_search = "CfgVehicles";
7753 string muzzle_owner_config;
7754
7756 {
7757 if (IsInherited(Weapon))
7758 config_to_search = "CfgWeapons";
7759
7760 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7761
7762 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7763
7765
7766 if (config_OnFire_subclass_count > 0)
7767 {
7768 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7769
7770 for (int i = 0; i < config_OnFire_subclass_count; i++)
7771 {
7772 string particle_class = "";
7774 string config_OnFire_entry = config_OnFire_class + particle_class;
7775 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7776 WPOF_array.Insert(WPOF);
7777 }
7778
7779
7781 }
7782 }
7783
7785 {
7786 config_to_search = "CfgWeapons";
7787 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7788
7789 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7790
7792
7793 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7794 {
7795 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7796
7797 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7798 {
7799 string particle_class2 = "";
7801 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7802 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7803 WPOBE_array.Insert(WPOBE);
7804 }
7805
7806
7808 }
7809 }
7810 }
7811
7812
7814 {
7817
7819 {
7820 string config_to_search = "CfgVehicles";
7821
7822 if (IsInherited(Weapon))
7823 config_to_search = "CfgWeapons";
7824
7825 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7826 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7827
7828 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7829 {
7830
7832
7834 {
7836 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7838 return;
7839 }
7840
7843
7844
7845
7847 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7848
7849 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7850 {
7851 string particle_class = "";
7853 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7855
7856 if (entry_type == CT_CLASS)
7857 {
7858 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7859 WPOOH_array.Insert(WPOF);
7860 }
7861 }
7862
7863
7865 }
7866 }
7867 }
7868
7870 {
7872 }
7873
7875 {
7877 {
7879
7882
7885
7886 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7887 }
7888 }
7889
7891 {
7893 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7894
7896 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7897
7899 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7900
7902 {
7904 }
7905 }
7906
7908 {
7910 }
7911
7913 {
7916 else
7918
7920 {
7923 }
7924 else
7925 {
7928
7931 }
7932
7934 }
7935
7937 {
7939 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7940 }
7941
7943 {
7945 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7947 }
7948
7950 {
7952 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7953 }
7954
7956 {
7959
7960 OverheatingParticle OP = new OverheatingParticle();
7965
7967 }
7968
7970 {
7973
7974 return -1;
7975 }
7976
7978 {
7980 {
7983
7984 for (int i = count; i > 0; --i)
7985 {
7986 int id = i - 1;
7989
7992
7993 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7994 {
7995 if (p)
7996 {
7999 }
8000 }
8001 }
8002 }
8003 }
8004
8006 {
8008 {
8010 {
8011 int id = i - 1;
8013
8014 if (OP)
8015 {
8017
8018 if (p)
8019 {
8021 }
8022
8023 delete OP;
8024 }
8025 }
8026
8029 }
8030 }
8031
8034 {
8035 return 0.0;
8036 }
8037
8038
8040 {
8041 return 250;
8042 }
8043
8045 {
8046 return 0;
8047 }
8048
8051 {
8053 return true;
8054
8055 return false;
8056 }
8057
8060 {
8063
8065 {
8067 }
8068 else
8069 {
8070
8072 }
8073
8075 }
8076
8083 {
8084 return -1;
8085 }
8086
8087
8088
8089
8091 {
8093 {
8095 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8096
8097 if (r_index >= 0)
8098 {
8099 InventoryLocation r_il = new InventoryLocation;
8100 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8101
8102 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8105 {
8106 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8107 }
8109 {
8110 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8111 }
8112
8113 }
8114
8115 player.GetHumanInventory().ClearUserReservedLocation(this);
8116 }
8117
8120 }
8121
8122
8123
8124
8126 {
8127 return ItemBase.m_DebugActionsMask;
8128 }
8129
8131 {
8132 return ItemBase.m_DebugActionsMask & mask;
8133 }
8134
8136 {
8137 ItemBase.m_DebugActionsMask = mask;
8138 }
8139
8141 {
8142 ItemBase.m_DebugActionsMask |= mask;
8143 }
8144
8146 {
8147 ItemBase.m_DebugActionsMask &= ~mask;
8148 }
8149
8151 {
8153 {
8155 }
8156 else
8157 {
8159 }
8160 }
8161
8162
8164 {
8165 if (GetEconomyProfile())
8166 {
8167 float q_max = GetEconomyProfile().GetQuantityMax();
8168 if (q_max > 0)
8169 {
8170 float q_min = GetEconomyProfile().GetQuantityMin();
8171 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8172
8174 {
8175 ComponentEnergyManager comp = GetCompEM();
8177 {
8179 }
8180 }
8182 {
8184
8185 }
8186
8187 }
8188 }
8189 }
8190
8193 {
8194 EntityAI parent = GetHierarchyParent();
8195
8196 if (parent)
8197 {
8198 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8199 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8200 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8201 }
8202 }
8203
8206 {
8207 EntityAI parent = GetHierarchyParent();
8208
8209 if (parent)
8210 {
8211 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8212 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8213 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8214 }
8215 }
8216
8218 {
8219
8220
8221
8222
8224
8226 {
8227 if (ScriptInputUserData.CanStoreInputUserData())
8228 {
8229 ScriptInputUserData ctx = new ScriptInputUserData;
8235 ctx.
Write(use_stack_max);
8238
8240 {
8241 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8242 }
8243 }
8244 }
8245 else if (!
GetGame().IsMultiplayer())
8246 {
8248 }
8249 }
8250
8252 {
8254 }
8255
8257 {
8259 }
8260
8262 {
8264 }
8265
8267 {
8268
8269 return false;
8270 }
8271
8273 {
8274 return false;
8275 }
8276
8280 {
8281 return false;
8282 }
8283
8285 {
8286 return "";
8287 }
8288
8290
8292 {
8293 return false;
8294 }
8295
8297 {
8298 return true;
8299 }
8300
8301
8302
8304 {
8305 return true;
8306 }
8307
8309 {
8310 return true;
8311 }
8312
8314 {
8315 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8317 }
8318
8320 {
8322 }
8323
8325 {
8327 if (!is_being_placed)
8329 SetSynchDirty();
8330 }
8331
8332
8334
8336 {
8338 }
8339
8341 {
8343 }
8344
8346 {
8347 return 1;
8348 }
8349
8351 {
8352 return false;
8353 }
8354
8356 {
8358 SetSynchDirty();
8359 }
8360
8361
8362
8363
8364
8365
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
8396 {
8397 super.OnMovedInsideCargo(container);
8398
8399 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8400 }
8401
8402 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8403 {
8404 super.EEItemLocationChanged(oldLoc,newLoc);
8405
8406 PlayerBase new_player = null;
8407 PlayerBase old_player = null;
8408
8409 if (newLoc.GetParent())
8410 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8411
8412 if (oldLoc.GetParent())
8413 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8414
8416 {
8417 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8418
8419 if (r_index >= 0)
8420 {
8421 InventoryLocation r_il = new InventoryLocation;
8422 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8423
8424 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8427 {
8428 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8429 }
8431 {
8432 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8433 }
8434
8435 }
8436 }
8437
8439 {
8440 if (new_player)
8441 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8442
8443 if (new_player == old_player)
8444 {
8445
8446 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8447 {
8449 {
8450 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8451 {
8452 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8453 }
8454 }
8455 else
8456 {
8457 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8458 }
8459 }
8460
8461 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8462 {
8463 int type = oldLoc.GetType();
8465 {
8466 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8467 }
8469 {
8470 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8471 }
8472 }
8473 if (!m_OldLocation)
8474 {
8475 m_OldLocation = new InventoryLocation;
8476 }
8477 m_OldLocation.Copy(oldLoc);
8478 }
8479 else
8480 {
8481 if (m_OldLocation)
8482 {
8483 m_OldLocation.Reset();
8484 }
8485 }
8486
8488 }
8489 else
8490 {
8491 if (new_player)
8492 {
8493 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8494 if (res_index >= 0)
8495 {
8496 InventoryLocation il = new InventoryLocation;
8497 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8499 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8502 {
8503 il.
GetParent().GetOnReleaseLock().Invoke(it);
8504 }
8506 {
8508 }
8509
8510 }
8511 }
8513 {
8514
8516 }
8517
8518 if (m_OldLocation)
8519 {
8520 m_OldLocation.Reset();
8521 }
8522 }
8523 }
8524
8525 override void EOnContact(IEntity other, Contact extra)
8526 {
8528 {
8529 int liquidType = -1;
8531 if (impactSpeed > 0.0)
8532 {
8534 #ifndef SERVER
8536 #else
8538 SetSynchDirty();
8539 #endif
8541 }
8542 }
8543
8544 #ifdef SERVER
8545 if (GetCompEM() && GetCompEM().IsPlugged())
8546 {
8547 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8548 GetCompEM().UnplugThis();
8549 }
8550 #endif
8551 }
8552
8554
8556 {
8558 }
8559
8561 {
8562
8563 }
8564
8566 {
8567 super.OnItemLocationChanged(old_owner, new_owner);
8568
8569 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8570 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8571
8572 if (!relatedPlayer && playerNew)
8573 relatedPlayer = playerNew;
8574
8575 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8576 {
8578 if (actionMgr)
8579 {
8580 ActionBase currentAction = actionMgr.GetRunningAction();
8581 if (currentAction)
8583 }
8584 }
8585
8586 Man ownerPlayerOld = null;
8587 Man ownerPlayerNew = null;
8588
8589 if (old_owner)
8590 {
8591 if (old_owner.
IsMan())
8592 {
8593 ownerPlayerOld = Man.Cast(old_owner);
8594 }
8595 else
8596 {
8597 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8598 }
8599 }
8600 else
8601 {
8603 {
8605
8606 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8607 {
8608 GetCompEM().UnplugThis();
8609 }
8610 }
8611 }
8612
8613 if (new_owner)
8614 {
8615 if (new_owner.
IsMan())
8616 {
8617 ownerPlayerNew = Man.Cast(new_owner);
8618 }
8619 else
8620 {
8621 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8622 }
8623 }
8624
8625 if (ownerPlayerOld != ownerPlayerNew)
8626 {
8627 if (ownerPlayerOld)
8628 {
8629 array<EntityAI> subItemsExit = new array<EntityAI>;
8631 for (int i = 0; i < subItemsExit.Count(); i++)
8632 {
8635 }
8636 }
8637
8638 if (ownerPlayerNew)
8639 {
8640 array<EntityAI> subItemsEnter = new array<EntityAI>;
8642 for (int j = 0; j < subItemsEnter.Count(); j++)
8643 {
8646 }
8647 }
8648 }
8649 else if (ownerPlayerNew != null)
8650 {
8651 PlayerBase nplayer;
8652 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8653 {
8654 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8656 for (int k = 0; k < subItemsUpdate.Count(); k++)
8657 {
8659 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8660 }
8661 }
8662 }
8663
8664 if (old_owner)
8665 old_owner.OnChildItemRemoved(this);
8666 if (new_owner)
8667 new_owner.OnChildItemReceived(this);
8668 }
8669
8670
8672 {
8673 super.EEDelete(parent);
8674 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8675 if (player)
8676 {
8678
8679 if (player.IsAlive())
8680 {
8681 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8682 if (r_index >= 0)
8683 {
8684 InventoryLocation r_il = new InventoryLocation;
8685 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8686
8687 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8690 {
8691 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8692 }
8694 {
8695 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8696 }
8697
8698 }
8699
8700 player.RemoveQuickBarEntityShortcut(this);
8701 }
8702 }
8703 }
8704
8706 {
8707 super.EEKilled(killer);
8708
8711 {
8712 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8713 {
8714 if (IsMagazine())
8715 {
8716 if (Magazine.Cast(this).GetAmmoCount() > 0)
8717 {
8719 }
8720 }
8721 else
8722 {
8724 }
8725 }
8726 }
8727 }
8728
8730 {
8731 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8732
8733 super.OnWasAttached(parent, slot_id);
8734
8737
8739 }
8740
8742 {
8743 super.OnWasDetached(parent, slot_id);
8744
8747 }
8748
8750 {
8751 int idx;
8754
8755 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8756 if (inventory_slots.Count() < 1)
8757 {
8758 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8759 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8760 }
8761 else
8762 {
8763 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8764 }
8765
8766 idx = inventory_slots.Find(slot);
8767 if (idx < 0)
8768 return "";
8769
8770 return attach_types.Get(idx);
8771 }
8772
8774 {
8775 int idx = -1;
8776 string slot;
8777
8780
8781 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8782 if (inventory_slots.Count() < 1)
8783 {
8784 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8785 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8786 }
8787 else
8788 {
8789 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8790 if (detach_types.Count() < 1)
8791 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8792 }
8793
8794 for (int i = 0; i < inventory_slots.Count(); i++)
8795 {
8796 slot = inventory_slots.Get(i);
8797 }
8798
8799 if (slot != "")
8800 {
8801 if (detach_types.Count() == 1)
8802 idx = 0;
8803 else
8804 idx = inventory_slots.Find(slot);
8805 }
8806 if (idx < 0)
8807 return "";
8808
8809 return detach_types.Get(idx);
8810 }
8811
8813 {
8814
8816
8817
8818 float min_time = 1;
8819 float max_time = 3;
8820 float delay = Math.RandomFloat(min_time, max_time);
8821
8822 explode_timer.Run(delay, this, "DoAmmoExplosion");
8823 }
8824
8826 {
8827 Magazine magazine = Magazine.Cast(this);
8828 int pop_sounds_count = 6;
8829 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8830
8831
8832 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8833 string sound_name = pop_sounds[ sound_idx ];
8835
8836
8837 magazine.ServerAddAmmoCount(-1);
8838
8839
8840 float min_temp_to_explode = 100;
8841
8842 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8843 {
8845 }
8846 }
8847
8848
8849 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8850 {
8851 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8852
8853 const int CHANCE_DAMAGE_CARGO = 4;
8854 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8855 const int CHANCE_DAMAGE_NOTHING = 2;
8856
8858 {
8859 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8860 int chances;
8861 int rnd;
8862
8863 if (GetInventory().GetCargo())
8864 {
8865 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8866 rnd = Math.RandomInt(0,chances);
8867
8868 if (rnd < CHANCE_DAMAGE_CARGO)
8869 {
8871 }
8872 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8873 {
8875 }
8876 }
8877 else
8878 {
8879 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8880 rnd = Math.RandomInt(0,chances);
8881
8882 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8883 {
8885 }
8886 }
8887 }
8888 }
8889
8891 {
8892 if (GetInventory().GetCargo())
8893 {
8894 int item_count = GetInventory().GetCargo().GetItemCount();
8895 if (item_count > 0)
8896 {
8897 int random_pick = Math.RandomInt(0, item_count);
8899 if (!item.IsExplosive())
8900 {
8901 item.AddHealth("","",damage);
8902 return true;
8903 }
8904 }
8905 }
8906 return false;
8907 }
8908
8910 {
8911 int attachment_count = GetInventory().AttachmentCount();
8912 if (attachment_count > 0)
8913 {
8914 int random_pick = Math.RandomInt(0, attachment_count);
8915 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8916 if (!attachment.IsExplosive())
8917 {
8918 attachment.AddHealth("","",damage);
8919 return true;
8920 }
8921 }
8922 return false;
8923 }
8924
8926 {
8928 }
8929
8931 {
8933 return GetInventory().CanRemoveEntity();
8934
8935 return false;
8936 }
8937
8939 {
8941 return;
8942
8944 {
8945 if (ScriptInputUserData.CanStoreInputUserData())
8946 {
8947 ScriptInputUserData ctx = new ScriptInputUserData;
8952 ctx.
Write(destination_entity);
8956 }
8957 }
8958 else if (!
GetGame().IsMultiplayer())
8959 {
8961 }
8962 }
8963
8965 {
8967 return;
8968
8969 float split_quantity_new;
8973 InventoryLocation loc = new InventoryLocation;
8974
8975 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8976 {
8978 split_quantity_new = stack_max;
8979 else
8981
8982 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8983 if (new_item)
8984 {
8985 new_item.SetResultOfSplit(true);
8986 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8988 new_item.SetQuantity(split_quantity_new);
8989 }
8990 }
8991 else if (destination_entity && slot_id == -1)
8992 {
8993 if (quantity > stack_max)
8994 split_quantity_new = stack_max;
8995 else
8996 split_quantity_new = quantity;
8997
8999 {
9002 }
9003
9004 if (new_item)
9005 {
9006 new_item.SetResultOfSplit(true);
9007 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9009 new_item.SetQuantity(split_quantity_new);
9010 }
9011 }
9012 else
9013 {
9014 if (stack_max != 0)
9015 {
9017 {
9019 }
9020
9021 if (split_quantity_new == 0)
9022 {
9023 if (!
GetGame().IsMultiplayer())
9024 player.PhysicalPredictiveDropItem(this);
9025 else
9026 player.ServerDropEntity(this);
9027 return;
9028 }
9029
9031
9032 if (new_item)
9033 {
9034 new_item.SetResultOfSplit(true);
9035 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9037 new_item.SetQuantity(stack_max);
9038 new_item.PlaceOnSurface();
9039 }
9040 }
9041 }
9042 }
9043
9045 {
9047 return;
9048
9049 float split_quantity_new;
9053 InventoryLocation loc = new InventoryLocation;
9054
9055 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9056 {
9058 split_quantity_new = stack_max;
9059 else
9061
9062 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9063 if (new_item)
9064 {
9065 new_item.SetResultOfSplit(true);
9066 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9068 new_item.SetQuantity(split_quantity_new);
9069 }
9070 }
9071 else if (destination_entity && slot_id == -1)
9072 {
9073 if (quantity > stack_max)
9074 split_quantity_new = stack_max;
9075 else
9076 split_quantity_new = quantity;
9077
9079 {
9082 }
9083
9084 if (new_item)
9085 {
9086 new_item.SetResultOfSplit(true);
9087 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9089 new_item.SetQuantity(split_quantity_new);
9090 }
9091 }
9092 else
9093 {
9094 if (stack_max != 0)
9095 {
9097 {
9099 }
9100
9102
9103 if (new_item)
9104 {
9105 new_item.SetResultOfSplit(true);
9106 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9108 new_item.SetQuantity(stack_max);
9109 new_item.PlaceOnSurface();
9110 }
9111 }
9112 }
9113 }
9114
9116 {
9118 return;
9119
9121 {
9122 if (ScriptInputUserData.CanStoreInputUserData())
9123 {
9124 ScriptInputUserData ctx = new ScriptInputUserData;
9129 dst.WriteToContext(ctx);
9131 }
9132 }
9133 else if (!
GetGame().IsMultiplayer())
9134 {
9136 }
9137 }
9138
9140 {
9142 return;
9143
9145 {
9146 if (ScriptInputUserData.CanStoreInputUserData())
9147 {
9148 ScriptInputUserData ctx = new ScriptInputUserData;
9153 ctx.
Write(destination_entity);
9159 }
9160 }
9161 else if (!
GetGame().IsMultiplayer())
9162 {
9164 }
9165 }
9166
9168 {
9170 }
9171
9173 {
9175 return this;
9176
9178 float split_quantity_new;
9180 if (dst.IsValid())
9181 {
9182 int slot_id = dst.GetSlot();
9184
9185 if (quantity > stack_max)
9186 split_quantity_new = stack_max;
9187 else
9188 split_quantity_new = quantity;
9189
9191
9192 if (new_item)
9193 {
9194 new_item.SetResultOfSplit(true);
9195 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9198 }
9199
9200 return new_item;
9201 }
9202
9203 return null;
9204 }
9205
9207 {
9209 return;
9210
9212 float split_quantity_new;
9214 if (destination_entity)
9215 {
9217 if (quantity > stackable)
9218 split_quantity_new = stackable;
9219 else
9220 split_quantity_new = quantity;
9221
9222 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9223 if (new_item)
9224 {
9225 new_item.SetResultOfSplit(true);
9226 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9228 new_item.SetQuantity(split_quantity_new);
9229 }
9230 }
9231 }
9232
9234 {
9236 return;
9237
9239 {
9240 if (ScriptInputUserData.CanStoreInputUserData())
9241 {
9242 ScriptInputUserData ctx = new ScriptInputUserData;
9247 ItemBase destination_entity =
this;
9248 ctx.
Write(destination_entity);
9252 }
9253 }
9254 else if (!
GetGame().IsMultiplayer())
9255 {
9257 }
9258 }
9259
9261 {
9263 return;
9264
9266 float split_quantity_new;
9268 if (player)
9269 {
9271 if (quantity > stackable)
9272 split_quantity_new = stackable;
9273 else
9274 split_quantity_new = quantity;
9275
9276 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9277 new_item =
ItemBase.Cast(in_hands);
9278 if (new_item)
9279 {
9280 new_item.SetResultOfSplit(true);
9281 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9283 new_item.SetQuantity(split_quantity_new);
9284 }
9285 }
9286 }
9287
9289 {
9291 return;
9292
9294 float split_quantity_new = Math.Floor(quantity * 0.5);
9295
9297
9298 if (new_item)
9299 {
9300 if (new_item.GetQuantityMax() < split_quantity_new)
9301 {
9302 split_quantity_new = new_item.GetQuantityMax();
9303 }
9304
9305 new_item.SetResultOfSplit(true);
9306 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9307
9309 {
9312 }
9313 else
9314 {
9317 }
9318 }
9319 }
9320
9322 {
9324 return;
9325
9327 float split_quantity_new = Math.Floor(quantity / 2);
9328
9329 InventoryLocation invloc = new InventoryLocation;
9331
9333 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9334
9335 if (new_item)
9336 {
9337 if (new_item.GetQuantityMax() < split_quantity_new)
9338 {
9339 split_quantity_new = new_item.GetQuantityMax();
9340 }
9342 {
9345 }
9346 else
9347 {
9350 }
9351 }
9352 }
9353
9356 {
9357 SetWeightDirty();
9359
9360 if (parent)
9361 parent.OnAttachmentQuantityChangedEx(this, delta);
9362
9364 {
9366 {
9368 }
9370 {
9371 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9373 }
9374 }
9375
9376 }
9377
9380 {
9381
9382 }
9383
9386 {
9388 }
9389
9391 {
9392 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9393
9395 {
9396 if (newLevel == GameConstants.STATE_RUINED)
9397 {
9399 EntityAI parent = GetHierarchyParent();
9400 if (parent && parent.IsFireplace())
9401 {
9402 CargoBase cargo = GetInventory().GetCargo();
9403 if (cargo)
9404 {
9406 {
9408 }
9409 }
9410 }
9411 }
9412
9414 {
9415
9417 return;
9418 }
9419
9420 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9421 {
9423 }
9424 }
9425 }
9426
9427
9429 {
9430 super.OnRightClick();
9431
9433 {
9435 {
9436 if (ScriptInputUserData.CanStoreInputUserData())
9437 {
9438 vector m4[4];
9440
9441 EntityAI root = GetHierarchyRoot();
9442
9443 InventoryLocation dst = new InventoryLocation;
9445 {
9446 if (root)
9447 {
9448 root.GetTransform(m4);
9450 }
9451 else
9452 GetInventory().GetCurrentInventoryLocation(dst);
9453 }
9454 else
9455 {
9457
9458
9459 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9460 {
9461 if (root)
9462 {
9463 root.GetTransform(m4);
9465 }
9466 else
9467 GetInventory().GetCurrentInventoryLocation(dst);
9468 }
9469 else
9470 {
9471 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9472 }
9473 }
9474
9475 ScriptInputUserData ctx = new ScriptInputUserData;
9483 }
9484 }
9485 else if (!
GetGame().IsMultiplayer())
9486 {
9488 }
9489 }
9490 }
9491
9492 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9493 {
9494
9495 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9496 return false;
9497
9498 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9499 return false;
9500
9501
9503 return false;
9504
9505
9506 Magazine mag = Magazine.Cast(this);
9507 if (mag)
9508 {
9509 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9510 return false;
9511
9512 if (stack_max_limit)
9513 {
9514 Magazine other_mag = Magazine.Cast(other_item);
9515 if (other_item)
9516 {
9517 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9518 return false;
9519 }
9520
9521 }
9522 }
9523 else
9524 {
9525
9527 return false;
9528
9530 return false;
9531 }
9532
9533 PlayerBase player = null;
9534 if (CastTo(player, GetHierarchyRootPlayer()))
9535 {
9536 if (player.GetInventory().HasAttachment(this))
9537 return false;
9538
9539 if (player.IsItemsToDelete())
9540 return false;
9541 }
9542
9543 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9544 return false;
9545
9546 int slotID;
9548 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9549 return false;
9550
9551 return true;
9552 }
9553
9555 {
9557 }
9558
9560 {
9561 return m_IsResultOfSplit;
9562 }
9563
9565 {
9566 m_IsResultOfSplit = value;
9567 }
9568
9570 {
9572 }
9573
9575 {
9576 float other_item_quantity = other_item.GetQuantity();
9577 float this_free_space;
9578
9580
9582
9583 if (other_item_quantity > this_free_space)
9584 {
9585 return this_free_space;
9586 }
9587 else
9588 {
9589 return other_item_quantity;
9590 }
9591 }
9592
9594 {
9596 }
9597
9599 {
9601 return;
9602
9603 if (!IsMagazine() && other_item)
9604 {
9606 if (quantity_used != 0)
9607 {
9608 float hp1 = GetHealth01("","");
9609 float hp2 = other_item.GetHealth01("","");
9610 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9611 hpResult = hpResult / (
GetQuantity() + quantity_used);
9612
9613 hpResult *= GetMaxHealth();
9614 Math.Round(hpResult);
9615 SetHealth("", "Health", hpResult);
9616
9618 other_item.AddQuantity(-quantity_used);
9619 }
9620 }
9622 }
9623
9625 {
9626 #ifdef SERVER
9627 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9628 GetHierarchyParent().IncreaseLifetimeUp();
9629 #endif
9630 };
9631
9633 {
9634 PlayerBase p = PlayerBase.Cast(player);
9635
9636 array<int> recipesIds = p.m_Recipes;
9637 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9638 if (moduleRecipesManager)
9639 {
9640 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9641 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9642 }
9643
9644 for (int i = 0;i < recipesIds.Count(); i++)
9645 {
9646 int key = recipesIds.Get(i);
9647 string recipeName = moduleRecipesManager.GetRecipeName(key);
9649 }
9650 }
9651
9652
9653 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9654 {
9655 super.GetDebugActions(outputList);
9656
9657
9662
9663
9667
9671
9672
9675
9676
9678 {
9681 }
9682
9684
9687
9691 }
9692
9693
9694
9695
9697 {
9698 super.OnAction(action_id, player, ctx);
9699 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9700 {
9701 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9702 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9703 PlayerBase p = PlayerBase.Cast(player);
9704 if (
EActions.RECIPES_RANGE_START < 1000)
9705 {
9706 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9707 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9708 }
9709 }
9710 #ifndef SERVER
9711 else if (action_id ==
EActions.WATCH_PLAYER)
9712 {
9713 PluginDeveloper.SetDeveloperItemClientEx(player);
9714 }
9715 #endif
9717 {
9718 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9719 {
9720 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9721 OnDebugButtonPressServer(id + 1);
9722 }
9723
9724 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9725 {
9726 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9728 }
9729
9730 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9731 {
9732 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9734 }
9735
9736 else if (action_id ==
EActions.ADD_QUANTITY)
9737 {
9738 if (IsMagazine())
9739 {
9740 Magazine mag = Magazine.Cast(this);
9741 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9742 }
9743 else
9744 {
9746 }
9747
9748 if (m_EM)
9749 {
9750 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9751 }
9752
9753 }
9754
9755 else if (action_id ==
EActions.REMOVE_QUANTITY)
9756 {
9757 if (IsMagazine())
9758 {
9759 Magazine mag2 = Magazine.Cast(this);
9760 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9761 }
9762 else
9763 {
9765 }
9766 if (m_EM)
9767 {
9768 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9769 }
9770
9771 }
9772
9773 else if (action_id ==
EActions.SET_QUANTITY_0)
9774 {
9776
9777 if (m_EM)
9778 {
9779 m_EM.SetEnergy(0);
9780 }
9781 }
9782
9783 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9784 {
9786
9787 if (m_EM)
9788 {
9789 m_EM.SetEnergy(m_EM.GetEnergyMax());
9790 }
9791 }
9792
9793 else if (action_id ==
EActions.ADD_HEALTH)
9794 {
9795 AddHealth("","",GetMaxHealth("","Health")/5);
9796 }
9797 else if (action_id ==
EActions.REMOVE_HEALTH)
9798 {
9799 AddHealth("","",-GetMaxHealth("","Health")/5);
9800 }
9801 else if (action_id ==
EActions.DESTROY_HEALTH)
9802 {
9803 SetHealth01("","",0);
9804 }
9805 else if (action_id ==
EActions.WATCH_ITEM)
9806 {
9808 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9809 #ifdef DEVELOPER
9810 SetDebugDeveloper_item(this);
9811 #endif
9812 }
9813
9814 else if (action_id ==
EActions.ADD_TEMPERATURE)
9815 {
9816 AddTemperature(20);
9817
9818 }
9819
9820 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9821 {
9822 AddTemperature(-20);
9823
9824 }
9825
9826 else if (action_id ==
EActions.FLIP_FROZEN)
9827 {
9828 SetFrozen(!GetIsFrozen());
9829
9830 }
9831
9832 else if (action_id ==
EActions.ADD_WETNESS)
9833 {
9835
9836 }
9837
9838 else if (action_id ==
EActions.REMOVE_WETNESS)
9839 {
9841
9842 }
9843
9844 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9845 {
9848
9849
9850 }
9851
9852 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9853 {
9856 }
9857
9858 else if (action_id ==
EActions.MAKE_SPECIAL)
9859 {
9860 auto debugParams = DebugSpawnParams.WithPlayer(player);
9861 OnDebugSpawnEx(debugParams);
9862 }
9863
9864 else if (action_id ==
EActions.DELETE)
9865 {
9866 Delete();
9867 }
9868
9869 }
9870
9871
9872 return false;
9873 }
9874
9875
9876
9877
9881
9884
9885
9886
9888 {
9889 return false;
9890 }
9891
9892
9894 {
9895 return true;
9896 }
9897
9898
9900 {
9901 return true;
9902 }
9903
9904
9905
9907 {
9908 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9910 }
9911
9914 {
9915 return null;
9916 }
9917
9919 {
9920 return false;
9921 }
9922
9924 {
9925 return false;
9926 }
9927
9931
9932
9934 {
9935 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9936 return module_repairing.CanRepair(this, item_repair_kit);
9937 }
9938
9939
9940 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9941 {
9942 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9943 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9944 }
9945
9946
9948 {
9949
9950
9951
9952
9953
9954
9955
9956
9957 return 1;
9958 }
9959
9960
9961
9963 {
9965 }
9966
9967
9968
9970 {
9972 }
9973
9974
9983 {
9984 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9985
9986 if (player)
9987 {
9988 player.MessageStatus(text);
9989 }
9990 }
9991
9992
10001 {
10002 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10003
10004 if (player)
10005 {
10006 player.MessageAction(text);
10007 }
10008 }
10009
10010
10019 {
10020 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10021
10022 if (player)
10023 {
10024 player.MessageFriendly(text);
10025 }
10026 }
10027
10028
10037 {
10038 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10039
10040 if (player)
10041 {
10042 player.MessageImportant(text);
10043 }
10044 }
10045
10047 {
10048 return true;
10049 }
10050
10051
10052 override bool KindOf(
string tag)
10053 {
10054 bool found = false;
10055 string item_name = this.
GetType();
10058
10059 int array_size = item_tag_array.Count();
10060 for (int i = 0; i < array_size; i++)
10061 {
10062 if (item_tag_array.Get(i) == tag)
10063 {
10064 found = true;
10065 break;
10066 }
10067 }
10068 return found;
10069 }
10070
10071
10073 {
10074
10075 super.OnRPC(sender, rpc_type,ctx);
10076
10077
10078 switch (rpc_type)
10079 {
10080 #ifndef SERVER
10081 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10082 Param2<bool, string> p = new Param2<bool, string>(false, "");
10083
10085 return;
10086
10087 bool play = p.param1;
10088 string soundSet = p.param2;
10089
10090 if (play)
10091 {
10093 {
10095 {
10097 }
10098 }
10099 else
10100 {
10102 }
10103 }
10104 else
10105 {
10107 }
10108
10109 break;
10110 #endif
10111
10112 }
10113
10115 {
10117 }
10118 }
10119
10120
10121
10122
10124 {
10125 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10126 return plugin.GetID(
name);
10127 }
10128
10130 {
10131 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10132 return plugin.GetName(id);
10133 }
10134
10137 {
10138
10139
10140 int varFlags;
10141 if (!ctx.
Read(varFlags))
10142 return;
10143
10144 if (varFlags & ItemVariableFlags.FLOAT)
10145 {
10147 }
10148 }
10149
10151 {
10152
10153 super.SerializeNumericalVars(floats_out);
10154
10155
10156
10158 {
10160 }
10161
10163 {
10165 }
10166
10168 {
10170 }
10171
10173 {
10178 }
10179
10181 {
10183 }
10184 }
10185
10187 {
10188
10189 super.DeSerializeNumericalVars(floats);
10190
10191
10192 int index = 0;
10193 int mask = Math.Round(floats.Get(index));
10194
10195 index++;
10196
10198 {
10200 {
10202 }
10203 else
10204 {
10205 float quantity = floats.Get(index);
10206 SetQuantity(quantity,
true,
false,
false,
false);
10207 }
10208 index++;
10209 }
10210
10212 {
10213 float wet = floats.Get(index);
10215 index++;
10216 }
10217
10219 {
10220 int liquidtype = Math.Round(floats.Get(index));
10222 index++;
10223 }
10224
10226 {
10228 index++;
10230 index++;
10232 index++;
10234 index++;
10235 }
10236
10238 {
10239 int cleanness = Math.Round(floats.Get(index));
10241 index++;
10242 }
10243 }
10244
10246 {
10247 super.WriteVarsToCTX(ctx);
10248
10249
10251 {
10253 }
10254
10256 {
10258 }
10259
10261 {
10263 }
10264
10266 {
10267 int r,g,b,a;
10273 }
10274
10276 {
10278 }
10279 }
10280
10282 {
10283 if (!super.ReadVarsFromCTX(ctx,version))
10284 return false;
10285
10286 int intValue;
10287 float value;
10288
10289 if (version < 140)
10290 {
10291 if (!ctx.
Read(intValue))
10292 return false;
10293
10294 m_VariablesMask = intValue;
10295 }
10296
10298 {
10299 if (!ctx.
Read(value))
10300 return false;
10301
10303 {
10305 }
10306 else
10307 {
10309 }
10310 }
10311
10312 if (version < 140)
10313 {
10315 {
10316 if (!ctx.
Read(value))
10317 return false;
10318 SetTemperatureDirect(value);
10319 }
10320 }
10321
10323 {
10324 if (!ctx.
Read(value))
10325 return false;
10327 }
10328
10330 {
10331 if (!ctx.
Read(intValue))
10332 return false;
10334 }
10335
10337 {
10338 int r,g,b,a;
10340 return false;
10342 return false;
10344 return false;
10346 return false;
10347
10349 }
10350
10352 {
10353 if (!ctx.
Read(intValue))
10354 return false;
10356 }
10357
10358 if (version >= 138 && version < 140)
10359 {
10361 {
10362 if (!ctx.
Read(intValue))
10363 return false;
10364 SetFrozen(intValue);
10365 }
10366 }
10367
10368 return true;
10369 }
10370
10371
10373 {
10376 {
10378 }
10379
10380 if (!super.OnStoreLoad(ctx, version))
10381 {
10383 return false;
10384 }
10385
10386 if (version >= 114)
10387 {
10388 bool hasQuickBarIndexSaved;
10389
10390 if (!ctx.
Read(hasQuickBarIndexSaved))
10391 {
10393 return false;
10394 }
10395
10396 if (hasQuickBarIndexSaved)
10397 {
10398 int itmQBIndex;
10399
10400
10401 if (!ctx.
Read(itmQBIndex))
10402 {
10404 return false;
10405 }
10406
10407 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10408 if (itmQBIndex != -1 && parentPlayer)
10409 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10410 }
10411 }
10412 else
10413 {
10414
10415 PlayerBase player;
10416 int itemQBIndex;
10417 if (version ==
int.
MAX)
10418 {
10419 if (!ctx.
Read(itemQBIndex))
10420 {
10422 return false;
10423 }
10424 }
10425 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10426 {
10427
10428 if (!ctx.
Read(itemQBIndex))
10429 {
10431 return false;
10432 }
10433 if (itemQBIndex != -1 && player)
10434 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10435 }
10436 }
10437
10438 if (version < 140)
10439 {
10440
10441 if (!LoadVariables(ctx, version))
10442 {
10444 return false;
10445 }
10446 }
10447
10448
10450 {
10452 return false;
10453 }
10454 if (version >= 132)
10455 {
10457 if (raib)
10458 {
10460 {
10462 return false;
10463 }
10464 }
10465 }
10466
10468 return true;
10469 }
10470
10471
10472
10474 {
10475 super.OnStoreSave(ctx);
10476
10477 PlayerBase player;
10478 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10479 {
10481
10482 int itemQBIndex = -1;
10483 itemQBIndex = player.FindQuickBarEntityIndex(this);
10484 ctx.
Write(itemQBIndex);
10485 }
10486 else
10487 {
10489 }
10490
10492
10494 if (raib)
10495 {
10497 }
10498 }
10499
10500
10502 {
10503 super.AfterStoreLoad();
10504
10506 {
10508 }
10509
10511 {
10514 }
10515 }
10516
10518 {
10519 super.EEOnAfterLoad();
10520
10522 {
10524 }
10525
10528 }
10529
10531 {
10532 return false;
10533 }
10534
10535
10536
10538 {
10540 {
10541 #ifdef PLATFORM_CONSOLE
10542
10544 {
10546 if (menu)
10547 {
10549 }
10550 }
10551 #endif
10552 }
10553
10555 {
10558 }
10559
10561 {
10562 SetWeightDirty();
10564 }
10566 {
10569 }
10570
10572 {
10575 }
10577 {
10580 }
10581
10582 super.OnVariablesSynchronized();
10583 }
10584
10585
10586
10588 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10589 {
10590 if (!IsServerCheck(allow_client))
10591 return false;
10592
10594 return false;
10595
10598
10599 if (value <= (min + 0.001))
10600 value = min;
10601
10602 if (value == min)
10603 {
10604 if (destroy_config)
10605 {
10606 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10607 if (dstr)
10608 {
10610 this.Delete();
10611 return true;
10612 }
10613 }
10614 else if (destroy_forced)
10615 {
10617 this.Delete();
10618 return true;
10619 }
10620
10622 }
10623
10626
10628 {
10630
10631 if (delta)
10633 }
10634
10636
10637 return false;
10638 }
10639
10640
10642 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10643 {
10645 }
10646
10648 {
10651 }
10652
10654 {
10657 }
10658
10661 {
10662 float value_clamped = Math.Clamp(value, 0, 1);
10664 SetQuantity(result, destroy_config, destroy_forced);
10665 }
10666
10667
10670 {
10672 }
10673
10675 {
10677 }
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10689 {
10690 int slot = -1;
10691 if (GetInventory())
10692 {
10693 InventoryLocation il = new InventoryLocation;
10694 GetInventory().GetCurrentInventoryLocation(il);
10696 }
10697
10699 }
10700
10702 {
10703 float quantity_max = 0;
10704
10706 {
10707 if (attSlotID != -1)
10708 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10709
10710 if (quantity_max <= 0)
10712 }
10713
10714 if (quantity_max <= 0)
10716
10717 return quantity_max;
10718 }
10719
10721 {
10723 }
10724
10726 {
10728 }
10729
10730
10732 {
10734 }
10735
10737 {
10739 }
10740
10742 {
10744 }
10745
10746
10748 {
10749
10750 float weightEx = GetWeightEx();
10751 float special = GetInventoryAndCargoWeight();
10752 return weightEx - special;
10753 }
10754
10755
10757 {
10759 }
10760
10762 {
10764 {
10765 #ifdef DEVELOPER
10766 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10767 {
10768 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10770 }
10771 #endif
10772
10773 return GetQuantity() * GetConfigWeightModified();
10774 }
10775 else if (HasEnergyManager())
10776 {
10777 #ifdef DEVELOPER
10778 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10779 {
10780 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10781 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10782 }
10783 #endif
10784 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10785 }
10786 else
10787 {
10788 #ifdef DEVELOPER
10789 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10790 {
10791 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10792 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10793 }
10794 #endif
10795 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10796 }
10797 }
10798
10801 {
10802 int item_count = 0;
10804
10805 if (GetInventory().GetCargo() != NULL)
10806 {
10807 item_count = GetInventory().GetCargo().GetItemCount();
10808 }
10809
10810 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10811 {
10812 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10813 if (item)
10814 item_count += item.GetNumberOfItems();
10815 }
10816 return item_count;
10817 }
10818
10821 {
10822 float weight = 0;
10823 float wetness = 1;
10824 if (include_wetness)
10827 {
10828 weight = wetness * m_ConfigWeight;
10829 }
10831 {
10832 weight = 1;
10833 }
10834 return weight;
10835 }
10836
10837
10838
10840 {
10841 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10842 {
10843 GameInventory inv = GetInventory();
10844 array<EntityAI> items = new array<EntityAI>;
10846 for (int i = 0; i < items.Count(); i++)
10847 {
10849 if (item)
10850 {
10852 }
10853 }
10854 }
10855 }
10856
10857
10858
10859
10861 {
10862 float energy = 0;
10863 if (HasEnergyManager())
10864 {
10865 energy = GetCompEM().GetEnergy();
10866 }
10867 return energy;
10868 }
10869
10870
10872 {
10873 super.OnEnergyConsumed();
10874
10876 }
10877
10879 {
10880 super.OnEnergyAdded();
10881
10883 }
10884
10885
10887 {
10888 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10889 {
10891 {
10892 float energy_0to1 = GetCompEM().GetEnergy0To1();
10894 }
10895 }
10896 }
10897
10898
10900 {
10901 return ConfigGetFloat("heatIsolation");
10902 }
10903
10905 {
10907 }
10908
10910 {
10911 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10912 if (
GetGame().ConfigIsExisting(paramPath))
10914
10915 return 0.0;
10916 }
10917
10919 {
10920 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10921 if (
GetGame().ConfigIsExisting(paramPath))
10923
10924 return 0.0;
10925 }
10926
10927 override void SetWet(
float value,
bool allow_client =
false)
10928 {
10929 if (!IsServerCheck(allow_client))
10930 return;
10931
10934
10936
10937 m_VarWet = Math.Clamp(value, min, max);
10938
10940 {
10943 }
10944 }
10945
10946 override void AddWet(
float value)
10947 {
10949 }
10950
10952 {
10954 }
10955
10957 {
10959 }
10960
10962 {
10964 }
10965
10967 {
10969 }
10970
10972 {
10974 }
10975
10976 override void OnWetChanged(
float newVal,
float oldVal)
10977 {
10980 if (newLevel != oldLevel)
10981 {
10983 }
10984 }
10985
10987 {
10988 SetWeightDirty();
10989 }
10990
10992 {
10993 return GetWetLevelInternal(
m_VarWet);
10994 }
10995
10996
10997
10999 {
11001 }
11002
11004 {
11006 }
11007
11009 {
11011 }
11012
11014 {
11016 }
11017
11018
11019
11021 {
11022 if (ConfigIsExisting("itemModelLength"))
11023 {
11024 return ConfigGetFloat("itemModelLength");
11025 }
11026 return 0;
11027 }
11028
11030 {
11031 if (ConfigIsExisting("itemAttachOffset"))
11032 {
11033 return ConfigGetFloat("itemAttachOffset");
11034 }
11035 return 0;
11036 }
11037
11038 override void SetCleanness(
int value,
bool allow_client =
false)
11039 {
11040 if (!IsServerCheck(allow_client))
11041 return;
11042
11044
11046
11049 }
11050
11052 {
11054 }
11055
11057 {
11058 return true;
11059 }
11060
11061
11062
11063
11065 {
11067 }
11068
11070 {
11072 }
11073
11074
11075
11076
11077 override void SetColor(
int r,
int g,
int b,
int a)
11078 {
11084 }
11086 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11087 {
11092 }
11093
11095 {
11097 }
11098
11101 {
11102 int r,g,b,a;
11104 r = r/255;
11105 g = g/255;
11106 b = b/255;
11107 a = a/255;
11108 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11109 }
11110
11111
11112
11113 override void SetLiquidType(
int value,
bool allow_client =
false)
11114 {
11115 if (!IsServerCheck(allow_client))
11116 return;
11117
11122 }
11123
11125 {
11126 return ConfigGetInt("varLiquidTypeInit");
11127 }
11128
11130 {
11132 }
11133
11135 {
11137 SetFrozen(false);
11138 }
11139
11142 {
11143 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11144 }
11145
11146
11149 {
11150 PlayerBase nplayer;
11151 if (PlayerBase.CastTo(nplayer, player))
11152 {
11154
11155 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11156 }
11157 }
11158
11159
11162 {
11163 PlayerBase nplayer;
11164 if (PlayerBase.CastTo(nplayer,player))
11165 {
11166
11167 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11168
11169 }
11170
11171
11172 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11173
11174
11175 if (HasEnergyManager())
11176 {
11177 GetCompEM().UpdatePlugState();
11178 }
11179 }
11180
11181
11183 {
11184 super.OnPlacementStarted(player);
11185
11187 }
11188
11189 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11190 {
11192 {
11193 m_AdminLog.OnPlacementComplete(player,
this);
11194 }
11195
11196 super.OnPlacementComplete(player, position, orientation);
11197 }
11198
11199
11200
11201
11202
11204 {
11206 {
11207 return true;
11208 }
11209 else
11210 {
11211 return false;
11212 }
11213 }
11214
11215
11217 {
11219 {
11221 }
11222 }
11223
11224
11226 {
11228 }
11229
11231 {
11233 }
11234
11235 override void InsertAgent(
int agent,
float count = 1)
11236 {
11237 if (count < 1)
11238 return;
11239
11241 }
11242
11245 {
11247 }
11248
11249
11251 {
11253 }
11254
11255
11256
11257
11258
11259
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
11297 {
11299 return false;
11300 return true;
11301 }
11302
11304 {
11305
11307 }
11308
11309
11312 {
11313 super.CheckForRoofLimited(timeTresholdMS);
11314
11316 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11317 {
11318 m_PreviousRoofTestTime = time;
11319 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11320 }
11321 }
11322
11323
11325 {
11327 {
11328 return 0;
11329 }
11330
11331 if (GetInventory().GetAttachmentSlotsCount() != 0)
11332 {
11333 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11334 if (filter)
11335 return filter.GetProtectionLevel(type, false, system);
11336 else
11337 return 0;
11338 }
11339
11340 string subclassPath, entryName;
11341
11342 switch (type)
11343 {
11345 entryName = "biological";
11346 break;
11348 entryName = "chemical";
11349 break;
11350 default:
11351 entryName = "biological";
11352 break;
11353 }
11354
11355 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11356
11358 }
11359
11360
11361
11364 {
11365 if (!IsMagazine())
11367
11369 }
11370
11371
11372
11373
11374
11379 {
11380 return true;
11381 }
11382
11384 {
11386 }
11387
11388
11389
11390
11391
11393 {
11394 if (parent)
11395 {
11396 if (parent.IsInherited(DayZInfected))
11397 return true;
11398
11399 if (!parent.IsRuined())
11400 return true;
11401 }
11402
11403 return true;
11404 }
11405
11407 {
11408 if (!super.CanPutAsAttachment(parent))
11409 {
11410 return false;
11411 }
11412
11413 if (!IsRuined() && !parent.IsRuined())
11414 {
11415 return true;
11416 }
11417
11418 return false;
11419 }
11420
11422 {
11423
11424
11425
11426
11427 return super.CanReceiveItemIntoCargo(item);
11428 }
11429
11431 {
11432
11433
11434
11435
11436 GameInventory attachmentInv = attachment.GetInventory();
11438 {
11439 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11440 return false;
11441 }
11442
11443 InventoryLocation loc = new InventoryLocation();
11444 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11445 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11446 return false;
11447
11448 return super.CanReceiveAttachment(attachment, slotId);
11449 }
11450
11452 {
11453 if (!super.CanReleaseAttachment(attachment))
11454 return false;
11455
11456 return GetInventory().AreChildrenAccessible();
11457 }
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11480 {
11481 int id = muzzle_owner.GetMuzzleID();
11482 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11483
11484 if (WPOF_array)
11485 {
11486 for (int i = 0; i < WPOF_array.Count(); i++)
11487 {
11488 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11489
11490 if (WPOF)
11491 {
11492 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11493 }
11494 }
11495 }
11496 }
11497
11498
11500 {
11501 int id = muzzle_owner.GetMuzzleID();
11503
11504 if (WPOBE_array)
11505 {
11506 for (int i = 0; i < WPOBE_array.Count(); i++)
11507 {
11508 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11509
11510 if (WPOBE)
11511 {
11512 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11513 }
11514 }
11515 }
11516 }
11517
11518
11520 {
11521 int id = muzzle_owner.GetMuzzleID();
11522 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11523
11524 if (WPOOH_array)
11525 {
11526 for (int i = 0; i < WPOOH_array.Count(); i++)
11527 {
11528 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11529
11530 if (WPOOH)
11531 {
11532 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11533 }
11534 }
11535 }
11536 }
11537
11538
11540 {
11541 int id = muzzle_owner.GetMuzzleID();
11542 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11543
11544 if (WPOOH_array)
11545 {
11546 for (int i = 0; i < WPOOH_array.Count(); i++)
11547 {
11548 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11549
11550 if (WPOOH)
11551 {
11552 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11553 }
11554 }
11555 }
11556 }
11557
11558
11560 {
11561 int id = muzzle_owner.GetMuzzleID();
11562 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11563
11564 if (WPOOH_array)
11565 {
11566 for (int i = 0; i < WPOOH_array.Count(); i++)
11567 {
11568 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11569
11570 if (WPOOH)
11571 {
11572 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11573 }
11574 }
11575 }
11576 }
11577
11578
11579
11581 {
11583 {
11584 return true;
11585 }
11586
11587 return false;
11588 }
11589
11591 {
11593 {
11594 return true;
11595 }
11596
11597 return false;
11598 }
11599
11601 {
11603 {
11604 return true;
11605 }
11606
11607 return false;
11608 }
11609
11611 {
11612 return false;
11613 }
11614
11617 {
11618 return UATimeSpent.DEFAULT_DEPLOY;
11619 }
11620
11621
11622
11623
11625 {
11627 SetSynchDirty();
11628 }
11629
11631 {
11633 }
11634
11635
11637 {
11638 return false;
11639 }
11640
11643 {
11644 string att_type = "None";
11645
11646 if (ConfigIsExisting("soundAttType"))
11647 {
11648 att_type = ConfigGetString("soundAttType");
11649 }
11650
11652 }
11653
11655 {
11657 }
11658
11659
11660
11661
11662
11666
11668 {
11671
11673 }
11674
11675
11677 {
11679 return;
11680
11682
11685
11688
11689 SoundParameters params = new SoundParameters();
11693 }
11694
11695
11697 {
11699 return;
11700
11702 SetSynchDirty();
11703
11706 }
11707
11708
11710 {
11712 return;
11713
11715 SetSynchDirty();
11716
11719 }
11720
11722 {
11724 }
11725
11727 {
11729 }
11730
11733 {
11734 if (!
GetGame().IsDedicatedServer())
11735 {
11736 if (ConfigIsExisting("attachSoundSet"))
11737 {
11738 string cfg_path = "";
11739 string soundset = "";
11740 string type_name =
GetType();
11741
11744 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11745 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11746
11747 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11748 {
11749 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11750 {
11751 if (cfg_slot_array[i] == slot_type)
11752 {
11753 soundset = cfg_soundset_array[i];
11754 break;
11755 }
11756 }
11757 }
11758
11759 if (soundset != "")
11760 {
11761 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11763 }
11764 }
11765 }
11766 }
11767
11769 {
11770
11771 }
11772
11773 void OnApply(PlayerBase player);
11774
11776 {
11777 return 1.0;
11778 };
11779
11781 {
11783 }
11784
11786 {
11788 }
11789
11791
11793 {
11794 SetDynamicPhysicsLifeTime(0.01);
11796 }
11797
11799 {
11800 array<string> zone_names = new array<string>;
11801 GetDamageZones(zone_names);
11802 for (int i = 0; i < zone_names.Count(); i++)
11803 {
11804 SetHealthMax(zone_names.Get(i),"Health");
11805 }
11806 SetHealthMax("","Health");
11807 }
11808
11811 {
11812 float global_health = GetHealth01("","Health");
11813 array<string> zones = new array<string>;
11814 GetDamageZones(zones);
11815
11816 for (int i = 0; i < zones.Count(); i++)
11817 {
11818 SetHealth01(zones.Get(i),"Health",global_health);
11819 }
11820 }
11821
11824 {
11825 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11826 }
11827
11829 {
11830 if (!hasRootAsPlayer)
11831 {
11832 if (refParentIB)
11833 {
11834
11835 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11836 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11837
11838 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11839 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11840
11843 }
11844 else
11845 {
11846
11849 }
11850 }
11851 }
11852
11854 {
11856 {
11857 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11858 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11859 {
11860 float heatPermCoef = 1.0;
11862 while (ent)
11863 {
11864 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11865 ent = ent.GetHierarchyParent();
11866 }
11867
11868 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11869 }
11870 }
11871 }
11872
11874 {
11875
11876 EntityAI parent = GetHierarchyParent();
11877 if (!parent)
11878 {
11879 hasParent = false;
11880 hasRootAsPlayer = false;
11881 }
11882 else
11883 {
11884 hasParent = true;
11885 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11886 refParentIB =
ItemBase.Cast(parent);
11887 }
11888 }
11889
11890 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11891 {
11892
11893 }
11894
11896 {
11897
11898 return false;
11899 }
11900
11902 {
11903
11904
11905 return false;
11906 }
11907
11909 {
11910
11911 return false;
11912 }
11913
11916 {
11917 return !GetIsFrozen() &&
IsOpen();
11918 }
11919
11921 {
11922 bool hasParent = false, hasRootAsPlayer = false;
11924
11925 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11926 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11927
11928 if (wwtu || foodDecay)
11929 {
11933
11934 if (processWetness || processTemperature || processDecay)
11935 {
11937
11938 if (processWetness)
11939 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11940
11941 if (processTemperature)
11943
11944 if (processDecay)
11945 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11946 }
11947 }
11948 }
11949
11952 {
11954 }
11955
11957 {
11960
11961 return super.GetTemperatureFreezeThreshold();
11962 }
11963
11965 {
11968
11969 return super.GetTemperatureThawThreshold();
11970 }
11971
11973 {
11976
11977 return super.GetItemOverheatThreshold();
11978 }
11979
11981 {
11983 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11984
11985 return super.GetTemperatureFreezeTime();
11986 }
11987
11989 {
11991 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11992
11993 return super.GetTemperatureThawTime();
11994 }
11995
12000
12002 {
12003 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12004 }
12005
12007 {
12008 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12009 }
12010
12013 {
12015 }
12016
12018 {
12020 }
12021
12023 {
12025 }
12026
12029 {
12030 return null;
12031 }
12032
12035 {
12036 return false;
12037 }
12038
12040 {
12042 {
12045 if (!trg)
12046 {
12048 explosive = this;
12049 }
12050
12051 explosive.PairRemote(trg);
12053
12054 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12055 trg.SetPersistentPairID(persistentID);
12056 explosive.SetPersistentPairID(persistentID);
12057
12058 return true;
12059 }
12060 return false;
12061 }
12062
12065 {
12066 float ret = 1.0;
12069 ret *= GetHealth01();
12070
12071 return ret;
12072 }
12073
12074 #ifdef DEVELOPER
12075 override void SetDebugItem()
12076 {
12077 super.SetDebugItem();
12078 _itemBase = this;
12079 }
12080
12082 {
12083 string text = super.GetDebugText();
12084
12086 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12087
12088 return text;
12089 }
12090 #endif
12091
12093 {
12094 return true;
12095 }
12096
12098
12100
12102 {
12105 }
12106
12107
12115
12131}
12132
12134{
12136 if (entity)
12137 {
12138 bool is_item = entity.IsInherited(
ItemBase);
12139 if (is_item && full_quantity)
12140 {
12143 }
12144 }
12145 else
12146 {
12148 return NULL;
12149 }
12150 return entity;
12151}
12152
12154{
12155 if (item)
12156 {
12157 if (health > 0)
12158 item.SetHealth("", "", health);
12159
12160 if (item.CanHaveTemperature())
12161 {
12163 if (item.CanFreeze())
12164 item.SetFrozen(false);
12165 }
12166
12167 if (item.HasEnergyManager())
12168 {
12169 if (quantity >= 0)
12170 {
12171 item.GetCompEM().SetEnergy0To1(quantity);
12172 }
12173 else
12174 {
12176 }
12177 }
12178 else if (item.IsMagazine())
12179 {
12180 Magazine mag = Magazine.Cast(item);
12181 if (quantity >= 0)
12182 {
12183 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12184 }
12185 else
12186 {
12188 }
12189
12190 }
12191 else
12192 {
12193 if (quantity >= 0)
12194 {
12195 item.SetQuantityNormalized(quantity, false);
12196 }
12197 else
12198 {
12200 }
12201
12202 }
12203 }
12204}
12205
12206#ifdef DEVELOPER
12208#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.