8368{
8370 {
8371 return true;
8372 }
8373};
8374
8375
8376
8378{
8382
8384
8387
8388
8389
8390
8391
8400
8406
8411
8416
8437 protected bool m_IsResultOfSplit
8438
8440
8445
8446
8447
8449
8453
8454
8455
8457
8460
8461
8462
8468
8469
8477
8480
8481
8483
8484
8486
8487
8492
8493
8498
8499
8501
8502
8504 {
8509
8510 if (!
GetGame().IsDedicatedServer())
8511 {
8513 {
8515
8517 {
8519 }
8520 }
8521
8524 }
8525
8526 m_OldLocation = null;
8527
8529 {
8531 }
8532
8533 if (ConfigIsExisting("headSelectionsToHide"))
8534 {
8537 }
8538
8540 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8541 {
8543 }
8544
8546
8547 m_IsResultOfSplit = false;
8548
8550 }
8551
8553 {
8554 super.InitItemVariables();
8555
8561 m_Count = ConfigGetInt(
"count");
8562
8565
8570
8573
8578
8590
8594
8595
8598 if (ConfigIsExisting("canBeSplit"))
8599 {
8602 }
8603
8605 if (ConfigIsExisting("itemBehaviour"))
8607
8608
8611 RegisterNetSyncVariableInt("m_VarLiquidType");
8612 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8613
8614 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8615 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8616 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8617
8618 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8619 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8620 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8621 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8622
8623 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8624 RegisterNetSyncVariableBool("m_IsTakeable");
8625 RegisterNetSyncVariableBool("m_IsHologram");
8626
8629 {
8632 }
8633
8635
8637 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8639
8640 }
8641
8643 {
8645 }
8646
8648 {
8651 {
8656 }
8657 }
8658
8659 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8660 {
8662 {
8665 }
8666
8668 }
8669
8671 {
8677 }
8678
8680
8682 {
8684
8685 if (!action)
8686 {
8687 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8688 return;
8689 }
8690
8692 if (!ai)
8693 {
8695 return;
8696 }
8697
8699 if (!action_array)
8700 {
8701 action_array = new array<ActionBase_Basic>;
8703 }
8704 if (LogManager.IsActionLogEnable())
8705 {
8706 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8707 }
8708
8709 if (action_array.Find(action) != -1)
8710 {
8711 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8712 }
8713 else
8714 {
8715 action_array.Insert(action);
8716 }
8717 }
8718
8720 {
8722 ActionBase action = player.GetActionManager().GetAction(actionName);
8725
8726 if (action_array)
8727 {
8728 action_array.RemoveItem(action);
8729 }
8730 }
8731
8732
8733
8735 {
8736 ActionOverrideData overrideData = new ActionOverrideData();
8740
8742 if (!actionMap)
8743 {
8746 }
8747
8748 actionMap.Insert(this.
Type(), overrideData);
8749
8750 }
8751
8753
8755
8756
8758 {
8761
8764
8765 string config_to_search = "CfgVehicles";
8766 string muzzle_owner_config;
8767
8769 {
8770 if (IsInherited(Weapon))
8771 config_to_search = "CfgWeapons";
8772
8773 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8774
8775 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8776
8778
8779 if (config_OnFire_subclass_count > 0)
8780 {
8781 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8782
8783 for (int i = 0; i < config_OnFire_subclass_count; i++)
8784 {
8785 string particle_class = "";
8787 string config_OnFire_entry = config_OnFire_class + particle_class;
8788 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8789 WPOF_array.Insert(WPOF);
8790 }
8791
8792
8794 }
8795 }
8796
8798 {
8799 config_to_search = "CfgWeapons";
8800 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8801
8802 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8803
8805
8806 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8807 {
8808 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8809
8810 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8811 {
8812 string particle_class2 = "";
8814 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8815 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8816 WPOBE_array.Insert(WPOBE);
8817 }
8818
8819
8821 }
8822 }
8823 }
8824
8825
8827 {
8830
8832 {
8833 string config_to_search = "CfgVehicles";
8834
8835 if (IsInherited(Weapon))
8836 config_to_search = "CfgWeapons";
8837
8838 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8839 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8840
8841 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8842 {
8843
8845
8847 {
8849 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8851 return;
8852 }
8853
8856
8857
8858
8860 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8861
8862 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8863 {
8864 string particle_class = "";
8866 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8868
8869 if (entry_type == CT_CLASS)
8870 {
8871 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8872 WPOOH_array.Insert(WPOF);
8873 }
8874 }
8875
8876
8878 }
8879 }
8880 }
8881
8883 {
8885 }
8886
8888 {
8890 {
8892
8895
8898
8899 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8900 }
8901 }
8902
8904 {
8906 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8907
8909 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8910
8912 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8913
8915 {
8917 }
8918 }
8919
8921 {
8923 }
8924
8926 {
8929 else
8931
8933 {
8936 }
8937 else
8938 {
8941
8944 }
8945
8947 }
8948
8950 {
8952 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8953 }
8954
8956 {
8958 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8960 }
8961
8963 {
8965 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8966 }
8967
8969 {
8972
8973 OverheatingParticle OP = new OverheatingParticle();
8978
8980 }
8981
8983 {
8986
8987 return -1;
8988 }
8989
8991 {
8993 {
8996
8997 for (int i = count; i > 0; --i)
8998 {
8999 int id = i - 1;
9002
9005
9006 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9007 {
9008 if (p)
9009 {
9012 }
9013 }
9014 }
9015 }
9016 }
9017
9019 {
9021 {
9023 {
9024 int id = i - 1;
9026
9027 if (OP)
9028 {
9030
9031 if (p)
9032 {
9034 }
9035
9036 delete OP;
9037 }
9038 }
9039
9042 }
9043 }
9044
9047 {
9048 return 0.0;
9049 }
9050
9051
9053 {
9054 return 250;
9055 }
9056
9058 {
9059 return 0;
9060 }
9061
9064 {
9066 return true;
9067
9068 return false;
9069 }
9070
9073 {
9076
9078 {
9080 }
9081 else
9082 {
9083
9085 }
9086
9088 }
9089
9096 {
9097 return -1;
9098 }
9099
9100
9101
9102
9104 {
9106 {
9108 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9109
9110 if (r_index >= 0)
9111 {
9112 InventoryLocation r_il = new InventoryLocation;
9113 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9114
9115 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9118 {
9119 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9120 }
9122 {
9123 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9124 }
9125
9126 }
9127
9128 player.GetHumanInventory().ClearUserReservedLocation(this);
9129 }
9130
9133 }
9134
9135
9136
9137
9139 {
9140 return ItemBase.m_DebugActionsMask;
9141 }
9142
9144 {
9145 return ItemBase.m_DebugActionsMask & mask;
9146 }
9147
9149 {
9150 ItemBase.m_DebugActionsMask = mask;
9151 }
9152
9154 {
9155 ItemBase.m_DebugActionsMask |= mask;
9156 }
9157
9159 {
9160 ItemBase.m_DebugActionsMask &= ~mask;
9161 }
9162
9164 {
9166 {
9168 }
9169 else
9170 {
9172 }
9173 }
9174
9175
9177 {
9178 if (GetEconomyProfile())
9179 {
9180 float q_max = GetEconomyProfile().GetQuantityMax();
9181 if (q_max > 0)
9182 {
9183 float q_min = GetEconomyProfile().GetQuantityMin();
9184 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9185
9187 {
9188 ComponentEnergyManager comp = GetCompEM();
9190 {
9192 }
9193 }
9195 {
9197
9198 }
9199
9200 }
9201 }
9202 }
9203
9206 {
9207 EntityAI parent = GetHierarchyParent();
9208
9209 if (parent)
9210 {
9211 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9212 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9213 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9214 }
9215 }
9216
9219 {
9220 EntityAI parent = GetHierarchyParent();
9221
9222 if (parent)
9223 {
9224 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9225 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9226 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9227 }
9228 }
9229
9231 {
9232
9233
9234
9235
9237
9239 {
9240 if (ScriptInputUserData.CanStoreInputUserData())
9241 {
9242 ScriptInputUserData ctx = new ScriptInputUserData;
9248 ctx.
Write(use_stack_max);
9251
9253 {
9254 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9255 }
9256 }
9257 }
9258 else if (!
GetGame().IsMultiplayer())
9259 {
9261 }
9262 }
9263
9265 {
9267 }
9268
9270 {
9272 }
9273
9275 {
9277 }
9278
9280 {
9281
9282 return false;
9283 }
9284
9286 {
9287 return false;
9288 }
9289
9293 {
9294 return false;
9295 }
9296
9298 {
9299 return "";
9300 }
9301
9303
9305 {
9306 return false;
9307 }
9308
9310 {
9311 return true;
9312 }
9313
9314
9315
9317 {
9318 return true;
9319 }
9320
9322 {
9323 return true;
9324 }
9325
9327 {
9328 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9330 }
9331
9333 {
9335 }
9336
9338 {
9340 if (!is_being_placed)
9342 SetSynchDirty();
9343 }
9344
9345
9347
9349 {
9351 }
9352
9354 {
9356 }
9357
9359 {
9360 return 1;
9361 }
9362
9364 {
9365 return false;
9366 }
9367
9369 {
9371 SetSynchDirty();
9372 }
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9409 {
9410 super.OnMovedInsideCargo(container);
9411
9412 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9413 }
9414
9415 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9416 {
9417 super.EEItemLocationChanged(oldLoc,newLoc);
9418
9419 PlayerBase new_player = null;
9420 PlayerBase old_player = null;
9421
9422 if (newLoc.GetParent())
9423 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9424
9425 if (oldLoc.GetParent())
9426 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9427
9429 {
9430 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9431
9432 if (r_index >= 0)
9433 {
9434 InventoryLocation r_il = new InventoryLocation;
9435 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9436
9437 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9440 {
9441 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9442 }
9444 {
9445 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9446 }
9447
9448 }
9449 }
9450
9452 {
9453 if (new_player)
9454 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9455
9456 if (new_player == old_player)
9457 {
9458
9459 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9460 {
9462 {
9463 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9464 {
9465 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9466 }
9467 }
9468 else
9469 {
9470 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9471 }
9472 }
9473
9474 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9475 {
9476 int type = oldLoc.GetType();
9478 {
9479 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9480 }
9482 {
9483 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9484 }
9485 }
9486 if (!m_OldLocation)
9487 {
9488 m_OldLocation = new InventoryLocation;
9489 }
9490 m_OldLocation.Copy(oldLoc);
9491 }
9492 else
9493 {
9494 if (m_OldLocation)
9495 {
9496 m_OldLocation.Reset();
9497 }
9498 }
9499
9501 }
9502 else
9503 {
9504 if (new_player)
9505 {
9506 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9507 if (res_index >= 0)
9508 {
9509 InventoryLocation il = new InventoryLocation;
9510 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9512 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9515 {
9516 il.
GetParent().GetOnReleaseLock().Invoke(it);
9517 }
9519 {
9521 }
9522
9523 }
9524 }
9526 {
9527
9529 }
9530
9531 if (m_OldLocation)
9532 {
9533 m_OldLocation.Reset();
9534 }
9535 }
9536 }
9537
9538 override void EOnContact(IEntity other, Contact extra)
9539 {
9541 {
9542 int liquidType = -1;
9544 if (impactSpeed > 0.0)
9545 {
9547 #ifndef SERVER
9549 #else
9551 SetSynchDirty();
9552 #endif
9554 }
9555 }
9556
9557 #ifdef SERVER
9558 if (GetCompEM() && GetCompEM().IsPlugged())
9559 {
9560 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9561 GetCompEM().UnplugThis();
9562 }
9563 #endif
9564 }
9565
9567
9569 {
9571 }
9572
9574 {
9575
9576 }
9577
9579 {
9580 super.OnItemLocationChanged(old_owner, new_owner);
9581
9582 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9583 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9584
9585 if (!relatedPlayer && playerNew)
9586 relatedPlayer = playerNew;
9587
9588 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9589 {
9591 if (actionMgr)
9592 {
9593 ActionBase currentAction = actionMgr.GetRunningAction();
9594 if (currentAction)
9596 }
9597 }
9598
9599 Man ownerPlayerOld = null;
9600 Man ownerPlayerNew = null;
9601
9602 if (old_owner)
9603 {
9604 if (old_owner.
IsMan())
9605 {
9606 ownerPlayerOld = Man.Cast(old_owner);
9607 }
9608 else
9609 {
9610 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9611 }
9612 }
9613 else
9614 {
9616 {
9618
9619 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9620 {
9621 GetCompEM().UnplugThis();
9622 }
9623 }
9624 }
9625
9626 if (new_owner)
9627 {
9628 if (new_owner.
IsMan())
9629 {
9630 ownerPlayerNew = Man.Cast(new_owner);
9631 }
9632 else
9633 {
9634 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9635 }
9636 }
9637
9638 if (ownerPlayerOld != ownerPlayerNew)
9639 {
9640 if (ownerPlayerOld)
9641 {
9642 array<EntityAI> subItemsExit = new array<EntityAI>;
9644 for (int i = 0; i < subItemsExit.Count(); i++)
9645 {
9648 }
9649 }
9650
9651 if (ownerPlayerNew)
9652 {
9653 array<EntityAI> subItemsEnter = new array<EntityAI>;
9655 for (int j = 0; j < subItemsEnter.Count(); j++)
9656 {
9659 }
9660 }
9661 }
9662 else if (ownerPlayerNew != null)
9663 {
9664 PlayerBase nplayer;
9665 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9666 {
9667 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9669 for (int k = 0; k < subItemsUpdate.Count(); k++)
9670 {
9672 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9673 }
9674 }
9675 }
9676
9677 if (old_owner)
9678 old_owner.OnChildItemRemoved(this);
9679 if (new_owner)
9680 new_owner.OnChildItemReceived(this);
9681 }
9682
9683
9685 {
9686 super.EEDelete(parent);
9687 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9688 if (player)
9689 {
9691
9692 if (player.IsAlive())
9693 {
9694 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9695 if (r_index >= 0)
9696 {
9697 InventoryLocation r_il = new InventoryLocation;
9698 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9699
9700 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9703 {
9704 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9705 }
9707 {
9708 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9709 }
9710
9711 }
9712
9713 player.RemoveQuickBarEntityShortcut(this);
9714 }
9715 }
9716 }
9717
9719 {
9720 super.EEKilled(killer);
9721
9724 {
9725 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9726 {
9727 if (IsMagazine())
9728 {
9729 if (Magazine.Cast(this).GetAmmoCount() > 0)
9730 {
9732 }
9733 }
9734 else
9735 {
9737 }
9738 }
9739 }
9740 }
9741
9743 {
9744 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9745
9746 super.OnWasAttached(parent, slot_id);
9747
9750
9752 }
9753
9755 {
9756 super.OnWasDetached(parent, slot_id);
9757
9760 }
9761
9763 {
9764 int idx;
9767
9768 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9769 if (inventory_slots.Count() < 1)
9770 {
9771 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9772 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9773 }
9774 else
9775 {
9776 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9777 }
9778
9779 idx = inventory_slots.Find(slot);
9780 if (idx < 0)
9781 return "";
9782
9783 return attach_types.Get(idx);
9784 }
9785
9787 {
9788 int idx = -1;
9789 string slot;
9790
9793
9794 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9795 if (inventory_slots.Count() < 1)
9796 {
9797 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9798 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9799 }
9800 else
9801 {
9802 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9803 if (detach_types.Count() < 1)
9804 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9805 }
9806
9807 for (int i = 0; i < inventory_slots.Count(); i++)
9808 {
9809 slot = inventory_slots.Get(i);
9810 }
9811
9812 if (slot != "")
9813 {
9814 if (detach_types.Count() == 1)
9815 idx = 0;
9816 else
9817 idx = inventory_slots.Find(slot);
9818 }
9819 if (idx < 0)
9820 return "";
9821
9822 return detach_types.Get(idx);
9823 }
9824
9826 {
9827
9829
9830
9831 float min_time = 1;
9832 float max_time = 3;
9833 float delay = Math.RandomFloat(min_time, max_time);
9834
9835 explode_timer.Run(delay, this, "DoAmmoExplosion");
9836 }
9837
9839 {
9840 Magazine magazine = Magazine.Cast(this);
9841 int pop_sounds_count = 6;
9842 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9843
9844
9845 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9846 string sound_name = pop_sounds[ sound_idx ];
9848
9849
9850 magazine.ServerAddAmmoCount(-1);
9851
9852
9853 float min_temp_to_explode = 100;
9854
9855 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9856 {
9858 }
9859 }
9860
9861
9862 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9863 {
9864 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9865
9866 const int CHANCE_DAMAGE_CARGO = 4;
9867 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9868 const int CHANCE_DAMAGE_NOTHING = 2;
9869
9871 {
9872 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9873 int chances;
9874 int rnd;
9875
9876 if (GetInventory().GetCargo())
9877 {
9878 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9879 rnd = Math.RandomInt(0,chances);
9880
9881 if (rnd < CHANCE_DAMAGE_CARGO)
9882 {
9884 }
9885 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9886 {
9888 }
9889 }
9890 else
9891 {
9892 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9893 rnd = Math.RandomInt(0,chances);
9894
9895 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9896 {
9898 }
9899 }
9900 }
9901 }
9902
9904 {
9905 if (GetInventory().GetCargo())
9906 {
9907 int item_count = GetInventory().GetCargo().GetItemCount();
9908 if (item_count > 0)
9909 {
9910 int random_pick = Math.RandomInt(0, item_count);
9912 if (!item.IsExplosive())
9913 {
9914 item.AddHealth("","",damage);
9915 return true;
9916 }
9917 }
9918 }
9919 return false;
9920 }
9921
9923 {
9924 int attachment_count = GetInventory().AttachmentCount();
9925 if (attachment_count > 0)
9926 {
9927 int random_pick = Math.RandomInt(0, attachment_count);
9928 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9929 if (!attachment.IsExplosive())
9930 {
9931 attachment.AddHealth("","",damage);
9932 return true;
9933 }
9934 }
9935 return false;
9936 }
9937
9939 {
9941 }
9942
9944 {
9946 return GetInventory().CanRemoveEntity();
9947
9948 return false;
9949 }
9950
9952 {
9954 return;
9955
9957 {
9958 if (ScriptInputUserData.CanStoreInputUserData())
9959 {
9960 ScriptInputUserData ctx = new ScriptInputUserData;
9965 ctx.
Write(destination_entity);
9969 }
9970 }
9971 else if (!
GetGame().IsMultiplayer())
9972 {
9974 }
9975 }
9976
9978 {
9980 return;
9981
9982 float split_quantity_new;
9986 InventoryLocation loc = new InventoryLocation;
9987
9988 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9989 {
9991 split_quantity_new = stack_max;
9992 else
9994
9995 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9996 if (new_item)
9997 {
9998 new_item.SetResultOfSplit(true);
9999 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10001 new_item.SetQuantity(split_quantity_new);
10002 }
10003 }
10004 else if (destination_entity && slot_id == -1)
10005 {
10006 if (quantity > stack_max)
10007 split_quantity_new = stack_max;
10008 else
10009 split_quantity_new = quantity;
10010
10012 {
10015 }
10016
10017 if (new_item)
10018 {
10019 new_item.SetResultOfSplit(true);
10020 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10022 new_item.SetQuantity(split_quantity_new);
10023 }
10024 }
10025 else
10026 {
10027 if (stack_max != 0)
10028 {
10030 {
10032 }
10033
10034 if (split_quantity_new == 0)
10035 {
10036 if (!
GetGame().IsMultiplayer())
10037 player.PhysicalPredictiveDropItem(this);
10038 else
10039 player.ServerDropEntity(this);
10040 return;
10041 }
10042
10044
10045 if (new_item)
10046 {
10047 new_item.SetResultOfSplit(true);
10048 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10050 new_item.SetQuantity(stack_max);
10051 new_item.PlaceOnSurface();
10052 }
10053 }
10054 }
10055 }
10056
10058 {
10060 return;
10061
10062 float split_quantity_new;
10066 InventoryLocation loc = new InventoryLocation;
10067
10068 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10069 {
10071 split_quantity_new = stack_max;
10072 else
10074
10075 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10076 if (new_item)
10077 {
10078 new_item.SetResultOfSplit(true);
10079 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10081 new_item.SetQuantity(split_quantity_new);
10082 }
10083 }
10084 else if (destination_entity && slot_id == -1)
10085 {
10086 if (quantity > stack_max)
10087 split_quantity_new = stack_max;
10088 else
10089 split_quantity_new = quantity;
10090
10092 {
10095 }
10096
10097 if (new_item)
10098 {
10099 new_item.SetResultOfSplit(true);
10100 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10102 new_item.SetQuantity(split_quantity_new);
10103 }
10104 }
10105 else
10106 {
10107 if (stack_max != 0)
10108 {
10110 {
10112 }
10113
10115
10116 if (new_item)
10117 {
10118 new_item.SetResultOfSplit(true);
10119 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10121 new_item.SetQuantity(stack_max);
10122 new_item.PlaceOnSurface();
10123 }
10124 }
10125 }
10126 }
10127
10129 {
10131 return;
10132
10134 {
10135 if (ScriptInputUserData.CanStoreInputUserData())
10136 {
10137 ScriptInputUserData ctx = new ScriptInputUserData;
10142 dst.WriteToContext(ctx);
10144 }
10145 }
10146 else if (!
GetGame().IsMultiplayer())
10147 {
10149 }
10150 }
10151
10153 {
10155 return;
10156
10158 {
10159 if (ScriptInputUserData.CanStoreInputUserData())
10160 {
10161 ScriptInputUserData ctx = new ScriptInputUserData;
10166 ctx.
Write(destination_entity);
10172 }
10173 }
10174 else if (!
GetGame().IsMultiplayer())
10175 {
10177 }
10178 }
10179
10181 {
10183 }
10184
10186 {
10188 return this;
10189
10191 float split_quantity_new;
10193 if (dst.IsValid())
10194 {
10195 int slot_id = dst.GetSlot();
10197
10198 if (quantity > stack_max)
10199 split_quantity_new = stack_max;
10200 else
10201 split_quantity_new = quantity;
10202
10204
10205 if (new_item)
10206 {
10207 new_item.SetResultOfSplit(true);
10208 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10211 }
10212
10213 return new_item;
10214 }
10215
10216 return null;
10217 }
10218
10220 {
10222 return;
10223
10225 float split_quantity_new;
10227 if (destination_entity)
10228 {
10230 if (quantity > stackable)
10231 split_quantity_new = stackable;
10232 else
10233 split_quantity_new = quantity;
10234
10235 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10236 if (new_item)
10237 {
10238 new_item.SetResultOfSplit(true);
10239 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10241 new_item.SetQuantity(split_quantity_new);
10242 }
10243 }
10244 }
10245
10247 {
10249 return;
10250
10252 {
10253 if (ScriptInputUserData.CanStoreInputUserData())
10254 {
10255 ScriptInputUserData ctx = new ScriptInputUserData;
10260 ItemBase destination_entity =
this;
10261 ctx.
Write(destination_entity);
10265 }
10266 }
10267 else if (!
GetGame().IsMultiplayer())
10268 {
10270 }
10271 }
10272
10274 {
10276 return;
10277
10279 float split_quantity_new;
10281 if (player)
10282 {
10284 if (quantity > stackable)
10285 split_quantity_new = stackable;
10286 else
10287 split_quantity_new = quantity;
10288
10289 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10290 new_item =
ItemBase.Cast(in_hands);
10291 if (new_item)
10292 {
10293 new_item.SetResultOfSplit(true);
10294 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10296 new_item.SetQuantity(split_quantity_new);
10297 }
10298 }
10299 }
10300
10302 {
10304 return;
10305
10307 float split_quantity_new = Math.Floor(quantity * 0.5);
10308
10310
10311 if (new_item)
10312 {
10313 if (new_item.GetQuantityMax() < split_quantity_new)
10314 {
10315 split_quantity_new = new_item.GetQuantityMax();
10316 }
10317
10318 new_item.SetResultOfSplit(true);
10319 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10320
10322 {
10325 }
10326 else
10327 {
10330 }
10331 }
10332 }
10333
10335 {
10337 return;
10338
10340 float split_quantity_new = Math.Floor(quantity / 2);
10341
10342 InventoryLocation invloc = new InventoryLocation;
10344
10346 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10347
10348 if (new_item)
10349 {
10350 if (new_item.GetQuantityMax() < split_quantity_new)
10351 {
10352 split_quantity_new = new_item.GetQuantityMax();
10353 }
10355 {
10358 }
10359 else
10360 {
10363 }
10364 }
10365 }
10366
10369 {
10370 SetWeightDirty();
10372
10373 if (parent)
10374 parent.OnAttachmentQuantityChangedEx(this, delta);
10375
10377 {
10379 {
10381 }
10383 {
10384 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10386 }
10387 }
10388
10389 }
10390
10393 {
10394
10395 }
10396
10399 {
10401 }
10402
10404 {
10405 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10406
10408 {
10409 if (newLevel == GameConstants.STATE_RUINED)
10410 {
10412 EntityAI parent = GetHierarchyParent();
10413 if (parent && parent.IsFireplace())
10414 {
10415 CargoBase cargo = GetInventory().GetCargo();
10416 if (cargo)
10417 {
10419 {
10421 }
10422 }
10423 }
10424 }
10425
10427 {
10428
10430 return;
10431 }
10432
10433 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10434 {
10436 }
10437 }
10438 }
10439
10440
10442 {
10443 super.OnRightClick();
10444
10446 {
10448 {
10449 if (ScriptInputUserData.CanStoreInputUserData())
10450 {
10451 vector m4[4];
10453
10454 EntityAI root = GetHierarchyRoot();
10455
10456 InventoryLocation dst = new InventoryLocation;
10458 {
10459 if (root)
10460 {
10461 root.GetTransform(m4);
10463 }
10464 else
10465 GetInventory().GetCurrentInventoryLocation(dst);
10466 }
10467 else
10468 {
10470
10471
10472 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10473 {
10474 if (root)
10475 {
10476 root.GetTransform(m4);
10478 }
10479 else
10480 GetInventory().GetCurrentInventoryLocation(dst);
10481 }
10482 else
10483 {
10484 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10485 }
10486 }
10487
10488 ScriptInputUserData ctx = new ScriptInputUserData;
10496 }
10497 }
10498 else if (!
GetGame().IsMultiplayer())
10499 {
10501 }
10502 }
10503 }
10504
10505 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10506 {
10507
10508 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10509 return false;
10510
10511 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10512 return false;
10513
10514
10516 return false;
10517
10518
10519 Magazine mag = Magazine.Cast(this);
10520 if (mag)
10521 {
10522 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10523 return false;
10524
10525 if (stack_max_limit)
10526 {
10527 Magazine other_mag = Magazine.Cast(other_item);
10528 if (other_item)
10529 {
10530 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10531 return false;
10532 }
10533
10534 }
10535 }
10536 else
10537 {
10538
10540 return false;
10541
10543 return false;
10544 }
10545
10546 PlayerBase player = null;
10547 if (CastTo(player, GetHierarchyRootPlayer()))
10548 {
10549 if (player.GetInventory().HasAttachment(this))
10550 return false;
10551
10552 if (player.IsItemsToDelete())
10553 return false;
10554 }
10555
10556 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10557 return false;
10558
10559 int slotID;
10561 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10562 return false;
10563
10564 return true;
10565 }
10566
10568 {
10570 }
10571
10573 {
10574 return m_IsResultOfSplit;
10575 }
10576
10578 {
10579 m_IsResultOfSplit = value;
10580 }
10581
10583 {
10585 }
10586
10588 {
10589 float other_item_quantity = other_item.GetQuantity();
10590 float this_free_space;
10591
10593
10595
10596 if (other_item_quantity > this_free_space)
10597 {
10598 return this_free_space;
10599 }
10600 else
10601 {
10602 return other_item_quantity;
10603 }
10604 }
10605
10607 {
10609 }
10610
10612 {
10614 return;
10615
10616 if (!IsMagazine() && other_item)
10617 {
10619 if (quantity_used != 0)
10620 {
10621 float hp1 = GetHealth01("","");
10622 float hp2 = other_item.GetHealth01("","");
10623 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10624 hpResult = hpResult / (
GetQuantity() + quantity_used);
10625
10626 hpResult *= GetMaxHealth();
10627 Math.Round(hpResult);
10628 SetHealth("", "Health", hpResult);
10629
10631 other_item.AddQuantity(-quantity_used);
10632 }
10633 }
10635 }
10636
10638 {
10639 #ifdef SERVER
10640 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10641 GetHierarchyParent().IncreaseLifetimeUp();
10642 #endif
10643 };
10644
10646 {
10647 PlayerBase p = PlayerBase.Cast(player);
10648
10649 array<int> recipesIds = p.m_Recipes;
10650 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10651 if (moduleRecipesManager)
10652 {
10653 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10654 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10655 }
10656
10657 for (int i = 0;i < recipesIds.Count(); i++)
10658 {
10659 int key = recipesIds.Get(i);
10660 string recipeName = moduleRecipesManager.GetRecipeName(key);
10662 }
10663 }
10664
10665
10666 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10667 {
10668 super.GetDebugActions(outputList);
10669
10670
10675
10676
10680
10684
10685
10688
10689
10691 {
10694 }
10695
10697
10700
10704 }
10705
10706
10707
10708
10710 {
10711 super.OnAction(action_id, player, ctx);
10712 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10713 {
10714 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10715 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10716 PlayerBase p = PlayerBase.Cast(player);
10717 if (
EActions.RECIPES_RANGE_START < 1000)
10718 {
10719 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10720 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10721 }
10722 }
10723 #ifndef SERVER
10724 else if (action_id ==
EActions.WATCH_PLAYER)
10725 {
10726 PluginDeveloper.SetDeveloperItemClientEx(player);
10727 }
10728 #endif
10730 {
10731 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10732 {
10733 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10734 OnDebugButtonPressServer(id + 1);
10735 }
10736
10737 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10738 {
10739 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10741 }
10742
10743 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10744 {
10745 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10747 }
10748
10749 else if (action_id ==
EActions.ADD_QUANTITY)
10750 {
10751 if (IsMagazine())
10752 {
10753 Magazine mag = Magazine.Cast(this);
10754 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10755 }
10756 else
10757 {
10759 }
10760
10761 if (m_EM)
10762 {
10763 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10764 }
10765
10766 }
10767
10768 else if (action_id ==
EActions.REMOVE_QUANTITY)
10769 {
10770 if (IsMagazine())
10771 {
10772 Magazine mag2 = Magazine.Cast(this);
10773 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10774 }
10775 else
10776 {
10778 }
10779 if (m_EM)
10780 {
10781 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10782 }
10783
10784 }
10785
10786 else if (action_id ==
EActions.SET_QUANTITY_0)
10787 {
10789
10790 if (m_EM)
10791 {
10792 m_EM.SetEnergy(0);
10793 }
10794 }
10795
10796 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10797 {
10799
10800 if (m_EM)
10801 {
10802 m_EM.SetEnergy(m_EM.GetEnergyMax());
10803 }
10804 }
10805
10806 else if (action_id ==
EActions.ADD_HEALTH)
10807 {
10808 AddHealth("","",GetMaxHealth("","Health")/5);
10809 }
10810 else if (action_id ==
EActions.REMOVE_HEALTH)
10811 {
10812 AddHealth("","",-GetMaxHealth("","Health")/5);
10813 }
10814 else if (action_id ==
EActions.DESTROY_HEALTH)
10815 {
10816 SetHealth01("","",0);
10817 }
10818 else if (action_id ==
EActions.WATCH_ITEM)
10819 {
10821 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10822 #ifdef DEVELOPER
10823 SetDebugDeveloper_item(this);
10824 #endif
10825 }
10826
10827 else if (action_id ==
EActions.ADD_TEMPERATURE)
10828 {
10829 AddTemperature(20);
10830
10831 }
10832
10833 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10834 {
10835 AddTemperature(-20);
10836
10837 }
10838
10839 else if (action_id ==
EActions.FLIP_FROZEN)
10840 {
10841 SetFrozen(!GetIsFrozen());
10842
10843 }
10844
10845 else if (action_id ==
EActions.ADD_WETNESS)
10846 {
10848
10849 }
10850
10851 else if (action_id ==
EActions.REMOVE_WETNESS)
10852 {
10854
10855 }
10856
10857 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10858 {
10861
10862
10863 }
10864
10865 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10866 {
10869 }
10870
10871 else if (action_id ==
EActions.MAKE_SPECIAL)
10872 {
10873 auto debugParams = DebugSpawnParams.WithPlayer(player);
10874 OnDebugSpawnEx(debugParams);
10875 }
10876
10877 else if (action_id ==
EActions.DELETE)
10878 {
10879 Delete();
10880 }
10881
10882 }
10883
10884
10885 return false;
10886 }
10887
10888
10889
10890
10894
10897
10898
10899
10901 {
10902 return false;
10903 }
10904
10905
10907 {
10908 return true;
10909 }
10910
10911
10913 {
10914 return true;
10915 }
10916
10917
10918
10920 {
10921 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10923 }
10924
10927 {
10928 return null;
10929 }
10930
10932 {
10933 return false;
10934 }
10935
10937 {
10938 return false;
10939 }
10940
10944
10945
10947 {
10948 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10949 return module_repairing.CanRepair(this, item_repair_kit);
10950 }
10951
10952
10953 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10954 {
10955 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10956 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10957 }
10958
10959
10961 {
10962
10963
10964
10965
10966
10967
10968
10969
10970 return 1;
10971 }
10972
10973
10974
10976 {
10978 }
10979
10980
10981
10983 {
10985 }
10986
10987
10996 {
10997 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10998
10999 if (player)
11000 {
11001 player.MessageStatus(text);
11002 }
11003 }
11004
11005
11014 {
11015 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11016
11017 if (player)
11018 {
11019 player.MessageAction(text);
11020 }
11021 }
11022
11023
11032 {
11033 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11034
11035 if (player)
11036 {
11037 player.MessageFriendly(text);
11038 }
11039 }
11040
11041
11050 {
11051 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11052
11053 if (player)
11054 {
11055 player.MessageImportant(text);
11056 }
11057 }
11058
11060 {
11061 return true;
11062 }
11063
11064
11065 override bool KindOf(
string tag)
11066 {
11067 bool found = false;
11068 string item_name = this.
GetType();
11071
11072 int array_size = item_tag_array.Count();
11073 for (int i = 0; i < array_size; i++)
11074 {
11075 if (item_tag_array.Get(i) == tag)
11076 {
11077 found = true;
11078 break;
11079 }
11080 }
11081 return found;
11082 }
11083
11084
11086 {
11087
11088 super.OnRPC(sender, rpc_type,ctx);
11089
11090
11091 switch (rpc_type)
11092 {
11093 #ifndef SERVER
11094 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11095 Param2<bool, string> p = new Param2<bool, string>(false, "");
11096
11098 return;
11099
11100 bool play = p.param1;
11101 string soundSet = p.param2;
11102
11103 if (play)
11104 {
11106 {
11108 {
11110 }
11111 }
11112 else
11113 {
11115 }
11116 }
11117 else
11118 {
11120 }
11121
11122 break;
11123 #endif
11124
11125 }
11126
11128 {
11130 }
11131 }
11132
11133
11134
11135
11137 {
11138 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11139 return plugin.GetID(
name);
11140 }
11141
11143 {
11144 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11145 return plugin.GetName(id);
11146 }
11147
11150 {
11151
11152
11153 int varFlags;
11154 if (!ctx.
Read(varFlags))
11155 return;
11156
11157 if (varFlags & ItemVariableFlags.FLOAT)
11158 {
11160 }
11161 }
11162
11164 {
11165
11166 super.SerializeNumericalVars(floats_out);
11167
11168
11169
11171 {
11173 }
11174
11176 {
11178 }
11179
11181 {
11183 }
11184
11186 {
11191 }
11192
11194 {
11196 }
11197 }
11198
11200 {
11201
11202 super.DeSerializeNumericalVars(floats);
11203
11204
11205 int index = 0;
11206 int mask = Math.Round(floats.Get(index));
11207
11208 index++;
11209
11211 {
11213 {
11215 }
11216 else
11217 {
11218 float quantity = floats.Get(index);
11219 SetQuantity(quantity,
true,
false,
false,
false);
11220 }
11221 index++;
11222 }
11223
11225 {
11226 float wet = floats.Get(index);
11228 index++;
11229 }
11230
11232 {
11233 int liquidtype = Math.Round(floats.Get(index));
11235 index++;
11236 }
11237
11239 {
11241 index++;
11243 index++;
11245 index++;
11247 index++;
11248 }
11249
11251 {
11252 int cleanness = Math.Round(floats.Get(index));
11254 index++;
11255 }
11256 }
11257
11259 {
11260 super.WriteVarsToCTX(ctx);
11261
11262
11264 {
11266 }
11267
11269 {
11271 }
11272
11274 {
11276 }
11277
11279 {
11280 int r,g,b,a;
11286 }
11287
11289 {
11291 }
11292 }
11293
11295 {
11296 if (!super.ReadVarsFromCTX(ctx,version))
11297 return false;
11298
11299 int intValue;
11300 float value;
11301
11302 if (version < 140)
11303 {
11304 if (!ctx.
Read(intValue))
11305 return false;
11306
11307 m_VariablesMask = intValue;
11308 }
11309
11311 {
11312 if (!ctx.
Read(value))
11313 return false;
11314
11316 {
11318 }
11319 else
11320 {
11322 }
11323 }
11324
11325 if (version < 140)
11326 {
11328 {
11329 if (!ctx.
Read(value))
11330 return false;
11331 SetTemperatureDirect(value);
11332 }
11333 }
11334
11336 {
11337 if (!ctx.
Read(value))
11338 return false;
11340 }
11341
11343 {
11344 if (!ctx.
Read(intValue))
11345 return false;
11347 }
11348
11350 {
11351 int r,g,b,a;
11353 return false;
11355 return false;
11357 return false;
11359 return false;
11360
11362 }
11363
11365 {
11366 if (!ctx.
Read(intValue))
11367 return false;
11369 }
11370
11371 if (version >= 138 && version < 140)
11372 {
11374 {
11375 if (!ctx.
Read(intValue))
11376 return false;
11377 SetFrozen(intValue);
11378 }
11379 }
11380
11381 return true;
11382 }
11383
11384
11386 {
11389 {
11391 }
11392
11393 if (!super.OnStoreLoad(ctx, version))
11394 {
11396 return false;
11397 }
11398
11399 if (version >= 114)
11400 {
11401 bool hasQuickBarIndexSaved;
11402
11403 if (!ctx.
Read(hasQuickBarIndexSaved))
11404 {
11406 return false;
11407 }
11408
11409 if (hasQuickBarIndexSaved)
11410 {
11411 int itmQBIndex;
11412
11413
11414 if (!ctx.
Read(itmQBIndex))
11415 {
11417 return false;
11418 }
11419
11420 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11421 if (itmQBIndex != -1 && parentPlayer)
11422 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11423 }
11424 }
11425 else
11426 {
11427
11428 PlayerBase player;
11429 int itemQBIndex;
11430 if (version ==
int.
MAX)
11431 {
11432 if (!ctx.
Read(itemQBIndex))
11433 {
11435 return false;
11436 }
11437 }
11438 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11439 {
11440
11441 if (!ctx.
Read(itemQBIndex))
11442 {
11444 return false;
11445 }
11446 if (itemQBIndex != -1 && player)
11447 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11448 }
11449 }
11450
11451 if (version < 140)
11452 {
11453
11454 if (!LoadVariables(ctx, version))
11455 {
11457 return false;
11458 }
11459 }
11460
11461
11463 {
11465 return false;
11466 }
11467 if (version >= 132)
11468 {
11470 if (raib)
11471 {
11473 {
11475 return false;
11476 }
11477 }
11478 }
11479
11481 return true;
11482 }
11483
11484
11485
11487 {
11488 super.OnStoreSave(ctx);
11489
11490 PlayerBase player;
11491 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11492 {
11494
11495 int itemQBIndex = -1;
11496 itemQBIndex = player.FindQuickBarEntityIndex(this);
11497 ctx.
Write(itemQBIndex);
11498 }
11499 else
11500 {
11502 }
11503
11505
11507 if (raib)
11508 {
11510 }
11511 }
11512
11513
11515 {
11516 super.AfterStoreLoad();
11517
11519 {
11521 }
11522
11524 {
11527 }
11528 }
11529
11531 {
11532 super.EEOnAfterLoad();
11533
11535 {
11537 }
11538
11541 }
11542
11544 {
11545 return false;
11546 }
11547
11548
11549
11551 {
11553 {
11554 #ifdef PLATFORM_CONSOLE
11555
11557 {
11559 if (menu)
11560 {
11562 }
11563 }
11564 #endif
11565 }
11566
11568 {
11571 }
11572
11574 {
11575 SetWeightDirty();
11577 }
11579 {
11582 }
11583
11585 {
11588 }
11590 {
11593 }
11594
11595 super.OnVariablesSynchronized();
11596 }
11597
11598
11599
11601 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11602 {
11603 if (!IsServerCheck(allow_client))
11604 return false;
11605
11607 return false;
11608
11611
11612 if (value <= (min + 0.001))
11613 value = min;
11614
11615 if (value == min)
11616 {
11617 if (destroy_config)
11618 {
11619 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11620 if (dstr)
11621 {
11623 this.Delete();
11624 return true;
11625 }
11626 }
11627 else if (destroy_forced)
11628 {
11630 this.Delete();
11631 return true;
11632 }
11633
11635 }
11636
11639
11641 {
11643
11644 if (delta)
11646 }
11647
11649
11650 return false;
11651 }
11652
11653
11655 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11656 {
11658 }
11659
11661 {
11664 }
11665
11667 {
11670 }
11671
11674 {
11675 float value_clamped = Math.Clamp(value, 0, 1);
11677 SetQuantity(result, destroy_config, destroy_forced);
11678 }
11679
11680
11683 {
11685 }
11686
11688 {
11690 }
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11702 {
11703 int slot = -1;
11704 if (GetInventory())
11705 {
11706 InventoryLocation il = new InventoryLocation;
11707 GetInventory().GetCurrentInventoryLocation(il);
11709 }
11710
11712 }
11713
11715 {
11716 float quantity_max = 0;
11717
11719 {
11720 if (attSlotID != -1)
11721 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11722
11723 if (quantity_max <= 0)
11725 }
11726
11727 if (quantity_max <= 0)
11729
11730 return quantity_max;
11731 }
11732
11734 {
11736 }
11737
11739 {
11741 }
11742
11743
11745 {
11747 }
11748
11750 {
11752 }
11753
11755 {
11757 }
11758
11759
11761 {
11762
11763 float weightEx = GetWeightEx();
11764 float special = GetInventoryAndCargoWeight();
11765 return weightEx - special;
11766 }
11767
11768
11770 {
11772 }
11773
11775 {
11777 {
11778 #ifdef DEVELOPER
11779 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11780 {
11781 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11783 }
11784 #endif
11785
11786 return GetQuantity() * GetConfigWeightModified();
11787 }
11788 else if (HasEnergyManager())
11789 {
11790 #ifdef DEVELOPER
11791 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11792 {
11793 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11794 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11795 }
11796 #endif
11797 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11798 }
11799 else
11800 {
11801 #ifdef DEVELOPER
11802 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11803 {
11804 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11805 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11806 }
11807 #endif
11808 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11809 }
11810 }
11811
11814 {
11815 int item_count = 0;
11817
11818 if (GetInventory().GetCargo() != NULL)
11819 {
11820 item_count = GetInventory().GetCargo().GetItemCount();
11821 }
11822
11823 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11824 {
11825 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11826 if (item)
11827 item_count += item.GetNumberOfItems();
11828 }
11829 return item_count;
11830 }
11831
11834 {
11835 float weight = 0;
11836 float wetness = 1;
11837 if (include_wetness)
11840 {
11841 weight = wetness * m_ConfigWeight;
11842 }
11844 {
11845 weight = 1;
11846 }
11847 return weight;
11848 }
11849
11850
11851
11853 {
11854 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11855 {
11856 GameInventory inv = GetInventory();
11857 array<EntityAI> items = new array<EntityAI>;
11859 for (int i = 0; i < items.Count(); i++)
11860 {
11862 if (item)
11863 {
11865 }
11866 }
11867 }
11868 }
11869
11870
11871
11872
11874 {
11875 float energy = 0;
11876 if (HasEnergyManager())
11877 {
11878 energy = GetCompEM().GetEnergy();
11879 }
11880 return energy;
11881 }
11882
11883
11885 {
11886 super.OnEnergyConsumed();
11887
11889 }
11890
11892 {
11893 super.OnEnergyAdded();
11894
11896 }
11897
11898
11900 {
11901 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11902 {
11904 {
11905 float energy_0to1 = GetCompEM().GetEnergy0To1();
11907 }
11908 }
11909 }
11910
11911
11913 {
11914 return ConfigGetFloat("heatIsolation");
11915 }
11916
11918 {
11920 }
11921
11923 {
11924 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11925 if (
GetGame().ConfigIsExisting(paramPath))
11927
11928 return 0.0;
11929 }
11930
11932 {
11933 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11934 if (
GetGame().ConfigIsExisting(paramPath))
11936
11937 return 0.0;
11938 }
11939
11940 override void SetWet(
float value,
bool allow_client =
false)
11941 {
11942 if (!IsServerCheck(allow_client))
11943 return;
11944
11947
11949
11950 m_VarWet = Math.Clamp(value, min, max);
11951
11953 {
11956 }
11957 }
11958
11959 override void AddWet(
float value)
11960 {
11962 }
11963
11965 {
11967 }
11968
11970 {
11972 }
11973
11975 {
11977 }
11978
11980 {
11982 }
11983
11985 {
11987 }
11988
11989 override void OnWetChanged(
float newVal,
float oldVal)
11990 {
11993 if (newLevel != oldLevel)
11994 {
11996 }
11997 }
11998
12000 {
12001 SetWeightDirty();
12002 }
12003
12005 {
12006 return GetWetLevelInternal(
m_VarWet);
12007 }
12008
12009
12010
12012 {
12014 }
12015
12017 {
12019 }
12020
12022 {
12024 }
12025
12027 {
12029 }
12030
12031
12032
12034 {
12035 if (ConfigIsExisting("itemModelLength"))
12036 {
12037 return ConfigGetFloat("itemModelLength");
12038 }
12039 return 0;
12040 }
12041
12043 {
12044 if (ConfigIsExisting("itemAttachOffset"))
12045 {
12046 return ConfigGetFloat("itemAttachOffset");
12047 }
12048 return 0;
12049 }
12050
12051 override void SetCleanness(
int value,
bool allow_client =
false)
12052 {
12053 if (!IsServerCheck(allow_client))
12054 return;
12055
12057
12059
12062 }
12063
12065 {
12067 }
12068
12070 {
12071 return true;
12072 }
12073
12074
12075
12076
12078 {
12080 }
12081
12083 {
12085 }
12086
12087
12088
12089
12090 override void SetColor(
int r,
int g,
int b,
int a)
12091 {
12097 }
12099 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12100 {
12105 }
12106
12108 {
12110 }
12111
12114 {
12115 int r,g,b,a;
12117 r = r/255;
12118 g = g/255;
12119 b = b/255;
12120 a = a/255;
12121 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12122 }
12123
12124
12125
12126 override void SetLiquidType(
int value,
bool allow_client =
false)
12127 {
12128 if (!IsServerCheck(allow_client))
12129 return;
12130
12135 }
12136
12138 {
12139 return ConfigGetInt("varLiquidTypeInit");
12140 }
12141
12143 {
12145 }
12146
12148 {
12150 SetFrozen(false);
12151 }
12152
12155 {
12156 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12157 }
12158
12159
12162 {
12163 PlayerBase nplayer;
12164 if (PlayerBase.CastTo(nplayer, player))
12165 {
12167
12168 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12169 }
12170 }
12171
12172
12175 {
12176 PlayerBase nplayer;
12177 if (PlayerBase.CastTo(nplayer,player))
12178 {
12179
12180 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12181
12182 }
12183
12184
12185 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12186
12187
12188 if (HasEnergyManager())
12189 {
12190 GetCompEM().UpdatePlugState();
12191 }
12192 }
12193
12194
12196 {
12197 super.OnPlacementStarted(player);
12198
12200 }
12201
12202 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12203 {
12205 {
12206 m_AdminLog.OnPlacementComplete(player,
this);
12207 }
12208
12209 super.OnPlacementComplete(player, position, orientation);
12210 }
12211
12212
12213
12214
12215
12217 {
12219 {
12220 return true;
12221 }
12222 else
12223 {
12224 return false;
12225 }
12226 }
12227
12228
12230 {
12232 {
12234 }
12235 }
12236
12237
12239 {
12241 }
12242
12244 {
12246 }
12247
12248 override void InsertAgent(
int agent,
float count = 1)
12249 {
12250 if (count < 1)
12251 return;
12252
12254 }
12255
12258 {
12260 }
12261
12262
12264 {
12266 }
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12310 {
12312 return false;
12313 return true;
12314 }
12315
12317 {
12318
12320 }
12321
12322
12325 {
12326 super.CheckForRoofLimited(timeTresholdMS);
12327
12329 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12330 {
12331 m_PreviousRoofTestTime = time;
12332 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12333 }
12334 }
12335
12336
12338 {
12340 {
12341 return 0;
12342 }
12343
12344 if (GetInventory().GetAttachmentSlotsCount() != 0)
12345 {
12346 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12347 if (filter)
12348 return filter.GetProtectionLevel(type, false, system);
12349 else
12350 return 0;
12351 }
12352
12353 string subclassPath, entryName;
12354
12355 switch (type)
12356 {
12358 entryName = "biological";
12359 break;
12361 entryName = "chemical";
12362 break;
12363 default:
12364 entryName = "biological";
12365 break;
12366 }
12367
12368 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12369
12371 }
12372
12373
12374
12377 {
12378 if (!IsMagazine())
12380
12382 }
12383
12384
12385
12386
12387
12392 {
12393 return true;
12394 }
12395
12397 {
12399 }
12400
12401
12402
12403
12404
12406 {
12407 if (parent)
12408 {
12409 if (parent.IsInherited(DayZInfected))
12410 return true;
12411
12412 if (!parent.IsRuined())
12413 return true;
12414 }
12415
12416 return true;
12417 }
12418
12420 {
12421 if (!super.CanPutAsAttachment(parent))
12422 {
12423 return false;
12424 }
12425
12426 if (!IsRuined() && !parent.IsRuined())
12427 {
12428 return true;
12429 }
12430
12431 return false;
12432 }
12433
12435 {
12436
12437
12438
12439
12440 return super.CanReceiveItemIntoCargo(item);
12441 }
12442
12444 {
12445
12446
12447
12448
12449 GameInventory attachmentInv = attachment.GetInventory();
12451 {
12452 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12453 return false;
12454 }
12455
12456 InventoryLocation loc = new InventoryLocation();
12457 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12458 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12459 return false;
12460
12461 return super.CanReceiveAttachment(attachment, slotId);
12462 }
12463
12465 {
12466 if (!super.CanReleaseAttachment(attachment))
12467 return false;
12468
12469 return GetInventory().AreChildrenAccessible();
12470 }
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12493 {
12494 int id = muzzle_owner.GetMuzzleID();
12495 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12496
12497 if (WPOF_array)
12498 {
12499 for (int i = 0; i < WPOF_array.Count(); i++)
12500 {
12501 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12502
12503 if (WPOF)
12504 {
12505 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12506 }
12507 }
12508 }
12509 }
12510
12511
12513 {
12514 int id = muzzle_owner.GetMuzzleID();
12516
12517 if (WPOBE_array)
12518 {
12519 for (int i = 0; i < WPOBE_array.Count(); i++)
12520 {
12521 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12522
12523 if (WPOBE)
12524 {
12525 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12526 }
12527 }
12528 }
12529 }
12530
12531
12533 {
12534 int id = muzzle_owner.GetMuzzleID();
12535 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12536
12537 if (WPOOH_array)
12538 {
12539 for (int i = 0; i < WPOOH_array.Count(); i++)
12540 {
12541 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12542
12543 if (WPOOH)
12544 {
12545 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12546 }
12547 }
12548 }
12549 }
12550
12551
12553 {
12554 int id = muzzle_owner.GetMuzzleID();
12555 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12556
12557 if (WPOOH_array)
12558 {
12559 for (int i = 0; i < WPOOH_array.Count(); i++)
12560 {
12561 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12562
12563 if (WPOOH)
12564 {
12565 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12566 }
12567 }
12568 }
12569 }
12570
12571
12573 {
12574 int id = muzzle_owner.GetMuzzleID();
12575 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12576
12577 if (WPOOH_array)
12578 {
12579 for (int i = 0; i < WPOOH_array.Count(); i++)
12580 {
12581 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12582
12583 if (WPOOH)
12584 {
12585 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12586 }
12587 }
12588 }
12589 }
12590
12591
12592
12594 {
12596 {
12597 return true;
12598 }
12599
12600 return false;
12601 }
12602
12604 {
12606 {
12607 return true;
12608 }
12609
12610 return false;
12611 }
12612
12614 {
12616 {
12617 return true;
12618 }
12619
12620 return false;
12621 }
12622
12624 {
12625 return false;
12626 }
12627
12630 {
12631 return UATimeSpent.DEFAULT_DEPLOY;
12632 }
12633
12634
12635
12636
12638 {
12640 SetSynchDirty();
12641 }
12642
12644 {
12646 }
12647
12648
12650 {
12651 return false;
12652 }
12653
12656 {
12657 string att_type = "None";
12658
12659 if (ConfigIsExisting("soundAttType"))
12660 {
12661 att_type = ConfigGetString("soundAttType");
12662 }
12663
12665 }
12666
12668 {
12670 }
12671
12672
12673
12674
12675
12679
12681 {
12684
12686 }
12687
12688
12690 {
12692 return;
12693
12695
12698
12701
12702 SoundParameters params = new SoundParameters();
12706 }
12707
12708
12710 {
12712 return;
12713
12715 SetSynchDirty();
12716
12719 }
12720
12721
12723 {
12725 return;
12726
12728 SetSynchDirty();
12729
12732 }
12733
12735 {
12737 }
12738
12740 {
12742 }
12743
12746 {
12747 if (!
GetGame().IsDedicatedServer())
12748 {
12749 if (ConfigIsExisting("attachSoundSet"))
12750 {
12751 string cfg_path = "";
12752 string soundset = "";
12753 string type_name =
GetType();
12754
12757 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12758 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12759
12760 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12761 {
12762 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12763 {
12764 if (cfg_slot_array[i] == slot_type)
12765 {
12766 soundset = cfg_soundset_array[i];
12767 break;
12768 }
12769 }
12770 }
12771
12772 if (soundset != "")
12773 {
12774 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12776 }
12777 }
12778 }
12779 }
12780
12782 {
12783
12784 }
12785
12786 void OnApply(PlayerBase player);
12787
12789 {
12790 return 1.0;
12791 };
12792
12794 {
12796 }
12797
12799 {
12801 }
12802
12804
12806 {
12807 SetDynamicPhysicsLifeTime(0.01);
12809 }
12810
12812 {
12813 array<string> zone_names = new array<string>;
12814 GetDamageZones(zone_names);
12815 for (int i = 0; i < zone_names.Count(); i++)
12816 {
12817 SetHealthMax(zone_names.Get(i),"Health");
12818 }
12819 SetHealthMax("","Health");
12820 }
12821
12824 {
12825 float global_health = GetHealth01("","Health");
12826 array<string> zones = new array<string>;
12827 GetDamageZones(zones);
12828
12829 for (int i = 0; i < zones.Count(); i++)
12830 {
12831 SetHealth01(zones.Get(i),"Health",global_health);
12832 }
12833 }
12834
12837 {
12838 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12839 }
12840
12842 {
12843 if (!hasRootAsPlayer)
12844 {
12845 if (refParentIB)
12846 {
12847
12848 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12849 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12850
12851 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12852 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12853
12856 }
12857 else
12858 {
12859
12862 }
12863 }
12864 }
12865
12867 {
12869 {
12870 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12871 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12872 {
12873 float heatPermCoef = 1.0;
12875 while (ent)
12876 {
12877 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12878 ent = ent.GetHierarchyParent();
12879 }
12880
12881 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12882 }
12883 }
12884 }
12885
12887 {
12888
12889 EntityAI parent = GetHierarchyParent();
12890 if (!parent)
12891 {
12892 hasParent = false;
12893 hasRootAsPlayer = false;
12894 }
12895 else
12896 {
12897 hasParent = true;
12898 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12899 refParentIB =
ItemBase.Cast(parent);
12900 }
12901 }
12902
12903 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12904 {
12905
12906 }
12907
12909 {
12910
12911 return false;
12912 }
12913
12915 {
12916
12917
12918 return false;
12919 }
12920
12922 {
12923
12924 return false;
12925 }
12926
12929 {
12930 return !GetIsFrozen() &&
IsOpen();
12931 }
12932
12934 {
12935 bool hasParent = false, hasRootAsPlayer = false;
12937
12938 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12939 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12940
12941 if (wwtu || foodDecay)
12942 {
12946
12947 if (processWetness || processTemperature || processDecay)
12948 {
12950
12951 if (processWetness)
12952 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12953
12954 if (processTemperature)
12956
12957 if (processDecay)
12958 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12959 }
12960 }
12961 }
12962
12965 {
12967 }
12968
12970 {
12973
12974 return super.GetTemperatureFreezeThreshold();
12975 }
12976
12978 {
12981
12982 return super.GetTemperatureThawThreshold();
12983 }
12984
12986 {
12989
12990 return super.GetItemOverheatThreshold();
12991 }
12992
12994 {
12996 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12997
12998 return super.GetTemperatureFreezeTime();
12999 }
13000
13002 {
13004 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13005
13006 return super.GetTemperatureThawTime();
13007 }
13008
13013
13015 {
13016 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13017 }
13018
13020 {
13021 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13022 }
13023
13026 {
13028 }
13029
13031 {
13033 }
13034
13036 {
13038 }
13039
13042 {
13043 return null;
13044 }
13045
13048 {
13049 return false;
13050 }
13051
13053 {
13055 {
13058 if (!trg)
13059 {
13061 explosive = this;
13062 }
13063
13064 explosive.PairRemote(trg);
13066
13067 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13068 trg.SetPersistentPairID(persistentID);
13069 explosive.SetPersistentPairID(persistentID);
13070
13071 return true;
13072 }
13073 return false;
13074 }
13075
13078 {
13079 float ret = 1.0;
13082 ret *= GetHealth01();
13083
13084 return ret;
13085 }
13086
13087 #ifdef DEVELOPER
13088 override void SetDebugItem()
13089 {
13090 super.SetDebugItem();
13091 _itemBase = this;
13092 }
13093
13095 {
13096 string text = super.GetDebugText();
13097
13099 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13100
13101 return text;
13102 }
13103 #endif
13104
13106 {
13107 return true;
13108 }
13109
13111
13113
13115 {
13118 }
13119
13120
13128
13144}
13145
13147{
13149 if (entity)
13150 {
13151 bool is_item = entity.IsInherited(
ItemBase);
13152 if (is_item && full_quantity)
13153 {
13156 }
13157 }
13158 else
13159 {
13161 return NULL;
13162 }
13163 return entity;
13164}
13165
13167{
13168 if (item)
13169 {
13170 if (health > 0)
13171 item.SetHealth("", "", health);
13172
13173 if (item.CanHaveTemperature())
13174 {
13176 if (item.CanFreeze())
13177 item.SetFrozen(false);
13178 }
13179
13180 if (item.HasEnergyManager())
13181 {
13182 if (quantity >= 0)
13183 {
13184 item.GetCompEM().SetEnergy0To1(quantity);
13185 }
13186 else
13187 {
13189 }
13190 }
13191 else if (item.IsMagazine())
13192 {
13193 Magazine mag = Magazine.Cast(item);
13194 if (quantity >= 0)
13195 {
13196 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13197 }
13198 else
13199 {
13201 }
13202
13203 }
13204 else
13205 {
13206 if (quantity >= 0)
13207 {
13208 item.SetQuantityNormalized(quantity, false);
13209 }
13210 else
13211 {
13213 }
13214
13215 }
13216 }
13217}
13218
13219#ifdef DEVELOPER
13221#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.