8325{
8327 {
8328 return true;
8329 }
8330};
8331
8332
8333
8335{
8339
8341
8344
8345
8346
8347
8348
8357
8363
8368
8373
8394 protected bool m_IsResultOfSplit
8395
8397
8402
8403
8404
8406
8410
8411
8412
8414
8417
8418
8419
8425
8426
8434
8437
8438
8440
8441
8443
8444
8449
8450
8455
8456
8458
8459
8461 {
8466
8467 if (!
GetGame().IsDedicatedServer())
8468 {
8470 {
8472
8474 {
8476 }
8477 }
8478
8481 }
8482
8483 m_OldLocation = null;
8484
8486 {
8488 }
8489
8490 if (ConfigIsExisting("headSelectionsToHide"))
8491 {
8494 }
8495
8497 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8498 {
8500 }
8501
8503
8504 m_IsResultOfSplit = false;
8505
8507 }
8508
8510 {
8511 super.InitItemVariables();
8512
8518 m_Count = ConfigGetInt(
"count");
8519
8522
8527
8530
8535
8547
8551
8552
8555 if (ConfigIsExisting("canBeSplit"))
8556 {
8559 }
8560
8562 if (ConfigIsExisting("itemBehaviour"))
8564
8565
8568 RegisterNetSyncVariableInt("m_VarLiquidType");
8569 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8570
8571 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8572 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8573 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8574
8575 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8576 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8577 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8578 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8579
8580 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8581 RegisterNetSyncVariableBool("m_IsTakeable");
8582 RegisterNetSyncVariableBool("m_IsHologram");
8583
8586 {
8589 }
8590
8592
8594 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8596
8597 }
8598
8600 {
8602 }
8603
8605 {
8608 {
8613 }
8614 }
8615
8616 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8617 {
8619 {
8622 }
8623
8625 }
8626
8628 {
8634 }
8635
8637
8639 {
8641
8642 if (!action)
8643 {
8644 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8645 return;
8646 }
8647
8649 if (!ai)
8650 {
8652 return;
8653 }
8654
8656 if (!action_array)
8657 {
8658 action_array = new array<ActionBase_Basic>;
8660 }
8661 if (LogManager.IsActionLogEnable())
8662 {
8663 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8664 }
8665
8666 if (action_array.Find(action) != -1)
8667 {
8668 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8669 }
8670 else
8671 {
8672 action_array.Insert(action);
8673 }
8674 }
8675
8677 {
8679 ActionBase action = player.GetActionManager().GetAction(actionName);
8682
8683 if (action_array)
8684 {
8685 action_array.RemoveItem(action);
8686 }
8687 }
8688
8689
8690
8692 {
8693 ActionOverrideData overrideData = new ActionOverrideData();
8697
8699 if (!actionMap)
8700 {
8703 }
8704
8705 actionMap.Insert(this.
Type(), overrideData);
8706
8707 }
8708
8710
8712
8713
8715 {
8718
8721
8722 string config_to_search = "CfgVehicles";
8723 string muzzle_owner_config;
8724
8726 {
8727 if (IsInherited(Weapon))
8728 config_to_search = "CfgWeapons";
8729
8730 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8731
8732 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8733
8735
8736 if (config_OnFire_subclass_count > 0)
8737 {
8738 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8739
8740 for (int i = 0; i < config_OnFire_subclass_count; i++)
8741 {
8742 string particle_class = "";
8744 string config_OnFire_entry = config_OnFire_class + particle_class;
8745 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8746 WPOF_array.Insert(WPOF);
8747 }
8748
8749
8751 }
8752 }
8753
8755 {
8756 config_to_search = "CfgWeapons";
8757 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8758
8759 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8760
8762
8763 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8764 {
8765 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8766
8767 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8768 {
8769 string particle_class2 = "";
8771 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8772 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8773 WPOBE_array.Insert(WPOBE);
8774 }
8775
8776
8778 }
8779 }
8780 }
8781
8782
8784 {
8787
8789 {
8790 string config_to_search = "CfgVehicles";
8791
8792 if (IsInherited(Weapon))
8793 config_to_search = "CfgWeapons";
8794
8795 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8796 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8797
8798 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8799 {
8800
8802
8804 {
8806 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8808 return;
8809 }
8810
8813
8814
8815
8817 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8818
8819 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8820 {
8821 string particle_class = "";
8823 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8825
8826 if (entry_type == CT_CLASS)
8827 {
8828 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8829 WPOOH_array.Insert(WPOF);
8830 }
8831 }
8832
8833
8835 }
8836 }
8837 }
8838
8840 {
8842 }
8843
8845 {
8847 {
8849
8852
8855
8856 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8857 }
8858 }
8859
8861 {
8863 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8864
8866 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8867
8869 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8870
8872 {
8874 }
8875 }
8876
8878 {
8880 }
8881
8883 {
8886 else
8888
8890 {
8893 }
8894 else
8895 {
8898
8901 }
8902
8904 }
8905
8907 {
8909 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8910 }
8911
8913 {
8915 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8917 }
8918
8920 {
8922 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8923 }
8924
8926 {
8929
8930 OverheatingParticle OP = new OverheatingParticle();
8935
8937 }
8938
8940 {
8943
8944 return -1;
8945 }
8946
8948 {
8950 {
8953
8954 for (int i = count; i > 0; --i)
8955 {
8956 int id = i - 1;
8959
8962
8963 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8964 {
8965 if (p)
8966 {
8969 }
8970 }
8971 }
8972 }
8973 }
8974
8976 {
8978 {
8980 {
8981 int id = i - 1;
8983
8984 if (OP)
8985 {
8987
8988 if (p)
8989 {
8991 }
8992
8993 delete OP;
8994 }
8995 }
8996
8999 }
9000 }
9001
9004 {
9005 return 0.0;
9006 }
9007
9008
9010 {
9011 return 250;
9012 }
9013
9015 {
9016 return 0;
9017 }
9018
9021 {
9023 return true;
9024
9025 return false;
9026 }
9027
9030 {
9033
9035 {
9037 }
9038 else
9039 {
9040
9042 }
9043
9045 }
9046
9053 {
9054 return -1;
9055 }
9056
9057
9058
9059
9061 {
9063 {
9065 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9066
9067 if (r_index >= 0)
9068 {
9069 InventoryLocation r_il = new InventoryLocation;
9070 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9071
9072 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9075 {
9076 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9077 }
9079 {
9080 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9081 }
9082
9083 }
9084
9085 player.GetHumanInventory().ClearUserReservedLocation(this);
9086 }
9087
9090 }
9091
9092
9093
9094
9096 {
9097 return ItemBase.m_DebugActionsMask;
9098 }
9099
9101 {
9102 return ItemBase.m_DebugActionsMask & mask;
9103 }
9104
9106 {
9107 ItemBase.m_DebugActionsMask = mask;
9108 }
9109
9111 {
9112 ItemBase.m_DebugActionsMask |= mask;
9113 }
9114
9116 {
9117 ItemBase.m_DebugActionsMask &= ~mask;
9118 }
9119
9121 {
9123 {
9125 }
9126 else
9127 {
9129 }
9130 }
9131
9132
9134 {
9135 if (GetEconomyProfile())
9136 {
9137 float q_max = GetEconomyProfile().GetQuantityMax();
9138 if (q_max > 0)
9139 {
9140 float q_min = GetEconomyProfile().GetQuantityMin();
9141 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9142
9144 {
9145 ComponentEnergyManager comp = GetCompEM();
9147 {
9149 }
9150 }
9152 {
9154
9155 }
9156
9157 }
9158 }
9159 }
9160
9163 {
9164 EntityAI parent = GetHierarchyParent();
9165
9166 if (parent)
9167 {
9168 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9169 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9170 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9171 }
9172 }
9173
9176 {
9177 EntityAI parent = GetHierarchyParent();
9178
9179 if (parent)
9180 {
9181 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9182 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9183 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9184 }
9185 }
9186
9188 {
9189
9190
9191
9192
9194
9196 {
9197 if (ScriptInputUserData.CanStoreInputUserData())
9198 {
9199 ScriptInputUserData ctx = new ScriptInputUserData;
9205 ctx.
Write(use_stack_max);
9208
9210 {
9211 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9212 }
9213 }
9214 }
9215 else if (!
GetGame().IsMultiplayer())
9216 {
9218 }
9219 }
9220
9222 {
9224 }
9225
9227 {
9229 }
9230
9232 {
9234 }
9235
9237 {
9238
9239 return false;
9240 }
9241
9243 {
9244 return false;
9245 }
9246
9250 {
9251 return false;
9252 }
9253
9255 {
9256 return "";
9257 }
9258
9260
9262 {
9263 return false;
9264 }
9265
9267 {
9268 return true;
9269 }
9270
9271
9272
9274 {
9275 return true;
9276 }
9277
9279 {
9280 return true;
9281 }
9282
9284 {
9285 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9287 }
9288
9290 {
9292 }
9293
9295 {
9297 if (!is_being_placed)
9299 SetSynchDirty();
9300 }
9301
9302
9304
9306 {
9308 }
9309
9311 {
9313 }
9314
9316 {
9317 return 1;
9318 }
9319
9321 {
9322 return false;
9323 }
9324
9326 {
9328 SetSynchDirty();
9329 }
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9366 {
9367 super.OnMovedInsideCargo(container);
9368
9369 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9370 }
9371
9372 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9373 {
9374 super.EEItemLocationChanged(oldLoc,newLoc);
9375
9376 PlayerBase new_player = null;
9377 PlayerBase old_player = null;
9378
9379 if (newLoc.GetParent())
9380 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9381
9382 if (oldLoc.GetParent())
9383 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9384
9386 {
9387 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9388
9389 if (r_index >= 0)
9390 {
9391 InventoryLocation r_il = new InventoryLocation;
9392 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9393
9394 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9397 {
9398 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9399 }
9401 {
9402 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9403 }
9404
9405 }
9406 }
9407
9409 {
9410 if (new_player)
9411 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9412
9413 if (new_player == old_player)
9414 {
9415
9416 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9417 {
9419 {
9420 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9421 {
9422 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9423 }
9424 }
9425 else
9426 {
9427 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9428 }
9429 }
9430
9431 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9432 {
9433 int type = oldLoc.GetType();
9435 {
9436 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9437 }
9439 {
9440 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9441 }
9442 }
9443 if (!m_OldLocation)
9444 {
9445 m_OldLocation = new InventoryLocation;
9446 }
9447 m_OldLocation.Copy(oldLoc);
9448 }
9449 else
9450 {
9451 if (m_OldLocation)
9452 {
9453 m_OldLocation.Reset();
9454 }
9455 }
9456
9458 }
9459 else
9460 {
9461 if (new_player)
9462 {
9463 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9464 if (res_index >= 0)
9465 {
9466 InventoryLocation il = new InventoryLocation;
9467 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9469 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9472 {
9473 il.
GetParent().GetOnReleaseLock().Invoke(it);
9474 }
9476 {
9478 }
9479
9480 }
9481 }
9483 {
9484
9486 }
9487
9488 if (m_OldLocation)
9489 {
9490 m_OldLocation.Reset();
9491 }
9492 }
9493 }
9494
9495 override void EOnContact(IEntity other, Contact extra)
9496 {
9498 {
9499 int liquidType = -1;
9501 if (impactSpeed > 0.0)
9502 {
9504 #ifndef SERVER
9506 #else
9508 SetSynchDirty();
9509 #endif
9511 }
9512 }
9513
9514 #ifdef SERVER
9515 if (GetCompEM() && GetCompEM().IsPlugged())
9516 {
9517 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9518 GetCompEM().UnplugThis();
9519 }
9520 #endif
9521 }
9522
9524
9526 {
9528 }
9529
9531 {
9532
9533 }
9534
9536 {
9537 super.OnItemLocationChanged(old_owner, new_owner);
9538
9539 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9540 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9541
9542 if (!relatedPlayer && playerNew)
9543 relatedPlayer = playerNew;
9544
9545 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9546 {
9548 if (actionMgr)
9549 {
9550 ActionBase currentAction = actionMgr.GetRunningAction();
9551 if (currentAction)
9553 }
9554 }
9555
9556 Man ownerPlayerOld = null;
9557 Man ownerPlayerNew = null;
9558
9559 if (old_owner)
9560 {
9561 if (old_owner.
IsMan())
9562 {
9563 ownerPlayerOld = Man.Cast(old_owner);
9564 }
9565 else
9566 {
9567 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9568 }
9569 }
9570 else
9571 {
9573 {
9575
9576 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9577 {
9578 GetCompEM().UnplugThis();
9579 }
9580 }
9581 }
9582
9583 if (new_owner)
9584 {
9585 if (new_owner.
IsMan())
9586 {
9587 ownerPlayerNew = Man.Cast(new_owner);
9588 }
9589 else
9590 {
9591 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9592 }
9593 }
9594
9595 if (ownerPlayerOld != ownerPlayerNew)
9596 {
9597 if (ownerPlayerOld)
9598 {
9599 array<EntityAI> subItemsExit = new array<EntityAI>;
9601 for (int i = 0; i < subItemsExit.Count(); i++)
9602 {
9605 }
9606 }
9607
9608 if (ownerPlayerNew)
9609 {
9610 array<EntityAI> subItemsEnter = new array<EntityAI>;
9612 for (int j = 0; j < subItemsEnter.Count(); j++)
9613 {
9616 }
9617 }
9618 }
9619 else if (ownerPlayerNew != null)
9620 {
9621 PlayerBase nplayer;
9622 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9623 {
9624 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9626 for (int k = 0; k < subItemsUpdate.Count(); k++)
9627 {
9629 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9630 }
9631 }
9632 }
9633
9634 if (old_owner)
9635 old_owner.OnChildItemRemoved(this);
9636 if (new_owner)
9637 new_owner.OnChildItemReceived(this);
9638 }
9639
9640
9642 {
9643 super.EEDelete(parent);
9644 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9645 if (player)
9646 {
9648
9649 if (player.IsAlive())
9650 {
9651 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9652 if (r_index >= 0)
9653 {
9654 InventoryLocation r_il = new InventoryLocation;
9655 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9656
9657 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9660 {
9661 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9662 }
9664 {
9665 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9666 }
9667
9668 }
9669
9670 player.RemoveQuickBarEntityShortcut(this);
9671 }
9672 }
9673 }
9674
9676 {
9677 super.EEKilled(killer);
9678
9681 {
9682 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9683 {
9684 if (IsMagazine())
9685 {
9686 if (Magazine.Cast(this).GetAmmoCount() > 0)
9687 {
9689 }
9690 }
9691 else
9692 {
9694 }
9695 }
9696 }
9697 }
9698
9700 {
9701 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9702
9703 super.OnWasAttached(parent, slot_id);
9704
9707
9709 }
9710
9712 {
9713 super.OnWasDetached(parent, slot_id);
9714
9717 }
9718
9720 {
9721 int idx;
9724
9725 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9726 if (inventory_slots.Count() < 1)
9727 {
9728 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9729 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9730 }
9731 else
9732 {
9733 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9734 }
9735
9736 idx = inventory_slots.Find(slot);
9737 if (idx < 0)
9738 return "";
9739
9740 return attach_types.Get(idx);
9741 }
9742
9744 {
9745 int idx = -1;
9746 string slot;
9747
9750
9751 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9752 if (inventory_slots.Count() < 1)
9753 {
9754 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9755 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9756 }
9757 else
9758 {
9759 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9760 if (detach_types.Count() < 1)
9761 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9762 }
9763
9764 for (int i = 0; i < inventory_slots.Count(); i++)
9765 {
9766 slot = inventory_slots.Get(i);
9767 }
9768
9769 if (slot != "")
9770 {
9771 if (detach_types.Count() == 1)
9772 idx = 0;
9773 else
9774 idx = inventory_slots.Find(slot);
9775 }
9776 if (idx < 0)
9777 return "";
9778
9779 return detach_types.Get(idx);
9780 }
9781
9783 {
9784
9786
9787
9788 float min_time = 1;
9789 float max_time = 3;
9790 float delay = Math.RandomFloat(min_time, max_time);
9791
9792 explode_timer.Run(delay, this, "DoAmmoExplosion");
9793 }
9794
9796 {
9797 Magazine magazine = Magazine.Cast(this);
9798 int pop_sounds_count = 6;
9799 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9800
9801
9802 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9803 string sound_name = pop_sounds[ sound_idx ];
9805
9806
9807 magazine.ServerAddAmmoCount(-1);
9808
9809
9810 float min_temp_to_explode = 100;
9811
9812 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9813 {
9815 }
9816 }
9817
9818
9819 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9820 {
9821 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9822
9823 const int CHANCE_DAMAGE_CARGO = 4;
9824 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9825 const int CHANCE_DAMAGE_NOTHING = 2;
9826
9828 {
9829 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9830 int chances;
9831 int rnd;
9832
9833 if (GetInventory().GetCargo())
9834 {
9835 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9836 rnd = Math.RandomInt(0,chances);
9837
9838 if (rnd < CHANCE_DAMAGE_CARGO)
9839 {
9841 }
9842 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9843 {
9845 }
9846 }
9847 else
9848 {
9849 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9850 rnd = Math.RandomInt(0,chances);
9851
9852 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9853 {
9855 }
9856 }
9857 }
9858 }
9859
9861 {
9862 if (GetInventory().GetCargo())
9863 {
9864 int item_count = GetInventory().GetCargo().GetItemCount();
9865 if (item_count > 0)
9866 {
9867 int random_pick = Math.RandomInt(0, item_count);
9869 if (!item.IsExplosive())
9870 {
9871 item.AddHealth("","",damage);
9872 return true;
9873 }
9874 }
9875 }
9876 return false;
9877 }
9878
9880 {
9881 int attachment_count = GetInventory().AttachmentCount();
9882 if (attachment_count > 0)
9883 {
9884 int random_pick = Math.RandomInt(0, attachment_count);
9885 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9886 if (!attachment.IsExplosive())
9887 {
9888 attachment.AddHealth("","",damage);
9889 return true;
9890 }
9891 }
9892 return false;
9893 }
9894
9896 {
9898 }
9899
9901 {
9903 return GetInventory().CanRemoveEntity();
9904
9905 return false;
9906 }
9907
9909 {
9910
9912 return false;
9913
9914
9916 return false;
9917
9918
9919
9921 if (delta == 0)
9922 return false;
9923
9924
9925 return true;
9926 }
9927
9929 {
9931 {
9932 if (ScriptInputUserData.CanStoreInputUserData())
9933 {
9934 ScriptInputUserData ctx = new ScriptInputUserData;
9939 ctx.
Write(destination_entity);
9943 }
9944 }
9945 else if (!
GetGame().IsMultiplayer())
9946 {
9948 }
9949 }
9950
9952 {
9953 float split_quantity_new;
9957 InventoryLocation loc = new InventoryLocation;
9958
9959 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9960 {
9962 split_quantity_new = stack_max;
9963 else
9965
9967 {
9968 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9969 if (new_item)
9970 {
9971 new_item.SetResultOfSplit(true);
9972 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9974 new_item.
SetQuantity(split_quantity_new,
false,
true);
9975 }
9976 }
9977 }
9978 else if (destination_entity && slot_id == -1)
9979 {
9980 if (quantity > stack_max)
9981 split_quantity_new = stack_max;
9982 else
9983 split_quantity_new = quantity;
9984
9986 {
9988 {
9991 }
9992
9993 if (new_item)
9994 {
9995 new_item.SetResultOfSplit(true);
9996 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9998 new_item.
SetQuantity(split_quantity_new,
false,
true);
9999 }
10000 }
10001 }
10002 else
10003 {
10004 if (stack_max != 0)
10005 {
10007 {
10009 }
10010
10011 if (split_quantity_new == 0)
10012 {
10013 if (!
GetGame().IsMultiplayer())
10014 player.PhysicalPredictiveDropItem(this);
10015 else
10016 player.ServerDropEntity(this);
10017 return;
10018 }
10019
10021 {
10023
10024 if (new_item)
10025 {
10026 new_item.SetResultOfSplit(true);
10027 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10030 new_item.PlaceOnSurface();
10031 }
10032 }
10033 }
10034 }
10035 }
10036
10038 {
10039 float split_quantity_new;
10043 InventoryLocation loc = new InventoryLocation;
10044
10045 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10046 {
10048 split_quantity_new = stack_max;
10049 else
10051
10053 {
10054 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10055 if (new_item)
10056 {
10057 new_item.SetResultOfSplit(true);
10058 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10060 new_item.
SetQuantity(split_quantity_new,
false,
true);
10061 }
10062 }
10063 }
10064 else if (destination_entity && slot_id == -1)
10065 {
10066 if (quantity > stack_max)
10067 split_quantity_new = stack_max;
10068 else
10069 split_quantity_new = quantity;
10070
10072 {
10074 {
10077 }
10078
10079 if (new_item)
10080 {
10081 new_item.SetResultOfSplit(true);
10082 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10084 new_item.
SetQuantity(split_quantity_new,
false,
true);
10085 }
10086 }
10087 }
10088 else
10089 {
10090 if (stack_max != 0)
10091 {
10093 {
10095 }
10096
10098 {
10100
10101 if (new_item)
10102 {
10103 new_item.SetResultOfSplit(true);
10104 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10107 new_item.PlaceOnSurface();
10108 }
10109 }
10110 }
10111 }
10112 }
10113
10115 {
10117 {
10118 if (ScriptInputUserData.CanStoreInputUserData())
10119 {
10120 ScriptInputUserData ctx = new ScriptInputUserData;
10125 dst.WriteToContext(ctx);
10127 }
10128 }
10129 else if (!
GetGame().IsMultiplayer())
10130 {
10132 }
10133 }
10134
10136 {
10138 {
10139 if (ScriptInputUserData.CanStoreInputUserData())
10140 {
10141 ScriptInputUserData ctx = new ScriptInputUserData;
10146 ctx.
Write(destination_entity);
10152 }
10153 }
10154 else if (!
GetGame().IsMultiplayer())
10155 {
10157 }
10158 }
10159
10161 {
10163 }
10164
10166 {
10168 float split_quantity_new;
10170 if (dst.IsValid())
10171 {
10172 int slot_id = dst.GetSlot();
10174
10175 if (quantity > stack_max)
10176 split_quantity_new = stack_max;
10177 else
10178 split_quantity_new = quantity;
10179
10181 {
10183
10184 if (new_item)
10185 {
10186 new_item.SetResultOfSplit(true);
10187 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10189 new_item.
SetQuantity(split_quantity_new,
false,
true);
10190 }
10191
10192 return new_item;
10193 }
10194 }
10195
10196 return null;
10197 }
10198
10200 {
10202 float split_quantity_new;
10204 if (destination_entity)
10205 {
10207 if (quantity > stackable)
10208 split_quantity_new = stackable;
10209 else
10210 split_quantity_new = quantity;
10211
10213 {
10214 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10215 if (new_item)
10216 {
10217 new_item.SetResultOfSplit(true);
10218 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10220 new_item.
SetQuantity(split_quantity_new,
false,
true);
10221 }
10222 }
10223 }
10224 }
10225
10227 {
10229 {
10230 if (ScriptInputUserData.CanStoreInputUserData())
10231 {
10232 ScriptInputUserData ctx = new ScriptInputUserData;
10237 ItemBase destination_entity =
this;
10238 ctx.
Write(destination_entity);
10242 }
10243 }
10244 else if (!
GetGame().IsMultiplayer())
10245 {
10247 }
10248 }
10249
10251 {
10253 float split_quantity_new;
10255 if (player)
10256 {
10258 if (quantity > stackable)
10259 split_quantity_new = stackable;
10260 else
10261 split_quantity_new = quantity;
10262
10264 {
10265 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10266 new_item =
ItemBase.Cast(in_hands);
10267 if (new_item)
10268 {
10269 new_item.SetResultOfSplit(true);
10270 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10272 new_item.SetQuantity(split_quantity_new, false, true);
10273 }
10274 }
10275 }
10276 }
10277
10279 {
10281 float split_quantity_new = Math.Floor(quantity * 0.5);
10282
10284 return;
10285
10287
10288 if (new_item)
10289 {
10290 if (new_item.GetQuantityMax() < split_quantity_new)
10291 {
10292 split_quantity_new = new_item.GetQuantityMax();
10293 }
10294
10295 new_item.SetResultOfSplit(true);
10296 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10297
10299 {
10302 }
10303 else
10304 {
10306 new_item.
SetQuantity(split_quantity_new,
false,
true);
10307 }
10308 }
10309 }
10310
10312 {
10314 float split_quantity_new = Math.Floor(quantity / 2);
10315
10317 return;
10318
10319 InventoryLocation invloc = new InventoryLocation;
10321
10323 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10324
10325 if (new_item)
10326 {
10327 if (new_item.GetQuantityMax() < split_quantity_new)
10328 {
10329 split_quantity_new = new_item.GetQuantityMax();
10330 }
10332 {
10335 }
10336 else if (split_quantity_new > 1)
10337 {
10339 new_item.
SetQuantity(split_quantity_new,
false,
true);
10340 }
10341 }
10342 }
10343
10346 {
10347 SetWeightDirty();
10349
10350 if (parent)
10351 parent.OnAttachmentQuantityChangedEx(this, delta);
10352
10354 {
10356 {
10358 }
10360 {
10361 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10363 }
10364 }
10365
10366 }
10367
10370 {
10371
10372 }
10373
10376 {
10378 }
10379
10381 {
10382 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10383
10385 {
10386 if (newLevel == GameConstants.STATE_RUINED)
10387 {
10389 EntityAI parent = GetHierarchyParent();
10390 if (parent && parent.IsFireplace())
10391 {
10392 CargoBase cargo = GetInventory().GetCargo();
10393 if (cargo)
10394 {
10396 {
10398 }
10399 }
10400 }
10401 }
10402
10404 {
10405
10407 return;
10408 }
10409
10410 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10411 {
10413 }
10414 }
10415 }
10416
10417
10419 {
10420 super.OnRightClick();
10421
10423 {
10425 {
10426 if (ScriptInputUserData.CanStoreInputUserData())
10427 {
10428 EntityAI root = GetHierarchyRoot();
10429 Man playerOwner = GetHierarchyRootPlayer();
10430 InventoryLocation dst = new InventoryLocation;
10431
10432
10433 if (!playerOwner && root && root == this)
10434 {
10436 }
10437 else
10438 {
10439
10440 GetInventory().GetCurrentInventoryLocation(dst);
10442 {
10445 {
10447 }
10448 else
10449 {
10451
10452
10453 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10454 {
10456 }
10457 else
10458 {
10459 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10460 }
10461 }
10462 }
10463 }
10464
10465 ScriptInputUserData ctx = new ScriptInputUserData;
10473 }
10474 }
10475 else if (!
GetGame().IsMultiplayer())
10476 {
10478 }
10479 }
10480 }
10481
10483 {
10484 if (root)
10485 {
10486 vector m4[4];
10487 root.GetTransform(m4);
10488 dst.SetGround(this, m4);
10489 }
10490 else
10491 {
10492 GetInventory().GetCurrentInventoryLocation(dst);
10493 }
10494 }
10495
10496 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10497 {
10498
10499 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10500 return false;
10501
10502 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10503 return false;
10504
10505
10507 return false;
10508
10509
10510 Magazine mag = Magazine.Cast(this);
10511 if (mag)
10512 {
10513 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10514 return false;
10515
10516 if (stack_max_limit)
10517 {
10518 Magazine other_mag = Magazine.Cast(other_item);
10519 if (other_item)
10520 {
10521 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10522 return false;
10523 }
10524
10525 }
10526 }
10527 else
10528 {
10529
10531 return false;
10532
10534 return false;
10535 }
10536
10537 PlayerBase player = null;
10538 if (CastTo(player, GetHierarchyRootPlayer()))
10539 {
10540 if (player.GetInventory().HasAttachment(this))
10541 return false;
10542
10543 if (player.IsItemsToDelete())
10544 return false;
10545 }
10546
10547 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10548 return false;
10549
10550 int slotID;
10552 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10553 return false;
10554
10555 return true;
10556 }
10557
10559 {
10561 }
10562
10564 {
10565 return m_IsResultOfSplit;
10566 }
10567
10569 {
10570 m_IsResultOfSplit = value;
10571 }
10572
10574 {
10576 }
10577
10579 {
10580 float other_item_quantity = other_item.GetQuantity();
10581 float this_free_space;
10582
10584
10586
10587 if (other_item_quantity > this_free_space)
10588 {
10589 return this_free_space;
10590 }
10591 else
10592 {
10593 return other_item_quantity;
10594 }
10595 }
10596
10598 {
10600 }
10601
10603 {
10605 return;
10606
10607 if (!IsMagazine() && other_item)
10608 {
10610 if (quantity_used != 0)
10611 {
10612 float hp1 = GetHealth01("","");
10613 float hp2 = other_item.GetHealth01("","");
10614 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10615 hpResult = hpResult / (
GetQuantity() + quantity_used);
10616
10617 hpResult *= GetMaxHealth();
10618 Math.Round(hpResult);
10619 SetHealth("", "Health", hpResult);
10620
10622 other_item.AddQuantity(-quantity_used);
10623 }
10624 }
10626 }
10627
10629 {
10630 #ifdef SERVER
10631 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10632 GetHierarchyParent().IncreaseLifetimeUp();
10633 #endif
10634 };
10635
10637 {
10638 PlayerBase p = PlayerBase.Cast(player);
10639
10640 array<int> recipesIds = p.m_Recipes;
10641 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10642 if (moduleRecipesManager)
10643 {
10644 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10645 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10646 }
10647
10648 for (int i = 0;i < recipesIds.Count(); i++)
10649 {
10650 int key = recipesIds.Get(i);
10651 string recipeName = moduleRecipesManager.GetRecipeName(key);
10653 }
10654 }
10655
10656
10657 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10658 {
10659 super.GetDebugActions(outputList);
10660
10661
10667
10668
10673
10678
10679
10683
10684
10686 {
10690 }
10691
10694
10695
10699
10701
10702 InventoryLocation loc = new InventoryLocation();
10703 GetInventory().GetCurrentInventoryLocation(loc);
10705 {
10706 if (Gizmo_IsSupported())
10709 }
10710
10712 }
10713
10714
10715
10716
10718 {
10719 super.OnAction(action_id, player, ctx);
10720
10722 {
10723 switch (action_id)
10724 {
10727 return true;
10730 return true;
10731 }
10732 }
10733
10735 {
10736 switch (action_id)
10737 {
10739 Delete();
10740 return true;
10741 }
10742 }
10743
10744 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10745 {
10746 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10747 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10748 PlayerBase p = PlayerBase.Cast(player);
10749 if (
EActions.RECIPES_RANGE_START < 1000)
10750 {
10751 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10752 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10753 }
10754 }
10755 #ifndef SERVER
10756 else if (action_id ==
EActions.WATCH_PLAYER)
10757 {
10758 PluginDeveloper.SetDeveloperItemClientEx(player);
10759 }
10760 #endif
10762 {
10763 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10764 {
10765 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10766 OnDebugButtonPressServer(id + 1);
10767 }
10768
10769 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10770 {
10771 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10773 }
10774
10775 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10776 {
10777 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10779 }
10780
10781 else if (action_id ==
EActions.ADD_QUANTITY)
10782 {
10783 if (IsMagazine())
10784 {
10785 Magazine mag = Magazine.Cast(this);
10786 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10787 }
10788 else
10789 {
10791 }
10792
10793 if (m_EM)
10794 {
10795 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10796 }
10797
10798 }
10799
10800 else if (action_id ==
EActions.REMOVE_QUANTITY)
10801 {
10802 if (IsMagazine())
10803 {
10804 Magazine mag2 = Magazine.Cast(this);
10805 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10806 }
10807 else
10808 {
10810 }
10811 if (m_EM)
10812 {
10813 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10814 }
10815
10816 }
10817
10818 else if (action_id ==
EActions.SET_QUANTITY_0)
10819 {
10821
10822 if (m_EM)
10823 {
10824 m_EM.SetEnergy(0);
10825 }
10826 }
10827
10828 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10829 {
10831
10832 if (m_EM)
10833 {
10834 m_EM.SetEnergy(m_EM.GetEnergyMax());
10835 }
10836 }
10837
10838 else if (action_id ==
EActions.ADD_HEALTH)
10839 {
10840 AddHealth("","",GetMaxHealth("","Health")/5);
10841 }
10842 else if (action_id ==
EActions.REMOVE_HEALTH)
10843 {
10844 AddHealth("","",-GetMaxHealth("","Health")/5);
10845 }
10846 else if (action_id ==
EActions.DESTROY_HEALTH)
10847 {
10848 SetHealth01("","",0);
10849 }
10850 else if (action_id ==
EActions.WATCH_ITEM)
10851 {
10853 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10854 #ifdef DEVELOPER
10855 SetDebugDeveloper_item(this);
10856 #endif
10857 }
10858
10859 else if (action_id ==
EActions.ADD_TEMPERATURE)
10860 {
10861 AddTemperature(20);
10862
10863 }
10864
10865 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10866 {
10867 AddTemperature(-20);
10868
10869 }
10870
10871 else if (action_id ==
EActions.FLIP_FROZEN)
10872 {
10873 SetFrozen(!GetIsFrozen());
10874
10875 }
10876
10877 else if (action_id ==
EActions.ADD_WETNESS)
10878 {
10880
10881 }
10882
10883 else if (action_id ==
EActions.REMOVE_WETNESS)
10884 {
10886
10887 }
10888
10889 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10890 {
10893
10894
10895 }
10896
10897 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10898 {
10901 }
10902
10903 else if (action_id ==
EActions.MAKE_SPECIAL)
10904 {
10905 auto debugParams = DebugSpawnParams.WithPlayer(player);
10906 OnDebugSpawnEx(debugParams);
10907 }
10908
10909 }
10910
10911
10912 return false;
10913 }
10914
10915
10916
10917
10921
10924
10925
10926
10928 {
10929 return false;
10930 }
10931
10932
10934 {
10935 return true;
10936 }
10937
10938
10940 {
10941 return true;
10942 }
10943
10944
10945
10947 {
10948 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10950 }
10951
10954 {
10955 return null;
10956 }
10957
10959 {
10960 return false;
10961 }
10962
10964 {
10965 return false;
10966 }
10967
10971
10972
10974 {
10975 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10976 return module_repairing.CanRepair(this, item_repair_kit);
10977 }
10978
10979
10980 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10981 {
10982 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10983 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10984 }
10985
10986
10988 {
10989
10990
10991
10992
10993
10994
10995
10996
10997 return 1;
10998 }
10999
11000
11001
11003 {
11005 }
11006
11007
11008
11010 {
11012 }
11013
11014
11023 {
11024 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11025
11026 if (player)
11027 {
11028 player.MessageStatus(text);
11029 }
11030 }
11031
11032
11041 {
11042 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11043
11044 if (player)
11045 {
11046 player.MessageAction(text);
11047 }
11048 }
11049
11050
11059 {
11060 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11061
11062 if (player)
11063 {
11064 player.MessageFriendly(text);
11065 }
11066 }
11067
11068
11077 {
11078 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11079
11080 if (player)
11081 {
11082 player.MessageImportant(text);
11083 }
11084 }
11085
11087 {
11088 return true;
11089 }
11090
11091
11092 override bool KindOf(
string tag)
11093 {
11094 bool found = false;
11095 string item_name = this.
GetType();
11098
11099 int array_size = item_tag_array.Count();
11100 for (int i = 0; i < array_size; i++)
11101 {
11102 if (item_tag_array.Get(i) == tag)
11103 {
11104 found = true;
11105 break;
11106 }
11107 }
11108 return found;
11109 }
11110
11111
11113 {
11114
11115 super.OnRPC(sender, rpc_type,ctx);
11116
11117
11118 switch (rpc_type)
11119 {
11120 #ifndef SERVER
11121 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11122 Param2<bool, string> p = new Param2<bool, string>(false, "");
11123
11125 return;
11126
11127 bool play = p.param1;
11128 string soundSet = p.param2;
11129
11130 if (play)
11131 {
11133 {
11135 {
11137 }
11138 }
11139 else
11140 {
11142 }
11143 }
11144 else
11145 {
11147 }
11148
11149 break;
11150 #endif
11151
11152 }
11153
11155 {
11157 }
11158 }
11159
11160
11161
11162
11164 {
11165 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11166 return plugin.GetID(
name);
11167 }
11168
11170 {
11171 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11172 return plugin.GetName(id);
11173 }
11174
11177 {
11178
11179
11180 int varFlags;
11181 if (!ctx.
Read(varFlags))
11182 return;
11183
11184 if (varFlags & ItemVariableFlags.FLOAT)
11185 {
11187 }
11188 }
11189
11191 {
11192
11193 super.SerializeNumericalVars(floats_out);
11194
11195
11196
11198 {
11200 }
11201
11203 {
11205 }
11206
11208 {
11210 }
11211
11213 {
11218 }
11219
11221 {
11223 }
11224 }
11225
11227 {
11228
11229 super.DeSerializeNumericalVars(floats);
11230
11231
11232 int index = 0;
11233 int mask = Math.Round(floats.Get(index));
11234
11235 index++;
11236
11238 {
11240 {
11242 }
11243 else
11244 {
11245 float quantity = floats.Get(index);
11246 SetQuantity(quantity,
true,
false,
false,
false);
11247 }
11248 index++;
11249 }
11250
11252 {
11253 float wet = floats.Get(index);
11255 index++;
11256 }
11257
11259 {
11260 int liquidtype = Math.Round(floats.Get(index));
11262 index++;
11263 }
11264
11266 {
11268 index++;
11270 index++;
11272 index++;
11274 index++;
11275 }
11276
11278 {
11279 int cleanness = Math.Round(floats.Get(index));
11281 index++;
11282 }
11283 }
11284
11286 {
11287 super.WriteVarsToCTX(ctx);
11288
11289
11291 {
11293 }
11294
11296 {
11298 }
11299
11301 {
11303 }
11304
11306 {
11307 int r,g,b,a;
11313 }
11314
11316 {
11318 }
11319 }
11320
11322 {
11323 if (!super.ReadVarsFromCTX(ctx,version))
11324 return false;
11325
11326 int intValue;
11327 float value;
11328
11329 if (version < 140)
11330 {
11331 if (!ctx.
Read(intValue))
11332 return false;
11333
11334 m_VariablesMask = intValue;
11335 }
11336
11338 {
11339 if (!ctx.
Read(value))
11340 return false;
11341
11343 {
11345 }
11346 else
11347 {
11349 }
11350 }
11351
11352 if (version < 140)
11353 {
11355 {
11356 if (!ctx.
Read(value))
11357 return false;
11358 SetTemperatureDirect(value);
11359 }
11360 }
11361
11363 {
11364 if (!ctx.
Read(value))
11365 return false;
11367 }
11368
11370 {
11371 if (!ctx.
Read(intValue))
11372 return false;
11374 }
11375
11377 {
11378 int r,g,b,a;
11380 return false;
11382 return false;
11384 return false;
11386 return false;
11387
11389 }
11390
11392 {
11393 if (!ctx.
Read(intValue))
11394 return false;
11396 }
11397
11398 if (version >= 138 && version < 140)
11399 {
11401 {
11402 if (!ctx.
Read(intValue))
11403 return false;
11404 SetFrozen(intValue);
11405 }
11406 }
11407
11408 return true;
11409 }
11410
11411
11413 {
11416 {
11418 }
11419
11420 if (!super.OnStoreLoad(ctx, version))
11421 {
11423 return false;
11424 }
11425
11426 if (version >= 114)
11427 {
11428 bool hasQuickBarIndexSaved;
11429
11430 if (!ctx.
Read(hasQuickBarIndexSaved))
11431 {
11433 return false;
11434 }
11435
11436 if (hasQuickBarIndexSaved)
11437 {
11438 int itmQBIndex;
11439
11440
11441 if (!ctx.
Read(itmQBIndex))
11442 {
11444 return false;
11445 }
11446
11447 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11448 if (itmQBIndex != -1 && parentPlayer)
11449 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11450 }
11451 }
11452 else
11453 {
11454
11455 PlayerBase player;
11456 int itemQBIndex;
11457 if (version ==
int.
MAX)
11458 {
11459 if (!ctx.
Read(itemQBIndex))
11460 {
11462 return false;
11463 }
11464 }
11465 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11466 {
11467
11468 if (!ctx.
Read(itemQBIndex))
11469 {
11471 return false;
11472 }
11473 if (itemQBIndex != -1 && player)
11474 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11475 }
11476 }
11477
11478 if (version < 140)
11479 {
11480
11481 if (!LoadVariables(ctx, version))
11482 {
11484 return false;
11485 }
11486 }
11487
11488
11490 {
11492 return false;
11493 }
11494 if (version >= 132)
11495 {
11497 if (raib)
11498 {
11500 {
11502 return false;
11503 }
11504 }
11505 }
11506
11508 return true;
11509 }
11510
11511
11512
11514 {
11515 super.OnStoreSave(ctx);
11516
11517 PlayerBase player;
11518 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11519 {
11521
11522 int itemQBIndex = -1;
11523 itemQBIndex = player.FindQuickBarEntityIndex(this);
11524 ctx.
Write(itemQBIndex);
11525 }
11526 else
11527 {
11529 }
11530
11532
11534 if (raib)
11535 {
11537 }
11538 }
11539
11540
11542 {
11543 super.AfterStoreLoad();
11544
11546 {
11548 }
11549
11551 {
11554 }
11555 }
11556
11558 {
11559 super.EEOnAfterLoad();
11560
11562 {
11564 }
11565
11568 }
11569
11571 {
11572 return false;
11573 }
11574
11575
11576
11578 {
11580 {
11581 #ifdef PLATFORM_CONSOLE
11582
11584 {
11586 if (menu)
11587 {
11589 }
11590 }
11591 #endif
11592 }
11593
11595 {
11598 }
11599
11601 {
11602 SetWeightDirty();
11604 }
11606 {
11609 }
11610
11612 {
11615 }
11617 {
11620 }
11621
11622 super.OnVariablesSynchronized();
11623 }
11624
11625
11626
11628 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11629 {
11630 if (!IsServerCheck(allow_client))
11631 return false;
11632
11634 return false;
11635
11638
11639 if (value <= (min + 0.001))
11640 value = min;
11641
11642 if (value == min)
11643 {
11644 if (destroy_config)
11645 {
11646 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11647 if (dstr)
11648 {
11650 this.Delete();
11651 return true;
11652 }
11653 }
11654 else if (destroy_forced)
11655 {
11657 this.Delete();
11658 return true;
11659 }
11660
11662 }
11663
11666
11668 {
11670
11671 if (delta)
11673 }
11674
11676
11677 return false;
11678 }
11679
11680
11682 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11683 {
11685 }
11686
11688 {
11691 }
11692
11694 {
11697 }
11698
11700 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11701 {
11702 float value_clamped = Math.Clamp(value, 0, 1);
11704 SetQuantity(result, destroy_config, destroy_forced);
11705 }
11706
11707
11710 {
11712 }
11713
11715 {
11717 }
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11729 {
11730 int slot = -1;
11731 if (GetInventory())
11732 {
11733 InventoryLocation il = new InventoryLocation;
11734 GetInventory().GetCurrentInventoryLocation(il);
11736 }
11737
11739 }
11740
11742 {
11743 float quantity_max = 0;
11744
11746 {
11747 if (attSlotID != -1)
11748 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11749
11750 if (quantity_max <= 0)
11752 }
11753
11754 if (quantity_max <= 0)
11756
11757 return quantity_max;
11758 }
11759
11761 {
11763 }
11764
11766 {
11768 }
11769
11770
11772 {
11774 }
11775
11777 {
11779 }
11780
11782 {
11784 }
11785
11786
11788 {
11789
11790 float weightEx = GetWeightEx();
11791 float special = GetInventoryAndCargoWeight();
11792 return weightEx - special;
11793 }
11794
11795
11797 {
11799 }
11800
11802 {
11804 {
11805 #ifdef DEVELOPER
11806 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11807 {
11808 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11810 }
11811 #endif
11812
11813 return GetQuantity() * GetConfigWeightModified();
11814 }
11815 else if (HasEnergyManager())
11816 {
11817 #ifdef DEVELOPER
11818 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11819 {
11820 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11821 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11822 }
11823 #endif
11824 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11825 }
11826 else
11827 {
11828 #ifdef DEVELOPER
11829 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11830 {
11831 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11832 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11833 }
11834 #endif
11835 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11836 }
11837 }
11838
11841 {
11842 int item_count = 0;
11844
11845 if (GetInventory().GetCargo() != NULL)
11846 {
11847 item_count = GetInventory().GetCargo().GetItemCount();
11848 }
11849
11850 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11851 {
11852 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11853 if (item)
11854 item_count += item.GetNumberOfItems();
11855 }
11856 return item_count;
11857 }
11858
11861 {
11862 float weight = 0;
11863 float wetness = 1;
11864 if (include_wetness)
11867 {
11868 weight = wetness * m_ConfigWeight;
11869 }
11871 {
11872 weight = 1;
11873 }
11874 return weight;
11875 }
11876
11877
11878
11880 {
11881 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11882 {
11883 GameInventory inv = GetInventory();
11884 array<EntityAI> items = new array<EntityAI>;
11886 for (int i = 0; i < items.Count(); i++)
11887 {
11889 if (item)
11890 {
11892 }
11893 }
11894 }
11895 }
11896
11897
11898
11899
11901 {
11902 float energy = 0;
11903 if (HasEnergyManager())
11904 {
11905 energy = GetCompEM().GetEnergy();
11906 }
11907 return energy;
11908 }
11909
11910
11912 {
11913 super.OnEnergyConsumed();
11914
11916 }
11917
11919 {
11920 super.OnEnergyAdded();
11921
11923 }
11924
11925
11927 {
11928 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11929 {
11931 {
11932 float energy_0to1 = GetCompEM().GetEnergy0To1();
11934 }
11935 }
11936 }
11937
11938
11940 {
11941 return ConfigGetFloat("heatIsolation");
11942 }
11943
11945 {
11947 }
11948
11950 {
11951 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11952 if (
GetGame().ConfigIsExisting(paramPath))
11954
11955 return 0.0;
11956 }
11957
11959 {
11960 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11961 if (
GetGame().ConfigIsExisting(paramPath))
11963
11964 return 0.0;
11965 }
11966
11967 override void SetWet(
float value,
bool allow_client =
false)
11968 {
11969 if (!IsServerCheck(allow_client))
11970 return;
11971
11974
11976
11977 m_VarWet = Math.Clamp(value, min, max);
11978
11980 {
11983 }
11984 }
11985
11986 override void AddWet(
float value)
11987 {
11989 }
11990
11992 {
11994 }
11995
11997 {
11999 }
12000
12002 {
12004 }
12005
12007 {
12009 }
12010
12012 {
12014 }
12015
12016 override void OnWetChanged(
float newVal,
float oldVal)
12017 {
12020 if (newLevel != oldLevel)
12021 {
12023 }
12024 }
12025
12027 {
12028 SetWeightDirty();
12029 }
12030
12032 {
12033 return GetWetLevelInternal(
m_VarWet);
12034 }
12035
12036
12037
12039 {
12041 }
12042
12044 {
12046 }
12047
12049 {
12051 }
12052
12054 {
12056 }
12057
12058
12059
12061 {
12062 if (ConfigIsExisting("itemModelLength"))
12063 {
12064 return ConfigGetFloat("itemModelLength");
12065 }
12066 return 0;
12067 }
12068
12070 {
12071 if (ConfigIsExisting("itemAttachOffset"))
12072 {
12073 return ConfigGetFloat("itemAttachOffset");
12074 }
12075 return 0;
12076 }
12077
12078 override void SetCleanness(
int value,
bool allow_client =
false)
12079 {
12080 if (!IsServerCheck(allow_client))
12081 return;
12082
12084
12086
12089 }
12090
12092 {
12094 }
12095
12097 {
12098 return true;
12099 }
12100
12101
12102
12103
12105 {
12107 }
12108
12110 {
12112 }
12113
12114
12115
12116
12117 override void SetColor(
int r,
int g,
int b,
int a)
12118 {
12124 }
12126 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12127 {
12132 }
12133
12135 {
12137 }
12138
12141 {
12142 int r,g,b,a;
12144 r = r/255;
12145 g = g/255;
12146 b = b/255;
12147 a = a/255;
12148 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12149 }
12150
12151
12152
12153 override void SetLiquidType(
int value,
bool allow_client =
false)
12154 {
12155 if (!IsServerCheck(allow_client))
12156 return;
12157
12162 }
12163
12165 {
12166 return ConfigGetInt("varLiquidTypeInit");
12167 }
12168
12170 {
12172 }
12173
12175 {
12177 SetFrozen(false);
12178 }
12179
12182 {
12183 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12184 }
12185
12186
12189 {
12190 PlayerBase nplayer;
12191 if (PlayerBase.CastTo(nplayer, player))
12192 {
12194
12195 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12196 }
12197 }
12198
12199
12202 {
12203 PlayerBase nplayer;
12204 if (PlayerBase.CastTo(nplayer,player))
12205 {
12206
12207 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12208
12209 }
12210
12211
12212 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12213
12214
12215 if (HasEnergyManager())
12216 {
12217 GetCompEM().UpdatePlugState();
12218 }
12219 }
12220
12221
12223 {
12224 super.OnPlacementStarted(player);
12225
12227 }
12228
12229 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12230 {
12232 {
12233 m_AdminLog.OnPlacementComplete(player,
this);
12234 }
12235
12236 super.OnPlacementComplete(player, position, orientation);
12237 }
12238
12239
12240
12241
12242
12244 {
12246 {
12247 return true;
12248 }
12249 else
12250 {
12251 return false;
12252 }
12253 }
12254
12255
12257 {
12259 {
12261 }
12262 }
12263
12264
12266 {
12268 }
12269
12271 {
12273 }
12274
12275 override void InsertAgent(
int agent,
float count = 1)
12276 {
12277 if (count < 1)
12278 return;
12279
12281 }
12282
12285 {
12287 }
12288
12289
12291 {
12293 }
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
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
12337 {
12339 return false;
12340 return true;
12341 }
12342
12344 {
12345
12347 }
12348
12349
12352 {
12353 super.CheckForRoofLimited(timeTresholdMS);
12354
12356 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12357 {
12358 m_PreviousRoofTestTime = time;
12359 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12360 }
12361 }
12362
12363
12365 {
12367 {
12368 return 0;
12369 }
12370
12371 if (GetInventory().GetAttachmentSlotsCount() != 0)
12372 {
12373 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12374 if (filter)
12375 return filter.GetProtectionLevel(type, false, system);
12376 else
12377 return 0;
12378 }
12379
12380 string subclassPath, entryName;
12381
12382 switch (type)
12383 {
12385 entryName = "biological";
12386 break;
12388 entryName = "chemical";
12389 break;
12390 default:
12391 entryName = "biological";
12392 break;
12393 }
12394
12395 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12396
12398 }
12399
12400
12401
12404 {
12405 if (!IsMagazine())
12407
12409 }
12410
12411
12412
12413
12414
12419 {
12420 return true;
12421 }
12422
12424 {
12426 }
12427
12428
12429
12430
12431
12433 {
12434 if (parent)
12435 {
12436 if (parent.IsInherited(DayZInfected))
12437 return true;
12438
12439 if (!parent.IsRuined())
12440 return true;
12441 }
12442
12443 return true;
12444 }
12445
12447 {
12448 if (!super.CanPutAsAttachment(parent))
12449 {
12450 return false;
12451 }
12452
12453 if (!IsRuined() && !parent.IsRuined())
12454 {
12455 return true;
12456 }
12457
12458 return false;
12459 }
12460
12462 {
12463
12464
12465
12466
12467 return super.CanReceiveItemIntoCargo(item);
12468 }
12469
12471 {
12472
12473
12474
12475
12476 GameInventory attachmentInv = attachment.GetInventory();
12478 {
12479 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12480 return false;
12481 }
12482
12483 InventoryLocation loc = new InventoryLocation();
12484 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12485 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12486 return false;
12487
12488 return super.CanReceiveAttachment(attachment, slotId);
12489 }
12490
12492 {
12493 if (!super.CanReleaseAttachment(attachment))
12494 return false;
12495
12496 return GetInventory().AreChildrenAccessible();
12497 }
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12520 {
12521 int id = muzzle_owner.GetMuzzleID();
12522 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12523
12524 if (WPOF_array)
12525 {
12526 for (int i = 0; i < WPOF_array.Count(); i++)
12527 {
12528 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12529
12530 if (WPOF)
12531 {
12532 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12533 }
12534 }
12535 }
12536 }
12537
12538
12540 {
12541 int id = muzzle_owner.GetMuzzleID();
12543
12544 if (WPOBE_array)
12545 {
12546 for (int i = 0; i < WPOBE_array.Count(); i++)
12547 {
12548 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12549
12550 if (WPOBE)
12551 {
12552 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12553 }
12554 }
12555 }
12556 }
12557
12558
12560 {
12561 int id = muzzle_owner.GetMuzzleID();
12562 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12563
12564 if (WPOOH_array)
12565 {
12566 for (int i = 0; i < WPOOH_array.Count(); i++)
12567 {
12568 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12569
12570 if (WPOOH)
12571 {
12572 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12573 }
12574 }
12575 }
12576 }
12577
12578
12580 {
12581 int id = muzzle_owner.GetMuzzleID();
12582 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12583
12584 if (WPOOH_array)
12585 {
12586 for (int i = 0; i < WPOOH_array.Count(); i++)
12587 {
12588 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12589
12590 if (WPOOH)
12591 {
12592 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12593 }
12594 }
12595 }
12596 }
12597
12598
12600 {
12601 int id = muzzle_owner.GetMuzzleID();
12602 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12603
12604 if (WPOOH_array)
12605 {
12606 for (int i = 0; i < WPOOH_array.Count(); i++)
12607 {
12608 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12609
12610 if (WPOOH)
12611 {
12612 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12613 }
12614 }
12615 }
12616 }
12617
12618
12619
12621 {
12623 {
12624 return true;
12625 }
12626
12627 return false;
12628 }
12629
12631 {
12633 {
12634 return true;
12635 }
12636
12637 return false;
12638 }
12639
12641 {
12643 {
12644 return true;
12645 }
12646
12647 return false;
12648 }
12649
12651 {
12652 return false;
12653 }
12654
12657 {
12658 return UATimeSpent.DEFAULT_DEPLOY;
12659 }
12660
12661
12662
12663
12665 {
12667 SetSynchDirty();
12668 }
12669
12671 {
12673 }
12674
12675
12677 {
12678 return false;
12679 }
12680
12683 {
12684 string att_type = "None";
12685
12686 if (ConfigIsExisting("soundAttType"))
12687 {
12688 att_type = ConfigGetString("soundAttType");
12689 }
12690
12692 }
12693
12695 {
12697 }
12698
12699
12700
12701
12702
12708
12710 {
12713
12715 }
12716
12717
12719 {
12721 return;
12722
12724
12727
12730
12731 SoundParameters params = new SoundParameters();
12735 }
12736
12737
12739 {
12741 return;
12742
12744 SetSynchDirty();
12745
12748 }
12749
12750
12752 {
12754 return;
12755
12757 SetSynchDirty();
12758
12761 }
12762
12764 {
12766 }
12767
12769 {
12771 }
12772
12775 {
12776 if (!
GetGame().IsDedicatedServer())
12777 {
12778 if (ConfigIsExisting("attachSoundSet"))
12779 {
12780 string cfg_path = "";
12781 string soundset = "";
12782 string type_name =
GetType();
12783
12786 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12787 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12788
12789 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12790 {
12791 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12792 {
12793 if (cfg_slot_array[i] == slot_type)
12794 {
12795 soundset = cfg_soundset_array[i];
12796 break;
12797 }
12798 }
12799 }
12800
12801 if (soundset != "")
12802 {
12803 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12805 }
12806 }
12807 }
12808 }
12809
12811 {
12812
12813 }
12814
12815 void OnApply(PlayerBase player);
12816
12818 {
12819 return 1.0;
12820 };
12821
12823 {
12825 }
12826
12828 {
12830 }
12831
12833
12835 {
12836 SetDynamicPhysicsLifeTime(0.01);
12838 }
12839
12841 {
12842 array<string> zone_names = new array<string>;
12843 GetDamageZones(zone_names);
12844 for (int i = 0; i < zone_names.Count(); i++)
12845 {
12846 SetHealthMax(zone_names.Get(i),"Health");
12847 }
12848 SetHealthMax("","Health");
12849 }
12850
12853 {
12854 float global_health = GetHealth01("","Health");
12855 array<string> zones = new array<string>;
12856 GetDamageZones(zones);
12857
12858 for (int i = 0; i < zones.Count(); i++)
12859 {
12860 SetHealth01(zones.Get(i),"Health",global_health);
12861 }
12862 }
12863
12866 {
12867 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12868 }
12869
12871 {
12872 if (!hasRootAsPlayer)
12873 {
12874 if (refParentIB)
12875 {
12876
12877 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12878 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12879
12880 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12881 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12882
12885 }
12886 else
12887 {
12888
12891 }
12892 }
12893 }
12894
12896 {
12898 {
12899 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12900 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12901 {
12902 float heatPermCoef = 1.0;
12904 while (ent)
12905 {
12906 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12907 ent = ent.GetHierarchyParent();
12908 }
12909
12910 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12911 }
12912 }
12913 }
12914
12916 {
12917
12918 EntityAI parent = GetHierarchyParent();
12919 if (!parent)
12920 {
12921 hasParent = false;
12922 hasRootAsPlayer = false;
12923 }
12924 else
12925 {
12926 hasParent = true;
12927 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12928 refParentIB =
ItemBase.Cast(parent);
12929 }
12930 }
12931
12932 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12933 {
12934
12935 }
12936
12938 {
12939
12940 return false;
12941 }
12942
12944 {
12945
12946
12947 return false;
12948 }
12949
12951 {
12952
12953 return false;
12954 }
12955
12958 {
12959 return !GetIsFrozen() &&
IsOpen();
12960 }
12961
12963 {
12964 bool hasParent = false, hasRootAsPlayer = false;
12966
12967 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12968 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12969
12970 if (wwtu || foodDecay)
12971 {
12975
12976 if (processWetness || processTemperature || processDecay)
12977 {
12979
12980 if (processWetness)
12981 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12982
12983 if (processTemperature)
12985
12986 if (processDecay)
12987 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12988 }
12989 }
12990 }
12991
12994 {
12996 }
12997
12999 {
13002
13003 return super.GetTemperatureFreezeThreshold();
13004 }
13005
13007 {
13010
13011 return super.GetTemperatureThawThreshold();
13012 }
13013
13015 {
13018
13019 return super.GetItemOverheatThreshold();
13020 }
13021
13023 {
13025 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13026
13027 return super.GetTemperatureFreezeTime();
13028 }
13029
13031 {
13033 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13034
13035 return super.GetTemperatureThawTime();
13036 }
13037
13042
13044 {
13045 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13046 }
13047
13049 {
13050 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13051 }
13052
13055 {
13057 }
13058
13060 {
13062 }
13063
13065 {
13067 }
13068
13071 {
13072 return null;
13073 }
13074
13077 {
13078 return false;
13079 }
13080
13082 {
13084 {
13087 if (!trg)
13088 {
13090 explosive = this;
13091 }
13092
13093 explosive.PairRemote(trg);
13095
13096 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13097 trg.SetPersistentPairID(persistentID);
13098 explosive.SetPersistentPairID(persistentID);
13099
13100 return true;
13101 }
13102 return false;
13103 }
13104
13107 {
13108 float ret = 1.0;
13111 ret *= GetHealth01();
13112
13113 return ret;
13114 }
13115
13116 #ifdef DEVELOPER
13117 override void SetDebugItem()
13118 {
13119 super.SetDebugItem();
13120 _itemBase = this;
13121 }
13122
13124 {
13125 string text = super.GetDebugText();
13126
13128 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13129
13130 return text;
13131 }
13132 #endif
13133
13135 {
13136 return true;
13137 }
13138
13140
13142
13144 {
13147 }
13148
13149
13157
13173}
13174
13176{
13178 if (entity)
13179 {
13180 bool is_item = entity.IsInherited(
ItemBase);
13181 if (is_item && full_quantity)
13182 {
13185 }
13186 }
13187 else
13188 {
13190 return NULL;
13191 }
13192 return entity;
13193}
13194
13196{
13197 if (item)
13198 {
13199 if (health > 0)
13200 item.SetHealth("", "", health);
13201
13202 if (item.CanHaveTemperature())
13203 {
13205 if (item.CanFreeze())
13206 item.SetFrozen(false);
13207 }
13208
13209 if (item.HasEnergyManager())
13210 {
13211 if (quantity >= 0)
13212 {
13213 item.GetCompEM().SetEnergy0To1(quantity);
13214 }
13215 else
13216 {
13218 }
13219 }
13220 else if (item.IsMagazine())
13221 {
13222 Magazine mag = Magazine.Cast(item);
13223 if (quantity >= 0)
13224 {
13225 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13226 }
13227 else
13228 {
13230 }
13231
13232 }
13233 else
13234 {
13235 if (quantity >= 0)
13236 {
13237 item.SetQuantityNormalized(quantity, false);
13238 }
13239 else
13240 {
13242 }
13243
13244 }
13245 }
13246}
13247
13248#ifdef DEVELOPER
13250#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.