7328{
7330 {
7331 return true;
7332 }
7333};
7334
7335
7336
7338{
7342
7344
7347
7348
7349
7350
7351
7360
7366
7371
7376
7397 protected bool m_IsResultOfSplit
7398
7400
7405
7406
7407
7409
7413
7414
7415
7417
7420
7421
7422
7428
7429
7437
7440
7441
7443
7444
7446
7447
7452
7453
7458
7459
7461
7462
7464 {
7469
7470 if (!
GetGame().IsDedicatedServer())
7471 {
7473 {
7475
7477 {
7479 }
7480 }
7481
7484 }
7485
7486 m_OldLocation = null;
7487
7489 {
7491 }
7492
7493 if (ConfigIsExisting("headSelectionsToHide"))
7494 {
7497 }
7498
7500 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7501 {
7503 }
7504
7506
7507 m_IsResultOfSplit = false;
7508
7510 }
7511
7513 {
7514 super.InitItemVariables();
7515
7521 m_Count = ConfigGetInt(
"count");
7522
7525
7530
7533
7538
7550
7554
7555
7558 if (ConfigIsExisting("canBeSplit"))
7559 {
7562 }
7563
7565 if (ConfigIsExisting("itemBehaviour"))
7567
7568
7571 RegisterNetSyncVariableInt("m_VarLiquidType");
7572 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7573
7574 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7575 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7576 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7577
7578 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7579 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7580 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7581 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7582
7583 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7584 RegisterNetSyncVariableBool("m_IsTakeable");
7585 RegisterNetSyncVariableBool("m_IsHologram");
7586
7589 {
7592 }
7593
7595
7597 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7599
7600 }
7601
7603 {
7605 }
7606
7608 {
7611 {
7616 }
7617 }
7618
7619 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7620 {
7622 {
7625 }
7626
7628 }
7629
7631 {
7637 }
7638
7640
7642 {
7644
7645 if (!action)
7646 {
7647 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7648 return;
7649 }
7650
7652 if (!ai)
7653 {
7655 return;
7656 }
7657
7659 if (!action_array)
7660 {
7661 action_array = new array<ActionBase_Basic>;
7663 }
7664 if (LogManager.IsActionLogEnable())
7665 {
7666 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7667 }
7668
7669 if (action_array.Find(action) != -1)
7670 {
7671 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7672 }
7673 else
7674 {
7675 action_array.Insert(action);
7676 }
7677 }
7678
7680 {
7682 ActionBase action = player.GetActionManager().GetAction(actionName);
7685
7686 if (action_array)
7687 {
7688 action_array.RemoveItem(action);
7689 }
7690 }
7691
7692
7693
7695 {
7696 ActionOverrideData overrideData = new ActionOverrideData();
7700
7702 if (!actionMap)
7703 {
7706 }
7707
7708 actionMap.Insert(this.
Type(), overrideData);
7709
7710 }
7711
7713
7715
7716
7718 {
7721
7724
7725 string config_to_search = "CfgVehicles";
7726 string muzzle_owner_config;
7727
7729 {
7730 if (IsInherited(Weapon))
7731 config_to_search = "CfgWeapons";
7732
7733 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7734
7735 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7736
7738
7739 if (config_OnFire_subclass_count > 0)
7740 {
7741 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7742
7743 for (int i = 0; i < config_OnFire_subclass_count; i++)
7744 {
7745 string particle_class = "";
7747 string config_OnFire_entry = config_OnFire_class + particle_class;
7748 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7749 WPOF_array.Insert(WPOF);
7750 }
7751
7752
7754 }
7755 }
7756
7758 {
7759 config_to_search = "CfgWeapons";
7760 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7761
7762 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7763
7765
7766 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7767 {
7768 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7769
7770 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7771 {
7772 string particle_class2 = "";
7774 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7775 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7776 WPOBE_array.Insert(WPOBE);
7777 }
7778
7779
7781 }
7782 }
7783 }
7784
7785
7787 {
7790
7792 {
7793 string config_to_search = "CfgVehicles";
7794
7795 if (IsInherited(Weapon))
7796 config_to_search = "CfgWeapons";
7797
7798 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7799 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7800
7801 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7802 {
7803
7805
7807 {
7809 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7811 return;
7812 }
7813
7816
7817
7818
7820 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7821
7822 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7823 {
7824 string particle_class = "";
7826 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7828
7829 if (entry_type == CT_CLASS)
7830 {
7831 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7832 WPOOH_array.Insert(WPOF);
7833 }
7834 }
7835
7836
7838 }
7839 }
7840 }
7841
7843 {
7845 }
7846
7848 {
7850 {
7852
7855
7858
7859 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7860 }
7861 }
7862
7864 {
7866 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7867
7869 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7870
7872 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7873
7875 {
7877 }
7878 }
7879
7881 {
7883 }
7884
7886 {
7889 else
7891
7893 {
7896 }
7897 else
7898 {
7901
7904 }
7905
7907 }
7908
7910 {
7912 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7913 }
7914
7916 {
7918 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7920 }
7921
7923 {
7925 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7926 }
7927
7929 {
7932
7933 OverheatingParticle OP = new OverheatingParticle();
7938
7940 }
7941
7943 {
7946
7947 return -1;
7948 }
7949
7951 {
7953 {
7956
7957 for (int i = count; i > 0; --i)
7958 {
7959 int id = i - 1;
7962
7965
7966 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7967 {
7968 if (p)
7969 {
7972 }
7973 }
7974 }
7975 }
7976 }
7977
7979 {
7981 {
7983 {
7984 int id = i - 1;
7986
7987 if (OP)
7988 {
7990
7991 if (p)
7992 {
7994 }
7995
7996 delete OP;
7997 }
7998 }
7999
8002 }
8003 }
8004
8007 {
8008 return 0.0;
8009 }
8010
8011
8013 {
8014 return 250;
8015 }
8016
8018 {
8019 return 0;
8020 }
8021
8024 {
8026 return true;
8027
8028 return false;
8029 }
8030
8033 {
8036
8038 {
8040 }
8041 else
8042 {
8043
8045 }
8046
8048 }
8049
8056 {
8057 return -1;
8058 }
8059
8060
8061
8062
8064 {
8066 {
8068 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8069
8070 if (r_index >= 0)
8071 {
8072 InventoryLocation r_il = new InventoryLocation;
8073 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8074
8075 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8078 {
8079 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8080 }
8082 {
8083 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8084 }
8085
8086 }
8087
8088 player.GetHumanInventory().ClearUserReservedLocation(this);
8089 }
8090
8093 }
8094
8095
8096
8097
8099 {
8100 return ItemBase.m_DebugActionsMask;
8101 }
8102
8104 {
8105 return ItemBase.m_DebugActionsMask & mask;
8106 }
8107
8109 {
8110 ItemBase.m_DebugActionsMask = mask;
8111 }
8112
8114 {
8115 ItemBase.m_DebugActionsMask |= mask;
8116 }
8117
8119 {
8120 ItemBase.m_DebugActionsMask &= ~mask;
8121 }
8122
8124 {
8126 {
8128 }
8129 else
8130 {
8132 }
8133 }
8134
8135
8137 {
8138 if (GetEconomyProfile())
8139 {
8140 float q_max = GetEconomyProfile().GetQuantityMax();
8141 if (q_max > 0)
8142 {
8143 float q_min = GetEconomyProfile().GetQuantityMin();
8144 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8145
8147 {
8148 ComponentEnergyManager comp = GetCompEM();
8150 {
8152 }
8153 }
8155 {
8157
8158 }
8159
8160 }
8161 }
8162 }
8163
8166 {
8167 EntityAI parent = GetHierarchyParent();
8168
8169 if (parent)
8170 {
8171 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8172 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8173 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8174 }
8175 }
8176
8179 {
8180 EntityAI parent = GetHierarchyParent();
8181
8182 if (parent)
8183 {
8184 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8185 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8186 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8187 }
8188 }
8189
8191 {
8192
8193
8194
8195
8197
8199 {
8200 if (ScriptInputUserData.CanStoreInputUserData())
8201 {
8202 ScriptInputUserData ctx = new ScriptInputUserData;
8208 ctx.
Write(use_stack_max);
8211
8213 {
8214 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8215 }
8216 }
8217 }
8218 else if (!
GetGame().IsMultiplayer())
8219 {
8221 }
8222 }
8223
8225 {
8227 }
8228
8230 {
8232 }
8233
8235 {
8237 }
8238
8240 {
8241
8242 return false;
8243 }
8244
8246 {
8247 return false;
8248 }
8249
8253 {
8254 return false;
8255 }
8256
8258 {
8259 return "";
8260 }
8261
8263
8265 {
8266 return false;
8267 }
8268
8270 {
8271 return true;
8272 }
8273
8274
8275
8277 {
8278 return true;
8279 }
8280
8282 {
8283 return true;
8284 }
8285
8287 {
8288 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8290 }
8291
8293 {
8295 }
8296
8298 {
8300 if (!is_being_placed)
8302 SetSynchDirty();
8303 }
8304
8305
8307
8309 {
8311 }
8312
8314 {
8316 }
8317
8319 {
8320 return 1;
8321 }
8322
8324 {
8325 return false;
8326 }
8327
8329 {
8331 SetSynchDirty();
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
8361
8362
8363
8364
8365
8366
8367
8369 {
8370 super.OnMovedInsideCargo(container);
8371
8372 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8373 }
8374
8375 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8376 {
8377 super.EEItemLocationChanged(oldLoc,newLoc);
8378
8379 PlayerBase new_player = null;
8380 PlayerBase old_player = null;
8381
8382 if (newLoc.GetParent())
8383 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8384
8385 if (oldLoc.GetParent())
8386 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8387
8389 {
8390 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8391
8392 if (r_index >= 0)
8393 {
8394 InventoryLocation r_il = new InventoryLocation;
8395 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8396
8397 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8400 {
8401 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8402 }
8404 {
8405 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8406 }
8407
8408 }
8409 }
8410
8412 {
8413 if (new_player)
8414 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8415
8416 if (new_player == old_player)
8417 {
8418
8419 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8420 {
8422 {
8423 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8424 {
8425 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8426 }
8427 }
8428 else
8429 {
8430 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8431 }
8432 }
8433
8434 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8435 {
8436 int type = oldLoc.GetType();
8438 {
8439 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8440 }
8442 {
8443 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8444 }
8445 }
8446 if (!m_OldLocation)
8447 {
8448 m_OldLocation = new InventoryLocation;
8449 }
8450 m_OldLocation.Copy(oldLoc);
8451 }
8452 else
8453 {
8454 if (m_OldLocation)
8455 {
8456 m_OldLocation.Reset();
8457 }
8458 }
8459
8461 }
8462 else
8463 {
8464 if (new_player)
8465 {
8466 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8467 if (res_index >= 0)
8468 {
8469 InventoryLocation il = new InventoryLocation;
8470 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8472 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8475 {
8476 il.
GetParent().GetOnReleaseLock().Invoke(it);
8477 }
8479 {
8481 }
8482
8483 }
8484 }
8486 {
8487
8489 }
8490
8491 if (m_OldLocation)
8492 {
8493 m_OldLocation.Reset();
8494 }
8495 }
8496 }
8497
8498 override void EOnContact(IEntity other, Contact extra)
8499 {
8501 {
8502 int liquidType = -1;
8504 if (impactSpeed > 0.0)
8505 {
8507 #ifndef SERVER
8509 #else
8511 SetSynchDirty();
8512 #endif
8514 }
8515 }
8516
8517 #ifdef SERVER
8518 if (GetCompEM() && GetCompEM().IsPlugged())
8519 {
8520 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8521 GetCompEM().UnplugThis();
8522 }
8523 #endif
8524 }
8525
8527
8529 {
8531 }
8532
8534 {
8535
8536 }
8537
8539 {
8540 super.OnItemLocationChanged(old_owner, new_owner);
8541
8542 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8543 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8544
8545 if (!relatedPlayer && playerNew)
8546 relatedPlayer = playerNew;
8547
8548 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8549 {
8551 if (actionMgr)
8552 {
8553 ActionBase currentAction = actionMgr.GetRunningAction();
8554 if (currentAction)
8556 }
8557 }
8558
8559 Man ownerPlayerOld = null;
8560 Man ownerPlayerNew = null;
8561
8562 if (old_owner)
8563 {
8564 if (old_owner.
IsMan())
8565 {
8566 ownerPlayerOld = Man.Cast(old_owner);
8567 }
8568 else
8569 {
8570 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8571 }
8572 }
8573 else
8574 {
8576 {
8578
8579 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8580 {
8581 GetCompEM().UnplugThis();
8582 }
8583 }
8584 }
8585
8586 if (new_owner)
8587 {
8588 if (new_owner.
IsMan())
8589 {
8590 ownerPlayerNew = Man.Cast(new_owner);
8591 }
8592 else
8593 {
8594 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8595 }
8596 }
8597
8598 if (ownerPlayerOld != ownerPlayerNew)
8599 {
8600 if (ownerPlayerOld)
8601 {
8602 array<EntityAI> subItemsExit = new array<EntityAI>;
8604 for (int i = 0; i < subItemsExit.Count(); i++)
8605 {
8608 }
8609 }
8610
8611 if (ownerPlayerNew)
8612 {
8613 array<EntityAI> subItemsEnter = new array<EntityAI>;
8615 for (int j = 0; j < subItemsEnter.Count(); j++)
8616 {
8619 }
8620 }
8621 }
8622 else if (ownerPlayerNew != null)
8623 {
8624 PlayerBase nplayer;
8625 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8626 {
8627 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8629 for (int k = 0; k < subItemsUpdate.Count(); k++)
8630 {
8632 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8633 }
8634 }
8635 }
8636
8637 if (old_owner)
8638 old_owner.OnChildItemRemoved(this);
8639 if (new_owner)
8640 new_owner.OnChildItemReceived(this);
8641 }
8642
8643
8645 {
8646 super.EEDelete(parent);
8647 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8648 if (player)
8649 {
8651
8652 if (player.IsAlive())
8653 {
8654 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8655 if (r_index >= 0)
8656 {
8657 InventoryLocation r_il = new InventoryLocation;
8658 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8659
8660 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8663 {
8664 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8665 }
8667 {
8668 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8669 }
8670
8671 }
8672
8673 player.RemoveQuickBarEntityShortcut(this);
8674 }
8675 }
8676 }
8677
8679 {
8680 super.EEKilled(killer);
8681
8684 {
8685 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8686 {
8687 if (IsMagazine())
8688 {
8689 if (Magazine.Cast(this).GetAmmoCount() > 0)
8690 {
8692 }
8693 }
8694 else
8695 {
8697 }
8698 }
8699 }
8700 }
8701
8703 {
8704 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8705
8706 super.OnWasAttached(parent, slot_id);
8707
8710
8712 }
8713
8715 {
8716 super.OnWasDetached(parent, slot_id);
8717
8720 }
8721
8723 {
8724 int idx;
8727
8728 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8729 if (inventory_slots.Count() < 1)
8730 {
8731 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8732 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8733 }
8734 else
8735 {
8736 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8737 }
8738
8739 idx = inventory_slots.Find(slot);
8740 if (idx < 0)
8741 return "";
8742
8743 return attach_types.Get(idx);
8744 }
8745
8747 {
8748 int idx = -1;
8749 string slot;
8750
8753
8754 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8755 if (inventory_slots.Count() < 1)
8756 {
8757 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8758 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8759 }
8760 else
8761 {
8762 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8763 if (detach_types.Count() < 1)
8764 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8765 }
8766
8767 for (int i = 0; i < inventory_slots.Count(); i++)
8768 {
8769 slot = inventory_slots.Get(i);
8770 }
8771
8772 if (slot != "")
8773 {
8774 if (detach_types.Count() == 1)
8775 idx = 0;
8776 else
8777 idx = inventory_slots.Find(slot);
8778 }
8779 if (idx < 0)
8780 return "";
8781
8782 return detach_types.Get(idx);
8783 }
8784
8786 {
8787
8789
8790
8791 float min_time = 1;
8792 float max_time = 3;
8793 float delay = Math.RandomFloat(min_time, max_time);
8794
8795 explode_timer.Run(delay, this, "DoAmmoExplosion");
8796 }
8797
8799 {
8800 Magazine magazine = Magazine.Cast(this);
8801 int pop_sounds_count = 6;
8802 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8803
8804
8805 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8806 string sound_name = pop_sounds[ sound_idx ];
8808
8809
8810 magazine.ServerAddAmmoCount(-1);
8811
8812
8813 float min_temp_to_explode = 100;
8814
8815 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8816 {
8818 }
8819 }
8820
8821
8822 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8823 {
8824 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8825
8826 const int CHANCE_DAMAGE_CARGO = 4;
8827 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8828 const int CHANCE_DAMAGE_NOTHING = 2;
8829
8831 {
8832 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8833 int chances;
8834 int rnd;
8835
8836 if (GetInventory().GetCargo())
8837 {
8838 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8839 rnd = Math.RandomInt(0,chances);
8840
8841 if (rnd < CHANCE_DAMAGE_CARGO)
8842 {
8844 }
8845 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8846 {
8848 }
8849 }
8850 else
8851 {
8852 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8853 rnd = Math.RandomInt(0,chances);
8854
8855 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8856 {
8858 }
8859 }
8860 }
8861 }
8862
8864 {
8865 if (GetInventory().GetCargo())
8866 {
8867 int item_count = GetInventory().GetCargo().GetItemCount();
8868 if (item_count > 0)
8869 {
8870 int random_pick = Math.RandomInt(0, item_count);
8872 if (!item.IsExplosive())
8873 {
8874 item.AddHealth("","",damage);
8875 return true;
8876 }
8877 }
8878 }
8879 return false;
8880 }
8881
8883 {
8884 int attachment_count = GetInventory().AttachmentCount();
8885 if (attachment_count > 0)
8886 {
8887 int random_pick = Math.RandomInt(0, attachment_count);
8888 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8889 if (!attachment.IsExplosive())
8890 {
8891 attachment.AddHealth("","",damage);
8892 return true;
8893 }
8894 }
8895 return false;
8896 }
8897
8899 {
8901 }
8902
8904 {
8906 return GetInventory().CanRemoveEntity();
8907
8908 return false;
8909 }
8910
8912 {
8914 return;
8915
8917 {
8918 if (ScriptInputUserData.CanStoreInputUserData())
8919 {
8920 ScriptInputUserData ctx = new ScriptInputUserData;
8925 ctx.
Write(destination_entity);
8929 }
8930 }
8931 else if (!
GetGame().IsMultiplayer())
8932 {
8934 }
8935 }
8936
8938 {
8940 return;
8941
8942 float split_quantity_new;
8946 InventoryLocation loc = new InventoryLocation;
8947
8948 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8949 {
8951 split_quantity_new = stack_max;
8952 else
8954
8955 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8956 if (new_item)
8957 {
8958 new_item.SetResultOfSplit(true);
8959 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8961 new_item.SetQuantity(split_quantity_new);
8962 }
8963 }
8964 else if (destination_entity && slot_id == -1)
8965 {
8966 if (quantity > stack_max)
8967 split_quantity_new = stack_max;
8968 else
8969 split_quantity_new = quantity;
8970
8972 {
8975 }
8976
8977 if (new_item)
8978 {
8979 new_item.SetResultOfSplit(true);
8980 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8982 new_item.SetQuantity(split_quantity_new);
8983 }
8984 }
8985 else
8986 {
8987 if (stack_max != 0)
8988 {
8990 {
8992 }
8993
8994 if (split_quantity_new == 0)
8995 {
8996 if (!
GetGame().IsMultiplayer())
8997 player.PhysicalPredictiveDropItem(this);
8998 else
8999 player.ServerDropEntity(this);
9000 return;
9001 }
9002
9004
9005 if (new_item)
9006 {
9007 new_item.SetResultOfSplit(true);
9008 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9010 new_item.SetQuantity(stack_max);
9011 new_item.PlaceOnSurface();
9012 }
9013 }
9014 }
9015 }
9016
9018 {
9020 return;
9021
9022 float split_quantity_new;
9026 InventoryLocation loc = new InventoryLocation;
9027
9028 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9029 {
9031 split_quantity_new = stack_max;
9032 else
9034
9035 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9036 if (new_item)
9037 {
9038 new_item.SetResultOfSplit(true);
9039 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9041 new_item.SetQuantity(split_quantity_new);
9042 }
9043 }
9044 else if (destination_entity && slot_id == -1)
9045 {
9046 if (quantity > stack_max)
9047 split_quantity_new = stack_max;
9048 else
9049 split_quantity_new = quantity;
9050
9052 {
9055 }
9056
9057 if (new_item)
9058 {
9059 new_item.SetResultOfSplit(true);
9060 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9062 new_item.SetQuantity(split_quantity_new);
9063 }
9064 }
9065 else
9066 {
9067 if (stack_max != 0)
9068 {
9070 {
9072 }
9073
9075
9076 if (new_item)
9077 {
9078 new_item.SetResultOfSplit(true);
9079 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9081 new_item.SetQuantity(stack_max);
9082 new_item.PlaceOnSurface();
9083 }
9084 }
9085 }
9086 }
9087
9089 {
9091 return;
9092
9094 {
9095 if (ScriptInputUserData.CanStoreInputUserData())
9096 {
9097 ScriptInputUserData ctx = new ScriptInputUserData;
9102 dst.WriteToContext(ctx);
9104 }
9105 }
9106 else if (!
GetGame().IsMultiplayer())
9107 {
9109 }
9110 }
9111
9113 {
9115 return;
9116
9118 {
9119 if (ScriptInputUserData.CanStoreInputUserData())
9120 {
9121 ScriptInputUserData ctx = new ScriptInputUserData;
9126 ctx.
Write(destination_entity);
9132 }
9133 }
9134 else if (!
GetGame().IsMultiplayer())
9135 {
9137 }
9138 }
9139
9141 {
9143 }
9144
9146 {
9148 return this;
9149
9151 float split_quantity_new;
9153 if (dst.IsValid())
9154 {
9155 int slot_id = dst.GetSlot();
9157
9158 if (quantity > stack_max)
9159 split_quantity_new = stack_max;
9160 else
9161 split_quantity_new = quantity;
9162
9164
9165 if (new_item)
9166 {
9167 new_item.SetResultOfSplit(true);
9168 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9171 }
9172
9173 return new_item;
9174 }
9175
9176 return null;
9177 }
9178
9180 {
9182 return;
9183
9185 float split_quantity_new;
9187 if (destination_entity)
9188 {
9190 if (quantity > stackable)
9191 split_quantity_new = stackable;
9192 else
9193 split_quantity_new = quantity;
9194
9195 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9196 if (new_item)
9197 {
9198 new_item.SetResultOfSplit(true);
9199 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9201 new_item.SetQuantity(split_quantity_new);
9202 }
9203 }
9204 }
9205
9207 {
9209 return;
9210
9212 {
9213 if (ScriptInputUserData.CanStoreInputUserData())
9214 {
9215 ScriptInputUserData ctx = new ScriptInputUserData;
9220 ItemBase destination_entity =
this;
9221 ctx.
Write(destination_entity);
9225 }
9226 }
9227 else if (!
GetGame().IsMultiplayer())
9228 {
9230 }
9231 }
9232
9234 {
9236 return;
9237
9239 float split_quantity_new;
9241 if (player)
9242 {
9244 if (quantity > stackable)
9245 split_quantity_new = stackable;
9246 else
9247 split_quantity_new = quantity;
9248
9249 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9250 new_item =
ItemBase.Cast(in_hands);
9251 if (new_item)
9252 {
9253 new_item.SetResultOfSplit(true);
9254 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9256 new_item.SetQuantity(split_quantity_new);
9257 }
9258 }
9259 }
9260
9262 {
9264 return;
9265
9267 float split_quantity_new = Math.Floor(quantity * 0.5);
9268
9270
9271 if (new_item)
9272 {
9273 if (new_item.GetQuantityMax() < split_quantity_new)
9274 {
9275 split_quantity_new = new_item.GetQuantityMax();
9276 }
9277
9278 new_item.SetResultOfSplit(true);
9279 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9280
9282 {
9285 }
9286 else
9287 {
9290 }
9291 }
9292 }
9293
9295 {
9297 return;
9298
9300 float split_quantity_new = Math.Floor(quantity / 2);
9301
9302 InventoryLocation invloc = new InventoryLocation;
9304
9306 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9307
9308 if (new_item)
9309 {
9310 if (new_item.GetQuantityMax() < split_quantity_new)
9311 {
9312 split_quantity_new = new_item.GetQuantityMax();
9313 }
9315 {
9318 }
9319 else
9320 {
9323 }
9324 }
9325 }
9326
9329 {
9330 SetWeightDirty();
9332
9333 if (parent)
9334 parent.OnAttachmentQuantityChangedEx(this, delta);
9335
9337 {
9339 {
9341 }
9343 {
9344 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9346 }
9347 }
9348
9349 }
9350
9353 {
9354
9355 }
9356
9359 {
9361 }
9362
9364 {
9365 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9366
9368 {
9369 if (newLevel == GameConstants.STATE_RUINED)
9370 {
9372 EntityAI parent = GetHierarchyParent();
9373 if (parent && parent.IsFireplace())
9374 {
9375 CargoBase cargo = GetInventory().GetCargo();
9376 if (cargo)
9377 {
9379 {
9381 }
9382 }
9383 }
9384 }
9385
9387 {
9388
9390 return;
9391 }
9392
9393 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9394 {
9396 }
9397 }
9398 }
9399
9400
9402 {
9403 super.OnRightClick();
9404
9406 {
9408 {
9409 if (ScriptInputUserData.CanStoreInputUserData())
9410 {
9411 vector m4[4];
9413
9414 EntityAI root = GetHierarchyRoot();
9415
9416 InventoryLocation dst = new InventoryLocation;
9418 {
9419 if (root)
9420 {
9421 root.GetTransform(m4);
9423 }
9424 else
9425 GetInventory().GetCurrentInventoryLocation(dst);
9426 }
9427 else
9428 {
9430
9431
9432 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9433 {
9434 if (root)
9435 {
9436 root.GetTransform(m4);
9438 }
9439 else
9440 GetInventory().GetCurrentInventoryLocation(dst);
9441 }
9442 else
9443 {
9444 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9445 }
9446 }
9447
9448 ScriptInputUserData ctx = new ScriptInputUserData;
9456 }
9457 }
9458 else if (!
GetGame().IsMultiplayer())
9459 {
9461 }
9462 }
9463 }
9464
9465 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9466 {
9467
9468 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9469 return false;
9470
9471 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9472 return false;
9473
9474
9476 return false;
9477
9478
9479 Magazine mag = Magazine.Cast(this);
9480 if (mag)
9481 {
9482 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9483 return false;
9484
9485 if (stack_max_limit)
9486 {
9487 Magazine other_mag = Magazine.Cast(other_item);
9488 if (other_item)
9489 {
9490 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9491 return false;
9492 }
9493
9494 }
9495 }
9496 else
9497 {
9498
9500 return false;
9501
9503 return false;
9504 }
9505
9506 PlayerBase player = null;
9507 if (CastTo(player, GetHierarchyRootPlayer()))
9508 {
9509 if (player.GetInventory().HasAttachment(this))
9510 return false;
9511
9512 if (player.IsItemsToDelete())
9513 return false;
9514 }
9515
9516 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9517 return false;
9518
9519 int slotID;
9521 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9522 return false;
9523
9524 return true;
9525 }
9526
9528 {
9530 }
9531
9533 {
9534 return m_IsResultOfSplit;
9535 }
9536
9538 {
9539 m_IsResultOfSplit = value;
9540 }
9541
9543 {
9545 }
9546
9548 {
9549 float other_item_quantity = other_item.GetQuantity();
9550 float this_free_space;
9551
9553
9555
9556 if (other_item_quantity > this_free_space)
9557 {
9558 return this_free_space;
9559 }
9560 else
9561 {
9562 return other_item_quantity;
9563 }
9564 }
9565
9567 {
9569 }
9570
9572 {
9574 return;
9575
9576 if (!IsMagazine() && other_item)
9577 {
9579 if (quantity_used != 0)
9580 {
9581 float hp1 = GetHealth01("","");
9582 float hp2 = other_item.GetHealth01("","");
9583 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9584 hpResult = hpResult / (
GetQuantity() + quantity_used);
9585
9586 hpResult *= GetMaxHealth();
9587 Math.Round(hpResult);
9588 SetHealth("", "Health", hpResult);
9589
9591 other_item.AddQuantity(-quantity_used);
9592 }
9593 }
9595 }
9596
9598 {
9599 #ifdef SERVER
9600 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9601 GetHierarchyParent().IncreaseLifetimeUp();
9602 #endif
9603 };
9604
9606 {
9607 PlayerBase p = PlayerBase.Cast(player);
9608
9609 array<int> recipesIds = p.m_Recipes;
9610 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9611 if (moduleRecipesManager)
9612 {
9613 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9614 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9615 }
9616
9617 for (int i = 0;i < recipesIds.Count(); i++)
9618 {
9619 int key = recipesIds.Get(i);
9620 string recipeName = moduleRecipesManager.GetRecipeName(key);
9622 }
9623 }
9624
9625
9626 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9627 {
9628 super.GetDebugActions(outputList);
9629
9630
9635
9636
9640
9644
9645
9648
9649
9651 {
9654 }
9655
9657
9660
9664 }
9665
9666
9667
9668
9670 {
9671 super.OnAction(action_id, player, ctx);
9672 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9673 {
9674 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9675 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9676 PlayerBase p = PlayerBase.Cast(player);
9677 if (
EActions.RECIPES_RANGE_START < 1000)
9678 {
9679 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9680 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9681 }
9682 }
9683 #ifndef SERVER
9684 else if (action_id ==
EActions.WATCH_PLAYER)
9685 {
9686 PluginDeveloper.SetDeveloperItemClientEx(player);
9687 }
9688 #endif
9690 {
9691 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9692 {
9693 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9694 OnDebugButtonPressServer(id + 1);
9695 }
9696
9697 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9698 {
9699 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9701 }
9702
9703 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9704 {
9705 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9707 }
9708
9709 else if (action_id ==
EActions.ADD_QUANTITY)
9710 {
9711 if (IsMagazine())
9712 {
9713 Magazine mag = Magazine.Cast(this);
9714 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9715 }
9716 else
9717 {
9719 }
9720
9721 if (m_EM)
9722 {
9723 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9724 }
9725
9726 }
9727
9728 else if (action_id ==
EActions.REMOVE_QUANTITY)
9729 {
9730 if (IsMagazine())
9731 {
9732 Magazine mag2 = Magazine.Cast(this);
9733 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9734 }
9735 else
9736 {
9738 }
9739 if (m_EM)
9740 {
9741 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9742 }
9743
9744 }
9745
9746 else if (action_id ==
EActions.SET_QUANTITY_0)
9747 {
9749
9750 if (m_EM)
9751 {
9752 m_EM.SetEnergy(0);
9753 }
9754 }
9755
9756 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9757 {
9759
9760 if (m_EM)
9761 {
9762 m_EM.SetEnergy(m_EM.GetEnergyMax());
9763 }
9764 }
9765
9766 else if (action_id ==
EActions.ADD_HEALTH)
9767 {
9768 AddHealth("","",GetMaxHealth("","Health")/5);
9769 }
9770 else if (action_id ==
EActions.REMOVE_HEALTH)
9771 {
9772 AddHealth("","",-GetMaxHealth("","Health")/5);
9773 }
9774 else if (action_id ==
EActions.DESTROY_HEALTH)
9775 {
9776 SetHealth01("","",0);
9777 }
9778 else if (action_id ==
EActions.WATCH_ITEM)
9779 {
9781 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9782 #ifdef DEVELOPER
9783 SetDebugDeveloper_item(this);
9784 #endif
9785 }
9786
9787 else if (action_id ==
EActions.ADD_TEMPERATURE)
9788 {
9789 AddTemperature(20);
9790
9791 }
9792
9793 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9794 {
9795 AddTemperature(-20);
9796
9797 }
9798
9799 else if (action_id ==
EActions.FLIP_FROZEN)
9800 {
9801 SetFrozen(!GetIsFrozen());
9802
9803 }
9804
9805 else if (action_id ==
EActions.ADD_WETNESS)
9806 {
9808
9809 }
9810
9811 else if (action_id ==
EActions.REMOVE_WETNESS)
9812 {
9814
9815 }
9816
9817 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9818 {
9821
9822
9823 }
9824
9825 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9826 {
9829 }
9830
9831 else if (action_id ==
EActions.MAKE_SPECIAL)
9832 {
9833 auto debugParams = DebugSpawnParams.WithPlayer(player);
9834 OnDebugSpawnEx(debugParams);
9835 }
9836
9837 else if (action_id ==
EActions.DELETE)
9838 {
9839 Delete();
9840 }
9841
9842 }
9843
9844
9845 return false;
9846 }
9847
9848
9849
9850
9854
9857
9858
9859
9861 {
9862 return false;
9863 }
9864
9865
9867 {
9868 return true;
9869 }
9870
9871
9873 {
9874 return true;
9875 }
9876
9877
9878
9880 {
9881 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9883 }
9884
9887 {
9888 return null;
9889 }
9890
9892 {
9893 return false;
9894 }
9895
9897 {
9898 return false;
9899 }
9900
9904
9905
9907 {
9908 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9909 return module_repairing.CanRepair(this, item_repair_kit);
9910 }
9911
9912
9913 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9914 {
9915 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9916 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9917 }
9918
9919
9921 {
9922
9923
9924
9925
9926
9927
9928
9929
9930 return 1;
9931 }
9932
9933
9934
9936 {
9938 }
9939
9940
9941
9943 {
9945 }
9946
9947
9956 {
9957 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9958
9959 if (player)
9960 {
9961 player.MessageStatus(text);
9962 }
9963 }
9964
9965
9974 {
9975 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9976
9977 if (player)
9978 {
9979 player.MessageAction(text);
9980 }
9981 }
9982
9983
9992 {
9993 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9994
9995 if (player)
9996 {
9997 player.MessageFriendly(text);
9998 }
9999 }
10000
10001
10010 {
10011 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10012
10013 if (player)
10014 {
10015 player.MessageImportant(text);
10016 }
10017 }
10018
10020 {
10021 return true;
10022 }
10023
10024
10025 override bool KindOf(
string tag)
10026 {
10027 bool found = false;
10028 string item_name = this.
GetType();
10031
10032 int array_size = item_tag_array.Count();
10033 for (int i = 0; i < array_size; i++)
10034 {
10035 if (item_tag_array.Get(i) == tag)
10036 {
10037 found = true;
10038 break;
10039 }
10040 }
10041 return found;
10042 }
10043
10044
10046 {
10047
10048 super.OnRPC(sender, rpc_type,ctx);
10049
10050
10051 switch (rpc_type)
10052 {
10053 #ifndef SERVER
10054 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10055 Param2<bool, string> p = new Param2<bool, string>(false, "");
10056
10058 return;
10059
10060 bool play = p.param1;
10061 string soundSet = p.param2;
10062
10063 if (play)
10064 {
10066 {
10068 {
10070 }
10071 }
10072 else
10073 {
10075 }
10076 }
10077 else
10078 {
10080 }
10081
10082 break;
10083 #endif
10084
10085 }
10086
10088 {
10090 }
10091 }
10092
10093
10094
10095
10097 {
10098 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10099 return plugin.GetID(
name);
10100 }
10101
10103 {
10104 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10105 return plugin.GetName(id);
10106 }
10107
10110 {
10111
10112
10113 int varFlags;
10114 if (!ctx.
Read(varFlags))
10115 return;
10116
10117 if (varFlags & ItemVariableFlags.FLOAT)
10118 {
10120 }
10121 }
10122
10124 {
10125
10126 super.SerializeNumericalVars(floats_out);
10127
10128
10129
10131 {
10133 }
10134
10136 {
10138 }
10139
10141 {
10143 }
10144
10146 {
10151 }
10152
10154 {
10156 }
10157 }
10158
10160 {
10161
10162 super.DeSerializeNumericalVars(floats);
10163
10164
10165 int index = 0;
10166 int mask = Math.Round(floats.Get(index));
10167
10168 index++;
10169
10171 {
10173 {
10175 }
10176 else
10177 {
10178 float quantity = floats.Get(index);
10179 SetQuantity(quantity,
true,
false,
false,
false);
10180 }
10181 index++;
10182 }
10183
10185 {
10186 float wet = floats.Get(index);
10188 index++;
10189 }
10190
10192 {
10193 int liquidtype = Math.Round(floats.Get(index));
10195 index++;
10196 }
10197
10199 {
10201 index++;
10203 index++;
10205 index++;
10207 index++;
10208 }
10209
10211 {
10212 int cleanness = Math.Round(floats.Get(index));
10214 index++;
10215 }
10216 }
10217
10219 {
10220 super.WriteVarsToCTX(ctx);
10221
10222
10224 {
10226 }
10227
10229 {
10231 }
10232
10234 {
10236 }
10237
10239 {
10240 int r,g,b,a;
10246 }
10247
10249 {
10251 }
10252 }
10253
10255 {
10256 if (!super.ReadVarsFromCTX(ctx,version))
10257 return false;
10258
10259 int intValue;
10260 float value;
10261
10262 if (version < 140)
10263 {
10264 if (!ctx.
Read(intValue))
10265 return false;
10266
10267 m_VariablesMask = intValue;
10268 }
10269
10271 {
10272 if (!ctx.
Read(value))
10273 return false;
10274
10276 {
10278 }
10279 else
10280 {
10282 }
10283 }
10284
10285 if (version < 140)
10286 {
10288 {
10289 if (!ctx.
Read(value))
10290 return false;
10291 SetTemperatureDirect(value);
10292 }
10293 }
10294
10296 {
10297 if (!ctx.
Read(value))
10298 return false;
10300 }
10301
10303 {
10304 if (!ctx.
Read(intValue))
10305 return false;
10307 }
10308
10310 {
10311 int r,g,b,a;
10313 return false;
10315 return false;
10317 return false;
10319 return false;
10320
10322 }
10323
10325 {
10326 if (!ctx.
Read(intValue))
10327 return false;
10329 }
10330
10331 if (version >= 138 && version < 140)
10332 {
10334 {
10335 if (!ctx.
Read(intValue))
10336 return false;
10337 SetFrozen(intValue);
10338 }
10339 }
10340
10341 return true;
10342 }
10343
10344
10346 {
10349 {
10351 }
10352
10353 if (!super.OnStoreLoad(ctx, version))
10354 {
10356 return false;
10357 }
10358
10359 if (version >= 114)
10360 {
10361 bool hasQuickBarIndexSaved;
10362
10363 if (!ctx.
Read(hasQuickBarIndexSaved))
10364 {
10366 return false;
10367 }
10368
10369 if (hasQuickBarIndexSaved)
10370 {
10371 int itmQBIndex;
10372
10373
10374 if (!ctx.
Read(itmQBIndex))
10375 {
10377 return false;
10378 }
10379
10380 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10381 if (itmQBIndex != -1 && parentPlayer)
10382 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10383 }
10384 }
10385 else
10386 {
10387
10388 PlayerBase player;
10389 int itemQBIndex;
10390 if (version ==
int.
MAX)
10391 {
10392 if (!ctx.
Read(itemQBIndex))
10393 {
10395 return false;
10396 }
10397 }
10398 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10399 {
10400
10401 if (!ctx.
Read(itemQBIndex))
10402 {
10404 return false;
10405 }
10406 if (itemQBIndex != -1 && player)
10407 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10408 }
10409 }
10410
10411 if (version < 140)
10412 {
10413
10414 if (!LoadVariables(ctx, version))
10415 {
10417 return false;
10418 }
10419 }
10420
10421
10423 {
10425 return false;
10426 }
10427 if (version >= 132)
10428 {
10430 if (raib)
10431 {
10433 {
10435 return false;
10436 }
10437 }
10438 }
10439
10441 return true;
10442 }
10443
10444
10445
10447 {
10448 super.OnStoreSave(ctx);
10449
10450 PlayerBase player;
10451 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10452 {
10454
10455 int itemQBIndex = -1;
10456 itemQBIndex = player.FindQuickBarEntityIndex(this);
10457 ctx.
Write(itemQBIndex);
10458 }
10459 else
10460 {
10462 }
10463
10465
10467 if (raib)
10468 {
10470 }
10471 }
10472
10473
10475 {
10476 super.AfterStoreLoad();
10477
10479 {
10481 }
10482
10484 {
10487 }
10488 }
10489
10491 {
10492 super.EEOnAfterLoad();
10493
10495 {
10497 }
10498
10501 }
10502
10504 {
10505 return false;
10506 }
10507
10508
10509
10511 {
10513 {
10514 #ifdef PLATFORM_CONSOLE
10515
10517 {
10519 if (menu)
10520 {
10522 }
10523 }
10524 #endif
10525 }
10526
10528 {
10531 }
10532
10534 {
10535 SetWeightDirty();
10537 }
10539 {
10542 }
10543
10545 {
10548 }
10550 {
10553 }
10554
10555 super.OnVariablesSynchronized();
10556 }
10557
10558
10559
10561 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10562 {
10563 if (!IsServerCheck(allow_client))
10564 return false;
10565
10567 return false;
10568
10571
10572 if (value <= (min + 0.001))
10573 value = min;
10574
10575 if (value == min)
10576 {
10577 if (destroy_config)
10578 {
10579 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10580 if (dstr)
10581 {
10583 this.Delete();
10584 return true;
10585 }
10586 }
10587 else if (destroy_forced)
10588 {
10590 this.Delete();
10591 return true;
10592 }
10593
10595 }
10596
10599
10601 {
10603
10604 if (delta)
10606 }
10607
10609
10610 return false;
10611 }
10612
10613
10615 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10616 {
10618 }
10619
10621 {
10624 }
10625
10627 {
10630 }
10631
10634 {
10635 float value_clamped = Math.Clamp(value, 0, 1);
10637 SetQuantity(result, destroy_config, destroy_forced);
10638 }
10639
10640
10643 {
10645 }
10646
10648 {
10650 }
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10662 {
10663 int slot = -1;
10664 if (GetInventory())
10665 {
10666 InventoryLocation il = new InventoryLocation;
10667 GetInventory().GetCurrentInventoryLocation(il);
10669 }
10670
10672 }
10673
10675 {
10676 float quantity_max = 0;
10677
10679 {
10680 if (attSlotID != -1)
10681 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10682
10683 if (quantity_max <= 0)
10685 }
10686
10687 if (quantity_max <= 0)
10689
10690 return quantity_max;
10691 }
10692
10694 {
10696 }
10697
10699 {
10701 }
10702
10703
10705 {
10707 }
10708
10710 {
10712 }
10713
10715 {
10717 }
10718
10719
10721 {
10722
10723 float weightEx = GetWeightEx();
10724 float special = GetInventoryAndCargoWeight();
10725 return weightEx - special;
10726 }
10727
10728
10730 {
10732 }
10733
10735 {
10737 {
10738 #ifdef DEVELOPER
10739 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10740 {
10741 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10743 }
10744 #endif
10745
10746 return GetQuantity() * GetConfigWeightModified();
10747 }
10748 else if (HasEnergyManager())
10749 {
10750 #ifdef DEVELOPER
10751 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10752 {
10753 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10754 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10755 }
10756 #endif
10757 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10758 }
10759 else
10760 {
10761 #ifdef DEVELOPER
10762 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10763 {
10764 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10765 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10766 }
10767 #endif
10768 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10769 }
10770 }
10771
10774 {
10775 int item_count = 0;
10777
10778 if (GetInventory().GetCargo() != NULL)
10779 {
10780 item_count = GetInventory().GetCargo().GetItemCount();
10781 }
10782
10783 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10784 {
10785 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10786 if (item)
10787 item_count += item.GetNumberOfItems();
10788 }
10789 return item_count;
10790 }
10791
10794 {
10795 float weight = 0;
10796 float wetness = 1;
10797 if (include_wetness)
10800 {
10801 weight = wetness * m_ConfigWeight;
10802 }
10804 {
10805 weight = 1;
10806 }
10807 return weight;
10808 }
10809
10810
10811
10813 {
10814 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10815 {
10816 GameInventory inv = GetInventory();
10817 array<EntityAI> items = new array<EntityAI>;
10819 for (int i = 0; i < items.Count(); i++)
10820 {
10822 if (item)
10823 {
10825 }
10826 }
10827 }
10828 }
10829
10830
10831
10832
10834 {
10835 float energy = 0;
10836 if (HasEnergyManager())
10837 {
10838 energy = GetCompEM().GetEnergy();
10839 }
10840 return energy;
10841 }
10842
10843
10845 {
10846 super.OnEnergyConsumed();
10847
10849 }
10850
10852 {
10853 super.OnEnergyAdded();
10854
10856 }
10857
10858
10860 {
10861 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10862 {
10864 {
10865 float energy_0to1 = GetCompEM().GetEnergy0To1();
10867 }
10868 }
10869 }
10870
10871
10873 {
10874 return ConfigGetFloat("heatIsolation");
10875 }
10876
10878 {
10880 }
10881
10883 {
10884 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10885 if (
GetGame().ConfigIsExisting(paramPath))
10887
10888 return 0.0;
10889 }
10890
10892 {
10893 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10894 if (
GetGame().ConfigIsExisting(paramPath))
10896
10897 return 0.0;
10898 }
10899
10900 override void SetWet(
float value,
bool allow_client =
false)
10901 {
10902 if (!IsServerCheck(allow_client))
10903 return;
10904
10907
10909
10910 m_VarWet = Math.Clamp(value, min, max);
10911
10913 {
10916 }
10917 }
10918
10919 override void AddWet(
float value)
10920 {
10922 }
10923
10925 {
10927 }
10928
10930 {
10932 }
10933
10935 {
10937 }
10938
10940 {
10942 }
10943
10945 {
10947 }
10948
10949 override void OnWetChanged(
float newVal,
float oldVal)
10950 {
10953 if (newLevel != oldLevel)
10954 {
10956 }
10957 }
10958
10960 {
10961 SetWeightDirty();
10962 }
10963
10965 {
10966 return GetWetLevelInternal(
m_VarWet);
10967 }
10968
10969
10970
10972 {
10974 }
10975
10977 {
10979 }
10980
10982 {
10984 }
10985
10987 {
10989 }
10990
10991
10992
10994 {
10995 if (ConfigIsExisting("itemModelLength"))
10996 {
10997 return ConfigGetFloat("itemModelLength");
10998 }
10999 return 0;
11000 }
11001
11003 {
11004 if (ConfigIsExisting("itemAttachOffset"))
11005 {
11006 return ConfigGetFloat("itemAttachOffset");
11007 }
11008 return 0;
11009 }
11010
11011 override void SetCleanness(
int value,
bool allow_client =
false)
11012 {
11013 if (!IsServerCheck(allow_client))
11014 return;
11015
11017
11019
11022 }
11023
11025 {
11027 }
11028
11030 {
11031 return true;
11032 }
11033
11034
11035
11036
11038 {
11040 }
11041
11043 {
11045 }
11046
11047
11048
11049
11050 override void SetColor(
int r,
int g,
int b,
int a)
11051 {
11057 }
11059 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11060 {
11065 }
11066
11068 {
11070 }
11071
11074 {
11075 int r,g,b,a;
11077 r = r/255;
11078 g = g/255;
11079 b = b/255;
11080 a = a/255;
11081 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11082 }
11083
11084
11085
11086 override void SetLiquidType(
int value,
bool allow_client =
false)
11087 {
11088 if (!IsServerCheck(allow_client))
11089 return;
11090
11095 }
11096
11098 {
11099 return ConfigGetInt("varLiquidTypeInit");
11100 }
11101
11103 {
11105 }
11106
11108 {
11110 SetFrozen(false);
11111 }
11112
11115 {
11116 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11117 }
11118
11119
11122 {
11123 PlayerBase nplayer;
11124 if (PlayerBase.CastTo(nplayer, player))
11125 {
11127
11128 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11129 }
11130 }
11131
11132
11135 {
11136 PlayerBase nplayer;
11137 if (PlayerBase.CastTo(nplayer,player))
11138 {
11139
11140 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11141
11142 }
11143
11144
11145 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11146
11147
11148 if (HasEnergyManager())
11149 {
11150 GetCompEM().UpdatePlugState();
11151 }
11152 }
11153
11154
11156 {
11157 super.OnPlacementStarted(player);
11158
11160 }
11161
11162 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11163 {
11165 {
11166 m_AdminLog.OnPlacementComplete(player,
this);
11167 }
11168
11169 super.OnPlacementComplete(player, position, orientation);
11170 }
11171
11172
11173
11174
11175
11177 {
11179 {
11180 return true;
11181 }
11182 else
11183 {
11184 return false;
11185 }
11186 }
11187
11188
11190 {
11192 {
11194 }
11195 }
11196
11197
11199 {
11201 }
11202
11204 {
11206 }
11207
11208 override void InsertAgent(
int agent,
float count = 1)
11209 {
11210 if (count < 1)
11211 return;
11212
11214 }
11215
11218 {
11220 }
11221
11222
11224 {
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
11262
11263
11264
11265
11266
11267
11268
11270 {
11272 return false;
11273 return true;
11274 }
11275
11277 {
11278
11280 }
11281
11282
11285 {
11286 super.CheckForRoofLimited(timeTresholdMS);
11287
11289 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11290 {
11291 m_PreviousRoofTestTime = time;
11292 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11293 }
11294 }
11295
11296
11298 {
11300 {
11301 return 0;
11302 }
11303
11304 if (GetInventory().GetAttachmentSlotsCount() != 0)
11305 {
11306 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11307 if (filter)
11308 return filter.GetProtectionLevel(type, false, system);
11309 else
11310 return 0;
11311 }
11312
11313 string subclassPath, entryName;
11314
11315 switch (type)
11316 {
11318 entryName = "biological";
11319 break;
11321 entryName = "chemical";
11322 break;
11323 default:
11324 entryName = "biological";
11325 break;
11326 }
11327
11328 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11329
11331 }
11332
11333
11334
11337 {
11338 if (!IsMagazine())
11340
11342 }
11343
11344
11345
11346
11347
11352 {
11353 return true;
11354 }
11355
11357 {
11359 }
11360
11361
11362
11363
11364
11366 {
11367 if (parent)
11368 {
11369 if (parent.IsInherited(DayZInfected))
11370 return true;
11371
11372 if (!parent.IsRuined())
11373 return true;
11374 }
11375
11376 return true;
11377 }
11378
11380 {
11381 if (!super.CanPutAsAttachment(parent))
11382 {
11383 return false;
11384 }
11385
11386 if (!IsRuined() && !parent.IsRuined())
11387 {
11388 return true;
11389 }
11390
11391 return false;
11392 }
11393
11395 {
11396
11397
11398
11399
11400 return super.CanReceiveItemIntoCargo(item);
11401 }
11402
11404 {
11405
11406
11407
11408
11409 GameInventory attachmentInv = attachment.GetInventory();
11411 {
11412 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11413 return false;
11414 }
11415
11416 InventoryLocation loc = new InventoryLocation();
11417 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11418 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11419 return false;
11420
11421 return super.CanReceiveAttachment(attachment, slotId);
11422 }
11423
11425 {
11426 if (!super.CanReleaseAttachment(attachment))
11427 return false;
11428
11429 return GetInventory().AreChildrenAccessible();
11430 }
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11453 {
11454 int id = muzzle_owner.GetMuzzleID();
11455 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11456
11457 if (WPOF_array)
11458 {
11459 for (int i = 0; i < WPOF_array.Count(); i++)
11460 {
11461 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11462
11463 if (WPOF)
11464 {
11465 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11466 }
11467 }
11468 }
11469 }
11470
11471
11473 {
11474 int id = muzzle_owner.GetMuzzleID();
11476
11477 if (WPOBE_array)
11478 {
11479 for (int i = 0; i < WPOBE_array.Count(); i++)
11480 {
11481 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11482
11483 if (WPOBE)
11484 {
11485 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11486 }
11487 }
11488 }
11489 }
11490
11491
11493 {
11494 int id = muzzle_owner.GetMuzzleID();
11495 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11496
11497 if (WPOOH_array)
11498 {
11499 for (int i = 0; i < WPOOH_array.Count(); i++)
11500 {
11501 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11502
11503 if (WPOOH)
11504 {
11505 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11506 }
11507 }
11508 }
11509 }
11510
11511
11513 {
11514 int id = muzzle_owner.GetMuzzleID();
11515 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11516
11517 if (WPOOH_array)
11518 {
11519 for (int i = 0; i < WPOOH_array.Count(); i++)
11520 {
11521 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11522
11523 if (WPOOH)
11524 {
11525 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11526 }
11527 }
11528 }
11529 }
11530
11531
11533 {
11534 int id = muzzle_owner.GetMuzzleID();
11535 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11536
11537 if (WPOOH_array)
11538 {
11539 for (int i = 0; i < WPOOH_array.Count(); i++)
11540 {
11541 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11542
11543 if (WPOOH)
11544 {
11545 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11546 }
11547 }
11548 }
11549 }
11550
11551
11552
11554 {
11556 {
11557 return true;
11558 }
11559
11560 return false;
11561 }
11562
11564 {
11566 {
11567 return true;
11568 }
11569
11570 return false;
11571 }
11572
11574 {
11576 {
11577 return true;
11578 }
11579
11580 return false;
11581 }
11582
11584 {
11585 return false;
11586 }
11587
11590 {
11591 return UATimeSpent.DEFAULT_DEPLOY;
11592 }
11593
11594
11595
11596
11598 {
11600 SetSynchDirty();
11601 }
11602
11604 {
11606 }
11607
11608
11610 {
11611 return false;
11612 }
11613
11616 {
11617 string att_type = "None";
11618
11619 if (ConfigIsExisting("soundAttType"))
11620 {
11621 att_type = ConfigGetString("soundAttType");
11622 }
11623
11625 }
11626
11628 {
11630 }
11631
11632
11633
11634
11635
11639
11641 {
11644
11646 }
11647
11648
11650 {
11652 return;
11653
11655
11658
11661
11662 SoundParameters params = new SoundParameters();
11666 }
11667
11668
11670 {
11672 return;
11673
11675 SetSynchDirty();
11676
11679 }
11680
11681
11683 {
11685 return;
11686
11688 SetSynchDirty();
11689
11692 }
11693
11695 {
11697 }
11698
11700 {
11702 }
11703
11706 {
11707 if (!
GetGame().IsDedicatedServer())
11708 {
11709 if (ConfigIsExisting("attachSoundSet"))
11710 {
11711 string cfg_path = "";
11712 string soundset = "";
11713 string type_name =
GetType();
11714
11717 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11718 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11719
11720 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11721 {
11722 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11723 {
11724 if (cfg_slot_array[i] == slot_type)
11725 {
11726 soundset = cfg_soundset_array[i];
11727 break;
11728 }
11729 }
11730 }
11731
11732 if (soundset != "")
11733 {
11734 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11736 }
11737 }
11738 }
11739 }
11740
11742 {
11743
11744 }
11745
11746 void OnApply(PlayerBase player);
11747
11749 {
11750 return 1.0;
11751 };
11752
11754 {
11756 }
11757
11759 {
11761 }
11762
11764
11766 {
11767 SetDynamicPhysicsLifeTime(0.01);
11769 }
11770
11772 {
11773 array<string> zone_names = new array<string>;
11774 GetDamageZones(zone_names);
11775 for (int i = 0; i < zone_names.Count(); i++)
11776 {
11777 SetHealthMax(zone_names.Get(i),"Health");
11778 }
11779 SetHealthMax("","Health");
11780 }
11781
11784 {
11785 float global_health = GetHealth01("","Health");
11786 array<string> zones = new array<string>;
11787 GetDamageZones(zones);
11788
11789 for (int i = 0; i < zones.Count(); i++)
11790 {
11791 SetHealth01(zones.Get(i),"Health",global_health);
11792 }
11793 }
11794
11797 {
11798 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11799 }
11800
11802 {
11803 if (!hasRootAsPlayer)
11804 {
11805 if (refParentIB)
11806 {
11807
11808 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11809 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11810
11811 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11812 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11813
11816 }
11817 else
11818 {
11819
11822 }
11823 }
11824 }
11825
11827 {
11829 {
11830 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11831 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11832 {
11833 float heatPermCoef = 1.0;
11835 while (ent)
11836 {
11837 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11838 ent = ent.GetHierarchyParent();
11839 }
11840
11841 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11842 }
11843 }
11844 }
11845
11847 {
11848
11849 EntityAI parent = GetHierarchyParent();
11850 if (!parent)
11851 {
11852 hasParent = false;
11853 hasRootAsPlayer = false;
11854 }
11855 else
11856 {
11857 hasParent = true;
11858 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11859 refParentIB =
ItemBase.Cast(parent);
11860 }
11861 }
11862
11863 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11864 {
11865
11866 }
11867
11869 {
11870
11871 return false;
11872 }
11873
11875 {
11876
11877
11878 return false;
11879 }
11880
11882 {
11883
11884 return false;
11885 }
11886
11889 {
11890 return !GetIsFrozen() &&
IsOpen();
11891 }
11892
11894 {
11895 bool hasParent = false, hasRootAsPlayer = false;
11897
11898 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11899 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11900
11901 if (wwtu || foodDecay)
11902 {
11906
11907 if (processWetness || processTemperature || processDecay)
11908 {
11910
11911 if (processWetness)
11912 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11913
11914 if (processTemperature)
11916
11917 if (processDecay)
11918 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11919 }
11920 }
11921 }
11922
11925 {
11927 }
11928
11930 {
11933
11934 return super.GetTemperatureFreezeThreshold();
11935 }
11936
11938 {
11941
11942 return super.GetTemperatureThawThreshold();
11943 }
11944
11946 {
11949
11950 return super.GetItemOverheatThreshold();
11951 }
11952
11954 {
11956 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11957
11958 return super.GetTemperatureFreezeTime();
11959 }
11960
11962 {
11964 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11965
11966 return super.GetTemperatureThawTime();
11967 }
11968
11973
11975 {
11976 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11977 }
11978
11980 {
11981 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11982 }
11983
11986 {
11988 }
11989
11991 {
11993 }
11994
11996 {
11998 }
11999
12002 {
12003 return null;
12004 }
12005
12008 {
12009 return false;
12010 }
12011
12013 {
12015 {
12018 if (!trg)
12019 {
12021 explosive = this;
12022 }
12023
12024 explosive.PairRemote(trg);
12026
12027 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12028 trg.SetPersistentPairID(persistentID);
12029 explosive.SetPersistentPairID(persistentID);
12030
12031 return true;
12032 }
12033 return false;
12034 }
12035
12038 {
12039 float ret = 1.0;
12042 ret *= GetHealth01();
12043
12044 return ret;
12045 }
12046
12047 #ifdef DEVELOPER
12048 override void SetDebugItem()
12049 {
12050 super.SetDebugItem();
12051 _itemBase = this;
12052 }
12053
12055 {
12056 string text = super.GetDebugText();
12057
12059 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12060
12061 return text;
12062 }
12063 #endif
12064
12066 {
12067 return true;
12068 }
12069
12071
12073
12075 {
12078 }
12079
12080
12088
12104}
12105
12107{
12109 if (entity)
12110 {
12111 bool is_item = entity.IsInherited(
ItemBase);
12112 if (is_item && full_quantity)
12113 {
12116 }
12117 }
12118 else
12119 {
12121 return NULL;
12122 }
12123 return entity;
12124}
12125
12127{
12128 if (item)
12129 {
12130 if (health > 0)
12131 item.SetHealth("", "", health);
12132
12133 if (item.CanHaveTemperature())
12134 {
12136 if (item.CanFreeze())
12137 item.SetFrozen(false);
12138 }
12139
12140 if (item.HasEnergyManager())
12141 {
12142 if (quantity >= 0)
12143 {
12144 item.GetCompEM().SetEnergy0To1(quantity);
12145 }
12146 else
12147 {
12149 }
12150 }
12151 else if (item.IsMagazine())
12152 {
12153 Magazine mag = Magazine.Cast(item);
12154 if (quantity >= 0)
12155 {
12156 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12157 }
12158 else
12159 {
12161 }
12162
12163 }
12164 else
12165 {
12166 if (quantity >= 0)
12167 {
12168 item.SetQuantityNormalized(quantity, false);
12169 }
12170 else
12171 {
12173 }
12174
12175 }
12176 }
12177}
12178
12179#ifdef DEVELOPER
12181#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.