8340{
8342 {
8343 return true;
8344 }
8345};
8346
8347
8348
8350{
8354
8356
8359
8360
8361
8362
8363
8372
8378
8383
8388
8409 protected bool m_IsResultOfSplit
8410
8412
8417
8418
8419
8421
8425
8426
8427
8429
8432
8433
8434
8440
8441
8449
8452
8453
8455
8456
8458
8459
8464
8465
8470
8471
8473
8474
8476 {
8481
8482 if (!
GetGame().IsDedicatedServer())
8483 {
8485 {
8487
8489 {
8491 }
8492 }
8493
8496 }
8497
8498 m_OldLocation = null;
8499
8501 {
8503 }
8504
8505 if (ConfigIsExisting("headSelectionsToHide"))
8506 {
8509 }
8510
8512 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8513 {
8515 }
8516
8518
8519 m_IsResultOfSplit = false;
8520
8522 }
8523
8525 {
8526 super.InitItemVariables();
8527
8533 m_Count = ConfigGetInt(
"count");
8534
8537
8542
8545
8550
8562
8566
8567
8570 if (ConfigIsExisting("canBeSplit"))
8571 {
8574 }
8575
8577 if (ConfigIsExisting("itemBehaviour"))
8579
8580
8583 RegisterNetSyncVariableInt("m_VarLiquidType");
8584 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8585
8586 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8587 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8588 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8589
8590 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8591 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8592 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8593 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8594
8595 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8596 RegisterNetSyncVariableBool("m_IsTakeable");
8597 RegisterNetSyncVariableBool("m_IsHologram");
8598
8601 {
8604 }
8605
8607
8609 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8611
8612 }
8613
8615 {
8617 }
8618
8620 {
8623 {
8628 }
8629 }
8630
8631 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8632 {
8634 {
8637 }
8638
8640 }
8641
8643 {
8649 }
8650
8652
8654 {
8656
8657 if (!action)
8658 {
8659 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8660 return;
8661 }
8662
8664 if (!ai)
8665 {
8667 return;
8668 }
8669
8671 if (!action_array)
8672 {
8673 action_array = new array<ActionBase_Basic>;
8675 }
8676 if (LogManager.IsActionLogEnable())
8677 {
8678 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8679 }
8680
8681 if (action_array.Find(action) != -1)
8682 {
8683 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8684 }
8685 else
8686 {
8687 action_array.Insert(action);
8688 }
8689 }
8690
8692 {
8694 ActionBase action = player.GetActionManager().GetAction(actionName);
8697
8698 if (action_array)
8699 {
8700 action_array.RemoveItem(action);
8701 }
8702 }
8703
8704
8705
8707 {
8708 ActionOverrideData overrideData = new ActionOverrideData();
8712
8714 if (!actionMap)
8715 {
8718 }
8719
8720 actionMap.Insert(this.
Type(), overrideData);
8721
8722 }
8723
8725
8727
8728
8730 {
8733
8736
8737 string config_to_search = "CfgVehicles";
8738 string muzzle_owner_config;
8739
8741 {
8742 if (IsInherited(Weapon))
8743 config_to_search = "CfgWeapons";
8744
8745 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8746
8747 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8748
8750
8751 if (config_OnFire_subclass_count > 0)
8752 {
8753 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8754
8755 for (int i = 0; i < config_OnFire_subclass_count; i++)
8756 {
8757 string particle_class = "";
8759 string config_OnFire_entry = config_OnFire_class + particle_class;
8760 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8761 WPOF_array.Insert(WPOF);
8762 }
8763
8764
8766 }
8767 }
8768
8770 {
8771 config_to_search = "CfgWeapons";
8772 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8773
8774 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8775
8777
8778 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8779 {
8780 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8781
8782 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8783 {
8784 string particle_class2 = "";
8786 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8787 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8788 WPOBE_array.Insert(WPOBE);
8789 }
8790
8791
8793 }
8794 }
8795 }
8796
8797
8799 {
8802
8804 {
8805 string config_to_search = "CfgVehicles";
8806
8807 if (IsInherited(Weapon))
8808 config_to_search = "CfgWeapons";
8809
8810 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8811 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8812
8813 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8814 {
8815
8817
8819 {
8821 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8823 return;
8824 }
8825
8828
8829
8830
8832 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8833
8834 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8835 {
8836 string particle_class = "";
8838 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8840
8841 if (entry_type == CT_CLASS)
8842 {
8843 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8844 WPOOH_array.Insert(WPOF);
8845 }
8846 }
8847
8848
8850 }
8851 }
8852 }
8853
8855 {
8857 }
8858
8860 {
8862 {
8864
8867
8870
8871 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8872 }
8873 }
8874
8876 {
8878 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8879
8881 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8882
8884 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8885
8887 {
8889 }
8890 }
8891
8893 {
8895 }
8896
8898 {
8901 else
8903
8905 {
8908 }
8909 else
8910 {
8913
8916 }
8917
8919 }
8920
8922 {
8924 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8925 }
8926
8928 {
8930 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8932 }
8933
8935 {
8937 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8938 }
8939
8941 {
8944
8945 OverheatingParticle OP = new OverheatingParticle();
8950
8952 }
8953
8955 {
8958
8959 return -1;
8960 }
8961
8963 {
8965 {
8968
8969 for (int i = count; i > 0; --i)
8970 {
8971 int id = i - 1;
8974
8977
8978 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8979 {
8980 if (p)
8981 {
8984 }
8985 }
8986 }
8987 }
8988 }
8989
8991 {
8993 {
8995 {
8996 int id = i - 1;
8998
8999 if (OP)
9000 {
9002
9003 if (p)
9004 {
9006 }
9007
9008 delete OP;
9009 }
9010 }
9011
9014 }
9015 }
9016
9019 {
9020 return 0.0;
9021 }
9022
9023
9025 {
9026 return 250;
9027 }
9028
9030 {
9031 return 0;
9032 }
9033
9036 {
9038 return true;
9039
9040 return false;
9041 }
9042
9045 {
9048
9050 {
9052 }
9053 else
9054 {
9055
9057 }
9058
9060 }
9061
9068 {
9069 return -1;
9070 }
9071
9072
9073
9074
9076 {
9078 {
9080 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9081
9082 if (r_index >= 0)
9083 {
9084 InventoryLocation r_il = new InventoryLocation;
9085 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9086
9087 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9090 {
9091 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9092 }
9094 {
9095 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9096 }
9097
9098 }
9099
9100 player.GetHumanInventory().ClearUserReservedLocation(this);
9101 }
9102
9105 }
9106
9107
9108
9109
9111 {
9112 return ItemBase.m_DebugActionsMask;
9113 }
9114
9116 {
9117 return ItemBase.m_DebugActionsMask & mask;
9118 }
9119
9121 {
9122 ItemBase.m_DebugActionsMask = mask;
9123 }
9124
9126 {
9127 ItemBase.m_DebugActionsMask |= mask;
9128 }
9129
9131 {
9132 ItemBase.m_DebugActionsMask &= ~mask;
9133 }
9134
9136 {
9138 {
9140 }
9141 else
9142 {
9144 }
9145 }
9146
9147
9149 {
9150 if (GetEconomyProfile())
9151 {
9152 float q_max = GetEconomyProfile().GetQuantityMax();
9153 if (q_max > 0)
9154 {
9155 float q_min = GetEconomyProfile().GetQuantityMin();
9156 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9157
9159 {
9160 ComponentEnergyManager comp = GetCompEM();
9162 {
9164 }
9165 }
9167 {
9169
9170 }
9171
9172 }
9173 }
9174 }
9175
9178 {
9179 EntityAI parent = GetHierarchyParent();
9180
9181 if (parent)
9182 {
9183 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9184 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9185 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9186 }
9187 }
9188
9191 {
9192 EntityAI parent = GetHierarchyParent();
9193
9194 if (parent)
9195 {
9196 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9197 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9198 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9199 }
9200 }
9201
9203 {
9204
9205
9206
9207
9209
9211 {
9212 if (ScriptInputUserData.CanStoreInputUserData())
9213 {
9214 ScriptInputUserData ctx = new ScriptInputUserData;
9220 ctx.
Write(use_stack_max);
9223
9225 {
9226 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9227 }
9228 }
9229 }
9230 else if (!
GetGame().IsMultiplayer())
9231 {
9233 }
9234 }
9235
9237 {
9239 }
9240
9242 {
9244 }
9245
9247 {
9249 }
9250
9252 {
9253
9254 return false;
9255 }
9256
9258 {
9259 return false;
9260 }
9261
9265 {
9266 return false;
9267 }
9268
9270 {
9271 return "";
9272 }
9273
9275
9277 {
9278 return false;
9279 }
9280
9282 {
9283 return true;
9284 }
9285
9286
9287
9289 {
9290 return true;
9291 }
9292
9294 {
9295 return true;
9296 }
9297
9299 {
9300 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9302 }
9303
9305 {
9307 }
9308
9310 {
9312 if (!is_being_placed)
9314 SetSynchDirty();
9315 }
9316
9317
9319
9321 {
9323 }
9324
9326 {
9328 }
9329
9331 {
9332 return 1;
9333 }
9334
9336 {
9337 return false;
9338 }
9339
9341 {
9343 SetSynchDirty();
9344 }
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9381 {
9382 super.OnMovedInsideCargo(container);
9383
9384 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9385 }
9386
9387 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9388 {
9389 super.EEItemLocationChanged(oldLoc,newLoc);
9390
9391 PlayerBase new_player = null;
9392 PlayerBase old_player = null;
9393
9394 if (newLoc.GetParent())
9395 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9396
9397 if (oldLoc.GetParent())
9398 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9399
9401 {
9402 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9403
9404 if (r_index >= 0)
9405 {
9406 InventoryLocation r_il = new InventoryLocation;
9407 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9408
9409 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9412 {
9413 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9414 }
9416 {
9417 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9418 }
9419
9420 }
9421 }
9422
9424 {
9425 if (new_player)
9426 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9427
9428 if (new_player == old_player)
9429 {
9430
9431 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9432 {
9434 {
9435 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9436 {
9437 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9438 }
9439 }
9440 else
9441 {
9442 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9443 }
9444 }
9445
9446 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9447 {
9448 int type = oldLoc.GetType();
9450 {
9451 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9452 }
9454 {
9455 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9456 }
9457 }
9458 if (!m_OldLocation)
9459 {
9460 m_OldLocation = new InventoryLocation;
9461 }
9462 m_OldLocation.Copy(oldLoc);
9463 }
9464 else
9465 {
9466 if (m_OldLocation)
9467 {
9468 m_OldLocation.Reset();
9469 }
9470 }
9471
9473 }
9474 else
9475 {
9476 if (new_player)
9477 {
9478 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9479 if (res_index >= 0)
9480 {
9481 InventoryLocation il = new InventoryLocation;
9482 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9484 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9487 {
9488 il.
GetParent().GetOnReleaseLock().Invoke(it);
9489 }
9491 {
9493 }
9494
9495 }
9496 }
9498 {
9499
9501 }
9502
9503 if (m_OldLocation)
9504 {
9505 m_OldLocation.Reset();
9506 }
9507 }
9508 }
9509
9510 override void EOnContact(IEntity other, Contact extra)
9511 {
9513 {
9514 int liquidType = -1;
9516 if (impactSpeed > 0.0)
9517 {
9519 #ifndef SERVER
9521 #else
9523 SetSynchDirty();
9524 #endif
9526 }
9527 }
9528
9529 #ifdef SERVER
9530 if (GetCompEM() && GetCompEM().IsPlugged())
9531 {
9532 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9533 GetCompEM().UnplugThis();
9534 }
9535 #endif
9536 }
9537
9539
9541 {
9543 }
9544
9546 {
9547
9548 }
9549
9551 {
9552 super.OnItemLocationChanged(old_owner, new_owner);
9553
9554 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9555 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9556
9557 if (!relatedPlayer && playerNew)
9558 relatedPlayer = playerNew;
9559
9560 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9561 {
9563 if (actionMgr)
9564 {
9565 ActionBase currentAction = actionMgr.GetRunningAction();
9566 if (currentAction)
9568 }
9569 }
9570
9571 Man ownerPlayerOld = null;
9572 Man ownerPlayerNew = null;
9573
9574 if (old_owner)
9575 {
9576 if (old_owner.
IsMan())
9577 {
9578 ownerPlayerOld = Man.Cast(old_owner);
9579 }
9580 else
9581 {
9582 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9583 }
9584 }
9585 else
9586 {
9588 {
9590
9591 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9592 {
9593 GetCompEM().UnplugThis();
9594 }
9595 }
9596 }
9597
9598 if (new_owner)
9599 {
9600 if (new_owner.
IsMan())
9601 {
9602 ownerPlayerNew = Man.Cast(new_owner);
9603 }
9604 else
9605 {
9606 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9607 }
9608 }
9609
9610 if (ownerPlayerOld != ownerPlayerNew)
9611 {
9612 if (ownerPlayerOld)
9613 {
9614 array<EntityAI> subItemsExit = new array<EntityAI>;
9616 for (int i = 0; i < subItemsExit.Count(); i++)
9617 {
9620 }
9621 }
9622
9623 if (ownerPlayerNew)
9624 {
9625 array<EntityAI> subItemsEnter = new array<EntityAI>;
9627 for (int j = 0; j < subItemsEnter.Count(); j++)
9628 {
9631 }
9632 }
9633 }
9634 else if (ownerPlayerNew != null)
9635 {
9636 PlayerBase nplayer;
9637 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9638 {
9639 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9641 for (int k = 0; k < subItemsUpdate.Count(); k++)
9642 {
9644 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9645 }
9646 }
9647 }
9648
9649 if (old_owner)
9650 old_owner.OnChildItemRemoved(this);
9651 if (new_owner)
9652 new_owner.OnChildItemReceived(this);
9653 }
9654
9655
9657 {
9658 super.EEDelete(parent);
9659 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9660 if (player)
9661 {
9663
9664 if (player.IsAlive())
9665 {
9666 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9667 if (r_index >= 0)
9668 {
9669 InventoryLocation r_il = new InventoryLocation;
9670 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9671
9672 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9675 {
9676 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9677 }
9679 {
9680 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9681 }
9682
9683 }
9684
9685 player.RemoveQuickBarEntityShortcut(this);
9686 }
9687 }
9688 }
9689
9691 {
9692 super.EEKilled(killer);
9693
9696 {
9697 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9698 {
9699 if (IsMagazine())
9700 {
9701 if (Magazine.Cast(this).GetAmmoCount() > 0)
9702 {
9704 }
9705 }
9706 else
9707 {
9709 }
9710 }
9711 }
9712 }
9713
9715 {
9716 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9717
9718 super.OnWasAttached(parent, slot_id);
9719
9722
9724 }
9725
9727 {
9728 super.OnWasDetached(parent, slot_id);
9729
9732 }
9733
9735 {
9736 int idx;
9739
9740 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9741 if (inventory_slots.Count() < 1)
9742 {
9743 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9744 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9745 }
9746 else
9747 {
9748 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9749 }
9750
9751 idx = inventory_slots.Find(slot);
9752 if (idx < 0)
9753 return "";
9754
9755 return attach_types.Get(idx);
9756 }
9757
9759 {
9760 int idx = -1;
9761 string slot;
9762
9765
9766 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9767 if (inventory_slots.Count() < 1)
9768 {
9769 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9770 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9771 }
9772 else
9773 {
9774 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9775 if (detach_types.Count() < 1)
9776 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9777 }
9778
9779 for (int i = 0; i < inventory_slots.Count(); i++)
9780 {
9781 slot = inventory_slots.Get(i);
9782 }
9783
9784 if (slot != "")
9785 {
9786 if (detach_types.Count() == 1)
9787 idx = 0;
9788 else
9789 idx = inventory_slots.Find(slot);
9790 }
9791 if (idx < 0)
9792 return "";
9793
9794 return detach_types.Get(idx);
9795 }
9796
9798 {
9799
9801
9802
9803 float min_time = 1;
9804 float max_time = 3;
9805 float delay = Math.RandomFloat(min_time, max_time);
9806
9807 explode_timer.Run(delay, this, "DoAmmoExplosion");
9808 }
9809
9811 {
9812 Magazine magazine = Magazine.Cast(this);
9813 int pop_sounds_count = 6;
9814 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9815
9816
9817 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9818 string sound_name = pop_sounds[ sound_idx ];
9820
9821
9822 magazine.ServerAddAmmoCount(-1);
9823
9824
9825 float min_temp_to_explode = 100;
9826
9827 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9828 {
9830 }
9831 }
9832
9833
9834 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9835 {
9836 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9837
9838 const int CHANCE_DAMAGE_CARGO = 4;
9839 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9840 const int CHANCE_DAMAGE_NOTHING = 2;
9841
9843 {
9844 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9845 int chances;
9846 int rnd;
9847
9848 if (GetInventory().GetCargo())
9849 {
9850 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9851 rnd = Math.RandomInt(0,chances);
9852
9853 if (rnd < CHANCE_DAMAGE_CARGO)
9854 {
9856 }
9857 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9858 {
9860 }
9861 }
9862 else
9863 {
9864 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9865 rnd = Math.RandomInt(0,chances);
9866
9867 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9868 {
9870 }
9871 }
9872 }
9873 }
9874
9876 {
9877 if (GetInventory().GetCargo())
9878 {
9879 int item_count = GetInventory().GetCargo().GetItemCount();
9880 if (item_count > 0)
9881 {
9882 int random_pick = Math.RandomInt(0, item_count);
9884 if (!item.IsExplosive())
9885 {
9886 item.AddHealth("","",damage);
9887 return true;
9888 }
9889 }
9890 }
9891 return false;
9892 }
9893
9895 {
9896 int attachment_count = GetInventory().AttachmentCount();
9897 if (attachment_count > 0)
9898 {
9899 int random_pick = Math.RandomInt(0, attachment_count);
9900 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9901 if (!attachment.IsExplosive())
9902 {
9903 attachment.AddHealth("","",damage);
9904 return true;
9905 }
9906 }
9907 return false;
9908 }
9909
9911 {
9913 }
9914
9916 {
9918 return GetInventory().CanRemoveEntity();
9919
9920 return false;
9921 }
9922
9924 {
9926 return;
9927
9929 {
9930 if (ScriptInputUserData.CanStoreInputUserData())
9931 {
9932 ScriptInputUserData ctx = new ScriptInputUserData;
9937 ctx.
Write(destination_entity);
9941 }
9942 }
9943 else if (!
GetGame().IsMultiplayer())
9944 {
9946 }
9947 }
9948
9950 {
9952 return;
9953
9954 float split_quantity_new;
9958 InventoryLocation loc = new InventoryLocation;
9959
9960 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9961 {
9963 split_quantity_new = stack_max;
9964 else
9966
9967 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9968 if (new_item)
9969 {
9970 new_item.SetResultOfSplit(true);
9971 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9973 new_item.SetQuantity(split_quantity_new);
9974 }
9975 }
9976 else if (destination_entity && slot_id == -1)
9977 {
9978 if (quantity > stack_max)
9979 split_quantity_new = stack_max;
9980 else
9981 split_quantity_new = quantity;
9982
9984 {
9987 }
9988
9989 if (new_item)
9990 {
9991 new_item.SetResultOfSplit(true);
9992 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9994 new_item.SetQuantity(split_quantity_new);
9995 }
9996 }
9997 else
9998 {
9999 if (stack_max != 0)
10000 {
10002 {
10004 }
10005
10006 if (split_quantity_new == 0)
10007 {
10008 if (!
GetGame().IsMultiplayer())
10009 player.PhysicalPredictiveDropItem(this);
10010 else
10011 player.ServerDropEntity(this);
10012 return;
10013 }
10014
10016
10017 if (new_item)
10018 {
10019 new_item.SetResultOfSplit(true);
10020 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10022 new_item.SetQuantity(stack_max);
10023 new_item.PlaceOnSurface();
10024 }
10025 }
10026 }
10027 }
10028
10030 {
10032 return;
10033
10034 float split_quantity_new;
10038 InventoryLocation loc = new InventoryLocation;
10039
10040 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10041 {
10043 split_quantity_new = stack_max;
10044 else
10046
10047 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10048 if (new_item)
10049 {
10050 new_item.SetResultOfSplit(true);
10051 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10053 new_item.SetQuantity(split_quantity_new);
10054 }
10055 }
10056 else if (destination_entity && slot_id == -1)
10057 {
10058 if (quantity > stack_max)
10059 split_quantity_new = stack_max;
10060 else
10061 split_quantity_new = quantity;
10062
10064 {
10067 }
10068
10069 if (new_item)
10070 {
10071 new_item.SetResultOfSplit(true);
10072 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10074 new_item.SetQuantity(split_quantity_new);
10075 }
10076 }
10077 else
10078 {
10079 if (stack_max != 0)
10080 {
10082 {
10084 }
10085
10087
10088 if (new_item)
10089 {
10090 new_item.SetResultOfSplit(true);
10091 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10093 new_item.SetQuantity(stack_max);
10094 new_item.PlaceOnSurface();
10095 }
10096 }
10097 }
10098 }
10099
10101 {
10103 return;
10104
10106 {
10107 if (ScriptInputUserData.CanStoreInputUserData())
10108 {
10109 ScriptInputUserData ctx = new ScriptInputUserData;
10114 dst.WriteToContext(ctx);
10116 }
10117 }
10118 else if (!
GetGame().IsMultiplayer())
10119 {
10121 }
10122 }
10123
10125 {
10127 return;
10128
10130 {
10131 if (ScriptInputUserData.CanStoreInputUserData())
10132 {
10133 ScriptInputUserData ctx = new ScriptInputUserData;
10138 ctx.
Write(destination_entity);
10144 }
10145 }
10146 else if (!
GetGame().IsMultiplayer())
10147 {
10149 }
10150 }
10151
10153 {
10155 }
10156
10158 {
10160 return this;
10161
10163 float split_quantity_new;
10165 if (dst.IsValid())
10166 {
10167 int slot_id = dst.GetSlot();
10169
10170 if (quantity > stack_max)
10171 split_quantity_new = stack_max;
10172 else
10173 split_quantity_new = quantity;
10174
10176
10177 if (new_item)
10178 {
10179 new_item.SetResultOfSplit(true);
10180 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10183 }
10184
10185 return new_item;
10186 }
10187
10188 return null;
10189 }
10190
10192 {
10194 return;
10195
10197 float split_quantity_new;
10199 if (destination_entity)
10200 {
10202 if (quantity > stackable)
10203 split_quantity_new = stackable;
10204 else
10205 split_quantity_new = quantity;
10206
10207 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10208 if (new_item)
10209 {
10210 new_item.SetResultOfSplit(true);
10211 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10213 new_item.SetQuantity(split_quantity_new);
10214 }
10215 }
10216 }
10217
10219 {
10221 return;
10222
10224 {
10225 if (ScriptInputUserData.CanStoreInputUserData())
10226 {
10227 ScriptInputUserData ctx = new ScriptInputUserData;
10232 ItemBase destination_entity =
this;
10233 ctx.
Write(destination_entity);
10237 }
10238 }
10239 else if (!
GetGame().IsMultiplayer())
10240 {
10242 }
10243 }
10244
10246 {
10248 return;
10249
10251 float split_quantity_new;
10253 if (player)
10254 {
10256 if (quantity > stackable)
10257 split_quantity_new = stackable;
10258 else
10259 split_quantity_new = quantity;
10260
10261 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10262 new_item =
ItemBase.Cast(in_hands);
10263 if (new_item)
10264 {
10265 new_item.SetResultOfSplit(true);
10266 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10268 new_item.SetQuantity(split_quantity_new);
10269 }
10270 }
10271 }
10272
10274 {
10276 return;
10277
10279 float split_quantity_new = Math.Floor(quantity * 0.5);
10280
10282
10283 if (new_item)
10284 {
10285 if (new_item.GetQuantityMax() < split_quantity_new)
10286 {
10287 split_quantity_new = new_item.GetQuantityMax();
10288 }
10289
10290 new_item.SetResultOfSplit(true);
10291 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10292
10294 {
10297 }
10298 else
10299 {
10302 }
10303 }
10304 }
10305
10307 {
10309 return;
10310
10312 float split_quantity_new = Math.Floor(quantity / 2);
10313
10314 InventoryLocation invloc = new InventoryLocation;
10316
10318 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10319
10320 if (new_item)
10321 {
10322 if (new_item.GetQuantityMax() < split_quantity_new)
10323 {
10324 split_quantity_new = new_item.GetQuantityMax();
10325 }
10327 {
10330 }
10331 else
10332 {
10335 }
10336 }
10337 }
10338
10341 {
10342 SetWeightDirty();
10344
10345 if (parent)
10346 parent.OnAttachmentQuantityChangedEx(this, delta);
10347
10349 {
10351 {
10353 }
10355 {
10356 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10358 }
10359 }
10360
10361 }
10362
10365 {
10366
10367 }
10368
10371 {
10373 }
10374
10376 {
10377 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10378
10380 {
10381 if (newLevel == GameConstants.STATE_RUINED)
10382 {
10384 EntityAI parent = GetHierarchyParent();
10385 if (parent && parent.IsFireplace())
10386 {
10387 CargoBase cargo = GetInventory().GetCargo();
10388 if (cargo)
10389 {
10391 {
10393 }
10394 }
10395 }
10396 }
10397
10399 {
10400
10402 return;
10403 }
10404
10405 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10406 {
10408 }
10409 }
10410 }
10411
10412
10414 {
10415 super.OnRightClick();
10416
10418 {
10420 {
10421 if (ScriptInputUserData.CanStoreInputUserData())
10422 {
10423 vector m4[4];
10425
10426 EntityAI root = GetHierarchyRoot();
10427
10428 InventoryLocation dst = new InventoryLocation;
10430 {
10431 if (root)
10432 {
10433 root.GetTransform(m4);
10435 }
10436 else
10437 GetInventory().GetCurrentInventoryLocation(dst);
10438 }
10439 else
10440 {
10442
10443
10444 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10445 {
10446 if (root)
10447 {
10448 root.GetTransform(m4);
10450 }
10451 else
10452 GetInventory().GetCurrentInventoryLocation(dst);
10453 }
10454 else
10455 {
10456 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10457 }
10458 }
10459
10460 ScriptInputUserData ctx = new ScriptInputUserData;
10468 }
10469 }
10470 else if (!
GetGame().IsMultiplayer())
10471 {
10473 }
10474 }
10475 }
10476
10477 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10478 {
10479
10480 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10481 return false;
10482
10483 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10484 return false;
10485
10486
10488 return false;
10489
10490
10491 Magazine mag = Magazine.Cast(this);
10492 if (mag)
10493 {
10494 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10495 return false;
10496
10497 if (stack_max_limit)
10498 {
10499 Magazine other_mag = Magazine.Cast(other_item);
10500 if (other_item)
10501 {
10502 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10503 return false;
10504 }
10505
10506 }
10507 }
10508 else
10509 {
10510
10512 return false;
10513
10515 return false;
10516 }
10517
10518 PlayerBase player = null;
10519 if (CastTo(player, GetHierarchyRootPlayer()))
10520 {
10521 if (player.GetInventory().HasAttachment(this))
10522 return false;
10523
10524 if (player.IsItemsToDelete())
10525 return false;
10526 }
10527
10528 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10529 return false;
10530
10531 int slotID;
10533 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10534 return false;
10535
10536 return true;
10537 }
10538
10540 {
10542 }
10543
10545 {
10546 return m_IsResultOfSplit;
10547 }
10548
10550 {
10551 m_IsResultOfSplit = value;
10552 }
10553
10555 {
10557 }
10558
10560 {
10561 float other_item_quantity = other_item.GetQuantity();
10562 float this_free_space;
10563
10565
10567
10568 if (other_item_quantity > this_free_space)
10569 {
10570 return this_free_space;
10571 }
10572 else
10573 {
10574 return other_item_quantity;
10575 }
10576 }
10577
10579 {
10581 }
10582
10584 {
10586 return;
10587
10588 if (!IsMagazine() && other_item)
10589 {
10591 if (quantity_used != 0)
10592 {
10593 float hp1 = GetHealth01("","");
10594 float hp2 = other_item.GetHealth01("","");
10595 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10596 hpResult = hpResult / (
GetQuantity() + quantity_used);
10597
10598 hpResult *= GetMaxHealth();
10599 Math.Round(hpResult);
10600 SetHealth("", "Health", hpResult);
10601
10603 other_item.AddQuantity(-quantity_used);
10604 }
10605 }
10607 }
10608
10610 {
10611 #ifdef SERVER
10612 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10613 GetHierarchyParent().IncreaseLifetimeUp();
10614 #endif
10615 };
10616
10618 {
10619 PlayerBase p = PlayerBase.Cast(player);
10620
10621 array<int> recipesIds = p.m_Recipes;
10622 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10623 if (moduleRecipesManager)
10624 {
10625 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10626 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10627 }
10628
10629 for (int i = 0;i < recipesIds.Count(); i++)
10630 {
10631 int key = recipesIds.Get(i);
10632 string recipeName = moduleRecipesManager.GetRecipeName(key);
10634 }
10635 }
10636
10637
10638 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10639 {
10640 super.GetDebugActions(outputList);
10641
10642
10647
10648
10652
10656
10657
10660
10661
10663 {
10666 }
10667
10669
10672
10676 }
10677
10678
10679
10680
10682 {
10683 super.OnAction(action_id, player, ctx);
10684 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10685 {
10686 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10687 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10688 PlayerBase p = PlayerBase.Cast(player);
10689 if (
EActions.RECIPES_RANGE_START < 1000)
10690 {
10691 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10692 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10693 }
10694 }
10695 #ifndef SERVER
10696 else if (action_id ==
EActions.WATCH_PLAYER)
10697 {
10698 PluginDeveloper.SetDeveloperItemClientEx(player);
10699 }
10700 #endif
10702 {
10703 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10704 {
10705 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10706 OnDebugButtonPressServer(id + 1);
10707 }
10708
10709 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10710 {
10711 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10713 }
10714
10715 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10716 {
10717 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10719 }
10720
10721 else if (action_id ==
EActions.ADD_QUANTITY)
10722 {
10723 if (IsMagazine())
10724 {
10725 Magazine mag = Magazine.Cast(this);
10726 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10727 }
10728 else
10729 {
10731 }
10732
10733 if (m_EM)
10734 {
10735 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10736 }
10737
10738 }
10739
10740 else if (action_id ==
EActions.REMOVE_QUANTITY)
10741 {
10742 if (IsMagazine())
10743 {
10744 Magazine mag2 = Magazine.Cast(this);
10745 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10746 }
10747 else
10748 {
10750 }
10751 if (m_EM)
10752 {
10753 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10754 }
10755
10756 }
10757
10758 else if (action_id ==
EActions.SET_QUANTITY_0)
10759 {
10761
10762 if (m_EM)
10763 {
10764 m_EM.SetEnergy(0);
10765 }
10766 }
10767
10768 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10769 {
10771
10772 if (m_EM)
10773 {
10774 m_EM.SetEnergy(m_EM.GetEnergyMax());
10775 }
10776 }
10777
10778 else if (action_id ==
EActions.ADD_HEALTH)
10779 {
10780 AddHealth("","",GetMaxHealth("","Health")/5);
10781 }
10782 else if (action_id ==
EActions.REMOVE_HEALTH)
10783 {
10784 AddHealth("","",-GetMaxHealth("","Health")/5);
10785 }
10786 else if (action_id ==
EActions.DESTROY_HEALTH)
10787 {
10788 SetHealth01("","",0);
10789 }
10790 else if (action_id ==
EActions.WATCH_ITEM)
10791 {
10793 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10794 #ifdef DEVELOPER
10795 SetDebugDeveloper_item(this);
10796 #endif
10797 }
10798
10799 else if (action_id ==
EActions.ADD_TEMPERATURE)
10800 {
10801 AddTemperature(20);
10802
10803 }
10804
10805 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10806 {
10807 AddTemperature(-20);
10808
10809 }
10810
10811 else if (action_id ==
EActions.FLIP_FROZEN)
10812 {
10813 SetFrozen(!GetIsFrozen());
10814
10815 }
10816
10817 else if (action_id ==
EActions.ADD_WETNESS)
10818 {
10820
10821 }
10822
10823 else if (action_id ==
EActions.REMOVE_WETNESS)
10824 {
10826
10827 }
10828
10829 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10830 {
10833
10834
10835 }
10836
10837 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10838 {
10841 }
10842
10843 else if (action_id ==
EActions.MAKE_SPECIAL)
10844 {
10845 auto debugParams = DebugSpawnParams.WithPlayer(player);
10846 OnDebugSpawnEx(debugParams);
10847 }
10848
10849 else if (action_id ==
EActions.DELETE)
10850 {
10851 Delete();
10852 }
10853
10854 }
10855
10856
10857 return false;
10858 }
10859
10860
10861
10862
10866
10869
10870
10871
10873 {
10874 return false;
10875 }
10876
10877
10879 {
10880 return true;
10881 }
10882
10883
10885 {
10886 return true;
10887 }
10888
10889
10890
10892 {
10893 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10895 }
10896
10899 {
10900 return null;
10901 }
10902
10904 {
10905 return false;
10906 }
10907
10909 {
10910 return false;
10911 }
10912
10916
10917
10919 {
10920 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10921 return module_repairing.CanRepair(this, item_repair_kit);
10922 }
10923
10924
10925 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10926 {
10927 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10928 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10929 }
10930
10931
10933 {
10934
10935
10936
10937
10938
10939
10940
10941
10942 return 1;
10943 }
10944
10945
10946
10948 {
10950 }
10951
10952
10953
10955 {
10957 }
10958
10959
10968 {
10969 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10970
10971 if (player)
10972 {
10973 player.MessageStatus(text);
10974 }
10975 }
10976
10977
10986 {
10987 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10988
10989 if (player)
10990 {
10991 player.MessageAction(text);
10992 }
10993 }
10994
10995
11004 {
11005 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11006
11007 if (player)
11008 {
11009 player.MessageFriendly(text);
11010 }
11011 }
11012
11013
11022 {
11023 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11024
11025 if (player)
11026 {
11027 player.MessageImportant(text);
11028 }
11029 }
11030
11032 {
11033 return true;
11034 }
11035
11036
11037 override bool KindOf(
string tag)
11038 {
11039 bool found = false;
11040 string item_name = this.
GetType();
11043
11044 int array_size = item_tag_array.Count();
11045 for (int i = 0; i < array_size; i++)
11046 {
11047 if (item_tag_array.Get(i) == tag)
11048 {
11049 found = true;
11050 break;
11051 }
11052 }
11053 return found;
11054 }
11055
11056
11058 {
11059
11060 super.OnRPC(sender, rpc_type,ctx);
11061
11062
11063 switch (rpc_type)
11064 {
11065 #ifndef SERVER
11066 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11067 Param2<bool, string> p = new Param2<bool, string>(false, "");
11068
11070 return;
11071
11072 bool play = p.param1;
11073 string soundSet = p.param2;
11074
11075 if (play)
11076 {
11078 {
11080 {
11082 }
11083 }
11084 else
11085 {
11087 }
11088 }
11089 else
11090 {
11092 }
11093
11094 break;
11095 #endif
11096
11097 }
11098
11100 {
11102 }
11103 }
11104
11105
11106
11107
11109 {
11110 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11111 return plugin.GetID(
name);
11112 }
11113
11115 {
11116 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11117 return plugin.GetName(id);
11118 }
11119
11122 {
11123
11124
11125 int varFlags;
11126 if (!ctx.
Read(varFlags))
11127 return;
11128
11129 if (varFlags & ItemVariableFlags.FLOAT)
11130 {
11132 }
11133 }
11134
11136 {
11137
11138 super.SerializeNumericalVars(floats_out);
11139
11140
11141
11143 {
11145 }
11146
11148 {
11150 }
11151
11153 {
11155 }
11156
11158 {
11163 }
11164
11166 {
11168 }
11169 }
11170
11172 {
11173
11174 super.DeSerializeNumericalVars(floats);
11175
11176
11177 int index = 0;
11178 int mask = Math.Round(floats.Get(index));
11179
11180 index++;
11181
11183 {
11185 {
11187 }
11188 else
11189 {
11190 float quantity = floats.Get(index);
11191 SetQuantity(quantity,
true,
false,
false,
false);
11192 }
11193 index++;
11194 }
11195
11197 {
11198 float wet = floats.Get(index);
11200 index++;
11201 }
11202
11204 {
11205 int liquidtype = Math.Round(floats.Get(index));
11207 index++;
11208 }
11209
11211 {
11213 index++;
11215 index++;
11217 index++;
11219 index++;
11220 }
11221
11223 {
11224 int cleanness = Math.Round(floats.Get(index));
11226 index++;
11227 }
11228 }
11229
11231 {
11232 super.WriteVarsToCTX(ctx);
11233
11234
11236 {
11238 }
11239
11241 {
11243 }
11244
11246 {
11248 }
11249
11251 {
11252 int r,g,b,a;
11258 }
11259
11261 {
11263 }
11264 }
11265
11267 {
11268 if (!super.ReadVarsFromCTX(ctx,version))
11269 return false;
11270
11271 int intValue;
11272 float value;
11273
11274 if (version < 140)
11275 {
11276 if (!ctx.
Read(intValue))
11277 return false;
11278
11279 m_VariablesMask = intValue;
11280 }
11281
11283 {
11284 if (!ctx.
Read(value))
11285 return false;
11286
11288 {
11290 }
11291 else
11292 {
11294 }
11295 }
11296
11297 if (version < 140)
11298 {
11300 {
11301 if (!ctx.
Read(value))
11302 return false;
11303 SetTemperatureDirect(value);
11304 }
11305 }
11306
11308 {
11309 if (!ctx.
Read(value))
11310 return false;
11312 }
11313
11315 {
11316 if (!ctx.
Read(intValue))
11317 return false;
11319 }
11320
11322 {
11323 int r,g,b,a;
11325 return false;
11327 return false;
11329 return false;
11331 return false;
11332
11334 }
11335
11337 {
11338 if (!ctx.
Read(intValue))
11339 return false;
11341 }
11342
11343 if (version >= 138 && version < 140)
11344 {
11346 {
11347 if (!ctx.
Read(intValue))
11348 return false;
11349 SetFrozen(intValue);
11350 }
11351 }
11352
11353 return true;
11354 }
11355
11356
11358 {
11361 {
11363 }
11364
11365 if (!super.OnStoreLoad(ctx, version))
11366 {
11368 return false;
11369 }
11370
11371 if (version >= 114)
11372 {
11373 bool hasQuickBarIndexSaved;
11374
11375 if (!ctx.
Read(hasQuickBarIndexSaved))
11376 {
11378 return false;
11379 }
11380
11381 if (hasQuickBarIndexSaved)
11382 {
11383 int itmQBIndex;
11384
11385
11386 if (!ctx.
Read(itmQBIndex))
11387 {
11389 return false;
11390 }
11391
11392 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11393 if (itmQBIndex != -1 && parentPlayer)
11394 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11395 }
11396 }
11397 else
11398 {
11399
11400 PlayerBase player;
11401 int itemQBIndex;
11402 if (version ==
int.
MAX)
11403 {
11404 if (!ctx.
Read(itemQBIndex))
11405 {
11407 return false;
11408 }
11409 }
11410 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11411 {
11412
11413 if (!ctx.
Read(itemQBIndex))
11414 {
11416 return false;
11417 }
11418 if (itemQBIndex != -1 && player)
11419 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11420 }
11421 }
11422
11423 if (version < 140)
11424 {
11425
11426 if (!LoadVariables(ctx, version))
11427 {
11429 return false;
11430 }
11431 }
11432
11433
11435 {
11437 return false;
11438 }
11439 if (version >= 132)
11440 {
11442 if (raib)
11443 {
11445 {
11447 return false;
11448 }
11449 }
11450 }
11451
11453 return true;
11454 }
11455
11456
11457
11459 {
11460 super.OnStoreSave(ctx);
11461
11462 PlayerBase player;
11463 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11464 {
11466
11467 int itemQBIndex = -1;
11468 itemQBIndex = player.FindQuickBarEntityIndex(this);
11469 ctx.
Write(itemQBIndex);
11470 }
11471 else
11472 {
11474 }
11475
11477
11479 if (raib)
11480 {
11482 }
11483 }
11484
11485
11487 {
11488 super.AfterStoreLoad();
11489
11491 {
11493 }
11494
11496 {
11499 }
11500 }
11501
11503 {
11504 super.EEOnAfterLoad();
11505
11507 {
11509 }
11510
11513 }
11514
11516 {
11517 return false;
11518 }
11519
11520
11521
11523 {
11525 {
11526 #ifdef PLATFORM_CONSOLE
11527
11529 {
11531 if (menu)
11532 {
11534 }
11535 }
11536 #endif
11537 }
11538
11540 {
11543 }
11544
11546 {
11547 SetWeightDirty();
11549 }
11551 {
11554 }
11555
11557 {
11560 }
11562 {
11565 }
11566
11567 super.OnVariablesSynchronized();
11568 }
11569
11570
11571
11573 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11574 {
11575 if (!IsServerCheck(allow_client))
11576 return false;
11577
11579 return false;
11580
11583
11584 if (value <= (min + 0.001))
11585 value = min;
11586
11587 if (value == min)
11588 {
11589 if (destroy_config)
11590 {
11591 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11592 if (dstr)
11593 {
11595 this.Delete();
11596 return true;
11597 }
11598 }
11599 else if (destroy_forced)
11600 {
11602 this.Delete();
11603 return true;
11604 }
11605
11607 }
11608
11611
11613 {
11615
11616 if (delta)
11618 }
11619
11621
11622 return false;
11623 }
11624
11625
11627 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11628 {
11630 }
11631
11633 {
11636 }
11637
11639 {
11642 }
11643
11646 {
11647 float value_clamped = Math.Clamp(value, 0, 1);
11649 SetQuantity(result, destroy_config, destroy_forced);
11650 }
11651
11652
11655 {
11657 }
11658
11660 {
11662 }
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11674 {
11675 int slot = -1;
11676 if (GetInventory())
11677 {
11678 InventoryLocation il = new InventoryLocation;
11679 GetInventory().GetCurrentInventoryLocation(il);
11681 }
11682
11684 }
11685
11687 {
11688 float quantity_max = 0;
11689
11691 {
11692 if (attSlotID != -1)
11693 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11694
11695 if (quantity_max <= 0)
11697 }
11698
11699 if (quantity_max <= 0)
11701
11702 return quantity_max;
11703 }
11704
11706 {
11708 }
11709
11711 {
11713 }
11714
11715
11717 {
11719 }
11720
11722 {
11724 }
11725
11727 {
11729 }
11730
11731
11733 {
11734
11735 float weightEx = GetWeightEx();
11736 float special = GetInventoryAndCargoWeight();
11737 return weightEx - special;
11738 }
11739
11740
11742 {
11744 }
11745
11747 {
11749 {
11750 #ifdef DEVELOPER
11751 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11752 {
11753 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11755 }
11756 #endif
11757
11758 return GetQuantity() * GetConfigWeightModified();
11759 }
11760 else if (HasEnergyManager())
11761 {
11762 #ifdef DEVELOPER
11763 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11764 {
11765 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11766 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11767 }
11768 #endif
11769 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11770 }
11771 else
11772 {
11773 #ifdef DEVELOPER
11774 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11775 {
11776 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11777 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11778 }
11779 #endif
11780 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11781 }
11782 }
11783
11786 {
11787 int item_count = 0;
11789
11790 if (GetInventory().GetCargo() != NULL)
11791 {
11792 item_count = GetInventory().GetCargo().GetItemCount();
11793 }
11794
11795 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11796 {
11797 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11798 if (item)
11799 item_count += item.GetNumberOfItems();
11800 }
11801 return item_count;
11802 }
11803
11806 {
11807 float weight = 0;
11808 float wetness = 1;
11809 if (include_wetness)
11812 {
11813 weight = wetness * m_ConfigWeight;
11814 }
11816 {
11817 weight = 1;
11818 }
11819 return weight;
11820 }
11821
11822
11823
11825 {
11826 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11827 {
11828 GameInventory inv = GetInventory();
11829 array<EntityAI> items = new array<EntityAI>;
11831 for (int i = 0; i < items.Count(); i++)
11832 {
11834 if (item)
11835 {
11837 }
11838 }
11839 }
11840 }
11841
11842
11843
11844
11846 {
11847 float energy = 0;
11848 if (HasEnergyManager())
11849 {
11850 energy = GetCompEM().GetEnergy();
11851 }
11852 return energy;
11853 }
11854
11855
11857 {
11858 super.OnEnergyConsumed();
11859
11861 }
11862
11864 {
11865 super.OnEnergyAdded();
11866
11868 }
11869
11870
11872 {
11873 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11874 {
11876 {
11877 float energy_0to1 = GetCompEM().GetEnergy0To1();
11879 }
11880 }
11881 }
11882
11883
11885 {
11886 return ConfigGetFloat("heatIsolation");
11887 }
11888
11890 {
11892 }
11893
11895 {
11896 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11897 if (
GetGame().ConfigIsExisting(paramPath))
11899
11900 return 0.0;
11901 }
11902
11904 {
11905 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11906 if (
GetGame().ConfigIsExisting(paramPath))
11908
11909 return 0.0;
11910 }
11911
11912 override void SetWet(
float value,
bool allow_client =
false)
11913 {
11914 if (!IsServerCheck(allow_client))
11915 return;
11916
11919
11921
11922 m_VarWet = Math.Clamp(value, min, max);
11923
11925 {
11928 }
11929 }
11930
11931 override void AddWet(
float value)
11932 {
11934 }
11935
11937 {
11939 }
11940
11942 {
11944 }
11945
11947 {
11949 }
11950
11952 {
11954 }
11955
11957 {
11959 }
11960
11961 override void OnWetChanged(
float newVal,
float oldVal)
11962 {
11965 if (newLevel != oldLevel)
11966 {
11968 }
11969 }
11970
11972 {
11973 SetWeightDirty();
11974 }
11975
11977 {
11978 return GetWetLevelInternal(
m_VarWet);
11979 }
11980
11981
11982
11984 {
11986 }
11987
11989 {
11991 }
11992
11994 {
11996 }
11997
11999 {
12001 }
12002
12003
12004
12006 {
12007 if (ConfigIsExisting("itemModelLength"))
12008 {
12009 return ConfigGetFloat("itemModelLength");
12010 }
12011 return 0;
12012 }
12013
12015 {
12016 if (ConfigIsExisting("itemAttachOffset"))
12017 {
12018 return ConfigGetFloat("itemAttachOffset");
12019 }
12020 return 0;
12021 }
12022
12023 override void SetCleanness(
int value,
bool allow_client =
false)
12024 {
12025 if (!IsServerCheck(allow_client))
12026 return;
12027
12029
12031
12034 }
12035
12037 {
12039 }
12040
12042 {
12043 return true;
12044 }
12045
12046
12047
12048
12050 {
12052 }
12053
12055 {
12057 }
12058
12059
12060
12061
12062 override void SetColor(
int r,
int g,
int b,
int a)
12063 {
12069 }
12071 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12072 {
12077 }
12078
12080 {
12082 }
12083
12086 {
12087 int r,g,b,a;
12089 r = r/255;
12090 g = g/255;
12091 b = b/255;
12092 a = a/255;
12093 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12094 }
12095
12096
12097
12098 override void SetLiquidType(
int value,
bool allow_client =
false)
12099 {
12100 if (!IsServerCheck(allow_client))
12101 return;
12102
12107 }
12108
12110 {
12111 return ConfigGetInt("varLiquidTypeInit");
12112 }
12113
12115 {
12117 }
12118
12120 {
12122 SetFrozen(false);
12123 }
12124
12127 {
12128 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12129 }
12130
12131
12134 {
12135 PlayerBase nplayer;
12136 if (PlayerBase.CastTo(nplayer, player))
12137 {
12139
12140 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12141 }
12142 }
12143
12144
12147 {
12148 PlayerBase nplayer;
12149 if (PlayerBase.CastTo(nplayer,player))
12150 {
12151
12152 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12153
12154 }
12155
12156
12157 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12158
12159
12160 if (HasEnergyManager())
12161 {
12162 GetCompEM().UpdatePlugState();
12163 }
12164 }
12165
12166
12168 {
12169 super.OnPlacementStarted(player);
12170
12172 }
12173
12174 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12175 {
12177 {
12178 m_AdminLog.OnPlacementComplete(player,
this);
12179 }
12180
12181 super.OnPlacementComplete(player, position, orientation);
12182 }
12183
12184
12185
12186
12187
12189 {
12191 {
12192 return true;
12193 }
12194 else
12195 {
12196 return false;
12197 }
12198 }
12199
12200
12202 {
12204 {
12206 }
12207 }
12208
12209
12211 {
12213 }
12214
12216 {
12218 }
12219
12220 override void InsertAgent(
int agent,
float count = 1)
12221 {
12222 if (count < 1)
12223 return;
12224
12226 }
12227
12230 {
12232 }
12233
12234
12236 {
12238 }
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12282 {
12284 return false;
12285 return true;
12286 }
12287
12289 {
12290
12292 }
12293
12294
12297 {
12298 super.CheckForRoofLimited(timeTresholdMS);
12299
12301 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12302 {
12303 m_PreviousRoofTestTime = time;
12304 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12305 }
12306 }
12307
12308
12310 {
12312 {
12313 return 0;
12314 }
12315
12316 if (GetInventory().GetAttachmentSlotsCount() != 0)
12317 {
12318 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12319 if (filter)
12320 return filter.GetProtectionLevel(type, false, system);
12321 else
12322 return 0;
12323 }
12324
12325 string subclassPath, entryName;
12326
12327 switch (type)
12328 {
12330 entryName = "biological";
12331 break;
12333 entryName = "chemical";
12334 break;
12335 default:
12336 entryName = "biological";
12337 break;
12338 }
12339
12340 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12341
12343 }
12344
12345
12346
12349 {
12350 if (!IsMagazine())
12352
12354 }
12355
12356
12357
12358
12359
12364 {
12365 return true;
12366 }
12367
12369 {
12371 }
12372
12373
12374
12375
12376
12378 {
12379 if (parent)
12380 {
12381 if (parent.IsInherited(DayZInfected))
12382 return true;
12383
12384 if (!parent.IsRuined())
12385 return true;
12386 }
12387
12388 return true;
12389 }
12390
12392 {
12393 if (!super.CanPutAsAttachment(parent))
12394 {
12395 return false;
12396 }
12397
12398 if (!IsRuined() && !parent.IsRuined())
12399 {
12400 return true;
12401 }
12402
12403 return false;
12404 }
12405
12407 {
12408
12409
12410
12411
12412 return super.CanReceiveItemIntoCargo(item);
12413 }
12414
12416 {
12417
12418
12419
12420
12421 GameInventory attachmentInv = attachment.GetInventory();
12423 {
12424 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12425 return false;
12426 }
12427
12428 InventoryLocation loc = new InventoryLocation();
12429 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12430 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12431 return false;
12432
12433 return super.CanReceiveAttachment(attachment, slotId);
12434 }
12435
12437 {
12438 if (!super.CanReleaseAttachment(attachment))
12439 return false;
12440
12441 return GetInventory().AreChildrenAccessible();
12442 }
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12465 {
12466 int id = muzzle_owner.GetMuzzleID();
12467 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12468
12469 if (WPOF_array)
12470 {
12471 for (int i = 0; i < WPOF_array.Count(); i++)
12472 {
12473 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12474
12475 if (WPOF)
12476 {
12477 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12478 }
12479 }
12480 }
12481 }
12482
12483
12485 {
12486 int id = muzzle_owner.GetMuzzleID();
12488
12489 if (WPOBE_array)
12490 {
12491 for (int i = 0; i < WPOBE_array.Count(); i++)
12492 {
12493 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12494
12495 if (WPOBE)
12496 {
12497 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12498 }
12499 }
12500 }
12501 }
12502
12503
12505 {
12506 int id = muzzle_owner.GetMuzzleID();
12507 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12508
12509 if (WPOOH_array)
12510 {
12511 for (int i = 0; i < WPOOH_array.Count(); i++)
12512 {
12513 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12514
12515 if (WPOOH)
12516 {
12517 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12518 }
12519 }
12520 }
12521 }
12522
12523
12525 {
12526 int id = muzzle_owner.GetMuzzleID();
12527 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12528
12529 if (WPOOH_array)
12530 {
12531 for (int i = 0; i < WPOOH_array.Count(); i++)
12532 {
12533 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12534
12535 if (WPOOH)
12536 {
12537 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12538 }
12539 }
12540 }
12541 }
12542
12543
12545 {
12546 int id = muzzle_owner.GetMuzzleID();
12547 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12548
12549 if (WPOOH_array)
12550 {
12551 for (int i = 0; i < WPOOH_array.Count(); i++)
12552 {
12553 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12554
12555 if (WPOOH)
12556 {
12557 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12558 }
12559 }
12560 }
12561 }
12562
12563
12564
12566 {
12568 {
12569 return true;
12570 }
12571
12572 return false;
12573 }
12574
12576 {
12578 {
12579 return true;
12580 }
12581
12582 return false;
12583 }
12584
12586 {
12588 {
12589 return true;
12590 }
12591
12592 return false;
12593 }
12594
12596 {
12597 return false;
12598 }
12599
12602 {
12603 return UATimeSpent.DEFAULT_DEPLOY;
12604 }
12605
12606
12607
12608
12610 {
12612 SetSynchDirty();
12613 }
12614
12616 {
12618 }
12619
12620
12622 {
12623 return false;
12624 }
12625
12628 {
12629 string att_type = "None";
12630
12631 if (ConfigIsExisting("soundAttType"))
12632 {
12633 att_type = ConfigGetString("soundAttType");
12634 }
12635
12637 }
12638
12640 {
12642 }
12643
12644
12645
12646
12647
12651
12653 {
12656
12658 }
12659
12660
12662 {
12664 return;
12665
12667
12670
12673
12674 SoundParameters params = new SoundParameters();
12678 }
12679
12680
12682 {
12684 return;
12685
12687 SetSynchDirty();
12688
12691 }
12692
12693
12695 {
12697 return;
12698
12700 SetSynchDirty();
12701
12704 }
12705
12707 {
12709 }
12710
12712 {
12714 }
12715
12718 {
12719 if (!
GetGame().IsDedicatedServer())
12720 {
12721 if (ConfigIsExisting("attachSoundSet"))
12722 {
12723 string cfg_path = "";
12724 string soundset = "";
12725 string type_name =
GetType();
12726
12729 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12730 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12731
12732 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12733 {
12734 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12735 {
12736 if (cfg_slot_array[i] == slot_type)
12737 {
12738 soundset = cfg_soundset_array[i];
12739 break;
12740 }
12741 }
12742 }
12743
12744 if (soundset != "")
12745 {
12746 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12748 }
12749 }
12750 }
12751 }
12752
12754 {
12755
12756 }
12757
12758 void OnApply(PlayerBase player);
12759
12761 {
12762 return 1.0;
12763 };
12764
12766 {
12768 }
12769
12771 {
12773 }
12774
12776
12778 {
12779 SetDynamicPhysicsLifeTime(0.01);
12781 }
12782
12784 {
12785 array<string> zone_names = new array<string>;
12786 GetDamageZones(zone_names);
12787 for (int i = 0; i < zone_names.Count(); i++)
12788 {
12789 SetHealthMax(zone_names.Get(i),"Health");
12790 }
12791 SetHealthMax("","Health");
12792 }
12793
12796 {
12797 float global_health = GetHealth01("","Health");
12798 array<string> zones = new array<string>;
12799 GetDamageZones(zones);
12800
12801 for (int i = 0; i < zones.Count(); i++)
12802 {
12803 SetHealth01(zones.Get(i),"Health",global_health);
12804 }
12805 }
12806
12809 {
12810 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12811 }
12812
12814 {
12815 if (!hasRootAsPlayer)
12816 {
12817 if (refParentIB)
12818 {
12819
12820 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12821 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12822
12823 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12824 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12825
12828 }
12829 else
12830 {
12831
12834 }
12835 }
12836 }
12837
12839 {
12841 {
12842 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12843 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12844 {
12845 float heatPermCoef = 1.0;
12847 while (ent)
12848 {
12849 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12850 ent = ent.GetHierarchyParent();
12851 }
12852
12853 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12854 }
12855 }
12856 }
12857
12859 {
12860
12861 EntityAI parent = GetHierarchyParent();
12862 if (!parent)
12863 {
12864 hasParent = false;
12865 hasRootAsPlayer = false;
12866 }
12867 else
12868 {
12869 hasParent = true;
12870 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12871 refParentIB =
ItemBase.Cast(parent);
12872 }
12873 }
12874
12875 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12876 {
12877
12878 }
12879
12881 {
12882
12883 return false;
12884 }
12885
12887 {
12888
12889
12890 return false;
12891 }
12892
12894 {
12895
12896 return false;
12897 }
12898
12901 {
12902 return !GetIsFrozen() &&
IsOpen();
12903 }
12904
12906 {
12907 bool hasParent = false, hasRootAsPlayer = false;
12909
12910 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12911 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12912
12913 if (wwtu || foodDecay)
12914 {
12918
12919 if (processWetness || processTemperature || processDecay)
12920 {
12922
12923 if (processWetness)
12924 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12925
12926 if (processTemperature)
12928
12929 if (processDecay)
12930 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12931 }
12932 }
12933 }
12934
12937 {
12939 }
12940
12942 {
12945
12946 return super.GetTemperatureFreezeThreshold();
12947 }
12948
12950 {
12953
12954 return super.GetTemperatureThawThreshold();
12955 }
12956
12958 {
12961
12962 return super.GetItemOverheatThreshold();
12963 }
12964
12966 {
12968 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12969
12970 return super.GetTemperatureFreezeTime();
12971 }
12972
12974 {
12976 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12977
12978 return super.GetTemperatureThawTime();
12979 }
12980
12985
12987 {
12988 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12989 }
12990
12992 {
12993 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12994 }
12995
12998 {
13000 }
13001
13003 {
13005 }
13006
13008 {
13010 }
13011
13014 {
13015 return null;
13016 }
13017
13020 {
13021 return false;
13022 }
13023
13025 {
13027 {
13030 if (!trg)
13031 {
13033 explosive = this;
13034 }
13035
13036 explosive.PairRemote(trg);
13038
13039 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13040 trg.SetPersistentPairID(persistentID);
13041 explosive.SetPersistentPairID(persistentID);
13042
13043 return true;
13044 }
13045 return false;
13046 }
13047
13050 {
13051 float ret = 1.0;
13054 ret *= GetHealth01();
13055
13056 return ret;
13057 }
13058
13059 #ifdef DEVELOPER
13060 override void SetDebugItem()
13061 {
13062 super.SetDebugItem();
13063 _itemBase = this;
13064 }
13065
13067 {
13068 string text = super.GetDebugText();
13069
13071 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13072
13073 return text;
13074 }
13075 #endif
13076
13078 {
13079 return true;
13080 }
13081
13083
13085
13087 {
13090 }
13091
13092
13100
13116}
13117
13119{
13121 if (entity)
13122 {
13123 bool is_item = entity.IsInherited(
ItemBase);
13124 if (is_item && full_quantity)
13125 {
13128 }
13129 }
13130 else
13131 {
13133 return NULL;
13134 }
13135 return entity;
13136}
13137
13139{
13140 if (item)
13141 {
13142 if (health > 0)
13143 item.SetHealth("", "", health);
13144
13145 if (item.CanHaveTemperature())
13146 {
13148 if (item.CanFreeze())
13149 item.SetFrozen(false);
13150 }
13151
13152 if (item.HasEnergyManager())
13153 {
13154 if (quantity >= 0)
13155 {
13156 item.GetCompEM().SetEnergy0To1(quantity);
13157 }
13158 else
13159 {
13161 }
13162 }
13163 else if (item.IsMagazine())
13164 {
13165 Magazine mag = Magazine.Cast(item);
13166 if (quantity >= 0)
13167 {
13168 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13169 }
13170 else
13171 {
13173 }
13174
13175 }
13176 else
13177 {
13178 if (quantity >= 0)
13179 {
13180 item.SetQuantityNormalized(quantity, false);
13181 }
13182 else
13183 {
13185 }
13186
13187 }
13188 }
13189}
13190
13191#ifdef DEVELOPER
13193#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.