8300{
8302 {
8303 return true;
8304 }
8305};
8306
8307
8308
8310{
8314
8316
8319
8320
8321
8322
8323
8332
8338
8343
8348
8369 protected bool m_IsResultOfSplit
8370
8372
8377
8378
8379
8381
8385
8386
8387
8389
8392
8393
8394
8400
8401
8409
8412
8413
8415
8416
8418
8419
8424
8425
8430
8431
8433
8434
8436 {
8441
8442 if (!
GetGame().IsDedicatedServer())
8443 {
8445 {
8447
8449 {
8451 }
8452 }
8453
8456 }
8457
8458 m_OldLocation = null;
8459
8461 {
8463 }
8464
8465 if (ConfigIsExisting("headSelectionsToHide"))
8466 {
8469 }
8470
8472 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8473 {
8475 }
8476
8478
8479 m_IsResultOfSplit = false;
8480
8482 }
8483
8485 {
8486 super.InitItemVariables();
8487
8493 m_Count = ConfigGetInt(
"count");
8494
8497
8502
8505
8510
8522
8526
8527
8530 if (ConfigIsExisting("canBeSplit"))
8531 {
8534 }
8535
8537 if (ConfigIsExisting("itemBehaviour"))
8539
8540
8543 RegisterNetSyncVariableInt("m_VarLiquidType");
8544 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8545
8546 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8547 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8548 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8549
8550 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8551 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8552 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8553 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8554
8555 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8556 RegisterNetSyncVariableBool("m_IsTakeable");
8557 RegisterNetSyncVariableBool("m_IsHologram");
8558
8561 {
8564 }
8565
8567
8569 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8571
8572 }
8573
8575 {
8577 }
8578
8580 {
8583 {
8588 }
8589 }
8590
8591 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8592 {
8594 {
8597 }
8598
8600 }
8601
8603 {
8609 }
8610
8612
8614 {
8616
8617 if (!action)
8618 {
8619 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8620 return;
8621 }
8622
8624 if (!ai)
8625 {
8627 return;
8628 }
8629
8631 if (!action_array)
8632 {
8633 action_array = new array<ActionBase_Basic>;
8635 }
8636 if (LogManager.IsActionLogEnable())
8637 {
8638 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8639 }
8640
8641 if (action_array.Find(action) != -1)
8642 {
8643 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8644 }
8645 else
8646 {
8647 action_array.Insert(action);
8648 }
8649 }
8650
8652 {
8654 ActionBase action = player.GetActionManager().GetAction(actionName);
8657
8658 if (action_array)
8659 {
8660 action_array.RemoveItem(action);
8661 }
8662 }
8663
8664
8665
8667 {
8668 ActionOverrideData overrideData = new ActionOverrideData();
8672
8674 if (!actionMap)
8675 {
8678 }
8679
8680 actionMap.Insert(this.
Type(), overrideData);
8681
8682 }
8683
8685
8687
8688
8690 {
8693
8696
8697 string config_to_search = "CfgVehicles";
8698 string muzzle_owner_config;
8699
8701 {
8702 if (IsInherited(Weapon))
8703 config_to_search = "CfgWeapons";
8704
8705 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8706
8707 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8708
8710
8711 if (config_OnFire_subclass_count > 0)
8712 {
8713 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8714
8715 for (int i = 0; i < config_OnFire_subclass_count; i++)
8716 {
8717 string particle_class = "";
8719 string config_OnFire_entry = config_OnFire_class + particle_class;
8720 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8721 WPOF_array.Insert(WPOF);
8722 }
8723
8724
8726 }
8727 }
8728
8730 {
8731 config_to_search = "CfgWeapons";
8732 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8733
8734 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8735
8737
8738 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8739 {
8740 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8741
8742 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8743 {
8744 string particle_class2 = "";
8746 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8747 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8748 WPOBE_array.Insert(WPOBE);
8749 }
8750
8751
8753 }
8754 }
8755 }
8756
8757
8759 {
8762
8764 {
8765 string config_to_search = "CfgVehicles";
8766
8767 if (IsInherited(Weapon))
8768 config_to_search = "CfgWeapons";
8769
8770 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8771 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8772
8773 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8774 {
8775
8777
8779 {
8781 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8783 return;
8784 }
8785
8788
8789
8790
8792 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8793
8794 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8795 {
8796 string particle_class = "";
8798 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8800
8801 if (entry_type == CT_CLASS)
8802 {
8803 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8804 WPOOH_array.Insert(WPOF);
8805 }
8806 }
8807
8808
8810 }
8811 }
8812 }
8813
8815 {
8817 }
8818
8820 {
8822 {
8824
8827
8830
8831 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8832 }
8833 }
8834
8836 {
8838 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8839
8841 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8842
8844 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8845
8847 {
8849 }
8850 }
8851
8853 {
8855 }
8856
8858 {
8861 else
8863
8865 {
8868 }
8869 else
8870 {
8873
8876 }
8877
8879 }
8880
8882 {
8884 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8885 }
8886
8888 {
8890 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8892 }
8893
8895 {
8897 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8898 }
8899
8901 {
8904
8905 OverheatingParticle OP = new OverheatingParticle();
8910
8912 }
8913
8915 {
8918
8919 return -1;
8920 }
8921
8923 {
8925 {
8928
8929 for (int i = count; i > 0; --i)
8930 {
8931 int id = i - 1;
8934
8937
8938 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8939 {
8940 if (p)
8941 {
8944 }
8945 }
8946 }
8947 }
8948 }
8949
8951 {
8953 {
8955 {
8956 int id = i - 1;
8958
8959 if (OP)
8960 {
8962
8963 if (p)
8964 {
8966 }
8967
8968 delete OP;
8969 }
8970 }
8971
8974 }
8975 }
8976
8979 {
8980 return 0.0;
8981 }
8982
8983
8985 {
8986 return 250;
8987 }
8988
8990 {
8991 return 0;
8992 }
8993
8996 {
8998 return true;
8999
9000 return false;
9001 }
9002
9005 {
9008
9010 {
9012 }
9013 else
9014 {
9015
9017 }
9018
9020 }
9021
9028 {
9029 return -1;
9030 }
9031
9032
9033
9034
9036 {
9038 {
9040 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9041
9042 if (r_index >= 0)
9043 {
9044 InventoryLocation r_il = new InventoryLocation;
9045 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9046
9047 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9050 {
9051 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9052 }
9054 {
9055 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9056 }
9057
9058 }
9059
9060 player.GetHumanInventory().ClearUserReservedLocation(this);
9061 }
9062
9065 }
9066
9067
9068
9069
9071 {
9072 return ItemBase.m_DebugActionsMask;
9073 }
9074
9076 {
9077 return ItemBase.m_DebugActionsMask & mask;
9078 }
9079
9081 {
9082 ItemBase.m_DebugActionsMask = mask;
9083 }
9084
9086 {
9087 ItemBase.m_DebugActionsMask |= mask;
9088 }
9089
9091 {
9092 ItemBase.m_DebugActionsMask &= ~mask;
9093 }
9094
9096 {
9098 {
9100 }
9101 else
9102 {
9104 }
9105 }
9106
9107
9109 {
9110 if (GetEconomyProfile())
9111 {
9112 float q_max = GetEconomyProfile().GetQuantityMax();
9113 if (q_max > 0)
9114 {
9115 float q_min = GetEconomyProfile().GetQuantityMin();
9116 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9117
9119 {
9120 ComponentEnergyManager comp = GetCompEM();
9122 {
9124 }
9125 }
9127 {
9129
9130 }
9131
9132 }
9133 }
9134 }
9135
9138 {
9139 EntityAI parent = GetHierarchyParent();
9140
9141 if (parent)
9142 {
9143 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9144 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9145 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9146 }
9147 }
9148
9151 {
9152 EntityAI parent = GetHierarchyParent();
9153
9154 if (parent)
9155 {
9156 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9157 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9158 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9159 }
9160 }
9161
9163 {
9164
9165
9166
9167
9169
9171 {
9172 if (ScriptInputUserData.CanStoreInputUserData())
9173 {
9174 ScriptInputUserData ctx = new ScriptInputUserData;
9180 ctx.
Write(use_stack_max);
9183
9185 {
9186 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9187 }
9188 }
9189 }
9190 else if (!
GetGame().IsMultiplayer())
9191 {
9193 }
9194 }
9195
9197 {
9199 }
9200
9202 {
9204 }
9205
9207 {
9209 }
9210
9212 {
9213
9214 return false;
9215 }
9216
9218 {
9219 return false;
9220 }
9221
9225 {
9226 return false;
9227 }
9228
9230 {
9231 return "";
9232 }
9233
9235
9237 {
9238 return false;
9239 }
9240
9242 {
9243 return true;
9244 }
9245
9246
9247
9249 {
9250 return true;
9251 }
9252
9254 {
9255 return true;
9256 }
9257
9259 {
9260 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9262 }
9263
9265 {
9267 }
9268
9270 {
9272 if (!is_being_placed)
9274 SetSynchDirty();
9275 }
9276
9277
9279
9281 {
9283 }
9284
9286 {
9288 }
9289
9291 {
9292 return 1;
9293 }
9294
9296 {
9297 return false;
9298 }
9299
9301 {
9303 SetSynchDirty();
9304 }
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9341 {
9342 super.OnMovedInsideCargo(container);
9343
9344 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9345 }
9346
9347 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9348 {
9349 super.EEItemLocationChanged(oldLoc,newLoc);
9350
9351 PlayerBase new_player = null;
9352 PlayerBase old_player = null;
9353
9354 if (newLoc.GetParent())
9355 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9356
9357 if (oldLoc.GetParent())
9358 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9359
9361 {
9362 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9363
9364 if (r_index >= 0)
9365 {
9366 InventoryLocation r_il = new InventoryLocation;
9367 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9368
9369 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9372 {
9373 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9374 }
9376 {
9377 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9378 }
9379
9380 }
9381 }
9382
9384 {
9385 if (new_player)
9386 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9387
9388 if (new_player == old_player)
9389 {
9390
9391 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9392 {
9394 {
9395 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9396 {
9397 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9398 }
9399 }
9400 else
9401 {
9402 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9403 }
9404 }
9405
9406 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9407 {
9408 int type = oldLoc.GetType();
9410 {
9411 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9412 }
9414 {
9415 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9416 }
9417 }
9418 if (!m_OldLocation)
9419 {
9420 m_OldLocation = new InventoryLocation;
9421 }
9422 m_OldLocation.Copy(oldLoc);
9423 }
9424 else
9425 {
9426 if (m_OldLocation)
9427 {
9428 m_OldLocation.Reset();
9429 }
9430 }
9431
9433 }
9434 else
9435 {
9436 if (new_player)
9437 {
9438 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9439 if (res_index >= 0)
9440 {
9441 InventoryLocation il = new InventoryLocation;
9442 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9444 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9447 {
9448 il.
GetParent().GetOnReleaseLock().Invoke(it);
9449 }
9451 {
9453 }
9454
9455 }
9456 }
9458 {
9459
9461 }
9462
9463 if (m_OldLocation)
9464 {
9465 m_OldLocation.Reset();
9466 }
9467 }
9468 }
9469
9470 override void EOnContact(IEntity other, Contact extra)
9471 {
9473 {
9474 int liquidType = -1;
9476 if (impactSpeed > 0.0)
9477 {
9479 #ifndef SERVER
9481 #else
9483 SetSynchDirty();
9484 #endif
9486 }
9487 }
9488
9489 #ifdef SERVER
9490 if (GetCompEM() && GetCompEM().IsPlugged())
9491 {
9492 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9493 GetCompEM().UnplugThis();
9494 }
9495 #endif
9496 }
9497
9499
9501 {
9503 }
9504
9506 {
9507
9508 }
9509
9511 {
9512 super.OnItemLocationChanged(old_owner, new_owner);
9513
9514 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9515 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9516
9517 if (!relatedPlayer && playerNew)
9518 relatedPlayer = playerNew;
9519
9520 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9521 {
9523 if (actionMgr)
9524 {
9525 ActionBase currentAction = actionMgr.GetRunningAction();
9526 if (currentAction)
9528 }
9529 }
9530
9531 Man ownerPlayerOld = null;
9532 Man ownerPlayerNew = null;
9533
9534 if (old_owner)
9535 {
9536 if (old_owner.
IsMan())
9537 {
9538 ownerPlayerOld = Man.Cast(old_owner);
9539 }
9540 else
9541 {
9542 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9543 }
9544 }
9545 else
9546 {
9548 {
9550
9551 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9552 {
9553 GetCompEM().UnplugThis();
9554 }
9555 }
9556 }
9557
9558 if (new_owner)
9559 {
9560 if (new_owner.
IsMan())
9561 {
9562 ownerPlayerNew = Man.Cast(new_owner);
9563 }
9564 else
9565 {
9566 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9567 }
9568 }
9569
9570 if (ownerPlayerOld != ownerPlayerNew)
9571 {
9572 if (ownerPlayerOld)
9573 {
9574 array<EntityAI> subItemsExit = new array<EntityAI>;
9576 for (int i = 0; i < subItemsExit.Count(); i++)
9577 {
9580 }
9581 }
9582
9583 if (ownerPlayerNew)
9584 {
9585 array<EntityAI> subItemsEnter = new array<EntityAI>;
9587 for (int j = 0; j < subItemsEnter.Count(); j++)
9588 {
9591 }
9592 }
9593 }
9594 else if (ownerPlayerNew != null)
9595 {
9596 PlayerBase nplayer;
9597 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9598 {
9599 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9601 for (int k = 0; k < subItemsUpdate.Count(); k++)
9602 {
9604 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9605 }
9606 }
9607 }
9608
9609 if (old_owner)
9610 old_owner.OnChildItemRemoved(this);
9611 if (new_owner)
9612 new_owner.OnChildItemReceived(this);
9613 }
9614
9615
9617 {
9618 super.EEDelete(parent);
9619 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9620 if (player)
9621 {
9623
9624 if (player.IsAlive())
9625 {
9626 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9627 if (r_index >= 0)
9628 {
9629 InventoryLocation r_il = new InventoryLocation;
9630 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9631
9632 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9635 {
9636 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9637 }
9639 {
9640 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9641 }
9642
9643 }
9644
9645 player.RemoveQuickBarEntityShortcut(this);
9646 }
9647 }
9648 }
9649
9651 {
9652 super.EEKilled(killer);
9653
9656 {
9657 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9658 {
9659 if (IsMagazine())
9660 {
9661 if (Magazine.Cast(this).GetAmmoCount() > 0)
9662 {
9664 }
9665 }
9666 else
9667 {
9669 }
9670 }
9671 }
9672 }
9673
9675 {
9676 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9677
9678 super.OnWasAttached(parent, slot_id);
9679
9682
9684 }
9685
9687 {
9688 super.OnWasDetached(parent, slot_id);
9689
9692 }
9693
9695 {
9696 int idx;
9699
9700 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9701 if (inventory_slots.Count() < 1)
9702 {
9703 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9704 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9705 }
9706 else
9707 {
9708 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9709 }
9710
9711 idx = inventory_slots.Find(slot);
9712 if (idx < 0)
9713 return "";
9714
9715 return attach_types.Get(idx);
9716 }
9717
9719 {
9720 int idx = -1;
9721 string slot;
9722
9725
9726 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9727 if (inventory_slots.Count() < 1)
9728 {
9729 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9730 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9731 }
9732 else
9733 {
9734 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9735 if (detach_types.Count() < 1)
9736 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9737 }
9738
9739 for (int i = 0; i < inventory_slots.Count(); i++)
9740 {
9741 slot = inventory_slots.Get(i);
9742 }
9743
9744 if (slot != "")
9745 {
9746 if (detach_types.Count() == 1)
9747 idx = 0;
9748 else
9749 idx = inventory_slots.Find(slot);
9750 }
9751 if (idx < 0)
9752 return "";
9753
9754 return detach_types.Get(idx);
9755 }
9756
9758 {
9759
9761
9762
9763 float min_time = 1;
9764 float max_time = 3;
9765 float delay = Math.RandomFloat(min_time, max_time);
9766
9767 explode_timer.Run(delay, this, "DoAmmoExplosion");
9768 }
9769
9771 {
9772 Magazine magazine = Magazine.Cast(this);
9773 int pop_sounds_count = 6;
9774 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9775
9776
9777 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9778 string sound_name = pop_sounds[ sound_idx ];
9780
9781
9782 magazine.ServerAddAmmoCount(-1);
9783
9784
9785 float min_temp_to_explode = 100;
9786
9787 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9788 {
9790 }
9791 }
9792
9793
9794 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9795 {
9796 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9797
9798 const int CHANCE_DAMAGE_CARGO = 4;
9799 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9800 const int CHANCE_DAMAGE_NOTHING = 2;
9801
9803 {
9804 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9805 int chances;
9806 int rnd;
9807
9808 if (GetInventory().GetCargo())
9809 {
9810 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9811 rnd = Math.RandomInt(0,chances);
9812
9813 if (rnd < CHANCE_DAMAGE_CARGO)
9814 {
9816 }
9817 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9818 {
9820 }
9821 }
9822 else
9823 {
9824 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9825 rnd = Math.RandomInt(0,chances);
9826
9827 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9828 {
9830 }
9831 }
9832 }
9833 }
9834
9836 {
9837 if (GetInventory().GetCargo())
9838 {
9839 int item_count = GetInventory().GetCargo().GetItemCount();
9840 if (item_count > 0)
9841 {
9842 int random_pick = Math.RandomInt(0, item_count);
9844 if (!item.IsExplosive())
9845 {
9846 item.AddHealth("","",damage);
9847 return true;
9848 }
9849 }
9850 }
9851 return false;
9852 }
9853
9855 {
9856 int attachment_count = GetInventory().AttachmentCount();
9857 if (attachment_count > 0)
9858 {
9859 int random_pick = Math.RandomInt(0, attachment_count);
9860 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9861 if (!attachment.IsExplosive())
9862 {
9863 attachment.AddHealth("","",damage);
9864 return true;
9865 }
9866 }
9867 return false;
9868 }
9869
9871 {
9873 }
9874
9876 {
9878 return GetInventory().CanRemoveEntity();
9879
9880 return false;
9881 }
9882
9884 {
9886 return;
9887
9889 {
9890 if (ScriptInputUserData.CanStoreInputUserData())
9891 {
9892 ScriptInputUserData ctx = new ScriptInputUserData;
9897 ctx.
Write(destination_entity);
9901 }
9902 }
9903 else if (!
GetGame().IsMultiplayer())
9904 {
9906 }
9907 }
9908
9910 {
9912 return;
9913
9914 float split_quantity_new;
9918 InventoryLocation loc = new InventoryLocation;
9919
9920 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9921 {
9923 split_quantity_new = stack_max;
9924 else
9926
9927 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9928 if (new_item)
9929 {
9930 new_item.SetResultOfSplit(true);
9931 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9933 new_item.SetQuantity(split_quantity_new);
9934 }
9935 }
9936 else if (destination_entity && slot_id == -1)
9937 {
9938 if (quantity > stack_max)
9939 split_quantity_new = stack_max;
9940 else
9941 split_quantity_new = quantity;
9942
9944 {
9947 }
9948
9949 if (new_item)
9950 {
9951 new_item.SetResultOfSplit(true);
9952 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9954 new_item.SetQuantity(split_quantity_new);
9955 }
9956 }
9957 else
9958 {
9959 if (stack_max != 0)
9960 {
9962 {
9964 }
9965
9966 if (split_quantity_new == 0)
9967 {
9968 if (!
GetGame().IsMultiplayer())
9969 player.PhysicalPredictiveDropItem(this);
9970 else
9971 player.ServerDropEntity(this);
9972 return;
9973 }
9974
9976
9977 if (new_item)
9978 {
9979 new_item.SetResultOfSplit(true);
9980 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9982 new_item.SetQuantity(stack_max);
9983 new_item.PlaceOnSurface();
9984 }
9985 }
9986 }
9987 }
9988
9990 {
9992 return;
9993
9994 float split_quantity_new;
9998 InventoryLocation loc = new InventoryLocation;
9999
10000 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10001 {
10003 split_quantity_new = stack_max;
10004 else
10006
10007 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10008 if (new_item)
10009 {
10010 new_item.SetResultOfSplit(true);
10011 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10013 new_item.SetQuantity(split_quantity_new);
10014 }
10015 }
10016 else if (destination_entity && slot_id == -1)
10017 {
10018 if (quantity > stack_max)
10019 split_quantity_new = stack_max;
10020 else
10021 split_quantity_new = quantity;
10022
10024 {
10027 }
10028
10029 if (new_item)
10030 {
10031 new_item.SetResultOfSplit(true);
10032 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10034 new_item.SetQuantity(split_quantity_new);
10035 }
10036 }
10037 else
10038 {
10039 if (stack_max != 0)
10040 {
10042 {
10044 }
10045
10047
10048 if (new_item)
10049 {
10050 new_item.SetResultOfSplit(true);
10051 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10053 new_item.SetQuantity(stack_max);
10054 new_item.PlaceOnSurface();
10055 }
10056 }
10057 }
10058 }
10059
10061 {
10063 return;
10064
10066 {
10067 if (ScriptInputUserData.CanStoreInputUserData())
10068 {
10069 ScriptInputUserData ctx = new ScriptInputUserData;
10074 dst.WriteToContext(ctx);
10076 }
10077 }
10078 else if (!
GetGame().IsMultiplayer())
10079 {
10081 }
10082 }
10083
10085 {
10087 return;
10088
10090 {
10091 if (ScriptInputUserData.CanStoreInputUserData())
10092 {
10093 ScriptInputUserData ctx = new ScriptInputUserData;
10098 ctx.
Write(destination_entity);
10104 }
10105 }
10106 else if (!
GetGame().IsMultiplayer())
10107 {
10109 }
10110 }
10111
10113 {
10115 }
10116
10118 {
10120 return this;
10121
10123 float split_quantity_new;
10125 if (dst.IsValid())
10126 {
10127 int slot_id = dst.GetSlot();
10129
10130 if (quantity > stack_max)
10131 split_quantity_new = stack_max;
10132 else
10133 split_quantity_new = quantity;
10134
10136
10137 if (new_item)
10138 {
10139 new_item.SetResultOfSplit(true);
10140 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10143 }
10144
10145 return new_item;
10146 }
10147
10148 return null;
10149 }
10150
10152 {
10154 return;
10155
10157 float split_quantity_new;
10159 if (destination_entity)
10160 {
10162 if (quantity > stackable)
10163 split_quantity_new = stackable;
10164 else
10165 split_quantity_new = quantity;
10166
10167 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10168 if (new_item)
10169 {
10170 new_item.SetResultOfSplit(true);
10171 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10173 new_item.SetQuantity(split_quantity_new);
10174 }
10175 }
10176 }
10177
10179 {
10181 return;
10182
10184 {
10185 if (ScriptInputUserData.CanStoreInputUserData())
10186 {
10187 ScriptInputUserData ctx = new ScriptInputUserData;
10192 ItemBase destination_entity =
this;
10193 ctx.
Write(destination_entity);
10197 }
10198 }
10199 else if (!
GetGame().IsMultiplayer())
10200 {
10202 }
10203 }
10204
10206 {
10208 return;
10209
10211 float split_quantity_new;
10213 if (player)
10214 {
10216 if (quantity > stackable)
10217 split_quantity_new = stackable;
10218 else
10219 split_quantity_new = quantity;
10220
10221 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10222 new_item =
ItemBase.Cast(in_hands);
10223 if (new_item)
10224 {
10225 new_item.SetResultOfSplit(true);
10226 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10228 new_item.SetQuantity(split_quantity_new);
10229 }
10230 }
10231 }
10232
10234 {
10236 return;
10237
10239 float split_quantity_new = Math.Floor(quantity * 0.5);
10240
10242
10243 if (new_item)
10244 {
10245 if (new_item.GetQuantityMax() < split_quantity_new)
10246 {
10247 split_quantity_new = new_item.GetQuantityMax();
10248 }
10249
10250 new_item.SetResultOfSplit(true);
10251 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10252
10254 {
10257 }
10258 else
10259 {
10262 }
10263 }
10264 }
10265
10267 {
10269 return;
10270
10272 float split_quantity_new = Math.Floor(quantity / 2);
10273
10274 InventoryLocation invloc = new InventoryLocation;
10276
10278 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10279
10280 if (new_item)
10281 {
10282 if (new_item.GetQuantityMax() < split_quantity_new)
10283 {
10284 split_quantity_new = new_item.GetQuantityMax();
10285 }
10287 {
10290 }
10291 else
10292 {
10295 }
10296 }
10297 }
10298
10301 {
10302 SetWeightDirty();
10304
10305 if (parent)
10306 parent.OnAttachmentQuantityChangedEx(this, delta);
10307
10309 {
10311 {
10313 }
10315 {
10316 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10318 }
10319 }
10320
10321 }
10322
10325 {
10326
10327 }
10328
10331 {
10333 }
10334
10336 {
10337 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10338
10340 {
10341 if (newLevel == GameConstants.STATE_RUINED)
10342 {
10344 EntityAI parent = GetHierarchyParent();
10345 if (parent && parent.IsFireplace())
10346 {
10347 CargoBase cargo = GetInventory().GetCargo();
10348 if (cargo)
10349 {
10351 {
10353 }
10354 }
10355 }
10356 }
10357
10359 {
10360
10362 return;
10363 }
10364
10365 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10366 {
10368 }
10369 }
10370 }
10371
10372
10374 {
10375 super.OnRightClick();
10376
10378 {
10380 {
10381 if (ScriptInputUserData.CanStoreInputUserData())
10382 {
10383 vector m4[4];
10385
10386 EntityAI root = GetHierarchyRoot();
10387
10388 InventoryLocation dst = new InventoryLocation;
10390 {
10391 if (root)
10392 {
10393 root.GetTransform(m4);
10395 }
10396 else
10397 GetInventory().GetCurrentInventoryLocation(dst);
10398 }
10399 else
10400 {
10402
10403
10404 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10405 {
10406 if (root)
10407 {
10408 root.GetTransform(m4);
10410 }
10411 else
10412 GetInventory().GetCurrentInventoryLocation(dst);
10413 }
10414 else
10415 {
10416 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10417 }
10418 }
10419
10420 ScriptInputUserData ctx = new ScriptInputUserData;
10428 }
10429 }
10430 else if (!
GetGame().IsMultiplayer())
10431 {
10433 }
10434 }
10435 }
10436
10437 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10438 {
10439
10440 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10441 return false;
10442
10443 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10444 return false;
10445
10446
10448 return false;
10449
10450
10451 Magazine mag = Magazine.Cast(this);
10452 if (mag)
10453 {
10454 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10455 return false;
10456
10457 if (stack_max_limit)
10458 {
10459 Magazine other_mag = Magazine.Cast(other_item);
10460 if (other_item)
10461 {
10462 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10463 return false;
10464 }
10465
10466 }
10467 }
10468 else
10469 {
10470
10472 return false;
10473
10475 return false;
10476 }
10477
10478 PlayerBase player = null;
10479 if (CastTo(player, GetHierarchyRootPlayer()))
10480 {
10481 if (player.GetInventory().HasAttachment(this))
10482 return false;
10483
10484 if (player.IsItemsToDelete())
10485 return false;
10486 }
10487
10488 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10489 return false;
10490
10491 int slotID;
10493 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10494 return false;
10495
10496 return true;
10497 }
10498
10500 {
10502 }
10503
10505 {
10506 return m_IsResultOfSplit;
10507 }
10508
10510 {
10511 m_IsResultOfSplit = value;
10512 }
10513
10515 {
10517 }
10518
10520 {
10521 float other_item_quantity = other_item.GetQuantity();
10522 float this_free_space;
10523
10525
10527
10528 if (other_item_quantity > this_free_space)
10529 {
10530 return this_free_space;
10531 }
10532 else
10533 {
10534 return other_item_quantity;
10535 }
10536 }
10537
10539 {
10541 }
10542
10544 {
10546 return;
10547
10548 if (!IsMagazine() && other_item)
10549 {
10551 if (quantity_used != 0)
10552 {
10553 float hp1 = GetHealth01("","");
10554 float hp2 = other_item.GetHealth01("","");
10555 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10556 hpResult = hpResult / (
GetQuantity() + quantity_used);
10557
10558 hpResult *= GetMaxHealth();
10559 Math.Round(hpResult);
10560 SetHealth("", "Health", hpResult);
10561
10563 other_item.AddQuantity(-quantity_used);
10564 }
10565 }
10567 }
10568
10570 {
10571 #ifdef SERVER
10572 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10573 GetHierarchyParent().IncreaseLifetimeUp();
10574 #endif
10575 };
10576
10578 {
10579 PlayerBase p = PlayerBase.Cast(player);
10580
10581 array<int> recipesIds = p.m_Recipes;
10582 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10583 if (moduleRecipesManager)
10584 {
10585 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10586 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10587 }
10588
10589 for (int i = 0;i < recipesIds.Count(); i++)
10590 {
10591 int key = recipesIds.Get(i);
10592 string recipeName = moduleRecipesManager.GetRecipeName(key);
10594 }
10595 }
10596
10597
10598 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10599 {
10600 super.GetDebugActions(outputList);
10601
10602
10607
10608
10612
10616
10617
10620
10621
10623 {
10626 }
10627
10629
10632
10636 }
10637
10638
10639
10640
10642 {
10643 super.OnAction(action_id, player, ctx);
10644 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10645 {
10646 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10647 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10648 PlayerBase p = PlayerBase.Cast(player);
10649 if (
EActions.RECIPES_RANGE_START < 1000)
10650 {
10651 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10652 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10653 }
10654 }
10655 #ifndef SERVER
10656 else if (action_id ==
EActions.WATCH_PLAYER)
10657 {
10658 PluginDeveloper.SetDeveloperItemClientEx(player);
10659 }
10660 #endif
10662 {
10663 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10664 {
10665 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10666 OnDebugButtonPressServer(id + 1);
10667 }
10668
10669 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10670 {
10671 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10673 }
10674
10675 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10676 {
10677 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10679 }
10680
10681 else if (action_id ==
EActions.ADD_QUANTITY)
10682 {
10683 if (IsMagazine())
10684 {
10685 Magazine mag = Magazine.Cast(this);
10686 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10687 }
10688 else
10689 {
10691 }
10692
10693 if (m_EM)
10694 {
10695 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10696 }
10697
10698 }
10699
10700 else if (action_id ==
EActions.REMOVE_QUANTITY)
10701 {
10702 if (IsMagazine())
10703 {
10704 Magazine mag2 = Magazine.Cast(this);
10705 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10706 }
10707 else
10708 {
10710 }
10711 if (m_EM)
10712 {
10713 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10714 }
10715
10716 }
10717
10718 else if (action_id ==
EActions.SET_QUANTITY_0)
10719 {
10721
10722 if (m_EM)
10723 {
10724 m_EM.SetEnergy(0);
10725 }
10726 }
10727
10728 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10729 {
10731
10732 if (m_EM)
10733 {
10734 m_EM.SetEnergy(m_EM.GetEnergyMax());
10735 }
10736 }
10737
10738 else if (action_id ==
EActions.ADD_HEALTH)
10739 {
10740 AddHealth("","",GetMaxHealth("","Health")/5);
10741 }
10742 else if (action_id ==
EActions.REMOVE_HEALTH)
10743 {
10744 AddHealth("","",-GetMaxHealth("","Health")/5);
10745 }
10746 else if (action_id ==
EActions.DESTROY_HEALTH)
10747 {
10748 SetHealth01("","",0);
10749 }
10750 else if (action_id ==
EActions.WATCH_ITEM)
10751 {
10753 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10754 #ifdef DEVELOPER
10755 SetDebugDeveloper_item(this);
10756 #endif
10757 }
10758
10759 else if (action_id ==
EActions.ADD_TEMPERATURE)
10760 {
10761 AddTemperature(20);
10762
10763 }
10764
10765 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10766 {
10767 AddTemperature(-20);
10768
10769 }
10770
10771 else if (action_id ==
EActions.FLIP_FROZEN)
10772 {
10773 SetFrozen(!GetIsFrozen());
10774
10775 }
10776
10777 else if (action_id ==
EActions.ADD_WETNESS)
10778 {
10780
10781 }
10782
10783 else if (action_id ==
EActions.REMOVE_WETNESS)
10784 {
10786
10787 }
10788
10789 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10790 {
10793
10794
10795 }
10796
10797 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10798 {
10801 }
10802
10803 else if (action_id ==
EActions.MAKE_SPECIAL)
10804 {
10805 auto debugParams = DebugSpawnParams.WithPlayer(player);
10806 OnDebugSpawnEx(debugParams);
10807 }
10808
10809 else if (action_id ==
EActions.DELETE)
10810 {
10811 Delete();
10812 }
10813
10814 }
10815
10816
10817 return false;
10818 }
10819
10820
10821
10822
10826
10829
10830
10831
10833 {
10834 return false;
10835 }
10836
10837
10839 {
10840 return true;
10841 }
10842
10843
10845 {
10846 return true;
10847 }
10848
10849
10850
10852 {
10853 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10855 }
10856
10859 {
10860 return null;
10861 }
10862
10864 {
10865 return false;
10866 }
10867
10869 {
10870 return false;
10871 }
10872
10876
10877
10879 {
10880 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10881 return module_repairing.CanRepair(this, item_repair_kit);
10882 }
10883
10884
10885 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10886 {
10887 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10888 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10889 }
10890
10891
10893 {
10894
10895
10896
10897
10898
10899
10900
10901
10902 return 1;
10903 }
10904
10905
10906
10908 {
10910 }
10911
10912
10913
10915 {
10917 }
10918
10919
10928 {
10929 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10930
10931 if (player)
10932 {
10933 player.MessageStatus(text);
10934 }
10935 }
10936
10937
10946 {
10947 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10948
10949 if (player)
10950 {
10951 player.MessageAction(text);
10952 }
10953 }
10954
10955
10964 {
10965 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10966
10967 if (player)
10968 {
10969 player.MessageFriendly(text);
10970 }
10971 }
10972
10973
10982 {
10983 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10984
10985 if (player)
10986 {
10987 player.MessageImportant(text);
10988 }
10989 }
10990
10992 {
10993 return true;
10994 }
10995
10996
10997 override bool KindOf(
string tag)
10998 {
10999 bool found = false;
11000 string item_name = this.
GetType();
11003
11004 int array_size = item_tag_array.Count();
11005 for (int i = 0; i < array_size; i++)
11006 {
11007 if (item_tag_array.Get(i) == tag)
11008 {
11009 found = true;
11010 break;
11011 }
11012 }
11013 return found;
11014 }
11015
11016
11018 {
11019
11020 super.OnRPC(sender, rpc_type,ctx);
11021
11022
11023 switch (rpc_type)
11024 {
11025 #ifndef SERVER
11026 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11027 Param2<bool, string> p = new Param2<bool, string>(false, "");
11028
11030 return;
11031
11032 bool play = p.param1;
11033 string soundSet = p.param2;
11034
11035 if (play)
11036 {
11038 {
11040 {
11042 }
11043 }
11044 else
11045 {
11047 }
11048 }
11049 else
11050 {
11052 }
11053
11054 break;
11055 #endif
11056
11057 }
11058
11060 {
11062 }
11063 }
11064
11065
11066
11067
11069 {
11070 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11071 return plugin.GetID(
name);
11072 }
11073
11075 {
11076 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11077 return plugin.GetName(id);
11078 }
11079
11082 {
11083
11084
11085 int varFlags;
11086 if (!ctx.
Read(varFlags))
11087 return;
11088
11089 if (varFlags & ItemVariableFlags.FLOAT)
11090 {
11092 }
11093 }
11094
11096 {
11097
11098 super.SerializeNumericalVars(floats_out);
11099
11100
11101
11103 {
11105 }
11106
11108 {
11110 }
11111
11113 {
11115 }
11116
11118 {
11123 }
11124
11126 {
11128 }
11129 }
11130
11132 {
11133
11134 super.DeSerializeNumericalVars(floats);
11135
11136
11137 int index = 0;
11138 int mask = Math.Round(floats.Get(index));
11139
11140 index++;
11141
11143 {
11145 {
11147 }
11148 else
11149 {
11150 float quantity = floats.Get(index);
11151 SetQuantity(quantity,
true,
false,
false,
false);
11152 }
11153 index++;
11154 }
11155
11157 {
11158 float wet = floats.Get(index);
11160 index++;
11161 }
11162
11164 {
11165 int liquidtype = Math.Round(floats.Get(index));
11167 index++;
11168 }
11169
11171 {
11173 index++;
11175 index++;
11177 index++;
11179 index++;
11180 }
11181
11183 {
11184 int cleanness = Math.Round(floats.Get(index));
11186 index++;
11187 }
11188 }
11189
11191 {
11192 super.WriteVarsToCTX(ctx);
11193
11194
11196 {
11198 }
11199
11201 {
11203 }
11204
11206 {
11208 }
11209
11211 {
11212 int r,g,b,a;
11218 }
11219
11221 {
11223 }
11224 }
11225
11227 {
11228 if (!super.ReadVarsFromCTX(ctx,version))
11229 return false;
11230
11231 int intValue;
11232 float value;
11233
11234 if (version < 140)
11235 {
11236 if (!ctx.
Read(intValue))
11237 return false;
11238
11239 m_VariablesMask = intValue;
11240 }
11241
11243 {
11244 if (!ctx.
Read(value))
11245 return false;
11246
11248 {
11250 }
11251 else
11252 {
11254 }
11255 }
11256
11257 if (version < 140)
11258 {
11260 {
11261 if (!ctx.
Read(value))
11262 return false;
11263 SetTemperatureDirect(value);
11264 }
11265 }
11266
11268 {
11269 if (!ctx.
Read(value))
11270 return false;
11272 }
11273
11275 {
11276 if (!ctx.
Read(intValue))
11277 return false;
11279 }
11280
11282 {
11283 int r,g,b,a;
11285 return false;
11287 return false;
11289 return false;
11291 return false;
11292
11294 }
11295
11297 {
11298 if (!ctx.
Read(intValue))
11299 return false;
11301 }
11302
11303 if (version >= 138 && version < 140)
11304 {
11306 {
11307 if (!ctx.
Read(intValue))
11308 return false;
11309 SetFrozen(intValue);
11310 }
11311 }
11312
11313 return true;
11314 }
11315
11316
11318 {
11321 {
11323 }
11324
11325 if (!super.OnStoreLoad(ctx, version))
11326 {
11328 return false;
11329 }
11330
11331 if (version >= 114)
11332 {
11333 bool hasQuickBarIndexSaved;
11334
11335 if (!ctx.
Read(hasQuickBarIndexSaved))
11336 {
11338 return false;
11339 }
11340
11341 if (hasQuickBarIndexSaved)
11342 {
11343 int itmQBIndex;
11344
11345
11346 if (!ctx.
Read(itmQBIndex))
11347 {
11349 return false;
11350 }
11351
11352 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11353 if (itmQBIndex != -1 && parentPlayer)
11354 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11355 }
11356 }
11357 else
11358 {
11359
11360 PlayerBase player;
11361 int itemQBIndex;
11362 if (version ==
int.
MAX)
11363 {
11364 if (!ctx.
Read(itemQBIndex))
11365 {
11367 return false;
11368 }
11369 }
11370 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11371 {
11372
11373 if (!ctx.
Read(itemQBIndex))
11374 {
11376 return false;
11377 }
11378 if (itemQBIndex != -1 && player)
11379 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11380 }
11381 }
11382
11383 if (version < 140)
11384 {
11385
11386 if (!LoadVariables(ctx, version))
11387 {
11389 return false;
11390 }
11391 }
11392
11393
11395 {
11397 return false;
11398 }
11399 if (version >= 132)
11400 {
11402 if (raib)
11403 {
11405 {
11407 return false;
11408 }
11409 }
11410 }
11411
11413 return true;
11414 }
11415
11416
11417
11419 {
11420 super.OnStoreSave(ctx);
11421
11422 PlayerBase player;
11423 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11424 {
11426
11427 int itemQBIndex = -1;
11428 itemQBIndex = player.FindQuickBarEntityIndex(this);
11429 ctx.
Write(itemQBIndex);
11430 }
11431 else
11432 {
11434 }
11435
11437
11439 if (raib)
11440 {
11442 }
11443 }
11444
11445
11447 {
11448 super.AfterStoreLoad();
11449
11451 {
11453 }
11454
11456 {
11459 }
11460 }
11461
11463 {
11464 super.EEOnAfterLoad();
11465
11467 {
11469 }
11470
11473 }
11474
11476 {
11477 return false;
11478 }
11479
11480
11481
11483 {
11485 {
11486 #ifdef PLATFORM_CONSOLE
11487
11489 {
11491 if (menu)
11492 {
11494 }
11495 }
11496 #endif
11497 }
11498
11500 {
11503 }
11504
11506 {
11507 SetWeightDirty();
11509 }
11511 {
11514 }
11515
11517 {
11520 }
11522 {
11525 }
11526
11527 super.OnVariablesSynchronized();
11528 }
11529
11530
11531
11533 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11534 {
11535 if (!IsServerCheck(allow_client))
11536 return false;
11537
11539 return false;
11540
11543
11544 if (value <= (min + 0.001))
11545 value = min;
11546
11547 if (value == min)
11548 {
11549 if (destroy_config)
11550 {
11551 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11552 if (dstr)
11553 {
11555 this.Delete();
11556 return true;
11557 }
11558 }
11559 else if (destroy_forced)
11560 {
11562 this.Delete();
11563 return true;
11564 }
11565
11567 }
11568
11571
11573 {
11575
11576 if (delta)
11578 }
11579
11581
11582 return false;
11583 }
11584
11585
11587 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11588 {
11590 }
11591
11593 {
11596 }
11597
11599 {
11602 }
11603
11606 {
11607 float value_clamped = Math.Clamp(value, 0, 1);
11609 SetQuantity(result, destroy_config, destroy_forced);
11610 }
11611
11612
11615 {
11617 }
11618
11620 {
11622 }
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11634 {
11635 int slot = -1;
11636 if (GetInventory())
11637 {
11638 InventoryLocation il = new InventoryLocation;
11639 GetInventory().GetCurrentInventoryLocation(il);
11641 }
11642
11644 }
11645
11647 {
11648 float quantity_max = 0;
11649
11651 {
11652 if (attSlotID != -1)
11653 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11654
11655 if (quantity_max <= 0)
11657 }
11658
11659 if (quantity_max <= 0)
11661
11662 return quantity_max;
11663 }
11664
11666 {
11668 }
11669
11671 {
11673 }
11674
11675
11677 {
11679 }
11680
11682 {
11684 }
11685
11687 {
11689 }
11690
11691
11693 {
11694
11695 float weightEx = GetWeightEx();
11696 float special = GetInventoryAndCargoWeight();
11697 return weightEx - special;
11698 }
11699
11700
11702 {
11704 }
11705
11707 {
11709 {
11710 #ifdef DEVELOPER
11711 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11712 {
11713 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11715 }
11716 #endif
11717
11718 return GetQuantity() * GetConfigWeightModified();
11719 }
11720 else if (HasEnergyManager())
11721 {
11722 #ifdef DEVELOPER
11723 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11724 {
11725 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11726 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11727 }
11728 #endif
11729 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11730 }
11731 else
11732 {
11733 #ifdef DEVELOPER
11734 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11735 {
11736 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11737 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11738 }
11739 #endif
11740 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11741 }
11742 }
11743
11746 {
11747 int item_count = 0;
11749
11750 if (GetInventory().GetCargo() != NULL)
11751 {
11752 item_count = GetInventory().GetCargo().GetItemCount();
11753 }
11754
11755 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11756 {
11757 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11758 if (item)
11759 item_count += item.GetNumberOfItems();
11760 }
11761 return item_count;
11762 }
11763
11766 {
11767 float weight = 0;
11768 float wetness = 1;
11769 if (include_wetness)
11772 {
11773 weight = wetness * m_ConfigWeight;
11774 }
11776 {
11777 weight = 1;
11778 }
11779 return weight;
11780 }
11781
11782
11783
11785 {
11786 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11787 {
11788 GameInventory inv = GetInventory();
11789 array<EntityAI> items = new array<EntityAI>;
11791 for (int i = 0; i < items.Count(); i++)
11792 {
11794 if (item)
11795 {
11797 }
11798 }
11799 }
11800 }
11801
11802
11803
11804
11806 {
11807 float energy = 0;
11808 if (HasEnergyManager())
11809 {
11810 energy = GetCompEM().GetEnergy();
11811 }
11812 return energy;
11813 }
11814
11815
11817 {
11818 super.OnEnergyConsumed();
11819
11821 }
11822
11824 {
11825 super.OnEnergyAdded();
11826
11828 }
11829
11830
11832 {
11833 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11834 {
11836 {
11837 float energy_0to1 = GetCompEM().GetEnergy0To1();
11839 }
11840 }
11841 }
11842
11843
11845 {
11846 return ConfigGetFloat("heatIsolation");
11847 }
11848
11850 {
11852 }
11853
11855 {
11856 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11857 if (
GetGame().ConfigIsExisting(paramPath))
11859
11860 return 0.0;
11861 }
11862
11864 {
11865 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11866 if (
GetGame().ConfigIsExisting(paramPath))
11868
11869 return 0.0;
11870 }
11871
11872 override void SetWet(
float value,
bool allow_client =
false)
11873 {
11874 if (!IsServerCheck(allow_client))
11875 return;
11876
11879
11881
11882 m_VarWet = Math.Clamp(value, min, max);
11883
11885 {
11888 }
11889 }
11890
11891 override void AddWet(
float value)
11892 {
11894 }
11895
11897 {
11899 }
11900
11902 {
11904 }
11905
11907 {
11909 }
11910
11912 {
11914 }
11915
11917 {
11919 }
11920
11921 override void OnWetChanged(
float newVal,
float oldVal)
11922 {
11925 if (newLevel != oldLevel)
11926 {
11928 }
11929 }
11930
11932 {
11933 SetWeightDirty();
11934 }
11935
11937 {
11938 return GetWetLevelInternal(
m_VarWet);
11939 }
11940
11941
11942
11944 {
11946 }
11947
11949 {
11951 }
11952
11954 {
11956 }
11957
11959 {
11961 }
11962
11963
11964
11966 {
11967 if (ConfigIsExisting("itemModelLength"))
11968 {
11969 return ConfigGetFloat("itemModelLength");
11970 }
11971 return 0;
11972 }
11973
11975 {
11976 if (ConfigIsExisting("itemAttachOffset"))
11977 {
11978 return ConfigGetFloat("itemAttachOffset");
11979 }
11980 return 0;
11981 }
11982
11983 override void SetCleanness(
int value,
bool allow_client =
false)
11984 {
11985 if (!IsServerCheck(allow_client))
11986 return;
11987
11989
11991
11994 }
11995
11997 {
11999 }
12000
12002 {
12003 return true;
12004 }
12005
12006
12007
12008
12010 {
12012 }
12013
12015 {
12017 }
12018
12019
12020
12021
12022 override void SetColor(
int r,
int g,
int b,
int a)
12023 {
12029 }
12031 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12032 {
12037 }
12038
12040 {
12042 }
12043
12046 {
12047 int r,g,b,a;
12049 r = r/255;
12050 g = g/255;
12051 b = b/255;
12052 a = a/255;
12053 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12054 }
12055
12056
12057
12058 override void SetLiquidType(
int value,
bool allow_client =
false)
12059 {
12060 if (!IsServerCheck(allow_client))
12061 return;
12062
12067 }
12068
12070 {
12071 return ConfigGetInt("varLiquidTypeInit");
12072 }
12073
12075 {
12077 }
12078
12080 {
12082 SetFrozen(false);
12083 }
12084
12087 {
12088 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12089 }
12090
12091
12094 {
12095 PlayerBase nplayer;
12096 if (PlayerBase.CastTo(nplayer, player))
12097 {
12099
12100 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12101 }
12102 }
12103
12104
12107 {
12108 PlayerBase nplayer;
12109 if (PlayerBase.CastTo(nplayer,player))
12110 {
12111
12112 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12113
12114 }
12115
12116
12117 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12118
12119
12120 if (HasEnergyManager())
12121 {
12122 GetCompEM().UpdatePlugState();
12123 }
12124 }
12125
12126
12128 {
12129 super.OnPlacementStarted(player);
12130
12132 }
12133
12134 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12135 {
12137 {
12138 m_AdminLog.OnPlacementComplete(player,
this);
12139 }
12140
12141 super.OnPlacementComplete(player, position, orientation);
12142 }
12143
12144
12145
12146
12147
12149 {
12151 {
12152 return true;
12153 }
12154 else
12155 {
12156 return false;
12157 }
12158 }
12159
12160
12162 {
12164 {
12166 }
12167 }
12168
12169
12171 {
12173 }
12174
12176 {
12178 }
12179
12180 override void InsertAgent(
int agent,
float count = 1)
12181 {
12182 if (count < 1)
12183 return;
12184
12186 }
12187
12190 {
12192 }
12193
12194
12196 {
12198 }
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12242 {
12244 return false;
12245 return true;
12246 }
12247
12249 {
12250
12252 }
12253
12254
12257 {
12258 super.CheckForRoofLimited(timeTresholdMS);
12259
12261 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12262 {
12263 m_PreviousRoofTestTime = time;
12264 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12265 }
12266 }
12267
12268
12270 {
12272 {
12273 return 0;
12274 }
12275
12276 if (GetInventory().GetAttachmentSlotsCount() != 0)
12277 {
12278 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12279 if (filter)
12280 return filter.GetProtectionLevel(type, false, system);
12281 else
12282 return 0;
12283 }
12284
12285 string subclassPath, entryName;
12286
12287 switch (type)
12288 {
12290 entryName = "biological";
12291 break;
12293 entryName = "chemical";
12294 break;
12295 default:
12296 entryName = "biological";
12297 break;
12298 }
12299
12300 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12301
12303 }
12304
12305
12306
12309 {
12310 if (!IsMagazine())
12312
12314 }
12315
12316
12317
12318
12319
12324 {
12325 return true;
12326 }
12327
12329 {
12331 }
12332
12333
12334
12335
12336
12338 {
12339 if (parent)
12340 {
12341 if (parent.IsInherited(DayZInfected))
12342 return true;
12343
12344 if (!parent.IsRuined())
12345 return true;
12346 }
12347
12348 return true;
12349 }
12350
12352 {
12353 if (!super.CanPutAsAttachment(parent))
12354 {
12355 return false;
12356 }
12357
12358 if (!IsRuined() && !parent.IsRuined())
12359 {
12360 return true;
12361 }
12362
12363 return false;
12364 }
12365
12367 {
12368
12369
12370
12371
12372 return super.CanReceiveItemIntoCargo(item);
12373 }
12374
12376 {
12377
12378
12379
12380
12381 GameInventory attachmentInv = attachment.GetInventory();
12383 {
12384 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12385 return false;
12386 }
12387
12388 InventoryLocation loc = new InventoryLocation();
12389 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12390 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12391 return false;
12392
12393 return super.CanReceiveAttachment(attachment, slotId);
12394 }
12395
12397 {
12398 if (!super.CanReleaseAttachment(attachment))
12399 return false;
12400
12401 return GetInventory().AreChildrenAccessible();
12402 }
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12425 {
12426 int id = muzzle_owner.GetMuzzleID();
12427 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12428
12429 if (WPOF_array)
12430 {
12431 for (int i = 0; i < WPOF_array.Count(); i++)
12432 {
12433 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12434
12435 if (WPOF)
12436 {
12437 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12438 }
12439 }
12440 }
12441 }
12442
12443
12445 {
12446 int id = muzzle_owner.GetMuzzleID();
12448
12449 if (WPOBE_array)
12450 {
12451 for (int i = 0; i < WPOBE_array.Count(); i++)
12452 {
12453 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12454
12455 if (WPOBE)
12456 {
12457 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12458 }
12459 }
12460 }
12461 }
12462
12463
12465 {
12466 int id = muzzle_owner.GetMuzzleID();
12467 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12468
12469 if (WPOOH_array)
12470 {
12471 for (int i = 0; i < WPOOH_array.Count(); i++)
12472 {
12473 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12474
12475 if (WPOOH)
12476 {
12477 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12478 }
12479 }
12480 }
12481 }
12482
12483
12485 {
12486 int id = muzzle_owner.GetMuzzleID();
12487 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12488
12489 if (WPOOH_array)
12490 {
12491 for (int i = 0; i < WPOOH_array.Count(); i++)
12492 {
12493 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12494
12495 if (WPOOH)
12496 {
12497 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12498 }
12499 }
12500 }
12501 }
12502
12503
12505 {
12506 int id = muzzle_owner.GetMuzzleID();
12507 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12508
12509 if (WPOOH_array)
12510 {
12511 for (int i = 0; i < WPOOH_array.Count(); i++)
12512 {
12513 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12514
12515 if (WPOOH)
12516 {
12517 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12518 }
12519 }
12520 }
12521 }
12522
12523
12524
12526 {
12528 {
12529 return true;
12530 }
12531
12532 return false;
12533 }
12534
12536 {
12538 {
12539 return true;
12540 }
12541
12542 return false;
12543 }
12544
12546 {
12548 {
12549 return true;
12550 }
12551
12552 return false;
12553 }
12554
12556 {
12557 return false;
12558 }
12559
12562 {
12563 return UATimeSpent.DEFAULT_DEPLOY;
12564 }
12565
12566
12567
12568
12570 {
12572 SetSynchDirty();
12573 }
12574
12576 {
12578 }
12579
12580
12582 {
12583 return false;
12584 }
12585
12588 {
12589 string att_type = "None";
12590
12591 if (ConfigIsExisting("soundAttType"))
12592 {
12593 att_type = ConfigGetString("soundAttType");
12594 }
12595
12597 }
12598
12600 {
12602 }
12603
12604
12605
12606
12607
12611
12613 {
12616
12618 }
12619
12620
12622 {
12624 return;
12625
12627
12630
12633
12634 SoundParameters params = new SoundParameters();
12638 }
12639
12640
12642 {
12644 return;
12645
12647 SetSynchDirty();
12648
12651 }
12652
12653
12655 {
12657 return;
12658
12660 SetSynchDirty();
12661
12664 }
12665
12667 {
12669 }
12670
12672 {
12674 }
12675
12678 {
12679 if (!
GetGame().IsDedicatedServer())
12680 {
12681 if (ConfigIsExisting("attachSoundSet"))
12682 {
12683 string cfg_path = "";
12684 string soundset = "";
12685 string type_name =
GetType();
12686
12689 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12690 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12691
12692 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12693 {
12694 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12695 {
12696 if (cfg_slot_array[i] == slot_type)
12697 {
12698 soundset = cfg_soundset_array[i];
12699 break;
12700 }
12701 }
12702 }
12703
12704 if (soundset != "")
12705 {
12706 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12708 }
12709 }
12710 }
12711 }
12712
12714 {
12715
12716 }
12717
12718 void OnApply(PlayerBase player);
12719
12721 {
12722 return 1.0;
12723 };
12724
12726 {
12728 }
12729
12731 {
12733 }
12734
12736
12738 {
12739 SetDynamicPhysicsLifeTime(0.01);
12741 }
12742
12744 {
12745 array<string> zone_names = new array<string>;
12746 GetDamageZones(zone_names);
12747 for (int i = 0; i < zone_names.Count(); i++)
12748 {
12749 SetHealthMax(zone_names.Get(i),"Health");
12750 }
12751 SetHealthMax("","Health");
12752 }
12753
12756 {
12757 float global_health = GetHealth01("","Health");
12758 array<string> zones = new array<string>;
12759 GetDamageZones(zones);
12760
12761 for (int i = 0; i < zones.Count(); i++)
12762 {
12763 SetHealth01(zones.Get(i),"Health",global_health);
12764 }
12765 }
12766
12769 {
12770 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12771 }
12772
12774 {
12775 if (!hasRootAsPlayer)
12776 {
12777 if (refParentIB)
12778 {
12779
12780 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12781 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12782
12783 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12784 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12785
12788 }
12789 else
12790 {
12791
12794 }
12795 }
12796 }
12797
12799 {
12801 {
12802 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12803 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12804 {
12805 float heatPermCoef = 1.0;
12807 while (ent)
12808 {
12809 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12810 ent = ent.GetHierarchyParent();
12811 }
12812
12813 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12814 }
12815 }
12816 }
12817
12819 {
12820
12821 EntityAI parent = GetHierarchyParent();
12822 if (!parent)
12823 {
12824 hasParent = false;
12825 hasRootAsPlayer = false;
12826 }
12827 else
12828 {
12829 hasParent = true;
12830 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12831 refParentIB =
ItemBase.Cast(parent);
12832 }
12833 }
12834
12835 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12836 {
12837
12838 }
12839
12841 {
12842
12843 return false;
12844 }
12845
12847 {
12848
12849
12850 return false;
12851 }
12852
12854 {
12855
12856 return false;
12857 }
12858
12861 {
12862 return !GetIsFrozen() &&
IsOpen();
12863 }
12864
12866 {
12867 bool hasParent = false, hasRootAsPlayer = false;
12869
12870 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12871 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12872
12873 if (wwtu || foodDecay)
12874 {
12878
12879 if (processWetness || processTemperature || processDecay)
12880 {
12882
12883 if (processWetness)
12884 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12885
12886 if (processTemperature)
12888
12889 if (processDecay)
12890 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12891 }
12892 }
12893 }
12894
12897 {
12899 }
12900
12902 {
12905
12906 return super.GetTemperatureFreezeThreshold();
12907 }
12908
12910 {
12913
12914 return super.GetTemperatureThawThreshold();
12915 }
12916
12918 {
12921
12922 return super.GetItemOverheatThreshold();
12923 }
12924
12926 {
12928 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12929
12930 return super.GetTemperatureFreezeTime();
12931 }
12932
12934 {
12936 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12937
12938 return super.GetTemperatureThawTime();
12939 }
12940
12945
12947 {
12948 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12949 }
12950
12952 {
12953 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12954 }
12955
12958 {
12960 }
12961
12963 {
12965 }
12966
12968 {
12970 }
12971
12974 {
12975 return null;
12976 }
12977
12980 {
12981 return false;
12982 }
12983
12985 {
12987 {
12990 if (!trg)
12991 {
12993 explosive = this;
12994 }
12995
12996 explosive.PairRemote(trg);
12998
12999 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13000 trg.SetPersistentPairID(persistentID);
13001 explosive.SetPersistentPairID(persistentID);
13002
13003 return true;
13004 }
13005 return false;
13006 }
13007
13010 {
13011 float ret = 1.0;
13014 ret *= GetHealth01();
13015
13016 return ret;
13017 }
13018
13019 #ifdef DEVELOPER
13020 override void SetDebugItem()
13021 {
13022 super.SetDebugItem();
13023 _itemBase = this;
13024 }
13025
13027 {
13028 string text = super.GetDebugText();
13029
13031 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13032
13033 return text;
13034 }
13035 #endif
13036
13038 {
13039 return true;
13040 }
13041
13043
13045
13047 {
13050 }
13051
13052
13060
13076}
13077
13079{
13081 if (entity)
13082 {
13083 bool is_item = entity.IsInherited(
ItemBase);
13084 if (is_item && full_quantity)
13085 {
13088 }
13089 }
13090 else
13091 {
13093 return NULL;
13094 }
13095 return entity;
13096}
13097
13099{
13100 if (item)
13101 {
13102 if (health > 0)
13103 item.SetHealth("", "", health);
13104
13105 if (item.CanHaveTemperature())
13106 {
13108 if (item.CanFreeze())
13109 item.SetFrozen(false);
13110 }
13111
13112 if (item.HasEnergyManager())
13113 {
13114 if (quantity >= 0)
13115 {
13116 item.GetCompEM().SetEnergy0To1(quantity);
13117 }
13118 else
13119 {
13121 }
13122 }
13123 else if (item.IsMagazine())
13124 {
13125 Magazine mag = Magazine.Cast(item);
13126 if (quantity >= 0)
13127 {
13128 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13129 }
13130 else
13131 {
13133 }
13134
13135 }
13136 else
13137 {
13138 if (quantity >= 0)
13139 {
13140 item.SetQuantityNormalized(quantity, false);
13141 }
13142 else
13143 {
13145 }
13146
13147 }
13148 }
13149}
13150
13151#ifdef DEVELOPER
13153#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.