8425{
8427 {
8428 return true;
8429 }
8430};
8431
8432
8433
8435{
8439
8441
8444
8445
8446
8447
8448
8457
8463
8468
8473
8494 protected bool m_IsResultOfSplit
8495
8497
8502
8503
8504
8506
8510
8511
8512
8514
8517
8518
8519
8525
8526
8534
8537
8538
8540
8541
8543
8544
8549
8550
8555
8556
8558
8559
8561 {
8566
8567 if (!
GetGame().IsDedicatedServer())
8568 {
8570 {
8572
8574 {
8576 }
8577 }
8578
8581 }
8582
8583 m_OldLocation = null;
8584
8586 {
8588 }
8589
8590 if (ConfigIsExisting("headSelectionsToHide"))
8591 {
8594 }
8595
8597 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8598 {
8600 }
8601
8603
8604 m_IsResultOfSplit = false;
8605
8607 }
8608
8610 {
8611 super.InitItemVariables();
8612
8618 m_Count = ConfigGetInt(
"count");
8619
8622
8627
8630
8635
8647
8651
8652
8655 if (ConfigIsExisting("canBeSplit"))
8656 {
8659 }
8660
8662 if (ConfigIsExisting("itemBehaviour"))
8664
8665
8668 RegisterNetSyncVariableInt("m_VarLiquidType");
8669 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8670
8671 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8672 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8673 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8674
8675 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8676 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8677 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8678 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8679
8680 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8681 RegisterNetSyncVariableBool("m_IsTakeable");
8682 RegisterNetSyncVariableBool("m_IsHologram");
8683
8686 {
8689 }
8690
8692
8694 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8696
8697 }
8698
8700 {
8702 }
8703
8705 {
8708 {
8713 }
8714 }
8715
8716 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8717 {
8719 {
8722 }
8723
8725 }
8726
8728 {
8734 }
8735
8737
8739 {
8741
8742 if (!action)
8743 {
8744 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8745 return;
8746 }
8747
8749 if (!ai)
8750 {
8752 return;
8753 }
8754
8756 if (!action_array)
8757 {
8758 action_array = new array<ActionBase_Basic>;
8760 }
8761 if (LogManager.IsActionLogEnable())
8762 {
8763 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8764 }
8765
8766 if (action_array.Find(action) != -1)
8767 {
8768 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8769 }
8770 else
8771 {
8772 action_array.Insert(action);
8773 }
8774 }
8775
8777 {
8779 ActionBase action = player.GetActionManager().GetAction(actionName);
8782
8783 if (action_array)
8784 {
8785 action_array.RemoveItem(action);
8786 }
8787 }
8788
8789
8790
8792 {
8793 ActionOverrideData overrideData = new ActionOverrideData();
8797
8799 if (!actionMap)
8800 {
8803 }
8804
8805 actionMap.Insert(this.
Type(), overrideData);
8806
8807 }
8808
8810
8812
8813
8815 {
8818
8821
8822 string config_to_search = "CfgVehicles";
8823 string muzzle_owner_config;
8824
8826 {
8827 if (IsInherited(Weapon))
8828 config_to_search = "CfgWeapons";
8829
8830 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8831
8832 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8833
8835
8836 if (config_OnFire_subclass_count > 0)
8837 {
8838 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8839
8840 for (int i = 0; i < config_OnFire_subclass_count; i++)
8841 {
8842 string particle_class = "";
8844 string config_OnFire_entry = config_OnFire_class + particle_class;
8845 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8846 WPOF_array.Insert(WPOF);
8847 }
8848
8849
8851 }
8852 }
8853
8855 {
8856 config_to_search = "CfgWeapons";
8857 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8858
8859 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8860
8862
8863 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8864 {
8865 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8866
8867 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8868 {
8869 string particle_class2 = "";
8871 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8872 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8873 WPOBE_array.Insert(WPOBE);
8874 }
8875
8876
8878 }
8879 }
8880 }
8881
8882
8884 {
8887
8889 {
8890 string config_to_search = "CfgVehicles";
8891
8892 if (IsInherited(Weapon))
8893 config_to_search = "CfgWeapons";
8894
8895 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8896 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8897
8898 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8899 {
8900
8902
8904 {
8906 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8908 return;
8909 }
8910
8913
8914
8915
8917 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8918
8919 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8920 {
8921 string particle_class = "";
8923 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8925
8926 if (entry_type == CT_CLASS)
8927 {
8928 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8929 WPOOH_array.Insert(WPOF);
8930 }
8931 }
8932
8933
8935 }
8936 }
8937 }
8938
8940 {
8942 }
8943
8945 {
8947 {
8949
8952
8955
8956 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8957 }
8958 }
8959
8961 {
8963 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8964
8966 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8967
8969 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8970
8972 {
8974 }
8975 }
8976
8978 {
8980 }
8981
8983 {
8986 else
8988
8990 {
8993 }
8994 else
8995 {
8998
9001 }
9002
9004 }
9005
9007 {
9009 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9010 }
9011
9013 {
9015 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9017 }
9018
9020 {
9022 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9023 }
9024
9026 {
9029
9030 OverheatingParticle OP = new OverheatingParticle();
9035
9037 }
9038
9040 {
9043
9044 return -1;
9045 }
9046
9048 {
9050 {
9053
9054 for (int i = count; i > 0; --i)
9055 {
9056 int id = i - 1;
9059
9062
9063 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9064 {
9065 if (p)
9066 {
9069 }
9070 }
9071 }
9072 }
9073 }
9074
9076 {
9078 {
9080 {
9081 int id = i - 1;
9083
9084 if (OP)
9085 {
9087
9088 if (p)
9089 {
9091 }
9092
9093 delete OP;
9094 }
9095 }
9096
9099 }
9100 }
9101
9104 {
9105 return 0.0;
9106 }
9107
9108
9110 {
9111 return 250;
9112 }
9113
9115 {
9116 return 0;
9117 }
9118
9121 {
9123 return true;
9124
9125 return false;
9126 }
9127
9130 {
9133
9135 {
9137 }
9138 else
9139 {
9140
9142 }
9143
9145 }
9146
9153 {
9154 return -1;
9155 }
9156
9157
9158
9159
9161 {
9163 {
9165 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9166
9167 if (r_index >= 0)
9168 {
9169 InventoryLocation r_il = new InventoryLocation;
9170 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9171
9172 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9175 {
9176 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9177 }
9179 {
9180 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9181 }
9182
9183 }
9184
9185 player.GetHumanInventory().ClearUserReservedLocation(this);
9186 }
9187
9190 }
9191
9192
9193
9194
9196 {
9197 return ItemBase.m_DebugActionsMask;
9198 }
9199
9201 {
9202 return ItemBase.m_DebugActionsMask & mask;
9203 }
9204
9206 {
9207 ItemBase.m_DebugActionsMask = mask;
9208 }
9209
9211 {
9212 ItemBase.m_DebugActionsMask |= mask;
9213 }
9214
9216 {
9217 ItemBase.m_DebugActionsMask &= ~mask;
9218 }
9219
9221 {
9223 {
9225 }
9226 else
9227 {
9229 }
9230 }
9231
9232
9234 {
9235 if (GetEconomyProfile())
9236 {
9237 float q_max = GetEconomyProfile().GetQuantityMax();
9238 if (q_max > 0)
9239 {
9240 float q_min = GetEconomyProfile().GetQuantityMin();
9241 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9242
9244 {
9245 ComponentEnergyManager comp = GetCompEM();
9247 {
9249 }
9250 }
9252 {
9254
9255 }
9256
9257 }
9258 }
9259 }
9260
9263 {
9264 EntityAI parent = GetHierarchyParent();
9265
9266 if (parent)
9267 {
9268 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9269 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9270 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9271 }
9272 }
9273
9276 {
9277 EntityAI parent = GetHierarchyParent();
9278
9279 if (parent)
9280 {
9281 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9282 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9283 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9284 }
9285 }
9286
9288 {
9289
9290
9291
9292
9294
9296 {
9297 if (ScriptInputUserData.CanStoreInputUserData())
9298 {
9299 ScriptInputUserData ctx = new ScriptInputUserData;
9305 ctx.
Write(use_stack_max);
9308
9310 {
9311 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9312 }
9313 }
9314 }
9315 else if (!
GetGame().IsMultiplayer())
9316 {
9318 }
9319 }
9320
9322 {
9324 }
9325
9327 {
9329 }
9330
9332 {
9334 }
9335
9337 {
9338
9339 return false;
9340 }
9341
9343 {
9344 return false;
9345 }
9346
9350 {
9351 return false;
9352 }
9353
9355 {
9356 return "";
9357 }
9358
9360
9362 {
9363 return false;
9364 }
9365
9367 {
9368 return true;
9369 }
9370
9371
9372
9374 {
9375 return true;
9376 }
9377
9379 {
9380 return true;
9381 }
9382
9384 {
9385 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9387 }
9388
9390 {
9392 }
9393
9395 {
9397 if (!is_being_placed)
9399 SetSynchDirty();
9400 }
9401
9402
9404
9406 {
9408 }
9409
9411 {
9413 }
9414
9416 {
9417 return 1;
9418 }
9419
9421 {
9422 return false;
9423 }
9424
9426 {
9428 SetSynchDirty();
9429 }
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9466 {
9467 super.OnMovedInsideCargo(container);
9468
9469 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9470 }
9471
9472 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9473 {
9474 super.EEItemLocationChanged(oldLoc,newLoc);
9475
9476 PlayerBase new_player = null;
9477 PlayerBase old_player = null;
9478
9479 if (newLoc.GetParent())
9480 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9481
9482 if (oldLoc.GetParent())
9483 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9484
9486 {
9487 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9488
9489 if (r_index >= 0)
9490 {
9491 InventoryLocation r_il = new InventoryLocation;
9492 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9493
9494 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9497 {
9498 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9499 }
9501 {
9502 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9503 }
9504
9505 }
9506 }
9507
9509 {
9510 if (new_player)
9511 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9512
9513 if (new_player == old_player)
9514 {
9515
9516 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9517 {
9519 {
9520 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9521 {
9522 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9523 }
9524 }
9525 else
9526 {
9527 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9528 }
9529 }
9530
9531 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9532 {
9533 int type = oldLoc.GetType();
9535 {
9536 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9537 }
9539 {
9540 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9541 }
9542 }
9543 if (!m_OldLocation)
9544 {
9545 m_OldLocation = new InventoryLocation;
9546 }
9547 m_OldLocation.Copy(oldLoc);
9548 }
9549 else
9550 {
9551 if (m_OldLocation)
9552 {
9553 m_OldLocation.Reset();
9554 }
9555 }
9556
9558 }
9559 else
9560 {
9561 if (new_player)
9562 {
9563 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9564 if (res_index >= 0)
9565 {
9566 InventoryLocation il = new InventoryLocation;
9567 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9569 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9572 {
9573 il.
GetParent().GetOnReleaseLock().Invoke(it);
9574 }
9576 {
9578 }
9579
9580 }
9581 }
9583 {
9584
9586 }
9587
9588 if (m_OldLocation)
9589 {
9590 m_OldLocation.Reset();
9591 }
9592 }
9593 }
9594
9595 override void EOnContact(IEntity other, Contact extra)
9596 {
9598 {
9599 int liquidType = -1;
9601 if (impactSpeed > 0.0)
9602 {
9604 #ifndef SERVER
9606 #else
9608 SetSynchDirty();
9609 #endif
9611 }
9612 }
9613
9614 #ifdef SERVER
9615 if (GetCompEM() && GetCompEM().IsPlugged())
9616 {
9617 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9618 GetCompEM().UnplugThis();
9619 }
9620 #endif
9621 }
9622
9624
9626 {
9628 }
9629
9631 {
9632
9633 }
9634
9636 {
9637 super.OnItemLocationChanged(old_owner, new_owner);
9638
9639 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9640 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9641
9642 if (!relatedPlayer && playerNew)
9643 relatedPlayer = playerNew;
9644
9645 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9646 {
9648 if (actionMgr)
9649 {
9650 ActionBase currentAction = actionMgr.GetRunningAction();
9651 if (currentAction)
9653 }
9654 }
9655
9656 Man ownerPlayerOld = null;
9657 Man ownerPlayerNew = null;
9658
9659 if (old_owner)
9660 {
9661 if (old_owner.
IsMan())
9662 {
9663 ownerPlayerOld = Man.Cast(old_owner);
9664 }
9665 else
9666 {
9667 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9668 }
9669 }
9670 else
9671 {
9673 {
9675
9676 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9677 {
9678 GetCompEM().UnplugThis();
9679 }
9680 }
9681 }
9682
9683 if (new_owner)
9684 {
9685 if (new_owner.
IsMan())
9686 {
9687 ownerPlayerNew = Man.Cast(new_owner);
9688 }
9689 else
9690 {
9691 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9692 }
9693 }
9694
9695 if (ownerPlayerOld != ownerPlayerNew)
9696 {
9697 if (ownerPlayerOld)
9698 {
9699 array<EntityAI> subItemsExit = new array<EntityAI>;
9701 for (int i = 0; i < subItemsExit.Count(); i++)
9702 {
9705 }
9706 }
9707
9708 if (ownerPlayerNew)
9709 {
9710 array<EntityAI> subItemsEnter = new array<EntityAI>;
9712 for (int j = 0; j < subItemsEnter.Count(); j++)
9713 {
9716 }
9717 }
9718 }
9719 else if (ownerPlayerNew != null)
9720 {
9721 PlayerBase nplayer;
9722 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9723 {
9724 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9726 for (int k = 0; k < subItemsUpdate.Count(); k++)
9727 {
9729 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9730 }
9731 }
9732 }
9733
9734 if (old_owner)
9735 old_owner.OnChildItemRemoved(this);
9736 if (new_owner)
9737 new_owner.OnChildItemReceived(this);
9738 }
9739
9740
9742 {
9743 super.EEDelete(parent);
9744 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9745 if (player)
9746 {
9748
9749 if (player.IsAlive())
9750 {
9751 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9752 if (r_index >= 0)
9753 {
9754 InventoryLocation r_il = new InventoryLocation;
9755 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9756
9757 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9760 {
9761 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9762 }
9764 {
9765 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9766 }
9767
9768 }
9769
9770 player.RemoveQuickBarEntityShortcut(this);
9771 }
9772 }
9773 }
9774
9776 {
9777 super.EEKilled(killer);
9778
9781 {
9782 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9783 {
9784 if (IsMagazine())
9785 {
9786 if (Magazine.Cast(this).GetAmmoCount() > 0)
9787 {
9789 }
9790 }
9791 else
9792 {
9794 }
9795 }
9796 }
9797 }
9798
9800 {
9801 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9802
9803 super.OnWasAttached(parent, slot_id);
9804
9807
9809 }
9810
9812 {
9813 super.OnWasDetached(parent, slot_id);
9814
9817 }
9818
9820 {
9821 int idx;
9824
9825 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9826 if (inventory_slots.Count() < 1)
9827 {
9828 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9829 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9830 }
9831 else
9832 {
9833 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9834 }
9835
9836 idx = inventory_slots.Find(slot);
9837 if (idx < 0)
9838 return "";
9839
9840 return attach_types.Get(idx);
9841 }
9842
9844 {
9845 int idx = -1;
9846 string slot;
9847
9850
9851 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9852 if (inventory_slots.Count() < 1)
9853 {
9854 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9855 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9856 }
9857 else
9858 {
9859 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9860 if (detach_types.Count() < 1)
9861 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9862 }
9863
9864 for (int i = 0; i < inventory_slots.Count(); i++)
9865 {
9866 slot = inventory_slots.Get(i);
9867 }
9868
9869 if (slot != "")
9870 {
9871 if (detach_types.Count() == 1)
9872 idx = 0;
9873 else
9874 idx = inventory_slots.Find(slot);
9875 }
9876 if (idx < 0)
9877 return "";
9878
9879 return detach_types.Get(idx);
9880 }
9881
9883 {
9884
9886
9887
9888 float min_time = 1;
9889 float max_time = 3;
9890 float delay = Math.RandomFloat(min_time, max_time);
9891
9892 explode_timer.Run(delay, this, "DoAmmoExplosion");
9893 }
9894
9896 {
9897 Magazine magazine = Magazine.Cast(this);
9898 int pop_sounds_count = 6;
9899 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9900
9901
9902 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9903 string sound_name = pop_sounds[ sound_idx ];
9905
9906
9907 magazine.ServerAddAmmoCount(-1);
9908
9909
9910 float min_temp_to_explode = 100;
9911
9912 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9913 {
9915 }
9916 }
9917
9918
9919 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9920 {
9921 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9922
9923 const int CHANCE_DAMAGE_CARGO = 4;
9924 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9925 const int CHANCE_DAMAGE_NOTHING = 2;
9926
9928 {
9929 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9930 int chances;
9931 int rnd;
9932
9933 if (GetInventory().GetCargo())
9934 {
9935 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9936 rnd = Math.RandomInt(0,chances);
9937
9938 if (rnd < CHANCE_DAMAGE_CARGO)
9939 {
9941 }
9942 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9943 {
9945 }
9946 }
9947 else
9948 {
9949 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9950 rnd = Math.RandomInt(0,chances);
9951
9952 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9953 {
9955 }
9956 }
9957 }
9958 }
9959
9961 {
9962 if (GetInventory().GetCargo())
9963 {
9964 int item_count = GetInventory().GetCargo().GetItemCount();
9965 if (item_count > 0)
9966 {
9967 int random_pick = Math.RandomInt(0, item_count);
9969 if (!item.IsExplosive())
9970 {
9971 item.AddHealth("","",damage);
9972 return true;
9973 }
9974 }
9975 }
9976 return false;
9977 }
9978
9980 {
9981 int attachment_count = GetInventory().AttachmentCount();
9982 if (attachment_count > 0)
9983 {
9984 int random_pick = Math.RandomInt(0, attachment_count);
9985 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9986 if (!attachment.IsExplosive())
9987 {
9988 attachment.AddHealth("","",damage);
9989 return true;
9990 }
9991 }
9992 return false;
9993 }
9994
9996 {
9998 }
9999
10001 {
10003 return GetInventory().CanRemoveEntity();
10004
10005 return false;
10006 }
10007
10009 {
10011 return;
10012
10014 {
10015 if (ScriptInputUserData.CanStoreInputUserData())
10016 {
10017 ScriptInputUserData ctx = new ScriptInputUserData;
10022 ctx.
Write(destination_entity);
10024 ctx.
Write(slot_id);
10026 }
10027 }
10028 else if (!
GetGame().IsMultiplayer())
10029 {
10031 }
10032 }
10033
10035 {
10037 return;
10038
10039 float split_quantity_new;
10043 InventoryLocation loc = new InventoryLocation;
10044
10045 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10046 {
10048 split_quantity_new = stack_max;
10049 else
10051
10052 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10053 if (new_item)
10054 {
10055 new_item.SetResultOfSplit(true);
10056 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10058 new_item.SetQuantity(split_quantity_new);
10059 }
10060 }
10061 else if (destination_entity && slot_id == -1)
10062 {
10063 if (quantity > stack_max)
10064 split_quantity_new = stack_max;
10065 else
10066 split_quantity_new = quantity;
10067
10069 {
10072 }
10073
10074 if (new_item)
10075 {
10076 new_item.SetResultOfSplit(true);
10077 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10079 new_item.SetQuantity(split_quantity_new);
10080 }
10081 }
10082 else
10083 {
10084 if (stack_max != 0)
10085 {
10087 {
10089 }
10090
10091 if (split_quantity_new == 0)
10092 {
10093 if (!
GetGame().IsMultiplayer())
10094 player.PhysicalPredictiveDropItem(this);
10095 else
10096 player.ServerDropEntity(this);
10097 return;
10098 }
10099
10101
10102 if (new_item)
10103 {
10104 new_item.SetResultOfSplit(true);
10105 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10107 new_item.SetQuantity(stack_max);
10108 new_item.PlaceOnSurface();
10109 }
10110 }
10111 }
10112 }
10113
10115 {
10117 return;
10118
10119 float split_quantity_new;
10123 InventoryLocation loc = new InventoryLocation;
10124
10125 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10126 {
10128 split_quantity_new = stack_max;
10129 else
10131
10132 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10133 if (new_item)
10134 {
10135 new_item.SetResultOfSplit(true);
10136 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10138 new_item.SetQuantity(split_quantity_new);
10139 }
10140 }
10141 else if (destination_entity && slot_id == -1)
10142 {
10143 if (quantity > stack_max)
10144 split_quantity_new = stack_max;
10145 else
10146 split_quantity_new = quantity;
10147
10149 {
10152 }
10153
10154 if (new_item)
10155 {
10156 new_item.SetResultOfSplit(true);
10157 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10159 new_item.SetQuantity(split_quantity_new);
10160 }
10161 }
10162 else
10163 {
10164 if (stack_max != 0)
10165 {
10167 {
10169 }
10170
10172
10173 if (new_item)
10174 {
10175 new_item.SetResultOfSplit(true);
10176 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10178 new_item.SetQuantity(stack_max);
10179 new_item.PlaceOnSurface();
10180 }
10181 }
10182 }
10183 }
10184
10186 {
10188 return;
10189
10191 {
10192 if (ScriptInputUserData.CanStoreInputUserData())
10193 {
10194 ScriptInputUserData ctx = new ScriptInputUserData;
10199 dst.WriteToContext(ctx);
10201 }
10202 }
10203 else if (!
GetGame().IsMultiplayer())
10204 {
10206 }
10207 }
10208
10210 {
10212 return;
10213
10215 {
10216 if (ScriptInputUserData.CanStoreInputUserData())
10217 {
10218 ScriptInputUserData ctx = new ScriptInputUserData;
10223 ctx.
Write(destination_entity);
10229 }
10230 }
10231 else if (!
GetGame().IsMultiplayer())
10232 {
10234 }
10235 }
10236
10238 {
10240 }
10241
10243 {
10245 return this;
10246
10248 float split_quantity_new;
10250 if (dst.IsValid())
10251 {
10252 int slot_id = dst.GetSlot();
10254
10255 if (quantity > stack_max)
10256 split_quantity_new = stack_max;
10257 else
10258 split_quantity_new = quantity;
10259
10261
10262 if (new_item)
10263 {
10264 new_item.SetResultOfSplit(true);
10265 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10268 }
10269
10270 return new_item;
10271 }
10272
10273 return null;
10274 }
10275
10277 {
10279 return;
10280
10282 float split_quantity_new;
10284 if (destination_entity)
10285 {
10287 if (quantity > stackable)
10288 split_quantity_new = stackable;
10289 else
10290 split_quantity_new = quantity;
10291
10292 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10293 if (new_item)
10294 {
10295 new_item.SetResultOfSplit(true);
10296 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10298 new_item.SetQuantity(split_quantity_new);
10299 }
10300 }
10301 }
10302
10304 {
10306 return;
10307
10309 {
10310 if (ScriptInputUserData.CanStoreInputUserData())
10311 {
10312 ScriptInputUserData ctx = new ScriptInputUserData;
10317 ItemBase destination_entity =
this;
10318 ctx.
Write(destination_entity);
10322 }
10323 }
10324 else if (!
GetGame().IsMultiplayer())
10325 {
10327 }
10328 }
10329
10331 {
10333 return;
10334
10336 float split_quantity_new;
10338 if (player)
10339 {
10341 if (quantity > stackable)
10342 split_quantity_new = stackable;
10343 else
10344 split_quantity_new = quantity;
10345
10346 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10347 new_item =
ItemBase.Cast(in_hands);
10348 if (new_item)
10349 {
10350 new_item.SetResultOfSplit(true);
10351 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10353 new_item.SetQuantity(split_quantity_new);
10354 }
10355 }
10356 }
10357
10359 {
10361 return;
10362
10364 float split_quantity_new = Math.Floor(quantity * 0.5);
10365
10367
10368 if (new_item)
10369 {
10370 if (new_item.GetQuantityMax() < split_quantity_new)
10371 {
10372 split_quantity_new = new_item.GetQuantityMax();
10373 }
10374
10375 new_item.SetResultOfSplit(true);
10376 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10377
10379 {
10382 }
10383 else
10384 {
10387 }
10388 }
10389 }
10390
10392 {
10394 return;
10395
10397 float split_quantity_new = Math.Floor(quantity / 2);
10398
10399 InventoryLocation invloc = new InventoryLocation;
10401
10403 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10404
10405 if (new_item)
10406 {
10407 if (new_item.GetQuantityMax() < split_quantity_new)
10408 {
10409 split_quantity_new = new_item.GetQuantityMax();
10410 }
10412 {
10415 }
10416 else
10417 {
10420 }
10421 }
10422 }
10423
10426 {
10427 SetWeightDirty();
10429
10430 if (parent)
10431 parent.OnAttachmentQuantityChangedEx(this, delta);
10432
10434 {
10436 {
10438 }
10440 {
10441 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10443 }
10444 }
10445
10446 }
10447
10450 {
10451
10452 }
10453
10456 {
10458 }
10459
10461 {
10462 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10463
10465 {
10466 if (newLevel == GameConstants.STATE_RUINED)
10467 {
10469 EntityAI parent = GetHierarchyParent();
10470 if (parent && parent.IsFireplace())
10471 {
10472 CargoBase cargo = GetInventory().GetCargo();
10473 if (cargo)
10474 {
10476 {
10478 }
10479 }
10480 }
10481 }
10482
10484 {
10485
10487 return;
10488 }
10489
10490 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10491 {
10493 }
10494 }
10495 }
10496
10497
10499 {
10500 super.OnRightClick();
10501
10503 {
10505 {
10506 if (ScriptInputUserData.CanStoreInputUserData())
10507 {
10508 vector m4[4];
10510
10511 EntityAI root = GetHierarchyRoot();
10512
10513 InventoryLocation dst = new InventoryLocation;
10515 {
10516 if (root)
10517 {
10518 root.GetTransform(m4);
10520 }
10521 else
10522 GetInventory().GetCurrentInventoryLocation(dst);
10523 }
10524 else
10525 {
10527
10528
10529 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10530 {
10531 if (root)
10532 {
10533 root.GetTransform(m4);
10535 }
10536 else
10537 GetInventory().GetCurrentInventoryLocation(dst);
10538 }
10539 else
10540 {
10541 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10542 }
10543 }
10544
10545 ScriptInputUserData ctx = new ScriptInputUserData;
10553 }
10554 }
10555 else if (!
GetGame().IsMultiplayer())
10556 {
10558 }
10559 }
10560 }
10561
10562 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10563 {
10564
10565 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10566 return false;
10567
10568 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10569 return false;
10570
10571
10573 return false;
10574
10575
10576 Magazine mag = Magazine.Cast(this);
10577 if (mag)
10578 {
10579 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10580 return false;
10581
10582 if (stack_max_limit)
10583 {
10584 Magazine other_mag = Magazine.Cast(other_item);
10585 if (other_item)
10586 {
10587 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10588 return false;
10589 }
10590
10591 }
10592 }
10593 else
10594 {
10595
10597 return false;
10598
10600 return false;
10601 }
10602
10603 PlayerBase player = null;
10604 if (CastTo(player, GetHierarchyRootPlayer()))
10605 {
10606 if (player.GetInventory().HasAttachment(this))
10607 return false;
10608
10609 if (player.IsItemsToDelete())
10610 return false;
10611 }
10612
10613 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10614 return false;
10615
10616 int slotID;
10618 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10619 return false;
10620
10621 return true;
10622 }
10623
10625 {
10627 }
10628
10630 {
10631 return m_IsResultOfSplit;
10632 }
10633
10635 {
10636 m_IsResultOfSplit = value;
10637 }
10638
10640 {
10642 }
10643
10645 {
10646 float other_item_quantity = other_item.GetQuantity();
10647 float this_free_space;
10648
10650
10652
10653 if (other_item_quantity > this_free_space)
10654 {
10655 return this_free_space;
10656 }
10657 else
10658 {
10659 return other_item_quantity;
10660 }
10661 }
10662
10664 {
10666 }
10667
10669 {
10671 return;
10672
10673 if (!IsMagazine() && other_item)
10674 {
10676 if (quantity_used != 0)
10677 {
10678 float hp1 = GetHealth01("","");
10679 float hp2 = other_item.GetHealth01("","");
10680 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10681 hpResult = hpResult / (
GetQuantity() + quantity_used);
10682
10683 hpResult *= GetMaxHealth();
10684 Math.Round(hpResult);
10685 SetHealth("", "Health", hpResult);
10686
10688 other_item.AddQuantity(-quantity_used);
10689 }
10690 }
10692 }
10693
10695 {
10696 #ifdef SERVER
10697 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10698 GetHierarchyParent().IncreaseLifetimeUp();
10699 #endif
10700 };
10701
10703 {
10704 PlayerBase p = PlayerBase.Cast(player);
10705
10706 array<int> recipesIds = p.m_Recipes;
10707 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10708 if (moduleRecipesManager)
10709 {
10710 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10711 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10712 }
10713
10714 for (int i = 0;i < recipesIds.Count(); i++)
10715 {
10716 int key = recipesIds.Get(i);
10717 string recipeName = moduleRecipesManager.GetRecipeName(key);
10719 }
10720 }
10721
10722
10723 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10724 {
10725 super.GetDebugActions(outputList);
10726
10727
10732
10733
10737
10741
10742
10745
10746
10748 {
10751 }
10752
10754
10757
10761 }
10762
10763
10764
10765
10767 {
10768 super.OnAction(action_id, player, ctx);
10769 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10770 {
10771 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10772 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10773 PlayerBase p = PlayerBase.Cast(player);
10774 if (
EActions.RECIPES_RANGE_START < 1000)
10775 {
10776 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10777 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10778 }
10779 }
10780 #ifndef SERVER
10781 else if (action_id ==
EActions.WATCH_PLAYER)
10782 {
10783 PluginDeveloper.SetDeveloperItemClientEx(player);
10784 }
10785 #endif
10787 {
10788 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10789 {
10790 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10791 OnDebugButtonPressServer(id + 1);
10792 }
10793
10794 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10795 {
10796 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10798 }
10799
10800 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10801 {
10802 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10804 }
10805
10806 else if (action_id ==
EActions.ADD_QUANTITY)
10807 {
10808 if (IsMagazine())
10809 {
10810 Magazine mag = Magazine.Cast(this);
10811 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10812 }
10813 else
10814 {
10816 }
10817
10818 if (m_EM)
10819 {
10820 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10821 }
10822
10823 }
10824
10825 else if (action_id ==
EActions.REMOVE_QUANTITY)
10826 {
10827 if (IsMagazine())
10828 {
10829 Magazine mag2 = Magazine.Cast(this);
10830 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10831 }
10832 else
10833 {
10835 }
10836 if (m_EM)
10837 {
10838 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10839 }
10840
10841 }
10842
10843 else if (action_id ==
EActions.SET_QUANTITY_0)
10844 {
10846
10847 if (m_EM)
10848 {
10849 m_EM.SetEnergy(0);
10850 }
10851 }
10852
10853 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10854 {
10856
10857 if (m_EM)
10858 {
10859 m_EM.SetEnergy(m_EM.GetEnergyMax());
10860 }
10861 }
10862
10863 else if (action_id ==
EActions.ADD_HEALTH)
10864 {
10865 AddHealth("","",GetMaxHealth("","Health")/5);
10866 }
10867 else if (action_id ==
EActions.REMOVE_HEALTH)
10868 {
10869 AddHealth("","",-GetMaxHealth("","Health")/5);
10870 }
10871 else if (action_id ==
EActions.DESTROY_HEALTH)
10872 {
10873 SetHealth01("","",0);
10874 }
10875 else if (action_id ==
EActions.WATCH_ITEM)
10876 {
10878 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10879 #ifdef DEVELOPER
10880 SetDebugDeveloper_item(this);
10881 #endif
10882 }
10883
10884 else if (action_id ==
EActions.ADD_TEMPERATURE)
10885 {
10886 AddTemperature(20);
10887
10888 }
10889
10890 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10891 {
10892 AddTemperature(-20);
10893
10894 }
10895
10896 else if (action_id ==
EActions.FLIP_FROZEN)
10897 {
10898 SetFrozen(!GetIsFrozen());
10899
10900 }
10901
10902 else if (action_id ==
EActions.ADD_WETNESS)
10903 {
10905
10906 }
10907
10908 else if (action_id ==
EActions.REMOVE_WETNESS)
10909 {
10911
10912 }
10913
10914 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10915 {
10918
10919
10920 }
10921
10922 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10923 {
10926 }
10927
10928 else if (action_id ==
EActions.MAKE_SPECIAL)
10929 {
10930 auto debugParams = DebugSpawnParams.WithPlayer(player);
10931 OnDebugSpawnEx(debugParams);
10932 }
10933
10934 else if (action_id ==
EActions.DELETE)
10935 {
10936 Delete();
10937 }
10938
10939 }
10940
10941
10942 return false;
10943 }
10944
10945
10946
10947
10951
10954
10955
10956
10958 {
10959 return false;
10960 }
10961
10962
10964 {
10965 return true;
10966 }
10967
10968
10970 {
10971 return true;
10972 }
10973
10974
10975
10977 {
10978 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10980 }
10981
10984 {
10985 return null;
10986 }
10987
10989 {
10990 return false;
10991 }
10992
10994 {
10995 return false;
10996 }
10997
11001
11002
11004 {
11005 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11006 return module_repairing.CanRepair(this, item_repair_kit);
11007 }
11008
11009
11010 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11011 {
11012 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11013 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11014 }
11015
11016
11018 {
11019
11020
11021
11022
11023
11024
11025
11026
11027 return 1;
11028 }
11029
11030
11031
11033 {
11035 }
11036
11037
11038
11040 {
11042 }
11043
11044
11053 {
11054 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11055
11056 if (player)
11057 {
11058 player.MessageStatus(text);
11059 }
11060 }
11061
11062
11071 {
11072 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11073
11074 if (player)
11075 {
11076 player.MessageAction(text);
11077 }
11078 }
11079
11080
11089 {
11090 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11091
11092 if (player)
11093 {
11094 player.MessageFriendly(text);
11095 }
11096 }
11097
11098
11107 {
11108 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11109
11110 if (player)
11111 {
11112 player.MessageImportant(text);
11113 }
11114 }
11115
11117 {
11118 return true;
11119 }
11120
11121
11122 override bool KindOf(
string tag)
11123 {
11124 bool found = false;
11125 string item_name = this.
GetType();
11128
11129 int array_size = item_tag_array.Count();
11130 for (int i = 0; i < array_size; i++)
11131 {
11132 if (item_tag_array.Get(i) == tag)
11133 {
11134 found = true;
11135 break;
11136 }
11137 }
11138 return found;
11139 }
11140
11141
11143 {
11144
11145 super.OnRPC(sender, rpc_type,ctx);
11146
11147
11148 switch (rpc_type)
11149 {
11150 #ifndef SERVER
11151 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11152 Param2<bool, string> p = new Param2<bool, string>(false, "");
11153
11155 return;
11156
11157 bool play = p.param1;
11158 string soundSet = p.param2;
11159
11160 if (play)
11161 {
11163 {
11165 {
11167 }
11168 }
11169 else
11170 {
11172 }
11173 }
11174 else
11175 {
11177 }
11178
11179 break;
11180 #endif
11181
11182 }
11183
11185 {
11187 }
11188 }
11189
11190
11191
11192
11194 {
11195 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11196 return plugin.GetID(
name);
11197 }
11198
11200 {
11201 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11202 return plugin.GetName(id);
11203 }
11204
11207 {
11208
11209
11210 int varFlags;
11211 if (!ctx.
Read(varFlags))
11212 return;
11213
11214 if (varFlags & ItemVariableFlags.FLOAT)
11215 {
11217 }
11218 }
11219
11221 {
11222
11223 super.SerializeNumericalVars(floats_out);
11224
11225
11226
11228 {
11230 }
11231
11233 {
11235 }
11236
11238 {
11240 }
11241
11243 {
11248 }
11249
11251 {
11253 }
11254 }
11255
11257 {
11258
11259 super.DeSerializeNumericalVars(floats);
11260
11261
11262 int index = 0;
11263 int mask = Math.Round(floats.Get(index));
11264
11265 index++;
11266
11268 {
11270 {
11272 }
11273 else
11274 {
11275 float quantity = floats.Get(index);
11276 SetQuantity(quantity,
true,
false,
false,
false);
11277 }
11278 index++;
11279 }
11280
11282 {
11283 float wet = floats.Get(index);
11285 index++;
11286 }
11287
11289 {
11290 int liquidtype = Math.Round(floats.Get(index));
11292 index++;
11293 }
11294
11296 {
11298 index++;
11300 index++;
11302 index++;
11304 index++;
11305 }
11306
11308 {
11309 int cleanness = Math.Round(floats.Get(index));
11311 index++;
11312 }
11313 }
11314
11316 {
11317 super.WriteVarsToCTX(ctx);
11318
11319
11321 {
11323 }
11324
11326 {
11328 }
11329
11331 {
11333 }
11334
11336 {
11337 int r,g,b,a;
11343 }
11344
11346 {
11348 }
11349 }
11350
11352 {
11353 if (!super.ReadVarsFromCTX(ctx,version))
11354 return false;
11355
11356 int intValue;
11357 float value;
11358
11359 if (version < 140)
11360 {
11361 if (!ctx.
Read(intValue))
11362 return false;
11363
11364 m_VariablesMask = intValue;
11365 }
11366
11368 {
11369 if (!ctx.
Read(value))
11370 return false;
11371
11373 {
11375 }
11376 else
11377 {
11379 }
11380 }
11381
11382 if (version < 140)
11383 {
11385 {
11386 if (!ctx.
Read(value))
11387 return false;
11388 SetTemperatureDirect(value);
11389 }
11390 }
11391
11393 {
11394 if (!ctx.
Read(value))
11395 return false;
11397 }
11398
11400 {
11401 if (!ctx.
Read(intValue))
11402 return false;
11404 }
11405
11407 {
11408 int r,g,b,a;
11410 return false;
11412 return false;
11414 return false;
11416 return false;
11417
11419 }
11420
11422 {
11423 if (!ctx.
Read(intValue))
11424 return false;
11426 }
11427
11428 if (version >= 138 && version < 140)
11429 {
11431 {
11432 if (!ctx.
Read(intValue))
11433 return false;
11434 SetFrozen(intValue);
11435 }
11436 }
11437
11438 return true;
11439 }
11440
11441
11443 {
11446 {
11448 }
11449
11450 if (!super.OnStoreLoad(ctx, version))
11451 {
11453 return false;
11454 }
11455
11456 if (version >= 114)
11457 {
11458 bool hasQuickBarIndexSaved;
11459
11460 if (!ctx.
Read(hasQuickBarIndexSaved))
11461 {
11463 return false;
11464 }
11465
11466 if (hasQuickBarIndexSaved)
11467 {
11468 int itmQBIndex;
11469
11470
11471 if (!ctx.
Read(itmQBIndex))
11472 {
11474 return false;
11475 }
11476
11477 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11478 if (itmQBIndex != -1 && parentPlayer)
11479 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11480 }
11481 }
11482 else
11483 {
11484
11485 PlayerBase player;
11486 int itemQBIndex;
11487 if (version ==
int.
MAX)
11488 {
11489 if (!ctx.
Read(itemQBIndex))
11490 {
11492 return false;
11493 }
11494 }
11495 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11496 {
11497
11498 if (!ctx.
Read(itemQBIndex))
11499 {
11501 return false;
11502 }
11503 if (itemQBIndex != -1 && player)
11504 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11505 }
11506 }
11507
11508 if (version < 140)
11509 {
11510
11511 if (!LoadVariables(ctx, version))
11512 {
11514 return false;
11515 }
11516 }
11517
11518
11520 {
11522 return false;
11523 }
11524 if (version >= 132)
11525 {
11527 if (raib)
11528 {
11530 {
11532 return false;
11533 }
11534 }
11535 }
11536
11538 return true;
11539 }
11540
11541
11542
11544 {
11545 super.OnStoreSave(ctx);
11546
11547 PlayerBase player;
11548 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11549 {
11551
11552 int itemQBIndex = -1;
11553 itemQBIndex = player.FindQuickBarEntityIndex(this);
11554 ctx.
Write(itemQBIndex);
11555 }
11556 else
11557 {
11559 }
11560
11562
11564 if (raib)
11565 {
11567 }
11568 }
11569
11570
11572 {
11573 super.AfterStoreLoad();
11574
11576 {
11578 }
11579
11581 {
11584 }
11585 }
11586
11588 {
11589 super.EEOnAfterLoad();
11590
11592 {
11594 }
11595
11598 }
11599
11601 {
11602 return false;
11603 }
11604
11605
11606
11608 {
11610 {
11611 #ifdef PLATFORM_CONSOLE
11612
11614 {
11616 if (menu)
11617 {
11619 }
11620 }
11621 #endif
11622 }
11623
11625 {
11628 }
11629
11631 {
11632 SetWeightDirty();
11634 }
11636 {
11639 }
11640
11642 {
11645 }
11647 {
11650 }
11651
11652 super.OnVariablesSynchronized();
11653 }
11654
11655
11656
11658 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11659 {
11660 if (!IsServerCheck(allow_client))
11661 return false;
11662
11664 return false;
11665
11668
11669 if (value <= (min + 0.001))
11670 value = min;
11671
11672 if (value == min)
11673 {
11674 if (destroy_config)
11675 {
11676 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11677 if (dstr)
11678 {
11680 this.Delete();
11681 return true;
11682 }
11683 }
11684 else if (destroy_forced)
11685 {
11687 this.Delete();
11688 return true;
11689 }
11690
11692 }
11693
11696
11698 {
11700
11701 if (delta)
11703 }
11704
11706
11707 return false;
11708 }
11709
11710
11712 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11713 {
11715 }
11716
11718 {
11721 }
11722
11724 {
11727 }
11728
11731 {
11732 float value_clamped = Math.Clamp(value, 0, 1);
11734 SetQuantity(result, destroy_config, destroy_forced);
11735 }
11736
11737
11740 {
11742 }
11743
11745 {
11747 }
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11759 {
11760 int slot = -1;
11761 if (GetInventory())
11762 {
11763 InventoryLocation il = new InventoryLocation;
11764 GetInventory().GetCurrentInventoryLocation(il);
11766 }
11767
11769 }
11770
11772 {
11773 float quantity_max = 0;
11774
11776 {
11777 if (attSlotID != -1)
11778 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11779
11780 if (quantity_max <= 0)
11782 }
11783
11784 if (quantity_max <= 0)
11786
11787 return quantity_max;
11788 }
11789
11791 {
11793 }
11794
11796 {
11798 }
11799
11800
11802 {
11804 }
11805
11807 {
11809 }
11810
11812 {
11814 }
11815
11816
11818 {
11819
11820 float weightEx = GetWeightEx();
11821 float special = GetInventoryAndCargoWeight();
11822 return weightEx - special;
11823 }
11824
11825
11827 {
11829 }
11830
11832 {
11834 {
11835 #ifdef DEVELOPER
11836 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11837 {
11838 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11840 }
11841 #endif
11842
11843 return GetQuantity() * GetConfigWeightModified();
11844 }
11845 else if (HasEnergyManager())
11846 {
11847 #ifdef DEVELOPER
11848 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11849 {
11850 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11851 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11852 }
11853 #endif
11854 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11855 }
11856 else
11857 {
11858 #ifdef DEVELOPER
11859 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11860 {
11861 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11862 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11863 }
11864 #endif
11865 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11866 }
11867 }
11868
11871 {
11872 int item_count = 0;
11874
11875 if (GetInventory().GetCargo() != NULL)
11876 {
11877 item_count = GetInventory().GetCargo().GetItemCount();
11878 }
11879
11880 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11881 {
11882 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11883 if (item)
11884 item_count += item.GetNumberOfItems();
11885 }
11886 return item_count;
11887 }
11888
11891 {
11892 float weight = 0;
11893 float wetness = 1;
11894 if (include_wetness)
11897 {
11898 weight = wetness * m_ConfigWeight;
11899 }
11901 {
11902 weight = 1;
11903 }
11904 return weight;
11905 }
11906
11907
11908
11910 {
11911 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11912 {
11913 GameInventory inv = GetInventory();
11914 array<EntityAI> items = new array<EntityAI>;
11916 for (int i = 0; i < items.Count(); i++)
11917 {
11919 if (item)
11920 {
11922 }
11923 }
11924 }
11925 }
11926
11927
11928
11929
11931 {
11932 float energy = 0;
11933 if (HasEnergyManager())
11934 {
11935 energy = GetCompEM().GetEnergy();
11936 }
11937 return energy;
11938 }
11939
11940
11942 {
11943 super.OnEnergyConsumed();
11944
11946 }
11947
11949 {
11950 super.OnEnergyAdded();
11951
11953 }
11954
11955
11957 {
11958 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11959 {
11961 {
11962 float energy_0to1 = GetCompEM().GetEnergy0To1();
11964 }
11965 }
11966 }
11967
11968
11970 {
11971 return ConfigGetFloat("heatIsolation");
11972 }
11973
11975 {
11977 }
11978
11980 {
11981 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11982 if (
GetGame().ConfigIsExisting(paramPath))
11984
11985 return 0.0;
11986 }
11987
11989 {
11990 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11991 if (
GetGame().ConfigIsExisting(paramPath))
11993
11994 return 0.0;
11995 }
11996
11997 override void SetWet(
float value,
bool allow_client =
false)
11998 {
11999 if (!IsServerCheck(allow_client))
12000 return;
12001
12004
12006
12007 m_VarWet = Math.Clamp(value, min, max);
12008
12010 {
12013 }
12014 }
12015
12016 override void AddWet(
float value)
12017 {
12019 }
12020
12022 {
12024 }
12025
12027 {
12029 }
12030
12032 {
12034 }
12035
12037 {
12039 }
12040
12042 {
12044 }
12045
12046 override void OnWetChanged(
float newVal,
float oldVal)
12047 {
12050 if (newLevel != oldLevel)
12051 {
12053 }
12054 }
12055
12057 {
12058 SetWeightDirty();
12059 }
12060
12062 {
12063 return GetWetLevelInternal(
m_VarWet);
12064 }
12065
12066
12067
12069 {
12071 }
12072
12074 {
12076 }
12077
12079 {
12081 }
12082
12084 {
12086 }
12087
12088
12089
12091 {
12092 if (ConfigIsExisting("itemModelLength"))
12093 {
12094 return ConfigGetFloat("itemModelLength");
12095 }
12096 return 0;
12097 }
12098
12100 {
12101 if (ConfigIsExisting("itemAttachOffset"))
12102 {
12103 return ConfigGetFloat("itemAttachOffset");
12104 }
12105 return 0;
12106 }
12107
12108 override void SetCleanness(
int value,
bool allow_client =
false)
12109 {
12110 if (!IsServerCheck(allow_client))
12111 return;
12112
12114
12116
12119 }
12120
12122 {
12124 }
12125
12127 {
12128 return true;
12129 }
12130
12131
12132
12133
12135 {
12137 }
12138
12140 {
12142 }
12143
12144
12145
12146
12147 override void SetColor(
int r,
int g,
int b,
int a)
12148 {
12154 }
12156 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12157 {
12162 }
12163
12165 {
12167 }
12168
12171 {
12172 int r,g,b,a;
12174 r = r/255;
12175 g = g/255;
12176 b = b/255;
12177 a = a/255;
12178 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12179 }
12180
12181
12182
12183 override void SetLiquidType(
int value,
bool allow_client =
false)
12184 {
12185 if (!IsServerCheck(allow_client))
12186 return;
12187
12192 }
12193
12195 {
12196 return ConfigGetInt("varLiquidTypeInit");
12197 }
12198
12200 {
12202 }
12203
12205 {
12207 SetFrozen(false);
12208 }
12209
12212 {
12213 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12214 }
12215
12216
12219 {
12220 PlayerBase nplayer;
12221 if (PlayerBase.CastTo(nplayer, player))
12222 {
12224
12225 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12226 }
12227 }
12228
12229
12232 {
12233 PlayerBase nplayer;
12234 if (PlayerBase.CastTo(nplayer,player))
12235 {
12236
12237 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12238
12239 }
12240
12241
12242 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12243
12244
12245 if (HasEnergyManager())
12246 {
12247 GetCompEM().UpdatePlugState();
12248 }
12249 }
12250
12251
12253 {
12254 super.OnPlacementStarted(player);
12255
12257 }
12258
12259 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12260 {
12262 {
12263 m_AdminLog.OnPlacementComplete(player,
this);
12264 }
12265
12266 super.OnPlacementComplete(player, position, orientation);
12267 }
12268
12269
12270
12271
12272
12274 {
12276 {
12277 return true;
12278 }
12279 else
12280 {
12281 return false;
12282 }
12283 }
12284
12285
12287 {
12289 {
12291 }
12292 }
12293
12294
12296 {
12298 }
12299
12301 {
12303 }
12304
12305 override void InsertAgent(
int agent,
float count = 1)
12306 {
12307 if (count < 1)
12308 return;
12309
12311 }
12312
12315 {
12317 }
12318
12319
12321 {
12323 }
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12367 {
12369 return false;
12370 return true;
12371 }
12372
12374 {
12375
12377 }
12378
12379
12382 {
12383 super.CheckForRoofLimited(timeTresholdMS);
12384
12386 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12387 {
12388 m_PreviousRoofTestTime = time;
12389 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12390 }
12391 }
12392
12393
12395 {
12397 {
12398 return 0;
12399 }
12400
12401 if (GetInventory().GetAttachmentSlotsCount() != 0)
12402 {
12403 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12404 if (filter)
12405 return filter.GetProtectionLevel(type, false, system);
12406 else
12407 return 0;
12408 }
12409
12410 string subclassPath, entryName;
12411
12412 switch (type)
12413 {
12415 entryName = "biological";
12416 break;
12418 entryName = "chemical";
12419 break;
12420 default:
12421 entryName = "biological";
12422 break;
12423 }
12424
12425 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12426
12428 }
12429
12430
12431
12434 {
12435 if (!IsMagazine())
12437
12439 }
12440
12441
12442
12443
12444
12449 {
12450 return true;
12451 }
12452
12454 {
12456 }
12457
12458
12459
12460
12461
12463 {
12464 if (parent)
12465 {
12466 if (parent.IsInherited(DayZInfected))
12467 return true;
12468
12469 if (!parent.IsRuined())
12470 return true;
12471 }
12472
12473 return true;
12474 }
12475
12477 {
12478 if (!super.CanPutAsAttachment(parent))
12479 {
12480 return false;
12481 }
12482
12483 if (!IsRuined() && !parent.IsRuined())
12484 {
12485 return true;
12486 }
12487
12488 return false;
12489 }
12490
12492 {
12493
12494
12495
12496
12497 return super.CanReceiveItemIntoCargo(item);
12498 }
12499
12501 {
12502
12503
12504
12505
12506 GameInventory attachmentInv = attachment.GetInventory();
12508 {
12509 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12510 return false;
12511 }
12512
12513 InventoryLocation loc = new InventoryLocation();
12514 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12515 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12516 return false;
12517
12518 return super.CanReceiveAttachment(attachment, slotId);
12519 }
12520
12522 {
12523 if (!super.CanReleaseAttachment(attachment))
12524 return false;
12525
12526 return GetInventory().AreChildrenAccessible();
12527 }
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12550 {
12551 int id = muzzle_owner.GetMuzzleID();
12552 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12553
12554 if (WPOF_array)
12555 {
12556 for (int i = 0; i < WPOF_array.Count(); i++)
12557 {
12558 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12559
12560 if (WPOF)
12561 {
12562 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12563 }
12564 }
12565 }
12566 }
12567
12568
12570 {
12571 int id = muzzle_owner.GetMuzzleID();
12573
12574 if (WPOBE_array)
12575 {
12576 for (int i = 0; i < WPOBE_array.Count(); i++)
12577 {
12578 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12579
12580 if (WPOBE)
12581 {
12582 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12583 }
12584 }
12585 }
12586 }
12587
12588
12590 {
12591 int id = muzzle_owner.GetMuzzleID();
12592 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12593
12594 if (WPOOH_array)
12595 {
12596 for (int i = 0; i < WPOOH_array.Count(); i++)
12597 {
12598 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12599
12600 if (WPOOH)
12601 {
12602 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12603 }
12604 }
12605 }
12606 }
12607
12608
12610 {
12611 int id = muzzle_owner.GetMuzzleID();
12612 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12613
12614 if (WPOOH_array)
12615 {
12616 for (int i = 0; i < WPOOH_array.Count(); i++)
12617 {
12618 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12619
12620 if (WPOOH)
12621 {
12622 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12623 }
12624 }
12625 }
12626 }
12627
12628
12630 {
12631 int id = muzzle_owner.GetMuzzleID();
12632 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12633
12634 if (WPOOH_array)
12635 {
12636 for (int i = 0; i < WPOOH_array.Count(); i++)
12637 {
12638 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12639
12640 if (WPOOH)
12641 {
12642 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12643 }
12644 }
12645 }
12646 }
12647
12648
12649
12651 {
12653 {
12654 return true;
12655 }
12656
12657 return false;
12658 }
12659
12661 {
12663 {
12664 return true;
12665 }
12666
12667 return false;
12668 }
12669
12671 {
12673 {
12674 return true;
12675 }
12676
12677 return false;
12678 }
12679
12681 {
12682 return false;
12683 }
12684
12687 {
12688 return UATimeSpent.DEFAULT_DEPLOY;
12689 }
12690
12691
12692
12693
12695 {
12697 SetSynchDirty();
12698 }
12699
12701 {
12703 }
12704
12705
12707 {
12708 return false;
12709 }
12710
12713 {
12714 string att_type = "None";
12715
12716 if (ConfigIsExisting("soundAttType"))
12717 {
12718 att_type = ConfigGetString("soundAttType");
12719 }
12720
12722 }
12723
12725 {
12727 }
12728
12729
12730
12731
12732
12736
12738 {
12741
12743 }
12744
12745
12747 {
12749 return;
12750
12752
12755
12758
12759 SoundParameters params = new SoundParameters();
12763 }
12764
12765
12767 {
12769 return;
12770
12772 SetSynchDirty();
12773
12776 }
12777
12778
12780 {
12782 return;
12783
12785 SetSynchDirty();
12786
12789 }
12790
12792 {
12794 }
12795
12797 {
12799 }
12800
12803 {
12804 if (!
GetGame().IsDedicatedServer())
12805 {
12806 if (ConfigIsExisting("attachSoundSet"))
12807 {
12808 string cfg_path = "";
12809 string soundset = "";
12810 string type_name =
GetType();
12811
12814 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12815 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12816
12817 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12818 {
12819 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12820 {
12821 if (cfg_slot_array[i] == slot_type)
12822 {
12823 soundset = cfg_soundset_array[i];
12824 break;
12825 }
12826 }
12827 }
12828
12829 if (soundset != "")
12830 {
12831 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12833 }
12834 }
12835 }
12836 }
12837
12839 {
12840
12841 }
12842
12843 void OnApply(PlayerBase player);
12844
12846 {
12847 return 1.0;
12848 };
12849
12851 {
12853 }
12854
12856 {
12858 }
12859
12861
12863 {
12864 SetDynamicPhysicsLifeTime(0.01);
12866 }
12867
12869 {
12870 array<string> zone_names = new array<string>;
12871 GetDamageZones(zone_names);
12872 for (int i = 0; i < zone_names.Count(); i++)
12873 {
12874 SetHealthMax(zone_names.Get(i),"Health");
12875 }
12876 SetHealthMax("","Health");
12877 }
12878
12881 {
12882 float global_health = GetHealth01("","Health");
12883 array<string> zones = new array<string>;
12884 GetDamageZones(zones);
12885
12886 for (int i = 0; i < zones.Count(); i++)
12887 {
12888 SetHealth01(zones.Get(i),"Health",global_health);
12889 }
12890 }
12891
12894 {
12895 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12896 }
12897
12899 {
12900 if (!hasRootAsPlayer)
12901 {
12902 if (refParentIB)
12903 {
12904
12905 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12906 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12907
12908 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12909 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12910
12913 }
12914 else
12915 {
12916
12919 }
12920 }
12921 }
12922
12924 {
12926 {
12927 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12928 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12929 {
12930 float heatPermCoef = 1.0;
12932 while (ent)
12933 {
12934 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12935 ent = ent.GetHierarchyParent();
12936 }
12937
12938 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12939 }
12940 }
12941 }
12942
12944 {
12945
12946 EntityAI parent = GetHierarchyParent();
12947 if (!parent)
12948 {
12949 hasParent = false;
12950 hasRootAsPlayer = false;
12951 }
12952 else
12953 {
12954 hasParent = true;
12955 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12956 refParentIB =
ItemBase.Cast(parent);
12957 }
12958 }
12959
12960 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12961 {
12962
12963 }
12964
12966 {
12967
12968 return false;
12969 }
12970
12972 {
12973
12974
12975 return false;
12976 }
12977
12979 {
12980
12981 return false;
12982 }
12983
12986 {
12987 return !GetIsFrozen() &&
IsOpen();
12988 }
12989
12991 {
12992 bool hasParent = false, hasRootAsPlayer = false;
12994
12995 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12996 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12997
12998 if (wwtu || foodDecay)
12999 {
13003
13004 if (processWetness || processTemperature || processDecay)
13005 {
13007
13008 if (processWetness)
13009 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13010
13011 if (processTemperature)
13013
13014 if (processDecay)
13015 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13016 }
13017 }
13018 }
13019
13022 {
13024 }
13025
13027 {
13030
13031 return super.GetTemperatureFreezeThreshold();
13032 }
13033
13035 {
13038
13039 return super.GetTemperatureThawThreshold();
13040 }
13041
13043 {
13046
13047 return super.GetItemOverheatThreshold();
13048 }
13049
13051 {
13053 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13054
13055 return super.GetTemperatureFreezeTime();
13056 }
13057
13059 {
13061 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13062
13063 return super.GetTemperatureThawTime();
13064 }
13065
13070
13072 {
13073 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13074 }
13075
13077 {
13078 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13079 }
13080
13083 {
13085 }
13086
13088 {
13090 }
13091
13093 {
13095 }
13096
13099 {
13100 return null;
13101 }
13102
13105 {
13106 return false;
13107 }
13108
13110 {
13112 {
13115 if (!trg)
13116 {
13118 explosive = this;
13119 }
13120
13121 explosive.PairRemote(trg);
13123
13124 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13125 trg.SetPersistentPairID(persistentID);
13126 explosive.SetPersistentPairID(persistentID);
13127
13128 return true;
13129 }
13130 return false;
13131 }
13132
13135 {
13136 float ret = 1.0;
13139 ret *= GetHealth01();
13140
13141 return ret;
13142 }
13143
13144 #ifdef DEVELOPER
13145 override void SetDebugItem()
13146 {
13147 super.SetDebugItem();
13148 _itemBase = this;
13149 }
13150
13152 {
13153 string text = super.GetDebugText();
13154
13156 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13157
13158 return text;
13159 }
13160 #endif
13161
13163 {
13164 return true;
13165 }
13166
13168
13170
13172 {
13175 }
13176
13177
13185
13201}
13202
13204{
13206 if (entity)
13207 {
13208 bool is_item = entity.IsInherited(
ItemBase);
13209 if (is_item && full_quantity)
13210 {
13213 }
13214 }
13215 else
13216 {
13218 return NULL;
13219 }
13220 return entity;
13221}
13222
13224{
13225 if (item)
13226 {
13227 if (health > 0)
13228 item.SetHealth("", "", health);
13229
13230 if (item.CanHaveTemperature())
13231 {
13233 if (item.CanFreeze())
13234 item.SetFrozen(false);
13235 }
13236
13237 if (item.HasEnergyManager())
13238 {
13239 if (quantity >= 0)
13240 {
13241 item.GetCompEM().SetEnergy0To1(quantity);
13242 }
13243 else
13244 {
13246 }
13247 }
13248 else if (item.IsMagazine())
13249 {
13250 Magazine mag = Magazine.Cast(item);
13251 if (quantity >= 0)
13252 {
13253 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13254 }
13255 else
13256 {
13258 }
13259
13260 }
13261 else
13262 {
13263 if (quantity >= 0)
13264 {
13265 item.SetQuantityNormalized(quantity, false);
13266 }
13267 else
13268 {
13270 }
13271
13272 }
13273 }
13274}
13275
13276#ifdef DEVELOPER
13278#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.