8420{
8422 {
8423 return true;
8424 }
8425};
8426
8427
8428
8430{
8434
8436
8439
8440
8441
8442
8443
8452
8458
8463
8468
8489 protected bool m_IsResultOfSplit
8490
8492
8497
8498
8499
8501
8505
8506
8507
8509
8512
8513
8514
8520
8521
8529
8532
8533
8535
8536
8538
8539
8544
8545
8550
8551
8553
8554
8556 {
8561
8562 if (!
GetGame().IsDedicatedServer())
8563 {
8565 {
8567
8569 {
8571 }
8572 }
8573
8576 }
8577
8578 m_OldLocation = null;
8579
8581 {
8583 }
8584
8585 if (ConfigIsExisting("headSelectionsToHide"))
8586 {
8589 }
8590
8592 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8593 {
8595 }
8596
8598
8599 m_IsResultOfSplit = false;
8600
8602 }
8603
8605 {
8606 super.InitItemVariables();
8607
8613 m_Count = ConfigGetInt(
"count");
8614
8617
8622
8625
8630
8642
8646
8647
8650 if (ConfigIsExisting("canBeSplit"))
8651 {
8654 }
8655
8657 if (ConfigIsExisting("itemBehaviour"))
8659
8660
8663 RegisterNetSyncVariableInt("m_VarLiquidType");
8664 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8665
8666 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8667 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8668 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8669
8670 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8671 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8672 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8673 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8674
8675 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8676 RegisterNetSyncVariableBool("m_IsTakeable");
8677 RegisterNetSyncVariableBool("m_IsHologram");
8678
8681 {
8684 }
8685
8687
8689 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8691
8692 }
8693
8695 {
8697 }
8698
8700 {
8703 {
8708 }
8709 }
8710
8711 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8712 {
8714 {
8717 }
8718
8720 }
8721
8723 {
8729 }
8730
8732
8734 {
8736
8737 if (!action)
8738 {
8739 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8740 return;
8741 }
8742
8744 if (!ai)
8745 {
8747 return;
8748 }
8749
8751 if (!action_array)
8752 {
8753 action_array = new array<ActionBase_Basic>;
8755 }
8756 if (LogManager.IsActionLogEnable())
8757 {
8758 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8759 }
8760
8761 if (action_array.Find(action) != -1)
8762 {
8763 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8764 }
8765 else
8766 {
8767 action_array.Insert(action);
8768 }
8769 }
8770
8772 {
8774 ActionBase action = player.GetActionManager().GetAction(actionName);
8777
8778 if (action_array)
8779 {
8780 action_array.RemoveItem(action);
8781 }
8782 }
8783
8784
8785
8787 {
8788 ActionOverrideData overrideData = new ActionOverrideData();
8792
8794 if (!actionMap)
8795 {
8798 }
8799
8800 actionMap.Insert(this.
Type(), overrideData);
8801
8802 }
8803
8805
8807
8808
8810 {
8813
8816
8817 string config_to_search = "CfgVehicles";
8818 string muzzle_owner_config;
8819
8821 {
8822 if (IsInherited(Weapon))
8823 config_to_search = "CfgWeapons";
8824
8825 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8826
8827 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8828
8830
8831 if (config_OnFire_subclass_count > 0)
8832 {
8833 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8834
8835 for (int i = 0; i < config_OnFire_subclass_count; i++)
8836 {
8837 string particle_class = "";
8839 string config_OnFire_entry = config_OnFire_class + particle_class;
8840 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8841 WPOF_array.Insert(WPOF);
8842 }
8843
8844
8846 }
8847 }
8848
8850 {
8851 config_to_search = "CfgWeapons";
8852 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8853
8854 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8855
8857
8858 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8859 {
8860 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8861
8862 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8863 {
8864 string particle_class2 = "";
8866 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8867 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8868 WPOBE_array.Insert(WPOBE);
8869 }
8870
8871
8873 }
8874 }
8875 }
8876
8877
8879 {
8882
8884 {
8885 string config_to_search = "CfgVehicles";
8886
8887 if (IsInherited(Weapon))
8888 config_to_search = "CfgWeapons";
8889
8890 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8891 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8892
8893 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8894 {
8895
8897
8899 {
8901 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8903 return;
8904 }
8905
8908
8909
8910
8912 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8913
8914 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8915 {
8916 string particle_class = "";
8918 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8920
8921 if (entry_type == CT_CLASS)
8922 {
8923 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8924 WPOOH_array.Insert(WPOF);
8925 }
8926 }
8927
8928
8930 }
8931 }
8932 }
8933
8935 {
8937 }
8938
8940 {
8942 {
8944
8947
8950
8951 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8952 }
8953 }
8954
8956 {
8958 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8959
8961 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8962
8964 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8965
8967 {
8969 }
8970 }
8971
8973 {
8975 }
8976
8978 {
8981 else
8983
8985 {
8988 }
8989 else
8990 {
8993
8996 }
8997
8999 }
9000
9002 {
9004 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9005 }
9006
9008 {
9010 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9012 }
9013
9015 {
9017 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9018 }
9019
9021 {
9024
9025 OverheatingParticle OP = new OverheatingParticle();
9030
9032 }
9033
9035 {
9038
9039 return -1;
9040 }
9041
9043 {
9045 {
9048
9049 for (int i = count; i > 0; --i)
9050 {
9051 int id = i - 1;
9054
9057
9058 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9059 {
9060 if (p)
9061 {
9064 }
9065 }
9066 }
9067 }
9068 }
9069
9071 {
9073 {
9075 {
9076 int id = i - 1;
9078
9079 if (OP)
9080 {
9082
9083 if (p)
9084 {
9086 }
9087
9088 delete OP;
9089 }
9090 }
9091
9094 }
9095 }
9096
9099 {
9100 return 0.0;
9101 }
9102
9103
9105 {
9106 return 250;
9107 }
9108
9110 {
9111 return 0;
9112 }
9113
9116 {
9118 return true;
9119
9120 return false;
9121 }
9122
9125 {
9128
9130 {
9132 }
9133 else
9134 {
9135
9137 }
9138
9140 }
9141
9148 {
9149 return -1;
9150 }
9151
9152
9153
9154
9156 {
9158 {
9160 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9161
9162 if (r_index >= 0)
9163 {
9164 InventoryLocation r_il = new InventoryLocation;
9165 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9166
9167 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9170 {
9171 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9172 }
9174 {
9175 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9176 }
9177
9178 }
9179
9180 player.GetHumanInventory().ClearUserReservedLocation(this);
9181 }
9182
9185 }
9186
9187
9188
9189
9191 {
9192 return ItemBase.m_DebugActionsMask;
9193 }
9194
9196 {
9197 return ItemBase.m_DebugActionsMask & mask;
9198 }
9199
9201 {
9202 ItemBase.m_DebugActionsMask = mask;
9203 }
9204
9206 {
9207 ItemBase.m_DebugActionsMask |= mask;
9208 }
9209
9211 {
9212 ItemBase.m_DebugActionsMask &= ~mask;
9213 }
9214
9216 {
9218 {
9220 }
9221 else
9222 {
9224 }
9225 }
9226
9227
9229 {
9230 if (GetEconomyProfile())
9231 {
9232 float q_max = GetEconomyProfile().GetQuantityMax();
9233 if (q_max > 0)
9234 {
9235 float q_min = GetEconomyProfile().GetQuantityMin();
9236 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9237
9239 {
9240 ComponentEnergyManager comp = GetCompEM();
9242 {
9244 }
9245 }
9247 {
9249
9250 }
9251
9252 }
9253 }
9254 }
9255
9258 {
9259 EntityAI parent = GetHierarchyParent();
9260
9261 if (parent)
9262 {
9263 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9264 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9265 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9266 }
9267 }
9268
9271 {
9272 EntityAI parent = GetHierarchyParent();
9273
9274 if (parent)
9275 {
9276 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9277 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9278 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9279 }
9280 }
9281
9283 {
9284
9285
9286
9287
9289
9291 {
9292 if (ScriptInputUserData.CanStoreInputUserData())
9293 {
9294 ScriptInputUserData ctx = new ScriptInputUserData;
9300 ctx.
Write(use_stack_max);
9303
9305 {
9306 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9307 }
9308 }
9309 }
9310 else if (!
GetGame().IsMultiplayer())
9311 {
9313 }
9314 }
9315
9317 {
9319 }
9320
9322 {
9324 }
9325
9327 {
9329 }
9330
9332 {
9333
9334 return false;
9335 }
9336
9338 {
9339 return false;
9340 }
9341
9345 {
9346 return false;
9347 }
9348
9350 {
9351 return "";
9352 }
9353
9355
9357 {
9358 return false;
9359 }
9360
9362 {
9363 return true;
9364 }
9365
9366
9367
9369 {
9370 return true;
9371 }
9372
9374 {
9375 return true;
9376 }
9377
9379 {
9380 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9382 }
9383
9385 {
9387 }
9388
9390 {
9392 if (!is_being_placed)
9394 SetSynchDirty();
9395 }
9396
9397
9399
9401 {
9403 }
9404
9406 {
9408 }
9409
9411 {
9412 return 1;
9413 }
9414
9416 {
9417 return false;
9418 }
9419
9421 {
9423 SetSynchDirty();
9424 }
9425
9426
9427
9428
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
9461 {
9462 super.OnMovedInsideCargo(container);
9463
9464 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9465 }
9466
9467 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9468 {
9469 super.EEItemLocationChanged(oldLoc,newLoc);
9470
9471 PlayerBase new_player = null;
9472 PlayerBase old_player = null;
9473
9474 if (newLoc.GetParent())
9475 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9476
9477 if (oldLoc.GetParent())
9478 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9479
9481 {
9482 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9483
9484 if (r_index >= 0)
9485 {
9486 InventoryLocation r_il = new InventoryLocation;
9487 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9488
9489 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9492 {
9493 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9494 }
9496 {
9497 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9498 }
9499
9500 }
9501 }
9502
9504 {
9505 if (new_player)
9506 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9507
9508 if (new_player == old_player)
9509 {
9510
9511 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9512 {
9514 {
9515 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9516 {
9517 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9518 }
9519 }
9520 else
9521 {
9522 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9523 }
9524 }
9525
9526 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9527 {
9528 int type = oldLoc.GetType();
9530 {
9531 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9532 }
9534 {
9535 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9536 }
9537 }
9538 if (!m_OldLocation)
9539 {
9540 m_OldLocation = new InventoryLocation;
9541 }
9542 m_OldLocation.Copy(oldLoc);
9543 }
9544 else
9545 {
9546 if (m_OldLocation)
9547 {
9548 m_OldLocation.Reset();
9549 }
9550 }
9551
9553 }
9554 else
9555 {
9556 if (new_player)
9557 {
9558 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9559 if (res_index >= 0)
9560 {
9561 InventoryLocation il = new InventoryLocation;
9562 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9564 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9567 {
9568 il.
GetParent().GetOnReleaseLock().Invoke(it);
9569 }
9571 {
9573 }
9574
9575 }
9576 }
9578 {
9579
9581 }
9582
9583 if (m_OldLocation)
9584 {
9585 m_OldLocation.Reset();
9586 }
9587 }
9588 }
9589
9590 override void EOnContact(IEntity other, Contact extra)
9591 {
9593 {
9594 int liquidType = -1;
9596 if (impactSpeed > 0.0)
9597 {
9599 #ifndef SERVER
9601 #else
9603 SetSynchDirty();
9604 #endif
9606 }
9607 }
9608
9609 #ifdef SERVER
9610 if (GetCompEM() && GetCompEM().IsPlugged())
9611 {
9612 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9613 GetCompEM().UnplugThis();
9614 }
9615 #endif
9616 }
9617
9619
9621 {
9623 }
9624
9626 {
9627
9628 }
9629
9631 {
9632 super.OnItemLocationChanged(old_owner, new_owner);
9633
9634 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9635 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9636
9637 if (!relatedPlayer && playerNew)
9638 relatedPlayer = playerNew;
9639
9640 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9641 {
9643 if (actionMgr)
9644 {
9645 ActionBase currentAction = actionMgr.GetRunningAction();
9646 if (currentAction)
9648 }
9649 }
9650
9651 Man ownerPlayerOld = null;
9652 Man ownerPlayerNew = null;
9653
9654 if (old_owner)
9655 {
9656 if (old_owner.
IsMan())
9657 {
9658 ownerPlayerOld = Man.Cast(old_owner);
9659 }
9660 else
9661 {
9662 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9663 }
9664 }
9665 else
9666 {
9668 {
9670
9671 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9672 {
9673 GetCompEM().UnplugThis();
9674 }
9675 }
9676 }
9677
9678 if (new_owner)
9679 {
9680 if (new_owner.
IsMan())
9681 {
9682 ownerPlayerNew = Man.Cast(new_owner);
9683 }
9684 else
9685 {
9686 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9687 }
9688 }
9689
9690 if (ownerPlayerOld != ownerPlayerNew)
9691 {
9692 if (ownerPlayerOld)
9693 {
9694 array<EntityAI> subItemsExit = new array<EntityAI>;
9696 for (int i = 0; i < subItemsExit.Count(); i++)
9697 {
9700 }
9701 }
9702
9703 if (ownerPlayerNew)
9704 {
9705 array<EntityAI> subItemsEnter = new array<EntityAI>;
9707 for (int j = 0; j < subItemsEnter.Count(); j++)
9708 {
9711 }
9712 }
9713 }
9714 else if (ownerPlayerNew != null)
9715 {
9716 PlayerBase nplayer;
9717 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9718 {
9719 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9721 for (int k = 0; k < subItemsUpdate.Count(); k++)
9722 {
9724 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9725 }
9726 }
9727 }
9728
9729 if (old_owner)
9730 old_owner.OnChildItemRemoved(this);
9731 if (new_owner)
9732 new_owner.OnChildItemReceived(this);
9733 }
9734
9735
9737 {
9738 super.EEDelete(parent);
9739 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9740 if (player)
9741 {
9743
9744 if (player.IsAlive())
9745 {
9746 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9747 if (r_index >= 0)
9748 {
9749 InventoryLocation r_il = new InventoryLocation;
9750 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9751
9752 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9755 {
9756 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9757 }
9759 {
9760 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9761 }
9762
9763 }
9764
9765 player.RemoveQuickBarEntityShortcut(this);
9766 }
9767 }
9768 }
9769
9771 {
9772 super.EEKilled(killer);
9773
9776 {
9777 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9778 {
9779 if (IsMagazine())
9780 {
9781 if (Magazine.Cast(this).GetAmmoCount() > 0)
9782 {
9784 }
9785 }
9786 else
9787 {
9789 }
9790 }
9791 }
9792 }
9793
9795 {
9796 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9797
9798 super.OnWasAttached(parent, slot_id);
9799
9802
9804 }
9805
9807 {
9808 super.OnWasDetached(parent, slot_id);
9809
9812 }
9813
9815 {
9816 int idx;
9819
9820 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9821 if (inventory_slots.Count() < 1)
9822 {
9823 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9824 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9825 }
9826 else
9827 {
9828 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9829 }
9830
9831 idx = inventory_slots.Find(slot);
9832 if (idx < 0)
9833 return "";
9834
9835 return attach_types.Get(idx);
9836 }
9837
9839 {
9840 int idx = -1;
9841 string slot;
9842
9845
9846 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9847 if (inventory_slots.Count() < 1)
9848 {
9849 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9850 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9851 }
9852 else
9853 {
9854 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9855 if (detach_types.Count() < 1)
9856 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9857 }
9858
9859 for (int i = 0; i < inventory_slots.Count(); i++)
9860 {
9861 slot = inventory_slots.Get(i);
9862 }
9863
9864 if (slot != "")
9865 {
9866 if (detach_types.Count() == 1)
9867 idx = 0;
9868 else
9869 idx = inventory_slots.Find(slot);
9870 }
9871 if (idx < 0)
9872 return "";
9873
9874 return detach_types.Get(idx);
9875 }
9876
9878 {
9879
9881
9882
9883 float min_time = 1;
9884 float max_time = 3;
9885 float delay = Math.RandomFloat(min_time, max_time);
9886
9887 explode_timer.Run(delay, this, "DoAmmoExplosion");
9888 }
9889
9891 {
9892 Magazine magazine = Magazine.Cast(this);
9893 int pop_sounds_count = 6;
9894 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9895
9896
9897 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9898 string sound_name = pop_sounds[ sound_idx ];
9900
9901
9902 magazine.ServerAddAmmoCount(-1);
9903
9904
9905 float min_temp_to_explode = 100;
9906
9907 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9908 {
9910 }
9911 }
9912
9913
9914 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9915 {
9916 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9917
9918 const int CHANCE_DAMAGE_CARGO = 4;
9919 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9920 const int CHANCE_DAMAGE_NOTHING = 2;
9921
9923 {
9924 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9925 int chances;
9926 int rnd;
9927
9928 if (GetInventory().GetCargo())
9929 {
9930 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9931 rnd = Math.RandomInt(0,chances);
9932
9933 if (rnd < CHANCE_DAMAGE_CARGO)
9934 {
9936 }
9937 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9938 {
9940 }
9941 }
9942 else
9943 {
9944 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9945 rnd = Math.RandomInt(0,chances);
9946
9947 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9948 {
9950 }
9951 }
9952 }
9953 }
9954
9956 {
9957 if (GetInventory().GetCargo())
9958 {
9959 int item_count = GetInventory().GetCargo().GetItemCount();
9960 if (item_count > 0)
9961 {
9962 int random_pick = Math.RandomInt(0, item_count);
9964 if (!item.IsExplosive())
9965 {
9966 item.AddHealth("","",damage);
9967 return true;
9968 }
9969 }
9970 }
9971 return false;
9972 }
9973
9975 {
9976 int attachment_count = GetInventory().AttachmentCount();
9977 if (attachment_count > 0)
9978 {
9979 int random_pick = Math.RandomInt(0, attachment_count);
9980 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9981 if (!attachment.IsExplosive())
9982 {
9983 attachment.AddHealth("","",damage);
9984 return true;
9985 }
9986 }
9987 return false;
9988 }
9989
9991 {
9993 }
9994
9996 {
9998 return GetInventory().CanRemoveEntity();
9999
10000 return false;
10001 }
10002
10004 {
10006 return;
10007
10009 {
10010 if (ScriptInputUserData.CanStoreInputUserData())
10011 {
10012 ScriptInputUserData ctx = new ScriptInputUserData;
10017 ctx.
Write(destination_entity);
10019 ctx.
Write(slot_id);
10021 }
10022 }
10023 else if (!
GetGame().IsMultiplayer())
10024 {
10026 }
10027 }
10028
10030 {
10032 return;
10033
10034 float split_quantity_new;
10038 InventoryLocation loc = new InventoryLocation;
10039
10040 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10041 {
10043 split_quantity_new = stack_max;
10044 else
10046
10047 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10048 if (new_item)
10049 {
10050 new_item.SetResultOfSplit(true);
10051 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10053 new_item.SetQuantity(split_quantity_new);
10054 }
10055 }
10056 else if (destination_entity && slot_id == -1)
10057 {
10058 if (quantity > stack_max)
10059 split_quantity_new = stack_max;
10060 else
10061 split_quantity_new = quantity;
10062
10064 {
10067 }
10068
10069 if (new_item)
10070 {
10071 new_item.SetResultOfSplit(true);
10072 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10074 new_item.SetQuantity(split_quantity_new);
10075 }
10076 }
10077 else
10078 {
10079 if (stack_max != 0)
10080 {
10082 {
10084 }
10085
10086 if (split_quantity_new == 0)
10087 {
10088 if (!
GetGame().IsMultiplayer())
10089 player.PhysicalPredictiveDropItem(this);
10090 else
10091 player.ServerDropEntity(this);
10092 return;
10093 }
10094
10096
10097 if (new_item)
10098 {
10099 new_item.SetResultOfSplit(true);
10100 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10102 new_item.SetQuantity(stack_max);
10103 new_item.PlaceOnSurface();
10104 }
10105 }
10106 }
10107 }
10108
10110 {
10112 return;
10113
10114 float split_quantity_new;
10118 InventoryLocation loc = new InventoryLocation;
10119
10120 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10121 {
10123 split_quantity_new = stack_max;
10124 else
10126
10127 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10128 if (new_item)
10129 {
10130 new_item.SetResultOfSplit(true);
10131 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10133 new_item.SetQuantity(split_quantity_new);
10134 }
10135 }
10136 else if (destination_entity && slot_id == -1)
10137 {
10138 if (quantity > stack_max)
10139 split_quantity_new = stack_max;
10140 else
10141 split_quantity_new = quantity;
10142
10144 {
10147 }
10148
10149 if (new_item)
10150 {
10151 new_item.SetResultOfSplit(true);
10152 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10154 new_item.SetQuantity(split_quantity_new);
10155 }
10156 }
10157 else
10158 {
10159 if (stack_max != 0)
10160 {
10162 {
10164 }
10165
10167
10168 if (new_item)
10169 {
10170 new_item.SetResultOfSplit(true);
10171 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10173 new_item.SetQuantity(stack_max);
10174 new_item.PlaceOnSurface();
10175 }
10176 }
10177 }
10178 }
10179
10181 {
10183 return;
10184
10186 {
10187 if (ScriptInputUserData.CanStoreInputUserData())
10188 {
10189 ScriptInputUserData ctx = new ScriptInputUserData;
10194 dst.WriteToContext(ctx);
10196 }
10197 }
10198 else if (!
GetGame().IsMultiplayer())
10199 {
10201 }
10202 }
10203
10205 {
10207 return;
10208
10210 {
10211 if (ScriptInputUserData.CanStoreInputUserData())
10212 {
10213 ScriptInputUserData ctx = new ScriptInputUserData;
10218 ctx.
Write(destination_entity);
10224 }
10225 }
10226 else if (!
GetGame().IsMultiplayer())
10227 {
10229 }
10230 }
10231
10233 {
10235 }
10236
10238 {
10240 return this;
10241
10243 float split_quantity_new;
10245 if (dst.IsValid())
10246 {
10247 int slot_id = dst.GetSlot();
10249
10250 if (quantity > stack_max)
10251 split_quantity_new = stack_max;
10252 else
10253 split_quantity_new = quantity;
10254
10256
10257 if (new_item)
10258 {
10259 new_item.SetResultOfSplit(true);
10260 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10263 }
10264
10265 return new_item;
10266 }
10267
10268 return null;
10269 }
10270
10272 {
10274 return;
10275
10277 float split_quantity_new;
10279 if (destination_entity)
10280 {
10282 if (quantity > stackable)
10283 split_quantity_new = stackable;
10284 else
10285 split_quantity_new = quantity;
10286
10287 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10288 if (new_item)
10289 {
10290 new_item.SetResultOfSplit(true);
10291 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10293 new_item.SetQuantity(split_quantity_new);
10294 }
10295 }
10296 }
10297
10299 {
10301 return;
10302
10304 {
10305 if (ScriptInputUserData.CanStoreInputUserData())
10306 {
10307 ScriptInputUserData ctx = new ScriptInputUserData;
10312 ItemBase destination_entity =
this;
10313 ctx.
Write(destination_entity);
10317 }
10318 }
10319 else if (!
GetGame().IsMultiplayer())
10320 {
10322 }
10323 }
10324
10326 {
10328 return;
10329
10331 float split_quantity_new;
10333 if (player)
10334 {
10336 if (quantity > stackable)
10337 split_quantity_new = stackable;
10338 else
10339 split_quantity_new = quantity;
10340
10341 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10342 new_item =
ItemBase.Cast(in_hands);
10343 if (new_item)
10344 {
10345 new_item.SetResultOfSplit(true);
10346 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10348 new_item.SetQuantity(split_quantity_new);
10349 }
10350 }
10351 }
10352
10354 {
10356 return;
10357
10359 float split_quantity_new = Math.Floor(quantity * 0.5);
10360
10362
10363 if (new_item)
10364 {
10365 if (new_item.GetQuantityMax() < split_quantity_new)
10366 {
10367 split_quantity_new = new_item.GetQuantityMax();
10368 }
10369
10370 new_item.SetResultOfSplit(true);
10371 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10372
10374 {
10377 }
10378 else
10379 {
10382 }
10383 }
10384 }
10385
10387 {
10389 return;
10390
10392 float split_quantity_new = Math.Floor(quantity / 2);
10393
10394 InventoryLocation invloc = new InventoryLocation;
10396
10398 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10399
10400 if (new_item)
10401 {
10402 if (new_item.GetQuantityMax() < split_quantity_new)
10403 {
10404 split_quantity_new = new_item.GetQuantityMax();
10405 }
10407 {
10410 }
10411 else
10412 {
10415 }
10416 }
10417 }
10418
10421 {
10422 SetWeightDirty();
10424
10425 if (parent)
10426 parent.OnAttachmentQuantityChangedEx(this, delta);
10427
10429 {
10431 {
10433 }
10435 {
10436 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10438 }
10439 }
10440
10441 }
10442
10445 {
10446
10447 }
10448
10451 {
10453 }
10454
10456 {
10457 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10458
10460 {
10461 if (newLevel == GameConstants.STATE_RUINED)
10462 {
10464 EntityAI parent = GetHierarchyParent();
10465 if (parent && parent.IsFireplace())
10466 {
10467 CargoBase cargo = GetInventory().GetCargo();
10468 if (cargo)
10469 {
10471 {
10473 }
10474 }
10475 }
10476 }
10477
10479 {
10480
10482 return;
10483 }
10484
10485 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10486 {
10488 }
10489 }
10490 }
10491
10492
10494 {
10495 super.OnRightClick();
10496
10498 {
10500 {
10501 if (ScriptInputUserData.CanStoreInputUserData())
10502 {
10503 vector m4[4];
10505
10506 EntityAI root = GetHierarchyRoot();
10507
10508 InventoryLocation dst = new InventoryLocation;
10510 {
10511 if (root)
10512 {
10513 root.GetTransform(m4);
10515 }
10516 else
10517 GetInventory().GetCurrentInventoryLocation(dst);
10518 }
10519 else
10520 {
10522
10523
10524 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10525 {
10526 if (root)
10527 {
10528 root.GetTransform(m4);
10530 }
10531 else
10532 GetInventory().GetCurrentInventoryLocation(dst);
10533 }
10534 else
10535 {
10536 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10537 }
10538 }
10539
10540 ScriptInputUserData ctx = new ScriptInputUserData;
10548 }
10549 }
10550 else if (!
GetGame().IsMultiplayer())
10551 {
10553 }
10554 }
10555 }
10556
10557 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10558 {
10559
10560 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10561 return false;
10562
10563 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10564 return false;
10565
10566
10568 return false;
10569
10570
10571 Magazine mag = Magazine.Cast(this);
10572 if (mag)
10573 {
10574 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10575 return false;
10576
10577 if (stack_max_limit)
10578 {
10579 Magazine other_mag = Magazine.Cast(other_item);
10580 if (other_item)
10581 {
10582 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10583 return false;
10584 }
10585
10586 }
10587 }
10588 else
10589 {
10590
10592 return false;
10593
10595 return false;
10596 }
10597
10598 PlayerBase player = null;
10599 if (CastTo(player, GetHierarchyRootPlayer()))
10600 {
10601 if (player.GetInventory().HasAttachment(this))
10602 return false;
10603
10604 if (player.IsItemsToDelete())
10605 return false;
10606 }
10607
10608 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10609 return false;
10610
10611 int slotID;
10613 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10614 return false;
10615
10616 return true;
10617 }
10618
10620 {
10622 }
10623
10625 {
10626 return m_IsResultOfSplit;
10627 }
10628
10630 {
10631 m_IsResultOfSplit = value;
10632 }
10633
10635 {
10637 }
10638
10640 {
10641 float other_item_quantity = other_item.GetQuantity();
10642 float this_free_space;
10643
10645
10647
10648 if (other_item_quantity > this_free_space)
10649 {
10650 return this_free_space;
10651 }
10652 else
10653 {
10654 return other_item_quantity;
10655 }
10656 }
10657
10659 {
10661 }
10662
10664 {
10666 return;
10667
10668 if (!IsMagazine() && other_item)
10669 {
10671 if (quantity_used != 0)
10672 {
10673 float hp1 = GetHealth01("","");
10674 float hp2 = other_item.GetHealth01("","");
10675 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10676 hpResult = hpResult / (
GetQuantity() + quantity_used);
10677
10678 hpResult *= GetMaxHealth();
10679 Math.Round(hpResult);
10680 SetHealth("", "Health", hpResult);
10681
10683 other_item.AddQuantity(-quantity_used);
10684 }
10685 }
10687 }
10688
10690 {
10691 #ifdef SERVER
10692 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10693 GetHierarchyParent().IncreaseLifetimeUp();
10694 #endif
10695 };
10696
10698 {
10699 PlayerBase p = PlayerBase.Cast(player);
10700
10701 array<int> recipesIds = p.m_Recipes;
10702 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10703 if (moduleRecipesManager)
10704 {
10705 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10706 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10707 }
10708
10709 for (int i = 0;i < recipesIds.Count(); i++)
10710 {
10711 int key = recipesIds.Get(i);
10712 string recipeName = moduleRecipesManager.GetRecipeName(key);
10714 }
10715 }
10716
10717
10718 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10719 {
10720 super.GetDebugActions(outputList);
10721
10722
10727
10728
10732
10736
10737
10740
10741
10743 {
10746 }
10747
10749
10752
10756 }
10757
10758
10759
10760
10762 {
10763 super.OnAction(action_id, player, ctx);
10764 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10765 {
10766 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10767 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10768 PlayerBase p = PlayerBase.Cast(player);
10769 if (
EActions.RECIPES_RANGE_START < 1000)
10770 {
10771 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10772 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10773 }
10774 }
10775 #ifndef SERVER
10776 else if (action_id ==
EActions.WATCH_PLAYER)
10777 {
10778 PluginDeveloper.SetDeveloperItemClientEx(player);
10779 }
10780 #endif
10782 {
10783 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10784 {
10785 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10786 OnDebugButtonPressServer(id + 1);
10787 }
10788
10789 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10790 {
10791 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10793 }
10794
10795 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10796 {
10797 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10799 }
10800
10801 else if (action_id ==
EActions.ADD_QUANTITY)
10802 {
10803 if (IsMagazine())
10804 {
10805 Magazine mag = Magazine.Cast(this);
10806 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10807 }
10808 else
10809 {
10811 }
10812
10813 if (m_EM)
10814 {
10815 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10816 }
10817
10818 }
10819
10820 else if (action_id ==
EActions.REMOVE_QUANTITY)
10821 {
10822 if (IsMagazine())
10823 {
10824 Magazine mag2 = Magazine.Cast(this);
10825 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10826 }
10827 else
10828 {
10830 }
10831 if (m_EM)
10832 {
10833 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10834 }
10835
10836 }
10837
10838 else if (action_id ==
EActions.SET_QUANTITY_0)
10839 {
10841
10842 if (m_EM)
10843 {
10844 m_EM.SetEnergy(0);
10845 }
10846 }
10847
10848 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10849 {
10851
10852 if (m_EM)
10853 {
10854 m_EM.SetEnergy(m_EM.GetEnergyMax());
10855 }
10856 }
10857
10858 else if (action_id ==
EActions.ADD_HEALTH)
10859 {
10860 AddHealth("","",GetMaxHealth("","Health")/5);
10861 }
10862 else if (action_id ==
EActions.REMOVE_HEALTH)
10863 {
10864 AddHealth("","",-GetMaxHealth("","Health")/5);
10865 }
10866 else if (action_id ==
EActions.DESTROY_HEALTH)
10867 {
10868 SetHealth01("","",0);
10869 }
10870 else if (action_id ==
EActions.WATCH_ITEM)
10871 {
10873 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10874 #ifdef DEVELOPER
10875 SetDebugDeveloper_item(this);
10876 #endif
10877 }
10878
10879 else if (action_id ==
EActions.ADD_TEMPERATURE)
10880 {
10881 AddTemperature(20);
10882
10883 }
10884
10885 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10886 {
10887 AddTemperature(-20);
10888
10889 }
10890
10891 else if (action_id ==
EActions.FLIP_FROZEN)
10892 {
10893 SetFrozen(!GetIsFrozen());
10894
10895 }
10896
10897 else if (action_id ==
EActions.ADD_WETNESS)
10898 {
10900
10901 }
10902
10903 else if (action_id ==
EActions.REMOVE_WETNESS)
10904 {
10906
10907 }
10908
10909 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10910 {
10913
10914
10915 }
10916
10917 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10918 {
10921 }
10922
10923 else if (action_id ==
EActions.MAKE_SPECIAL)
10924 {
10925 auto debugParams = DebugSpawnParams.WithPlayer(player);
10926 OnDebugSpawnEx(debugParams);
10927 }
10928
10929 else if (action_id ==
EActions.DELETE)
10930 {
10931 Delete();
10932 }
10933
10934 }
10935
10936
10937 return false;
10938 }
10939
10940
10941
10942
10946
10949
10950
10951
10953 {
10954 return false;
10955 }
10956
10957
10959 {
10960 return true;
10961 }
10962
10963
10965 {
10966 return true;
10967 }
10968
10969
10970
10972 {
10973 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10975 }
10976
10979 {
10980 return null;
10981 }
10982
10984 {
10985 return false;
10986 }
10987
10989 {
10990 return false;
10991 }
10992
10996
10997
10999 {
11000 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11001 return module_repairing.CanRepair(this, item_repair_kit);
11002 }
11003
11004
11005 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11006 {
11007 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11008 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11009 }
11010
11011
11013 {
11014
11015
11016
11017
11018
11019
11020
11021
11022 return 1;
11023 }
11024
11025
11026
11028 {
11030 }
11031
11032
11033
11035 {
11037 }
11038
11039
11048 {
11049 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11050
11051 if (player)
11052 {
11053 player.MessageStatus(text);
11054 }
11055 }
11056
11057
11066 {
11067 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11068
11069 if (player)
11070 {
11071 player.MessageAction(text);
11072 }
11073 }
11074
11075
11084 {
11085 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11086
11087 if (player)
11088 {
11089 player.MessageFriendly(text);
11090 }
11091 }
11092
11093
11102 {
11103 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11104
11105 if (player)
11106 {
11107 player.MessageImportant(text);
11108 }
11109 }
11110
11112 {
11113 return true;
11114 }
11115
11116
11117 override bool KindOf(
string tag)
11118 {
11119 bool found = false;
11120 string item_name = this.
GetType();
11123
11124 int array_size = item_tag_array.Count();
11125 for (int i = 0; i < array_size; i++)
11126 {
11127 if (item_tag_array.Get(i) == tag)
11128 {
11129 found = true;
11130 break;
11131 }
11132 }
11133 return found;
11134 }
11135
11136
11138 {
11139
11140 super.OnRPC(sender, rpc_type,ctx);
11141
11142
11143 switch (rpc_type)
11144 {
11145 #ifndef SERVER
11146 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11147 Param2<bool, string> p = new Param2<bool, string>(false, "");
11148
11150 return;
11151
11152 bool play = p.param1;
11153 string soundSet = p.param2;
11154
11155 if (play)
11156 {
11158 {
11160 {
11162 }
11163 }
11164 else
11165 {
11167 }
11168 }
11169 else
11170 {
11172 }
11173
11174 break;
11175 #endif
11176
11177 }
11178
11180 {
11182 }
11183 }
11184
11185
11186
11187
11189 {
11190 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11191 return plugin.GetID(
name);
11192 }
11193
11195 {
11196 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11197 return plugin.GetName(id);
11198 }
11199
11202 {
11203
11204
11205 int varFlags;
11206 if (!ctx.
Read(varFlags))
11207 return;
11208
11209 if (varFlags & ItemVariableFlags.FLOAT)
11210 {
11212 }
11213 }
11214
11216 {
11217
11218 super.SerializeNumericalVars(floats_out);
11219
11220
11221
11223 {
11225 }
11226
11228 {
11230 }
11231
11233 {
11235 }
11236
11238 {
11243 }
11244
11246 {
11248 }
11249 }
11250
11252 {
11253
11254 super.DeSerializeNumericalVars(floats);
11255
11256
11257 int index = 0;
11258 int mask = Math.Round(floats.Get(index));
11259
11260 index++;
11261
11263 {
11265 {
11267 }
11268 else
11269 {
11270 float quantity = floats.Get(index);
11271 SetQuantity(quantity,
true,
false,
false,
false);
11272 }
11273 index++;
11274 }
11275
11277 {
11278 float wet = floats.Get(index);
11280 index++;
11281 }
11282
11284 {
11285 int liquidtype = Math.Round(floats.Get(index));
11287 index++;
11288 }
11289
11291 {
11293 index++;
11295 index++;
11297 index++;
11299 index++;
11300 }
11301
11303 {
11304 int cleanness = Math.Round(floats.Get(index));
11306 index++;
11307 }
11308 }
11309
11311 {
11312 super.WriteVarsToCTX(ctx);
11313
11314
11316 {
11318 }
11319
11321 {
11323 }
11324
11326 {
11328 }
11329
11331 {
11332 int r,g,b,a;
11338 }
11339
11341 {
11343 }
11344 }
11345
11347 {
11348 if (!super.ReadVarsFromCTX(ctx,version))
11349 return false;
11350
11351 int intValue;
11352 float value;
11353
11354 if (version < 140)
11355 {
11356 if (!ctx.
Read(intValue))
11357 return false;
11358
11359 m_VariablesMask = intValue;
11360 }
11361
11363 {
11364 if (!ctx.
Read(value))
11365 return false;
11366
11368 {
11370 }
11371 else
11372 {
11374 }
11375 }
11376
11377 if (version < 140)
11378 {
11380 {
11381 if (!ctx.
Read(value))
11382 return false;
11383 SetTemperatureDirect(value);
11384 }
11385 }
11386
11388 {
11389 if (!ctx.
Read(value))
11390 return false;
11392 }
11393
11395 {
11396 if (!ctx.
Read(intValue))
11397 return false;
11399 }
11400
11402 {
11403 int r,g,b,a;
11405 return false;
11407 return false;
11409 return false;
11411 return false;
11412
11414 }
11415
11417 {
11418 if (!ctx.
Read(intValue))
11419 return false;
11421 }
11422
11423 if (version >= 138 && version < 140)
11424 {
11426 {
11427 if (!ctx.
Read(intValue))
11428 return false;
11429 SetFrozen(intValue);
11430 }
11431 }
11432
11433 return true;
11434 }
11435
11436
11438 {
11441 {
11443 }
11444
11445 if (!super.OnStoreLoad(ctx, version))
11446 {
11448 return false;
11449 }
11450
11451 if (version >= 114)
11452 {
11453 bool hasQuickBarIndexSaved;
11454
11455 if (!ctx.
Read(hasQuickBarIndexSaved))
11456 {
11458 return false;
11459 }
11460
11461 if (hasQuickBarIndexSaved)
11462 {
11463 int itmQBIndex;
11464
11465
11466 if (!ctx.
Read(itmQBIndex))
11467 {
11469 return false;
11470 }
11471
11472 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11473 if (itmQBIndex != -1 && parentPlayer)
11474 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11475 }
11476 }
11477 else
11478 {
11479
11480 PlayerBase player;
11481 int itemQBIndex;
11482 if (version ==
int.
MAX)
11483 {
11484 if (!ctx.
Read(itemQBIndex))
11485 {
11487 return false;
11488 }
11489 }
11490 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11491 {
11492
11493 if (!ctx.
Read(itemQBIndex))
11494 {
11496 return false;
11497 }
11498 if (itemQBIndex != -1 && player)
11499 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11500 }
11501 }
11502
11503 if (version < 140)
11504 {
11505
11506 if (!LoadVariables(ctx, version))
11507 {
11509 return false;
11510 }
11511 }
11512
11513
11515 {
11517 return false;
11518 }
11519 if (version >= 132)
11520 {
11522 if (raib)
11523 {
11525 {
11527 return false;
11528 }
11529 }
11530 }
11531
11533 return true;
11534 }
11535
11536
11537
11539 {
11540 super.OnStoreSave(ctx);
11541
11542 PlayerBase player;
11543 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11544 {
11546
11547 int itemQBIndex = -1;
11548 itemQBIndex = player.FindQuickBarEntityIndex(this);
11549 ctx.
Write(itemQBIndex);
11550 }
11551 else
11552 {
11554 }
11555
11557
11559 if (raib)
11560 {
11562 }
11563 }
11564
11565
11567 {
11568 super.AfterStoreLoad();
11569
11571 {
11573 }
11574
11576 {
11579 }
11580 }
11581
11583 {
11584 super.EEOnAfterLoad();
11585
11587 {
11589 }
11590
11593 }
11594
11596 {
11597 return false;
11598 }
11599
11600
11601
11603 {
11605 {
11606 #ifdef PLATFORM_CONSOLE
11607
11609 {
11611 if (menu)
11612 {
11614 }
11615 }
11616 #endif
11617 }
11618
11620 {
11623 }
11624
11626 {
11627 SetWeightDirty();
11629 }
11631 {
11634 }
11635
11637 {
11640 }
11642 {
11645 }
11646
11647 super.OnVariablesSynchronized();
11648 }
11649
11650
11651
11653 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11654 {
11655 if (!IsServerCheck(allow_client))
11656 return false;
11657
11659 return false;
11660
11663
11664 if (value <= (min + 0.001))
11665 value = min;
11666
11667 if (value == min)
11668 {
11669 if (destroy_config)
11670 {
11671 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11672 if (dstr)
11673 {
11675 this.Delete();
11676 return true;
11677 }
11678 }
11679 else if (destroy_forced)
11680 {
11682 this.Delete();
11683 return true;
11684 }
11685
11687 }
11688
11691
11693 {
11695
11696 if (delta)
11698 }
11699
11701
11702 return false;
11703 }
11704
11705
11707 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11708 {
11710 }
11711
11713 {
11716 }
11717
11719 {
11722 }
11723
11726 {
11727 float value_clamped = Math.Clamp(value, 0, 1);
11729 SetQuantity(result, destroy_config, destroy_forced);
11730 }
11731
11732
11735 {
11737 }
11738
11740 {
11742 }
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11754 {
11755 int slot = -1;
11756 if (GetInventory())
11757 {
11758 InventoryLocation il = new InventoryLocation;
11759 GetInventory().GetCurrentInventoryLocation(il);
11761 }
11762
11764 }
11765
11767 {
11768 float quantity_max = 0;
11769
11771 {
11772 if (attSlotID != -1)
11773 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11774
11775 if (quantity_max <= 0)
11777 }
11778
11779 if (quantity_max <= 0)
11781
11782 return quantity_max;
11783 }
11784
11786 {
11788 }
11789
11791 {
11793 }
11794
11795
11797 {
11799 }
11800
11802 {
11804 }
11805
11807 {
11809 }
11810
11811
11813 {
11814
11815 float weightEx = GetWeightEx();
11816 float special = GetInventoryAndCargoWeight();
11817 return weightEx - special;
11818 }
11819
11820
11822 {
11824 }
11825
11827 {
11829 {
11830 #ifdef DEVELOPER
11831 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11832 {
11833 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11835 }
11836 #endif
11837
11838 return GetQuantity() * GetConfigWeightModified();
11839 }
11840 else if (HasEnergyManager())
11841 {
11842 #ifdef DEVELOPER
11843 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11844 {
11845 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11846 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11847 }
11848 #endif
11849 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11850 }
11851 else
11852 {
11853 #ifdef DEVELOPER
11854 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11855 {
11856 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11857 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11858 }
11859 #endif
11860 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11861 }
11862 }
11863
11866 {
11867 int item_count = 0;
11869
11870 if (GetInventory().GetCargo() != NULL)
11871 {
11872 item_count = GetInventory().GetCargo().GetItemCount();
11873 }
11874
11875 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11876 {
11877 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11878 if (item)
11879 item_count += item.GetNumberOfItems();
11880 }
11881 return item_count;
11882 }
11883
11886 {
11887 float weight = 0;
11888 float wetness = 1;
11889 if (include_wetness)
11892 {
11893 weight = wetness * m_ConfigWeight;
11894 }
11896 {
11897 weight = 1;
11898 }
11899 return weight;
11900 }
11901
11902
11903
11905 {
11906 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11907 {
11908 GameInventory inv = GetInventory();
11909 array<EntityAI> items = new array<EntityAI>;
11911 for (int i = 0; i < items.Count(); i++)
11912 {
11914 if (item)
11915 {
11917 }
11918 }
11919 }
11920 }
11921
11922
11923
11924
11926 {
11927 float energy = 0;
11928 if (HasEnergyManager())
11929 {
11930 energy = GetCompEM().GetEnergy();
11931 }
11932 return energy;
11933 }
11934
11935
11937 {
11938 super.OnEnergyConsumed();
11939
11941 }
11942
11944 {
11945 super.OnEnergyAdded();
11946
11948 }
11949
11950
11952 {
11953 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11954 {
11956 {
11957 float energy_0to1 = GetCompEM().GetEnergy0To1();
11959 }
11960 }
11961 }
11962
11963
11965 {
11966 return ConfigGetFloat("heatIsolation");
11967 }
11968
11970 {
11972 }
11973
11975 {
11976 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11977 if (
GetGame().ConfigIsExisting(paramPath))
11979
11980 return 0.0;
11981 }
11982
11984 {
11985 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11986 if (
GetGame().ConfigIsExisting(paramPath))
11988
11989 return 0.0;
11990 }
11991
11992 override void SetWet(
float value,
bool allow_client =
false)
11993 {
11994 if (!IsServerCheck(allow_client))
11995 return;
11996
11999
12001
12002 m_VarWet = Math.Clamp(value, min, max);
12003
12005 {
12008 }
12009 }
12010
12011 override void AddWet(
float value)
12012 {
12014 }
12015
12017 {
12019 }
12020
12022 {
12024 }
12025
12027 {
12029 }
12030
12032 {
12034 }
12035
12037 {
12039 }
12040
12041 override void OnWetChanged(
float newVal,
float oldVal)
12042 {
12045 if (newLevel != oldLevel)
12046 {
12048 }
12049 }
12050
12052 {
12053 SetWeightDirty();
12054 }
12055
12057 {
12058 return GetWetLevelInternal(
m_VarWet);
12059 }
12060
12061
12062
12064 {
12066 }
12067
12069 {
12071 }
12072
12074 {
12076 }
12077
12079 {
12081 }
12082
12083
12084
12086 {
12087 if (ConfigIsExisting("itemModelLength"))
12088 {
12089 return ConfigGetFloat("itemModelLength");
12090 }
12091 return 0;
12092 }
12093
12095 {
12096 if (ConfigIsExisting("itemAttachOffset"))
12097 {
12098 return ConfigGetFloat("itemAttachOffset");
12099 }
12100 return 0;
12101 }
12102
12103 override void SetCleanness(
int value,
bool allow_client =
false)
12104 {
12105 if (!IsServerCheck(allow_client))
12106 return;
12107
12109
12111
12114 }
12115
12117 {
12119 }
12120
12122 {
12123 return true;
12124 }
12125
12126
12127
12128
12130 {
12132 }
12133
12135 {
12137 }
12138
12139
12140
12141
12142 override void SetColor(
int r,
int g,
int b,
int a)
12143 {
12149 }
12151 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12152 {
12157 }
12158
12160 {
12162 }
12163
12166 {
12167 int r,g,b,a;
12169 r = r/255;
12170 g = g/255;
12171 b = b/255;
12172 a = a/255;
12173 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12174 }
12175
12176
12177
12178 override void SetLiquidType(
int value,
bool allow_client =
false)
12179 {
12180 if (!IsServerCheck(allow_client))
12181 return;
12182
12187 }
12188
12190 {
12191 return ConfigGetInt("varLiquidTypeInit");
12192 }
12193
12195 {
12197 }
12198
12200 {
12202 SetFrozen(false);
12203 }
12204
12207 {
12208 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12209 }
12210
12211
12214 {
12215 PlayerBase nplayer;
12216 if (PlayerBase.CastTo(nplayer, player))
12217 {
12219
12220 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12221 }
12222 }
12223
12224
12227 {
12228 PlayerBase nplayer;
12229 if (PlayerBase.CastTo(nplayer,player))
12230 {
12231
12232 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12233
12234 }
12235
12236
12237 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12238
12239
12240 if (HasEnergyManager())
12241 {
12242 GetCompEM().UpdatePlugState();
12243 }
12244 }
12245
12246
12248 {
12249 super.OnPlacementStarted(player);
12250
12252 }
12253
12254 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12255 {
12257 {
12258 m_AdminLog.OnPlacementComplete(player,
this);
12259 }
12260
12261 super.OnPlacementComplete(player, position, orientation);
12262 }
12263
12264
12265
12266
12267
12269 {
12271 {
12272 return true;
12273 }
12274 else
12275 {
12276 return false;
12277 }
12278 }
12279
12280
12282 {
12284 {
12286 }
12287 }
12288
12289
12291 {
12293 }
12294
12296 {
12298 }
12299
12300 override void InsertAgent(
int agent,
float count = 1)
12301 {
12302 if (count < 1)
12303 return;
12304
12306 }
12307
12310 {
12312 }
12313
12314
12316 {
12318 }
12319
12320
12321
12322
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
12362 {
12364 return false;
12365 return true;
12366 }
12367
12369 {
12370
12372 }
12373
12374
12377 {
12378 super.CheckForRoofLimited(timeTresholdMS);
12379
12381 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12382 {
12383 m_PreviousRoofTestTime = time;
12384 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12385 }
12386 }
12387
12388
12390 {
12392 {
12393 return 0;
12394 }
12395
12396 if (GetInventory().GetAttachmentSlotsCount() != 0)
12397 {
12398 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12399 if (filter)
12400 return filter.GetProtectionLevel(type, false, system);
12401 else
12402 return 0;
12403 }
12404
12405 string subclassPath, entryName;
12406
12407 switch (type)
12408 {
12410 entryName = "biological";
12411 break;
12413 entryName = "chemical";
12414 break;
12415 default:
12416 entryName = "biological";
12417 break;
12418 }
12419
12420 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12421
12423 }
12424
12425
12426
12429 {
12430 if (!IsMagazine())
12432
12434 }
12435
12436
12437
12438
12439
12444 {
12445 return true;
12446 }
12447
12449 {
12451 }
12452
12453
12454
12455
12456
12458 {
12459 if (parent)
12460 {
12461 if (parent.IsInherited(DayZInfected))
12462 return true;
12463
12464 if (!parent.IsRuined())
12465 return true;
12466 }
12467
12468 return true;
12469 }
12470
12472 {
12473 if (!super.CanPutAsAttachment(parent))
12474 {
12475 return false;
12476 }
12477
12478 if (!IsRuined() && !parent.IsRuined())
12479 {
12480 return true;
12481 }
12482
12483 return false;
12484 }
12485
12487 {
12488
12489
12490
12491
12492 return super.CanReceiveItemIntoCargo(item);
12493 }
12494
12496 {
12497
12498
12499
12500
12501 GameInventory attachmentInv = attachment.GetInventory();
12503 {
12504 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12505 return false;
12506 }
12507
12508 InventoryLocation loc = new InventoryLocation();
12509 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12510 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12511 return false;
12512
12513 return super.CanReceiveAttachment(attachment, slotId);
12514 }
12515
12517 {
12518 if (!super.CanReleaseAttachment(attachment))
12519 return false;
12520
12521 return GetInventory().AreChildrenAccessible();
12522 }
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12545 {
12546 int id = muzzle_owner.GetMuzzleID();
12547 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12548
12549 if (WPOF_array)
12550 {
12551 for (int i = 0; i < WPOF_array.Count(); i++)
12552 {
12553 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12554
12555 if (WPOF)
12556 {
12557 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12558 }
12559 }
12560 }
12561 }
12562
12563
12565 {
12566 int id = muzzle_owner.GetMuzzleID();
12568
12569 if (WPOBE_array)
12570 {
12571 for (int i = 0; i < WPOBE_array.Count(); i++)
12572 {
12573 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12574
12575 if (WPOBE)
12576 {
12577 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12578 }
12579 }
12580 }
12581 }
12582
12583
12585 {
12586 int id = muzzle_owner.GetMuzzleID();
12587 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12588
12589 if (WPOOH_array)
12590 {
12591 for (int i = 0; i < WPOOH_array.Count(); i++)
12592 {
12593 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12594
12595 if (WPOOH)
12596 {
12597 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12598 }
12599 }
12600 }
12601 }
12602
12603
12605 {
12606 int id = muzzle_owner.GetMuzzleID();
12607 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12608
12609 if (WPOOH_array)
12610 {
12611 for (int i = 0; i < WPOOH_array.Count(); i++)
12612 {
12613 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12614
12615 if (WPOOH)
12616 {
12617 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12618 }
12619 }
12620 }
12621 }
12622
12623
12625 {
12626 int id = muzzle_owner.GetMuzzleID();
12627 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12628
12629 if (WPOOH_array)
12630 {
12631 for (int i = 0; i < WPOOH_array.Count(); i++)
12632 {
12633 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12634
12635 if (WPOOH)
12636 {
12637 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12638 }
12639 }
12640 }
12641 }
12642
12643
12644
12646 {
12648 {
12649 return true;
12650 }
12651
12652 return false;
12653 }
12654
12656 {
12658 {
12659 return true;
12660 }
12661
12662 return false;
12663 }
12664
12666 {
12668 {
12669 return true;
12670 }
12671
12672 return false;
12673 }
12674
12676 {
12677 return false;
12678 }
12679
12682 {
12683 return UATimeSpent.DEFAULT_DEPLOY;
12684 }
12685
12686
12687
12688
12690 {
12692 SetSynchDirty();
12693 }
12694
12696 {
12698 }
12699
12700
12702 {
12703 return false;
12704 }
12705
12708 {
12709 string att_type = "None";
12710
12711 if (ConfigIsExisting("soundAttType"))
12712 {
12713 att_type = ConfigGetString("soundAttType");
12714 }
12715
12717 }
12718
12720 {
12722 }
12723
12724
12725
12726
12727
12731
12733 {
12736
12738 }
12739
12740
12742 {
12744 return;
12745
12747
12750
12753
12754 SoundParameters params = new SoundParameters();
12758 }
12759
12760
12762 {
12764 return;
12765
12767 SetSynchDirty();
12768
12771 }
12772
12773
12775 {
12777 return;
12778
12780 SetSynchDirty();
12781
12784 }
12785
12787 {
12789 }
12790
12792 {
12794 }
12795
12798 {
12799 if (!
GetGame().IsDedicatedServer())
12800 {
12801 if (ConfigIsExisting("attachSoundSet"))
12802 {
12803 string cfg_path = "";
12804 string soundset = "";
12805 string type_name =
GetType();
12806
12809 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12810 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12811
12812 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12813 {
12814 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12815 {
12816 if (cfg_slot_array[i] == slot_type)
12817 {
12818 soundset = cfg_soundset_array[i];
12819 break;
12820 }
12821 }
12822 }
12823
12824 if (soundset != "")
12825 {
12826 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12828 }
12829 }
12830 }
12831 }
12832
12834 {
12835
12836 }
12837
12838 void OnApply(PlayerBase player);
12839
12841 {
12842 return 1.0;
12843 };
12844
12846 {
12848 }
12849
12851 {
12853 }
12854
12856
12858 {
12859 SetDynamicPhysicsLifeTime(0.01);
12861 }
12862
12864 {
12865 array<string> zone_names = new array<string>;
12866 GetDamageZones(zone_names);
12867 for (int i = 0; i < zone_names.Count(); i++)
12868 {
12869 SetHealthMax(zone_names.Get(i),"Health");
12870 }
12871 SetHealthMax("","Health");
12872 }
12873
12876 {
12877 float global_health = GetHealth01("","Health");
12878 array<string> zones = new array<string>;
12879 GetDamageZones(zones);
12880
12881 for (int i = 0; i < zones.Count(); i++)
12882 {
12883 SetHealth01(zones.Get(i),"Health",global_health);
12884 }
12885 }
12886
12889 {
12890 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12891 }
12892
12894 {
12895 if (!hasRootAsPlayer)
12896 {
12897 if (refParentIB)
12898 {
12899
12900 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12901 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12902
12903 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12904 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12905
12908 }
12909 else
12910 {
12911
12914 }
12915 }
12916 }
12917
12919 {
12921 {
12922 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12923 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12924 {
12925 float heatPermCoef = 1.0;
12927 while (ent)
12928 {
12929 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12930 ent = ent.GetHierarchyParent();
12931 }
12932
12933 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12934 }
12935 }
12936 }
12937
12939 {
12940
12941 EntityAI parent = GetHierarchyParent();
12942 if (!parent)
12943 {
12944 hasParent = false;
12945 hasRootAsPlayer = false;
12946 }
12947 else
12948 {
12949 hasParent = true;
12950 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12951 refParentIB =
ItemBase.Cast(parent);
12952 }
12953 }
12954
12955 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12956 {
12957
12958 }
12959
12961 {
12962
12963 return false;
12964 }
12965
12967 {
12968
12969
12970 return false;
12971 }
12972
12974 {
12975
12976 return false;
12977 }
12978
12981 {
12982 return !GetIsFrozen() &&
IsOpen();
12983 }
12984
12986 {
12987 bool hasParent = false, hasRootAsPlayer = false;
12989
12990 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12991 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12992
12993 if (wwtu || foodDecay)
12994 {
12998
12999 if (processWetness || processTemperature || processDecay)
13000 {
13002
13003 if (processWetness)
13004 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13005
13006 if (processTemperature)
13008
13009 if (processDecay)
13010 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13011 }
13012 }
13013 }
13014
13017 {
13019 }
13020
13022 {
13025
13026 return super.GetTemperatureFreezeThreshold();
13027 }
13028
13030 {
13033
13034 return super.GetTemperatureThawThreshold();
13035 }
13036
13038 {
13041
13042 return super.GetItemOverheatThreshold();
13043 }
13044
13046 {
13048 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13049
13050 return super.GetTemperatureFreezeTime();
13051 }
13052
13054 {
13056 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13057
13058 return super.GetTemperatureThawTime();
13059 }
13060
13065
13067 {
13068 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13069 }
13070
13072 {
13073 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13074 }
13075
13078 {
13080 }
13081
13083 {
13085 }
13086
13088 {
13090 }
13091
13094 {
13095 return null;
13096 }
13097
13100 {
13101 return false;
13102 }
13103
13105 {
13107 {
13110 if (!trg)
13111 {
13113 explosive = this;
13114 }
13115
13116 explosive.PairRemote(trg);
13118
13119 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13120 trg.SetPersistentPairID(persistentID);
13121 explosive.SetPersistentPairID(persistentID);
13122
13123 return true;
13124 }
13125 return false;
13126 }
13127
13130 {
13131 float ret = 1.0;
13134 ret *= GetHealth01();
13135
13136 return ret;
13137 }
13138
13139 #ifdef DEVELOPER
13140 override void SetDebugItem()
13141 {
13142 super.SetDebugItem();
13143 _itemBase = this;
13144 }
13145
13147 {
13148 string text = super.GetDebugText();
13149
13151 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13152
13153 return text;
13154 }
13155 #endif
13156
13158 {
13159 return true;
13160 }
13161
13163
13165
13167 {
13170 }
13171
13172
13180
13196}
13197
13199{
13201 if (entity)
13202 {
13203 bool is_item = entity.IsInherited(
ItemBase);
13204 if (is_item && full_quantity)
13205 {
13208 }
13209 }
13210 else
13211 {
13213 return NULL;
13214 }
13215 return entity;
13216}
13217
13219{
13220 if (item)
13221 {
13222 if (health > 0)
13223 item.SetHealth("", "", health);
13224
13225 if (item.CanHaveTemperature())
13226 {
13228 if (item.CanFreeze())
13229 item.SetFrozen(false);
13230 }
13231
13232 if (item.HasEnergyManager())
13233 {
13234 if (quantity >= 0)
13235 {
13236 item.GetCompEM().SetEnergy0To1(quantity);
13237 }
13238 else
13239 {
13241 }
13242 }
13243 else if (item.IsMagazine())
13244 {
13245 Magazine mag = Magazine.Cast(item);
13246 if (quantity >= 0)
13247 {
13248 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13249 }
13250 else
13251 {
13253 }
13254
13255 }
13256 else
13257 {
13258 if (quantity >= 0)
13259 {
13260 item.SetQuantityNormalized(quantity, false);
13261 }
13262 else
13263 {
13265 }
13266
13267 }
13268 }
13269}
13270
13271#ifdef DEVELOPER
13273#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.