7345{
7347 {
7348 return true;
7349 }
7350};
7351
7352
7353
7355{
7359
7361
7364
7365
7366
7367
7368
7377
7383
7388
7393
7414 protected bool m_IsResultOfSplit
7415
7417
7422
7423
7424
7426
7430
7431
7432
7434
7437
7438
7439
7445
7446
7454
7457
7458
7460
7461
7463
7464
7469
7470
7475
7476
7478
7479
7481 {
7486
7487 if (!
GetGame().IsDedicatedServer())
7488 {
7490 {
7492
7494 {
7496 }
7497 }
7498
7501 }
7502
7503 m_OldLocation = null;
7504
7506 {
7508 }
7509
7510 if (ConfigIsExisting("headSelectionsToHide"))
7511 {
7514 }
7515
7517 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7518 {
7520 }
7521
7523
7524 m_IsResultOfSplit = false;
7525
7527 }
7528
7530 {
7531 super.InitItemVariables();
7532
7538 m_Count = ConfigGetInt(
"count");
7539
7542
7547
7550
7555
7567
7571
7572
7575 if (ConfigIsExisting("canBeSplit"))
7576 {
7579 }
7580
7582 if (ConfigIsExisting("itemBehaviour"))
7584
7585
7588 RegisterNetSyncVariableInt("m_VarLiquidType");
7589 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7590
7591 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7592 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7593 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7594
7595 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7596 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7597 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7598 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7599
7600 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7601 RegisterNetSyncVariableBool("m_IsTakeable");
7602 RegisterNetSyncVariableBool("m_IsHologram");
7603
7606 {
7609 }
7610
7612
7614 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7616
7617 }
7618
7620 {
7622 }
7623
7625 {
7628 {
7633 }
7634 }
7635
7636 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7637 {
7639 {
7642 }
7643
7645 }
7646
7648 {
7654 }
7655
7657
7659 {
7661
7662 if (!action)
7663 {
7664 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7665 return;
7666 }
7667
7669 if (!ai)
7670 {
7672 return;
7673 }
7674
7676 if (!action_array)
7677 {
7678 action_array = new array<ActionBase_Basic>;
7680 }
7681 if (LogManager.IsActionLogEnable())
7682 {
7683 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7684 }
7685
7686 if (action_array.Find(action) != -1)
7687 {
7688 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7689 }
7690 else
7691 {
7692 action_array.Insert(action);
7693 }
7694 }
7695
7697 {
7699 ActionBase action = player.GetActionManager().GetAction(actionName);
7702
7703 if (action_array)
7704 {
7705 action_array.RemoveItem(action);
7706 }
7707 }
7708
7709
7710
7712 {
7713 ActionOverrideData overrideData = new ActionOverrideData();
7717
7719 if (!actionMap)
7720 {
7723 }
7724
7725 actionMap.Insert(this.
Type(), overrideData);
7726
7727 }
7728
7730
7732
7733
7735 {
7738
7741
7742 string config_to_search = "CfgVehicles";
7743 string muzzle_owner_config;
7744
7746 {
7747 if (IsInherited(Weapon))
7748 config_to_search = "CfgWeapons";
7749
7750 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7751
7752 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7753
7755
7756 if (config_OnFire_subclass_count > 0)
7757 {
7758 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7759
7760 for (int i = 0; i < config_OnFire_subclass_count; i++)
7761 {
7762 string particle_class = "";
7764 string config_OnFire_entry = config_OnFire_class + particle_class;
7765 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7766 WPOF_array.Insert(WPOF);
7767 }
7768
7769
7771 }
7772 }
7773
7775 {
7776 config_to_search = "CfgWeapons";
7777 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7778
7779 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7780
7782
7783 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7784 {
7785 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7786
7787 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7788 {
7789 string particle_class2 = "";
7791 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7792 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7793 WPOBE_array.Insert(WPOBE);
7794 }
7795
7796
7798 }
7799 }
7800 }
7801
7802
7804 {
7807
7809 {
7810 string config_to_search = "CfgVehicles";
7811
7812 if (IsInherited(Weapon))
7813 config_to_search = "CfgWeapons";
7814
7815 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7816 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7817
7818 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7819 {
7820
7822
7824 {
7826 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7828 return;
7829 }
7830
7833
7834
7835
7837 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7838
7839 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7840 {
7841 string particle_class = "";
7843 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7845
7846 if (entry_type == CT_CLASS)
7847 {
7848 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7849 WPOOH_array.Insert(WPOF);
7850 }
7851 }
7852
7853
7855 }
7856 }
7857 }
7858
7860 {
7862 }
7863
7865 {
7867 {
7869
7872
7875
7876 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7877 }
7878 }
7879
7881 {
7883 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7884
7886 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7887
7889 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7890
7892 {
7894 }
7895 }
7896
7898 {
7900 }
7901
7903 {
7906 else
7908
7910 {
7913 }
7914 else
7915 {
7918
7921 }
7922
7924 }
7925
7927 {
7929 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7930 }
7931
7933 {
7935 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7937 }
7938
7940 {
7942 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7943 }
7944
7946 {
7949
7950 OverheatingParticle OP = new OverheatingParticle();
7955
7957 }
7958
7960 {
7963
7964 return -1;
7965 }
7966
7968 {
7970 {
7973
7974 for (int i = count; i > 0; --i)
7975 {
7976 int id = i - 1;
7979
7982
7983 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7984 {
7985 if (p)
7986 {
7989 }
7990 }
7991 }
7992 }
7993 }
7994
7996 {
7998 {
8000 {
8001 int id = i - 1;
8003
8004 if (OP)
8005 {
8007
8008 if (p)
8009 {
8011 }
8012
8013 delete OP;
8014 }
8015 }
8016
8019 }
8020 }
8021
8024 {
8025 return 0.0;
8026 }
8027
8028
8030 {
8031 return 250;
8032 }
8033
8035 {
8036 return 0;
8037 }
8038
8041 {
8043 return true;
8044
8045 return false;
8046 }
8047
8050 {
8053
8055 {
8057 }
8058 else
8059 {
8060
8062 }
8063
8065 }
8066
8073 {
8074 return -1;
8075 }
8076
8077
8078
8079
8081 {
8083 {
8085 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8086
8087 if (r_index >= 0)
8088 {
8089 InventoryLocation r_il = new InventoryLocation;
8090 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8091
8092 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8095 {
8096 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8097 }
8099 {
8100 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8101 }
8102
8103 }
8104
8105 player.GetHumanInventory().ClearUserReservedLocation(this);
8106 }
8107
8110 }
8111
8112
8113
8114
8116 {
8117 return ItemBase.m_DebugActionsMask;
8118 }
8119
8121 {
8122 return ItemBase.m_DebugActionsMask & mask;
8123 }
8124
8126 {
8127 ItemBase.m_DebugActionsMask = mask;
8128 }
8129
8131 {
8132 ItemBase.m_DebugActionsMask |= mask;
8133 }
8134
8136 {
8137 ItemBase.m_DebugActionsMask &= ~mask;
8138 }
8139
8141 {
8143 {
8145 }
8146 else
8147 {
8149 }
8150 }
8151
8152
8154 {
8155 if (GetEconomyProfile())
8156 {
8157 float q_max = GetEconomyProfile().GetQuantityMax();
8158 if (q_max > 0)
8159 {
8160 float q_min = GetEconomyProfile().GetQuantityMin();
8161 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8162
8164 {
8165 ComponentEnergyManager comp = GetCompEM();
8167 {
8169 }
8170 }
8172 {
8174
8175 }
8176
8177 }
8178 }
8179 }
8180
8183 {
8184 EntityAI parent = GetHierarchyParent();
8185
8186 if (parent)
8187 {
8188 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8189 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8190 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8191 }
8192 }
8193
8196 {
8197 EntityAI parent = GetHierarchyParent();
8198
8199 if (parent)
8200 {
8201 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8202 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8203 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8204 }
8205 }
8206
8208 {
8209
8210
8211
8212
8214
8216 {
8217 if (ScriptInputUserData.CanStoreInputUserData())
8218 {
8219 ScriptInputUserData ctx = new ScriptInputUserData;
8225 ctx.
Write(use_stack_max);
8228
8230 {
8231 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8232 }
8233 }
8234 }
8235 else if (!
GetGame().IsMultiplayer())
8236 {
8238 }
8239 }
8240
8242 {
8244 }
8245
8247 {
8249 }
8250
8252 {
8254 }
8255
8257 {
8258
8259 return false;
8260 }
8261
8263 {
8264 return false;
8265 }
8266
8270 {
8271 return false;
8272 }
8273
8275 {
8276 return "";
8277 }
8278
8280
8282 {
8283 return false;
8284 }
8285
8287 {
8288 return true;
8289 }
8290
8291
8292
8294 {
8295 return true;
8296 }
8297
8299 {
8300 return true;
8301 }
8302
8304 {
8305 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8307 }
8308
8310 {
8312 }
8313
8315 {
8317 if (!is_being_placed)
8319 SetSynchDirty();
8320 }
8321
8322
8324
8326 {
8328 }
8329
8331 {
8333 }
8334
8336 {
8337 return 1;
8338 }
8339
8341 {
8342 return false;
8343 }
8344
8346 {
8348 SetSynchDirty();
8349 }
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8386 {
8387 super.OnMovedInsideCargo(container);
8388
8389 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8390 }
8391
8392 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8393 {
8394 super.EEItemLocationChanged(oldLoc,newLoc);
8395
8396 PlayerBase new_player = null;
8397 PlayerBase old_player = null;
8398
8399 if (newLoc.GetParent())
8400 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8401
8402 if (oldLoc.GetParent())
8403 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8404
8406 {
8407 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8408
8409 if (r_index >= 0)
8410 {
8411 InventoryLocation r_il = new InventoryLocation;
8412 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8413
8414 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8417 {
8418 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8419 }
8421 {
8422 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8423 }
8424
8425 }
8426 }
8427
8429 {
8430 if (new_player)
8431 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8432
8433 if (new_player == old_player)
8434 {
8435
8436 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8437 {
8439 {
8440 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8441 {
8442 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8443 }
8444 }
8445 else
8446 {
8447 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8448 }
8449 }
8450
8451 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8452 {
8453 int type = oldLoc.GetType();
8455 {
8456 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8457 }
8459 {
8460 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8461 }
8462 }
8463 if (!m_OldLocation)
8464 {
8465 m_OldLocation = new InventoryLocation;
8466 }
8467 m_OldLocation.Copy(oldLoc);
8468 }
8469 else
8470 {
8471 if (m_OldLocation)
8472 {
8473 m_OldLocation.Reset();
8474 }
8475 }
8476
8478 }
8479 else
8480 {
8481 if (new_player)
8482 {
8483 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8484 if (res_index >= 0)
8485 {
8486 InventoryLocation il = new InventoryLocation;
8487 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8489 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8492 {
8493 il.
GetParent().GetOnReleaseLock().Invoke(it);
8494 }
8496 {
8498 }
8499
8500 }
8501 }
8503 {
8504
8506 }
8507
8508 if (m_OldLocation)
8509 {
8510 m_OldLocation.Reset();
8511 }
8512 }
8513 }
8514
8515 override void EOnContact(IEntity other, Contact extra)
8516 {
8518 {
8519 int liquidType = -1;
8521 if (impactSpeed > 0.0)
8522 {
8524 #ifndef SERVER
8526 #else
8528 SetSynchDirty();
8529 #endif
8531 }
8532 }
8533
8534 #ifdef SERVER
8535 if (GetCompEM() && GetCompEM().IsPlugged())
8536 {
8537 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8538 GetCompEM().UnplugThis();
8539 }
8540 #endif
8541 }
8542
8544
8546 {
8548 }
8549
8551 {
8552
8553 }
8554
8556 {
8557 super.OnItemLocationChanged(old_owner, new_owner);
8558
8559 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8560 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8561
8562 if (!relatedPlayer && playerNew)
8563 relatedPlayer = playerNew;
8564
8565 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8566 {
8568 if (actionMgr)
8569 {
8570 ActionBase currentAction = actionMgr.GetRunningAction();
8571 if (currentAction)
8573 }
8574 }
8575
8576 Man ownerPlayerOld = null;
8577 Man ownerPlayerNew = null;
8578
8579 if (old_owner)
8580 {
8581 if (old_owner.
IsMan())
8582 {
8583 ownerPlayerOld = Man.Cast(old_owner);
8584 }
8585 else
8586 {
8587 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8588 }
8589 }
8590 else
8591 {
8593 {
8595
8596 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8597 {
8598 GetCompEM().UnplugThis();
8599 }
8600 }
8601 }
8602
8603 if (new_owner)
8604 {
8605 if (new_owner.
IsMan())
8606 {
8607 ownerPlayerNew = Man.Cast(new_owner);
8608 }
8609 else
8610 {
8611 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8612 }
8613 }
8614
8615 if (ownerPlayerOld != ownerPlayerNew)
8616 {
8617 if (ownerPlayerOld)
8618 {
8619 array<EntityAI> subItemsExit = new array<EntityAI>;
8621 for (int i = 0; i < subItemsExit.Count(); i++)
8622 {
8625 }
8626 }
8627
8628 if (ownerPlayerNew)
8629 {
8630 array<EntityAI> subItemsEnter = new array<EntityAI>;
8632 for (int j = 0; j < subItemsEnter.Count(); j++)
8633 {
8636 }
8637 }
8638 }
8639 else if (ownerPlayerNew != null)
8640 {
8641 PlayerBase nplayer;
8642 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8643 {
8644 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8646 for (int k = 0; k < subItemsUpdate.Count(); k++)
8647 {
8649 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8650 }
8651 }
8652 }
8653
8654 if (old_owner)
8655 old_owner.OnChildItemRemoved(this);
8656 if (new_owner)
8657 new_owner.OnChildItemReceived(this);
8658 }
8659
8660
8662 {
8663 super.EEDelete(parent);
8664 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8665 if (player)
8666 {
8668
8669 if (player.IsAlive())
8670 {
8671 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8672 if (r_index >= 0)
8673 {
8674 InventoryLocation r_il = new InventoryLocation;
8675 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8676
8677 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8680 {
8681 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8682 }
8684 {
8685 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8686 }
8687
8688 }
8689
8690 player.RemoveQuickBarEntityShortcut(this);
8691 }
8692 }
8693 }
8694
8696 {
8697 super.EEKilled(killer);
8698
8701 {
8702 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8703 {
8704 if (IsMagazine())
8705 {
8706 if (Magazine.Cast(this).GetAmmoCount() > 0)
8707 {
8709 }
8710 }
8711 else
8712 {
8714 }
8715 }
8716 }
8717 }
8718
8720 {
8721 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8722
8723 super.OnWasAttached(parent, slot_id);
8724
8727
8729 }
8730
8732 {
8733 super.OnWasDetached(parent, slot_id);
8734
8737 }
8738
8740 {
8741 int idx;
8744
8745 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8746 if (inventory_slots.Count() < 1)
8747 {
8748 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8749 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8750 }
8751 else
8752 {
8753 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8754 }
8755
8756 idx = inventory_slots.Find(slot);
8757 if (idx < 0)
8758 return "";
8759
8760 return attach_types.Get(idx);
8761 }
8762
8764 {
8765 int idx = -1;
8766 string slot;
8767
8770
8771 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8772 if (inventory_slots.Count() < 1)
8773 {
8774 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8775 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8776 }
8777 else
8778 {
8779 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8780 if (detach_types.Count() < 1)
8781 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8782 }
8783
8784 for (int i = 0; i < inventory_slots.Count(); i++)
8785 {
8786 slot = inventory_slots.Get(i);
8787 }
8788
8789 if (slot != "")
8790 {
8791 if (detach_types.Count() == 1)
8792 idx = 0;
8793 else
8794 idx = inventory_slots.Find(slot);
8795 }
8796 if (idx < 0)
8797 return "";
8798
8799 return detach_types.Get(idx);
8800 }
8801
8803 {
8804
8806
8807
8808 float min_time = 1;
8809 float max_time = 3;
8810 float delay = Math.RandomFloat(min_time, max_time);
8811
8812 explode_timer.Run(delay, this, "DoAmmoExplosion");
8813 }
8814
8816 {
8817 Magazine magazine = Magazine.Cast(this);
8818 int pop_sounds_count = 6;
8819 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8820
8821
8822 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8823 string sound_name = pop_sounds[ sound_idx ];
8825
8826
8827 magazine.ServerAddAmmoCount(-1);
8828
8829
8830 float min_temp_to_explode = 100;
8831
8832 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8833 {
8835 }
8836 }
8837
8838
8839 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8840 {
8841 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8842
8843 const int CHANCE_DAMAGE_CARGO = 4;
8844 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8845 const int CHANCE_DAMAGE_NOTHING = 2;
8846
8848 {
8849 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8850 int chances;
8851 int rnd;
8852
8853 if (GetInventory().GetCargo())
8854 {
8855 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8856 rnd = Math.RandomInt(0,chances);
8857
8858 if (rnd < CHANCE_DAMAGE_CARGO)
8859 {
8861 }
8862 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8863 {
8865 }
8866 }
8867 else
8868 {
8869 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8870 rnd = Math.RandomInt(0,chances);
8871
8872 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8873 {
8875 }
8876 }
8877 }
8878 }
8879
8881 {
8882 if (GetInventory().GetCargo())
8883 {
8884 int item_count = GetInventory().GetCargo().GetItemCount();
8885 if (item_count > 0)
8886 {
8887 int random_pick = Math.RandomInt(0, item_count);
8889 if (!item.IsExplosive())
8890 {
8891 item.AddHealth("","",damage);
8892 return true;
8893 }
8894 }
8895 }
8896 return false;
8897 }
8898
8900 {
8901 int attachment_count = GetInventory().AttachmentCount();
8902 if (attachment_count > 0)
8903 {
8904 int random_pick = Math.RandomInt(0, attachment_count);
8905 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8906 if (!attachment.IsExplosive())
8907 {
8908 attachment.AddHealth("","",damage);
8909 return true;
8910 }
8911 }
8912 return false;
8913 }
8914
8916 {
8918 }
8919
8921 {
8923 return GetInventory().CanRemoveEntity();
8924
8925 return false;
8926 }
8927
8929 {
8931 return;
8932
8934 {
8935 if (ScriptInputUserData.CanStoreInputUserData())
8936 {
8937 ScriptInputUserData ctx = new ScriptInputUserData;
8942 ctx.
Write(destination_entity);
8946 }
8947 }
8948 else if (!
GetGame().IsMultiplayer())
8949 {
8951 }
8952 }
8953
8955 {
8957 return;
8958
8959 float split_quantity_new;
8963 InventoryLocation loc = new InventoryLocation;
8964
8965 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8966 {
8968 split_quantity_new = stack_max;
8969 else
8971
8972 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8973 if (new_item)
8974 {
8975 new_item.SetResultOfSplit(true);
8976 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8978 new_item.SetQuantity(split_quantity_new);
8979 }
8980 }
8981 else if (destination_entity && slot_id == -1)
8982 {
8983 if (quantity > stack_max)
8984 split_quantity_new = stack_max;
8985 else
8986 split_quantity_new = quantity;
8987
8989 {
8992 }
8993
8994 if (new_item)
8995 {
8996 new_item.SetResultOfSplit(true);
8997 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8999 new_item.SetQuantity(split_quantity_new);
9000 }
9001 }
9002 else
9003 {
9004 if (stack_max != 0)
9005 {
9007 {
9009 }
9010
9011 if (split_quantity_new == 0)
9012 {
9013 if (!
GetGame().IsMultiplayer())
9014 player.PhysicalPredictiveDropItem(this);
9015 else
9016 player.ServerDropEntity(this);
9017 return;
9018 }
9019
9021
9022 if (new_item)
9023 {
9024 new_item.SetResultOfSplit(true);
9025 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9027 new_item.SetQuantity(stack_max);
9028 new_item.PlaceOnSurface();
9029 }
9030 }
9031 }
9032 }
9033
9035 {
9037 return;
9038
9039 float split_quantity_new;
9043 InventoryLocation loc = new InventoryLocation;
9044
9045 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9046 {
9048 split_quantity_new = stack_max;
9049 else
9051
9052 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9053 if (new_item)
9054 {
9055 new_item.SetResultOfSplit(true);
9056 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9058 new_item.SetQuantity(split_quantity_new);
9059 }
9060 }
9061 else if (destination_entity && slot_id == -1)
9062 {
9063 if (quantity > stack_max)
9064 split_quantity_new = stack_max;
9065 else
9066 split_quantity_new = quantity;
9067
9069 {
9072 }
9073
9074 if (new_item)
9075 {
9076 new_item.SetResultOfSplit(true);
9077 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9079 new_item.SetQuantity(split_quantity_new);
9080 }
9081 }
9082 else
9083 {
9084 if (stack_max != 0)
9085 {
9087 {
9089 }
9090
9092
9093 if (new_item)
9094 {
9095 new_item.SetResultOfSplit(true);
9096 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9098 new_item.SetQuantity(stack_max);
9099 new_item.PlaceOnSurface();
9100 }
9101 }
9102 }
9103 }
9104
9106 {
9108 return;
9109
9111 {
9112 if (ScriptInputUserData.CanStoreInputUserData())
9113 {
9114 ScriptInputUserData ctx = new ScriptInputUserData;
9119 dst.WriteToContext(ctx);
9121 }
9122 }
9123 else if (!
GetGame().IsMultiplayer())
9124 {
9126 }
9127 }
9128
9130 {
9132 return;
9133
9135 {
9136 if (ScriptInputUserData.CanStoreInputUserData())
9137 {
9138 ScriptInputUserData ctx = new ScriptInputUserData;
9143 ctx.
Write(destination_entity);
9149 }
9150 }
9151 else if (!
GetGame().IsMultiplayer())
9152 {
9154 }
9155 }
9156
9158 {
9160 }
9161
9163 {
9165 return this;
9166
9168 float split_quantity_new;
9170 if (dst.IsValid())
9171 {
9172 int slot_id = dst.GetSlot();
9174
9175 if (quantity > stack_max)
9176 split_quantity_new = stack_max;
9177 else
9178 split_quantity_new = quantity;
9179
9181
9182 if (new_item)
9183 {
9184 new_item.SetResultOfSplit(true);
9185 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9188 }
9189
9190 return new_item;
9191 }
9192
9193 return null;
9194 }
9195
9197 {
9199 return;
9200
9202 float split_quantity_new;
9204 if (destination_entity)
9205 {
9207 if (quantity > stackable)
9208 split_quantity_new = stackable;
9209 else
9210 split_quantity_new = quantity;
9211
9212 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9213 if (new_item)
9214 {
9215 new_item.SetResultOfSplit(true);
9216 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9218 new_item.SetQuantity(split_quantity_new);
9219 }
9220 }
9221 }
9222
9224 {
9226 return;
9227
9229 {
9230 if (ScriptInputUserData.CanStoreInputUserData())
9231 {
9232 ScriptInputUserData ctx = new ScriptInputUserData;
9237 ItemBase destination_entity =
this;
9238 ctx.
Write(destination_entity);
9242 }
9243 }
9244 else if (!
GetGame().IsMultiplayer())
9245 {
9247 }
9248 }
9249
9251 {
9253 return;
9254
9256 float split_quantity_new;
9258 if (player)
9259 {
9261 if (quantity > stackable)
9262 split_quantity_new = stackable;
9263 else
9264 split_quantity_new = quantity;
9265
9266 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9267 new_item =
ItemBase.Cast(in_hands);
9268 if (new_item)
9269 {
9270 new_item.SetResultOfSplit(true);
9271 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9273 new_item.SetQuantity(split_quantity_new);
9274 }
9275 }
9276 }
9277
9279 {
9281 return;
9282
9284 float split_quantity_new = Math.Floor(quantity * 0.5);
9285
9287
9288 if (new_item)
9289 {
9290 if (new_item.GetQuantityMax() < split_quantity_new)
9291 {
9292 split_quantity_new = new_item.GetQuantityMax();
9293 }
9294
9295 new_item.SetResultOfSplit(true);
9296 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9297
9299 {
9302 }
9303 else
9304 {
9307 }
9308 }
9309 }
9310
9312 {
9314 return;
9315
9317 float split_quantity_new = Math.Floor(quantity / 2);
9318
9319 InventoryLocation invloc = new InventoryLocation;
9321
9323 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9324
9325 if (new_item)
9326 {
9327 if (new_item.GetQuantityMax() < split_quantity_new)
9328 {
9329 split_quantity_new = new_item.GetQuantityMax();
9330 }
9332 {
9335 }
9336 else
9337 {
9340 }
9341 }
9342 }
9343
9346 {
9347 SetWeightDirty();
9349
9350 if (parent)
9351 parent.OnAttachmentQuantityChangedEx(this, delta);
9352
9354 {
9356 {
9358 }
9360 {
9361 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9363 }
9364 }
9365
9366 }
9367
9370 {
9371
9372 }
9373
9376 {
9378 }
9379
9381 {
9382 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9383
9385 {
9386 if (newLevel == GameConstants.STATE_RUINED)
9387 {
9389 EntityAI parent = GetHierarchyParent();
9390 if (parent && parent.IsFireplace())
9391 {
9392 CargoBase cargo = GetInventory().GetCargo();
9393 if (cargo)
9394 {
9396 {
9398 }
9399 }
9400 }
9401 }
9402
9404 {
9405
9407 return;
9408 }
9409
9410 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9411 {
9413 }
9414 }
9415 }
9416
9417
9419 {
9420 super.OnRightClick();
9421
9423 {
9425 {
9426 if (ScriptInputUserData.CanStoreInputUserData())
9427 {
9428 vector m4[4];
9430
9431 EntityAI root = GetHierarchyRoot();
9432
9433 InventoryLocation dst = new InventoryLocation;
9435 {
9436 if (root)
9437 {
9438 root.GetTransform(m4);
9440 }
9441 else
9442 GetInventory().GetCurrentInventoryLocation(dst);
9443 }
9444 else
9445 {
9447
9448
9449 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9450 {
9451 if (root)
9452 {
9453 root.GetTransform(m4);
9455 }
9456 else
9457 GetInventory().GetCurrentInventoryLocation(dst);
9458 }
9459 else
9460 {
9461 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9462 }
9463 }
9464
9465 ScriptInputUserData ctx = new ScriptInputUserData;
9473 }
9474 }
9475 else if (!
GetGame().IsMultiplayer())
9476 {
9478 }
9479 }
9480 }
9481
9482 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9483 {
9484
9485 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9486 return false;
9487
9488 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9489 return false;
9490
9491
9493 return false;
9494
9495
9496 Magazine mag = Magazine.Cast(this);
9497 if (mag)
9498 {
9499 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9500 return false;
9501
9502 if (stack_max_limit)
9503 {
9504 Magazine other_mag = Magazine.Cast(other_item);
9505 if (other_item)
9506 {
9507 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9508 return false;
9509 }
9510
9511 }
9512 }
9513 else
9514 {
9515
9517 return false;
9518
9520 return false;
9521 }
9522
9523 PlayerBase player = null;
9524 if (CastTo(player, GetHierarchyRootPlayer()))
9525 {
9526 if (player.GetInventory().HasAttachment(this))
9527 return false;
9528
9529 if (player.IsItemsToDelete())
9530 return false;
9531 }
9532
9533 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9534 return false;
9535
9536 int slotID;
9538 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9539 return false;
9540
9541 return true;
9542 }
9543
9545 {
9547 }
9548
9550 {
9551 return m_IsResultOfSplit;
9552 }
9553
9555 {
9556 m_IsResultOfSplit = value;
9557 }
9558
9560 {
9562 }
9563
9565 {
9566 float other_item_quantity = other_item.GetQuantity();
9567 float this_free_space;
9568
9570
9572
9573 if (other_item_quantity > this_free_space)
9574 {
9575 return this_free_space;
9576 }
9577 else
9578 {
9579 return other_item_quantity;
9580 }
9581 }
9582
9584 {
9586 }
9587
9589 {
9591 return;
9592
9593 if (!IsMagazine() && other_item)
9594 {
9596 if (quantity_used != 0)
9597 {
9598 float hp1 = GetHealth01("","");
9599 float hp2 = other_item.GetHealth01("","");
9600 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9601 hpResult = hpResult / (
GetQuantity() + quantity_used);
9602
9603 hpResult *= GetMaxHealth();
9604 Math.Round(hpResult);
9605 SetHealth("", "Health", hpResult);
9606
9608 other_item.AddQuantity(-quantity_used);
9609 }
9610 }
9612 }
9613
9615 {
9616 #ifdef SERVER
9617 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9618 GetHierarchyParent().IncreaseLifetimeUp();
9619 #endif
9620 };
9621
9623 {
9624 PlayerBase p = PlayerBase.Cast(player);
9625
9626 array<int> recipesIds = p.m_Recipes;
9627 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9628 if (moduleRecipesManager)
9629 {
9630 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9631 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9632 }
9633
9634 for (int i = 0;i < recipesIds.Count(); i++)
9635 {
9636 int key = recipesIds.Get(i);
9637 string recipeName = moduleRecipesManager.GetRecipeName(key);
9639 }
9640 }
9641
9642
9643 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9644 {
9645 super.GetDebugActions(outputList);
9646
9647
9652
9653
9657
9661
9662
9665
9666
9668 {
9671 }
9672
9674
9677
9681 }
9682
9683
9684
9685
9687 {
9688 super.OnAction(action_id, player, ctx);
9689 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9690 {
9691 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9692 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9693 PlayerBase p = PlayerBase.Cast(player);
9694 if (
EActions.RECIPES_RANGE_START < 1000)
9695 {
9696 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9697 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9698 }
9699 }
9700 #ifndef SERVER
9701 else if (action_id ==
EActions.WATCH_PLAYER)
9702 {
9703 PluginDeveloper.SetDeveloperItemClientEx(player);
9704 }
9705 #endif
9707 {
9708 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9709 {
9710 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9711 OnDebugButtonPressServer(id + 1);
9712 }
9713
9714 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9715 {
9716 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9718 }
9719
9720 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9721 {
9722 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9724 }
9725
9726 else if (action_id ==
EActions.ADD_QUANTITY)
9727 {
9728 if (IsMagazine())
9729 {
9730 Magazine mag = Magazine.Cast(this);
9731 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9732 }
9733 else
9734 {
9736 }
9737
9738 if (m_EM)
9739 {
9740 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9741 }
9742
9743 }
9744
9745 else if (action_id ==
EActions.REMOVE_QUANTITY)
9746 {
9747 if (IsMagazine())
9748 {
9749 Magazine mag2 = Magazine.Cast(this);
9750 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9751 }
9752 else
9753 {
9755 }
9756 if (m_EM)
9757 {
9758 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9759 }
9760
9761 }
9762
9763 else if (action_id ==
EActions.SET_QUANTITY_0)
9764 {
9766
9767 if (m_EM)
9768 {
9769 m_EM.SetEnergy(0);
9770 }
9771 }
9772
9773 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9774 {
9776
9777 if (m_EM)
9778 {
9779 m_EM.SetEnergy(m_EM.GetEnergyMax());
9780 }
9781 }
9782
9783 else if (action_id ==
EActions.ADD_HEALTH)
9784 {
9785 AddHealth("","",GetMaxHealth("","Health")/5);
9786 }
9787 else if (action_id ==
EActions.REMOVE_HEALTH)
9788 {
9789 AddHealth("","",-GetMaxHealth("","Health")/5);
9790 }
9791 else if (action_id ==
EActions.DESTROY_HEALTH)
9792 {
9793 SetHealth01("","",0);
9794 }
9795 else if (action_id ==
EActions.WATCH_ITEM)
9796 {
9798 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9799 #ifdef DEVELOPER
9800 SetDebugDeveloper_item(this);
9801 #endif
9802 }
9803
9804 else if (action_id ==
EActions.ADD_TEMPERATURE)
9805 {
9806 AddTemperature(20);
9807
9808 }
9809
9810 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9811 {
9812 AddTemperature(-20);
9813
9814 }
9815
9816 else if (action_id ==
EActions.FLIP_FROZEN)
9817 {
9818 SetFrozen(!GetIsFrozen());
9819
9820 }
9821
9822 else if (action_id ==
EActions.ADD_WETNESS)
9823 {
9825
9826 }
9827
9828 else if (action_id ==
EActions.REMOVE_WETNESS)
9829 {
9831
9832 }
9833
9834 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9835 {
9838
9839
9840 }
9841
9842 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9843 {
9846 }
9847
9848 else if (action_id ==
EActions.MAKE_SPECIAL)
9849 {
9850 auto debugParams = DebugSpawnParams.WithPlayer(player);
9851 OnDebugSpawnEx(debugParams);
9852 }
9853
9854 else if (action_id ==
EActions.DELETE)
9855 {
9856 Delete();
9857 }
9858
9859 }
9860
9861
9862 return false;
9863 }
9864
9865
9866
9867
9871
9874
9875
9876
9878 {
9879 return false;
9880 }
9881
9882
9884 {
9885 return true;
9886 }
9887
9888
9890 {
9891 return true;
9892 }
9893
9894
9895
9897 {
9898 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9900 }
9901
9904 {
9905 return null;
9906 }
9907
9909 {
9910 return false;
9911 }
9912
9914 {
9915 return false;
9916 }
9917
9921
9922
9924 {
9925 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9926 return module_repairing.CanRepair(this, item_repair_kit);
9927 }
9928
9929
9930 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9931 {
9932 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9933 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9934 }
9935
9936
9938 {
9939
9940
9941
9942
9943
9944
9945
9946
9947 return 1;
9948 }
9949
9950
9951
9953 {
9955 }
9956
9957
9958
9960 {
9962 }
9963
9964
9973 {
9974 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9975
9976 if (player)
9977 {
9978 player.MessageStatus(text);
9979 }
9980 }
9981
9982
9991 {
9992 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9993
9994 if (player)
9995 {
9996 player.MessageAction(text);
9997 }
9998 }
9999
10000
10009 {
10010 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10011
10012 if (player)
10013 {
10014 player.MessageFriendly(text);
10015 }
10016 }
10017
10018
10027 {
10028 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10029
10030 if (player)
10031 {
10032 player.MessageImportant(text);
10033 }
10034 }
10035
10037 {
10038 return true;
10039 }
10040
10041
10042 override bool KindOf(
string tag)
10043 {
10044 bool found = false;
10045 string item_name = this.
GetType();
10048
10049 int array_size = item_tag_array.Count();
10050 for (int i = 0; i < array_size; i++)
10051 {
10052 if (item_tag_array.Get(i) == tag)
10053 {
10054 found = true;
10055 break;
10056 }
10057 }
10058 return found;
10059 }
10060
10061
10063 {
10064
10065 super.OnRPC(sender, rpc_type,ctx);
10066
10067
10068 switch (rpc_type)
10069 {
10070 #ifndef SERVER
10071 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10072 Param2<bool, string> p = new Param2<bool, string>(false, "");
10073
10075 return;
10076
10077 bool play = p.param1;
10078 string soundSet = p.param2;
10079
10080 if (play)
10081 {
10083 {
10085 {
10087 }
10088 }
10089 else
10090 {
10092 }
10093 }
10094 else
10095 {
10097 }
10098
10099 break;
10100 #endif
10101
10102 }
10103
10105 {
10107 }
10108 }
10109
10110
10111
10112
10114 {
10115 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10116 return plugin.GetID(
name);
10117 }
10118
10120 {
10121 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10122 return plugin.GetName(id);
10123 }
10124
10127 {
10128
10129
10130 int varFlags;
10131 if (!ctx.
Read(varFlags))
10132 return;
10133
10134 if (varFlags & ItemVariableFlags.FLOAT)
10135 {
10137 }
10138 }
10139
10141 {
10142
10143 super.SerializeNumericalVars(floats_out);
10144
10145
10146
10148 {
10150 }
10151
10153 {
10155 }
10156
10158 {
10160 }
10161
10163 {
10168 }
10169
10171 {
10173 }
10174 }
10175
10177 {
10178
10179 super.DeSerializeNumericalVars(floats);
10180
10181
10182 int index = 0;
10183 int mask = Math.Round(floats.Get(index));
10184
10185 index++;
10186
10188 {
10190 {
10192 }
10193 else
10194 {
10195 float quantity = floats.Get(index);
10196 SetQuantity(quantity,
true,
false,
false,
false);
10197 }
10198 index++;
10199 }
10200
10202 {
10203 float wet = floats.Get(index);
10205 index++;
10206 }
10207
10209 {
10210 int liquidtype = Math.Round(floats.Get(index));
10212 index++;
10213 }
10214
10216 {
10218 index++;
10220 index++;
10222 index++;
10224 index++;
10225 }
10226
10228 {
10229 int cleanness = Math.Round(floats.Get(index));
10231 index++;
10232 }
10233 }
10234
10236 {
10237 super.WriteVarsToCTX(ctx);
10238
10239
10241 {
10243 }
10244
10246 {
10248 }
10249
10251 {
10253 }
10254
10256 {
10257 int r,g,b,a;
10263 }
10264
10266 {
10268 }
10269 }
10270
10272 {
10273 if (!super.ReadVarsFromCTX(ctx,version))
10274 return false;
10275
10276 int intValue;
10277 float value;
10278
10279 if (version < 140)
10280 {
10281 if (!ctx.
Read(intValue))
10282 return false;
10283
10284 m_VariablesMask = intValue;
10285 }
10286
10288 {
10289 if (!ctx.
Read(value))
10290 return false;
10291
10293 {
10295 }
10296 else
10297 {
10299 }
10300 }
10301
10302 if (version < 140)
10303 {
10305 {
10306 if (!ctx.
Read(value))
10307 return false;
10308 SetTemperatureDirect(value);
10309 }
10310 }
10311
10313 {
10314 if (!ctx.
Read(value))
10315 return false;
10317 }
10318
10320 {
10321 if (!ctx.
Read(intValue))
10322 return false;
10324 }
10325
10327 {
10328 int r,g,b,a;
10330 return false;
10332 return false;
10334 return false;
10336 return false;
10337
10339 }
10340
10342 {
10343 if (!ctx.
Read(intValue))
10344 return false;
10346 }
10347
10348 if (version >= 138 && version < 140)
10349 {
10351 {
10352 if (!ctx.
Read(intValue))
10353 return false;
10354 SetFrozen(intValue);
10355 }
10356 }
10357
10358 return true;
10359 }
10360
10361
10363 {
10366 {
10368 }
10369
10370 if (!super.OnStoreLoad(ctx, version))
10371 {
10373 return false;
10374 }
10375
10376 if (version >= 114)
10377 {
10378 bool hasQuickBarIndexSaved;
10379
10380 if (!ctx.
Read(hasQuickBarIndexSaved))
10381 {
10383 return false;
10384 }
10385
10386 if (hasQuickBarIndexSaved)
10387 {
10388 int itmQBIndex;
10389
10390
10391 if (!ctx.
Read(itmQBIndex))
10392 {
10394 return false;
10395 }
10396
10397 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10398 if (itmQBIndex != -1 && parentPlayer)
10399 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10400 }
10401 }
10402 else
10403 {
10404
10405 PlayerBase player;
10406 int itemQBIndex;
10407 if (version ==
int.
MAX)
10408 {
10409 if (!ctx.
Read(itemQBIndex))
10410 {
10412 return false;
10413 }
10414 }
10415 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10416 {
10417
10418 if (!ctx.
Read(itemQBIndex))
10419 {
10421 return false;
10422 }
10423 if (itemQBIndex != -1 && player)
10424 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10425 }
10426 }
10427
10428 if (version < 140)
10429 {
10430
10431 if (!LoadVariables(ctx, version))
10432 {
10434 return false;
10435 }
10436 }
10437
10438
10440 {
10442 return false;
10443 }
10444 if (version >= 132)
10445 {
10447 if (raib)
10448 {
10450 {
10452 return false;
10453 }
10454 }
10455 }
10456
10458 return true;
10459 }
10460
10461
10462
10464 {
10465 super.OnStoreSave(ctx);
10466
10467 PlayerBase player;
10468 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10469 {
10471
10472 int itemQBIndex = -1;
10473 itemQBIndex = player.FindQuickBarEntityIndex(this);
10474 ctx.
Write(itemQBIndex);
10475 }
10476 else
10477 {
10479 }
10480
10482
10484 if (raib)
10485 {
10487 }
10488 }
10489
10490
10492 {
10493 super.AfterStoreLoad();
10494
10496 {
10498 }
10499
10501 {
10504 }
10505 }
10506
10508 {
10509 super.EEOnAfterLoad();
10510
10512 {
10514 }
10515
10518 }
10519
10521 {
10522 return false;
10523 }
10524
10525
10526
10528 {
10530 {
10531 #ifdef PLATFORM_CONSOLE
10532
10534 {
10536 if (menu)
10537 {
10539 }
10540 }
10541 #endif
10542 }
10543
10545 {
10548 }
10549
10551 {
10552 SetWeightDirty();
10554 }
10556 {
10559 }
10560
10562 {
10565 }
10567 {
10570 }
10571
10572 super.OnVariablesSynchronized();
10573 }
10574
10575
10576
10578 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10579 {
10580 if (!IsServerCheck(allow_client))
10581 return false;
10582
10584 return false;
10585
10588
10589 if (value <= (min + 0.001))
10590 value = min;
10591
10592 if (value == min)
10593 {
10594 if (destroy_config)
10595 {
10596 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10597 if (dstr)
10598 {
10600 this.Delete();
10601 return true;
10602 }
10603 }
10604 else if (destroy_forced)
10605 {
10607 this.Delete();
10608 return true;
10609 }
10610
10612 }
10613
10616
10618 {
10620
10621 if (delta)
10623 }
10624
10626
10627 return false;
10628 }
10629
10630
10632 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10633 {
10635 }
10636
10638 {
10641 }
10642
10644 {
10647 }
10648
10651 {
10652 float value_clamped = Math.Clamp(value, 0, 1);
10654 SetQuantity(result, destroy_config, destroy_forced);
10655 }
10656
10657
10660 {
10662 }
10663
10665 {
10667 }
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10679 {
10680 int slot = -1;
10681 if (GetInventory())
10682 {
10683 InventoryLocation il = new InventoryLocation;
10684 GetInventory().GetCurrentInventoryLocation(il);
10686 }
10687
10689 }
10690
10692 {
10693 float quantity_max = 0;
10694
10696 {
10697 if (attSlotID != -1)
10698 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10699
10700 if (quantity_max <= 0)
10702 }
10703
10704 if (quantity_max <= 0)
10706
10707 return quantity_max;
10708 }
10709
10711 {
10713 }
10714
10716 {
10718 }
10719
10720
10722 {
10724 }
10725
10727 {
10729 }
10730
10732 {
10734 }
10735
10736
10738 {
10739
10740 float weightEx = GetWeightEx();
10741 float special = GetInventoryAndCargoWeight();
10742 return weightEx - special;
10743 }
10744
10745
10747 {
10749 }
10750
10752 {
10754 {
10755 #ifdef DEVELOPER
10756 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10757 {
10758 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10760 }
10761 #endif
10762
10763 return GetQuantity() * GetConfigWeightModified();
10764 }
10765 else if (HasEnergyManager())
10766 {
10767 #ifdef DEVELOPER
10768 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10769 {
10770 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10771 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10772 }
10773 #endif
10774 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10775 }
10776 else
10777 {
10778 #ifdef DEVELOPER
10779 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10780 {
10781 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10782 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10783 }
10784 #endif
10785 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10786 }
10787 }
10788
10791 {
10792 int item_count = 0;
10794
10795 if (GetInventory().GetCargo() != NULL)
10796 {
10797 item_count = GetInventory().GetCargo().GetItemCount();
10798 }
10799
10800 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10801 {
10802 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10803 if (item)
10804 item_count += item.GetNumberOfItems();
10805 }
10806 return item_count;
10807 }
10808
10811 {
10812 float weight = 0;
10813 float wetness = 1;
10814 if (include_wetness)
10817 {
10818 weight = wetness * m_ConfigWeight;
10819 }
10821 {
10822 weight = 1;
10823 }
10824 return weight;
10825 }
10826
10827
10828
10830 {
10831 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10832 {
10833 GameInventory inv = GetInventory();
10834 array<EntityAI> items = new array<EntityAI>;
10836 for (int i = 0; i < items.Count(); i++)
10837 {
10839 if (item)
10840 {
10842 }
10843 }
10844 }
10845 }
10846
10847
10848
10849
10851 {
10852 float energy = 0;
10853 if (HasEnergyManager())
10854 {
10855 energy = GetCompEM().GetEnergy();
10856 }
10857 return energy;
10858 }
10859
10860
10862 {
10863 super.OnEnergyConsumed();
10864
10866 }
10867
10869 {
10870 super.OnEnergyAdded();
10871
10873 }
10874
10875
10877 {
10878 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10879 {
10881 {
10882 float energy_0to1 = GetCompEM().GetEnergy0To1();
10884 }
10885 }
10886 }
10887
10888
10890 {
10891 return ConfigGetFloat("heatIsolation");
10892 }
10893
10895 {
10897 }
10898
10900 {
10901 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10902 if (
GetGame().ConfigIsExisting(paramPath))
10904
10905 return 0.0;
10906 }
10907
10909 {
10910 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10911 if (
GetGame().ConfigIsExisting(paramPath))
10913
10914 return 0.0;
10915 }
10916
10917 override void SetWet(
float value,
bool allow_client =
false)
10918 {
10919 if (!IsServerCheck(allow_client))
10920 return;
10921
10924
10926
10927 m_VarWet = Math.Clamp(value, min, max);
10928
10930 {
10933 }
10934 }
10935
10936 override void AddWet(
float value)
10937 {
10939 }
10940
10942 {
10944 }
10945
10947 {
10949 }
10950
10952 {
10954 }
10955
10957 {
10959 }
10960
10962 {
10964 }
10965
10966 override void OnWetChanged(
float newVal,
float oldVal)
10967 {
10970 if (newLevel != oldLevel)
10971 {
10973 }
10974 }
10975
10977 {
10978 SetWeightDirty();
10979 }
10980
10982 {
10983 return GetWetLevelInternal(
m_VarWet);
10984 }
10985
10986
10987
10989 {
10991 }
10992
10994 {
10996 }
10997
10999 {
11001 }
11002
11004 {
11006 }
11007
11008
11009
11011 {
11012 if (ConfigIsExisting("itemModelLength"))
11013 {
11014 return ConfigGetFloat("itemModelLength");
11015 }
11016 return 0;
11017 }
11018
11020 {
11021 if (ConfigIsExisting("itemAttachOffset"))
11022 {
11023 return ConfigGetFloat("itemAttachOffset");
11024 }
11025 return 0;
11026 }
11027
11028 override void SetCleanness(
int value,
bool allow_client =
false)
11029 {
11030 if (!IsServerCheck(allow_client))
11031 return;
11032
11034
11036
11039 }
11040
11042 {
11044 }
11045
11047 {
11048 return true;
11049 }
11050
11051
11052
11053
11055 {
11057 }
11058
11060 {
11062 }
11063
11064
11065
11066
11067 override void SetColor(
int r,
int g,
int b,
int a)
11068 {
11074 }
11076 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11077 {
11082 }
11083
11085 {
11087 }
11088
11091 {
11092 int r,g,b,a;
11094 r = r/255;
11095 g = g/255;
11096 b = b/255;
11097 a = a/255;
11098 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11099 }
11100
11101
11102
11103 override void SetLiquidType(
int value,
bool allow_client =
false)
11104 {
11105 if (!IsServerCheck(allow_client))
11106 return;
11107
11112 }
11113
11115 {
11116 return ConfigGetInt("varLiquidTypeInit");
11117 }
11118
11120 {
11122 }
11123
11125 {
11127 SetFrozen(false);
11128 }
11129
11132 {
11133 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11134 }
11135
11136
11139 {
11140 PlayerBase nplayer;
11141 if (PlayerBase.CastTo(nplayer, player))
11142 {
11144
11145 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11146 }
11147 }
11148
11149
11152 {
11153 PlayerBase nplayer;
11154 if (PlayerBase.CastTo(nplayer,player))
11155 {
11156
11157 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11158
11159 }
11160
11161
11162 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11163
11164
11165 if (HasEnergyManager())
11166 {
11167 GetCompEM().UpdatePlugState();
11168 }
11169 }
11170
11171
11173 {
11174 super.OnPlacementStarted(player);
11175
11177 }
11178
11179 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11180 {
11182 {
11183 m_AdminLog.OnPlacementComplete(player,
this);
11184 }
11185
11186 super.OnPlacementComplete(player, position, orientation);
11187 }
11188
11189
11190
11191
11192
11194 {
11196 {
11197 return true;
11198 }
11199 else
11200 {
11201 return false;
11202 }
11203 }
11204
11205
11207 {
11209 {
11211 }
11212 }
11213
11214
11216 {
11218 }
11219
11221 {
11223 }
11224
11225 override void InsertAgent(
int agent,
float count = 1)
11226 {
11227 if (count < 1)
11228 return;
11229
11231 }
11232
11235 {
11237 }
11238
11239
11241 {
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
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11287 {
11289 return false;
11290 return true;
11291 }
11292
11294 {
11295
11297 }
11298
11299
11302 {
11303 super.CheckForRoofLimited(timeTresholdMS);
11304
11306 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11307 {
11308 m_PreviousRoofTestTime = time;
11309 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11310 }
11311 }
11312
11313
11315 {
11317 {
11318 return 0;
11319 }
11320
11321 if (GetInventory().GetAttachmentSlotsCount() != 0)
11322 {
11323 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11324 if (filter)
11325 return filter.GetProtectionLevel(type, false, system);
11326 else
11327 return 0;
11328 }
11329
11330 string subclassPath, entryName;
11331
11332 switch (type)
11333 {
11335 entryName = "biological";
11336 break;
11338 entryName = "chemical";
11339 break;
11340 default:
11341 entryName = "biological";
11342 break;
11343 }
11344
11345 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11346
11348 }
11349
11350
11351
11354 {
11355 if (!IsMagazine())
11357
11359 }
11360
11361
11362
11363
11364
11369 {
11370 return true;
11371 }
11372
11374 {
11376 }
11377
11378
11379
11380
11381
11383 {
11384 if (parent)
11385 {
11386 if (parent.IsInherited(DayZInfected))
11387 return true;
11388
11389 if (!parent.IsRuined())
11390 return true;
11391 }
11392
11393 return true;
11394 }
11395
11397 {
11398 if (!super.CanPutAsAttachment(parent))
11399 {
11400 return false;
11401 }
11402
11403 if (!IsRuined() && !parent.IsRuined())
11404 {
11405 return true;
11406 }
11407
11408 return false;
11409 }
11410
11412 {
11413
11414
11415
11416
11417 return super.CanReceiveItemIntoCargo(item);
11418 }
11419
11421 {
11422
11423
11424
11425
11426 GameInventory attachmentInv = attachment.GetInventory();
11428 {
11429 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11430 return false;
11431 }
11432
11433 InventoryLocation loc = new InventoryLocation();
11434 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11435 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11436 return false;
11437
11438 return super.CanReceiveAttachment(attachment, slotId);
11439 }
11440
11442 {
11443 if (!super.CanReleaseAttachment(attachment))
11444 return false;
11445
11446 return GetInventory().AreChildrenAccessible();
11447 }
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11470 {
11471 int id = muzzle_owner.GetMuzzleID();
11472 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11473
11474 if (WPOF_array)
11475 {
11476 for (int i = 0; i < WPOF_array.Count(); i++)
11477 {
11478 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11479
11480 if (WPOF)
11481 {
11482 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11483 }
11484 }
11485 }
11486 }
11487
11488
11490 {
11491 int id = muzzle_owner.GetMuzzleID();
11493
11494 if (WPOBE_array)
11495 {
11496 for (int i = 0; i < WPOBE_array.Count(); i++)
11497 {
11498 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11499
11500 if (WPOBE)
11501 {
11502 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11503 }
11504 }
11505 }
11506 }
11507
11508
11510 {
11511 int id = muzzle_owner.GetMuzzleID();
11512 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11513
11514 if (WPOOH_array)
11515 {
11516 for (int i = 0; i < WPOOH_array.Count(); i++)
11517 {
11518 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11519
11520 if (WPOOH)
11521 {
11522 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11523 }
11524 }
11525 }
11526 }
11527
11528
11530 {
11531 int id = muzzle_owner.GetMuzzleID();
11532 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11533
11534 if (WPOOH_array)
11535 {
11536 for (int i = 0; i < WPOOH_array.Count(); i++)
11537 {
11538 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11539
11540 if (WPOOH)
11541 {
11542 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11543 }
11544 }
11545 }
11546 }
11547
11548
11550 {
11551 int id = muzzle_owner.GetMuzzleID();
11552 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11553
11554 if (WPOOH_array)
11555 {
11556 for (int i = 0; i < WPOOH_array.Count(); i++)
11557 {
11558 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11559
11560 if (WPOOH)
11561 {
11562 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11563 }
11564 }
11565 }
11566 }
11567
11568
11569
11571 {
11573 {
11574 return true;
11575 }
11576
11577 return false;
11578 }
11579
11581 {
11583 {
11584 return true;
11585 }
11586
11587 return false;
11588 }
11589
11591 {
11593 {
11594 return true;
11595 }
11596
11597 return false;
11598 }
11599
11601 {
11602 return false;
11603 }
11604
11607 {
11608 return UATimeSpent.DEFAULT_DEPLOY;
11609 }
11610
11611
11612
11613
11615 {
11617 SetSynchDirty();
11618 }
11619
11621 {
11623 }
11624
11625
11627 {
11628 return false;
11629 }
11630
11633 {
11634 string att_type = "None";
11635
11636 if (ConfigIsExisting("soundAttType"))
11637 {
11638 att_type = ConfigGetString("soundAttType");
11639 }
11640
11642 }
11643
11645 {
11647 }
11648
11649
11650
11651
11652
11656
11658 {
11661
11663 }
11664
11665
11667 {
11669 return;
11670
11672
11675
11678
11679 SoundParameters params = new SoundParameters();
11683 }
11684
11685
11687 {
11689 return;
11690
11692 SetSynchDirty();
11693
11696 }
11697
11698
11700 {
11702 return;
11703
11705 SetSynchDirty();
11706
11709 }
11710
11712 {
11714 }
11715
11717 {
11719 }
11720
11723 {
11724 if (!
GetGame().IsDedicatedServer())
11725 {
11726 if (ConfigIsExisting("attachSoundSet"))
11727 {
11728 string cfg_path = "";
11729 string soundset = "";
11730 string type_name =
GetType();
11731
11734 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11735 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11736
11737 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11738 {
11739 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11740 {
11741 if (cfg_slot_array[i] == slot_type)
11742 {
11743 soundset = cfg_soundset_array[i];
11744 break;
11745 }
11746 }
11747 }
11748
11749 if (soundset != "")
11750 {
11751 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11753 }
11754 }
11755 }
11756 }
11757
11759 {
11760
11761 }
11762
11763 void OnApply(PlayerBase player);
11764
11766 {
11767 return 1.0;
11768 };
11769
11771 {
11773 }
11774
11776 {
11778 }
11779
11781
11783 {
11784 SetDynamicPhysicsLifeTime(0.01);
11786 }
11787
11789 {
11790 array<string> zone_names = new array<string>;
11791 GetDamageZones(zone_names);
11792 for (int i = 0; i < zone_names.Count(); i++)
11793 {
11794 SetHealthMax(zone_names.Get(i),"Health");
11795 }
11796 SetHealthMax("","Health");
11797 }
11798
11801 {
11802 float global_health = GetHealth01("","Health");
11803 array<string> zones = new array<string>;
11804 GetDamageZones(zones);
11805
11806 for (int i = 0; i < zones.Count(); i++)
11807 {
11808 SetHealth01(zones.Get(i),"Health",global_health);
11809 }
11810 }
11811
11814 {
11815 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11816 }
11817
11819 {
11820 if (!hasRootAsPlayer)
11821 {
11822 if (refParentIB)
11823 {
11824
11825 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11826 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11827
11828 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11829 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11830
11833 }
11834 else
11835 {
11836
11839 }
11840 }
11841 }
11842
11844 {
11846 {
11847 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11848 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11849 {
11850 float heatPermCoef = 1.0;
11852 while (ent)
11853 {
11854 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11855 ent = ent.GetHierarchyParent();
11856 }
11857
11858 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11859 }
11860 }
11861 }
11862
11864 {
11865
11866 EntityAI parent = GetHierarchyParent();
11867 if (!parent)
11868 {
11869 hasParent = false;
11870 hasRootAsPlayer = false;
11871 }
11872 else
11873 {
11874 hasParent = true;
11875 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11876 refParentIB =
ItemBase.Cast(parent);
11877 }
11878 }
11879
11880 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11881 {
11882
11883 }
11884
11886 {
11887
11888 return false;
11889 }
11890
11892 {
11893
11894
11895 return false;
11896 }
11897
11899 {
11900
11901 return false;
11902 }
11903
11906 {
11907 return !GetIsFrozen() &&
IsOpen();
11908 }
11909
11911 {
11912 bool hasParent = false, hasRootAsPlayer = false;
11914
11915 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11916 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11917
11918 if (wwtu || foodDecay)
11919 {
11923
11924 if (processWetness || processTemperature || processDecay)
11925 {
11927
11928 if (processWetness)
11929 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11930
11931 if (processTemperature)
11933
11934 if (processDecay)
11935 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11936 }
11937 }
11938 }
11939
11942 {
11944 }
11945
11947 {
11950
11951 return super.GetTemperatureFreezeThreshold();
11952 }
11953
11955 {
11958
11959 return super.GetTemperatureThawThreshold();
11960 }
11961
11963 {
11966
11967 return super.GetItemOverheatThreshold();
11968 }
11969
11971 {
11973 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11974
11975 return super.GetTemperatureFreezeTime();
11976 }
11977
11979 {
11981 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11982
11983 return super.GetTemperatureThawTime();
11984 }
11985
11990
11992 {
11993 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11994 }
11995
11997 {
11998 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11999 }
12000
12003 {
12005 }
12006
12008 {
12010 }
12011
12013 {
12015 }
12016
12019 {
12020 return null;
12021 }
12022
12025 {
12026 return false;
12027 }
12028
12030 {
12032 {
12035 if (!trg)
12036 {
12038 explosive = this;
12039 }
12040
12041 explosive.PairRemote(trg);
12043
12044 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12045 trg.SetPersistentPairID(persistentID);
12046 explosive.SetPersistentPairID(persistentID);
12047
12048 return true;
12049 }
12050 return false;
12051 }
12052
12055 {
12056 float ret = 1.0;
12059 ret *= GetHealth01();
12060
12061 return ret;
12062 }
12063
12064 #ifdef DEVELOPER
12065 override void SetDebugItem()
12066 {
12067 super.SetDebugItem();
12068 _itemBase = this;
12069 }
12070
12072 {
12073 string text = super.GetDebugText();
12074
12076 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12077
12078 return text;
12079 }
12080 #endif
12081
12083 {
12084 return true;
12085 }
12086
12088
12090
12092 {
12095 }
12096
12097
12105
12121}
12122
12124{
12126 if (entity)
12127 {
12128 bool is_item = entity.IsInherited(
ItemBase);
12129 if (is_item && full_quantity)
12130 {
12133 }
12134 }
12135 else
12136 {
12138 return NULL;
12139 }
12140 return entity;
12141}
12142
12144{
12145 if (item)
12146 {
12147 if (health > 0)
12148 item.SetHealth("", "", health);
12149
12150 if (item.CanHaveTemperature())
12151 {
12153 if (item.CanFreeze())
12154 item.SetFrozen(false);
12155 }
12156
12157 if (item.HasEnergyManager())
12158 {
12159 if (quantity >= 0)
12160 {
12161 item.GetCompEM().SetEnergy0To1(quantity);
12162 }
12163 else
12164 {
12166 }
12167 }
12168 else if (item.IsMagazine())
12169 {
12170 Magazine mag = Magazine.Cast(item);
12171 if (quantity >= 0)
12172 {
12173 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12174 }
12175 else
12176 {
12178 }
12179
12180 }
12181 else
12182 {
12183 if (quantity >= 0)
12184 {
12185 item.SetQuantityNormalized(quantity, false);
12186 }
12187 else
12188 {
12190 }
12191
12192 }
12193 }
12194}
12195
12196#ifdef DEVELOPER
12198#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.