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 {
9885
9887 return false;
9888
9889
9891 return false;
9892
9893
9894
9896 if (delta == 0)
9897 return false;
9898
9899
9900 return true;
9901 }
9902
9904 {
9906 {
9907 if (ScriptInputUserData.CanStoreInputUserData())
9908 {
9909 ScriptInputUserData ctx = new ScriptInputUserData;
9914 ctx.
Write(destination_entity);
9918 }
9919 }
9920 else if (!
GetGame().IsMultiplayer())
9921 {
9923 }
9924 }
9925
9927 {
9928 float split_quantity_new;
9932 InventoryLocation loc = new InventoryLocation;
9933
9934 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9935 {
9937 split_quantity_new = stack_max;
9938 else
9940
9942 {
9943 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9944 if (new_item)
9945 {
9946 new_item.SetResultOfSplit(true);
9947 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9949 new_item.
SetQuantity(split_quantity_new,
false,
true);
9950 }
9951 }
9952 }
9953 else if (destination_entity && slot_id == -1)
9954 {
9955 if (quantity > stack_max)
9956 split_quantity_new = stack_max;
9957 else
9958 split_quantity_new = quantity;
9959
9961 {
9963 {
9966 }
9967
9968 if (new_item)
9969 {
9970 new_item.SetResultOfSplit(true);
9971 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9973 new_item.
SetQuantity(split_quantity_new,
false,
true);
9974 }
9975 }
9976 }
9977 else
9978 {
9979 if (stack_max != 0)
9980 {
9982 {
9984 }
9985
9986 if (split_quantity_new == 0)
9987 {
9988 if (!
GetGame().IsMultiplayer())
9989 player.PhysicalPredictiveDropItem(this);
9990 else
9991 player.ServerDropEntity(this);
9992 return;
9993 }
9994
9996 {
9998
9999 if (new_item)
10000 {
10001 new_item.SetResultOfSplit(true);
10002 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10005 new_item.PlaceOnSurface();
10006 }
10007 }
10008 }
10009 }
10010 }
10011
10013 {
10014 float split_quantity_new;
10018 InventoryLocation loc = new InventoryLocation;
10019
10020 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10021 {
10023 split_quantity_new = stack_max;
10024 else
10026
10028 {
10029 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10030 if (new_item)
10031 {
10032 new_item.SetResultOfSplit(true);
10033 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10035 new_item.
SetQuantity(split_quantity_new,
false,
true);
10036 }
10037 }
10038 }
10039 else if (destination_entity && slot_id == -1)
10040 {
10041 if (quantity > stack_max)
10042 split_quantity_new = stack_max;
10043 else
10044 split_quantity_new = quantity;
10045
10047 {
10049 {
10052 }
10053
10054 if (new_item)
10055 {
10056 new_item.SetResultOfSplit(true);
10057 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10059 new_item.
SetQuantity(split_quantity_new,
false,
true);
10060 }
10061 }
10062 }
10063 else
10064 {
10065 if (stack_max != 0)
10066 {
10068 {
10070 }
10071
10073 {
10075
10076 if (new_item)
10077 {
10078 new_item.SetResultOfSplit(true);
10079 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10082 new_item.PlaceOnSurface();
10083 }
10084 }
10085 }
10086 }
10087 }
10088
10090 {
10092 {
10093 if (ScriptInputUserData.CanStoreInputUserData())
10094 {
10095 ScriptInputUserData ctx = new ScriptInputUserData;
10100 dst.WriteToContext(ctx);
10102 }
10103 }
10104 else if (!
GetGame().IsMultiplayer())
10105 {
10107 }
10108 }
10109
10111 {
10113 {
10114 if (ScriptInputUserData.CanStoreInputUserData())
10115 {
10116 ScriptInputUserData ctx = new ScriptInputUserData;
10121 ctx.
Write(destination_entity);
10127 }
10128 }
10129 else if (!
GetGame().IsMultiplayer())
10130 {
10132 }
10133 }
10134
10136 {
10138 }
10139
10141 {
10143 float split_quantity_new;
10145 if (dst.IsValid())
10146 {
10147 int slot_id = dst.GetSlot();
10149
10150 if (quantity > stack_max)
10151 split_quantity_new = stack_max;
10152 else
10153 split_quantity_new = quantity;
10154
10156 {
10158
10159 if (new_item)
10160 {
10161 new_item.SetResultOfSplit(true);
10162 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10164 new_item.
SetQuantity(split_quantity_new,
false,
true);
10165 }
10166
10167 return new_item;
10168 }
10169 }
10170
10171 return null;
10172 }
10173
10175 {
10177 float split_quantity_new;
10179 if (destination_entity)
10180 {
10182 if (quantity > stackable)
10183 split_quantity_new = stackable;
10184 else
10185 split_quantity_new = quantity;
10186
10188 {
10189 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10190 if (new_item)
10191 {
10192 new_item.SetResultOfSplit(true);
10193 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10195 new_item.
SetQuantity(split_quantity_new,
false,
true);
10196 }
10197 }
10198 }
10199 }
10200
10202 {
10204 {
10205 if (ScriptInputUserData.CanStoreInputUserData())
10206 {
10207 ScriptInputUserData ctx = new ScriptInputUserData;
10212 ItemBase destination_entity =
this;
10213 ctx.
Write(destination_entity);
10217 }
10218 }
10219 else if (!
GetGame().IsMultiplayer())
10220 {
10222 }
10223 }
10224
10226 {
10228 float split_quantity_new;
10230 if (player)
10231 {
10233 if (quantity > stackable)
10234 split_quantity_new = stackable;
10235 else
10236 split_quantity_new = quantity;
10237
10239 {
10240 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10241 new_item =
ItemBase.Cast(in_hands);
10242 if (new_item)
10243 {
10244 new_item.SetResultOfSplit(true);
10245 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10247 new_item.SetQuantity(split_quantity_new, false, true);
10248 }
10249 }
10250 }
10251 }
10252
10254 {
10256 float split_quantity_new = Math.Floor(quantity * 0.5);
10257
10259 return;
10260
10262
10263 if (new_item)
10264 {
10265 if (new_item.GetQuantityMax() < split_quantity_new)
10266 {
10267 split_quantity_new = new_item.GetQuantityMax();
10268 }
10269
10270 new_item.SetResultOfSplit(true);
10271 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10272
10274 {
10277 }
10278 else
10279 {
10281 new_item.
SetQuantity(split_quantity_new,
false,
true);
10282 }
10283 }
10284 }
10285
10287 {
10289 float split_quantity_new = Math.Floor(quantity / 2);
10290
10292 return;
10293
10294 InventoryLocation invloc = new InventoryLocation;
10296
10298 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10299
10300 if (new_item)
10301 {
10302 if (new_item.GetQuantityMax() < split_quantity_new)
10303 {
10304 split_quantity_new = new_item.GetQuantityMax();
10305 }
10307 {
10310 }
10311 else if (split_quantity_new > 1)
10312 {
10314 new_item.
SetQuantity(split_quantity_new,
false,
true);
10315 }
10316 }
10317 }
10318
10321 {
10322 SetWeightDirty();
10324
10325 if (parent)
10326 parent.OnAttachmentQuantityChangedEx(this, delta);
10327
10329 {
10331 {
10333 }
10335 {
10336 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10338 }
10339 }
10340
10341 }
10342
10345 {
10346
10347 }
10348
10351 {
10353 }
10354
10356 {
10357 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10358
10360 {
10361 if (newLevel == GameConstants.STATE_RUINED)
10362 {
10364 EntityAI parent = GetHierarchyParent();
10365 if (parent && parent.IsFireplace())
10366 {
10367 CargoBase cargo = GetInventory().GetCargo();
10368 if (cargo)
10369 {
10371 {
10373 }
10374 }
10375 }
10376 }
10377
10379 {
10380
10382 return;
10383 }
10384
10385 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10386 {
10388 }
10389 }
10390 }
10391
10392
10394 {
10395 super.OnRightClick();
10396
10398 {
10400 {
10401 if (ScriptInputUserData.CanStoreInputUserData())
10402 {
10403 EntityAI root = GetHierarchyRoot();
10404 Man playerOwner = GetHierarchyRootPlayer();
10405 InventoryLocation dst = new InventoryLocation;
10406
10407
10408 if (!playerOwner && root && root == this)
10409 {
10411 }
10412 else
10413 {
10414
10415 GetInventory().GetCurrentInventoryLocation(dst);
10417 {
10420 {
10422 }
10423 else
10424 {
10426
10427
10428 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10429 {
10431 }
10432 else
10433 {
10434 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10435 }
10436 }
10437 }
10438 }
10439
10440 ScriptInputUserData ctx = new ScriptInputUserData;
10448 }
10449 }
10450 else if (!
GetGame().IsMultiplayer())
10451 {
10453 }
10454 }
10455 }
10456
10458 {
10459 if (root)
10460 {
10461 vector m4[4];
10462 root.GetTransform(m4);
10463 dst.SetGround(this, m4);
10464 }
10465 else
10466 {
10467 GetInventory().GetCurrentInventoryLocation(dst);
10468 }
10469 }
10470
10471 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10472 {
10473
10474 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10475 return false;
10476
10477 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10478 return false;
10479
10480
10482 return false;
10483
10484
10485 Magazine mag = Magazine.Cast(this);
10486 if (mag)
10487 {
10488 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10489 return false;
10490
10491 if (stack_max_limit)
10492 {
10493 Magazine other_mag = Magazine.Cast(other_item);
10494 if (other_item)
10495 {
10496 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10497 return false;
10498 }
10499
10500 }
10501 }
10502 else
10503 {
10504
10506 return false;
10507
10509 return false;
10510 }
10511
10512 PlayerBase player = null;
10513 if (CastTo(player, GetHierarchyRootPlayer()))
10514 {
10515 if (player.GetInventory().HasAttachment(this))
10516 return false;
10517
10518 if (player.IsItemsToDelete())
10519 return false;
10520 }
10521
10522 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10523 return false;
10524
10525 int slotID;
10527 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10528 return false;
10529
10530 return true;
10531 }
10532
10534 {
10536 }
10537
10539 {
10540 return m_IsResultOfSplit;
10541 }
10542
10544 {
10545 m_IsResultOfSplit = value;
10546 }
10547
10549 {
10551 }
10552
10554 {
10555 float other_item_quantity = other_item.GetQuantity();
10556 float this_free_space;
10557
10559
10561
10562 if (other_item_quantity > this_free_space)
10563 {
10564 return this_free_space;
10565 }
10566 else
10567 {
10568 return other_item_quantity;
10569 }
10570 }
10571
10573 {
10575 }
10576
10578 {
10580 return;
10581
10582 if (!IsMagazine() && other_item)
10583 {
10585 if (quantity_used != 0)
10586 {
10587 float hp1 = GetHealth01("","");
10588 float hp2 = other_item.GetHealth01("","");
10589 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10590 hpResult = hpResult / (
GetQuantity() + quantity_used);
10591
10592 hpResult *= GetMaxHealth();
10593 Math.Round(hpResult);
10594 SetHealth("", "Health", hpResult);
10595
10597 other_item.AddQuantity(-quantity_used);
10598 }
10599 }
10601 }
10602
10604 {
10605 #ifdef SERVER
10606 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10607 GetHierarchyParent().IncreaseLifetimeUp();
10608 #endif
10609 };
10610
10612 {
10613 PlayerBase p = PlayerBase.Cast(player);
10614
10615 array<int> recipesIds = p.m_Recipes;
10616 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10617 if (moduleRecipesManager)
10618 {
10619 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10620 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10621 }
10622
10623 for (int i = 0;i < recipesIds.Count(); i++)
10624 {
10625 int key = recipesIds.Get(i);
10626 string recipeName = moduleRecipesManager.GetRecipeName(key);
10628 }
10629 }
10630
10631
10632 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10633 {
10634 super.GetDebugActions(outputList);
10635
10636
10642
10643
10648
10653
10654
10658
10659
10661 {
10665 }
10666
10669
10670
10674
10676
10677 InventoryLocation loc = new InventoryLocation();
10678 GetInventory().GetCurrentInventoryLocation(loc);
10680 {
10681 if (Gizmo_IsSupported())
10684 }
10685
10687 }
10688
10689
10690
10691
10693 {
10694 super.OnAction(action_id, player, ctx);
10695
10697 {
10698 switch (action_id)
10699 {
10702 return true;
10705 return true;
10706 }
10707 }
10708
10710 {
10711 switch (action_id)
10712 {
10714 Delete();
10715 return true;
10716 }
10717 }
10718
10719 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10720 {
10721 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10722 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10723 PlayerBase p = PlayerBase.Cast(player);
10724 if (
EActions.RECIPES_RANGE_START < 1000)
10725 {
10726 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10727 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10728 }
10729 }
10730 #ifndef SERVER
10731 else if (action_id ==
EActions.WATCH_PLAYER)
10732 {
10733 PluginDeveloper.SetDeveloperItemClientEx(player);
10734 }
10735 #endif
10737 {
10738 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10739 {
10740 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10741 OnDebugButtonPressServer(id + 1);
10742 }
10743
10744 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10745 {
10746 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10748 }
10749
10750 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10751 {
10752 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10754 }
10755
10756 else if (action_id ==
EActions.ADD_QUANTITY)
10757 {
10758 if (IsMagazine())
10759 {
10760 Magazine mag = Magazine.Cast(this);
10761 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10762 }
10763 else
10764 {
10766 }
10767
10768 if (m_EM)
10769 {
10770 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10771 }
10772
10773 }
10774
10775 else if (action_id ==
EActions.REMOVE_QUANTITY)
10776 {
10777 if (IsMagazine())
10778 {
10779 Magazine mag2 = Magazine.Cast(this);
10780 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10781 }
10782 else
10783 {
10785 }
10786 if (m_EM)
10787 {
10788 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10789 }
10790
10791 }
10792
10793 else if (action_id ==
EActions.SET_QUANTITY_0)
10794 {
10796
10797 if (m_EM)
10798 {
10799 m_EM.SetEnergy(0);
10800 }
10801 }
10802
10803 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10804 {
10806
10807 if (m_EM)
10808 {
10809 m_EM.SetEnergy(m_EM.GetEnergyMax());
10810 }
10811 }
10812
10813 else if (action_id ==
EActions.ADD_HEALTH)
10814 {
10815 AddHealth("","",GetMaxHealth("","Health")/5);
10816 }
10817 else if (action_id ==
EActions.REMOVE_HEALTH)
10818 {
10819 AddHealth("","",-GetMaxHealth("","Health")/5);
10820 }
10821 else if (action_id ==
EActions.DESTROY_HEALTH)
10822 {
10823 SetHealth01("","",0);
10824 }
10825 else if (action_id ==
EActions.WATCH_ITEM)
10826 {
10828 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10829 #ifdef DEVELOPER
10830 SetDebugDeveloper_item(this);
10831 #endif
10832 }
10833
10834 else if (action_id ==
EActions.ADD_TEMPERATURE)
10835 {
10836 AddTemperature(20);
10837
10838 }
10839
10840 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10841 {
10842 AddTemperature(-20);
10843
10844 }
10845
10846 else if (action_id ==
EActions.FLIP_FROZEN)
10847 {
10848 SetFrozen(!GetIsFrozen());
10849
10850 }
10851
10852 else if (action_id ==
EActions.ADD_WETNESS)
10853 {
10855
10856 }
10857
10858 else if (action_id ==
EActions.REMOVE_WETNESS)
10859 {
10861
10862 }
10863
10864 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10865 {
10868
10869
10870 }
10871
10872 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10873 {
10876 }
10877
10878 else if (action_id ==
EActions.MAKE_SPECIAL)
10879 {
10880 auto debugParams = DebugSpawnParams.WithPlayer(player);
10881 OnDebugSpawnEx(debugParams);
10882 }
10883
10884 }
10885
10886
10887 return false;
10888 }
10889
10890
10891
10892
10896
10899
10900
10901
10903 {
10904 return false;
10905 }
10906
10907
10909 {
10910 return true;
10911 }
10912
10913
10915 {
10916 return true;
10917 }
10918
10919
10920
10922 {
10923 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10925 }
10926
10929 {
10930 return null;
10931 }
10932
10934 {
10935 return false;
10936 }
10937
10939 {
10940 return false;
10941 }
10942
10946
10947
10949 {
10950 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10951 return module_repairing.CanRepair(this, item_repair_kit);
10952 }
10953
10954
10955 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10956 {
10957 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10958 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10959 }
10960
10961
10963 {
10964
10965
10966
10967
10968
10969
10970
10971
10972 return 1;
10973 }
10974
10975
10976
10978 {
10980 }
10981
10982
10983
10985 {
10987 }
10988
10989
10998 {
10999 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11000
11001 if (player)
11002 {
11003 player.MessageStatus(text);
11004 }
11005 }
11006
11007
11016 {
11017 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11018
11019 if (player)
11020 {
11021 player.MessageAction(text);
11022 }
11023 }
11024
11025
11034 {
11035 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11036
11037 if (player)
11038 {
11039 player.MessageFriendly(text);
11040 }
11041 }
11042
11043
11052 {
11053 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11054
11055 if (player)
11056 {
11057 player.MessageImportant(text);
11058 }
11059 }
11060
11062 {
11063 return true;
11064 }
11065
11066
11067 override bool KindOf(
string tag)
11068 {
11069 bool found = false;
11070 string item_name = this.
GetType();
11073
11074 int array_size = item_tag_array.Count();
11075 for (int i = 0; i < array_size; i++)
11076 {
11077 if (item_tag_array.Get(i) == tag)
11078 {
11079 found = true;
11080 break;
11081 }
11082 }
11083 return found;
11084 }
11085
11086
11088 {
11089
11090 super.OnRPC(sender, rpc_type,ctx);
11091
11092
11093 switch (rpc_type)
11094 {
11095 #ifndef SERVER
11096 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11097 Param2<bool, string> p = new Param2<bool, string>(false, "");
11098
11100 return;
11101
11102 bool play = p.param1;
11103 string soundSet = p.param2;
11104
11105 if (play)
11106 {
11108 {
11110 {
11112 }
11113 }
11114 else
11115 {
11117 }
11118 }
11119 else
11120 {
11122 }
11123
11124 break;
11125 #endif
11126
11127 }
11128
11130 {
11132 }
11133 }
11134
11135
11136
11137
11139 {
11140 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11141 return plugin.GetID(
name);
11142 }
11143
11145 {
11146 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11147 return plugin.GetName(id);
11148 }
11149
11152 {
11153
11154
11155 int varFlags;
11156 if (!ctx.
Read(varFlags))
11157 return;
11158
11159 if (varFlags & ItemVariableFlags.FLOAT)
11160 {
11162 }
11163 }
11164
11166 {
11167
11168 super.SerializeNumericalVars(floats_out);
11169
11170
11171
11173 {
11175 }
11176
11178 {
11180 }
11181
11183 {
11185 }
11186
11188 {
11193 }
11194
11196 {
11198 }
11199 }
11200
11202 {
11203
11204 super.DeSerializeNumericalVars(floats);
11205
11206
11207 int index = 0;
11208 int mask = Math.Round(floats.Get(index));
11209
11210 index++;
11211
11213 {
11215 {
11217 }
11218 else
11219 {
11220 float quantity = floats.Get(index);
11221 SetQuantity(quantity,
true,
false,
false,
false);
11222 }
11223 index++;
11224 }
11225
11227 {
11228 float wet = floats.Get(index);
11230 index++;
11231 }
11232
11234 {
11235 int liquidtype = Math.Round(floats.Get(index));
11237 index++;
11238 }
11239
11241 {
11243 index++;
11245 index++;
11247 index++;
11249 index++;
11250 }
11251
11253 {
11254 int cleanness = Math.Round(floats.Get(index));
11256 index++;
11257 }
11258 }
11259
11261 {
11262 super.WriteVarsToCTX(ctx);
11263
11264
11266 {
11268 }
11269
11271 {
11273 }
11274
11276 {
11278 }
11279
11281 {
11282 int r,g,b,a;
11288 }
11289
11291 {
11293 }
11294 }
11295
11297 {
11298 if (!super.ReadVarsFromCTX(ctx,version))
11299 return false;
11300
11301 int intValue;
11302 float value;
11303
11304 if (version < 140)
11305 {
11306 if (!ctx.
Read(intValue))
11307 return false;
11308
11309 m_VariablesMask = intValue;
11310 }
11311
11313 {
11314 if (!ctx.
Read(value))
11315 return false;
11316
11318 {
11320 }
11321 else
11322 {
11324 }
11325 }
11326
11327 if (version < 140)
11328 {
11330 {
11331 if (!ctx.
Read(value))
11332 return false;
11333 SetTemperatureDirect(value);
11334 }
11335 }
11336
11338 {
11339 if (!ctx.
Read(value))
11340 return false;
11342 }
11343
11345 {
11346 if (!ctx.
Read(intValue))
11347 return false;
11349 }
11350
11352 {
11353 int r,g,b,a;
11355 return false;
11357 return false;
11359 return false;
11361 return false;
11362
11364 }
11365
11367 {
11368 if (!ctx.
Read(intValue))
11369 return false;
11371 }
11372
11373 if (version >= 138 && version < 140)
11374 {
11376 {
11377 if (!ctx.
Read(intValue))
11378 return false;
11379 SetFrozen(intValue);
11380 }
11381 }
11382
11383 return true;
11384 }
11385
11386
11388 {
11391 {
11393 }
11394
11395 if (!super.OnStoreLoad(ctx, version))
11396 {
11398 return false;
11399 }
11400
11401 if (version >= 114)
11402 {
11403 bool hasQuickBarIndexSaved;
11404
11405 if (!ctx.
Read(hasQuickBarIndexSaved))
11406 {
11408 return false;
11409 }
11410
11411 if (hasQuickBarIndexSaved)
11412 {
11413 int itmQBIndex;
11414
11415
11416 if (!ctx.
Read(itmQBIndex))
11417 {
11419 return false;
11420 }
11421
11422 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11423 if (itmQBIndex != -1 && parentPlayer)
11424 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11425 }
11426 }
11427 else
11428 {
11429
11430 PlayerBase player;
11431 int itemQBIndex;
11432 if (version ==
int.
MAX)
11433 {
11434 if (!ctx.
Read(itemQBIndex))
11435 {
11437 return false;
11438 }
11439 }
11440 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11441 {
11442
11443 if (!ctx.
Read(itemQBIndex))
11444 {
11446 return false;
11447 }
11448 if (itemQBIndex != -1 && player)
11449 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11450 }
11451 }
11452
11453 if (version < 140)
11454 {
11455
11456 if (!LoadVariables(ctx, version))
11457 {
11459 return false;
11460 }
11461 }
11462
11463
11465 {
11467 return false;
11468 }
11469 if (version >= 132)
11470 {
11472 if (raib)
11473 {
11475 {
11477 return false;
11478 }
11479 }
11480 }
11481
11483 return true;
11484 }
11485
11486
11487
11489 {
11490 super.OnStoreSave(ctx);
11491
11492 PlayerBase player;
11493 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11494 {
11496
11497 int itemQBIndex = -1;
11498 itemQBIndex = player.FindQuickBarEntityIndex(this);
11499 ctx.
Write(itemQBIndex);
11500 }
11501 else
11502 {
11504 }
11505
11507
11509 if (raib)
11510 {
11512 }
11513 }
11514
11515
11517 {
11518 super.AfterStoreLoad();
11519
11521 {
11523 }
11524
11526 {
11529 }
11530 }
11531
11533 {
11534 super.EEOnAfterLoad();
11535
11537 {
11539 }
11540
11543 }
11544
11546 {
11547 return false;
11548 }
11549
11550
11551
11553 {
11555 {
11556 #ifdef PLATFORM_CONSOLE
11557
11559 {
11561 if (menu)
11562 {
11564 }
11565 }
11566 #endif
11567 }
11568
11570 {
11573 }
11574
11576 {
11577 SetWeightDirty();
11579 }
11581 {
11584 }
11585
11587 {
11590 }
11592 {
11595 }
11596
11597 super.OnVariablesSynchronized();
11598 }
11599
11600
11601
11603 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11604 {
11605 if (!IsServerCheck(allow_client))
11606 return false;
11607
11609 return false;
11610
11613
11614 if (value <= (min + 0.001))
11615 value = min;
11616
11617 if (value == min)
11618 {
11619 if (destroy_config)
11620 {
11621 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11622 if (dstr)
11623 {
11625 this.Delete();
11626 return true;
11627 }
11628 }
11629 else if (destroy_forced)
11630 {
11632 this.Delete();
11633 return true;
11634 }
11635
11637 }
11638
11641
11643 {
11645
11646 if (delta)
11648 }
11649
11651
11652 return false;
11653 }
11654
11655
11657 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11658 {
11660 }
11661
11663 {
11666 }
11667
11669 {
11672 }
11673
11675 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11676 {
11677 float value_clamped = Math.Clamp(value, 0, 1);
11679 SetQuantity(result, destroy_config, destroy_forced);
11680 }
11681
11682
11685 {
11687 }
11688
11690 {
11692 }
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11704 {
11705 int slot = -1;
11706 if (GetInventory())
11707 {
11708 InventoryLocation il = new InventoryLocation;
11709 GetInventory().GetCurrentInventoryLocation(il);
11711 }
11712
11714 }
11715
11717 {
11718 float quantity_max = 0;
11719
11721 {
11722 if (attSlotID != -1)
11723 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11724
11725 if (quantity_max <= 0)
11727 }
11728
11729 if (quantity_max <= 0)
11731
11732 return quantity_max;
11733 }
11734
11736 {
11738 }
11739
11741 {
11743 }
11744
11745
11747 {
11749 }
11750
11752 {
11754 }
11755
11757 {
11759 }
11760
11761
11763 {
11764
11765 float weightEx = GetWeightEx();
11766 float special = GetInventoryAndCargoWeight();
11767 return weightEx - special;
11768 }
11769
11770
11772 {
11774 }
11775
11777 {
11779 {
11780 #ifdef DEVELOPER
11781 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11782 {
11783 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11785 }
11786 #endif
11787
11788 return GetQuantity() * GetConfigWeightModified();
11789 }
11790 else if (HasEnergyManager())
11791 {
11792 #ifdef DEVELOPER
11793 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11794 {
11795 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11796 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11797 }
11798 #endif
11799 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11800 }
11801 else
11802 {
11803 #ifdef DEVELOPER
11804 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11805 {
11806 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11807 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11808 }
11809 #endif
11810 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11811 }
11812 }
11813
11816 {
11817 int item_count = 0;
11819
11820 if (GetInventory().GetCargo() != NULL)
11821 {
11822 item_count = GetInventory().GetCargo().GetItemCount();
11823 }
11824
11825 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11826 {
11827 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11828 if (item)
11829 item_count += item.GetNumberOfItems();
11830 }
11831 return item_count;
11832 }
11833
11836 {
11837 float weight = 0;
11838 float wetness = 1;
11839 if (include_wetness)
11842 {
11843 weight = wetness * m_ConfigWeight;
11844 }
11846 {
11847 weight = 1;
11848 }
11849 return weight;
11850 }
11851
11852
11853
11855 {
11856 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11857 {
11858 GameInventory inv = GetInventory();
11859 array<EntityAI> items = new array<EntityAI>;
11861 for (int i = 0; i < items.Count(); i++)
11862 {
11864 if (item)
11865 {
11867 }
11868 }
11869 }
11870 }
11871
11872
11873
11874
11876 {
11877 float energy = 0;
11878 if (HasEnergyManager())
11879 {
11880 energy = GetCompEM().GetEnergy();
11881 }
11882 return energy;
11883 }
11884
11885
11887 {
11888 super.OnEnergyConsumed();
11889
11891 }
11892
11894 {
11895 super.OnEnergyAdded();
11896
11898 }
11899
11900
11902 {
11903 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11904 {
11906 {
11907 float energy_0to1 = GetCompEM().GetEnergy0To1();
11909 }
11910 }
11911 }
11912
11913
11915 {
11916 return ConfigGetFloat("heatIsolation");
11917 }
11918
11920 {
11922 }
11923
11925 {
11926 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11927 if (
GetGame().ConfigIsExisting(paramPath))
11929
11930 return 0.0;
11931 }
11932
11934 {
11935 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11936 if (
GetGame().ConfigIsExisting(paramPath))
11938
11939 return 0.0;
11940 }
11941
11942 override void SetWet(
float value,
bool allow_client =
false)
11943 {
11944 if (!IsServerCheck(allow_client))
11945 return;
11946
11949
11951
11952 m_VarWet = Math.Clamp(value, min, max);
11953
11955 {
11958 }
11959 }
11960
11961 override void AddWet(
float value)
11962 {
11964 }
11965
11967 {
11969 }
11970
11972 {
11974 }
11975
11977 {
11979 }
11980
11982 {
11984 }
11985
11987 {
11989 }
11990
11991 override void OnWetChanged(
float newVal,
float oldVal)
11992 {
11995 if (newLevel != oldLevel)
11996 {
11998 }
11999 }
12000
12002 {
12003 SetWeightDirty();
12004 }
12005
12007 {
12008 return GetWetLevelInternal(
m_VarWet);
12009 }
12010
12011
12012
12014 {
12016 }
12017
12019 {
12021 }
12022
12024 {
12026 }
12027
12029 {
12031 }
12032
12033
12034
12036 {
12037 if (ConfigIsExisting("itemModelLength"))
12038 {
12039 return ConfigGetFloat("itemModelLength");
12040 }
12041 return 0;
12042 }
12043
12045 {
12046 if (ConfigIsExisting("itemAttachOffset"))
12047 {
12048 return ConfigGetFloat("itemAttachOffset");
12049 }
12050 return 0;
12051 }
12052
12053 override void SetCleanness(
int value,
bool allow_client =
false)
12054 {
12055 if (!IsServerCheck(allow_client))
12056 return;
12057
12059
12061
12064 }
12065
12067 {
12069 }
12070
12072 {
12073 return true;
12074 }
12075
12076
12077
12078
12080 {
12082 }
12083
12085 {
12087 }
12088
12089
12090
12091
12092 override void SetColor(
int r,
int g,
int b,
int a)
12093 {
12099 }
12101 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12102 {
12107 }
12108
12110 {
12112 }
12113
12116 {
12117 int r,g,b,a;
12119 r = r/255;
12120 g = g/255;
12121 b = b/255;
12122 a = a/255;
12123 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12124 }
12125
12126
12127
12128 override void SetLiquidType(
int value,
bool allow_client =
false)
12129 {
12130 if (!IsServerCheck(allow_client))
12131 return;
12132
12137 }
12138
12140 {
12141 return ConfigGetInt("varLiquidTypeInit");
12142 }
12143
12145 {
12147 }
12148
12150 {
12152 SetFrozen(false);
12153 }
12154
12157 {
12158 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12159 }
12160
12161
12164 {
12165 PlayerBase nplayer;
12166 if (PlayerBase.CastTo(nplayer, player))
12167 {
12169
12170 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12171 }
12172 }
12173
12174
12177 {
12178 PlayerBase nplayer;
12179 if (PlayerBase.CastTo(nplayer,player))
12180 {
12181
12182 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12183
12184 }
12185
12186
12187 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12188
12189
12190 if (HasEnergyManager())
12191 {
12192 GetCompEM().UpdatePlugState();
12193 }
12194 }
12195
12196
12198 {
12199 super.OnPlacementStarted(player);
12200
12202 }
12203
12204 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12205 {
12207 {
12208 m_AdminLog.OnPlacementComplete(player,
this);
12209 }
12210
12211 super.OnPlacementComplete(player, position, orientation);
12212 }
12213
12214
12215
12216
12217
12219 {
12221 {
12222 return true;
12223 }
12224 else
12225 {
12226 return false;
12227 }
12228 }
12229
12230
12232 {
12234 {
12236 }
12237 }
12238
12239
12241 {
12243 }
12244
12246 {
12248 }
12249
12250 override void InsertAgent(
int agent,
float count = 1)
12251 {
12252 if (count < 1)
12253 return;
12254
12256 }
12257
12260 {
12262 }
12263
12264
12266 {
12268 }
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12312 {
12314 return false;
12315 return true;
12316 }
12317
12319 {
12320
12322 }
12323
12324
12327 {
12328 super.CheckForRoofLimited(timeTresholdMS);
12329
12331 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12332 {
12333 m_PreviousRoofTestTime = time;
12334 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12335 }
12336 }
12337
12338
12340 {
12342 {
12343 return 0;
12344 }
12345
12346 if (GetInventory().GetAttachmentSlotsCount() != 0)
12347 {
12348 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12349 if (filter)
12350 return filter.GetProtectionLevel(type, false, system);
12351 else
12352 return 0;
12353 }
12354
12355 string subclassPath, entryName;
12356
12357 switch (type)
12358 {
12360 entryName = "biological";
12361 break;
12363 entryName = "chemical";
12364 break;
12365 default:
12366 entryName = "biological";
12367 break;
12368 }
12369
12370 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12371
12373 }
12374
12375
12376
12379 {
12380 if (!IsMagazine())
12382
12384 }
12385
12386
12387
12388
12389
12394 {
12395 return true;
12396 }
12397
12399 {
12401 }
12402
12403
12404
12405
12406
12408 {
12409 if (parent)
12410 {
12411 if (parent.IsInherited(DayZInfected))
12412 return true;
12413
12414 if (!parent.IsRuined())
12415 return true;
12416 }
12417
12418 return true;
12419 }
12420
12422 {
12423 if (!super.CanPutAsAttachment(parent))
12424 {
12425 return false;
12426 }
12427
12428 if (!IsRuined() && !parent.IsRuined())
12429 {
12430 return true;
12431 }
12432
12433 return false;
12434 }
12435
12437 {
12438
12439
12440
12441
12442 return super.CanReceiveItemIntoCargo(item);
12443 }
12444
12446 {
12447
12448
12449
12450
12451 GameInventory attachmentInv = attachment.GetInventory();
12453 {
12454 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12455 return false;
12456 }
12457
12458 InventoryLocation loc = new InventoryLocation();
12459 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12460 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12461 return false;
12462
12463 return super.CanReceiveAttachment(attachment, slotId);
12464 }
12465
12467 {
12468 if (!super.CanReleaseAttachment(attachment))
12469 return false;
12470
12471 return GetInventory().AreChildrenAccessible();
12472 }
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12495 {
12496 int id = muzzle_owner.GetMuzzleID();
12497 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12498
12499 if (WPOF_array)
12500 {
12501 for (int i = 0; i < WPOF_array.Count(); i++)
12502 {
12503 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12504
12505 if (WPOF)
12506 {
12507 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12508 }
12509 }
12510 }
12511 }
12512
12513
12515 {
12516 int id = muzzle_owner.GetMuzzleID();
12518
12519 if (WPOBE_array)
12520 {
12521 for (int i = 0; i < WPOBE_array.Count(); i++)
12522 {
12523 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12524
12525 if (WPOBE)
12526 {
12527 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12528 }
12529 }
12530 }
12531 }
12532
12533
12535 {
12536 int id = muzzle_owner.GetMuzzleID();
12537 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12538
12539 if (WPOOH_array)
12540 {
12541 for (int i = 0; i < WPOOH_array.Count(); i++)
12542 {
12543 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12544
12545 if (WPOOH)
12546 {
12547 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12548 }
12549 }
12550 }
12551 }
12552
12553
12555 {
12556 int id = muzzle_owner.GetMuzzleID();
12557 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12558
12559 if (WPOOH_array)
12560 {
12561 for (int i = 0; i < WPOOH_array.Count(); i++)
12562 {
12563 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12564
12565 if (WPOOH)
12566 {
12567 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12568 }
12569 }
12570 }
12571 }
12572
12573
12575 {
12576 int id = muzzle_owner.GetMuzzleID();
12577 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12578
12579 if (WPOOH_array)
12580 {
12581 for (int i = 0; i < WPOOH_array.Count(); i++)
12582 {
12583 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12584
12585 if (WPOOH)
12586 {
12587 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12588 }
12589 }
12590 }
12591 }
12592
12593
12594
12596 {
12598 {
12599 return true;
12600 }
12601
12602 return false;
12603 }
12604
12606 {
12608 {
12609 return true;
12610 }
12611
12612 return false;
12613 }
12614
12616 {
12618 {
12619 return true;
12620 }
12621
12622 return false;
12623 }
12624
12626 {
12627 return false;
12628 }
12629
12632 {
12633 return UATimeSpent.DEFAULT_DEPLOY;
12634 }
12635
12636
12637
12638
12640 {
12642 SetSynchDirty();
12643 }
12644
12646 {
12648 }
12649
12650
12652 {
12653 return false;
12654 }
12655
12658 {
12659 string att_type = "None";
12660
12661 if (ConfigIsExisting("soundAttType"))
12662 {
12663 att_type = ConfigGetString("soundAttType");
12664 }
12665
12667 }
12668
12670 {
12672 }
12673
12674
12675
12676
12677
12683
12685 {
12688
12690 }
12691
12692
12694 {
12696 return;
12697
12699
12702
12705
12706 SoundParameters params = new SoundParameters();
12710 }
12711
12712
12714 {
12716 return;
12717
12719 SetSynchDirty();
12720
12723 }
12724
12725
12727 {
12729 return;
12730
12732 SetSynchDirty();
12733
12736 }
12737
12739 {
12741 }
12742
12744 {
12746 }
12747
12750 {
12751 if (!
GetGame().IsDedicatedServer())
12752 {
12753 if (ConfigIsExisting("attachSoundSet"))
12754 {
12755 string cfg_path = "";
12756 string soundset = "";
12757 string type_name =
GetType();
12758
12761 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12762 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12763
12764 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12765 {
12766 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12767 {
12768 if (cfg_slot_array[i] == slot_type)
12769 {
12770 soundset = cfg_soundset_array[i];
12771 break;
12772 }
12773 }
12774 }
12775
12776 if (soundset != "")
12777 {
12778 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12780 }
12781 }
12782 }
12783 }
12784
12786 {
12787
12788 }
12789
12790 void OnApply(PlayerBase player);
12791
12793 {
12794 return 1.0;
12795 };
12796
12798 {
12800 }
12801
12803 {
12805 }
12806
12808
12810 {
12811 SetDynamicPhysicsLifeTime(0.01);
12813 }
12814
12816 {
12817 array<string> zone_names = new array<string>;
12818 GetDamageZones(zone_names);
12819 for (int i = 0; i < zone_names.Count(); i++)
12820 {
12821 SetHealthMax(zone_names.Get(i),"Health");
12822 }
12823 SetHealthMax("","Health");
12824 }
12825
12828 {
12829 float global_health = GetHealth01("","Health");
12830 array<string> zones = new array<string>;
12831 GetDamageZones(zones);
12832
12833 for (int i = 0; i < zones.Count(); i++)
12834 {
12835 SetHealth01(zones.Get(i),"Health",global_health);
12836 }
12837 }
12838
12841 {
12842 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12843 }
12844
12846 {
12847 if (!hasRootAsPlayer)
12848 {
12849 if (refParentIB)
12850 {
12851
12852 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12853 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12854
12855 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12856 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12857
12860 }
12861 else
12862 {
12863
12866 }
12867 }
12868 }
12869
12871 {
12873 {
12874 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12875 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12876 {
12877 float heatPermCoef = 1.0;
12879 while (ent)
12880 {
12881 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12882 ent = ent.GetHierarchyParent();
12883 }
12884
12885 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12886 }
12887 }
12888 }
12889
12891 {
12892
12893 EntityAI parent = GetHierarchyParent();
12894 if (!parent)
12895 {
12896 hasParent = false;
12897 hasRootAsPlayer = false;
12898 }
12899 else
12900 {
12901 hasParent = true;
12902 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12903 refParentIB =
ItemBase.Cast(parent);
12904 }
12905 }
12906
12907 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12908 {
12909
12910 }
12911
12913 {
12914
12915 return false;
12916 }
12917
12919 {
12920
12921
12922 return false;
12923 }
12924
12926 {
12927
12928 return false;
12929 }
12930
12933 {
12934 return !GetIsFrozen() &&
IsOpen();
12935 }
12936
12938 {
12939 bool hasParent = false, hasRootAsPlayer = false;
12941
12942 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12943 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12944
12945 if (wwtu || foodDecay)
12946 {
12950
12951 if (processWetness || processTemperature || processDecay)
12952 {
12954
12955 if (processWetness)
12956 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12957
12958 if (processTemperature)
12960
12961 if (processDecay)
12962 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12963 }
12964 }
12965 }
12966
12969 {
12971 }
12972
12974 {
12977
12978 return super.GetTemperatureFreezeThreshold();
12979 }
12980
12982 {
12985
12986 return super.GetTemperatureThawThreshold();
12987 }
12988
12990 {
12993
12994 return super.GetItemOverheatThreshold();
12995 }
12996
12998 {
13000 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13001
13002 return super.GetTemperatureFreezeTime();
13003 }
13004
13006 {
13008 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13009
13010 return super.GetTemperatureThawTime();
13011 }
13012
13017
13019 {
13020 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13021 }
13022
13024 {
13025 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13026 }
13027
13030 {
13032 }
13033
13035 {
13037 }
13038
13040 {
13042 }
13043
13046 {
13047 return null;
13048 }
13049
13052 {
13053 return false;
13054 }
13055
13057 {
13059 {
13062 if (!trg)
13063 {
13065 explosive = this;
13066 }
13067
13068 explosive.PairRemote(trg);
13070
13071 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13072 trg.SetPersistentPairID(persistentID);
13073 explosive.SetPersistentPairID(persistentID);
13074
13075 return true;
13076 }
13077 return false;
13078 }
13079
13082 {
13083 float ret = 1.0;
13086 ret *= GetHealth01();
13087
13088 return ret;
13089 }
13090
13091 #ifdef DEVELOPER
13092 override void SetDebugItem()
13093 {
13094 super.SetDebugItem();
13095 _itemBase = this;
13096 }
13097
13099 {
13100 string text = super.GetDebugText();
13101
13103 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13104
13105 return text;
13106 }
13107 #endif
13108
13110 {
13111 return true;
13112 }
13113
13115
13117
13119 {
13122 }
13123
13124
13132
13148}
13149
13151{
13153 if (entity)
13154 {
13155 bool is_item = entity.IsInherited(
ItemBase);
13156 if (is_item && full_quantity)
13157 {
13160 }
13161 }
13162 else
13163 {
13165 return NULL;
13166 }
13167 return entity;
13168}
13169
13171{
13172 if (item)
13173 {
13174 if (health > 0)
13175 item.SetHealth("", "", health);
13176
13177 if (item.CanHaveTemperature())
13178 {
13180 if (item.CanFreeze())
13181 item.SetFrozen(false);
13182 }
13183
13184 if (item.HasEnergyManager())
13185 {
13186 if (quantity >= 0)
13187 {
13188 item.GetCompEM().SetEnergy0To1(quantity);
13189 }
13190 else
13191 {
13193 }
13194 }
13195 else if (item.IsMagazine())
13196 {
13197 Magazine mag = Magazine.Cast(item);
13198 if (quantity >= 0)
13199 {
13200 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13201 }
13202 else
13203 {
13205 }
13206
13207 }
13208 else
13209 {
13210 if (quantity >= 0)
13211 {
13212 item.SetQuantityNormalized(quantity, false);
13213 }
13214 else
13215 {
13217 }
13218
13219 }
13220 }
13221}
13222
13223#ifdef DEVELOPER
13225#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
Open
Implementations only.
override void EEOnCECreate()
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 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)
bool ShouldSplitQuantity(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)
override 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...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
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()
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)
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 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 void GizmoSelectObject(Object object)
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 native void GizmoSelectPhysics(Physics physics)
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
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 string GetFoldSoundset()
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 string GetLoopFoldSoundset()
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.