8413{
8415 {
8416 return true;
8417 }
8418};
8419
8420
8421
8423{
8427
8429
8432
8433
8434
8435
8436
8445
8451
8456
8461
8482 protected bool m_IsResultOfSplit
8483
8485
8490
8491
8492
8494
8498
8499
8500
8502
8505
8506
8507
8513
8514
8522
8525
8526
8528
8529
8531
8532
8537
8538
8543
8544
8546
8547
8549 {
8554
8555 if (!
GetGame().IsDedicatedServer())
8556 {
8558 {
8560
8562 {
8564 }
8565 }
8566
8569 }
8570
8571 m_OldLocation = null;
8572
8574 {
8576 }
8577
8578 if (ConfigIsExisting("headSelectionsToHide"))
8579 {
8582 }
8583
8585 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8586 {
8588 }
8589
8591
8592 m_IsResultOfSplit = false;
8593
8595 }
8596
8598 {
8599 super.InitItemVariables();
8600
8606 m_Count = ConfigGetInt(
"count");
8607
8610
8615
8618
8623
8635
8639
8640
8643 if (ConfigIsExisting("canBeSplit"))
8644 {
8647 }
8648
8650 if (ConfigIsExisting("itemBehaviour"))
8652
8653
8656 RegisterNetSyncVariableInt("m_VarLiquidType");
8657 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8658
8659 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8660 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8661 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8662
8663 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8664 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8665 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8666 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8667
8668 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8669 RegisterNetSyncVariableBool("m_IsTakeable");
8670 RegisterNetSyncVariableBool("m_IsHologram");
8671
8674 {
8677 }
8678
8680
8682 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8684
8685 }
8686
8688 {
8690 }
8691
8693 {
8696 {
8701 }
8702 }
8703
8704 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8705 {
8707 {
8710 }
8711
8713 }
8714
8716 {
8722 }
8723
8725
8727 {
8729
8730 if (!action)
8731 {
8732 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8733 return;
8734 }
8735
8737 if (!ai)
8738 {
8740 return;
8741 }
8742
8744 if (!action_array)
8745 {
8746 action_array = new array<ActionBase_Basic>;
8748 }
8749 if (LogManager.IsActionLogEnable())
8750 {
8751 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8752 }
8753
8754 if (action_array.Find(action) != -1)
8755 {
8756 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8757 }
8758 else
8759 {
8760 action_array.Insert(action);
8761 }
8762 }
8763
8765 {
8767 ActionBase action = player.GetActionManager().GetAction(actionName);
8770
8771 if (action_array)
8772 {
8773 action_array.RemoveItem(action);
8774 }
8775 }
8776
8777
8778
8780 {
8781 ActionOverrideData overrideData = new ActionOverrideData();
8785
8787 if (!actionMap)
8788 {
8791 }
8792
8793 actionMap.Insert(this.
Type(), overrideData);
8794
8795 }
8796
8798
8800
8801
8803 {
8806
8809
8810 string config_to_search = "CfgVehicles";
8811 string muzzle_owner_config;
8812
8814 {
8815 if (IsInherited(Weapon))
8816 config_to_search = "CfgWeapons";
8817
8818 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8819
8820 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8821
8823
8824 if (config_OnFire_subclass_count > 0)
8825 {
8826 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8827
8828 for (int i = 0; i < config_OnFire_subclass_count; i++)
8829 {
8830 string particle_class = "";
8832 string config_OnFire_entry = config_OnFire_class + particle_class;
8833 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8834 WPOF_array.Insert(WPOF);
8835 }
8836
8837
8839 }
8840 }
8841
8843 {
8844 config_to_search = "CfgWeapons";
8845 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8846
8847 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8848
8850
8851 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8852 {
8853 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8854
8855 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8856 {
8857 string particle_class2 = "";
8859 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8860 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8861 WPOBE_array.Insert(WPOBE);
8862 }
8863
8864
8866 }
8867 }
8868 }
8869
8870
8872 {
8875
8877 {
8878 string config_to_search = "CfgVehicles";
8879
8880 if (IsInherited(Weapon))
8881 config_to_search = "CfgWeapons";
8882
8883 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8884 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8885
8886 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8887 {
8888
8890
8892 {
8894 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8896 return;
8897 }
8898
8901
8902
8903
8905 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8906
8907 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8908 {
8909 string particle_class = "";
8911 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8913
8914 if (entry_type == CT_CLASS)
8915 {
8916 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8917 WPOOH_array.Insert(WPOF);
8918 }
8919 }
8920
8921
8923 }
8924 }
8925 }
8926
8928 {
8930 }
8931
8933 {
8935 {
8937
8940
8943
8944 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8945 }
8946 }
8947
8949 {
8951 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8952
8954 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8955
8957 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8958
8960 {
8962 }
8963 }
8964
8966 {
8968 }
8969
8971 {
8974 else
8976
8978 {
8981 }
8982 else
8983 {
8986
8989 }
8990
8992 }
8993
8995 {
8997 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8998 }
8999
9001 {
9003 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9005 }
9006
9008 {
9010 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9011 }
9012
9014 {
9017
9018 OverheatingParticle OP = new OverheatingParticle();
9023
9025 }
9026
9028 {
9031
9032 return -1;
9033 }
9034
9036 {
9038 {
9041
9042 for (int i = count; i > 0; --i)
9043 {
9044 int id = i - 1;
9047
9050
9051 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9052 {
9053 if (p)
9054 {
9057 }
9058 }
9059 }
9060 }
9061 }
9062
9064 {
9066 {
9068 {
9069 int id = i - 1;
9071
9072 if (OP)
9073 {
9075
9076 if (p)
9077 {
9079 }
9080
9081 delete OP;
9082 }
9083 }
9084
9087 }
9088 }
9089
9092 {
9093 return 0.0;
9094 }
9095
9096
9098 {
9099 return 250;
9100 }
9101
9103 {
9104 return 0;
9105 }
9106
9109 {
9111 return true;
9112
9113 return false;
9114 }
9115
9118 {
9121
9123 {
9125 }
9126 else
9127 {
9128
9130 }
9131
9133 }
9134
9141 {
9142 return -1;
9143 }
9144
9145
9146
9147
9149 {
9151 {
9153 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9154
9155 if (r_index >= 0)
9156 {
9157 InventoryLocation r_il = new InventoryLocation;
9158 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9159
9160 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9163 {
9164 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9165 }
9167 {
9168 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9169 }
9170
9171 }
9172
9173 player.GetHumanInventory().ClearUserReservedLocation(this);
9174 }
9175
9178 }
9179
9180
9181
9182
9184 {
9185 return ItemBase.m_DebugActionsMask;
9186 }
9187
9189 {
9190 return ItemBase.m_DebugActionsMask & mask;
9191 }
9192
9194 {
9195 ItemBase.m_DebugActionsMask = mask;
9196 }
9197
9199 {
9200 ItemBase.m_DebugActionsMask |= mask;
9201 }
9202
9204 {
9205 ItemBase.m_DebugActionsMask &= ~mask;
9206 }
9207
9209 {
9211 {
9213 }
9214 else
9215 {
9217 }
9218 }
9219
9220
9222 {
9223 if (GetEconomyProfile())
9224 {
9225 float q_max = GetEconomyProfile().GetQuantityMax();
9226 if (q_max > 0)
9227 {
9228 float q_min = GetEconomyProfile().GetQuantityMin();
9229 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9230
9232 {
9233 ComponentEnergyManager comp = GetCompEM();
9235 {
9237 }
9238 }
9240 {
9242
9243 }
9244
9245 }
9246 }
9247 }
9248
9251 {
9252 EntityAI parent = GetHierarchyParent();
9253
9254 if (parent)
9255 {
9256 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9257 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9258 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9259 }
9260 }
9261
9264 {
9265 EntityAI parent = GetHierarchyParent();
9266
9267 if (parent)
9268 {
9269 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9270 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9271 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9272 }
9273 }
9274
9276 {
9277
9278
9279
9280
9282
9284 {
9285 if (ScriptInputUserData.CanStoreInputUserData())
9286 {
9287 ScriptInputUserData ctx = new ScriptInputUserData;
9293 ctx.
Write(use_stack_max);
9296
9298 {
9299 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9300 }
9301 }
9302 }
9303 else if (!
GetGame().IsMultiplayer())
9304 {
9306 }
9307 }
9308
9310 {
9312 }
9313
9315 {
9317 }
9318
9320 {
9322 }
9323
9325 {
9326
9327 return false;
9328 }
9329
9331 {
9332 return false;
9333 }
9334
9338 {
9339 return false;
9340 }
9341
9343 {
9344 return "";
9345 }
9346
9348
9350 {
9351 return false;
9352 }
9353
9355 {
9356 return true;
9357 }
9358
9359
9360
9362 {
9363 return true;
9364 }
9365
9367 {
9368 return true;
9369 }
9370
9372 {
9373 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9375 }
9376
9378 {
9380 }
9381
9383 {
9385 if (!is_being_placed)
9387 SetSynchDirty();
9388 }
9389
9390
9392
9394 {
9396 }
9397
9399 {
9401 }
9402
9404 {
9405 return 1;
9406 }
9407
9409 {
9410 return false;
9411 }
9412
9414 {
9416 SetSynchDirty();
9417 }
9418
9419
9420
9421
9422
9423
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
9454 {
9455 super.OnMovedInsideCargo(container);
9456
9457 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9458 }
9459
9460 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9461 {
9462 super.EEItemLocationChanged(oldLoc,newLoc);
9463
9464 PlayerBase new_player = null;
9465 PlayerBase old_player = null;
9466
9467 if (newLoc.GetParent())
9468 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9469
9470 if (oldLoc.GetParent())
9471 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9472
9474 {
9475 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9476
9477 if (r_index >= 0)
9478 {
9479 InventoryLocation r_il = new InventoryLocation;
9480 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9481
9482 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9485 {
9486 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9487 }
9489 {
9490 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9491 }
9492
9493 }
9494 }
9495
9497 {
9498 if (new_player)
9499 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9500
9501 if (new_player == old_player)
9502 {
9503
9504 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9505 {
9507 {
9508 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9509 {
9510 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9511 }
9512 }
9513 else
9514 {
9515 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9516 }
9517 }
9518
9519 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9520 {
9521 int type = oldLoc.GetType();
9523 {
9524 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9525 }
9527 {
9528 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9529 }
9530 }
9531 if (!m_OldLocation)
9532 {
9533 m_OldLocation = new InventoryLocation;
9534 }
9535 m_OldLocation.Copy(oldLoc);
9536 }
9537 else
9538 {
9539 if (m_OldLocation)
9540 {
9541 m_OldLocation.Reset();
9542 }
9543 }
9544
9546 }
9547 else
9548 {
9549 if (new_player)
9550 {
9551 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9552 if (res_index >= 0)
9553 {
9554 InventoryLocation il = new InventoryLocation;
9555 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9557 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9560 {
9561 il.
GetParent().GetOnReleaseLock().Invoke(it);
9562 }
9564 {
9566 }
9567
9568 }
9569 }
9571 {
9572
9574 }
9575
9576 if (m_OldLocation)
9577 {
9578 m_OldLocation.Reset();
9579 }
9580 }
9581 }
9582
9583 override void EOnContact(IEntity other, Contact extra)
9584 {
9586 {
9587 int liquidType = -1;
9589 if (impactSpeed > 0.0)
9590 {
9592 #ifndef SERVER
9594 #else
9596 SetSynchDirty();
9597 #endif
9599 }
9600 }
9601
9602 #ifdef SERVER
9603 if (GetCompEM() && GetCompEM().IsPlugged())
9604 {
9605 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9606 GetCompEM().UnplugThis();
9607 }
9608 #endif
9609 }
9610
9612
9614 {
9616 }
9617
9619 {
9620
9621 }
9622
9624 {
9625 super.OnItemLocationChanged(old_owner, new_owner);
9626
9627 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9628 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9629
9630 if (!relatedPlayer && playerNew)
9631 relatedPlayer = playerNew;
9632
9633 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9634 {
9636 if (actionMgr)
9637 {
9638 ActionBase currentAction = actionMgr.GetRunningAction();
9639 if (currentAction)
9641 }
9642 }
9643
9644 Man ownerPlayerOld = null;
9645 Man ownerPlayerNew = null;
9646
9647 if (old_owner)
9648 {
9649 if (old_owner.
IsMan())
9650 {
9651 ownerPlayerOld = Man.Cast(old_owner);
9652 }
9653 else
9654 {
9655 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9656 }
9657 }
9658 else
9659 {
9661 {
9663
9664 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9665 {
9666 GetCompEM().UnplugThis();
9667 }
9668 }
9669 }
9670
9671 if (new_owner)
9672 {
9673 if (new_owner.
IsMan())
9674 {
9675 ownerPlayerNew = Man.Cast(new_owner);
9676 }
9677 else
9678 {
9679 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9680 }
9681 }
9682
9683 if (ownerPlayerOld != ownerPlayerNew)
9684 {
9685 if (ownerPlayerOld)
9686 {
9687 array<EntityAI> subItemsExit = new array<EntityAI>;
9689 for (int i = 0; i < subItemsExit.Count(); i++)
9690 {
9693 }
9694 }
9695
9696 if (ownerPlayerNew)
9697 {
9698 array<EntityAI> subItemsEnter = new array<EntityAI>;
9700 for (int j = 0; j < subItemsEnter.Count(); j++)
9701 {
9704 }
9705 }
9706 }
9707 else if (ownerPlayerNew != null)
9708 {
9709 PlayerBase nplayer;
9710 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9711 {
9712 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9714 for (int k = 0; k < subItemsUpdate.Count(); k++)
9715 {
9717 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9718 }
9719 }
9720 }
9721
9722 if (old_owner)
9723 old_owner.OnChildItemRemoved(this);
9724 if (new_owner)
9725 new_owner.OnChildItemReceived(this);
9726 }
9727
9728
9730 {
9731 super.EEDelete(parent);
9732 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9733 if (player)
9734 {
9736
9737 if (player.IsAlive())
9738 {
9739 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9740 if (r_index >= 0)
9741 {
9742 InventoryLocation r_il = new InventoryLocation;
9743 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9744
9745 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9748 {
9749 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9750 }
9752 {
9753 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9754 }
9755
9756 }
9757
9758 player.RemoveQuickBarEntityShortcut(this);
9759 }
9760 }
9761 }
9762
9764 {
9765 super.EEKilled(killer);
9766
9769 {
9770 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9771 {
9772 if (IsMagazine())
9773 {
9774 if (Magazine.Cast(this).GetAmmoCount() > 0)
9775 {
9777 }
9778 }
9779 else
9780 {
9782 }
9783 }
9784 }
9785 }
9786
9788 {
9789 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9790
9791 super.OnWasAttached(parent, slot_id);
9792
9795
9797 }
9798
9800 {
9801 super.OnWasDetached(parent, slot_id);
9802
9805 }
9806
9808 {
9809 int idx;
9812
9813 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9814 if (inventory_slots.Count() < 1)
9815 {
9816 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9817 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9818 }
9819 else
9820 {
9821 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9822 }
9823
9824 idx = inventory_slots.Find(slot);
9825 if (idx < 0)
9826 return "";
9827
9828 return attach_types.Get(idx);
9829 }
9830
9832 {
9833 int idx = -1;
9834 string slot;
9835
9838
9839 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9840 if (inventory_slots.Count() < 1)
9841 {
9842 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9843 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9844 }
9845 else
9846 {
9847 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9848 if (detach_types.Count() < 1)
9849 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9850 }
9851
9852 for (int i = 0; i < inventory_slots.Count(); i++)
9853 {
9854 slot = inventory_slots.Get(i);
9855 }
9856
9857 if (slot != "")
9858 {
9859 if (detach_types.Count() == 1)
9860 idx = 0;
9861 else
9862 idx = inventory_slots.Find(slot);
9863 }
9864 if (idx < 0)
9865 return "";
9866
9867 return detach_types.Get(idx);
9868 }
9869
9871 {
9872
9874
9875
9876 float min_time = 1;
9877 float max_time = 3;
9878 float delay = Math.RandomFloat(min_time, max_time);
9879
9880 explode_timer.Run(delay, this, "DoAmmoExplosion");
9881 }
9882
9884 {
9885 Magazine magazine = Magazine.Cast(this);
9886 int pop_sounds_count = 6;
9887 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9888
9889
9890 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9891 string sound_name = pop_sounds[ sound_idx ];
9893
9894
9895 magazine.ServerAddAmmoCount(-1);
9896
9897
9898 float min_temp_to_explode = 100;
9899
9900 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9901 {
9903 }
9904 }
9905
9906
9907 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9908 {
9909 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9910
9911 const int CHANCE_DAMAGE_CARGO = 4;
9912 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9913 const int CHANCE_DAMAGE_NOTHING = 2;
9914
9916 {
9917 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9918 int chances;
9919 int rnd;
9920
9921 if (GetInventory().GetCargo())
9922 {
9923 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9924 rnd = Math.RandomInt(0,chances);
9925
9926 if (rnd < CHANCE_DAMAGE_CARGO)
9927 {
9929 }
9930 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9931 {
9933 }
9934 }
9935 else
9936 {
9937 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9938 rnd = Math.RandomInt(0,chances);
9939
9940 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9941 {
9943 }
9944 }
9945 }
9946 }
9947
9949 {
9950 if (GetInventory().GetCargo())
9951 {
9952 int item_count = GetInventory().GetCargo().GetItemCount();
9953 if (item_count > 0)
9954 {
9955 int random_pick = Math.RandomInt(0, item_count);
9957 if (!item.IsExplosive())
9958 {
9959 item.AddHealth("","",damage);
9960 return true;
9961 }
9962 }
9963 }
9964 return false;
9965 }
9966
9968 {
9969 int attachment_count = GetInventory().AttachmentCount();
9970 if (attachment_count > 0)
9971 {
9972 int random_pick = Math.RandomInt(0, attachment_count);
9973 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9974 if (!attachment.IsExplosive())
9975 {
9976 attachment.AddHealth("","",damage);
9977 return true;
9978 }
9979 }
9980 return false;
9981 }
9982
9984 {
9986 }
9987
9989 {
9991 return GetInventory().CanRemoveEntity();
9992
9993 return false;
9994 }
9995
9997 {
9999 return;
10000
10002 {
10003 if (ScriptInputUserData.CanStoreInputUserData())
10004 {
10005 ScriptInputUserData ctx = new ScriptInputUserData;
10010 ctx.
Write(destination_entity);
10012 ctx.
Write(slot_id);
10014 }
10015 }
10016 else if (!
GetGame().IsMultiplayer())
10017 {
10019 }
10020 }
10021
10023 {
10025 return;
10026
10027 float split_quantity_new;
10031 InventoryLocation loc = new InventoryLocation;
10032
10033 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10034 {
10036 split_quantity_new = stack_max;
10037 else
10039
10040 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10041 if (new_item)
10042 {
10043 new_item.SetResultOfSplit(true);
10044 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10046 new_item.SetQuantity(split_quantity_new);
10047 }
10048 }
10049 else if (destination_entity && slot_id == -1)
10050 {
10051 if (quantity > stack_max)
10052 split_quantity_new = stack_max;
10053 else
10054 split_quantity_new = quantity;
10055
10057 {
10060 }
10061
10062 if (new_item)
10063 {
10064 new_item.SetResultOfSplit(true);
10065 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10067 new_item.SetQuantity(split_quantity_new);
10068 }
10069 }
10070 else
10071 {
10072 if (stack_max != 0)
10073 {
10075 {
10077 }
10078
10079 if (split_quantity_new == 0)
10080 {
10081 if (!
GetGame().IsMultiplayer())
10082 player.PhysicalPredictiveDropItem(this);
10083 else
10084 player.ServerDropEntity(this);
10085 return;
10086 }
10087
10089
10090 if (new_item)
10091 {
10092 new_item.SetResultOfSplit(true);
10093 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10095 new_item.SetQuantity(stack_max);
10096 new_item.PlaceOnSurface();
10097 }
10098 }
10099 }
10100 }
10101
10103 {
10105 return;
10106
10107 float split_quantity_new;
10111 InventoryLocation loc = new InventoryLocation;
10112
10113 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10114 {
10116 split_quantity_new = stack_max;
10117 else
10119
10120 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10121 if (new_item)
10122 {
10123 new_item.SetResultOfSplit(true);
10124 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10126 new_item.SetQuantity(split_quantity_new);
10127 }
10128 }
10129 else if (destination_entity && slot_id == -1)
10130 {
10131 if (quantity > stack_max)
10132 split_quantity_new = stack_max;
10133 else
10134 split_quantity_new = quantity;
10135
10137 {
10140 }
10141
10142 if (new_item)
10143 {
10144 new_item.SetResultOfSplit(true);
10145 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10147 new_item.SetQuantity(split_quantity_new);
10148 }
10149 }
10150 else
10151 {
10152 if (stack_max != 0)
10153 {
10155 {
10157 }
10158
10160
10161 if (new_item)
10162 {
10163 new_item.SetResultOfSplit(true);
10164 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10166 new_item.SetQuantity(stack_max);
10167 new_item.PlaceOnSurface();
10168 }
10169 }
10170 }
10171 }
10172
10174 {
10176 return;
10177
10179 {
10180 if (ScriptInputUserData.CanStoreInputUserData())
10181 {
10182 ScriptInputUserData ctx = new ScriptInputUserData;
10187 dst.WriteToContext(ctx);
10189 }
10190 }
10191 else if (!
GetGame().IsMultiplayer())
10192 {
10194 }
10195 }
10196
10198 {
10200 return;
10201
10203 {
10204 if (ScriptInputUserData.CanStoreInputUserData())
10205 {
10206 ScriptInputUserData ctx = new ScriptInputUserData;
10211 ctx.
Write(destination_entity);
10217 }
10218 }
10219 else if (!
GetGame().IsMultiplayer())
10220 {
10222 }
10223 }
10224
10226 {
10228 }
10229
10231 {
10233 return this;
10234
10236 float split_quantity_new;
10238 if (dst.IsValid())
10239 {
10240 int slot_id = dst.GetSlot();
10242
10243 if (quantity > stack_max)
10244 split_quantity_new = stack_max;
10245 else
10246 split_quantity_new = quantity;
10247
10249
10250 if (new_item)
10251 {
10252 new_item.SetResultOfSplit(true);
10253 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10256 }
10257
10258 return new_item;
10259 }
10260
10261 return null;
10262 }
10263
10265 {
10267 return;
10268
10270 float split_quantity_new;
10272 if (destination_entity)
10273 {
10275 if (quantity > stackable)
10276 split_quantity_new = stackable;
10277 else
10278 split_quantity_new = quantity;
10279
10280 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10281 if (new_item)
10282 {
10283 new_item.SetResultOfSplit(true);
10284 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10286 new_item.SetQuantity(split_quantity_new);
10287 }
10288 }
10289 }
10290
10292 {
10294 return;
10295
10297 {
10298 if (ScriptInputUserData.CanStoreInputUserData())
10299 {
10300 ScriptInputUserData ctx = new ScriptInputUserData;
10305 ItemBase destination_entity =
this;
10306 ctx.
Write(destination_entity);
10310 }
10311 }
10312 else if (!
GetGame().IsMultiplayer())
10313 {
10315 }
10316 }
10317
10319 {
10321 return;
10322
10324 float split_quantity_new;
10326 if (player)
10327 {
10329 if (quantity > stackable)
10330 split_quantity_new = stackable;
10331 else
10332 split_quantity_new = quantity;
10333
10334 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10335 new_item =
ItemBase.Cast(in_hands);
10336 if (new_item)
10337 {
10338 new_item.SetResultOfSplit(true);
10339 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10341 new_item.SetQuantity(split_quantity_new);
10342 }
10343 }
10344 }
10345
10347 {
10349 return;
10350
10352 float split_quantity_new = Math.Floor(quantity * 0.5);
10353
10355
10356 if (new_item)
10357 {
10358 if (new_item.GetQuantityMax() < split_quantity_new)
10359 {
10360 split_quantity_new = new_item.GetQuantityMax();
10361 }
10362
10363 new_item.SetResultOfSplit(true);
10364 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10365
10367 {
10370 }
10371 else
10372 {
10375 }
10376 }
10377 }
10378
10380 {
10382 return;
10383
10385 float split_quantity_new = Math.Floor(quantity / 2);
10386
10387 InventoryLocation invloc = new InventoryLocation;
10389
10391 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10392
10393 if (new_item)
10394 {
10395 if (new_item.GetQuantityMax() < split_quantity_new)
10396 {
10397 split_quantity_new = new_item.GetQuantityMax();
10398 }
10400 {
10403 }
10404 else
10405 {
10408 }
10409 }
10410 }
10411
10414 {
10415 SetWeightDirty();
10417
10418 if (parent)
10419 parent.OnAttachmentQuantityChangedEx(this, delta);
10420
10422 {
10424 {
10426 }
10428 {
10429 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10431 }
10432 }
10433
10434 }
10435
10438 {
10439
10440 }
10441
10444 {
10446 }
10447
10449 {
10450 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10451
10453 {
10454 if (newLevel == GameConstants.STATE_RUINED)
10455 {
10457 EntityAI parent = GetHierarchyParent();
10458 if (parent && parent.IsFireplace())
10459 {
10460 CargoBase cargo = GetInventory().GetCargo();
10461 if (cargo)
10462 {
10464 {
10466 }
10467 }
10468 }
10469 }
10470
10472 {
10473
10475 return;
10476 }
10477
10478 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10479 {
10481 }
10482 }
10483 }
10484
10485
10487 {
10488 super.OnRightClick();
10489
10491 {
10493 {
10494 if (ScriptInputUserData.CanStoreInputUserData())
10495 {
10496 vector m4[4];
10498
10499 EntityAI root = GetHierarchyRoot();
10500
10501 InventoryLocation dst = new InventoryLocation;
10503 {
10504 if (root)
10505 {
10506 root.GetTransform(m4);
10508 }
10509 else
10510 GetInventory().GetCurrentInventoryLocation(dst);
10511 }
10512 else
10513 {
10515
10516
10517 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10518 {
10519 if (root)
10520 {
10521 root.GetTransform(m4);
10523 }
10524 else
10525 GetInventory().GetCurrentInventoryLocation(dst);
10526 }
10527 else
10528 {
10529 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10530 }
10531 }
10532
10533 ScriptInputUserData ctx = new ScriptInputUserData;
10541 }
10542 }
10543 else if (!
GetGame().IsMultiplayer())
10544 {
10546 }
10547 }
10548 }
10549
10550 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10551 {
10552
10553 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10554 return false;
10555
10556 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10557 return false;
10558
10559
10561 return false;
10562
10563
10564 Magazine mag = Magazine.Cast(this);
10565 if (mag)
10566 {
10567 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10568 return false;
10569
10570 if (stack_max_limit)
10571 {
10572 Magazine other_mag = Magazine.Cast(other_item);
10573 if (other_item)
10574 {
10575 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10576 return false;
10577 }
10578
10579 }
10580 }
10581 else
10582 {
10583
10585 return false;
10586
10588 return false;
10589 }
10590
10591 PlayerBase player = null;
10592 if (CastTo(player, GetHierarchyRootPlayer()))
10593 {
10594 if (player.GetInventory().HasAttachment(this))
10595 return false;
10596
10597 if (player.IsItemsToDelete())
10598 return false;
10599 }
10600
10601 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10602 return false;
10603
10604 int slotID;
10606 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10607 return false;
10608
10609 return true;
10610 }
10611
10613 {
10615 }
10616
10618 {
10619 return m_IsResultOfSplit;
10620 }
10621
10623 {
10624 m_IsResultOfSplit = value;
10625 }
10626
10628 {
10630 }
10631
10633 {
10634 float other_item_quantity = other_item.GetQuantity();
10635 float this_free_space;
10636
10638
10640
10641 if (other_item_quantity > this_free_space)
10642 {
10643 return this_free_space;
10644 }
10645 else
10646 {
10647 return other_item_quantity;
10648 }
10649 }
10650
10652 {
10654 }
10655
10657 {
10659 return;
10660
10661 if (!IsMagazine() && other_item)
10662 {
10664 if (quantity_used != 0)
10665 {
10666 float hp1 = GetHealth01("","");
10667 float hp2 = other_item.GetHealth01("","");
10668 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10669 hpResult = hpResult / (
GetQuantity() + quantity_used);
10670
10671 hpResult *= GetMaxHealth();
10672 Math.Round(hpResult);
10673 SetHealth("", "Health", hpResult);
10674
10676 other_item.AddQuantity(-quantity_used);
10677 }
10678 }
10680 }
10681
10683 {
10684 #ifdef SERVER
10685 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10686 GetHierarchyParent().IncreaseLifetimeUp();
10687 #endif
10688 };
10689
10691 {
10692 PlayerBase p = PlayerBase.Cast(player);
10693
10694 array<int> recipesIds = p.m_Recipes;
10695 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10696 if (moduleRecipesManager)
10697 {
10698 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10699 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10700 }
10701
10702 for (int i = 0;i < recipesIds.Count(); i++)
10703 {
10704 int key = recipesIds.Get(i);
10705 string recipeName = moduleRecipesManager.GetRecipeName(key);
10707 }
10708 }
10709
10710
10711 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10712 {
10713 super.GetDebugActions(outputList);
10714
10715
10720
10721
10725
10729
10730
10733
10734
10736 {
10739 }
10740
10742
10745
10749 }
10750
10751
10752
10753
10755 {
10756 super.OnAction(action_id, player, ctx);
10757 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10758 {
10759 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10760 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10761 PlayerBase p = PlayerBase.Cast(player);
10762 if (
EActions.RECIPES_RANGE_START < 1000)
10763 {
10764 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10765 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10766 }
10767 }
10768 #ifndef SERVER
10769 else if (action_id ==
EActions.WATCH_PLAYER)
10770 {
10771 PluginDeveloper.SetDeveloperItemClientEx(player);
10772 }
10773 #endif
10775 {
10776 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10777 {
10778 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10779 OnDebugButtonPressServer(id + 1);
10780 }
10781
10782 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10783 {
10784 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10786 }
10787
10788 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10789 {
10790 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10792 }
10793
10794 else if (action_id ==
EActions.ADD_QUANTITY)
10795 {
10796 if (IsMagazine())
10797 {
10798 Magazine mag = Magazine.Cast(this);
10799 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10800 }
10801 else
10802 {
10804 }
10805
10806 if (m_EM)
10807 {
10808 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10809 }
10810
10811 }
10812
10813 else if (action_id ==
EActions.REMOVE_QUANTITY)
10814 {
10815 if (IsMagazine())
10816 {
10817 Magazine mag2 = Magazine.Cast(this);
10818 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10819 }
10820 else
10821 {
10823 }
10824 if (m_EM)
10825 {
10826 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10827 }
10828
10829 }
10830
10831 else if (action_id ==
EActions.SET_QUANTITY_0)
10832 {
10834
10835 if (m_EM)
10836 {
10837 m_EM.SetEnergy(0);
10838 }
10839 }
10840
10841 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10842 {
10844
10845 if (m_EM)
10846 {
10847 m_EM.SetEnergy(m_EM.GetEnergyMax());
10848 }
10849 }
10850
10851 else if (action_id ==
EActions.ADD_HEALTH)
10852 {
10853 AddHealth("","",GetMaxHealth("","Health")/5);
10854 }
10855 else if (action_id ==
EActions.REMOVE_HEALTH)
10856 {
10857 AddHealth("","",-GetMaxHealth("","Health")/5);
10858 }
10859 else if (action_id ==
EActions.DESTROY_HEALTH)
10860 {
10861 SetHealth01("","",0);
10862 }
10863 else if (action_id ==
EActions.WATCH_ITEM)
10864 {
10866 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10867 #ifdef DEVELOPER
10868 SetDebugDeveloper_item(this);
10869 #endif
10870 }
10871
10872 else if (action_id ==
EActions.ADD_TEMPERATURE)
10873 {
10874 AddTemperature(20);
10875
10876 }
10877
10878 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10879 {
10880 AddTemperature(-20);
10881
10882 }
10883
10884 else if (action_id ==
EActions.FLIP_FROZEN)
10885 {
10886 SetFrozen(!GetIsFrozen());
10887
10888 }
10889
10890 else if (action_id ==
EActions.ADD_WETNESS)
10891 {
10893
10894 }
10895
10896 else if (action_id ==
EActions.REMOVE_WETNESS)
10897 {
10899
10900 }
10901
10902 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10903 {
10906
10907
10908 }
10909
10910 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10911 {
10914 }
10915
10916 else if (action_id ==
EActions.MAKE_SPECIAL)
10917 {
10918 auto debugParams = DebugSpawnParams.WithPlayer(player);
10919 OnDebugSpawnEx(debugParams);
10920 }
10921
10922 else if (action_id ==
EActions.DELETE)
10923 {
10924 Delete();
10925 }
10926
10927 }
10928
10929
10930 return false;
10931 }
10932
10933
10934
10935
10939
10942
10943
10944
10946 {
10947 return false;
10948 }
10949
10950
10952 {
10953 return true;
10954 }
10955
10956
10958 {
10959 return true;
10960 }
10961
10962
10963
10965 {
10966 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10968 }
10969
10972 {
10973 return null;
10974 }
10975
10977 {
10978 return false;
10979 }
10980
10982 {
10983 return false;
10984 }
10985
10989
10990
10992 {
10993 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10994 return module_repairing.CanRepair(this, item_repair_kit);
10995 }
10996
10997
10998 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10999 {
11000 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11001 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11002 }
11003
11004
11006 {
11007
11008
11009
11010
11011
11012
11013
11014
11015 return 1;
11016 }
11017
11018
11019
11021 {
11023 }
11024
11025
11026
11028 {
11030 }
11031
11032
11041 {
11042 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11043
11044 if (player)
11045 {
11046 player.MessageStatus(text);
11047 }
11048 }
11049
11050
11059 {
11060 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11061
11062 if (player)
11063 {
11064 player.MessageAction(text);
11065 }
11066 }
11067
11068
11077 {
11078 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11079
11080 if (player)
11081 {
11082 player.MessageFriendly(text);
11083 }
11084 }
11085
11086
11095 {
11096 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11097
11098 if (player)
11099 {
11100 player.MessageImportant(text);
11101 }
11102 }
11103
11105 {
11106 return true;
11107 }
11108
11109
11110 override bool KindOf(
string tag)
11111 {
11112 bool found = false;
11113 string item_name = this.
GetType();
11116
11117 int array_size = item_tag_array.Count();
11118 for (int i = 0; i < array_size; i++)
11119 {
11120 if (item_tag_array.Get(i) == tag)
11121 {
11122 found = true;
11123 break;
11124 }
11125 }
11126 return found;
11127 }
11128
11129
11131 {
11132
11133 super.OnRPC(sender, rpc_type,ctx);
11134
11135
11136 switch (rpc_type)
11137 {
11138 #ifndef SERVER
11139 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11140 Param2<bool, string> p = new Param2<bool, string>(false, "");
11141
11143 return;
11144
11145 bool play = p.param1;
11146 string soundSet = p.param2;
11147
11148 if (play)
11149 {
11151 {
11153 {
11155 }
11156 }
11157 else
11158 {
11160 }
11161 }
11162 else
11163 {
11165 }
11166
11167 break;
11168 #endif
11169
11170 }
11171
11173 {
11175 }
11176 }
11177
11178
11179
11180
11182 {
11183 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11184 return plugin.GetID(
name);
11185 }
11186
11188 {
11189 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11190 return plugin.GetName(id);
11191 }
11192
11195 {
11196
11197
11198 int varFlags;
11199 if (!ctx.
Read(varFlags))
11200 return;
11201
11202 if (varFlags & ItemVariableFlags.FLOAT)
11203 {
11205 }
11206 }
11207
11209 {
11210
11211 super.SerializeNumericalVars(floats_out);
11212
11213
11214
11216 {
11218 }
11219
11221 {
11223 }
11224
11226 {
11228 }
11229
11231 {
11236 }
11237
11239 {
11241 }
11242 }
11243
11245 {
11246
11247 super.DeSerializeNumericalVars(floats);
11248
11249
11250 int index = 0;
11251 int mask = Math.Round(floats.Get(index));
11252
11253 index++;
11254
11256 {
11258 {
11260 }
11261 else
11262 {
11263 float quantity = floats.Get(index);
11264 SetQuantity(quantity,
true,
false,
false,
false);
11265 }
11266 index++;
11267 }
11268
11270 {
11271 float wet = floats.Get(index);
11273 index++;
11274 }
11275
11277 {
11278 int liquidtype = Math.Round(floats.Get(index));
11280 index++;
11281 }
11282
11284 {
11286 index++;
11288 index++;
11290 index++;
11292 index++;
11293 }
11294
11296 {
11297 int cleanness = Math.Round(floats.Get(index));
11299 index++;
11300 }
11301 }
11302
11304 {
11305 super.WriteVarsToCTX(ctx);
11306
11307
11309 {
11311 }
11312
11314 {
11316 }
11317
11319 {
11321 }
11322
11324 {
11325 int r,g,b,a;
11331 }
11332
11334 {
11336 }
11337 }
11338
11340 {
11341 if (!super.ReadVarsFromCTX(ctx,version))
11342 return false;
11343
11344 int intValue;
11345 float value;
11346
11347 if (version < 140)
11348 {
11349 if (!ctx.
Read(intValue))
11350 return false;
11351
11352 m_VariablesMask = intValue;
11353 }
11354
11356 {
11357 if (!ctx.
Read(value))
11358 return false;
11359
11361 {
11363 }
11364 else
11365 {
11367 }
11368 }
11369
11370 if (version < 140)
11371 {
11373 {
11374 if (!ctx.
Read(value))
11375 return false;
11376 SetTemperatureDirect(value);
11377 }
11378 }
11379
11381 {
11382 if (!ctx.
Read(value))
11383 return false;
11385 }
11386
11388 {
11389 if (!ctx.
Read(intValue))
11390 return false;
11392 }
11393
11395 {
11396 int r,g,b,a;
11398 return false;
11400 return false;
11402 return false;
11404 return false;
11405
11407 }
11408
11410 {
11411 if (!ctx.
Read(intValue))
11412 return false;
11414 }
11415
11416 if (version >= 138 && version < 140)
11417 {
11419 {
11420 if (!ctx.
Read(intValue))
11421 return false;
11422 SetFrozen(intValue);
11423 }
11424 }
11425
11426 return true;
11427 }
11428
11429
11431 {
11434 {
11436 }
11437
11438 if (!super.OnStoreLoad(ctx, version))
11439 {
11441 return false;
11442 }
11443
11444 if (version >= 114)
11445 {
11446 bool hasQuickBarIndexSaved;
11447
11448 if (!ctx.
Read(hasQuickBarIndexSaved))
11449 {
11451 return false;
11452 }
11453
11454 if (hasQuickBarIndexSaved)
11455 {
11456 int itmQBIndex;
11457
11458
11459 if (!ctx.
Read(itmQBIndex))
11460 {
11462 return false;
11463 }
11464
11465 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11466 if (itmQBIndex != -1 && parentPlayer)
11467 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11468 }
11469 }
11470 else
11471 {
11472
11473 PlayerBase player;
11474 int itemQBIndex;
11475 if (version ==
int.
MAX)
11476 {
11477 if (!ctx.
Read(itemQBIndex))
11478 {
11480 return false;
11481 }
11482 }
11483 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11484 {
11485
11486 if (!ctx.
Read(itemQBIndex))
11487 {
11489 return false;
11490 }
11491 if (itemQBIndex != -1 && player)
11492 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11493 }
11494 }
11495
11496 if (version < 140)
11497 {
11498
11499 if (!LoadVariables(ctx, version))
11500 {
11502 return false;
11503 }
11504 }
11505
11506
11508 {
11510 return false;
11511 }
11512 if (version >= 132)
11513 {
11515 if (raib)
11516 {
11518 {
11520 return false;
11521 }
11522 }
11523 }
11524
11526 return true;
11527 }
11528
11529
11530
11532 {
11533 super.OnStoreSave(ctx);
11534
11535 PlayerBase player;
11536 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11537 {
11539
11540 int itemQBIndex = -1;
11541 itemQBIndex = player.FindQuickBarEntityIndex(this);
11542 ctx.
Write(itemQBIndex);
11543 }
11544 else
11545 {
11547 }
11548
11550
11552 if (raib)
11553 {
11555 }
11556 }
11557
11558
11560 {
11561 super.AfterStoreLoad();
11562
11564 {
11566 }
11567
11569 {
11572 }
11573 }
11574
11576 {
11577 super.EEOnAfterLoad();
11578
11580 {
11582 }
11583
11586 }
11587
11589 {
11590 return false;
11591 }
11592
11593
11594
11596 {
11598 {
11599 #ifdef PLATFORM_CONSOLE
11600
11602 {
11604 if (menu)
11605 {
11607 }
11608 }
11609 #endif
11610 }
11611
11613 {
11616 }
11617
11619 {
11620 SetWeightDirty();
11622 }
11624 {
11627 }
11628
11630 {
11633 }
11635 {
11638 }
11639
11640 super.OnVariablesSynchronized();
11641 }
11642
11643
11644
11646 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11647 {
11648 if (!IsServerCheck(allow_client))
11649 return false;
11650
11652 return false;
11653
11656
11657 if (value <= (min + 0.001))
11658 value = min;
11659
11660 if (value == min)
11661 {
11662 if (destroy_config)
11663 {
11664 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11665 if (dstr)
11666 {
11668 this.Delete();
11669 return true;
11670 }
11671 }
11672 else if (destroy_forced)
11673 {
11675 this.Delete();
11676 return true;
11677 }
11678
11680 }
11681
11684
11686 {
11688
11689 if (delta)
11691 }
11692
11694
11695 return false;
11696 }
11697
11698
11700 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11701 {
11703 }
11704
11706 {
11709 }
11710
11712 {
11715 }
11716
11719 {
11720 float value_clamped = Math.Clamp(value, 0, 1);
11722 SetQuantity(result, destroy_config, destroy_forced);
11723 }
11724
11725
11728 {
11730 }
11731
11733 {
11735 }
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11747 {
11748 int slot = -1;
11749 if (GetInventory())
11750 {
11751 InventoryLocation il = new InventoryLocation;
11752 GetInventory().GetCurrentInventoryLocation(il);
11754 }
11755
11757 }
11758
11760 {
11761 float quantity_max = 0;
11762
11764 {
11765 if (attSlotID != -1)
11766 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11767
11768 if (quantity_max <= 0)
11770 }
11771
11772 if (quantity_max <= 0)
11774
11775 return quantity_max;
11776 }
11777
11779 {
11781 }
11782
11784 {
11786 }
11787
11788
11790 {
11792 }
11793
11795 {
11797 }
11798
11800 {
11802 }
11803
11804
11806 {
11807
11808 float weightEx = GetWeightEx();
11809 float special = GetInventoryAndCargoWeight();
11810 return weightEx - special;
11811 }
11812
11813
11815 {
11817 }
11818
11820 {
11822 {
11823 #ifdef DEVELOPER
11824 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11825 {
11826 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11828 }
11829 #endif
11830
11831 return GetQuantity() * GetConfigWeightModified();
11832 }
11833 else if (HasEnergyManager())
11834 {
11835 #ifdef DEVELOPER
11836 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11837 {
11838 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11839 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11840 }
11841 #endif
11842 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11843 }
11844 else
11845 {
11846 #ifdef DEVELOPER
11847 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11848 {
11849 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11850 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11851 }
11852 #endif
11853 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11854 }
11855 }
11856
11859 {
11860 int item_count = 0;
11862
11863 if (GetInventory().GetCargo() != NULL)
11864 {
11865 item_count = GetInventory().GetCargo().GetItemCount();
11866 }
11867
11868 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11869 {
11870 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11871 if (item)
11872 item_count += item.GetNumberOfItems();
11873 }
11874 return item_count;
11875 }
11876
11879 {
11880 float weight = 0;
11881 float wetness = 1;
11882 if (include_wetness)
11885 {
11886 weight = wetness * m_ConfigWeight;
11887 }
11889 {
11890 weight = 1;
11891 }
11892 return weight;
11893 }
11894
11895
11896
11898 {
11899 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11900 {
11901 GameInventory inv = GetInventory();
11902 array<EntityAI> items = new array<EntityAI>;
11904 for (int i = 0; i < items.Count(); i++)
11905 {
11907 if (item)
11908 {
11910 }
11911 }
11912 }
11913 }
11914
11915
11916
11917
11919 {
11920 float energy = 0;
11921 if (HasEnergyManager())
11922 {
11923 energy = GetCompEM().GetEnergy();
11924 }
11925 return energy;
11926 }
11927
11928
11930 {
11931 super.OnEnergyConsumed();
11932
11934 }
11935
11937 {
11938 super.OnEnergyAdded();
11939
11941 }
11942
11943
11945 {
11946 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11947 {
11949 {
11950 float energy_0to1 = GetCompEM().GetEnergy0To1();
11952 }
11953 }
11954 }
11955
11956
11958 {
11959 return ConfigGetFloat("heatIsolation");
11960 }
11961
11963 {
11965 }
11966
11968 {
11969 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11970 if (
GetGame().ConfigIsExisting(paramPath))
11972
11973 return 0.0;
11974 }
11975
11977 {
11978 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11979 if (
GetGame().ConfigIsExisting(paramPath))
11981
11982 return 0.0;
11983 }
11984
11985 override void SetWet(
float value,
bool allow_client =
false)
11986 {
11987 if (!IsServerCheck(allow_client))
11988 return;
11989
11992
11994
11995 m_VarWet = Math.Clamp(value, min, max);
11996
11998 {
12001 }
12002 }
12003
12004 override void AddWet(
float value)
12005 {
12007 }
12008
12010 {
12012 }
12013
12015 {
12017 }
12018
12020 {
12022 }
12023
12025 {
12027 }
12028
12030 {
12032 }
12033
12034 override void OnWetChanged(
float newVal,
float oldVal)
12035 {
12038 if (newLevel != oldLevel)
12039 {
12041 }
12042 }
12043
12045 {
12046 SetWeightDirty();
12047 }
12048
12050 {
12051 return GetWetLevelInternal(
m_VarWet);
12052 }
12053
12054
12055
12057 {
12059 }
12060
12062 {
12064 }
12065
12067 {
12069 }
12070
12072 {
12074 }
12075
12076
12077
12079 {
12080 if (ConfigIsExisting("itemModelLength"))
12081 {
12082 return ConfigGetFloat("itemModelLength");
12083 }
12084 return 0;
12085 }
12086
12088 {
12089 if (ConfigIsExisting("itemAttachOffset"))
12090 {
12091 return ConfigGetFloat("itemAttachOffset");
12092 }
12093 return 0;
12094 }
12095
12096 override void SetCleanness(
int value,
bool allow_client =
false)
12097 {
12098 if (!IsServerCheck(allow_client))
12099 return;
12100
12102
12104
12107 }
12108
12110 {
12112 }
12113
12115 {
12116 return true;
12117 }
12118
12119
12120
12121
12123 {
12125 }
12126
12128 {
12130 }
12131
12132
12133
12134
12135 override void SetColor(
int r,
int g,
int b,
int a)
12136 {
12142 }
12144 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12145 {
12150 }
12151
12153 {
12155 }
12156
12159 {
12160 int r,g,b,a;
12162 r = r/255;
12163 g = g/255;
12164 b = b/255;
12165 a = a/255;
12166 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12167 }
12168
12169
12170
12171 override void SetLiquidType(
int value,
bool allow_client =
false)
12172 {
12173 if (!IsServerCheck(allow_client))
12174 return;
12175
12180 }
12181
12183 {
12184 return ConfigGetInt("varLiquidTypeInit");
12185 }
12186
12188 {
12190 }
12191
12193 {
12195 SetFrozen(false);
12196 }
12197
12200 {
12201 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12202 }
12203
12204
12207 {
12208 PlayerBase nplayer;
12209 if (PlayerBase.CastTo(nplayer, player))
12210 {
12212
12213 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12214 }
12215 }
12216
12217
12220 {
12221 PlayerBase nplayer;
12222 if (PlayerBase.CastTo(nplayer,player))
12223 {
12224
12225 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12226
12227 }
12228
12229
12230 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12231
12232
12233 if (HasEnergyManager())
12234 {
12235 GetCompEM().UpdatePlugState();
12236 }
12237 }
12238
12239
12241 {
12242 super.OnPlacementStarted(player);
12243
12245 }
12246
12247 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12248 {
12250 {
12251 m_AdminLog.OnPlacementComplete(player,
this);
12252 }
12253
12254 super.OnPlacementComplete(player, position, orientation);
12255 }
12256
12257
12258
12259
12260
12262 {
12264 {
12265 return true;
12266 }
12267 else
12268 {
12269 return false;
12270 }
12271 }
12272
12273
12275 {
12277 {
12279 }
12280 }
12281
12282
12284 {
12286 }
12287
12289 {
12291 }
12292
12293 override void InsertAgent(
int agent,
float count = 1)
12294 {
12295 if (count < 1)
12296 return;
12297
12299 }
12300
12303 {
12305 }
12306
12307
12309 {
12311 }
12312
12313
12314
12315
12316
12317
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
12355 {
12357 return false;
12358 return true;
12359 }
12360
12362 {
12363
12365 }
12366
12367
12370 {
12371 super.CheckForRoofLimited(timeTresholdMS);
12372
12374 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12375 {
12376 m_PreviousRoofTestTime = time;
12377 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12378 }
12379 }
12380
12381
12383 {
12385 {
12386 return 0;
12387 }
12388
12389 if (GetInventory().GetAttachmentSlotsCount() != 0)
12390 {
12391 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12392 if (filter)
12393 return filter.GetProtectionLevel(type, false, system);
12394 else
12395 return 0;
12396 }
12397
12398 string subclassPath, entryName;
12399
12400 switch (type)
12401 {
12403 entryName = "biological";
12404 break;
12406 entryName = "chemical";
12407 break;
12408 default:
12409 entryName = "biological";
12410 break;
12411 }
12412
12413 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12414
12416 }
12417
12418
12419
12422 {
12423 if (!IsMagazine())
12425
12427 }
12428
12429
12430
12431
12432
12437 {
12438 return true;
12439 }
12440
12442 {
12444 }
12445
12446
12447
12448
12449
12451 {
12452 if (parent)
12453 {
12454 if (parent.IsInherited(DayZInfected))
12455 return true;
12456
12457 if (!parent.IsRuined())
12458 return true;
12459 }
12460
12461 return true;
12462 }
12463
12465 {
12466 if (!super.CanPutAsAttachment(parent))
12467 {
12468 return false;
12469 }
12470
12471 if (!IsRuined() && !parent.IsRuined())
12472 {
12473 return true;
12474 }
12475
12476 return false;
12477 }
12478
12480 {
12481
12482
12483
12484
12485 return super.CanReceiveItemIntoCargo(item);
12486 }
12487
12489 {
12490
12491
12492
12493
12494 GameInventory attachmentInv = attachment.GetInventory();
12496 {
12497 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12498 return false;
12499 }
12500
12501 InventoryLocation loc = new InventoryLocation();
12502 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12503 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12504 return false;
12505
12506 return super.CanReceiveAttachment(attachment, slotId);
12507 }
12508
12510 {
12511 if (!super.CanReleaseAttachment(attachment))
12512 return false;
12513
12514 return GetInventory().AreChildrenAccessible();
12515 }
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12538 {
12539 int id = muzzle_owner.GetMuzzleID();
12540 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12541
12542 if (WPOF_array)
12543 {
12544 for (int i = 0; i < WPOF_array.Count(); i++)
12545 {
12546 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12547
12548 if (WPOF)
12549 {
12550 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12551 }
12552 }
12553 }
12554 }
12555
12556
12558 {
12559 int id = muzzle_owner.GetMuzzleID();
12561
12562 if (WPOBE_array)
12563 {
12564 for (int i = 0; i < WPOBE_array.Count(); i++)
12565 {
12566 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12567
12568 if (WPOBE)
12569 {
12570 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12571 }
12572 }
12573 }
12574 }
12575
12576
12578 {
12579 int id = muzzle_owner.GetMuzzleID();
12580 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12581
12582 if (WPOOH_array)
12583 {
12584 for (int i = 0; i < WPOOH_array.Count(); i++)
12585 {
12586 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12587
12588 if (WPOOH)
12589 {
12590 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12591 }
12592 }
12593 }
12594 }
12595
12596
12598 {
12599 int id = muzzle_owner.GetMuzzleID();
12600 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12601
12602 if (WPOOH_array)
12603 {
12604 for (int i = 0; i < WPOOH_array.Count(); i++)
12605 {
12606 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12607
12608 if (WPOOH)
12609 {
12610 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12611 }
12612 }
12613 }
12614 }
12615
12616
12618 {
12619 int id = muzzle_owner.GetMuzzleID();
12620 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12621
12622 if (WPOOH_array)
12623 {
12624 for (int i = 0; i < WPOOH_array.Count(); i++)
12625 {
12626 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12627
12628 if (WPOOH)
12629 {
12630 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12631 }
12632 }
12633 }
12634 }
12635
12636
12637
12639 {
12641 {
12642 return true;
12643 }
12644
12645 return false;
12646 }
12647
12649 {
12651 {
12652 return true;
12653 }
12654
12655 return false;
12656 }
12657
12659 {
12661 {
12662 return true;
12663 }
12664
12665 return false;
12666 }
12667
12669 {
12670 return false;
12671 }
12672
12675 {
12676 return UATimeSpent.DEFAULT_DEPLOY;
12677 }
12678
12679
12680
12681
12683 {
12685 SetSynchDirty();
12686 }
12687
12689 {
12691 }
12692
12693
12695 {
12696 return false;
12697 }
12698
12701 {
12702 string att_type = "None";
12703
12704 if (ConfigIsExisting("soundAttType"))
12705 {
12706 att_type = ConfigGetString("soundAttType");
12707 }
12708
12710 }
12711
12713 {
12715 }
12716
12717
12718
12719
12720
12724
12726 {
12729
12731 }
12732
12733
12735 {
12737 return;
12738
12740
12743
12746
12747 SoundParameters params = new SoundParameters();
12751 }
12752
12753
12755 {
12757 return;
12758
12760 SetSynchDirty();
12761
12764 }
12765
12766
12768 {
12770 return;
12771
12773 SetSynchDirty();
12774
12777 }
12778
12780 {
12782 }
12783
12785 {
12787 }
12788
12791 {
12792 if (!
GetGame().IsDedicatedServer())
12793 {
12794 if (ConfigIsExisting("attachSoundSet"))
12795 {
12796 string cfg_path = "";
12797 string soundset = "";
12798 string type_name =
GetType();
12799
12802 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12803 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12804
12805 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12806 {
12807 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12808 {
12809 if (cfg_slot_array[i] == slot_type)
12810 {
12811 soundset = cfg_soundset_array[i];
12812 break;
12813 }
12814 }
12815 }
12816
12817 if (soundset != "")
12818 {
12819 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12821 }
12822 }
12823 }
12824 }
12825
12827 {
12828
12829 }
12830
12831 void OnApply(PlayerBase player);
12832
12834 {
12835 return 1.0;
12836 };
12837
12839 {
12841 }
12842
12844 {
12846 }
12847
12849
12851 {
12852 SetDynamicPhysicsLifeTime(0.01);
12854 }
12855
12857 {
12858 array<string> zone_names = new array<string>;
12859 GetDamageZones(zone_names);
12860 for (int i = 0; i < zone_names.Count(); i++)
12861 {
12862 SetHealthMax(zone_names.Get(i),"Health");
12863 }
12864 SetHealthMax("","Health");
12865 }
12866
12869 {
12870 float global_health = GetHealth01("","Health");
12871 array<string> zones = new array<string>;
12872 GetDamageZones(zones);
12873
12874 for (int i = 0; i < zones.Count(); i++)
12875 {
12876 SetHealth01(zones.Get(i),"Health",global_health);
12877 }
12878 }
12879
12882 {
12883 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12884 }
12885
12887 {
12888 if (!hasRootAsPlayer)
12889 {
12890 if (refParentIB)
12891 {
12892
12893 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12894 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12895
12896 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12897 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12898
12901 }
12902 else
12903 {
12904
12907 }
12908 }
12909 }
12910
12912 {
12914 {
12915 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12916 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12917 {
12918 float heatPermCoef = 1.0;
12920 while (ent)
12921 {
12922 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12923 ent = ent.GetHierarchyParent();
12924 }
12925
12926 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12927 }
12928 }
12929 }
12930
12932 {
12933
12934 EntityAI parent = GetHierarchyParent();
12935 if (!parent)
12936 {
12937 hasParent = false;
12938 hasRootAsPlayer = false;
12939 }
12940 else
12941 {
12942 hasParent = true;
12943 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12944 refParentIB =
ItemBase.Cast(parent);
12945 }
12946 }
12947
12948 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12949 {
12950
12951 }
12952
12954 {
12955
12956 return false;
12957 }
12958
12960 {
12961
12962
12963 return false;
12964 }
12965
12967 {
12968
12969 return false;
12970 }
12971
12974 {
12975 return !GetIsFrozen() &&
IsOpen();
12976 }
12977
12979 {
12980 bool hasParent = false, hasRootAsPlayer = false;
12982
12983 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12984 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12985
12986 if (wwtu || foodDecay)
12987 {
12991
12992 if (processWetness || processTemperature || processDecay)
12993 {
12995
12996 if (processWetness)
12997 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12998
12999 if (processTemperature)
13001
13002 if (processDecay)
13003 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13004 }
13005 }
13006 }
13007
13010 {
13012 }
13013
13015 {
13018
13019 return super.GetTemperatureFreezeThreshold();
13020 }
13021
13023 {
13026
13027 return super.GetTemperatureThawThreshold();
13028 }
13029
13031 {
13034
13035 return super.GetItemOverheatThreshold();
13036 }
13037
13039 {
13041 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13042
13043 return super.GetTemperatureFreezeTime();
13044 }
13045
13047 {
13049 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13050
13051 return super.GetTemperatureThawTime();
13052 }
13053
13058
13060 {
13061 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13062 }
13063
13065 {
13066 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13067 }
13068
13071 {
13073 }
13074
13076 {
13078 }
13079
13081 {
13083 }
13084
13087 {
13088 return null;
13089 }
13090
13093 {
13094 return false;
13095 }
13096
13098 {
13100 {
13103 if (!trg)
13104 {
13106 explosive = this;
13107 }
13108
13109 explosive.PairRemote(trg);
13111
13112 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13113 trg.SetPersistentPairID(persistentID);
13114 explosive.SetPersistentPairID(persistentID);
13115
13116 return true;
13117 }
13118 return false;
13119 }
13120
13123 {
13124 float ret = 1.0;
13127 ret *= GetHealth01();
13128
13129 return ret;
13130 }
13131
13132 #ifdef DEVELOPER
13133 override void SetDebugItem()
13134 {
13135 super.SetDebugItem();
13136 _itemBase = this;
13137 }
13138
13140 {
13141 string text = super.GetDebugText();
13142
13144 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13145
13146 return text;
13147 }
13148 #endif
13149
13151 {
13152 return true;
13153 }
13154
13156
13158
13160 {
13163 }
13164
13165
13173
13189}
13190
13192{
13194 if (entity)
13195 {
13196 bool is_item = entity.IsInherited(
ItemBase);
13197 if (is_item && full_quantity)
13198 {
13201 }
13202 }
13203 else
13204 {
13206 return NULL;
13207 }
13208 return entity;
13209}
13210
13212{
13213 if (item)
13214 {
13215 if (health > 0)
13216 item.SetHealth("", "", health);
13217
13218 if (item.CanHaveTemperature())
13219 {
13221 if (item.CanFreeze())
13222 item.SetFrozen(false);
13223 }
13224
13225 if (item.HasEnergyManager())
13226 {
13227 if (quantity >= 0)
13228 {
13229 item.GetCompEM().SetEnergy0To1(quantity);
13230 }
13231 else
13232 {
13234 }
13235 }
13236 else if (item.IsMagazine())
13237 {
13238 Magazine mag = Magazine.Cast(item);
13239 if (quantity >= 0)
13240 {
13241 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13242 }
13243 else
13244 {
13246 }
13247
13248 }
13249 else
13250 {
13251 if (quantity >= 0)
13252 {
13253 item.SetQuantityNormalized(quantity, false);
13254 }
13255 else
13256 {
13258 }
13259
13260 }
13261 }
13262}
13263
13264#ifdef DEVELOPER
13266#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.