8403{
8405 {
8406 return true;
8407 }
8408};
8409
8410
8411
8413{
8417
8419
8422
8423
8424
8425
8426
8435
8441
8446
8451
8472 protected bool m_IsResultOfSplit
8473
8475
8480
8481
8482
8484
8488
8489
8490
8492
8495
8496
8497
8503
8504
8512
8515
8516
8518
8519
8521
8522
8527
8528
8533
8534
8536
8537
8539 {
8544
8545 if (!
GetGame().IsDedicatedServer())
8546 {
8548 {
8550
8552 {
8554 }
8555 }
8556
8559 }
8560
8561 m_OldLocation = null;
8562
8564 {
8566 }
8567
8568 if (ConfigIsExisting("headSelectionsToHide"))
8569 {
8572 }
8573
8575 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8576 {
8578 }
8579
8581
8582 m_IsResultOfSplit = false;
8583
8585 }
8586
8588 {
8589 super.InitItemVariables();
8590
8596 m_Count = ConfigGetInt(
"count");
8597
8600
8605
8608
8613
8625
8629
8630
8633 if (ConfigIsExisting("canBeSplit"))
8634 {
8637 }
8638
8640 if (ConfigIsExisting("itemBehaviour"))
8642
8643
8646 RegisterNetSyncVariableInt("m_VarLiquidType");
8647 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8648
8649 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8650 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8651 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8652
8653 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8654 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8655 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8656 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8657
8658 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8659 RegisterNetSyncVariableBool("m_IsTakeable");
8660 RegisterNetSyncVariableBool("m_IsHologram");
8661
8664 {
8667 }
8668
8670
8672 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8674
8675 }
8676
8678 {
8680 }
8681
8683 {
8686 {
8691 }
8692 }
8693
8694 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8695 {
8697 {
8700 }
8701
8703 }
8704
8706 {
8712 }
8713
8715
8717 {
8719
8720 if (!action)
8721 {
8722 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8723 return;
8724 }
8725
8727 if (!ai)
8728 {
8730 return;
8731 }
8732
8734 if (!action_array)
8735 {
8736 action_array = new array<ActionBase_Basic>;
8738 }
8739 if (LogManager.IsActionLogEnable())
8740 {
8741 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8742 }
8743
8744 if (action_array.Find(action) != -1)
8745 {
8746 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8747 }
8748 else
8749 {
8750 action_array.Insert(action);
8751 }
8752 }
8753
8755 {
8757 ActionBase action = player.GetActionManager().GetAction(actionName);
8760
8761 if (action_array)
8762 {
8763 action_array.RemoveItem(action);
8764 }
8765 }
8766
8767
8768
8770 {
8771 ActionOverrideData overrideData = new ActionOverrideData();
8775
8777 if (!actionMap)
8778 {
8781 }
8782
8783 actionMap.Insert(this.
Type(), overrideData);
8784
8785 }
8786
8788
8790
8791
8793 {
8796
8799
8800 string config_to_search = "CfgVehicles";
8801 string muzzle_owner_config;
8802
8804 {
8805 if (IsInherited(Weapon))
8806 config_to_search = "CfgWeapons";
8807
8808 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8809
8810 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8811
8813
8814 if (config_OnFire_subclass_count > 0)
8815 {
8816 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8817
8818 for (int i = 0; i < config_OnFire_subclass_count; i++)
8819 {
8820 string particle_class = "";
8822 string config_OnFire_entry = config_OnFire_class + particle_class;
8823 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8824 WPOF_array.Insert(WPOF);
8825 }
8826
8827
8829 }
8830 }
8831
8833 {
8834 config_to_search = "CfgWeapons";
8835 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8836
8837 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8838
8840
8841 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8842 {
8843 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8844
8845 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8846 {
8847 string particle_class2 = "";
8849 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8850 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8851 WPOBE_array.Insert(WPOBE);
8852 }
8853
8854
8856 }
8857 }
8858 }
8859
8860
8862 {
8865
8867 {
8868 string config_to_search = "CfgVehicles";
8869
8870 if (IsInherited(Weapon))
8871 config_to_search = "CfgWeapons";
8872
8873 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8874 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8875
8876 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8877 {
8878
8880
8882 {
8884 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8886 return;
8887 }
8888
8891
8892
8893
8895 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8896
8897 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8898 {
8899 string particle_class = "";
8901 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8903
8904 if (entry_type == CT_CLASS)
8905 {
8906 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8907 WPOOH_array.Insert(WPOF);
8908 }
8909 }
8910
8911
8913 }
8914 }
8915 }
8916
8918 {
8920 }
8921
8923 {
8925 {
8927
8930
8933
8934 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8935 }
8936 }
8937
8939 {
8941 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8942
8944 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8945
8947 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8948
8950 {
8952 }
8953 }
8954
8956 {
8958 }
8959
8961 {
8964 else
8966
8968 {
8971 }
8972 else
8973 {
8976
8979 }
8980
8982 }
8983
8985 {
8987 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8988 }
8989
8991 {
8993 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8995 }
8996
8998 {
9000 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9001 }
9002
9004 {
9007
9008 OverheatingParticle OP = new OverheatingParticle();
9013
9015 }
9016
9018 {
9021
9022 return -1;
9023 }
9024
9026 {
9028 {
9031
9032 for (int i = count; i > 0; --i)
9033 {
9034 int id = i - 1;
9037
9040
9041 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9042 {
9043 if (p)
9044 {
9047 }
9048 }
9049 }
9050 }
9051 }
9052
9054 {
9056 {
9058 {
9059 int id = i - 1;
9061
9062 if (OP)
9063 {
9065
9066 if (p)
9067 {
9069 }
9070
9071 delete OP;
9072 }
9073 }
9074
9077 }
9078 }
9079
9082 {
9083 return 0.0;
9084 }
9085
9086
9088 {
9089 return 250;
9090 }
9091
9093 {
9094 return 0;
9095 }
9096
9099 {
9101 return true;
9102
9103 return false;
9104 }
9105
9108 {
9111
9113 {
9115 }
9116 else
9117 {
9118
9120 }
9121
9123 }
9124
9131 {
9132 return -1;
9133 }
9134
9135
9136
9137
9139 {
9141 {
9143 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9144
9145 if (r_index >= 0)
9146 {
9147 InventoryLocation r_il = new InventoryLocation;
9148 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9149
9150 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9153 {
9154 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9155 }
9157 {
9158 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9159 }
9160
9161 }
9162
9163 player.GetHumanInventory().ClearUserReservedLocation(this);
9164 }
9165
9168 }
9169
9170
9171
9172
9174 {
9175 return ItemBase.m_DebugActionsMask;
9176 }
9177
9179 {
9180 return ItemBase.m_DebugActionsMask & mask;
9181 }
9182
9184 {
9185 ItemBase.m_DebugActionsMask = mask;
9186 }
9187
9189 {
9190 ItemBase.m_DebugActionsMask |= mask;
9191 }
9192
9194 {
9195 ItemBase.m_DebugActionsMask &= ~mask;
9196 }
9197
9199 {
9201 {
9203 }
9204 else
9205 {
9207 }
9208 }
9209
9210
9212 {
9213 if (GetEconomyProfile())
9214 {
9215 float q_max = GetEconomyProfile().GetQuantityMax();
9216 if (q_max > 0)
9217 {
9218 float q_min = GetEconomyProfile().GetQuantityMin();
9219 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9220
9222 {
9223 ComponentEnergyManager comp = GetCompEM();
9225 {
9227 }
9228 }
9230 {
9232
9233 }
9234
9235 }
9236 }
9237 }
9238
9241 {
9242 EntityAI parent = GetHierarchyParent();
9243
9244 if (parent)
9245 {
9246 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9247 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9248 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9249 }
9250 }
9251
9254 {
9255 EntityAI parent = GetHierarchyParent();
9256
9257 if (parent)
9258 {
9259 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9260 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9261 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9262 }
9263 }
9264
9266 {
9267
9268
9269
9270
9272
9274 {
9275 if (ScriptInputUserData.CanStoreInputUserData())
9276 {
9277 ScriptInputUserData ctx = new ScriptInputUserData;
9283 ctx.
Write(use_stack_max);
9286
9288 {
9289 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9290 }
9291 }
9292 }
9293 else if (!
GetGame().IsMultiplayer())
9294 {
9296 }
9297 }
9298
9300 {
9302 }
9303
9305 {
9307 }
9308
9310 {
9312 }
9313
9315 {
9316
9317 return false;
9318 }
9319
9321 {
9322 return false;
9323 }
9324
9328 {
9329 return false;
9330 }
9331
9333 {
9334 return "";
9335 }
9336
9338
9340 {
9341 return false;
9342 }
9343
9345 {
9346 return true;
9347 }
9348
9349
9350
9352 {
9353 return true;
9354 }
9355
9357 {
9358 return true;
9359 }
9360
9362 {
9363 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9365 }
9366
9368 {
9370 }
9371
9373 {
9375 if (!is_being_placed)
9377 SetSynchDirty();
9378 }
9379
9380
9382
9384 {
9386 }
9387
9389 {
9391 }
9392
9394 {
9395 return 1;
9396 }
9397
9399 {
9400 return false;
9401 }
9402
9404 {
9406 SetSynchDirty();
9407 }
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9444 {
9445 super.OnMovedInsideCargo(container);
9446
9447 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9448 }
9449
9450 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9451 {
9452 super.EEItemLocationChanged(oldLoc,newLoc);
9453
9454 PlayerBase new_player = null;
9455 PlayerBase old_player = null;
9456
9457 if (newLoc.GetParent())
9458 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9459
9460 if (oldLoc.GetParent())
9461 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9462
9464 {
9465 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9466
9467 if (r_index >= 0)
9468 {
9469 InventoryLocation r_il = new InventoryLocation;
9470 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9471
9472 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9475 {
9476 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9477 }
9479 {
9480 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9481 }
9482
9483 }
9484 }
9485
9487 {
9488 if (new_player)
9489 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9490
9491 if (new_player == old_player)
9492 {
9493
9494 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9495 {
9497 {
9498 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9499 {
9500 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9501 }
9502 }
9503 else
9504 {
9505 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9506 }
9507 }
9508
9509 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9510 {
9511 int type = oldLoc.GetType();
9513 {
9514 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9515 }
9517 {
9518 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9519 }
9520 }
9521 if (!m_OldLocation)
9522 {
9523 m_OldLocation = new InventoryLocation;
9524 }
9525 m_OldLocation.Copy(oldLoc);
9526 }
9527 else
9528 {
9529 if (m_OldLocation)
9530 {
9531 m_OldLocation.Reset();
9532 }
9533 }
9534
9536 }
9537 else
9538 {
9539 if (new_player)
9540 {
9541 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9542 if (res_index >= 0)
9543 {
9544 InventoryLocation il = new InventoryLocation;
9545 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9547 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9550 {
9551 il.
GetParent().GetOnReleaseLock().Invoke(it);
9552 }
9554 {
9556 }
9557
9558 }
9559 }
9561 {
9562
9564 }
9565
9566 if (m_OldLocation)
9567 {
9568 m_OldLocation.Reset();
9569 }
9570 }
9571 }
9572
9573 override void EOnContact(IEntity other, Contact extra)
9574 {
9576 {
9577 int liquidType = -1;
9579 if (impactSpeed > 0.0)
9580 {
9582 #ifndef SERVER
9584 #else
9586 SetSynchDirty();
9587 #endif
9589 }
9590 }
9591
9592 #ifdef SERVER
9593 if (GetCompEM() && GetCompEM().IsPlugged())
9594 {
9595 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9596 GetCompEM().UnplugThis();
9597 }
9598 #endif
9599 }
9600
9602
9604 {
9606 }
9607
9609 {
9610
9611 }
9612
9614 {
9615 super.OnItemLocationChanged(old_owner, new_owner);
9616
9617 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9618 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9619
9620 if (!relatedPlayer && playerNew)
9621 relatedPlayer = playerNew;
9622
9623 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9624 {
9626 if (actionMgr)
9627 {
9628 ActionBase currentAction = actionMgr.GetRunningAction();
9629 if (currentAction)
9631 }
9632 }
9633
9634 Man ownerPlayerOld = null;
9635 Man ownerPlayerNew = null;
9636
9637 if (old_owner)
9638 {
9639 if (old_owner.
IsMan())
9640 {
9641 ownerPlayerOld = Man.Cast(old_owner);
9642 }
9643 else
9644 {
9645 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9646 }
9647 }
9648 else
9649 {
9651 {
9653
9654 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9655 {
9656 GetCompEM().UnplugThis();
9657 }
9658 }
9659 }
9660
9661 if (new_owner)
9662 {
9663 if (new_owner.
IsMan())
9664 {
9665 ownerPlayerNew = Man.Cast(new_owner);
9666 }
9667 else
9668 {
9669 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9670 }
9671 }
9672
9673 if (ownerPlayerOld != ownerPlayerNew)
9674 {
9675 if (ownerPlayerOld)
9676 {
9677 array<EntityAI> subItemsExit = new array<EntityAI>;
9679 for (int i = 0; i < subItemsExit.Count(); i++)
9680 {
9683 }
9684 }
9685
9686 if (ownerPlayerNew)
9687 {
9688 array<EntityAI> subItemsEnter = new array<EntityAI>;
9690 for (int j = 0; j < subItemsEnter.Count(); j++)
9691 {
9694 }
9695 }
9696 }
9697 else if (ownerPlayerNew != null)
9698 {
9699 PlayerBase nplayer;
9700 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9701 {
9702 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9704 for (int k = 0; k < subItemsUpdate.Count(); k++)
9705 {
9707 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9708 }
9709 }
9710 }
9711
9712 if (old_owner)
9713 old_owner.OnChildItemRemoved(this);
9714 if (new_owner)
9715 new_owner.OnChildItemReceived(this);
9716 }
9717
9718
9720 {
9721 super.EEDelete(parent);
9722 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9723 if (player)
9724 {
9726
9727 if (player.IsAlive())
9728 {
9729 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9730 if (r_index >= 0)
9731 {
9732 InventoryLocation r_il = new InventoryLocation;
9733 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9734
9735 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9738 {
9739 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9740 }
9742 {
9743 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9744 }
9745
9746 }
9747
9748 player.RemoveQuickBarEntityShortcut(this);
9749 }
9750 }
9751 }
9752
9754 {
9755 super.EEKilled(killer);
9756
9759 {
9760 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9761 {
9762 if (IsMagazine())
9763 {
9764 if (Magazine.Cast(this).GetAmmoCount() > 0)
9765 {
9767 }
9768 }
9769 else
9770 {
9772 }
9773 }
9774 }
9775 }
9776
9778 {
9779 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9780
9781 super.OnWasAttached(parent, slot_id);
9782
9785
9787 }
9788
9790 {
9791 super.OnWasDetached(parent, slot_id);
9792
9795 }
9796
9798 {
9799 int idx;
9802
9803 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9804 if (inventory_slots.Count() < 1)
9805 {
9806 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9807 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9808 }
9809 else
9810 {
9811 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9812 }
9813
9814 idx = inventory_slots.Find(slot);
9815 if (idx < 0)
9816 return "";
9817
9818 return attach_types.Get(idx);
9819 }
9820
9822 {
9823 int idx = -1;
9824 string slot;
9825
9828
9829 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9830 if (inventory_slots.Count() < 1)
9831 {
9832 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9833 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9834 }
9835 else
9836 {
9837 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9838 if (detach_types.Count() < 1)
9839 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9840 }
9841
9842 for (int i = 0; i < inventory_slots.Count(); i++)
9843 {
9844 slot = inventory_slots.Get(i);
9845 }
9846
9847 if (slot != "")
9848 {
9849 if (detach_types.Count() == 1)
9850 idx = 0;
9851 else
9852 idx = inventory_slots.Find(slot);
9853 }
9854 if (idx < 0)
9855 return "";
9856
9857 return detach_types.Get(idx);
9858 }
9859
9861 {
9862
9864
9865
9866 float min_time = 1;
9867 float max_time = 3;
9868 float delay = Math.RandomFloat(min_time, max_time);
9869
9870 explode_timer.Run(delay, this, "DoAmmoExplosion");
9871 }
9872
9874 {
9875 Magazine magazine = Magazine.Cast(this);
9876 int pop_sounds_count = 6;
9877 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9878
9879
9880 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9881 string sound_name = pop_sounds[ sound_idx ];
9883
9884
9885 magazine.ServerAddAmmoCount(-1);
9886
9887
9888 float min_temp_to_explode = 100;
9889
9890 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9891 {
9893 }
9894 }
9895
9896
9897 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9898 {
9899 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9900
9901 const int CHANCE_DAMAGE_CARGO = 4;
9902 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9903 const int CHANCE_DAMAGE_NOTHING = 2;
9904
9906 {
9907 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9908 int chances;
9909 int rnd;
9910
9911 if (GetInventory().GetCargo())
9912 {
9913 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9914 rnd = Math.RandomInt(0,chances);
9915
9916 if (rnd < CHANCE_DAMAGE_CARGO)
9917 {
9919 }
9920 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9921 {
9923 }
9924 }
9925 else
9926 {
9927 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9928 rnd = Math.RandomInt(0,chances);
9929
9930 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9931 {
9933 }
9934 }
9935 }
9936 }
9937
9939 {
9940 if (GetInventory().GetCargo())
9941 {
9942 int item_count = GetInventory().GetCargo().GetItemCount();
9943 if (item_count > 0)
9944 {
9945 int random_pick = Math.RandomInt(0, item_count);
9947 if (!item.IsExplosive())
9948 {
9949 item.AddHealth("","",damage);
9950 return true;
9951 }
9952 }
9953 }
9954 return false;
9955 }
9956
9958 {
9959 int attachment_count = GetInventory().AttachmentCount();
9960 if (attachment_count > 0)
9961 {
9962 int random_pick = Math.RandomInt(0, attachment_count);
9963 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9964 if (!attachment.IsExplosive())
9965 {
9966 attachment.AddHealth("","",damage);
9967 return true;
9968 }
9969 }
9970 return false;
9971 }
9972
9974 {
9976 }
9977
9979 {
9981 return GetInventory().CanRemoveEntity();
9982
9983 return false;
9984 }
9985
9987 {
9988
9990 return false;
9991
9992
9994 return false;
9995
9996
9997
9999 if (delta == 0)
10000 return false;
10001
10002
10003 return true;
10004 }
10005
10007 {
10009 {
10010 if (ScriptInputUserData.CanStoreInputUserData())
10011 {
10012 ScriptInputUserData ctx = new ScriptInputUserData;
10017 ctx.
Write(destination_entity);
10019 ctx.
Write(slot_id);
10021 }
10022 }
10023 else if (!
GetGame().IsMultiplayer())
10024 {
10026 }
10027 }
10028
10030 {
10031 float split_quantity_new;
10035 InventoryLocation loc = new InventoryLocation;
10036
10037 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10038 {
10040 split_quantity_new = stack_max;
10041 else
10043
10045 {
10046 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10047 if (new_item)
10048 {
10049 new_item.SetResultOfSplit(true);
10050 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10052 new_item.
SetQuantity(split_quantity_new,
false,
true);
10053 }
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 {
10066 {
10069 }
10070
10071 if (new_item)
10072 {
10073 new_item.SetResultOfSplit(true);
10074 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10076 new_item.
SetQuantity(split_quantity_new,
false,
true);
10077 }
10078 }
10079 }
10080 else
10081 {
10082 if (stack_max != 0)
10083 {
10085 {
10087 }
10088
10089 if (split_quantity_new == 0)
10090 {
10091 if (!
GetGame().IsMultiplayer())
10092 player.PhysicalPredictiveDropItem(this);
10093 else
10094 player.ServerDropEntity(this);
10095 return;
10096 }
10097
10099 {
10101
10102 if (new_item)
10103 {
10104 new_item.SetResultOfSplit(true);
10105 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10108 new_item.PlaceOnSurface();
10109 }
10110 }
10111 }
10112 }
10113 }
10114
10116 {
10117 float split_quantity_new;
10121 InventoryLocation loc = new InventoryLocation;
10122
10123 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10124 {
10126 split_quantity_new = stack_max;
10127 else
10129
10131 {
10132 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10133 if (new_item)
10134 {
10135 new_item.SetResultOfSplit(true);
10136 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10138 new_item.
SetQuantity(split_quantity_new,
false,
true);
10139 }
10140 }
10141 }
10142 else if (destination_entity && slot_id == -1)
10143 {
10144 if (quantity > stack_max)
10145 split_quantity_new = stack_max;
10146 else
10147 split_quantity_new = quantity;
10148
10150 {
10152 {
10155 }
10156
10157 if (new_item)
10158 {
10159 new_item.SetResultOfSplit(true);
10160 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10162 new_item.
SetQuantity(split_quantity_new,
false,
true);
10163 }
10164 }
10165 }
10166 else
10167 {
10168 if (stack_max != 0)
10169 {
10171 {
10173 }
10174
10176 {
10178
10179 if (new_item)
10180 {
10181 new_item.SetResultOfSplit(true);
10182 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10185 new_item.PlaceOnSurface();
10186 }
10187 }
10188 }
10189 }
10190 }
10191
10193 {
10195 {
10196 if (ScriptInputUserData.CanStoreInputUserData())
10197 {
10198 ScriptInputUserData ctx = new ScriptInputUserData;
10203 dst.WriteToContext(ctx);
10205 }
10206 }
10207 else if (!
GetGame().IsMultiplayer())
10208 {
10210 }
10211 }
10212
10214 {
10216 {
10217 if (ScriptInputUserData.CanStoreInputUserData())
10218 {
10219 ScriptInputUserData ctx = new ScriptInputUserData;
10224 ctx.
Write(destination_entity);
10230 }
10231 }
10232 else if (!
GetGame().IsMultiplayer())
10233 {
10235 }
10236 }
10237
10239 {
10241 }
10242
10244 {
10246 float split_quantity_new;
10248 if (dst.IsValid())
10249 {
10250 int slot_id = dst.GetSlot();
10252
10253 if (quantity > stack_max)
10254 split_quantity_new = stack_max;
10255 else
10256 split_quantity_new = quantity;
10257
10259 {
10261
10262 if (new_item)
10263 {
10264 new_item.SetResultOfSplit(true);
10265 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10267 new_item.
SetQuantity(split_quantity_new,
false,
true);
10268 }
10269
10270 return new_item;
10271 }
10272 }
10273
10274 return null;
10275 }
10276
10278 {
10280 float split_quantity_new;
10282 if (destination_entity)
10283 {
10285 if (quantity > stackable)
10286 split_quantity_new = stackable;
10287 else
10288 split_quantity_new = quantity;
10289
10291 {
10292 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10293 if (new_item)
10294 {
10295 new_item.SetResultOfSplit(true);
10296 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10298 new_item.
SetQuantity(split_quantity_new,
false,
true);
10299 }
10300 }
10301 }
10302 }
10303
10305 {
10307 {
10308 if (ScriptInputUserData.CanStoreInputUserData())
10309 {
10310 ScriptInputUserData ctx = new ScriptInputUserData;
10315 ItemBase destination_entity =
this;
10316 ctx.
Write(destination_entity);
10320 }
10321 }
10322 else if (!
GetGame().IsMultiplayer())
10323 {
10325 }
10326 }
10327
10329 {
10331 float split_quantity_new;
10333 if (player)
10334 {
10336 if (quantity > stackable)
10337 split_quantity_new = stackable;
10338 else
10339 split_quantity_new = quantity;
10340
10342 {
10343 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10344 new_item =
ItemBase.Cast(in_hands);
10345 if (new_item)
10346 {
10347 new_item.SetResultOfSplit(true);
10348 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10350 new_item.SetQuantity(split_quantity_new, false, true);
10351 }
10352 }
10353 }
10354 }
10355
10357 {
10359 float split_quantity_new = Math.Floor(quantity * 0.5);
10360
10362 return;
10363
10365
10366 if (new_item)
10367 {
10368 if (new_item.GetQuantityMax() < split_quantity_new)
10369 {
10370 split_quantity_new = new_item.GetQuantityMax();
10371 }
10372
10373 new_item.SetResultOfSplit(true);
10374 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10375
10377 {
10380 }
10381 else
10382 {
10384 new_item.
SetQuantity(split_quantity_new,
false,
true);
10385 }
10386 }
10387 }
10388
10390 {
10392 float split_quantity_new = Math.Floor(quantity / 2);
10393
10395 return;
10396
10397 InventoryLocation invloc = new InventoryLocation;
10399
10401 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10402
10403 if (new_item)
10404 {
10405 if (new_item.GetQuantityMax() < split_quantity_new)
10406 {
10407 split_quantity_new = new_item.GetQuantityMax();
10408 }
10410 {
10413 }
10414 else if (split_quantity_new > 1)
10415 {
10417 new_item.
SetQuantity(split_quantity_new,
false,
true);
10418 }
10419 }
10420 }
10421
10424 {
10425 SetWeightDirty();
10427
10428 if (parent)
10429 parent.OnAttachmentQuantityChangedEx(this, delta);
10430
10432 {
10434 {
10436 }
10438 {
10439 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10441 }
10442 }
10443
10444 }
10445
10448 {
10449
10450 }
10451
10454 {
10456 }
10457
10459 {
10460 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10461
10463 {
10464 if (newLevel == GameConstants.STATE_RUINED)
10465 {
10467 EntityAI parent = GetHierarchyParent();
10468 if (parent && parent.IsFireplace())
10469 {
10470 CargoBase cargo = GetInventory().GetCargo();
10471 if (cargo)
10472 {
10474 {
10476 }
10477 }
10478 }
10479 }
10480
10482 {
10483
10485 return;
10486 }
10487
10488 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10489 {
10491 }
10492 }
10493 }
10494
10495
10497 {
10498 super.OnRightClick();
10499
10501 {
10503 {
10504 if (ScriptInputUserData.CanStoreInputUserData())
10505 {
10506 EntityAI root = GetHierarchyRoot();
10507 Man playerOwner = GetHierarchyRootPlayer();
10508 InventoryLocation dst = new InventoryLocation;
10509
10510
10511 if (!playerOwner && root && root == this)
10512 {
10514 }
10515 else
10516 {
10517
10518 GetInventory().GetCurrentInventoryLocation(dst);
10520 {
10523 {
10525 }
10526 else
10527 {
10529
10530
10531 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10532 {
10534 }
10535 else
10536 {
10537 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10538 }
10539 }
10540 }
10541 }
10542
10543 ScriptInputUserData ctx = new ScriptInputUserData;
10551 }
10552 }
10553 else if (!
GetGame().IsMultiplayer())
10554 {
10556 }
10557 }
10558 }
10559
10561 {
10562 if (root)
10563 {
10564 vector m4[4];
10565 root.GetTransform(m4);
10566 dst.SetGround(this, m4);
10567 }
10568 else
10569 {
10570 GetInventory().GetCurrentInventoryLocation(dst);
10571 }
10572 }
10573
10574 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10575 {
10576
10577 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10578 return false;
10579
10580 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10581 return false;
10582
10583
10585 return false;
10586
10587
10588 Magazine mag = Magazine.Cast(this);
10589 if (mag)
10590 {
10591 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10592 return false;
10593
10594 if (stack_max_limit)
10595 {
10596 Magazine other_mag = Magazine.Cast(other_item);
10597 if (other_item)
10598 {
10599 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10600 return false;
10601 }
10602
10603 }
10604 }
10605 else
10606 {
10607
10609 return false;
10610
10612 return false;
10613 }
10614
10615 PlayerBase player = null;
10616 if (CastTo(player, GetHierarchyRootPlayer()))
10617 {
10618 if (player.GetInventory().HasAttachment(this))
10619 return false;
10620
10621 if (player.IsItemsToDelete())
10622 return false;
10623 }
10624
10625 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10626 return false;
10627
10628 int slotID;
10630 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10631 return false;
10632
10633 return true;
10634 }
10635
10637 {
10639 }
10640
10642 {
10643 return m_IsResultOfSplit;
10644 }
10645
10647 {
10648 m_IsResultOfSplit = value;
10649 }
10650
10652 {
10654 }
10655
10657 {
10658 float other_item_quantity = other_item.GetQuantity();
10659 float this_free_space;
10660
10662
10664
10665 if (other_item_quantity > this_free_space)
10666 {
10667 return this_free_space;
10668 }
10669 else
10670 {
10671 return other_item_quantity;
10672 }
10673 }
10674
10676 {
10678 }
10679
10681 {
10683 return;
10684
10685 if (!IsMagazine() && other_item)
10686 {
10688 if (quantity_used != 0)
10689 {
10690 float hp1 = GetHealth01("","");
10691 float hp2 = other_item.GetHealth01("","");
10692 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10693 hpResult = hpResult / (
GetQuantity() + quantity_used);
10694
10695 hpResult *= GetMaxHealth();
10696 Math.Round(hpResult);
10697 SetHealth("", "Health", hpResult);
10698
10700 other_item.AddQuantity(-quantity_used);
10701 }
10702 }
10704 }
10705
10707 {
10708 #ifdef SERVER
10709 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10710 GetHierarchyParent().IncreaseLifetimeUp();
10711 #endif
10712 };
10713
10715 {
10716 PlayerBase p = PlayerBase.Cast(player);
10717
10718 array<int> recipesIds = p.m_Recipes;
10719 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10720 if (moduleRecipesManager)
10721 {
10722 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10723 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10724 }
10725
10726 for (int i = 0;i < recipesIds.Count(); i++)
10727 {
10728 int key = recipesIds.Get(i);
10729 string recipeName = moduleRecipesManager.GetRecipeName(key);
10731 }
10732 }
10733
10734
10735 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10736 {
10737 super.GetDebugActions(outputList);
10738
10739
10745
10746
10751
10756
10757
10761
10762
10764 {
10768 }
10769
10772
10773
10777
10779
10780 InventoryLocation loc = new InventoryLocation();
10781 GetInventory().GetCurrentInventoryLocation(loc);
10783 {
10784 if (Gizmo_IsSupported())
10787 }
10788
10790 }
10791
10792
10793
10794
10796 {
10797 super.OnAction(action_id, player, ctx);
10798
10800 {
10801 switch (action_id)
10802 {
10805 return true;
10808 return true;
10809 }
10810 }
10811
10813 {
10814 switch (action_id)
10815 {
10817 Delete();
10818 return true;
10819 }
10820 }
10821
10822 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10823 {
10824 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10825 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10826 PlayerBase p = PlayerBase.Cast(player);
10827 if (
EActions.RECIPES_RANGE_START < 1000)
10828 {
10829 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10830 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10831 }
10832 }
10833 #ifndef SERVER
10834 else if (action_id ==
EActions.WATCH_PLAYER)
10835 {
10836 PluginDeveloper.SetDeveloperItemClientEx(player);
10837 }
10838 #endif
10840 {
10841 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10842 {
10843 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10844 OnDebugButtonPressServer(id + 1);
10845 }
10846
10847 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10848 {
10849 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10851 }
10852
10853 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10854 {
10855 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10857 }
10858
10859 else if (action_id ==
EActions.ADD_QUANTITY)
10860 {
10861 if (IsMagazine())
10862 {
10863 Magazine mag = Magazine.Cast(this);
10864 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10865 }
10866 else
10867 {
10869 }
10870
10871 if (m_EM)
10872 {
10873 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10874 }
10875
10876 }
10877
10878 else if (action_id ==
EActions.REMOVE_QUANTITY)
10879 {
10880 if (IsMagazine())
10881 {
10882 Magazine mag2 = Magazine.Cast(this);
10883 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10884 }
10885 else
10886 {
10888 }
10889 if (m_EM)
10890 {
10891 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10892 }
10893
10894 }
10895
10896 else if (action_id ==
EActions.SET_QUANTITY_0)
10897 {
10899
10900 if (m_EM)
10901 {
10902 m_EM.SetEnergy(0);
10903 }
10904 }
10905
10906 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10907 {
10909
10910 if (m_EM)
10911 {
10912 m_EM.SetEnergy(m_EM.GetEnergyMax());
10913 }
10914 }
10915
10916 else if (action_id ==
EActions.ADD_HEALTH)
10917 {
10918 AddHealth("","",GetMaxHealth("","Health")/5);
10919 }
10920 else if (action_id ==
EActions.REMOVE_HEALTH)
10921 {
10922 AddHealth("","",-GetMaxHealth("","Health")/5);
10923 }
10924 else if (action_id ==
EActions.DESTROY_HEALTH)
10925 {
10926 SetHealth01("","",0);
10927 }
10928 else if (action_id ==
EActions.WATCH_ITEM)
10929 {
10931 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10932 #ifdef DEVELOPER
10933 SetDebugDeveloper_item(this);
10934 #endif
10935 }
10936
10937 else if (action_id ==
EActions.ADD_TEMPERATURE)
10938 {
10939 AddTemperature(20);
10940
10941 }
10942
10943 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10944 {
10945 AddTemperature(-20);
10946
10947 }
10948
10949 else if (action_id ==
EActions.FLIP_FROZEN)
10950 {
10951 SetFrozen(!GetIsFrozen());
10952
10953 }
10954
10955 else if (action_id ==
EActions.ADD_WETNESS)
10956 {
10958
10959 }
10960
10961 else if (action_id ==
EActions.REMOVE_WETNESS)
10962 {
10964
10965 }
10966
10967 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10968 {
10971
10972
10973 }
10974
10975 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10976 {
10979 }
10980
10981 else if (action_id ==
EActions.MAKE_SPECIAL)
10982 {
10983 auto debugParams = DebugSpawnParams.WithPlayer(player);
10984 OnDebugSpawnEx(debugParams);
10985 }
10986
10987 }
10988
10989
10990 return false;
10991 }
10992
10993
10994
10995
10999
11002
11003
11004
11006 {
11007 return false;
11008 }
11009
11010
11012 {
11013 return true;
11014 }
11015
11016
11018 {
11019 return true;
11020 }
11021
11022
11023
11025 {
11026 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11028 }
11029
11032 {
11033 return null;
11034 }
11035
11037 {
11038 return false;
11039 }
11040
11042 {
11043 return false;
11044 }
11045
11049
11050
11052 {
11053 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11054 return module_repairing.CanRepair(this, item_repair_kit);
11055 }
11056
11057
11058 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11059 {
11060 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11061 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11062 }
11063
11064
11066 {
11067
11068
11069
11070
11071
11072
11073
11074
11075 return 1;
11076 }
11077
11078
11079
11081 {
11083 }
11084
11085
11086
11088 {
11090 }
11091
11092
11101 {
11102 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11103
11104 if (player)
11105 {
11106 player.MessageStatus(text);
11107 }
11108 }
11109
11110
11119 {
11120 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11121
11122 if (player)
11123 {
11124 player.MessageAction(text);
11125 }
11126 }
11127
11128
11137 {
11138 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11139
11140 if (player)
11141 {
11142 player.MessageFriendly(text);
11143 }
11144 }
11145
11146
11155 {
11156 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11157
11158 if (player)
11159 {
11160 player.MessageImportant(text);
11161 }
11162 }
11163
11165 {
11166 return true;
11167 }
11168
11169
11170 override bool KindOf(
string tag)
11171 {
11172 bool found = false;
11173 string item_name = this.
GetType();
11176
11177 int array_size = item_tag_array.Count();
11178 for (int i = 0; i < array_size; i++)
11179 {
11180 if (item_tag_array.Get(i) == tag)
11181 {
11182 found = true;
11183 break;
11184 }
11185 }
11186 return found;
11187 }
11188
11189
11191 {
11192
11193 super.OnRPC(sender, rpc_type,ctx);
11194
11195
11196 switch (rpc_type)
11197 {
11198 #ifndef SERVER
11199 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11200 Param2<bool, string> p = new Param2<bool, string>(false, "");
11201
11203 return;
11204
11205 bool play = p.param1;
11206 string soundSet = p.param2;
11207
11208 if (play)
11209 {
11211 {
11213 {
11215 }
11216 }
11217 else
11218 {
11220 }
11221 }
11222 else
11223 {
11225 }
11226
11227 break;
11228 #endif
11229
11230 }
11231
11233 {
11235 }
11236 }
11237
11238
11239
11240
11242 {
11243 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11244 return plugin.GetID(
name);
11245 }
11246
11248 {
11249 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11250 return plugin.GetName(id);
11251 }
11252
11255 {
11256
11257
11258 int varFlags;
11259 if (!ctx.
Read(varFlags))
11260 return;
11261
11262 if (varFlags & ItemVariableFlags.FLOAT)
11263 {
11265 }
11266 }
11267
11269 {
11270
11271 super.SerializeNumericalVars(floats_out);
11272
11273
11274
11276 {
11278 }
11279
11281 {
11283 }
11284
11286 {
11288 }
11289
11291 {
11296 }
11297
11299 {
11301 }
11302 }
11303
11305 {
11306
11307 super.DeSerializeNumericalVars(floats);
11308
11309
11310 int index = 0;
11311 int mask = Math.Round(floats.Get(index));
11312
11313 index++;
11314
11316 {
11318 {
11320 }
11321 else
11322 {
11323 float quantity = floats.Get(index);
11324 SetQuantity(quantity,
true,
false,
false,
false);
11325 }
11326 index++;
11327 }
11328
11330 {
11331 float wet = floats.Get(index);
11333 index++;
11334 }
11335
11337 {
11338 int liquidtype = Math.Round(floats.Get(index));
11340 index++;
11341 }
11342
11344 {
11346 index++;
11348 index++;
11350 index++;
11352 index++;
11353 }
11354
11356 {
11357 int cleanness = Math.Round(floats.Get(index));
11359 index++;
11360 }
11361 }
11362
11364 {
11365 super.WriteVarsToCTX(ctx);
11366
11367
11369 {
11371 }
11372
11374 {
11376 }
11377
11379 {
11381 }
11382
11384 {
11385 int r,g,b,a;
11391 }
11392
11394 {
11396 }
11397 }
11398
11400 {
11401 if (!super.ReadVarsFromCTX(ctx,version))
11402 return false;
11403
11404 int intValue;
11405 float value;
11406
11407 if (version < 140)
11408 {
11409 if (!ctx.
Read(intValue))
11410 return false;
11411
11412 m_VariablesMask = intValue;
11413 }
11414
11416 {
11417 if (!ctx.
Read(value))
11418 return false;
11419
11421 {
11423 }
11424 else
11425 {
11427 }
11428 }
11429
11430 if (version < 140)
11431 {
11433 {
11434 if (!ctx.
Read(value))
11435 return false;
11436 SetTemperatureDirect(value);
11437 }
11438 }
11439
11441 {
11442 if (!ctx.
Read(value))
11443 return false;
11445 }
11446
11448 {
11449 if (!ctx.
Read(intValue))
11450 return false;
11452 }
11453
11455 {
11456 int r,g,b,a;
11458 return false;
11460 return false;
11462 return false;
11464 return false;
11465
11467 }
11468
11470 {
11471 if (!ctx.
Read(intValue))
11472 return false;
11474 }
11475
11476 if (version >= 138 && version < 140)
11477 {
11479 {
11480 if (!ctx.
Read(intValue))
11481 return false;
11482 SetFrozen(intValue);
11483 }
11484 }
11485
11486 return true;
11487 }
11488
11489
11491 {
11494 {
11496 }
11497
11498 if (!super.OnStoreLoad(ctx, version))
11499 {
11501 return false;
11502 }
11503
11504 if (version >= 114)
11505 {
11506 bool hasQuickBarIndexSaved;
11507
11508 if (!ctx.
Read(hasQuickBarIndexSaved))
11509 {
11511 return false;
11512 }
11513
11514 if (hasQuickBarIndexSaved)
11515 {
11516 int itmQBIndex;
11517
11518
11519 if (!ctx.
Read(itmQBIndex))
11520 {
11522 return false;
11523 }
11524
11525 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11526 if (itmQBIndex != -1 && parentPlayer)
11527 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11528 }
11529 }
11530 else
11531 {
11532
11533 PlayerBase player;
11534 int itemQBIndex;
11535 if (version ==
int.
MAX)
11536 {
11537 if (!ctx.
Read(itemQBIndex))
11538 {
11540 return false;
11541 }
11542 }
11543 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11544 {
11545
11546 if (!ctx.
Read(itemQBIndex))
11547 {
11549 return false;
11550 }
11551 if (itemQBIndex != -1 && player)
11552 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11553 }
11554 }
11555
11556 if (version < 140)
11557 {
11558
11559 if (!LoadVariables(ctx, version))
11560 {
11562 return false;
11563 }
11564 }
11565
11566
11568 {
11570 return false;
11571 }
11572 if (version >= 132)
11573 {
11575 if (raib)
11576 {
11578 {
11580 return false;
11581 }
11582 }
11583 }
11584
11586 return true;
11587 }
11588
11589
11590
11592 {
11593 super.OnStoreSave(ctx);
11594
11595 PlayerBase player;
11596 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11597 {
11599
11600 int itemQBIndex = -1;
11601 itemQBIndex = player.FindQuickBarEntityIndex(this);
11602 ctx.
Write(itemQBIndex);
11603 }
11604 else
11605 {
11607 }
11608
11610
11612 if (raib)
11613 {
11615 }
11616 }
11617
11618
11620 {
11621 super.AfterStoreLoad();
11622
11624 {
11626 }
11627
11629 {
11632 }
11633 }
11634
11636 {
11637 super.EEOnAfterLoad();
11638
11640 {
11642 }
11643
11646 }
11647
11649 {
11650 return false;
11651 }
11652
11653
11654
11656 {
11658 {
11659 #ifdef PLATFORM_CONSOLE
11660
11662 {
11664 if (menu)
11665 {
11667 }
11668 }
11669 #endif
11670 }
11671
11673 {
11676 }
11677
11679 {
11680 SetWeightDirty();
11682 }
11684 {
11687 }
11688
11690 {
11693 }
11695 {
11698 }
11699
11700 super.OnVariablesSynchronized();
11701 }
11702
11703
11704
11706 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11707 {
11708 if (!IsServerCheck(allow_client))
11709 return false;
11710
11712 return false;
11713
11716
11717 if (value <= (min + 0.001))
11718 value = min;
11719
11720 if (value == min)
11721 {
11722 if (destroy_config)
11723 {
11724 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11725 if (dstr)
11726 {
11728 this.Delete();
11729 return true;
11730 }
11731 }
11732 else if (destroy_forced)
11733 {
11735 this.Delete();
11736 return true;
11737 }
11738
11740 }
11741
11744
11746 {
11748
11749 if (delta)
11751 }
11752
11754
11755 return false;
11756 }
11757
11758
11760 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11761 {
11763 }
11764
11766 {
11769 }
11770
11772 {
11775 }
11776
11778 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11779 {
11780 float value_clamped = Math.Clamp(value, 0, 1);
11782 SetQuantity(result, destroy_config, destroy_forced);
11783 }
11784
11785
11788 {
11790 }
11791
11793 {
11795 }
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11807 {
11808 int slot = -1;
11809 if (GetInventory())
11810 {
11811 InventoryLocation il = new InventoryLocation;
11812 GetInventory().GetCurrentInventoryLocation(il);
11814 }
11815
11817 }
11818
11820 {
11821 float quantity_max = 0;
11822
11824 {
11825 if (attSlotID != -1)
11826 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11827
11828 if (quantity_max <= 0)
11830 }
11831
11832 if (quantity_max <= 0)
11834
11835 return quantity_max;
11836 }
11837
11839 {
11841 }
11842
11844 {
11846 }
11847
11848
11850 {
11852 }
11853
11855 {
11857 }
11858
11860 {
11862 }
11863
11864
11866 {
11867
11868 float weightEx = GetWeightEx();
11869 float special = GetInventoryAndCargoWeight();
11870 return weightEx - special;
11871 }
11872
11873
11875 {
11877 }
11878
11880 {
11882 {
11883 #ifdef DEVELOPER
11884 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11885 {
11886 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11888 }
11889 #endif
11890
11891 return GetQuantity() * GetConfigWeightModified();
11892 }
11893 else if (HasEnergyManager())
11894 {
11895 #ifdef DEVELOPER
11896 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11897 {
11898 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11899 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11900 }
11901 #endif
11902 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11903 }
11904 else
11905 {
11906 #ifdef DEVELOPER
11907 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11908 {
11909 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11910 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11911 }
11912 #endif
11913 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11914 }
11915 }
11916
11919 {
11920 int item_count = 0;
11922
11923 if (GetInventory().GetCargo() != NULL)
11924 {
11925 item_count = GetInventory().GetCargo().GetItemCount();
11926 }
11927
11928 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11929 {
11930 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11931 if (item)
11932 item_count += item.GetNumberOfItems();
11933 }
11934 return item_count;
11935 }
11936
11939 {
11940 float weight = 0;
11941 float wetness = 1;
11942 if (include_wetness)
11945 {
11946 weight = wetness * m_ConfigWeight;
11947 }
11949 {
11950 weight = 1;
11951 }
11952 return weight;
11953 }
11954
11955
11956
11958 {
11959 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11960 {
11961 GameInventory inv = GetInventory();
11962 array<EntityAI> items = new array<EntityAI>;
11964 for (int i = 0; i < items.Count(); i++)
11965 {
11967 if (item)
11968 {
11970 }
11971 }
11972 }
11973 }
11974
11975
11976
11977
11979 {
11980 float energy = 0;
11981 if (HasEnergyManager())
11982 {
11983 energy = GetCompEM().GetEnergy();
11984 }
11985 return energy;
11986 }
11987
11988
11990 {
11991 super.OnEnergyConsumed();
11992
11994 }
11995
11997 {
11998 super.OnEnergyAdded();
11999
12001 }
12002
12003
12005 {
12006 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12007 {
12009 {
12010 float energy_0to1 = GetCompEM().GetEnergy0To1();
12012 }
12013 }
12014 }
12015
12016
12018 {
12019 return ConfigGetFloat("heatIsolation");
12020 }
12021
12023 {
12025 }
12026
12028 {
12029 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12030 if (
GetGame().ConfigIsExisting(paramPath))
12032
12033 return 0.0;
12034 }
12035
12037 {
12038 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12039 if (
GetGame().ConfigIsExisting(paramPath))
12041
12042 return 0.0;
12043 }
12044
12045 override void SetWet(
float value,
bool allow_client =
false)
12046 {
12047 if (!IsServerCheck(allow_client))
12048 return;
12049
12052
12054
12055 m_VarWet = Math.Clamp(value, min, max);
12056
12058 {
12061 }
12062 }
12063
12064 override void AddWet(
float value)
12065 {
12067 }
12068
12070 {
12072 }
12073
12075 {
12077 }
12078
12080 {
12082 }
12083
12085 {
12087 }
12088
12090 {
12092 }
12093
12094 override void OnWetChanged(
float newVal,
float oldVal)
12095 {
12098 if (newLevel != oldLevel)
12099 {
12101 }
12102 }
12103
12105 {
12106 SetWeightDirty();
12107 }
12108
12110 {
12111 return GetWetLevelInternal(
m_VarWet);
12112 }
12113
12114
12115
12117 {
12119 }
12120
12122 {
12124 }
12125
12127 {
12129 }
12130
12132 {
12134 }
12135
12136
12137
12139 {
12140 if (ConfigIsExisting("itemModelLength"))
12141 {
12142 return ConfigGetFloat("itemModelLength");
12143 }
12144 return 0;
12145 }
12146
12148 {
12149 if (ConfigIsExisting("itemAttachOffset"))
12150 {
12151 return ConfigGetFloat("itemAttachOffset");
12152 }
12153 return 0;
12154 }
12155
12156 override void SetCleanness(
int value,
bool allow_client =
false)
12157 {
12158 if (!IsServerCheck(allow_client))
12159 return;
12160
12162
12164
12167 }
12168
12170 {
12172 }
12173
12175 {
12176 return true;
12177 }
12178
12179
12180
12181
12183 {
12185 }
12186
12188 {
12190 }
12191
12192
12193
12194
12195 override void SetColor(
int r,
int g,
int b,
int a)
12196 {
12202 }
12204 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12205 {
12210 }
12211
12213 {
12215 }
12216
12219 {
12220 int r,g,b,a;
12222 r = r/255;
12223 g = g/255;
12224 b = b/255;
12225 a = a/255;
12226 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12227 }
12228
12229
12230
12231 override void SetLiquidType(
int value,
bool allow_client =
false)
12232 {
12233 if (!IsServerCheck(allow_client))
12234 return;
12235
12240 }
12241
12243 {
12244 return ConfigGetInt("varLiquidTypeInit");
12245 }
12246
12248 {
12250 }
12251
12253 {
12255 SetFrozen(false);
12256 }
12257
12260 {
12261 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12262 }
12263
12264
12267 {
12268 PlayerBase nplayer;
12269 if (PlayerBase.CastTo(nplayer, player))
12270 {
12272
12273 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12274 }
12275 }
12276
12277
12280 {
12281 PlayerBase nplayer;
12282 if (PlayerBase.CastTo(nplayer,player))
12283 {
12284
12285 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12286
12287 }
12288
12289
12290 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12291
12292
12293 if (HasEnergyManager())
12294 {
12295 GetCompEM().UpdatePlugState();
12296 }
12297 }
12298
12299
12301 {
12302 super.OnPlacementStarted(player);
12303
12305 }
12306
12307 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12308 {
12310 {
12311 m_AdminLog.OnPlacementComplete(player,
this);
12312 }
12313
12314 super.OnPlacementComplete(player, position, orientation);
12315 }
12316
12317
12318
12319
12320
12322 {
12324 {
12325 return true;
12326 }
12327 else
12328 {
12329 return false;
12330 }
12331 }
12332
12333
12335 {
12337 {
12339 }
12340 }
12341
12342
12344 {
12346 }
12347
12349 {
12351 }
12352
12353 override void InsertAgent(
int agent,
float count = 1)
12354 {
12355 if (count < 1)
12356 return;
12357
12359 }
12360
12363 {
12365 }
12366
12367
12369 {
12371 }
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12415 {
12417 return false;
12418 return true;
12419 }
12420
12422 {
12423
12425 }
12426
12427
12430 {
12431 super.CheckForRoofLimited(timeTresholdMS);
12432
12434 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12435 {
12436 m_PreviousRoofTestTime = time;
12437 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12438 }
12439 }
12440
12441
12443 {
12445 {
12446 return 0;
12447 }
12448
12449 if (GetInventory().GetAttachmentSlotsCount() != 0)
12450 {
12451 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12452 if (filter)
12453 return filter.GetProtectionLevel(type, false, system);
12454 else
12455 return 0;
12456 }
12457
12458 string subclassPath, entryName;
12459
12460 switch (type)
12461 {
12463 entryName = "biological";
12464 break;
12466 entryName = "chemical";
12467 break;
12468 default:
12469 entryName = "biological";
12470 break;
12471 }
12472
12473 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12474
12476 }
12477
12478
12479
12482 {
12483 if (!IsMagazine())
12485
12487 }
12488
12489
12490
12491
12492
12497 {
12498 return true;
12499 }
12500
12502 {
12504 }
12505
12506
12507
12508
12509
12511 {
12512 if (parent)
12513 {
12514 if (parent.IsInherited(DayZInfected))
12515 return true;
12516
12517 if (!parent.IsRuined())
12518 return true;
12519 }
12520
12521 return true;
12522 }
12523
12525 {
12526 if (!super.CanPutAsAttachment(parent))
12527 {
12528 return false;
12529 }
12530
12531 if (!IsRuined() && !parent.IsRuined())
12532 {
12533 return true;
12534 }
12535
12536 return false;
12537 }
12538
12540 {
12541
12542
12543
12544
12545 return super.CanReceiveItemIntoCargo(item);
12546 }
12547
12549 {
12550
12551
12552
12553
12554 GameInventory attachmentInv = attachment.GetInventory();
12556 {
12557 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12558 return false;
12559 }
12560
12561 InventoryLocation loc = new InventoryLocation();
12562 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12563 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12564 return false;
12565
12566 return super.CanReceiveAttachment(attachment, slotId);
12567 }
12568
12570 {
12571 if (!super.CanReleaseAttachment(attachment))
12572 return false;
12573
12574 return GetInventory().AreChildrenAccessible();
12575 }
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12598 {
12599 int id = muzzle_owner.GetMuzzleID();
12600 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12601
12602 if (WPOF_array)
12603 {
12604 for (int i = 0; i < WPOF_array.Count(); i++)
12605 {
12606 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12607
12608 if (WPOF)
12609 {
12610 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12611 }
12612 }
12613 }
12614 }
12615
12616
12618 {
12619 int id = muzzle_owner.GetMuzzleID();
12621
12622 if (WPOBE_array)
12623 {
12624 for (int i = 0; i < WPOBE_array.Count(); i++)
12625 {
12626 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12627
12628 if (WPOBE)
12629 {
12630 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12631 }
12632 }
12633 }
12634 }
12635
12636
12638 {
12639 int id = muzzle_owner.GetMuzzleID();
12640 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12641
12642 if (WPOOH_array)
12643 {
12644 for (int i = 0; i < WPOOH_array.Count(); i++)
12645 {
12646 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12647
12648 if (WPOOH)
12649 {
12650 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12651 }
12652 }
12653 }
12654 }
12655
12656
12658 {
12659 int id = muzzle_owner.GetMuzzleID();
12660 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12661
12662 if (WPOOH_array)
12663 {
12664 for (int i = 0; i < WPOOH_array.Count(); i++)
12665 {
12666 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12667
12668 if (WPOOH)
12669 {
12670 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12671 }
12672 }
12673 }
12674 }
12675
12676
12678 {
12679 int id = muzzle_owner.GetMuzzleID();
12680 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12681
12682 if (WPOOH_array)
12683 {
12684 for (int i = 0; i < WPOOH_array.Count(); i++)
12685 {
12686 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12687
12688 if (WPOOH)
12689 {
12690 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12691 }
12692 }
12693 }
12694 }
12695
12696
12697
12699 {
12701 {
12702 return true;
12703 }
12704
12705 return false;
12706 }
12707
12709 {
12711 {
12712 return true;
12713 }
12714
12715 return false;
12716 }
12717
12719 {
12721 {
12722 return true;
12723 }
12724
12725 return false;
12726 }
12727
12729 {
12730 return false;
12731 }
12732
12735 {
12736 return UATimeSpent.DEFAULT_DEPLOY;
12737 }
12738
12739
12740
12741
12743 {
12745 SetSynchDirty();
12746 }
12747
12749 {
12751 }
12752
12753
12755 {
12756 return false;
12757 }
12758
12761 {
12762 string att_type = "None";
12763
12764 if (ConfigIsExisting("soundAttType"))
12765 {
12766 att_type = ConfigGetString("soundAttType");
12767 }
12768
12770 }
12771
12773 {
12775 }
12776
12777
12778
12779
12780
12786
12788 {
12791
12793 }
12794
12795
12797 {
12799 return;
12800
12802
12805
12808
12809 SoundParameters params = new SoundParameters();
12813 }
12814
12815
12817 {
12819 return;
12820
12822 SetSynchDirty();
12823
12826 }
12827
12828
12830 {
12832 return;
12833
12835 SetSynchDirty();
12836
12839 }
12840
12842 {
12844 }
12845
12847 {
12849 }
12850
12853 {
12854 if (!
GetGame().IsDedicatedServer())
12855 {
12856 if (ConfigIsExisting("attachSoundSet"))
12857 {
12858 string cfg_path = "";
12859 string soundset = "";
12860 string type_name =
GetType();
12861
12864 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12865 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12866
12867 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12868 {
12869 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12870 {
12871 if (cfg_slot_array[i] == slot_type)
12872 {
12873 soundset = cfg_soundset_array[i];
12874 break;
12875 }
12876 }
12877 }
12878
12879 if (soundset != "")
12880 {
12881 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12883 }
12884 }
12885 }
12886 }
12887
12889 {
12890
12891 }
12892
12893 void OnApply(PlayerBase player);
12894
12896 {
12897 return 1.0;
12898 };
12899
12901 {
12903 }
12904
12906 {
12908 }
12909
12911
12913 {
12914 SetDynamicPhysicsLifeTime(0.01);
12916 }
12917
12919 {
12920 array<string> zone_names = new array<string>;
12921 GetDamageZones(zone_names);
12922 for (int i = 0; i < zone_names.Count(); i++)
12923 {
12924 SetHealthMax(zone_names.Get(i),"Health");
12925 }
12926 SetHealthMax("","Health");
12927 }
12928
12931 {
12932 float global_health = GetHealth01("","Health");
12933 array<string> zones = new array<string>;
12934 GetDamageZones(zones);
12935
12936 for (int i = 0; i < zones.Count(); i++)
12937 {
12938 SetHealth01(zones.Get(i),"Health",global_health);
12939 }
12940 }
12941
12944 {
12945 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12946 }
12947
12949 {
12950 if (!hasRootAsPlayer)
12951 {
12952 if (refParentIB)
12953 {
12954
12955 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12956 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12957
12958 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12959 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12960
12963 }
12964 else
12965 {
12966
12969 }
12970 }
12971 }
12972
12974 {
12976 {
12977 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12978 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12979 {
12980 float heatPermCoef = 1.0;
12982 while (ent)
12983 {
12984 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12985 ent = ent.GetHierarchyParent();
12986 }
12987
12988 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12989 }
12990 }
12991 }
12992
12994 {
12995
12996 EntityAI parent = GetHierarchyParent();
12997 if (!parent)
12998 {
12999 hasParent = false;
13000 hasRootAsPlayer = false;
13001 }
13002 else
13003 {
13004 hasParent = true;
13005 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13006 refParentIB =
ItemBase.Cast(parent);
13007 }
13008 }
13009
13010 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13011 {
13012
13013 }
13014
13016 {
13017
13018 return false;
13019 }
13020
13022 {
13023
13024
13025 return false;
13026 }
13027
13029 {
13030
13031 return false;
13032 }
13033
13036 {
13037 return !GetIsFrozen() &&
IsOpen();
13038 }
13039
13041 {
13042 bool hasParent = false, hasRootAsPlayer = false;
13044
13045 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13046 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13047
13048 if (wwtu || foodDecay)
13049 {
13053
13054 if (processWetness || processTemperature || processDecay)
13055 {
13057
13058 if (processWetness)
13059 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13060
13061 if (processTemperature)
13063
13064 if (processDecay)
13065 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13066 }
13067 }
13068 }
13069
13072 {
13074 }
13075
13077 {
13080
13081 return super.GetTemperatureFreezeThreshold();
13082 }
13083
13085 {
13088
13089 return super.GetTemperatureThawThreshold();
13090 }
13091
13093 {
13096
13097 return super.GetItemOverheatThreshold();
13098 }
13099
13101 {
13103 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13104
13105 return super.GetTemperatureFreezeTime();
13106 }
13107
13109 {
13111 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13112
13113 return super.GetTemperatureThawTime();
13114 }
13115
13120
13122 {
13123 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13124 }
13125
13127 {
13128 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13129 }
13130
13133 {
13135 }
13136
13138 {
13140 }
13141
13143 {
13145 }
13146
13149 {
13150 return null;
13151 }
13152
13155 {
13156 return false;
13157 }
13158
13160 {
13162 {
13165 if (!trg)
13166 {
13168 explosive = this;
13169 }
13170
13171 explosive.PairRemote(trg);
13173
13174 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13175 trg.SetPersistentPairID(persistentID);
13176 explosive.SetPersistentPairID(persistentID);
13177
13178 return true;
13179 }
13180 return false;
13181 }
13182
13185 {
13186 float ret = 1.0;
13189 ret *= GetHealth01();
13190
13191 return ret;
13192 }
13193
13194 #ifdef DEVELOPER
13195 override void SetDebugItem()
13196 {
13197 super.SetDebugItem();
13198 _itemBase = this;
13199 }
13200
13202 {
13203 string text = super.GetDebugText();
13204
13206 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13207
13208 return text;
13209 }
13210 #endif
13211
13213 {
13214 return true;
13215 }
13216
13218
13220
13222 {
13225 }
13226
13227
13235
13251}
13252
13254{
13256 if (entity)
13257 {
13258 bool is_item = entity.IsInherited(
ItemBase);
13259 if (is_item && full_quantity)
13260 {
13263 }
13264 }
13265 else
13266 {
13268 return NULL;
13269 }
13270 return entity;
13271}
13272
13274{
13275 if (item)
13276 {
13277 if (health > 0)
13278 item.SetHealth("", "", health);
13279
13280 if (item.CanHaveTemperature())
13281 {
13283 if (item.CanFreeze())
13284 item.SetFrozen(false);
13285 }
13286
13287 if (item.HasEnergyManager())
13288 {
13289 if (quantity >= 0)
13290 {
13291 item.GetCompEM().SetEnergy0To1(quantity);
13292 }
13293 else
13294 {
13296 }
13297 }
13298 else if (item.IsMagazine())
13299 {
13300 Magazine mag = Magazine.Cast(item);
13301 if (quantity >= 0)
13302 {
13303 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13304 }
13305 else
13306 {
13308 }
13309
13310 }
13311 else
13312 {
13313 if (quantity >= 0)
13314 {
13315 item.SetQuantityNormalized(quantity, false);
13316 }
13317 else
13318 {
13320 }
13321
13322 }
13323 }
13324}
13325
13326#ifdef DEVELOPER
13328#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.