8373{
8375 {
8376 return true;
8377 }
8378};
8379
8380
8381
8383{
8387
8389
8392
8393
8394
8395
8396
8405
8411
8416
8421
8442 protected bool m_IsResultOfSplit
8443
8445
8450
8451
8452
8454
8458
8459
8460
8462
8465
8466
8467
8473
8474
8482
8485
8486
8488
8489
8491
8492
8497
8498
8503
8504
8506
8507
8509 {
8514
8515 if (!
GetGame().IsDedicatedServer())
8516 {
8518 {
8520
8522 {
8524 }
8525 }
8526
8529 }
8530
8531 m_OldLocation = null;
8532
8534 {
8536 }
8537
8538 if (ConfigIsExisting("headSelectionsToHide"))
8539 {
8542 }
8543
8545 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8546 {
8548 }
8549
8551
8552 m_IsResultOfSplit = false;
8553
8555 }
8556
8558 {
8559 super.InitItemVariables();
8560
8566 m_Count = ConfigGetInt(
"count");
8567
8570
8575
8578
8583
8595
8599
8600
8603 if (ConfigIsExisting("canBeSplit"))
8604 {
8607 }
8608
8610 if (ConfigIsExisting("itemBehaviour"))
8612
8613
8616 RegisterNetSyncVariableInt("m_VarLiquidType");
8617 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8618
8619 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8620 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8621 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8622
8623 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8624 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8625 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8626 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8627
8628 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8629 RegisterNetSyncVariableBool("m_IsTakeable");
8630 RegisterNetSyncVariableBool("m_IsHologram");
8631
8634 {
8637 }
8638
8640
8642 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8644
8645 }
8646
8648 {
8650 }
8651
8653 {
8656 {
8661 }
8662 }
8663
8664 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8665 {
8667 {
8670 }
8671
8673 }
8674
8676 {
8682 }
8683
8685
8687 {
8689
8690 if (!action)
8691 {
8692 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8693 return;
8694 }
8695
8697 if (!ai)
8698 {
8700 return;
8701 }
8702
8704 if (!action_array)
8705 {
8706 action_array = new array<ActionBase_Basic>;
8708 }
8709 if (LogManager.IsActionLogEnable())
8710 {
8711 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8712 }
8713
8714 if (action_array.Find(action) != -1)
8715 {
8716 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8717 }
8718 else
8719 {
8720 action_array.Insert(action);
8721 }
8722 }
8723
8725 {
8727 ActionBase action = player.GetActionManager().GetAction(actionName);
8730
8731 if (action_array)
8732 {
8733 action_array.RemoveItem(action);
8734 }
8735 }
8736
8737
8738
8740 {
8741 ActionOverrideData overrideData = new ActionOverrideData();
8745
8747 if (!actionMap)
8748 {
8751 }
8752
8753 actionMap.Insert(this.
Type(), overrideData);
8754
8755 }
8756
8758
8760
8761
8763 {
8766
8769
8770 string config_to_search = "CfgVehicles";
8771 string muzzle_owner_config;
8772
8774 {
8775 if (IsInherited(Weapon))
8776 config_to_search = "CfgWeapons";
8777
8778 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8779
8780 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8781
8783
8784 if (config_OnFire_subclass_count > 0)
8785 {
8786 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8787
8788 for (int i = 0; i < config_OnFire_subclass_count; i++)
8789 {
8790 string particle_class = "";
8792 string config_OnFire_entry = config_OnFire_class + particle_class;
8793 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8794 WPOF_array.Insert(WPOF);
8795 }
8796
8797
8799 }
8800 }
8801
8803 {
8804 config_to_search = "CfgWeapons";
8805 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8806
8807 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8808
8810
8811 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8812 {
8813 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8814
8815 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8816 {
8817 string particle_class2 = "";
8819 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8820 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8821 WPOBE_array.Insert(WPOBE);
8822 }
8823
8824
8826 }
8827 }
8828 }
8829
8830
8832 {
8835
8837 {
8838 string config_to_search = "CfgVehicles";
8839
8840 if (IsInherited(Weapon))
8841 config_to_search = "CfgWeapons";
8842
8843 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8844 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8845
8846 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8847 {
8848
8850
8852 {
8854 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8856 return;
8857 }
8858
8861
8862
8863
8865 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8866
8867 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8868 {
8869 string particle_class = "";
8871 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8873
8874 if (entry_type == CT_CLASS)
8875 {
8876 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8877 WPOOH_array.Insert(WPOF);
8878 }
8879 }
8880
8881
8883 }
8884 }
8885 }
8886
8888 {
8890 }
8891
8893 {
8895 {
8897
8900
8903
8904 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8905 }
8906 }
8907
8909 {
8911 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8912
8914 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8915
8917 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8918
8920 {
8922 }
8923 }
8924
8926 {
8928 }
8929
8931 {
8934 else
8936
8938 {
8941 }
8942 else
8943 {
8946
8949 }
8950
8952 }
8953
8955 {
8957 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8958 }
8959
8961 {
8963 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8965 }
8966
8968 {
8970 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8971 }
8972
8974 {
8977
8978 OverheatingParticle OP = new OverheatingParticle();
8983
8985 }
8986
8988 {
8991
8992 return -1;
8993 }
8994
8996 {
8998 {
9001
9002 for (int i = count; i > 0; --i)
9003 {
9004 int id = i - 1;
9007
9010
9011 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9012 {
9013 if (p)
9014 {
9017 }
9018 }
9019 }
9020 }
9021 }
9022
9024 {
9026 {
9028 {
9029 int id = i - 1;
9031
9032 if (OP)
9033 {
9035
9036 if (p)
9037 {
9039 }
9040
9041 delete OP;
9042 }
9043 }
9044
9047 }
9048 }
9049
9052 {
9053 return 0.0;
9054 }
9055
9056
9058 {
9059 return 250;
9060 }
9061
9063 {
9064 return 0;
9065 }
9066
9069 {
9071 return true;
9072
9073 return false;
9074 }
9075
9078 {
9081
9083 {
9085 }
9086 else
9087 {
9088
9090 }
9091
9093 }
9094
9101 {
9102 return -1;
9103 }
9104
9105
9106
9107
9109 {
9111 {
9113 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9114
9115 if (r_index >= 0)
9116 {
9117 InventoryLocation r_il = new InventoryLocation;
9118 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9119
9120 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9123 {
9124 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9125 }
9127 {
9128 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9129 }
9130
9131 }
9132
9133 player.GetHumanInventory().ClearUserReservedLocation(this);
9134 }
9135
9138 }
9139
9140
9141
9142
9144 {
9145 return ItemBase.m_DebugActionsMask;
9146 }
9147
9149 {
9150 return ItemBase.m_DebugActionsMask & mask;
9151 }
9152
9154 {
9155 ItemBase.m_DebugActionsMask = mask;
9156 }
9157
9159 {
9160 ItemBase.m_DebugActionsMask |= mask;
9161 }
9162
9164 {
9165 ItemBase.m_DebugActionsMask &= ~mask;
9166 }
9167
9169 {
9171 {
9173 }
9174 else
9175 {
9177 }
9178 }
9179
9180
9182 {
9183 if (GetEconomyProfile())
9184 {
9185 float q_max = GetEconomyProfile().GetQuantityMax();
9186 if (q_max > 0)
9187 {
9188 float q_min = GetEconomyProfile().GetQuantityMin();
9189 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9190
9192 {
9193 ComponentEnergyManager comp = GetCompEM();
9195 {
9197 }
9198 }
9200 {
9202
9203 }
9204
9205 }
9206 }
9207 }
9208
9211 {
9212 EntityAI parent = GetHierarchyParent();
9213
9214 if (parent)
9215 {
9216 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9217 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9218 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9219 }
9220 }
9221
9224 {
9225 EntityAI parent = GetHierarchyParent();
9226
9227 if (parent)
9228 {
9229 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9230 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9231 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9232 }
9233 }
9234
9236 {
9237
9238
9239
9240
9242
9244 {
9245 if (ScriptInputUserData.CanStoreInputUserData())
9246 {
9247 ScriptInputUserData ctx = new ScriptInputUserData;
9253 ctx.
Write(use_stack_max);
9256
9258 {
9259 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9260 }
9261 }
9262 }
9263 else if (!
GetGame().IsMultiplayer())
9264 {
9266 }
9267 }
9268
9270 {
9272 }
9273
9275 {
9277 }
9278
9280 {
9282 }
9283
9285 {
9286
9287 return false;
9288 }
9289
9291 {
9292 return false;
9293 }
9294
9298 {
9299 return false;
9300 }
9301
9303 {
9304 return "";
9305 }
9306
9308
9310 {
9311 return false;
9312 }
9313
9315 {
9316 return true;
9317 }
9318
9319
9320
9322 {
9323 return true;
9324 }
9325
9327 {
9328 return true;
9329 }
9330
9332 {
9333 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9335 }
9336
9338 {
9340 }
9341
9343 {
9345 if (!is_being_placed)
9347 SetSynchDirty();
9348 }
9349
9350
9352
9354 {
9356 }
9357
9359 {
9361 }
9362
9364 {
9365 return 1;
9366 }
9367
9369 {
9370 return false;
9371 }
9372
9374 {
9376 SetSynchDirty();
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
9408
9409
9410
9411
9412
9414 {
9415 super.OnMovedInsideCargo(container);
9416
9417 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9418 }
9419
9420 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9421 {
9422 super.EEItemLocationChanged(oldLoc,newLoc);
9423
9424 PlayerBase new_player = null;
9425 PlayerBase old_player = null;
9426
9427 if (newLoc.GetParent())
9428 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9429
9430 if (oldLoc.GetParent())
9431 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9432
9434 {
9435 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9436
9437 if (r_index >= 0)
9438 {
9439 InventoryLocation r_il = new InventoryLocation;
9440 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9441
9442 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9445 {
9446 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9447 }
9449 {
9450 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9451 }
9452
9453 }
9454 }
9455
9457 {
9458 if (new_player)
9459 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9460
9461 if (new_player == old_player)
9462 {
9463
9464 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9465 {
9467 {
9468 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9469 {
9470 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9471 }
9472 }
9473 else
9474 {
9475 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9476 }
9477 }
9478
9479 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9480 {
9481 int type = oldLoc.GetType();
9483 {
9484 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9485 }
9487 {
9488 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9489 }
9490 }
9491 if (!m_OldLocation)
9492 {
9493 m_OldLocation = new InventoryLocation;
9494 }
9495 m_OldLocation.Copy(oldLoc);
9496 }
9497 else
9498 {
9499 if (m_OldLocation)
9500 {
9501 m_OldLocation.Reset();
9502 }
9503 }
9504
9506 }
9507 else
9508 {
9509 if (new_player)
9510 {
9511 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9512 if (res_index >= 0)
9513 {
9514 InventoryLocation il = new InventoryLocation;
9515 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9517 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9520 {
9521 il.
GetParent().GetOnReleaseLock().Invoke(it);
9522 }
9524 {
9526 }
9527
9528 }
9529 }
9531 {
9532
9534 }
9535
9536 if (m_OldLocation)
9537 {
9538 m_OldLocation.Reset();
9539 }
9540 }
9541 }
9542
9543 override void EOnContact(IEntity other, Contact extra)
9544 {
9546 {
9547 int liquidType = -1;
9549 if (impactSpeed > 0.0)
9550 {
9552 #ifndef SERVER
9554 #else
9556 SetSynchDirty();
9557 #endif
9559 }
9560 }
9561
9562 #ifdef SERVER
9563 if (GetCompEM() && GetCompEM().IsPlugged())
9564 {
9565 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9566 GetCompEM().UnplugThis();
9567 }
9568 #endif
9569 }
9570
9572
9574 {
9576 }
9577
9579 {
9580
9581 }
9582
9584 {
9585 super.OnItemLocationChanged(old_owner, new_owner);
9586
9587 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9588 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9589
9590 if (!relatedPlayer && playerNew)
9591 relatedPlayer = playerNew;
9592
9593 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9594 {
9596 if (actionMgr)
9597 {
9598 ActionBase currentAction = actionMgr.GetRunningAction();
9599 if (currentAction)
9601 }
9602 }
9603
9604 Man ownerPlayerOld = null;
9605 Man ownerPlayerNew = null;
9606
9607 if (old_owner)
9608 {
9609 if (old_owner.
IsMan())
9610 {
9611 ownerPlayerOld = Man.Cast(old_owner);
9612 }
9613 else
9614 {
9615 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9616 }
9617 }
9618 else
9619 {
9621 {
9623
9624 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9625 {
9626 GetCompEM().UnplugThis();
9627 }
9628 }
9629 }
9630
9631 if (new_owner)
9632 {
9633 if (new_owner.
IsMan())
9634 {
9635 ownerPlayerNew = Man.Cast(new_owner);
9636 }
9637 else
9638 {
9639 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9640 }
9641 }
9642
9643 if (ownerPlayerOld != ownerPlayerNew)
9644 {
9645 if (ownerPlayerOld)
9646 {
9647 array<EntityAI> subItemsExit = new array<EntityAI>;
9649 for (int i = 0; i < subItemsExit.Count(); i++)
9650 {
9653 }
9654 }
9655
9656 if (ownerPlayerNew)
9657 {
9658 array<EntityAI> subItemsEnter = new array<EntityAI>;
9660 for (int j = 0; j < subItemsEnter.Count(); j++)
9661 {
9664 }
9665 }
9666 }
9667 else if (ownerPlayerNew != null)
9668 {
9669 PlayerBase nplayer;
9670 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9671 {
9672 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9674 for (int k = 0; k < subItemsUpdate.Count(); k++)
9675 {
9677 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9678 }
9679 }
9680 }
9681
9682 if (old_owner)
9683 old_owner.OnChildItemRemoved(this);
9684 if (new_owner)
9685 new_owner.OnChildItemReceived(this);
9686 }
9687
9688
9690 {
9691 super.EEDelete(parent);
9692 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9693 if (player)
9694 {
9696
9697 if (player.IsAlive())
9698 {
9699 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9700 if (r_index >= 0)
9701 {
9702 InventoryLocation r_il = new InventoryLocation;
9703 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9704
9705 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9708 {
9709 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9710 }
9712 {
9713 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9714 }
9715
9716 }
9717
9718 player.RemoveQuickBarEntityShortcut(this);
9719 }
9720 }
9721 }
9722
9724 {
9725 super.EEKilled(killer);
9726
9729 {
9730 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9731 {
9732 if (IsMagazine())
9733 {
9734 if (Magazine.Cast(this).GetAmmoCount() > 0)
9735 {
9737 }
9738 }
9739 else
9740 {
9742 }
9743 }
9744 }
9745 }
9746
9748 {
9749 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9750
9751 super.OnWasAttached(parent, slot_id);
9752
9755
9757 }
9758
9760 {
9761 super.OnWasDetached(parent, slot_id);
9762
9765 }
9766
9768 {
9769 int idx;
9772
9773 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9774 if (inventory_slots.Count() < 1)
9775 {
9776 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9777 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9778 }
9779 else
9780 {
9781 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9782 }
9783
9784 idx = inventory_slots.Find(slot);
9785 if (idx < 0)
9786 return "";
9787
9788 return attach_types.Get(idx);
9789 }
9790
9792 {
9793 int idx = -1;
9794 string slot;
9795
9798
9799 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9800 if (inventory_slots.Count() < 1)
9801 {
9802 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9803 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9804 }
9805 else
9806 {
9807 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9808 if (detach_types.Count() < 1)
9809 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9810 }
9811
9812 for (int i = 0; i < inventory_slots.Count(); i++)
9813 {
9814 slot = inventory_slots.Get(i);
9815 }
9816
9817 if (slot != "")
9818 {
9819 if (detach_types.Count() == 1)
9820 idx = 0;
9821 else
9822 idx = inventory_slots.Find(slot);
9823 }
9824 if (idx < 0)
9825 return "";
9826
9827 return detach_types.Get(idx);
9828 }
9829
9831 {
9832
9834
9835
9836 float min_time = 1;
9837 float max_time = 3;
9838 float delay = Math.RandomFloat(min_time, max_time);
9839
9840 explode_timer.Run(delay, this, "DoAmmoExplosion");
9841 }
9842
9844 {
9845 Magazine magazine = Magazine.Cast(this);
9846 int pop_sounds_count = 6;
9847 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9848
9849
9850 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9851 string sound_name = pop_sounds[ sound_idx ];
9853
9854
9855 magazine.ServerAddAmmoCount(-1);
9856
9857
9858 float min_temp_to_explode = 100;
9859
9860 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9861 {
9863 }
9864 }
9865
9866
9867 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9868 {
9869 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9870
9871 const int CHANCE_DAMAGE_CARGO = 4;
9872 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9873 const int CHANCE_DAMAGE_NOTHING = 2;
9874
9876 {
9877 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9878 int chances;
9879 int rnd;
9880
9881 if (GetInventory().GetCargo())
9882 {
9883 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9884 rnd = Math.RandomInt(0,chances);
9885
9886 if (rnd < CHANCE_DAMAGE_CARGO)
9887 {
9889 }
9890 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9891 {
9893 }
9894 }
9895 else
9896 {
9897 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9898 rnd = Math.RandomInt(0,chances);
9899
9900 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9901 {
9903 }
9904 }
9905 }
9906 }
9907
9909 {
9910 if (GetInventory().GetCargo())
9911 {
9912 int item_count = GetInventory().GetCargo().GetItemCount();
9913 if (item_count > 0)
9914 {
9915 int random_pick = Math.RandomInt(0, item_count);
9917 if (!item.IsExplosive())
9918 {
9919 item.AddHealth("","",damage);
9920 return true;
9921 }
9922 }
9923 }
9924 return false;
9925 }
9926
9928 {
9929 int attachment_count = GetInventory().AttachmentCount();
9930 if (attachment_count > 0)
9931 {
9932 int random_pick = Math.RandomInt(0, attachment_count);
9933 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9934 if (!attachment.IsExplosive())
9935 {
9936 attachment.AddHealth("","",damage);
9937 return true;
9938 }
9939 }
9940 return false;
9941 }
9942
9944 {
9946 }
9947
9949 {
9951 return GetInventory().CanRemoveEntity();
9952
9953 return false;
9954 }
9955
9957 {
9959 return;
9960
9962 {
9963 if (ScriptInputUserData.CanStoreInputUserData())
9964 {
9965 ScriptInputUserData ctx = new ScriptInputUserData;
9970 ctx.
Write(destination_entity);
9974 }
9975 }
9976 else if (!
GetGame().IsMultiplayer())
9977 {
9979 }
9980 }
9981
9983 {
9985 return;
9986
9987 float split_quantity_new;
9991 InventoryLocation loc = new InventoryLocation;
9992
9993 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9994 {
9996 split_quantity_new = stack_max;
9997 else
9999
10000 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10001 if (new_item)
10002 {
10003 new_item.SetResultOfSplit(true);
10004 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10006 new_item.SetQuantity(split_quantity_new);
10007 }
10008 }
10009 else if (destination_entity && slot_id == -1)
10010 {
10011 if (quantity > stack_max)
10012 split_quantity_new = stack_max;
10013 else
10014 split_quantity_new = quantity;
10015
10017 {
10020 }
10021
10022 if (new_item)
10023 {
10024 new_item.SetResultOfSplit(true);
10025 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10027 new_item.SetQuantity(split_quantity_new);
10028 }
10029 }
10030 else
10031 {
10032 if (stack_max != 0)
10033 {
10035 {
10037 }
10038
10039 if (split_quantity_new == 0)
10040 {
10041 if (!
GetGame().IsMultiplayer())
10042 player.PhysicalPredictiveDropItem(this);
10043 else
10044 player.ServerDropEntity(this);
10045 return;
10046 }
10047
10049
10050 if (new_item)
10051 {
10052 new_item.SetResultOfSplit(true);
10053 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10055 new_item.SetQuantity(stack_max);
10056 new_item.PlaceOnSurface();
10057 }
10058 }
10059 }
10060 }
10061
10063 {
10065 return;
10066
10067 float split_quantity_new;
10071 InventoryLocation loc = new InventoryLocation;
10072
10073 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10074 {
10076 split_quantity_new = stack_max;
10077 else
10079
10080 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10081 if (new_item)
10082 {
10083 new_item.SetResultOfSplit(true);
10084 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10086 new_item.SetQuantity(split_quantity_new);
10087 }
10088 }
10089 else if (destination_entity && slot_id == -1)
10090 {
10091 if (quantity > stack_max)
10092 split_quantity_new = stack_max;
10093 else
10094 split_quantity_new = quantity;
10095
10097 {
10100 }
10101
10102 if (new_item)
10103 {
10104 new_item.SetResultOfSplit(true);
10105 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10107 new_item.SetQuantity(split_quantity_new);
10108 }
10109 }
10110 else
10111 {
10112 if (stack_max != 0)
10113 {
10115 {
10117 }
10118
10120
10121 if (new_item)
10122 {
10123 new_item.SetResultOfSplit(true);
10124 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10126 new_item.SetQuantity(stack_max);
10127 new_item.PlaceOnSurface();
10128 }
10129 }
10130 }
10131 }
10132
10134 {
10136 return;
10137
10139 {
10140 if (ScriptInputUserData.CanStoreInputUserData())
10141 {
10142 ScriptInputUserData ctx = new ScriptInputUserData;
10147 dst.WriteToContext(ctx);
10149 }
10150 }
10151 else if (!
GetGame().IsMultiplayer())
10152 {
10154 }
10155 }
10156
10158 {
10160 return;
10161
10163 {
10164 if (ScriptInputUserData.CanStoreInputUserData())
10165 {
10166 ScriptInputUserData ctx = new ScriptInputUserData;
10171 ctx.
Write(destination_entity);
10177 }
10178 }
10179 else if (!
GetGame().IsMultiplayer())
10180 {
10182 }
10183 }
10184
10186 {
10188 }
10189
10191 {
10193 return this;
10194
10196 float split_quantity_new;
10198 if (dst.IsValid())
10199 {
10200 int slot_id = dst.GetSlot();
10202
10203 if (quantity > stack_max)
10204 split_quantity_new = stack_max;
10205 else
10206 split_quantity_new = quantity;
10207
10209
10210 if (new_item)
10211 {
10212 new_item.SetResultOfSplit(true);
10213 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10216 }
10217
10218 return new_item;
10219 }
10220
10221 return null;
10222 }
10223
10225 {
10227 return;
10228
10230 float split_quantity_new;
10232 if (destination_entity)
10233 {
10235 if (quantity > stackable)
10236 split_quantity_new = stackable;
10237 else
10238 split_quantity_new = quantity;
10239
10240 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10241 if (new_item)
10242 {
10243 new_item.SetResultOfSplit(true);
10244 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10246 new_item.SetQuantity(split_quantity_new);
10247 }
10248 }
10249 }
10250
10252 {
10254 return;
10255
10257 {
10258 if (ScriptInputUserData.CanStoreInputUserData())
10259 {
10260 ScriptInputUserData ctx = new ScriptInputUserData;
10265 ItemBase destination_entity =
this;
10266 ctx.
Write(destination_entity);
10270 }
10271 }
10272 else if (!
GetGame().IsMultiplayer())
10273 {
10275 }
10276 }
10277
10279 {
10281 return;
10282
10284 float split_quantity_new;
10286 if (player)
10287 {
10289 if (quantity > stackable)
10290 split_quantity_new = stackable;
10291 else
10292 split_quantity_new = quantity;
10293
10294 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10295 new_item =
ItemBase.Cast(in_hands);
10296 if (new_item)
10297 {
10298 new_item.SetResultOfSplit(true);
10299 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10301 new_item.SetQuantity(split_quantity_new);
10302 }
10303 }
10304 }
10305
10307 {
10309 return;
10310
10312 float split_quantity_new = Math.Floor(quantity * 0.5);
10313
10315
10316 if (new_item)
10317 {
10318 if (new_item.GetQuantityMax() < split_quantity_new)
10319 {
10320 split_quantity_new = new_item.GetQuantityMax();
10321 }
10322
10323 new_item.SetResultOfSplit(true);
10324 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10325
10327 {
10330 }
10331 else
10332 {
10335 }
10336 }
10337 }
10338
10340 {
10342 return;
10343
10345 float split_quantity_new = Math.Floor(quantity / 2);
10346
10347 InventoryLocation invloc = new InventoryLocation;
10349
10351 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10352
10353 if (new_item)
10354 {
10355 if (new_item.GetQuantityMax() < split_quantity_new)
10356 {
10357 split_quantity_new = new_item.GetQuantityMax();
10358 }
10360 {
10363 }
10364 else
10365 {
10368 }
10369 }
10370 }
10371
10374 {
10375 SetWeightDirty();
10377
10378 if (parent)
10379 parent.OnAttachmentQuantityChangedEx(this, delta);
10380
10382 {
10384 {
10386 }
10388 {
10389 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10391 }
10392 }
10393
10394 }
10395
10398 {
10399
10400 }
10401
10404 {
10406 }
10407
10409 {
10410 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10411
10413 {
10414 if (newLevel == GameConstants.STATE_RUINED)
10415 {
10417 EntityAI parent = GetHierarchyParent();
10418 if (parent && parent.IsFireplace())
10419 {
10420 CargoBase cargo = GetInventory().GetCargo();
10421 if (cargo)
10422 {
10424 {
10426 }
10427 }
10428 }
10429 }
10430
10432 {
10433
10435 return;
10436 }
10437
10438 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10439 {
10441 }
10442 }
10443 }
10444
10445
10447 {
10448 super.OnRightClick();
10449
10451 {
10453 {
10454 if (ScriptInputUserData.CanStoreInputUserData())
10455 {
10456 vector m4[4];
10458
10459 EntityAI root = GetHierarchyRoot();
10460
10461 InventoryLocation dst = new InventoryLocation;
10463 {
10464 if (root)
10465 {
10466 root.GetTransform(m4);
10468 }
10469 else
10470 GetInventory().GetCurrentInventoryLocation(dst);
10471 }
10472 else
10473 {
10475
10476
10477 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10478 {
10479 if (root)
10480 {
10481 root.GetTransform(m4);
10483 }
10484 else
10485 GetInventory().GetCurrentInventoryLocation(dst);
10486 }
10487 else
10488 {
10489 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10490 }
10491 }
10492
10493 ScriptInputUserData ctx = new ScriptInputUserData;
10501 }
10502 }
10503 else if (!
GetGame().IsMultiplayer())
10504 {
10506 }
10507 }
10508 }
10509
10510 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10511 {
10512
10513 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10514 return false;
10515
10516 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10517 return false;
10518
10519
10521 return false;
10522
10523
10524 Magazine mag = Magazine.Cast(this);
10525 if (mag)
10526 {
10527 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10528 return false;
10529
10530 if (stack_max_limit)
10531 {
10532 Magazine other_mag = Magazine.Cast(other_item);
10533 if (other_item)
10534 {
10535 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10536 return false;
10537 }
10538
10539 }
10540 }
10541 else
10542 {
10543
10545 return false;
10546
10548 return false;
10549 }
10550
10551 PlayerBase player = null;
10552 if (CastTo(player, GetHierarchyRootPlayer()))
10553 {
10554 if (player.GetInventory().HasAttachment(this))
10555 return false;
10556
10557 if (player.IsItemsToDelete())
10558 return false;
10559 }
10560
10561 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10562 return false;
10563
10564 int slotID;
10566 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10567 return false;
10568
10569 return true;
10570 }
10571
10573 {
10575 }
10576
10578 {
10579 return m_IsResultOfSplit;
10580 }
10581
10583 {
10584 m_IsResultOfSplit = value;
10585 }
10586
10588 {
10590 }
10591
10593 {
10594 float other_item_quantity = other_item.GetQuantity();
10595 float this_free_space;
10596
10598
10600
10601 if (other_item_quantity > this_free_space)
10602 {
10603 return this_free_space;
10604 }
10605 else
10606 {
10607 return other_item_quantity;
10608 }
10609 }
10610
10612 {
10614 }
10615
10617 {
10619 return;
10620
10621 if (!IsMagazine() && other_item)
10622 {
10624 if (quantity_used != 0)
10625 {
10626 float hp1 = GetHealth01("","");
10627 float hp2 = other_item.GetHealth01("","");
10628 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10629 hpResult = hpResult / (
GetQuantity() + quantity_used);
10630
10631 hpResult *= GetMaxHealth();
10632 Math.Round(hpResult);
10633 SetHealth("", "Health", hpResult);
10634
10636 other_item.AddQuantity(-quantity_used);
10637 }
10638 }
10640 }
10641
10643 {
10644 #ifdef SERVER
10645 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10646 GetHierarchyParent().IncreaseLifetimeUp();
10647 #endif
10648 };
10649
10651 {
10652 PlayerBase p = PlayerBase.Cast(player);
10653
10654 array<int> recipesIds = p.m_Recipes;
10655 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10656 if (moduleRecipesManager)
10657 {
10658 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10659 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10660 }
10661
10662 for (int i = 0;i < recipesIds.Count(); i++)
10663 {
10664 int key = recipesIds.Get(i);
10665 string recipeName = moduleRecipesManager.GetRecipeName(key);
10667 }
10668 }
10669
10670
10671 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10672 {
10673 super.GetDebugActions(outputList);
10674
10675
10680
10681
10685
10689
10690
10693
10694
10696 {
10699 }
10700
10702
10705
10709 }
10710
10711
10712
10713
10715 {
10716 super.OnAction(action_id, player, ctx);
10717 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10718 {
10719 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10720 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10721 PlayerBase p = PlayerBase.Cast(player);
10722 if (
EActions.RECIPES_RANGE_START < 1000)
10723 {
10724 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10725 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10726 }
10727 }
10728 #ifndef SERVER
10729 else if (action_id ==
EActions.WATCH_PLAYER)
10730 {
10731 PluginDeveloper.SetDeveloperItemClientEx(player);
10732 }
10733 #endif
10735 {
10736 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10737 {
10738 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10739 OnDebugButtonPressServer(id + 1);
10740 }
10741
10742 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10743 {
10744 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10746 }
10747
10748 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10749 {
10750 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10752 }
10753
10754 else if (action_id ==
EActions.ADD_QUANTITY)
10755 {
10756 if (IsMagazine())
10757 {
10758 Magazine mag = Magazine.Cast(this);
10759 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10760 }
10761 else
10762 {
10764 }
10765
10766 if (m_EM)
10767 {
10768 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10769 }
10770
10771 }
10772
10773 else if (action_id ==
EActions.REMOVE_QUANTITY)
10774 {
10775 if (IsMagazine())
10776 {
10777 Magazine mag2 = Magazine.Cast(this);
10778 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10779 }
10780 else
10781 {
10783 }
10784 if (m_EM)
10785 {
10786 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10787 }
10788
10789 }
10790
10791 else if (action_id ==
EActions.SET_QUANTITY_0)
10792 {
10794
10795 if (m_EM)
10796 {
10797 m_EM.SetEnergy(0);
10798 }
10799 }
10800
10801 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10802 {
10804
10805 if (m_EM)
10806 {
10807 m_EM.SetEnergy(m_EM.GetEnergyMax());
10808 }
10809 }
10810
10811 else if (action_id ==
EActions.ADD_HEALTH)
10812 {
10813 AddHealth("","",GetMaxHealth("","Health")/5);
10814 }
10815 else if (action_id ==
EActions.REMOVE_HEALTH)
10816 {
10817 AddHealth("","",-GetMaxHealth("","Health")/5);
10818 }
10819 else if (action_id ==
EActions.DESTROY_HEALTH)
10820 {
10821 SetHealth01("","",0);
10822 }
10823 else if (action_id ==
EActions.WATCH_ITEM)
10824 {
10826 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10827 #ifdef DEVELOPER
10828 SetDebugDeveloper_item(this);
10829 #endif
10830 }
10831
10832 else if (action_id ==
EActions.ADD_TEMPERATURE)
10833 {
10834 AddTemperature(20);
10835
10836 }
10837
10838 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10839 {
10840 AddTemperature(-20);
10841
10842 }
10843
10844 else if (action_id ==
EActions.FLIP_FROZEN)
10845 {
10846 SetFrozen(!GetIsFrozen());
10847
10848 }
10849
10850 else if (action_id ==
EActions.ADD_WETNESS)
10851 {
10853
10854 }
10855
10856 else if (action_id ==
EActions.REMOVE_WETNESS)
10857 {
10859
10860 }
10861
10862 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10863 {
10866
10867
10868 }
10869
10870 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10871 {
10874 }
10875
10876 else if (action_id ==
EActions.MAKE_SPECIAL)
10877 {
10878 auto debugParams = DebugSpawnParams.WithPlayer(player);
10879 OnDebugSpawnEx(debugParams);
10880 }
10881
10882 else if (action_id ==
EActions.DELETE)
10883 {
10884 Delete();
10885 }
10886
10887 }
10888
10889
10890 return false;
10891 }
10892
10893
10894
10895
10899
10902
10903
10904
10906 {
10907 return false;
10908 }
10909
10910
10912 {
10913 return true;
10914 }
10915
10916
10918 {
10919 return true;
10920 }
10921
10922
10923
10925 {
10926 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10928 }
10929
10932 {
10933 return null;
10934 }
10935
10937 {
10938 return false;
10939 }
10940
10942 {
10943 return false;
10944 }
10945
10949
10950
10952 {
10953 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10954 return module_repairing.CanRepair(this, item_repair_kit);
10955 }
10956
10957
10958 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10959 {
10960 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10961 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10962 }
10963
10964
10966 {
10967
10968
10969
10970
10971
10972
10973
10974
10975 return 1;
10976 }
10977
10978
10979
10981 {
10983 }
10984
10985
10986
10988 {
10990 }
10991
10992
11001 {
11002 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11003
11004 if (player)
11005 {
11006 player.MessageStatus(text);
11007 }
11008 }
11009
11010
11019 {
11020 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11021
11022 if (player)
11023 {
11024 player.MessageAction(text);
11025 }
11026 }
11027
11028
11037 {
11038 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11039
11040 if (player)
11041 {
11042 player.MessageFriendly(text);
11043 }
11044 }
11045
11046
11055 {
11056 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11057
11058 if (player)
11059 {
11060 player.MessageImportant(text);
11061 }
11062 }
11063
11065 {
11066 return true;
11067 }
11068
11069
11070 override bool KindOf(
string tag)
11071 {
11072 bool found = false;
11073 string item_name = this.
GetType();
11076
11077 int array_size = item_tag_array.Count();
11078 for (int i = 0; i < array_size; i++)
11079 {
11080 if (item_tag_array.Get(i) == tag)
11081 {
11082 found = true;
11083 break;
11084 }
11085 }
11086 return found;
11087 }
11088
11089
11091 {
11092
11093 super.OnRPC(sender, rpc_type,ctx);
11094
11095
11096 switch (rpc_type)
11097 {
11098 #ifndef SERVER
11099 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11100 Param2<bool, string> p = new Param2<bool, string>(false, "");
11101
11103 return;
11104
11105 bool play = p.param1;
11106 string soundSet = p.param2;
11107
11108 if (play)
11109 {
11111 {
11113 {
11115 }
11116 }
11117 else
11118 {
11120 }
11121 }
11122 else
11123 {
11125 }
11126
11127 break;
11128 #endif
11129
11130 }
11131
11133 {
11135 }
11136 }
11137
11138
11139
11140
11142 {
11143 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11144 return plugin.GetID(
name);
11145 }
11146
11148 {
11149 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11150 return plugin.GetName(id);
11151 }
11152
11155 {
11156
11157
11158 int varFlags;
11159 if (!ctx.
Read(varFlags))
11160 return;
11161
11162 if (varFlags & ItemVariableFlags.FLOAT)
11163 {
11165 }
11166 }
11167
11169 {
11170
11171 super.SerializeNumericalVars(floats_out);
11172
11173
11174
11176 {
11178 }
11179
11181 {
11183 }
11184
11186 {
11188 }
11189
11191 {
11196 }
11197
11199 {
11201 }
11202 }
11203
11205 {
11206
11207 super.DeSerializeNumericalVars(floats);
11208
11209
11210 int index = 0;
11211 int mask = Math.Round(floats.Get(index));
11212
11213 index++;
11214
11216 {
11218 {
11220 }
11221 else
11222 {
11223 float quantity = floats.Get(index);
11224 SetQuantity(quantity,
true,
false,
false,
false);
11225 }
11226 index++;
11227 }
11228
11230 {
11231 float wet = floats.Get(index);
11233 index++;
11234 }
11235
11237 {
11238 int liquidtype = Math.Round(floats.Get(index));
11240 index++;
11241 }
11242
11244 {
11246 index++;
11248 index++;
11250 index++;
11252 index++;
11253 }
11254
11256 {
11257 int cleanness = Math.Round(floats.Get(index));
11259 index++;
11260 }
11261 }
11262
11264 {
11265 super.WriteVarsToCTX(ctx);
11266
11267
11269 {
11271 }
11272
11274 {
11276 }
11277
11279 {
11281 }
11282
11284 {
11285 int r,g,b,a;
11291 }
11292
11294 {
11296 }
11297 }
11298
11300 {
11301 if (!super.ReadVarsFromCTX(ctx,version))
11302 return false;
11303
11304 int intValue;
11305 float value;
11306
11307 if (version < 140)
11308 {
11309 if (!ctx.
Read(intValue))
11310 return false;
11311
11312 m_VariablesMask = intValue;
11313 }
11314
11316 {
11317 if (!ctx.
Read(value))
11318 return false;
11319
11321 {
11323 }
11324 else
11325 {
11327 }
11328 }
11329
11330 if (version < 140)
11331 {
11333 {
11334 if (!ctx.
Read(value))
11335 return false;
11336 SetTemperatureDirect(value);
11337 }
11338 }
11339
11341 {
11342 if (!ctx.
Read(value))
11343 return false;
11345 }
11346
11348 {
11349 if (!ctx.
Read(intValue))
11350 return false;
11352 }
11353
11355 {
11356 int r,g,b,a;
11358 return false;
11360 return false;
11362 return false;
11364 return false;
11365
11367 }
11368
11370 {
11371 if (!ctx.
Read(intValue))
11372 return false;
11374 }
11375
11376 if (version >= 138 && version < 140)
11377 {
11379 {
11380 if (!ctx.
Read(intValue))
11381 return false;
11382 SetFrozen(intValue);
11383 }
11384 }
11385
11386 return true;
11387 }
11388
11389
11391 {
11394 {
11396 }
11397
11398 if (!super.OnStoreLoad(ctx, version))
11399 {
11401 return false;
11402 }
11403
11404 if (version >= 114)
11405 {
11406 bool hasQuickBarIndexSaved;
11407
11408 if (!ctx.
Read(hasQuickBarIndexSaved))
11409 {
11411 return false;
11412 }
11413
11414 if (hasQuickBarIndexSaved)
11415 {
11416 int itmQBIndex;
11417
11418
11419 if (!ctx.
Read(itmQBIndex))
11420 {
11422 return false;
11423 }
11424
11425 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11426 if (itmQBIndex != -1 && parentPlayer)
11427 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11428 }
11429 }
11430 else
11431 {
11432
11433 PlayerBase player;
11434 int itemQBIndex;
11435 if (version ==
int.
MAX)
11436 {
11437 if (!ctx.
Read(itemQBIndex))
11438 {
11440 return false;
11441 }
11442 }
11443 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11444 {
11445
11446 if (!ctx.
Read(itemQBIndex))
11447 {
11449 return false;
11450 }
11451 if (itemQBIndex != -1 && player)
11452 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11453 }
11454 }
11455
11456 if (version < 140)
11457 {
11458
11459 if (!LoadVariables(ctx, version))
11460 {
11462 return false;
11463 }
11464 }
11465
11466
11468 {
11470 return false;
11471 }
11472 if (version >= 132)
11473 {
11475 if (raib)
11476 {
11478 {
11480 return false;
11481 }
11482 }
11483 }
11484
11486 return true;
11487 }
11488
11489
11490
11492 {
11493 super.OnStoreSave(ctx);
11494
11495 PlayerBase player;
11496 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11497 {
11499
11500 int itemQBIndex = -1;
11501 itemQBIndex = player.FindQuickBarEntityIndex(this);
11502 ctx.
Write(itemQBIndex);
11503 }
11504 else
11505 {
11507 }
11508
11510
11512 if (raib)
11513 {
11515 }
11516 }
11517
11518
11520 {
11521 super.AfterStoreLoad();
11522
11524 {
11526 }
11527
11529 {
11532 }
11533 }
11534
11536 {
11537 super.EEOnAfterLoad();
11538
11540 {
11542 }
11543
11546 }
11547
11549 {
11550 return false;
11551 }
11552
11553
11554
11556 {
11558 {
11559 #ifdef PLATFORM_CONSOLE
11560
11562 {
11564 if (menu)
11565 {
11567 }
11568 }
11569 #endif
11570 }
11571
11573 {
11576 }
11577
11579 {
11580 SetWeightDirty();
11582 }
11584 {
11587 }
11588
11590 {
11593 }
11595 {
11598 }
11599
11600 super.OnVariablesSynchronized();
11601 }
11602
11603
11604
11606 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11607 {
11608 if (!IsServerCheck(allow_client))
11609 return false;
11610
11612 return false;
11613
11616
11617 if (value <= (min + 0.001))
11618 value = min;
11619
11620 if (value == min)
11621 {
11622 if (destroy_config)
11623 {
11624 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11625 if (dstr)
11626 {
11628 this.Delete();
11629 return true;
11630 }
11631 }
11632 else if (destroy_forced)
11633 {
11635 this.Delete();
11636 return true;
11637 }
11638
11640 }
11641
11644
11646 {
11648
11649 if (delta)
11651 }
11652
11654
11655 return false;
11656 }
11657
11658
11660 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11661 {
11663 }
11664
11666 {
11669 }
11670
11672 {
11675 }
11676
11679 {
11680 float value_clamped = Math.Clamp(value, 0, 1);
11682 SetQuantity(result, destroy_config, destroy_forced);
11683 }
11684
11685
11688 {
11690 }
11691
11693 {
11695 }
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11707 {
11708 int slot = -1;
11709 if (GetInventory())
11710 {
11711 InventoryLocation il = new InventoryLocation;
11712 GetInventory().GetCurrentInventoryLocation(il);
11714 }
11715
11717 }
11718
11720 {
11721 float quantity_max = 0;
11722
11724 {
11725 if (attSlotID != -1)
11726 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11727
11728 if (quantity_max <= 0)
11730 }
11731
11732 if (quantity_max <= 0)
11734
11735 return quantity_max;
11736 }
11737
11739 {
11741 }
11742
11744 {
11746 }
11747
11748
11750 {
11752 }
11753
11755 {
11757 }
11758
11760 {
11762 }
11763
11764
11766 {
11767
11768 float weightEx = GetWeightEx();
11769 float special = GetInventoryAndCargoWeight();
11770 return weightEx - special;
11771 }
11772
11773
11775 {
11777 }
11778
11780 {
11782 {
11783 #ifdef DEVELOPER
11784 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11785 {
11786 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11788 }
11789 #endif
11790
11791 return GetQuantity() * GetConfigWeightModified();
11792 }
11793 else if (HasEnergyManager())
11794 {
11795 #ifdef DEVELOPER
11796 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11797 {
11798 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11799 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11800 }
11801 #endif
11802 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11803 }
11804 else
11805 {
11806 #ifdef DEVELOPER
11807 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11808 {
11809 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11810 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11811 }
11812 #endif
11813 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11814 }
11815 }
11816
11819 {
11820 int item_count = 0;
11822
11823 if (GetInventory().GetCargo() != NULL)
11824 {
11825 item_count = GetInventory().GetCargo().GetItemCount();
11826 }
11827
11828 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11829 {
11830 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11831 if (item)
11832 item_count += item.GetNumberOfItems();
11833 }
11834 return item_count;
11835 }
11836
11839 {
11840 float weight = 0;
11841 float wetness = 1;
11842 if (include_wetness)
11845 {
11846 weight = wetness * m_ConfigWeight;
11847 }
11849 {
11850 weight = 1;
11851 }
11852 return weight;
11853 }
11854
11855
11856
11858 {
11859 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11860 {
11861 GameInventory inv = GetInventory();
11862 array<EntityAI> items = new array<EntityAI>;
11864 for (int i = 0; i < items.Count(); i++)
11865 {
11867 if (item)
11868 {
11870 }
11871 }
11872 }
11873 }
11874
11875
11876
11877
11879 {
11880 float energy = 0;
11881 if (HasEnergyManager())
11882 {
11883 energy = GetCompEM().GetEnergy();
11884 }
11885 return energy;
11886 }
11887
11888
11890 {
11891 super.OnEnergyConsumed();
11892
11894 }
11895
11897 {
11898 super.OnEnergyAdded();
11899
11901 }
11902
11903
11905 {
11906 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11907 {
11909 {
11910 float energy_0to1 = GetCompEM().GetEnergy0To1();
11912 }
11913 }
11914 }
11915
11916
11918 {
11919 return ConfigGetFloat("heatIsolation");
11920 }
11921
11923 {
11925 }
11926
11928 {
11929 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11930 if (
GetGame().ConfigIsExisting(paramPath))
11932
11933 return 0.0;
11934 }
11935
11937 {
11938 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11939 if (
GetGame().ConfigIsExisting(paramPath))
11941
11942 return 0.0;
11943 }
11944
11945 override void SetWet(
float value,
bool allow_client =
false)
11946 {
11947 if (!IsServerCheck(allow_client))
11948 return;
11949
11952
11954
11955 m_VarWet = Math.Clamp(value, min, max);
11956
11958 {
11961 }
11962 }
11963
11964 override void AddWet(
float value)
11965 {
11967 }
11968
11970 {
11972 }
11973
11975 {
11977 }
11978
11980 {
11982 }
11983
11985 {
11987 }
11988
11990 {
11992 }
11993
11994 override void OnWetChanged(
float newVal,
float oldVal)
11995 {
11998 if (newLevel != oldLevel)
11999 {
12001 }
12002 }
12003
12005 {
12006 SetWeightDirty();
12007 }
12008
12010 {
12011 return GetWetLevelInternal(
m_VarWet);
12012 }
12013
12014
12015
12017 {
12019 }
12020
12022 {
12024 }
12025
12027 {
12029 }
12030
12032 {
12034 }
12035
12036
12037
12039 {
12040 if (ConfigIsExisting("itemModelLength"))
12041 {
12042 return ConfigGetFloat("itemModelLength");
12043 }
12044 return 0;
12045 }
12046
12048 {
12049 if (ConfigIsExisting("itemAttachOffset"))
12050 {
12051 return ConfigGetFloat("itemAttachOffset");
12052 }
12053 return 0;
12054 }
12055
12056 override void SetCleanness(
int value,
bool allow_client =
false)
12057 {
12058 if (!IsServerCheck(allow_client))
12059 return;
12060
12062
12064
12067 }
12068
12070 {
12072 }
12073
12075 {
12076 return true;
12077 }
12078
12079
12080
12081
12083 {
12085 }
12086
12088 {
12090 }
12091
12092
12093
12094
12095 override void SetColor(
int r,
int g,
int b,
int a)
12096 {
12102 }
12104 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12105 {
12110 }
12111
12113 {
12115 }
12116
12119 {
12120 int r,g,b,a;
12122 r = r/255;
12123 g = g/255;
12124 b = b/255;
12125 a = a/255;
12126 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12127 }
12128
12129
12130
12131 override void SetLiquidType(
int value,
bool allow_client =
false)
12132 {
12133 if (!IsServerCheck(allow_client))
12134 return;
12135
12140 }
12141
12143 {
12144 return ConfigGetInt("varLiquidTypeInit");
12145 }
12146
12148 {
12150 }
12151
12153 {
12155 SetFrozen(false);
12156 }
12157
12160 {
12161 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12162 }
12163
12164
12167 {
12168 PlayerBase nplayer;
12169 if (PlayerBase.CastTo(nplayer, player))
12170 {
12172
12173 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12174 }
12175 }
12176
12177
12180 {
12181 PlayerBase nplayer;
12182 if (PlayerBase.CastTo(nplayer,player))
12183 {
12184
12185 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12186
12187 }
12188
12189
12190 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12191
12192
12193 if (HasEnergyManager())
12194 {
12195 GetCompEM().UpdatePlugState();
12196 }
12197 }
12198
12199
12201 {
12202 super.OnPlacementStarted(player);
12203
12205 }
12206
12207 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12208 {
12210 {
12211 m_AdminLog.OnPlacementComplete(player,
this);
12212 }
12213
12214 super.OnPlacementComplete(player, position, orientation);
12215 }
12216
12217
12218
12219
12220
12222 {
12224 {
12225 return true;
12226 }
12227 else
12228 {
12229 return false;
12230 }
12231 }
12232
12233
12235 {
12237 {
12239 }
12240 }
12241
12242
12244 {
12246 }
12247
12249 {
12251 }
12252
12253 override void InsertAgent(
int agent,
float count = 1)
12254 {
12255 if (count < 1)
12256 return;
12257
12259 }
12260
12263 {
12265 }
12266
12267
12269 {
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
12309
12310
12311
12312
12313
12315 {
12317 return false;
12318 return true;
12319 }
12320
12322 {
12323
12325 }
12326
12327
12330 {
12331 super.CheckForRoofLimited(timeTresholdMS);
12332
12334 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12335 {
12336 m_PreviousRoofTestTime = time;
12337 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12338 }
12339 }
12340
12341
12343 {
12345 {
12346 return 0;
12347 }
12348
12349 if (GetInventory().GetAttachmentSlotsCount() != 0)
12350 {
12351 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12352 if (filter)
12353 return filter.GetProtectionLevel(type, false, system);
12354 else
12355 return 0;
12356 }
12357
12358 string subclassPath, entryName;
12359
12360 switch (type)
12361 {
12363 entryName = "biological";
12364 break;
12366 entryName = "chemical";
12367 break;
12368 default:
12369 entryName = "biological";
12370 break;
12371 }
12372
12373 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12374
12376 }
12377
12378
12379
12382 {
12383 if (!IsMagazine())
12385
12387 }
12388
12389
12390
12391
12392
12397 {
12398 return true;
12399 }
12400
12402 {
12404 }
12405
12406
12407
12408
12409
12411 {
12412 if (parent)
12413 {
12414 if (parent.IsInherited(DayZInfected))
12415 return true;
12416
12417 if (!parent.IsRuined())
12418 return true;
12419 }
12420
12421 return true;
12422 }
12423
12425 {
12426 if (!super.CanPutAsAttachment(parent))
12427 {
12428 return false;
12429 }
12430
12431 if (!IsRuined() && !parent.IsRuined())
12432 {
12433 return true;
12434 }
12435
12436 return false;
12437 }
12438
12440 {
12441
12442
12443
12444
12445 return super.CanReceiveItemIntoCargo(item);
12446 }
12447
12449 {
12450
12451
12452
12453
12454 GameInventory attachmentInv = attachment.GetInventory();
12456 {
12457 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12458 return false;
12459 }
12460
12461 InventoryLocation loc = new InventoryLocation();
12462 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12463 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12464 return false;
12465
12466 return super.CanReceiveAttachment(attachment, slotId);
12467 }
12468
12470 {
12471 if (!super.CanReleaseAttachment(attachment))
12472 return false;
12473
12474 return GetInventory().AreChildrenAccessible();
12475 }
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12498 {
12499 int id = muzzle_owner.GetMuzzleID();
12500 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12501
12502 if (WPOF_array)
12503 {
12504 for (int i = 0; i < WPOF_array.Count(); i++)
12505 {
12506 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12507
12508 if (WPOF)
12509 {
12510 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12511 }
12512 }
12513 }
12514 }
12515
12516
12518 {
12519 int id = muzzle_owner.GetMuzzleID();
12521
12522 if (WPOBE_array)
12523 {
12524 for (int i = 0; i < WPOBE_array.Count(); i++)
12525 {
12526 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12527
12528 if (WPOBE)
12529 {
12530 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12531 }
12532 }
12533 }
12534 }
12535
12536
12538 {
12539 int id = muzzle_owner.GetMuzzleID();
12540 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12541
12542 if (WPOOH_array)
12543 {
12544 for (int i = 0; i < WPOOH_array.Count(); i++)
12545 {
12546 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12547
12548 if (WPOOH)
12549 {
12550 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12551 }
12552 }
12553 }
12554 }
12555
12556
12558 {
12559 int id = muzzle_owner.GetMuzzleID();
12560 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12561
12562 if (WPOOH_array)
12563 {
12564 for (int i = 0; i < WPOOH_array.Count(); i++)
12565 {
12566 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12567
12568 if (WPOOH)
12569 {
12570 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12571 }
12572 }
12573 }
12574 }
12575
12576
12578 {
12579 int id = muzzle_owner.GetMuzzleID();
12580 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12581
12582 if (WPOOH_array)
12583 {
12584 for (int i = 0; i < WPOOH_array.Count(); i++)
12585 {
12586 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12587
12588 if (WPOOH)
12589 {
12590 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12591 }
12592 }
12593 }
12594 }
12595
12596
12597
12599 {
12601 {
12602 return true;
12603 }
12604
12605 return false;
12606 }
12607
12609 {
12611 {
12612 return true;
12613 }
12614
12615 return false;
12616 }
12617
12619 {
12621 {
12622 return true;
12623 }
12624
12625 return false;
12626 }
12627
12629 {
12630 return false;
12631 }
12632
12635 {
12636 return UATimeSpent.DEFAULT_DEPLOY;
12637 }
12638
12639
12640
12641
12643 {
12645 SetSynchDirty();
12646 }
12647
12649 {
12651 }
12652
12653
12655 {
12656 return false;
12657 }
12658
12661 {
12662 string att_type = "None";
12663
12664 if (ConfigIsExisting("soundAttType"))
12665 {
12666 att_type = ConfigGetString("soundAttType");
12667 }
12668
12670 }
12671
12673 {
12675 }
12676
12677
12678
12679
12680
12684
12686 {
12689
12691 }
12692
12693
12695 {
12697 return;
12698
12700
12703
12706
12707 SoundParameters params = new SoundParameters();
12711 }
12712
12713
12715 {
12717 return;
12718
12720 SetSynchDirty();
12721
12724 }
12725
12726
12728 {
12730 return;
12731
12733 SetSynchDirty();
12734
12737 }
12738
12740 {
12742 }
12743
12745 {
12747 }
12748
12751 {
12752 if (!
GetGame().IsDedicatedServer())
12753 {
12754 if (ConfigIsExisting("attachSoundSet"))
12755 {
12756 string cfg_path = "";
12757 string soundset = "";
12758 string type_name =
GetType();
12759
12762 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12763 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12764
12765 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12766 {
12767 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12768 {
12769 if (cfg_slot_array[i] == slot_type)
12770 {
12771 soundset = cfg_soundset_array[i];
12772 break;
12773 }
12774 }
12775 }
12776
12777 if (soundset != "")
12778 {
12779 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12781 }
12782 }
12783 }
12784 }
12785
12787 {
12788
12789 }
12790
12791 void OnApply(PlayerBase player);
12792
12794 {
12795 return 1.0;
12796 };
12797
12799 {
12801 }
12802
12804 {
12806 }
12807
12809
12811 {
12812 SetDynamicPhysicsLifeTime(0.01);
12814 }
12815
12817 {
12818 array<string> zone_names = new array<string>;
12819 GetDamageZones(zone_names);
12820 for (int i = 0; i < zone_names.Count(); i++)
12821 {
12822 SetHealthMax(zone_names.Get(i),"Health");
12823 }
12824 SetHealthMax("","Health");
12825 }
12826
12829 {
12830 float global_health = GetHealth01("","Health");
12831 array<string> zones = new array<string>;
12832 GetDamageZones(zones);
12833
12834 for (int i = 0; i < zones.Count(); i++)
12835 {
12836 SetHealth01(zones.Get(i),"Health",global_health);
12837 }
12838 }
12839
12842 {
12843 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12844 }
12845
12847 {
12848 if (!hasRootAsPlayer)
12849 {
12850 if (refParentIB)
12851 {
12852
12853 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12854 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12855
12856 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12857 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12858
12861 }
12862 else
12863 {
12864
12867 }
12868 }
12869 }
12870
12872 {
12874 {
12875 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12876 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12877 {
12878 float heatPermCoef = 1.0;
12880 while (ent)
12881 {
12882 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12883 ent = ent.GetHierarchyParent();
12884 }
12885
12886 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12887 }
12888 }
12889 }
12890
12892 {
12893
12894 EntityAI parent = GetHierarchyParent();
12895 if (!parent)
12896 {
12897 hasParent = false;
12898 hasRootAsPlayer = false;
12899 }
12900 else
12901 {
12902 hasParent = true;
12903 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12904 refParentIB =
ItemBase.Cast(parent);
12905 }
12906 }
12907
12908 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12909 {
12910
12911 }
12912
12914 {
12915
12916 return false;
12917 }
12918
12920 {
12921
12922
12923 return false;
12924 }
12925
12927 {
12928
12929 return false;
12930 }
12931
12934 {
12935 return !GetIsFrozen() &&
IsOpen();
12936 }
12937
12939 {
12940 bool hasParent = false, hasRootAsPlayer = false;
12942
12943 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12944 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12945
12946 if (wwtu || foodDecay)
12947 {
12951
12952 if (processWetness || processTemperature || processDecay)
12953 {
12955
12956 if (processWetness)
12957 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12958
12959 if (processTemperature)
12961
12962 if (processDecay)
12963 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12964 }
12965 }
12966 }
12967
12970 {
12972 }
12973
12975 {
12978
12979 return super.GetTemperatureFreezeThreshold();
12980 }
12981
12983 {
12986
12987 return super.GetTemperatureThawThreshold();
12988 }
12989
12991 {
12994
12995 return super.GetItemOverheatThreshold();
12996 }
12997
12999 {
13001 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13002
13003 return super.GetTemperatureFreezeTime();
13004 }
13005
13007 {
13009 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13010
13011 return super.GetTemperatureThawTime();
13012 }
13013
13018
13020 {
13021 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13022 }
13023
13025 {
13026 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13027 }
13028
13031 {
13033 }
13034
13036 {
13038 }
13039
13041 {
13043 }
13044
13047 {
13048 return null;
13049 }
13050
13053 {
13054 return false;
13055 }
13056
13058 {
13060 {
13063 if (!trg)
13064 {
13066 explosive = this;
13067 }
13068
13069 explosive.PairRemote(trg);
13071
13072 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13073 trg.SetPersistentPairID(persistentID);
13074 explosive.SetPersistentPairID(persistentID);
13075
13076 return true;
13077 }
13078 return false;
13079 }
13080
13083 {
13084 float ret = 1.0;
13087 ret *= GetHealth01();
13088
13089 return ret;
13090 }
13091
13092 #ifdef DEVELOPER
13093 override void SetDebugItem()
13094 {
13095 super.SetDebugItem();
13096 _itemBase = this;
13097 }
13098
13100 {
13101 string text = super.GetDebugText();
13102
13104 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13105
13106 return text;
13107 }
13108 #endif
13109
13111 {
13112 return true;
13113 }
13114
13116
13118
13120 {
13123 }
13124
13125
13133
13149}
13150
13152{
13154 if (entity)
13155 {
13156 bool is_item = entity.IsInherited(
ItemBase);
13157 if (is_item && full_quantity)
13158 {
13161 }
13162 }
13163 else
13164 {
13166 return NULL;
13167 }
13168 return entity;
13169}
13170
13172{
13173 if (item)
13174 {
13175 if (health > 0)
13176 item.SetHealth("", "", health);
13177
13178 if (item.CanHaveTemperature())
13179 {
13181 if (item.CanFreeze())
13182 item.SetFrozen(false);
13183 }
13184
13185 if (item.HasEnergyManager())
13186 {
13187 if (quantity >= 0)
13188 {
13189 item.GetCompEM().SetEnergy0To1(quantity);
13190 }
13191 else
13192 {
13194 }
13195 }
13196 else if (item.IsMagazine())
13197 {
13198 Magazine mag = Magazine.Cast(item);
13199 if (quantity >= 0)
13200 {
13201 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13202 }
13203 else
13204 {
13206 }
13207
13208 }
13209 else
13210 {
13211 if (quantity >= 0)
13212 {
13213 item.SetQuantityNormalized(quantity, false);
13214 }
13215 else
13216 {
13218 }
13219
13220 }
13221 }
13222}
13223
13224#ifdef DEVELOPER
13226#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.