7321{
7323 {
7324 return true;
7325 }
7326};
7327
7328
7329
7331{
7335
7337
7340
7341
7342
7343
7344
7353
7359
7364
7369
7390 protected bool m_IsResultOfSplit
7391
7393
7398
7399
7400
7402
7406
7407
7408
7410
7413
7414
7415
7421
7422
7430
7433
7434
7436
7437
7439
7440
7445
7446
7451
7452
7454
7455
7457 {
7462
7463 if (!
GetGame().IsDedicatedServer())
7464 {
7466 {
7468
7470 {
7472 }
7473 }
7474
7477 }
7478
7479 m_OldLocation = null;
7480
7482 {
7484 }
7485
7486 if (ConfigIsExisting("headSelectionsToHide"))
7487 {
7490 }
7491
7493 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7494 {
7496 }
7497
7499
7500 m_IsResultOfSplit = false;
7501
7503 }
7504
7506 {
7507 super.InitItemVariables();
7508
7514 m_Count = ConfigGetInt(
"count");
7515
7518
7523
7526
7531
7543
7547
7548
7551 if (ConfigIsExisting("canBeSplit"))
7552 {
7555 }
7556
7558 if (ConfigIsExisting("itemBehaviour"))
7560
7561
7564 RegisterNetSyncVariableInt("m_VarLiquidType");
7565 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7566
7567 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7568 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7569 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7570
7571 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7572 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7573 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7574 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7575
7576 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7577 RegisterNetSyncVariableBool("m_IsTakeable");
7578 RegisterNetSyncVariableBool("m_IsHologram");
7579
7582 {
7585 }
7586
7588
7590 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7592
7593 }
7594
7596 {
7598 }
7599
7601 {
7604 {
7609 }
7610 }
7611
7612 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7613 {
7615 {
7618 }
7619
7621 }
7622
7624 {
7630 }
7631
7633
7635 {
7637
7638 if (!action)
7639 {
7640 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7641 return;
7642 }
7643
7645 if (!ai)
7646 {
7648 return;
7649 }
7650
7652 if (!action_array)
7653 {
7654 action_array = new array<ActionBase_Basic>;
7656 }
7657 if (LogManager.IsActionLogEnable())
7658 {
7659 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7660 }
7661
7662 if (action_array.Find(action) != -1)
7663 {
7664 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7665 }
7666 else
7667 {
7668 action_array.Insert(action);
7669 }
7670 }
7671
7673 {
7675 ActionBase action = player.GetActionManager().GetAction(actionName);
7678
7679 if (action_array)
7680 {
7681 action_array.RemoveItem(action);
7682 }
7683 }
7684
7685
7686
7688 {
7689 ActionOverrideData overrideData = new ActionOverrideData();
7693
7695 if (!actionMap)
7696 {
7699 }
7700
7701 actionMap.Insert(this.
Type(), overrideData);
7702
7703 }
7704
7706
7708
7709
7711 {
7714
7717
7718 string config_to_search = "CfgVehicles";
7719 string muzzle_owner_config;
7720
7722 {
7723 if (IsInherited(Weapon))
7724 config_to_search = "CfgWeapons";
7725
7726 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7727
7728 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7729
7731
7732 if (config_OnFire_subclass_count > 0)
7733 {
7734 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7735
7736 for (int i = 0; i < config_OnFire_subclass_count; i++)
7737 {
7738 string particle_class = "";
7740 string config_OnFire_entry = config_OnFire_class + particle_class;
7741 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7742 WPOF_array.Insert(WPOF);
7743 }
7744
7745
7747 }
7748 }
7749
7751 {
7752 config_to_search = "CfgWeapons";
7753 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7754
7755 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7756
7758
7759 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7760 {
7761 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7762
7763 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7764 {
7765 string particle_class2 = "";
7767 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7768 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7769 WPOBE_array.Insert(WPOBE);
7770 }
7771
7772
7774 }
7775 }
7776 }
7777
7778
7780 {
7783
7785 {
7786 string config_to_search = "CfgVehicles";
7787
7788 if (IsInherited(Weapon))
7789 config_to_search = "CfgWeapons";
7790
7791 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7792 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7793
7794 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7795 {
7796
7798
7800 {
7802 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7804 return;
7805 }
7806
7809
7810
7811
7813 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7814
7815 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7816 {
7817 string particle_class = "";
7819 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7821
7822 if (entry_type == CT_CLASS)
7823 {
7824 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7825 WPOOH_array.Insert(WPOF);
7826 }
7827 }
7828
7829
7831 }
7832 }
7833 }
7834
7836 {
7838 }
7839
7841 {
7843 {
7845
7848
7851
7852 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7853 }
7854 }
7855
7857 {
7859 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7860
7862 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7863
7865 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7866
7868 {
7870 }
7871 }
7872
7874 {
7876 }
7877
7879 {
7882 else
7884
7886 {
7889 }
7890 else
7891 {
7894
7897 }
7898
7900 }
7901
7903 {
7905 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7906 }
7907
7909 {
7911 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7913 }
7914
7916 {
7918 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7919 }
7920
7922 {
7925
7926 OverheatingParticle OP = new OverheatingParticle();
7931
7933 }
7934
7936 {
7939
7940 return -1;
7941 }
7942
7944 {
7946 {
7949
7950 for (int i = count; i > 0; --i)
7951 {
7952 int id = i - 1;
7955
7958
7959 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7960 {
7961 if (p)
7962 {
7965 }
7966 }
7967 }
7968 }
7969 }
7970
7972 {
7974 {
7976 {
7977 int id = i - 1;
7979
7980 if (OP)
7981 {
7983
7984 if (p)
7985 {
7987 }
7988
7989 delete OP;
7990 }
7991 }
7992
7995 }
7996 }
7997
8000 {
8001 return 0.0;
8002 }
8003
8004
8006 {
8007 return 250;
8008 }
8009
8011 {
8012 return 0;
8013 }
8014
8017 {
8019 return true;
8020
8021 return false;
8022 }
8023
8026 {
8029
8031 {
8033 }
8034 else
8035 {
8036
8038 }
8039
8041 }
8042
8049 {
8050 return -1;
8051 }
8052
8053
8054
8055
8057 {
8059 {
8061 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8062
8063 if (r_index >= 0)
8064 {
8065 InventoryLocation r_il = new InventoryLocation;
8066 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8067
8068 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8071 {
8072 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8073 }
8075 {
8076 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8077 }
8078
8079 }
8080
8081 player.GetHumanInventory().ClearUserReservedLocation(this);
8082 }
8083
8086 }
8087
8088
8089
8090
8092 {
8093 return ItemBase.m_DebugActionsMask;
8094 }
8095
8097 {
8098 return ItemBase.m_DebugActionsMask & mask;
8099 }
8100
8102 {
8103 ItemBase.m_DebugActionsMask = mask;
8104 }
8105
8107 {
8108 ItemBase.m_DebugActionsMask |= mask;
8109 }
8110
8112 {
8113 ItemBase.m_DebugActionsMask &= ~mask;
8114 }
8115
8117 {
8119 {
8121 }
8122 else
8123 {
8125 }
8126 }
8127
8128
8130 {
8131 if (GetEconomyProfile())
8132 {
8133 float q_max = GetEconomyProfile().GetQuantityMax();
8134 if (q_max > 0)
8135 {
8136 float q_min = GetEconomyProfile().GetQuantityMin();
8137 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8138
8140 {
8141 ComponentEnergyManager comp = GetCompEM();
8143 {
8145 }
8146 }
8148 {
8150
8151 }
8152
8153 }
8154 }
8155 }
8156
8159 {
8160 EntityAI parent = GetHierarchyParent();
8161
8162 if (parent)
8163 {
8164 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8165 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8166 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8167 }
8168 }
8169
8172 {
8173 EntityAI parent = GetHierarchyParent();
8174
8175 if (parent)
8176 {
8177 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8178 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8179 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8180 }
8181 }
8182
8184 {
8185
8186
8187
8188
8190
8192 {
8193 if (ScriptInputUserData.CanStoreInputUserData())
8194 {
8195 ScriptInputUserData ctx = new ScriptInputUserData;
8201 ctx.
Write(use_stack_max);
8204
8206 {
8207 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8208 }
8209 }
8210 }
8211 else if (!
GetGame().IsMultiplayer())
8212 {
8214 }
8215 }
8216
8218 {
8220 }
8221
8223 {
8225 }
8226
8228 {
8230 }
8231
8233 {
8234
8235 return false;
8236 }
8237
8239 {
8240 return false;
8241 }
8242
8246 {
8247 return false;
8248 }
8249
8251 {
8252 return "";
8253 }
8254
8256
8258 {
8259 return false;
8260 }
8261
8263 {
8264 return true;
8265 }
8266
8267
8268
8270 {
8271 return true;
8272 }
8273
8275 {
8276 return true;
8277 }
8278
8280 {
8281 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8283 }
8284
8286 {
8288 }
8289
8291 {
8293 if (!is_being_placed)
8295 SetSynchDirty();
8296 }
8297
8298
8300
8302 {
8304 }
8305
8307 {
8309 }
8310
8312 {
8313 return 1;
8314 }
8315
8317 {
8318 return false;
8319 }
8320
8322 {
8324 SetSynchDirty();
8325 }
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8362 {
8363 super.OnMovedInsideCargo(container);
8364
8365 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8366 }
8367
8368 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8369 {
8370 super.EEItemLocationChanged(oldLoc,newLoc);
8371
8372 PlayerBase new_player = null;
8373 PlayerBase old_player = null;
8374
8375 if (newLoc.GetParent())
8376 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8377
8378 if (oldLoc.GetParent())
8379 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8380
8382 {
8383 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8384
8385 if (r_index >= 0)
8386 {
8387 InventoryLocation r_il = new InventoryLocation;
8388 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8389
8390 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8393 {
8394 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8395 }
8397 {
8398 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8399 }
8400
8401 }
8402 }
8403
8405 {
8406 if (new_player)
8407 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8408
8409 if (new_player == old_player)
8410 {
8411
8412 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8413 {
8415 {
8416 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8417 {
8418 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8419 }
8420 }
8421 else
8422 {
8423 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8424 }
8425 }
8426
8427 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8428 {
8429 int type = oldLoc.GetType();
8431 {
8432 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8433 }
8435 {
8436 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8437 }
8438 }
8439 if (!m_OldLocation)
8440 {
8441 m_OldLocation = new InventoryLocation;
8442 }
8443 m_OldLocation.Copy(oldLoc);
8444 }
8445 else
8446 {
8447 if (m_OldLocation)
8448 {
8449 m_OldLocation.Reset();
8450 }
8451 }
8452
8454 }
8455 else
8456 {
8457 if (new_player)
8458 {
8459 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8460 if (res_index >= 0)
8461 {
8462 InventoryLocation il = new InventoryLocation;
8463 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8465 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8468 {
8469 il.
GetParent().GetOnReleaseLock().Invoke(it);
8470 }
8472 {
8474 }
8475
8476 }
8477 }
8479 {
8480
8482 }
8483
8484 if (m_OldLocation)
8485 {
8486 m_OldLocation.Reset();
8487 }
8488 }
8489 }
8490
8491 override void EOnContact(IEntity other, Contact extra)
8492 {
8494 {
8495 int liquidType = -1;
8497 if (impactSpeed > 0.0)
8498 {
8500 #ifndef SERVER
8502 #else
8504 SetSynchDirty();
8505 #endif
8507 }
8508 }
8509
8510 #ifdef SERVER
8511 if (GetCompEM() && GetCompEM().IsPlugged())
8512 {
8513 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8514 GetCompEM().UnplugThis();
8515 }
8516 #endif
8517 }
8518
8520
8522 {
8524 }
8525
8527 {
8528
8529 }
8530
8532 {
8533 super.OnItemLocationChanged(old_owner, new_owner);
8534
8535 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8536 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8537
8538 if (!relatedPlayer && playerNew)
8539 relatedPlayer = playerNew;
8540
8541 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8542 {
8544 if (actionMgr)
8545 {
8546 ActionBase currentAction = actionMgr.GetRunningAction();
8547 if (currentAction)
8549 }
8550 }
8551
8552 Man ownerPlayerOld = null;
8553 Man ownerPlayerNew = null;
8554
8555 if (old_owner)
8556 {
8557 if (old_owner.
IsMan())
8558 {
8559 ownerPlayerOld = Man.Cast(old_owner);
8560 }
8561 else
8562 {
8563 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8564 }
8565 }
8566 else
8567 {
8569 {
8571
8572 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8573 {
8574 GetCompEM().UnplugThis();
8575 }
8576 }
8577 }
8578
8579 if (new_owner)
8580 {
8581 if (new_owner.
IsMan())
8582 {
8583 ownerPlayerNew = Man.Cast(new_owner);
8584 }
8585 else
8586 {
8587 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8588 }
8589 }
8590
8591 if (ownerPlayerOld != ownerPlayerNew)
8592 {
8593 if (ownerPlayerOld)
8594 {
8595 array<EntityAI> subItemsExit = new array<EntityAI>;
8597 for (int i = 0; i < subItemsExit.Count(); i++)
8598 {
8601 }
8602 }
8603
8604 if (ownerPlayerNew)
8605 {
8606 array<EntityAI> subItemsEnter = new array<EntityAI>;
8608 for (int j = 0; j < subItemsEnter.Count(); j++)
8609 {
8612 }
8613 }
8614 }
8615 else if (ownerPlayerNew != null)
8616 {
8617 PlayerBase nplayer;
8618 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8619 {
8620 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8622 for (int k = 0; k < subItemsUpdate.Count(); k++)
8623 {
8625 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8626 }
8627 }
8628 }
8629
8630 if (old_owner)
8631 old_owner.OnChildItemRemoved(this);
8632 if (new_owner)
8633 new_owner.OnChildItemReceived(this);
8634 }
8635
8636
8638 {
8639 super.EEDelete(parent);
8640 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8641 if (player)
8642 {
8644
8645 if (player.IsAlive())
8646 {
8647 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8648 if (r_index >= 0)
8649 {
8650 InventoryLocation r_il = new InventoryLocation;
8651 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8652
8653 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8656 {
8657 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8658 }
8660 {
8661 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8662 }
8663
8664 }
8665
8666 player.RemoveQuickBarEntityShortcut(this);
8667 }
8668 }
8669 }
8670
8672 {
8673 super.EEKilled(killer);
8674
8677 {
8678 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8679 {
8680 if (IsMagazine())
8681 {
8682 if (Magazine.Cast(this).GetAmmoCount() > 0)
8683 {
8685 }
8686 }
8687 else
8688 {
8690 }
8691 }
8692 }
8693 }
8694
8696 {
8697 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8698
8699 super.OnWasAttached(parent, slot_id);
8700
8703
8705 }
8706
8708 {
8709 super.OnWasDetached(parent, slot_id);
8710
8713 }
8714
8716 {
8717 int idx;
8720
8721 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8722 if (inventory_slots.Count() < 1)
8723 {
8724 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8725 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8726 }
8727 else
8728 {
8729 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8730 }
8731
8732 idx = inventory_slots.Find(slot);
8733 if (idx < 0)
8734 return "";
8735
8736 return attach_types.Get(idx);
8737 }
8738
8740 {
8741 int idx = -1;
8742 string slot;
8743
8746
8747 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8748 if (inventory_slots.Count() < 1)
8749 {
8750 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8751 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8752 }
8753 else
8754 {
8755 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8756 if (detach_types.Count() < 1)
8757 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8758 }
8759
8760 for (int i = 0; i < inventory_slots.Count(); i++)
8761 {
8762 slot = inventory_slots.Get(i);
8763 }
8764
8765 if (slot != "")
8766 {
8767 if (detach_types.Count() == 1)
8768 idx = 0;
8769 else
8770 idx = inventory_slots.Find(slot);
8771 }
8772 if (idx < 0)
8773 return "";
8774
8775 return detach_types.Get(idx);
8776 }
8777
8779 {
8780
8782
8783
8784 float min_time = 1;
8785 float max_time = 3;
8786 float delay = Math.RandomFloat(min_time, max_time);
8787
8788 explode_timer.Run(delay, this, "DoAmmoExplosion");
8789 }
8790
8792 {
8793 Magazine magazine = Magazine.Cast(this);
8794 int pop_sounds_count = 6;
8795 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8796
8797
8798 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8799 string sound_name = pop_sounds[ sound_idx ];
8801
8802
8803 magazine.ServerAddAmmoCount(-1);
8804
8805
8806 float min_temp_to_explode = 100;
8807
8808 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8809 {
8811 }
8812 }
8813
8814
8815 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8816 {
8817 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8818
8819 const int CHANCE_DAMAGE_CARGO = 4;
8820 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8821 const int CHANCE_DAMAGE_NOTHING = 2;
8822
8824 {
8825 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8826 int chances;
8827 int rnd;
8828
8829 if (GetInventory().GetCargo())
8830 {
8831 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8832 rnd = Math.RandomInt(0,chances);
8833
8834 if (rnd < CHANCE_DAMAGE_CARGO)
8835 {
8837 }
8838 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8839 {
8841 }
8842 }
8843 else
8844 {
8845 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8846 rnd = Math.RandomInt(0,chances);
8847
8848 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8849 {
8851 }
8852 }
8853 }
8854 }
8855
8857 {
8858 if (GetInventory().GetCargo())
8859 {
8860 int item_count = GetInventory().GetCargo().GetItemCount();
8861 if (item_count > 0)
8862 {
8863 int random_pick = Math.RandomInt(0, item_count);
8865 if (!item.IsExplosive())
8866 {
8867 item.AddHealth("","",damage);
8868 return true;
8869 }
8870 }
8871 }
8872 return false;
8873 }
8874
8876 {
8877 int attachment_count = GetInventory().AttachmentCount();
8878 if (attachment_count > 0)
8879 {
8880 int random_pick = Math.RandomInt(0, attachment_count);
8881 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8882 if (!attachment.IsExplosive())
8883 {
8884 attachment.AddHealth("","",damage);
8885 return true;
8886 }
8887 }
8888 return false;
8889 }
8890
8892 {
8894 }
8895
8897 {
8899 return GetInventory().CanRemoveEntity();
8900
8901 return false;
8902 }
8903
8905 {
8907 return;
8908
8910 {
8911 if (ScriptInputUserData.CanStoreInputUserData())
8912 {
8913 ScriptInputUserData ctx = new ScriptInputUserData;
8918 ctx.
Write(destination_entity);
8922 }
8923 }
8924 else if (!
GetGame().IsMultiplayer())
8925 {
8927 }
8928 }
8929
8931 {
8933 return;
8934
8935 float split_quantity_new;
8939 InventoryLocation loc = new InventoryLocation;
8940
8941 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8942 {
8944 split_quantity_new = stack_max;
8945 else
8947
8948 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8949 if (new_item)
8950 {
8951 new_item.SetResultOfSplit(true);
8952 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8954 new_item.SetQuantity(split_quantity_new);
8955 }
8956 }
8957 else if (destination_entity && slot_id == -1)
8958 {
8959 if (quantity > stack_max)
8960 split_quantity_new = stack_max;
8961 else
8962 split_quantity_new = quantity;
8963
8965 {
8968 }
8969
8970 if (new_item)
8971 {
8972 new_item.SetResultOfSplit(true);
8973 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8975 new_item.SetQuantity(split_quantity_new);
8976 }
8977 }
8978 else
8979 {
8980 if (stack_max != 0)
8981 {
8983 {
8985 }
8986
8987 if (split_quantity_new == 0)
8988 {
8989 if (!
GetGame().IsMultiplayer())
8990 player.PhysicalPredictiveDropItem(this);
8991 else
8992 player.ServerDropEntity(this);
8993 return;
8994 }
8995
8997
8998 if (new_item)
8999 {
9000 new_item.SetResultOfSplit(true);
9001 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9003 new_item.SetQuantity(stack_max);
9004 new_item.PlaceOnSurface();
9005 }
9006 }
9007 }
9008 }
9009
9011 {
9013 return;
9014
9015 float split_quantity_new;
9019 InventoryLocation loc = new InventoryLocation;
9020
9021 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9022 {
9024 split_quantity_new = stack_max;
9025 else
9027
9028 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9029 if (new_item)
9030 {
9031 new_item.SetResultOfSplit(true);
9032 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9034 new_item.SetQuantity(split_quantity_new);
9035 }
9036 }
9037 else if (destination_entity && slot_id == -1)
9038 {
9039 if (quantity > stack_max)
9040 split_quantity_new = stack_max;
9041 else
9042 split_quantity_new = quantity;
9043
9045 {
9048 }
9049
9050 if (new_item)
9051 {
9052 new_item.SetResultOfSplit(true);
9053 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9055 new_item.SetQuantity(split_quantity_new);
9056 }
9057 }
9058 else
9059 {
9060 if (stack_max != 0)
9061 {
9063 {
9065 }
9066
9068
9069 if (new_item)
9070 {
9071 new_item.SetResultOfSplit(true);
9072 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9074 new_item.SetQuantity(stack_max);
9075 new_item.PlaceOnSurface();
9076 }
9077 }
9078 }
9079 }
9080
9082 {
9084 return;
9085
9087 {
9088 if (ScriptInputUserData.CanStoreInputUserData())
9089 {
9090 ScriptInputUserData ctx = new ScriptInputUserData;
9095 dst.WriteToContext(ctx);
9097 }
9098 }
9099 else if (!
GetGame().IsMultiplayer())
9100 {
9102 }
9103 }
9104
9106 {
9108 return;
9109
9111 {
9112 if (ScriptInputUserData.CanStoreInputUserData())
9113 {
9114 ScriptInputUserData ctx = new ScriptInputUserData;
9119 ctx.
Write(destination_entity);
9125 }
9126 }
9127 else if (!
GetGame().IsMultiplayer())
9128 {
9130 }
9131 }
9132
9134 {
9136 }
9137
9139 {
9141 return this;
9142
9144 float split_quantity_new;
9146 if (dst.IsValid())
9147 {
9148 int slot_id = dst.GetSlot();
9150
9151 if (quantity > stack_max)
9152 split_quantity_new = stack_max;
9153 else
9154 split_quantity_new = quantity;
9155
9157
9158 if (new_item)
9159 {
9160 new_item.SetResultOfSplit(true);
9161 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9164 }
9165
9166 return new_item;
9167 }
9168
9169 return null;
9170 }
9171
9173 {
9175 return;
9176
9178 float split_quantity_new;
9180 if (destination_entity)
9181 {
9183 if (quantity > stackable)
9184 split_quantity_new = stackable;
9185 else
9186 split_quantity_new = quantity;
9187
9188 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9189 if (new_item)
9190 {
9191 new_item.SetResultOfSplit(true);
9192 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9194 new_item.SetQuantity(split_quantity_new);
9195 }
9196 }
9197 }
9198
9200 {
9202 return;
9203
9205 {
9206 if (ScriptInputUserData.CanStoreInputUserData())
9207 {
9208 ScriptInputUserData ctx = new ScriptInputUserData;
9213 ItemBase destination_entity =
this;
9214 ctx.
Write(destination_entity);
9218 }
9219 }
9220 else if (!
GetGame().IsMultiplayer())
9221 {
9223 }
9224 }
9225
9227 {
9229 return;
9230
9232 float split_quantity_new;
9234 if (player)
9235 {
9237 if (quantity > stackable)
9238 split_quantity_new = stackable;
9239 else
9240 split_quantity_new = quantity;
9241
9242 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9243 new_item =
ItemBase.Cast(in_hands);
9244 if (new_item)
9245 {
9246 new_item.SetResultOfSplit(true);
9247 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9249 new_item.SetQuantity(split_quantity_new);
9250 }
9251 }
9252 }
9253
9255 {
9257 return;
9258
9260 float split_quantity_new = Math.Floor(quantity * 0.5);
9261
9263
9264 if (new_item)
9265 {
9266 if (new_item.GetQuantityMax() < split_quantity_new)
9267 {
9268 split_quantity_new = new_item.GetQuantityMax();
9269 }
9270
9271 new_item.SetResultOfSplit(true);
9272 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9273
9275 {
9278 }
9279 else
9280 {
9283 }
9284 }
9285 }
9286
9288 {
9290 return;
9291
9293 float split_quantity_new = Math.Floor(quantity / 2);
9294
9295 InventoryLocation invloc = new InventoryLocation;
9297
9299 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9300
9301 if (new_item)
9302 {
9303 if (new_item.GetQuantityMax() < split_quantity_new)
9304 {
9305 split_quantity_new = new_item.GetQuantityMax();
9306 }
9308 {
9311 }
9312 else
9313 {
9316 }
9317 }
9318 }
9319
9322 {
9323 SetWeightDirty();
9325
9326 if (parent)
9327 parent.OnAttachmentQuantityChangedEx(this, delta);
9328
9330 {
9332 {
9334 }
9336 {
9337 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9339 }
9340 }
9341
9342 }
9343
9346 {
9347
9348 }
9349
9352 {
9354 }
9355
9357 {
9358 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9359
9361 {
9362 if (newLevel == GameConstants.STATE_RUINED)
9363 {
9365 EntityAI parent = GetHierarchyParent();
9366 if (parent && parent.IsFireplace())
9367 {
9368 CargoBase cargo = GetInventory().GetCargo();
9369 if (cargo)
9370 {
9372 {
9374 }
9375 }
9376 }
9377 }
9378
9380 {
9381
9383 return;
9384 }
9385
9386 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9387 {
9389 }
9390 }
9391 }
9392
9393
9395 {
9396 super.OnRightClick();
9397
9399 {
9401 {
9402 if (ScriptInputUserData.CanStoreInputUserData())
9403 {
9404 vector m4[4];
9406
9407 EntityAI root = GetHierarchyRoot();
9408
9409 InventoryLocation dst = new InventoryLocation;
9411 {
9412 if (root)
9413 {
9414 root.GetTransform(m4);
9416 }
9417 else
9418 GetInventory().GetCurrentInventoryLocation(dst);
9419 }
9420 else
9421 {
9423
9424
9425 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9426 {
9427 if (root)
9428 {
9429 root.GetTransform(m4);
9431 }
9432 else
9433 GetInventory().GetCurrentInventoryLocation(dst);
9434 }
9435 else
9436 {
9437 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9438 }
9439 }
9440
9441 ScriptInputUserData ctx = new ScriptInputUserData;
9449 }
9450 }
9451 else if (!
GetGame().IsMultiplayer())
9452 {
9454 }
9455 }
9456 }
9457
9458 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9459 {
9460
9461 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9462 return false;
9463
9464 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9465 return false;
9466
9467
9469 return false;
9470
9471
9472 Magazine mag = Magazine.Cast(this);
9473 if (mag)
9474 {
9475 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9476 return false;
9477
9478 if (stack_max_limit)
9479 {
9480 Magazine other_mag = Magazine.Cast(other_item);
9481 if (other_item)
9482 {
9483 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9484 return false;
9485 }
9486
9487 }
9488 }
9489 else
9490 {
9491
9493 return false;
9494
9496 return false;
9497 }
9498
9499 PlayerBase player = null;
9500 if (CastTo(player, GetHierarchyRootPlayer()))
9501 {
9502 if (player.GetInventory().HasAttachment(this))
9503 return false;
9504
9505 if (player.IsItemsToDelete())
9506 return false;
9507 }
9508
9509 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9510 return false;
9511
9512 int slotID;
9514 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9515 return false;
9516
9517 return true;
9518 }
9519
9521 {
9523 }
9524
9526 {
9527 return m_IsResultOfSplit;
9528 }
9529
9531 {
9532 m_IsResultOfSplit = value;
9533 }
9534
9536 {
9538 }
9539
9541 {
9542 float other_item_quantity = other_item.GetQuantity();
9543 float this_free_space;
9544
9546
9548
9549 if (other_item_quantity > this_free_space)
9550 {
9551 return this_free_space;
9552 }
9553 else
9554 {
9555 return other_item_quantity;
9556 }
9557 }
9558
9560 {
9562 }
9563
9565 {
9567 return;
9568
9569 if (!IsMagazine() && other_item)
9570 {
9572 if (quantity_used != 0)
9573 {
9574 float hp1 = GetHealth01("","");
9575 float hp2 = other_item.GetHealth01("","");
9576 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9577 hpResult = hpResult / (
GetQuantity() + quantity_used);
9578
9579 hpResult *= GetMaxHealth();
9580 Math.Round(hpResult);
9581 SetHealth("", "Health", hpResult);
9582
9584 other_item.AddQuantity(-quantity_used);
9585 }
9586 }
9588 }
9589
9591 {
9592 #ifdef SERVER
9593 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9594 GetHierarchyParent().IncreaseLifetimeUp();
9595 #endif
9596 };
9597
9599 {
9600 PlayerBase p = PlayerBase.Cast(player);
9601
9602 array<int> recipesIds = p.m_Recipes;
9603 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9604 if (moduleRecipesManager)
9605 {
9606 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9607 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9608 }
9609
9610 for (int i = 0;i < recipesIds.Count(); i++)
9611 {
9612 int key = recipesIds.Get(i);
9613 string recipeName = moduleRecipesManager.GetRecipeName(key);
9615 }
9616 }
9617
9618
9619 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9620 {
9621 super.GetDebugActions(outputList);
9622
9623
9628
9629
9633
9637
9638
9641
9642
9644 {
9647 }
9648
9650
9653
9657 }
9658
9659
9660
9661
9663 {
9664 super.OnAction(action_id, player, ctx);
9665 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9666 {
9667 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9668 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9669 PlayerBase p = PlayerBase.Cast(player);
9670 if (
EActions.RECIPES_RANGE_START < 1000)
9671 {
9672 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9673 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9674 }
9675 }
9676 #ifndef SERVER
9677 else if (action_id ==
EActions.WATCH_PLAYER)
9678 {
9679 PluginDeveloper.SetDeveloperItemClientEx(player);
9680 }
9681 #endif
9683 {
9684 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9685 {
9686 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9687 OnDebugButtonPressServer(id + 1);
9688 }
9689
9690 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9691 {
9692 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9694 }
9695
9696 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9697 {
9698 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9700 }
9701
9702 else if (action_id ==
EActions.ADD_QUANTITY)
9703 {
9704 if (IsMagazine())
9705 {
9706 Magazine mag = Magazine.Cast(this);
9707 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9708 }
9709 else
9710 {
9712 }
9713
9714 if (m_EM)
9715 {
9716 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9717 }
9718
9719 }
9720
9721 else if (action_id ==
EActions.REMOVE_QUANTITY)
9722 {
9723 if (IsMagazine())
9724 {
9725 Magazine mag2 = Magazine.Cast(this);
9726 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9727 }
9728 else
9729 {
9731 }
9732 if (m_EM)
9733 {
9734 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9735 }
9736
9737 }
9738
9739 else if (action_id ==
EActions.SET_QUANTITY_0)
9740 {
9742
9743 if (m_EM)
9744 {
9745 m_EM.SetEnergy(0);
9746 }
9747 }
9748
9749 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9750 {
9752
9753 if (m_EM)
9754 {
9755 m_EM.SetEnergy(m_EM.GetEnergyMax());
9756 }
9757 }
9758
9759 else if (action_id ==
EActions.ADD_HEALTH)
9760 {
9761 AddHealth("","",GetMaxHealth("","Health")/5);
9762 }
9763 else if (action_id ==
EActions.REMOVE_HEALTH)
9764 {
9765 AddHealth("","",-GetMaxHealth("","Health")/5);
9766 }
9767 else if (action_id ==
EActions.DESTROY_HEALTH)
9768 {
9769 SetHealth01("","",0);
9770 }
9771 else if (action_id ==
EActions.WATCH_ITEM)
9772 {
9774 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9775 #ifdef DEVELOPER
9776 SetDebugDeveloper_item(this);
9777 #endif
9778 }
9779
9780 else if (action_id ==
EActions.ADD_TEMPERATURE)
9781 {
9782 AddTemperature(20);
9783
9784 }
9785
9786 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9787 {
9788 AddTemperature(-20);
9789
9790 }
9791
9792 else if (action_id ==
EActions.FLIP_FROZEN)
9793 {
9794 SetFrozen(!GetIsFrozen());
9795
9796 }
9797
9798 else if (action_id ==
EActions.ADD_WETNESS)
9799 {
9801
9802 }
9803
9804 else if (action_id ==
EActions.REMOVE_WETNESS)
9805 {
9807
9808 }
9809
9810 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9811 {
9814
9815
9816 }
9817
9818 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9819 {
9822 }
9823
9824 else if (action_id ==
EActions.MAKE_SPECIAL)
9825 {
9826 auto debugParams = DebugSpawnParams.WithPlayer(player);
9827 OnDebugSpawnEx(debugParams);
9828 }
9829
9830 else if (action_id ==
EActions.DELETE)
9831 {
9832 Delete();
9833 }
9834
9835 }
9836
9837
9838 return false;
9839 }
9840
9841
9842
9843
9847
9850
9851
9852
9854 {
9855 return false;
9856 }
9857
9858
9860 {
9861 return true;
9862 }
9863
9864
9866 {
9867 return true;
9868 }
9869
9870
9871
9873 {
9874 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9876 }
9877
9880 {
9881 return null;
9882 }
9883
9885 {
9886 return false;
9887 }
9888
9890 {
9891 return false;
9892 }
9893
9897
9898
9900 {
9901 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9902 return module_repairing.CanRepair(this, item_repair_kit);
9903 }
9904
9905
9906 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9907 {
9908 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9909 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9910 }
9911
9912
9914 {
9915
9916
9917
9918
9919
9920
9921
9922
9923 return 1;
9924 }
9925
9926
9927
9929 {
9931 }
9932
9933
9934
9936 {
9938 }
9939
9940
9949 {
9950 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9951
9952 if (player)
9953 {
9954 player.MessageStatus(text);
9955 }
9956 }
9957
9958
9967 {
9968 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9969
9970 if (player)
9971 {
9972 player.MessageAction(text);
9973 }
9974 }
9975
9976
9985 {
9986 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9987
9988 if (player)
9989 {
9990 player.MessageFriendly(text);
9991 }
9992 }
9993
9994
10003 {
10004 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10005
10006 if (player)
10007 {
10008 player.MessageImportant(text);
10009 }
10010 }
10011
10013 {
10014 return true;
10015 }
10016
10017
10018 override bool KindOf(
string tag)
10019 {
10020 bool found = false;
10021 string item_name = this.
GetType();
10024
10025 int array_size = item_tag_array.Count();
10026 for (int i = 0; i < array_size; i++)
10027 {
10028 if (item_tag_array.Get(i) == tag)
10029 {
10030 found = true;
10031 break;
10032 }
10033 }
10034 return found;
10035 }
10036
10037
10039 {
10040
10041 super.OnRPC(sender, rpc_type,ctx);
10042
10043
10044 switch (rpc_type)
10045 {
10046 #ifndef SERVER
10047 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10048 Param2<bool, string> p = new Param2<bool, string>(false, "");
10049
10051 return;
10052
10053 bool play = p.param1;
10054 string soundSet = p.param2;
10055
10056 if (play)
10057 {
10059 {
10061 {
10063 }
10064 }
10065 else
10066 {
10068 }
10069 }
10070 else
10071 {
10073 }
10074
10075 break;
10076 #endif
10077
10078 }
10079
10081 {
10083 }
10084 }
10085
10086
10087
10088
10090 {
10091 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10092 return plugin.GetID(
name);
10093 }
10094
10096 {
10097 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10098 return plugin.GetName(id);
10099 }
10100
10103 {
10104
10105
10106 int varFlags;
10107 if (!ctx.
Read(varFlags))
10108 return;
10109
10110 if (varFlags & ItemVariableFlags.FLOAT)
10111 {
10113 }
10114 }
10115
10117 {
10118
10119 super.SerializeNumericalVars(floats_out);
10120
10121
10122
10124 {
10126 }
10127
10129 {
10131 }
10132
10134 {
10136 }
10137
10139 {
10144 }
10145
10147 {
10149 }
10150 }
10151
10153 {
10154
10155 super.DeSerializeNumericalVars(floats);
10156
10157
10158 int index = 0;
10159 int mask = Math.Round(floats.Get(index));
10160
10161 index++;
10162
10164 {
10166 {
10168 }
10169 else
10170 {
10171 float quantity = floats.Get(index);
10172 SetQuantity(quantity,
true,
false,
false,
false);
10173 }
10174 index++;
10175 }
10176
10178 {
10179 float wet = floats.Get(index);
10181 index++;
10182 }
10183
10185 {
10186 int liquidtype = Math.Round(floats.Get(index));
10188 index++;
10189 }
10190
10192 {
10194 index++;
10196 index++;
10198 index++;
10200 index++;
10201 }
10202
10204 {
10205 int cleanness = Math.Round(floats.Get(index));
10207 index++;
10208 }
10209 }
10210
10212 {
10213 super.WriteVarsToCTX(ctx);
10214
10215
10217 {
10219 }
10220
10222 {
10224 }
10225
10227 {
10229 }
10230
10232 {
10233 int r,g,b,a;
10239 }
10240
10242 {
10244 }
10245 }
10246
10248 {
10249 if (!super.ReadVarsFromCTX(ctx,version))
10250 return false;
10251
10252 int intValue;
10253 float value;
10254
10255 if (version < 140)
10256 {
10257 if (!ctx.
Read(intValue))
10258 return false;
10259
10260 m_VariablesMask = intValue;
10261 }
10262
10264 {
10265 if (!ctx.
Read(value))
10266 return false;
10267
10269 {
10271 }
10272 else
10273 {
10275 }
10276 }
10277
10278 if (version < 140)
10279 {
10281 {
10282 if (!ctx.
Read(value))
10283 return false;
10284 SetTemperatureDirect(value);
10285 }
10286 }
10287
10289 {
10290 if (!ctx.
Read(value))
10291 return false;
10293 }
10294
10296 {
10297 if (!ctx.
Read(intValue))
10298 return false;
10300 }
10301
10303 {
10304 int r,g,b,a;
10306 return false;
10308 return false;
10310 return false;
10312 return false;
10313
10315 }
10316
10318 {
10319 if (!ctx.
Read(intValue))
10320 return false;
10322 }
10323
10324 if (version >= 138 && version < 140)
10325 {
10327 {
10328 if (!ctx.
Read(intValue))
10329 return false;
10330 SetFrozen(intValue);
10331 }
10332 }
10333
10334 return true;
10335 }
10336
10337
10339 {
10342 {
10344 }
10345
10346 if (!super.OnStoreLoad(ctx, version))
10347 {
10349 return false;
10350 }
10351
10352 if (version >= 114)
10353 {
10354 bool hasQuickBarIndexSaved;
10355
10356 if (!ctx.
Read(hasQuickBarIndexSaved))
10357 {
10359 return false;
10360 }
10361
10362 if (hasQuickBarIndexSaved)
10363 {
10364 int itmQBIndex;
10365
10366
10367 if (!ctx.
Read(itmQBIndex))
10368 {
10370 return false;
10371 }
10372
10373 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10374 if (itmQBIndex != -1 && parentPlayer)
10375 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10376 }
10377 }
10378 else
10379 {
10380
10381 PlayerBase player;
10382 int itemQBIndex;
10383 if (version ==
int.
MAX)
10384 {
10385 if (!ctx.
Read(itemQBIndex))
10386 {
10388 return false;
10389 }
10390 }
10391 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10392 {
10393
10394 if (!ctx.
Read(itemQBIndex))
10395 {
10397 return false;
10398 }
10399 if (itemQBIndex != -1 && player)
10400 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10401 }
10402 }
10403
10404 if (version < 140)
10405 {
10406
10407 if (!LoadVariables(ctx, version))
10408 {
10410 return false;
10411 }
10412 }
10413
10414
10416 {
10418 return false;
10419 }
10420 if (version >= 132)
10421 {
10423 if (raib)
10424 {
10426 {
10428 return false;
10429 }
10430 }
10431 }
10432
10434 return true;
10435 }
10436
10437
10438
10440 {
10441 super.OnStoreSave(ctx);
10442
10443 PlayerBase player;
10444 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10445 {
10447
10448 int itemQBIndex = -1;
10449 itemQBIndex = player.FindQuickBarEntityIndex(this);
10450 ctx.
Write(itemQBIndex);
10451 }
10452 else
10453 {
10455 }
10456
10458
10460 if (raib)
10461 {
10463 }
10464 }
10465
10466
10468 {
10469 super.AfterStoreLoad();
10470
10472 {
10474 }
10475
10477 {
10480 }
10481 }
10482
10484 {
10485 super.EEOnAfterLoad();
10486
10488 {
10490 }
10491
10494 }
10495
10497 {
10498 return false;
10499 }
10500
10501
10502
10504 {
10506 {
10507 #ifdef PLATFORM_CONSOLE
10508
10510 {
10512 if (menu)
10513 {
10515 }
10516 }
10517 #endif
10518 }
10519
10521 {
10524 }
10525
10527 {
10528 SetWeightDirty();
10530 }
10532 {
10535 }
10536
10538 {
10541 }
10543 {
10546 }
10547
10548 super.OnVariablesSynchronized();
10549 }
10550
10551
10552
10554 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10555 {
10556 if (!IsServerCheck(allow_client))
10557 return false;
10558
10560 return false;
10561
10564
10565 if (value <= (min + 0.001))
10566 value = min;
10567
10568 if (value == min)
10569 {
10570 if (destroy_config)
10571 {
10572 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10573 if (dstr)
10574 {
10576 this.Delete();
10577 return true;
10578 }
10579 }
10580 else if (destroy_forced)
10581 {
10583 this.Delete();
10584 return true;
10585 }
10586
10588 }
10589
10592
10594 {
10596
10597 if (delta)
10599 }
10600
10602
10603 return false;
10604 }
10605
10606
10608 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10609 {
10611 }
10612
10614 {
10617 }
10618
10620 {
10623 }
10624
10627 {
10628 float value_clamped = Math.Clamp(value, 0, 1);
10630 SetQuantity(result, destroy_config, destroy_forced);
10631 }
10632
10633
10636 {
10638 }
10639
10641 {
10643 }
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10655 {
10656 int slot = -1;
10657 if (GetInventory())
10658 {
10659 InventoryLocation il = new InventoryLocation;
10660 GetInventory().GetCurrentInventoryLocation(il);
10662 }
10663
10665 }
10666
10668 {
10669 float quantity_max = 0;
10670
10672 {
10673 if (attSlotID != -1)
10674 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10675
10676 if (quantity_max <= 0)
10678 }
10679
10680 if (quantity_max <= 0)
10682
10683 return quantity_max;
10684 }
10685
10687 {
10689 }
10690
10692 {
10694 }
10695
10696
10698 {
10700 }
10701
10703 {
10705 }
10706
10708 {
10710 }
10711
10712
10714 {
10715
10716 float weightEx = GetWeightEx();
10717 float special = GetInventoryAndCargoWeight();
10718 return weightEx - special;
10719 }
10720
10721
10723 {
10725 }
10726
10728 {
10730 {
10731 #ifdef DEVELOPER
10732 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10733 {
10734 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10736 }
10737 #endif
10738
10739 return GetQuantity() * GetConfigWeightModified();
10740 }
10741 else if (HasEnergyManager())
10742 {
10743 #ifdef DEVELOPER
10744 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10745 {
10746 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10747 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10748 }
10749 #endif
10750 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10751 }
10752 else
10753 {
10754 #ifdef DEVELOPER
10755 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10756 {
10757 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10758 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10759 }
10760 #endif
10761 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10762 }
10763 }
10764
10767 {
10768 int item_count = 0;
10770
10771 if (GetInventory().GetCargo() != NULL)
10772 {
10773 item_count = GetInventory().GetCargo().GetItemCount();
10774 }
10775
10776 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10777 {
10778 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10779 if (item)
10780 item_count += item.GetNumberOfItems();
10781 }
10782 return item_count;
10783 }
10784
10787 {
10788 float weight = 0;
10789 float wetness = 1;
10790 if (include_wetness)
10793 {
10794 weight = wetness * m_ConfigWeight;
10795 }
10797 {
10798 weight = 1;
10799 }
10800 return weight;
10801 }
10802
10803
10804
10806 {
10807 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10808 {
10809 GameInventory inv = GetInventory();
10810 array<EntityAI> items = new array<EntityAI>;
10812 for (int i = 0; i < items.Count(); i++)
10813 {
10815 if (item)
10816 {
10818 }
10819 }
10820 }
10821 }
10822
10823
10824
10825
10827 {
10828 float energy = 0;
10829 if (HasEnergyManager())
10830 {
10831 energy = GetCompEM().GetEnergy();
10832 }
10833 return energy;
10834 }
10835
10836
10838 {
10839 super.OnEnergyConsumed();
10840
10842 }
10843
10845 {
10846 super.OnEnergyAdded();
10847
10849 }
10850
10851
10853 {
10854 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10855 {
10857 {
10858 float energy_0to1 = GetCompEM().GetEnergy0To1();
10860 }
10861 }
10862 }
10863
10864
10866 {
10867 return ConfigGetFloat("heatIsolation");
10868 }
10869
10871 {
10873 }
10874
10876 {
10877 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10878 if (
GetGame().ConfigIsExisting(paramPath))
10880
10881 return 0.0;
10882 }
10883
10885 {
10886 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10887 if (
GetGame().ConfigIsExisting(paramPath))
10889
10890 return 0.0;
10891 }
10892
10893 override void SetWet(
float value,
bool allow_client =
false)
10894 {
10895 if (!IsServerCheck(allow_client))
10896 return;
10897
10900
10902
10903 m_VarWet = Math.Clamp(value, min, max);
10904
10906 {
10909 }
10910 }
10911
10912 override void AddWet(
float value)
10913 {
10915 }
10916
10918 {
10920 }
10921
10923 {
10925 }
10926
10928 {
10930 }
10931
10933 {
10935 }
10936
10938 {
10940 }
10941
10942 override void OnWetChanged(
float newVal,
float oldVal)
10943 {
10946 if (newLevel != oldLevel)
10947 {
10949 }
10950 }
10951
10953 {
10954 SetWeightDirty();
10955 }
10956
10958 {
10959 return GetWetLevelInternal(
m_VarWet);
10960 }
10961
10962
10963
10965 {
10967 }
10968
10970 {
10972 }
10973
10975 {
10977 }
10978
10980 {
10982 }
10983
10984
10985
10987 {
10988 if (ConfigIsExisting("itemModelLength"))
10989 {
10990 return ConfigGetFloat("itemModelLength");
10991 }
10992 return 0;
10993 }
10994
10996 {
10997 if (ConfigIsExisting("itemAttachOffset"))
10998 {
10999 return ConfigGetFloat("itemAttachOffset");
11000 }
11001 return 0;
11002 }
11003
11004 override void SetCleanness(
int value,
bool allow_client =
false)
11005 {
11006 if (!IsServerCheck(allow_client))
11007 return;
11008
11010
11012
11015 }
11016
11018 {
11020 }
11021
11023 {
11024 return true;
11025 }
11026
11027
11028
11029
11031 {
11033 }
11034
11036 {
11038 }
11039
11040
11041
11042
11043 override void SetColor(
int r,
int g,
int b,
int a)
11044 {
11050 }
11052 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11053 {
11058 }
11059
11061 {
11063 }
11064
11067 {
11068 int r,g,b,a;
11070 r = r/255;
11071 g = g/255;
11072 b = b/255;
11073 a = a/255;
11074 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11075 }
11076
11077
11078
11079 override void SetLiquidType(
int value,
bool allow_client =
false)
11080 {
11081 if (!IsServerCheck(allow_client))
11082 return;
11083
11088 }
11089
11091 {
11092 return ConfigGetInt("varLiquidTypeInit");
11093 }
11094
11096 {
11098 }
11099
11101 {
11103 SetFrozen(false);
11104 }
11105
11108 {
11109 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11110 }
11111
11112
11115 {
11116 PlayerBase nplayer;
11117 if (PlayerBase.CastTo(nplayer, player))
11118 {
11120
11121 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11122 }
11123 }
11124
11125
11128 {
11129 PlayerBase nplayer;
11130 if (PlayerBase.CastTo(nplayer,player))
11131 {
11132
11133 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11134
11135 }
11136
11137
11138 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11139
11140
11141 if (HasEnergyManager())
11142 {
11143 GetCompEM().UpdatePlugState();
11144 }
11145 }
11146
11147
11149 {
11150 super.OnPlacementStarted(player);
11151
11153 }
11154
11155 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11156 {
11158 {
11159 m_AdminLog.OnPlacementComplete(player,
this);
11160 }
11161
11162 super.OnPlacementComplete(player, position, orientation);
11163 }
11164
11165
11166
11167
11168
11170 {
11172 {
11173 return true;
11174 }
11175 else
11176 {
11177 return false;
11178 }
11179 }
11180
11181
11183 {
11185 {
11187 }
11188 }
11189
11190
11192 {
11194 }
11195
11197 {
11199 }
11200
11201 override void InsertAgent(
int agent,
float count = 1)
11202 {
11203 if (count < 1)
11204 return;
11205
11207 }
11208
11211 {
11213 }
11214
11215
11217 {
11219 }
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11263 {
11265 return false;
11266 return true;
11267 }
11268
11270 {
11271
11273 }
11274
11275
11278 {
11279 super.CheckForRoofLimited(timeTresholdMS);
11280
11282 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11283 {
11284 m_PreviousRoofTestTime = time;
11285 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11286 }
11287 }
11288
11289
11291 {
11293 {
11294 return 0;
11295 }
11296
11297 if (GetInventory().GetAttachmentSlotsCount() != 0)
11298 {
11299 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11300 if (filter)
11301 return filter.GetProtectionLevel(type, false, system);
11302 else
11303 return 0;
11304 }
11305
11306 string subclassPath, entryName;
11307
11308 switch (type)
11309 {
11311 entryName = "biological";
11312 break;
11314 entryName = "chemical";
11315 break;
11316 default:
11317 entryName = "biological";
11318 break;
11319 }
11320
11321 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11322
11324 }
11325
11326
11327
11330 {
11331 if (!IsMagazine())
11333
11335 }
11336
11337
11338
11339
11340
11345 {
11346 return true;
11347 }
11348
11350 {
11352 }
11353
11354
11355
11356
11357
11359 {
11360 if (parent)
11361 {
11362 if (parent.IsInherited(DayZInfected))
11363 return true;
11364
11365 if (!parent.IsRuined())
11366 return true;
11367 }
11368
11369 return true;
11370 }
11371
11373 {
11374 if (!super.CanPutAsAttachment(parent))
11375 {
11376 return false;
11377 }
11378
11379 if (!IsRuined() && !parent.IsRuined())
11380 {
11381 return true;
11382 }
11383
11384 return false;
11385 }
11386
11388 {
11389
11390
11391
11392
11393 return super.CanReceiveItemIntoCargo(item);
11394 }
11395
11397 {
11398
11399
11400
11401
11402 GameInventory attachmentInv = attachment.GetInventory();
11404 {
11405 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11406 return false;
11407 }
11408
11409 InventoryLocation loc = new InventoryLocation();
11410 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11411 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11412 return false;
11413
11414 return super.CanReceiveAttachment(attachment, slotId);
11415 }
11416
11418 {
11419 if (!super.CanReleaseAttachment(attachment))
11420 return false;
11421
11422 return GetInventory().AreChildrenAccessible();
11423 }
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11446 {
11447 int id = muzzle_owner.GetMuzzleID();
11448 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11449
11450 if (WPOF_array)
11451 {
11452 for (int i = 0; i < WPOF_array.Count(); i++)
11453 {
11454 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11455
11456 if (WPOF)
11457 {
11458 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11459 }
11460 }
11461 }
11462 }
11463
11464
11466 {
11467 int id = muzzle_owner.GetMuzzleID();
11469
11470 if (WPOBE_array)
11471 {
11472 for (int i = 0; i < WPOBE_array.Count(); i++)
11473 {
11474 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11475
11476 if (WPOBE)
11477 {
11478 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11479 }
11480 }
11481 }
11482 }
11483
11484
11486 {
11487 int id = muzzle_owner.GetMuzzleID();
11488 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11489
11490 if (WPOOH_array)
11491 {
11492 for (int i = 0; i < WPOOH_array.Count(); i++)
11493 {
11494 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11495
11496 if (WPOOH)
11497 {
11498 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11499 }
11500 }
11501 }
11502 }
11503
11504
11506 {
11507 int id = muzzle_owner.GetMuzzleID();
11508 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11509
11510 if (WPOOH_array)
11511 {
11512 for (int i = 0; i < WPOOH_array.Count(); i++)
11513 {
11514 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11515
11516 if (WPOOH)
11517 {
11518 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11519 }
11520 }
11521 }
11522 }
11523
11524
11526 {
11527 int id = muzzle_owner.GetMuzzleID();
11528 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11529
11530 if (WPOOH_array)
11531 {
11532 for (int i = 0; i < WPOOH_array.Count(); i++)
11533 {
11534 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11535
11536 if (WPOOH)
11537 {
11538 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11539 }
11540 }
11541 }
11542 }
11543
11544
11545
11547 {
11549 {
11550 return true;
11551 }
11552
11553 return false;
11554 }
11555
11557 {
11559 {
11560 return true;
11561 }
11562
11563 return false;
11564 }
11565
11567 {
11569 {
11570 return true;
11571 }
11572
11573 return false;
11574 }
11575
11577 {
11578 return false;
11579 }
11580
11583 {
11584 return UATimeSpent.DEFAULT_DEPLOY;
11585 }
11586
11587
11588
11589
11591 {
11593 SetSynchDirty();
11594 }
11595
11597 {
11599 }
11600
11601
11603 {
11604 return false;
11605 }
11606
11609 {
11610 string att_type = "None";
11611
11612 if (ConfigIsExisting("soundAttType"))
11613 {
11614 att_type = ConfigGetString("soundAttType");
11615 }
11616
11618 }
11619
11621 {
11623 }
11624
11625
11626
11627
11628
11632
11634 {
11637
11639 }
11640
11641
11643 {
11645 return;
11646
11648
11651
11654
11655 SoundParameters params = new SoundParameters();
11659 }
11660
11661
11663 {
11665 return;
11666
11668 SetSynchDirty();
11669
11672 }
11673
11674
11676 {
11678 return;
11679
11681 SetSynchDirty();
11682
11685 }
11686
11688 {
11690 }
11691
11693 {
11695 }
11696
11699 {
11700 if (!
GetGame().IsDedicatedServer())
11701 {
11702 if (ConfigIsExisting("attachSoundSet"))
11703 {
11704 string cfg_path = "";
11705 string soundset = "";
11706 string type_name =
GetType();
11707
11710 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11711 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11712
11713 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11714 {
11715 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11716 {
11717 if (cfg_slot_array[i] == slot_type)
11718 {
11719 soundset = cfg_soundset_array[i];
11720 break;
11721 }
11722 }
11723 }
11724
11725 if (soundset != "")
11726 {
11727 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11729 }
11730 }
11731 }
11732 }
11733
11735 {
11736
11737 }
11738
11739 void OnApply(PlayerBase player);
11740
11742 {
11743 return 1.0;
11744 };
11745
11747 {
11749 }
11750
11752 {
11754 }
11755
11757
11759 {
11760 SetDynamicPhysicsLifeTime(0.01);
11762 }
11763
11765 {
11766 array<string> zone_names = new array<string>;
11767 GetDamageZones(zone_names);
11768 for (int i = 0; i < zone_names.Count(); i++)
11769 {
11770 SetHealthMax(zone_names.Get(i),"Health");
11771 }
11772 SetHealthMax("","Health");
11773 }
11774
11777 {
11778 float global_health = GetHealth01("","Health");
11779 array<string> zones = new array<string>;
11780 GetDamageZones(zones);
11781
11782 for (int i = 0; i < zones.Count(); i++)
11783 {
11784 SetHealth01(zones.Get(i),"Health",global_health);
11785 }
11786 }
11787
11790 {
11791 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11792 }
11793
11795 {
11796 if (!hasRootAsPlayer)
11797 {
11798 if (refParentIB)
11799 {
11800
11801 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11802 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11803
11804 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11805 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11806
11809 }
11810 else
11811 {
11812
11815 }
11816 }
11817 }
11818
11820 {
11822 {
11823 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11824 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11825 {
11826 float heatPermCoef = 1.0;
11828 while (ent)
11829 {
11830 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11831 ent = ent.GetHierarchyParent();
11832 }
11833
11834 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11835 }
11836 }
11837 }
11838
11840 {
11841
11842 EntityAI parent = GetHierarchyParent();
11843 if (!parent)
11844 {
11845 hasParent = false;
11846 hasRootAsPlayer = false;
11847 }
11848 else
11849 {
11850 hasParent = true;
11851 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11852 refParentIB =
ItemBase.Cast(parent);
11853 }
11854 }
11855
11856 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11857 {
11858
11859 }
11860
11862 {
11863
11864 return false;
11865 }
11866
11868 {
11869
11870
11871 return false;
11872 }
11873
11875 {
11876
11877 return false;
11878 }
11879
11882 {
11883 return !GetIsFrozen() &&
IsOpen();
11884 }
11885
11887 {
11888 bool hasParent = false, hasRootAsPlayer = false;
11890
11891 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11892 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11893
11894 if (wwtu || foodDecay)
11895 {
11899
11900 if (processWetness || processTemperature || processDecay)
11901 {
11903
11904 if (processWetness)
11905 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11906
11907 if (processTemperature)
11909
11910 if (processDecay)
11911 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11912 }
11913 }
11914 }
11915
11918 {
11920 }
11921
11923 {
11926
11927 return super.GetTemperatureFreezeThreshold();
11928 }
11929
11931 {
11934
11935 return super.GetTemperatureThawThreshold();
11936 }
11937
11939 {
11942
11943 return super.GetItemOverheatThreshold();
11944 }
11945
11947 {
11949 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11950
11951 return super.GetTemperatureFreezeTime();
11952 }
11953
11955 {
11957 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11958
11959 return super.GetTemperatureThawTime();
11960 }
11961
11966
11968 {
11969 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11970 }
11971
11973 {
11974 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11975 }
11976
11979 {
11981 }
11982
11984 {
11986 }
11987
11989 {
11991 }
11992
11995 {
11996 return null;
11997 }
11998
12001 {
12002 return false;
12003 }
12004
12006 {
12008 {
12011 if (!trg)
12012 {
12014 explosive = this;
12015 }
12016
12017 explosive.PairRemote(trg);
12019
12020 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12021 trg.SetPersistentPairID(persistentID);
12022 explosive.SetPersistentPairID(persistentID);
12023
12024 return true;
12025 }
12026 return false;
12027 }
12028
12031 {
12032 float ret = 1.0;
12035 ret *= GetHealth01();
12036
12037 return ret;
12038 }
12039
12040 #ifdef DEVELOPER
12041 override void SetDebugItem()
12042 {
12043 super.SetDebugItem();
12044 _itemBase = this;
12045 }
12046
12048 {
12049 string text = super.GetDebugText();
12050
12052 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12053
12054 return text;
12055 }
12056 #endif
12057
12059 {
12060 return true;
12061 }
12062
12064
12066
12068 {
12071 }
12072
12073
12081
12097}
12098
12100{
12102 if (entity)
12103 {
12104 bool is_item = entity.IsInherited(
ItemBase);
12105 if (is_item && full_quantity)
12106 {
12109 }
12110 }
12111 else
12112 {
12114 return NULL;
12115 }
12116 return entity;
12117}
12118
12120{
12121 if (item)
12122 {
12123 if (health > 0)
12124 item.SetHealth("", "", health);
12125
12126 if (item.CanHaveTemperature())
12127 {
12129 if (item.CanFreeze())
12130 item.SetFrozen(false);
12131 }
12132
12133 if (item.HasEnergyManager())
12134 {
12135 if (quantity >= 0)
12136 {
12137 item.GetCompEM().SetEnergy0To1(quantity);
12138 }
12139 else
12140 {
12142 }
12143 }
12144 else if (item.IsMagazine())
12145 {
12146 Magazine mag = Magazine.Cast(item);
12147 if (quantity >= 0)
12148 {
12149 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12150 }
12151 else
12152 {
12154 }
12155
12156 }
12157 else
12158 {
12159 if (quantity >= 0)
12160 {
12161 item.SetQuantityNormalized(quantity, false);
12162 }
12163 else
12164 {
12166 }
12167
12168 }
12169 }
12170}
12171
12172#ifdef DEVELOPER
12174#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.