8289{
8291 {
8292 return true;
8293 }
8294};
8295
8296
8297
8299{
8303
8305
8308
8309
8310
8311
8312
8321
8327
8332
8337
8358 protected bool m_IsResultOfSplit
8359
8361
8366
8367
8368
8370
8374
8375
8376
8378
8381
8382
8383
8389
8390
8398
8401
8402
8404
8405
8407
8408
8413
8414
8419
8420
8422
8423
8425 {
8430
8431 if (!
GetGame().IsDedicatedServer())
8432 {
8434 {
8436
8438 {
8440 }
8441 }
8442
8445 }
8446
8447 m_OldLocation = null;
8448
8450 {
8452 }
8453
8454 if (ConfigIsExisting("headSelectionsToHide"))
8455 {
8458 }
8459
8461 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8462 {
8464 }
8465
8467
8468 m_IsResultOfSplit = false;
8469
8471 }
8472
8474 {
8475 super.InitItemVariables();
8476
8482 m_Count = ConfigGetInt(
"count");
8483
8486
8491
8494
8499
8511
8515
8516
8519 if (ConfigIsExisting("canBeSplit"))
8520 {
8523 }
8524
8526 if (ConfigIsExisting("itemBehaviour"))
8528
8529
8532 RegisterNetSyncVariableInt("m_VarLiquidType");
8533 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8534
8535 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8536 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8537 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8538
8539 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8540 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8541 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8542 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8543
8544 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8545 RegisterNetSyncVariableBool("m_IsTakeable");
8546 RegisterNetSyncVariableBool("m_IsHologram");
8547
8550 {
8553 }
8554
8556
8558 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8560
8561 }
8562
8564 {
8566 }
8567
8569 {
8572 {
8577 }
8578 }
8579
8580 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8581 {
8583 {
8586 }
8587
8589 }
8590
8592 {
8598 }
8599
8601
8603 {
8605
8606 if (!action)
8607 {
8608 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8609 return;
8610 }
8611
8613 if (!ai)
8614 {
8616 return;
8617 }
8618
8620 if (!action_array)
8621 {
8622 action_array = new array<ActionBase_Basic>;
8624 }
8625 if (LogManager.IsActionLogEnable())
8626 {
8627 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8628 }
8629
8630 if (action_array.Find(action) != -1)
8631 {
8632 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8633 }
8634 else
8635 {
8636 action_array.Insert(action);
8637 }
8638 }
8639
8641 {
8643 ActionBase action = player.GetActionManager().GetAction(actionName);
8646
8647 if (action_array)
8648 {
8649 action_array.RemoveItem(action);
8650 }
8651 }
8652
8653
8654
8656 {
8657 ActionOverrideData overrideData = new ActionOverrideData();
8661
8663 if (!actionMap)
8664 {
8667 }
8668
8669 actionMap.Insert(this.
Type(), overrideData);
8670
8671 }
8672
8674
8676
8677
8679 {
8682
8685
8686 string config_to_search = "CfgVehicles";
8687 string muzzle_owner_config;
8688
8690 {
8691 if (IsInherited(Weapon))
8692 config_to_search = "CfgWeapons";
8693
8694 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8695
8696 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8697
8699
8700 if (config_OnFire_subclass_count > 0)
8701 {
8702 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8703
8704 for (int i = 0; i < config_OnFire_subclass_count; i++)
8705 {
8706 string particle_class = "";
8708 string config_OnFire_entry = config_OnFire_class + particle_class;
8709 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8710 WPOF_array.Insert(WPOF);
8711 }
8712
8713
8715 }
8716 }
8717
8719 {
8720 config_to_search = "CfgWeapons";
8721 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8722
8723 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8724
8726
8727 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8728 {
8729 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8730
8731 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8732 {
8733 string particle_class2 = "";
8735 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8736 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8737 WPOBE_array.Insert(WPOBE);
8738 }
8739
8740
8742 }
8743 }
8744 }
8745
8746
8748 {
8751
8753 {
8754 string config_to_search = "CfgVehicles";
8755
8756 if (IsInherited(Weapon))
8757 config_to_search = "CfgWeapons";
8758
8759 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8760 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8761
8762 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8763 {
8764
8766
8768 {
8770 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8772 return;
8773 }
8774
8777
8778
8779
8781 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8782
8783 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8784 {
8785 string particle_class = "";
8787 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8789
8790 if (entry_type == CT_CLASS)
8791 {
8792 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8793 WPOOH_array.Insert(WPOF);
8794 }
8795 }
8796
8797
8799 }
8800 }
8801 }
8802
8804 {
8806 }
8807
8809 {
8811 {
8813
8816
8819
8820 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8821 }
8822 }
8823
8825 {
8827 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8828
8830 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8831
8833 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8834
8836 {
8838 }
8839 }
8840
8842 {
8844 }
8845
8847 {
8850 else
8852
8854 {
8857 }
8858 else
8859 {
8862
8865 }
8866
8868 }
8869
8871 {
8873 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8874 }
8875
8877 {
8879 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8881 }
8882
8884 {
8886 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8887 }
8888
8890 {
8893
8894 OverheatingParticle OP = new OverheatingParticle();
8899
8901 }
8902
8904 {
8907
8908 return -1;
8909 }
8910
8912 {
8914 {
8917
8918 for (int i = count; i > 0; --i)
8919 {
8920 int id = i - 1;
8923
8926
8927 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8928 {
8929 if (p)
8930 {
8933 }
8934 }
8935 }
8936 }
8937 }
8938
8940 {
8942 {
8944 {
8945 int id = i - 1;
8947
8948 if (OP)
8949 {
8951
8952 if (p)
8953 {
8955 }
8956
8957 delete OP;
8958 }
8959 }
8960
8963 }
8964 }
8965
8968 {
8969 return 0.0;
8970 }
8971
8972
8974 {
8975 return 250;
8976 }
8977
8979 {
8980 return 0;
8981 }
8982
8985 {
8987 return true;
8988
8989 return false;
8990 }
8991
8994 {
8997
8999 {
9001 }
9002 else
9003 {
9004
9006 }
9007
9009 }
9010
9017 {
9018 return -1;
9019 }
9020
9021
9022
9023
9025 {
9027 {
9029 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9030
9031 if (r_index >= 0)
9032 {
9033 InventoryLocation r_il = new InventoryLocation;
9034 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9035
9036 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9039 {
9040 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9041 }
9043 {
9044 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9045 }
9046
9047 }
9048
9049 player.GetHumanInventory().ClearUserReservedLocation(this);
9050 }
9051
9054 }
9055
9056
9057
9058
9060 {
9061 return ItemBase.m_DebugActionsMask;
9062 }
9063
9065 {
9066 return ItemBase.m_DebugActionsMask & mask;
9067 }
9068
9070 {
9071 ItemBase.m_DebugActionsMask = mask;
9072 }
9073
9075 {
9076 ItemBase.m_DebugActionsMask |= mask;
9077 }
9078
9080 {
9081 ItemBase.m_DebugActionsMask &= ~mask;
9082 }
9083
9085 {
9087 {
9089 }
9090 else
9091 {
9093 }
9094 }
9095
9096
9098 {
9099 if (GetEconomyProfile())
9100 {
9101 float q_max = GetEconomyProfile().GetQuantityMax();
9102 if (q_max > 0)
9103 {
9104 float q_min = GetEconomyProfile().GetQuantityMin();
9105 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9106
9108 {
9109 ComponentEnergyManager comp = GetCompEM();
9111 {
9113 }
9114 }
9116 {
9118
9119 }
9120
9121 }
9122 }
9123 }
9124
9127 {
9128 EntityAI parent = GetHierarchyParent();
9129
9130 if (parent)
9131 {
9132 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9133 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9134 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9135 }
9136 }
9137
9140 {
9141 EntityAI parent = GetHierarchyParent();
9142
9143 if (parent)
9144 {
9145 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9146 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9147 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9148 }
9149 }
9150
9152 {
9153
9154
9155
9156
9158
9160 {
9161 if (ScriptInputUserData.CanStoreInputUserData())
9162 {
9163 ScriptInputUserData ctx = new ScriptInputUserData;
9169 ctx.
Write(use_stack_max);
9172
9174 {
9175 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9176 }
9177 }
9178 }
9179 else if (!
GetGame().IsMultiplayer())
9180 {
9182 }
9183 }
9184
9186 {
9188 }
9189
9191 {
9193 }
9194
9196 {
9198 }
9199
9201 {
9202
9203 return false;
9204 }
9205
9207 {
9208 return false;
9209 }
9210
9214 {
9215 return false;
9216 }
9217
9219 {
9220 return "";
9221 }
9222
9224
9226 {
9227 return false;
9228 }
9229
9231 {
9232 return true;
9233 }
9234
9235
9236
9238 {
9239 return true;
9240 }
9241
9243 {
9244 return true;
9245 }
9246
9248 {
9249 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9251 }
9252
9254 {
9256 }
9257
9259 {
9261 if (!is_being_placed)
9263 SetSynchDirty();
9264 }
9265
9266
9268
9270 {
9272 }
9273
9275 {
9277 }
9278
9280 {
9281 return 1;
9282 }
9283
9285 {
9286 return false;
9287 }
9288
9290 {
9292 SetSynchDirty();
9293 }
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9330 {
9331 super.OnMovedInsideCargo(container);
9332
9333 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9334 }
9335
9336 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9337 {
9338 super.EEItemLocationChanged(oldLoc,newLoc);
9339
9340 PlayerBase new_player = null;
9341 PlayerBase old_player = null;
9342
9343 if (newLoc.GetParent())
9344 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9345
9346 if (oldLoc.GetParent())
9347 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9348
9350 {
9351 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9352
9353 if (r_index >= 0)
9354 {
9355 InventoryLocation r_il = new InventoryLocation;
9356 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9357
9358 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9361 {
9362 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9363 }
9365 {
9366 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9367 }
9368
9369 }
9370 }
9371
9373 {
9374 if (new_player)
9375 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9376
9377 if (new_player == old_player)
9378 {
9379
9380 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9381 {
9383 {
9384 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9385 {
9386 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9387 }
9388 }
9389 else
9390 {
9391 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9392 }
9393 }
9394
9395 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9396 {
9397 int type = oldLoc.GetType();
9399 {
9400 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9401 }
9403 {
9404 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9405 }
9406 }
9407 if (!m_OldLocation)
9408 {
9409 m_OldLocation = new InventoryLocation;
9410 }
9411 m_OldLocation.Copy(oldLoc);
9412 }
9413 else
9414 {
9415 if (m_OldLocation)
9416 {
9417 m_OldLocation.Reset();
9418 }
9419 }
9420
9422 }
9423 else
9424 {
9425 if (new_player)
9426 {
9427 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9428 if (res_index >= 0)
9429 {
9430 InventoryLocation il = new InventoryLocation;
9431 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9433 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9436 {
9437 il.
GetParent().GetOnReleaseLock().Invoke(it);
9438 }
9440 {
9442 }
9443
9444 }
9445 }
9447 {
9448
9450 }
9451
9452 if (m_OldLocation)
9453 {
9454 m_OldLocation.Reset();
9455 }
9456 }
9457 }
9458
9459 override void EOnContact(IEntity other, Contact extra)
9460 {
9462 {
9463 int liquidType = -1;
9465 if (impactSpeed > 0.0)
9466 {
9468 #ifndef SERVER
9470 #else
9472 SetSynchDirty();
9473 #endif
9475 }
9476 }
9477
9478 #ifdef SERVER
9479 if (GetCompEM() && GetCompEM().IsPlugged())
9480 {
9481 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9482 GetCompEM().UnplugThis();
9483 }
9484 #endif
9485 }
9486
9488
9490 {
9492 }
9493
9495 {
9496
9497 }
9498
9500 {
9501 super.OnItemLocationChanged(old_owner, new_owner);
9502
9503 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9504 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9505
9506 if (!relatedPlayer && playerNew)
9507 relatedPlayer = playerNew;
9508
9509 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9510 {
9512 if (actionMgr)
9513 {
9514 ActionBase currentAction = actionMgr.GetRunningAction();
9515 if (currentAction)
9517 }
9518 }
9519
9520 Man ownerPlayerOld = null;
9521 Man ownerPlayerNew = null;
9522
9523 if (old_owner)
9524 {
9525 if (old_owner.
IsMan())
9526 {
9527 ownerPlayerOld = Man.Cast(old_owner);
9528 }
9529 else
9530 {
9531 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9532 }
9533 }
9534 else
9535 {
9537 {
9539
9540 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9541 {
9542 GetCompEM().UnplugThis();
9543 }
9544 }
9545 }
9546
9547 if (new_owner)
9548 {
9549 if (new_owner.
IsMan())
9550 {
9551 ownerPlayerNew = Man.Cast(new_owner);
9552 }
9553 else
9554 {
9555 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9556 }
9557 }
9558
9559 if (ownerPlayerOld != ownerPlayerNew)
9560 {
9561 if (ownerPlayerOld)
9562 {
9563 array<EntityAI> subItemsExit = new array<EntityAI>;
9565 for (int i = 0; i < subItemsExit.Count(); i++)
9566 {
9569 }
9570 }
9571
9572 if (ownerPlayerNew)
9573 {
9574 array<EntityAI> subItemsEnter = new array<EntityAI>;
9576 for (int j = 0; j < subItemsEnter.Count(); j++)
9577 {
9580 }
9581 }
9582 }
9583 else if (ownerPlayerNew != null)
9584 {
9585 PlayerBase nplayer;
9586 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9587 {
9588 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9590 for (int k = 0; k < subItemsUpdate.Count(); k++)
9591 {
9593 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9594 }
9595 }
9596 }
9597
9598 if (old_owner)
9599 old_owner.OnChildItemRemoved(this);
9600 if (new_owner)
9601 new_owner.OnChildItemReceived(this);
9602 }
9603
9604
9606 {
9607 super.EEDelete(parent);
9608 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9609 if (player)
9610 {
9612
9613 if (player.IsAlive())
9614 {
9615 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9616 if (r_index >= 0)
9617 {
9618 InventoryLocation r_il = new InventoryLocation;
9619 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9620
9621 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9624 {
9625 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9626 }
9628 {
9629 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9630 }
9631
9632 }
9633
9634 player.RemoveQuickBarEntityShortcut(this);
9635 }
9636 }
9637 }
9638
9640 {
9641 super.EEKilled(killer);
9642
9645 {
9646 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9647 {
9648 if (IsMagazine())
9649 {
9650 if (Magazine.Cast(this).GetAmmoCount() > 0)
9651 {
9653 }
9654 }
9655 else
9656 {
9658 }
9659 }
9660 }
9661 }
9662
9664 {
9665 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9666
9667 super.OnWasAttached(parent, slot_id);
9668
9671
9673 }
9674
9676 {
9677 super.OnWasDetached(parent, slot_id);
9678
9681 }
9682
9684 {
9685 int idx;
9688
9689 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9690 if (inventory_slots.Count() < 1)
9691 {
9692 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9693 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9694 }
9695 else
9696 {
9697 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9698 }
9699
9700 idx = inventory_slots.Find(slot);
9701 if (idx < 0)
9702 return "";
9703
9704 return attach_types.Get(idx);
9705 }
9706
9708 {
9709 int idx = -1;
9710 string slot;
9711
9714
9715 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9716 if (inventory_slots.Count() < 1)
9717 {
9718 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9719 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9720 }
9721 else
9722 {
9723 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9724 if (detach_types.Count() < 1)
9725 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9726 }
9727
9728 for (int i = 0; i < inventory_slots.Count(); i++)
9729 {
9730 slot = inventory_slots.Get(i);
9731 }
9732
9733 if (slot != "")
9734 {
9735 if (detach_types.Count() == 1)
9736 idx = 0;
9737 else
9738 idx = inventory_slots.Find(slot);
9739 }
9740 if (idx < 0)
9741 return "";
9742
9743 return detach_types.Get(idx);
9744 }
9745
9747 {
9748
9750
9751
9752 float min_time = 1;
9753 float max_time = 3;
9754 float delay = Math.RandomFloat(min_time, max_time);
9755
9756 explode_timer.Run(delay, this, "DoAmmoExplosion");
9757 }
9758
9760 {
9761 Magazine magazine = Magazine.Cast(this);
9762 int pop_sounds_count = 6;
9763 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9764
9765
9766 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9767 string sound_name = pop_sounds[ sound_idx ];
9769
9770
9771 magazine.ServerAddAmmoCount(-1);
9772
9773
9774 float min_temp_to_explode = 100;
9775
9776 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9777 {
9779 }
9780 }
9781
9782
9783 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9784 {
9785 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9786
9787 const int CHANCE_DAMAGE_CARGO = 4;
9788 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9789 const int CHANCE_DAMAGE_NOTHING = 2;
9790
9792 {
9793 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9794 int chances;
9795 int rnd;
9796
9797 if (GetInventory().GetCargo())
9798 {
9799 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9800 rnd = Math.RandomInt(0,chances);
9801
9802 if (rnd < CHANCE_DAMAGE_CARGO)
9803 {
9805 }
9806 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9807 {
9809 }
9810 }
9811 else
9812 {
9813 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9814 rnd = Math.RandomInt(0,chances);
9815
9816 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9817 {
9819 }
9820 }
9821 }
9822 }
9823
9825 {
9826 if (GetInventory().GetCargo())
9827 {
9828 int item_count = GetInventory().GetCargo().GetItemCount();
9829 if (item_count > 0)
9830 {
9831 int random_pick = Math.RandomInt(0, item_count);
9833 if (!item.IsExplosive())
9834 {
9835 item.AddHealth("","",damage);
9836 return true;
9837 }
9838 }
9839 }
9840 return false;
9841 }
9842
9844 {
9845 int attachment_count = GetInventory().AttachmentCount();
9846 if (attachment_count > 0)
9847 {
9848 int random_pick = Math.RandomInt(0, attachment_count);
9849 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9850 if (!attachment.IsExplosive())
9851 {
9852 attachment.AddHealth("","",damage);
9853 return true;
9854 }
9855 }
9856 return false;
9857 }
9858
9860 {
9862 }
9863
9865 {
9867 return GetInventory().CanRemoveEntity();
9868
9869 return false;
9870 }
9871
9873 {
9874
9876 return false;
9877
9878
9880 return false;
9881
9882
9883
9885 if (delta == 0)
9886 return false;
9887
9888
9889 return true;
9890 }
9891
9893 {
9895 {
9896 if (ScriptInputUserData.CanStoreInputUserData())
9897 {
9898 ScriptInputUserData ctx = new ScriptInputUserData;
9903 ctx.
Write(destination_entity);
9907 }
9908 }
9909 else if (!
GetGame().IsMultiplayer())
9910 {
9912 }
9913 }
9914
9916 {
9917 float split_quantity_new;
9921 InventoryLocation loc = new InventoryLocation;
9922
9923 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9924 {
9926 split_quantity_new = stack_max;
9927 else
9929
9931 {
9932 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9933 if (new_item)
9934 {
9935 new_item.SetResultOfSplit(true);
9936 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9938 new_item.
SetQuantity(split_quantity_new,
false,
true);
9939 }
9940 }
9941 }
9942 else if (destination_entity && slot_id == -1)
9943 {
9944 if (quantity > stack_max)
9945 split_quantity_new = stack_max;
9946 else
9947 split_quantity_new = quantity;
9948
9950 {
9952 {
9955 }
9956
9957 if (new_item)
9958 {
9959 new_item.SetResultOfSplit(true);
9960 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9962 new_item.
SetQuantity(split_quantity_new,
false,
true);
9963 }
9964 }
9965 }
9966 else
9967 {
9968 if (stack_max != 0)
9969 {
9971 {
9973 }
9974
9975 if (split_quantity_new == 0)
9976 {
9977 if (!
GetGame().IsMultiplayer())
9978 player.PhysicalPredictiveDropItem(this);
9979 else
9980 player.ServerDropEntity(this);
9981 return;
9982 }
9983
9985 {
9987
9988 if (new_item)
9989 {
9990 new_item.SetResultOfSplit(true);
9991 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9994 new_item.PlaceOnSurface();
9995 }
9996 }
9997 }
9998 }
9999 }
10000
10002 {
10003 float split_quantity_new;
10007 InventoryLocation loc = new InventoryLocation;
10008
10009 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10010 {
10012 split_quantity_new = stack_max;
10013 else
10015
10017 {
10018 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10019 if (new_item)
10020 {
10021 new_item.SetResultOfSplit(true);
10022 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10024 new_item.
SetQuantity(split_quantity_new,
false,
true);
10025 }
10026 }
10027 }
10028 else if (destination_entity && slot_id == -1)
10029 {
10030 if (quantity > stack_max)
10031 split_quantity_new = stack_max;
10032 else
10033 split_quantity_new = quantity;
10034
10036 {
10038 {
10041 }
10042
10043 if (new_item)
10044 {
10045 new_item.SetResultOfSplit(true);
10046 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10048 new_item.
SetQuantity(split_quantity_new,
false,
true);
10049 }
10050 }
10051 }
10052 else
10053 {
10054 if (stack_max != 0)
10055 {
10057 {
10059 }
10060
10062 {
10064
10065 if (new_item)
10066 {
10067 new_item.SetResultOfSplit(true);
10068 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10071 new_item.PlaceOnSurface();
10072 }
10073 }
10074 }
10075 }
10076 }
10077
10079 {
10081 {
10082 if (ScriptInputUserData.CanStoreInputUserData())
10083 {
10084 ScriptInputUserData ctx = new ScriptInputUserData;
10089 dst.WriteToContext(ctx);
10091 }
10092 }
10093 else if (!
GetGame().IsMultiplayer())
10094 {
10096 }
10097 }
10098
10100 {
10102 {
10103 if (ScriptInputUserData.CanStoreInputUserData())
10104 {
10105 ScriptInputUserData ctx = new ScriptInputUserData;
10110 ctx.
Write(destination_entity);
10116 }
10117 }
10118 else if (!
GetGame().IsMultiplayer())
10119 {
10121 }
10122 }
10123
10125 {
10127 }
10128
10130 {
10132 float split_quantity_new;
10134 if (dst.IsValid())
10135 {
10136 int slot_id = dst.GetSlot();
10138
10139 if (quantity > stack_max)
10140 split_quantity_new = stack_max;
10141 else
10142 split_quantity_new = quantity;
10143
10145 {
10147
10148 if (new_item)
10149 {
10150 new_item.SetResultOfSplit(true);
10151 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10153 new_item.
SetQuantity(split_quantity_new,
false,
true);
10154 }
10155
10156 return new_item;
10157 }
10158 }
10159
10160 return null;
10161 }
10162
10164 {
10166 float split_quantity_new;
10168 if (destination_entity)
10169 {
10171 if (quantity > stackable)
10172 split_quantity_new = stackable;
10173 else
10174 split_quantity_new = quantity;
10175
10177 {
10178 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10179 if (new_item)
10180 {
10181 new_item.SetResultOfSplit(true);
10182 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10184 new_item.
SetQuantity(split_quantity_new,
false,
true);
10185 }
10186 }
10187 }
10188 }
10189
10191 {
10193 {
10194 if (ScriptInputUserData.CanStoreInputUserData())
10195 {
10196 ScriptInputUserData ctx = new ScriptInputUserData;
10201 ItemBase destination_entity =
this;
10202 ctx.
Write(destination_entity);
10206 }
10207 }
10208 else if (!
GetGame().IsMultiplayer())
10209 {
10211 }
10212 }
10213
10215 {
10217 float split_quantity_new;
10219 if (player)
10220 {
10222 if (quantity > stackable)
10223 split_quantity_new = stackable;
10224 else
10225 split_quantity_new = quantity;
10226
10228 {
10229 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10230 new_item =
ItemBase.Cast(in_hands);
10231 if (new_item)
10232 {
10233 new_item.SetResultOfSplit(true);
10234 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10236 new_item.SetQuantity(split_quantity_new, false, true);
10237 }
10238 }
10239 }
10240 }
10241
10243 {
10245 float split_quantity_new = Math.Floor(quantity * 0.5);
10246
10248 return;
10249
10251
10252 if (new_item)
10253 {
10254 if (new_item.GetQuantityMax() < split_quantity_new)
10255 {
10256 split_quantity_new = new_item.GetQuantityMax();
10257 }
10258
10259 new_item.SetResultOfSplit(true);
10260 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10261
10263 {
10266 }
10267 else
10268 {
10270 new_item.
SetQuantity(split_quantity_new,
false,
true);
10271 }
10272 }
10273 }
10274
10276 {
10278 float split_quantity_new = Math.Floor(quantity / 2);
10279
10281 return;
10282
10283 InventoryLocation invloc = new InventoryLocation;
10285
10287 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10288
10289 if (new_item)
10290 {
10291 if (new_item.GetQuantityMax() < split_quantity_new)
10292 {
10293 split_quantity_new = new_item.GetQuantityMax();
10294 }
10296 {
10299 }
10300 else if (split_quantity_new > 1)
10301 {
10303 new_item.
SetQuantity(split_quantity_new,
false,
true);
10304 }
10305 }
10306 }
10307
10310 {
10311 SetWeightDirty();
10313
10314 if (parent)
10315 parent.OnAttachmentQuantityChangedEx(this, delta);
10316
10318 {
10320 {
10322 }
10324 {
10325 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10327 }
10328 }
10329
10330 }
10331
10334 {
10335
10336 }
10337
10340 {
10342 }
10343
10345 {
10346 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10347
10349 {
10350 if (newLevel == GameConstants.STATE_RUINED)
10351 {
10353 EntityAI parent = GetHierarchyParent();
10354 if (parent && parent.IsFireplace())
10355 {
10356 CargoBase cargo = GetInventory().GetCargo();
10357 if (cargo)
10358 {
10360 {
10362 }
10363 }
10364 }
10365 }
10366
10368 {
10369
10371 return;
10372 }
10373
10374 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10375 {
10377 }
10378 }
10379 }
10380
10381
10383 {
10384 super.OnRightClick();
10385
10387 {
10389 {
10390 if (ScriptInputUserData.CanStoreInputUserData())
10391 {
10392 EntityAI root = GetHierarchyRoot();
10393 Man playerOwner = GetHierarchyRootPlayer();
10394 InventoryLocation dst = new InventoryLocation;
10395
10396
10397 if (!playerOwner && root && root == this)
10398 {
10400 }
10401 else
10402 {
10403
10404 GetInventory().GetCurrentInventoryLocation(dst);
10406 {
10409 {
10411 }
10412 else
10413 {
10415
10416
10417 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10418 {
10420 }
10421 else
10422 {
10423 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10424 }
10425 }
10426 }
10427 }
10428
10429 ScriptInputUserData ctx = new ScriptInputUserData;
10437 }
10438 }
10439 else if (!
GetGame().IsMultiplayer())
10440 {
10442 }
10443 }
10444 }
10445
10447 {
10448 if (root)
10449 {
10450 vector m4[4];
10451 root.GetTransform(m4);
10452 dst.SetGround(this, m4);
10453 }
10454 else
10455 {
10456 GetInventory().GetCurrentInventoryLocation(dst);
10457 }
10458 }
10459
10460 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10461 {
10462
10463 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10464 return false;
10465
10466 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10467 return false;
10468
10469
10471 return false;
10472
10473
10474 Magazine mag = Magazine.Cast(this);
10475 if (mag)
10476 {
10477 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10478 return false;
10479
10480 if (stack_max_limit)
10481 {
10482 Magazine other_mag = Magazine.Cast(other_item);
10483 if (other_item)
10484 {
10485 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10486 return false;
10487 }
10488
10489 }
10490 }
10491 else
10492 {
10493
10495 return false;
10496
10498 return false;
10499 }
10500
10501 PlayerBase player = null;
10502 if (CastTo(player, GetHierarchyRootPlayer()))
10503 {
10504 if (player.GetInventory().HasAttachment(this))
10505 return false;
10506
10507 if (player.IsItemsToDelete())
10508 return false;
10509 }
10510
10511 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10512 return false;
10513
10514 int slotID;
10516 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10517 return false;
10518
10519 return true;
10520 }
10521
10523 {
10525 }
10526
10528 {
10529 return m_IsResultOfSplit;
10530 }
10531
10533 {
10534 m_IsResultOfSplit = value;
10535 }
10536
10538 {
10540 }
10541
10543 {
10544 float other_item_quantity = other_item.GetQuantity();
10545 float this_free_space;
10546
10548
10550
10551 if (other_item_quantity > this_free_space)
10552 {
10553 return this_free_space;
10554 }
10555 else
10556 {
10557 return other_item_quantity;
10558 }
10559 }
10560
10562 {
10564 }
10565
10567 {
10569 return;
10570
10571 if (!IsMagazine() && other_item)
10572 {
10574 if (quantity_used != 0)
10575 {
10576 float hp1 = GetHealth01("","");
10577 float hp2 = other_item.GetHealth01("","");
10578 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10579 hpResult = hpResult / (
GetQuantity() + quantity_used);
10580
10581 hpResult *= GetMaxHealth();
10582 Math.Round(hpResult);
10583 SetHealth("", "Health", hpResult);
10584
10586 other_item.AddQuantity(-quantity_used);
10587 }
10588 }
10590 }
10591
10593 {
10594 #ifdef SERVER
10595 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10596 GetHierarchyParent().IncreaseLifetimeUp();
10597 #endif
10598 };
10599
10601 {
10602 PlayerBase p = PlayerBase.Cast(player);
10603
10604 array<int> recipesIds = p.m_Recipes;
10605 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10606 if (moduleRecipesManager)
10607 {
10608 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10609 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10610 }
10611
10612 for (int i = 0;i < recipesIds.Count(); i++)
10613 {
10614 int key = recipesIds.Get(i);
10615 string recipeName = moduleRecipesManager.GetRecipeName(key);
10617 }
10618 }
10619
10620
10621 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10622 {
10623 super.GetDebugActions(outputList);
10624
10625
10631
10632
10637
10642
10643
10647
10648
10650 {
10654 }
10655
10658
10659
10663
10665
10666 InventoryLocation loc = new InventoryLocation();
10667 GetInventory().GetCurrentInventoryLocation(loc);
10669 {
10670 if (Gizmo_IsSupported())
10673 }
10674
10676 }
10677
10678
10679
10680
10682 {
10683 super.OnAction(action_id, player, ctx);
10684
10686 {
10687 switch (action_id)
10688 {
10691 return true;
10694 return true;
10695 }
10696 }
10697
10699 {
10700 switch (action_id)
10701 {
10703 Delete();
10704 return true;
10705 }
10706 }
10707
10708 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10709 {
10710 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10711 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10712 PlayerBase p = PlayerBase.Cast(player);
10713 if (
EActions.RECIPES_RANGE_START < 1000)
10714 {
10715 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10716 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10717 }
10718 }
10719 #ifndef SERVER
10720 else if (action_id ==
EActions.WATCH_PLAYER)
10721 {
10722 PluginDeveloper.SetDeveloperItemClientEx(player);
10723 }
10724 #endif
10726 {
10727 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10728 {
10729 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10730 OnDebugButtonPressServer(id + 1);
10731 }
10732
10733 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10734 {
10735 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10737 }
10738
10739 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10740 {
10741 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10743 }
10744
10745 else if (action_id ==
EActions.ADD_QUANTITY)
10746 {
10747 if (IsMagazine())
10748 {
10749 Magazine mag = Magazine.Cast(this);
10750 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10751 }
10752 else
10753 {
10755 }
10756
10757 if (m_EM)
10758 {
10759 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10760 }
10761
10762 }
10763
10764 else if (action_id ==
EActions.REMOVE_QUANTITY)
10765 {
10766 if (IsMagazine())
10767 {
10768 Magazine mag2 = Magazine.Cast(this);
10769 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10770 }
10771 else
10772 {
10774 }
10775 if (m_EM)
10776 {
10777 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10778 }
10779
10780 }
10781
10782 else if (action_id ==
EActions.SET_QUANTITY_0)
10783 {
10785
10786 if (m_EM)
10787 {
10788 m_EM.SetEnergy(0);
10789 }
10790 }
10791
10792 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10793 {
10795
10796 if (m_EM)
10797 {
10798 m_EM.SetEnergy(m_EM.GetEnergyMax());
10799 }
10800 }
10801
10802 else if (action_id ==
EActions.ADD_HEALTH)
10803 {
10804 AddHealth("","",GetMaxHealth("","Health")/5);
10805 }
10806 else if (action_id ==
EActions.REMOVE_HEALTH)
10807 {
10808 AddHealth("","",-GetMaxHealth("","Health")/5);
10809 }
10810 else if (action_id ==
EActions.DESTROY_HEALTH)
10811 {
10812 SetHealth01("","",0);
10813 }
10814 else if (action_id ==
EActions.WATCH_ITEM)
10815 {
10817 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10818 #ifdef DEVELOPER
10819 SetDebugDeveloper_item(this);
10820 #endif
10821 }
10822
10823 else if (action_id ==
EActions.ADD_TEMPERATURE)
10824 {
10825 AddTemperature(20);
10826
10827 }
10828
10829 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10830 {
10831 AddTemperature(-20);
10832
10833 }
10834
10835 else if (action_id ==
EActions.FLIP_FROZEN)
10836 {
10837 SetFrozen(!GetIsFrozen());
10838
10839 }
10840
10841 else if (action_id ==
EActions.ADD_WETNESS)
10842 {
10844
10845 }
10846
10847 else if (action_id ==
EActions.REMOVE_WETNESS)
10848 {
10850
10851 }
10852
10853 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10854 {
10857
10858
10859 }
10860
10861 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10862 {
10865 }
10866
10867 else if (action_id ==
EActions.MAKE_SPECIAL)
10868 {
10869 auto debugParams = DebugSpawnParams.WithPlayer(player);
10870 OnDebugSpawnEx(debugParams);
10871 }
10872
10873 }
10874
10875
10876 return false;
10877 }
10878
10879
10880
10881
10885
10888
10889
10890
10892 {
10893 return false;
10894 }
10895
10896
10898 {
10899 return true;
10900 }
10901
10902
10904 {
10905 return true;
10906 }
10907
10908
10909
10911 {
10912 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10914 }
10915
10918 {
10919 return null;
10920 }
10921
10923 {
10924 return false;
10925 }
10926
10928 {
10929 return false;
10930 }
10931
10935
10936
10938 {
10939 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10940 return module_repairing.CanRepair(this, item_repair_kit);
10941 }
10942
10943
10944 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10945 {
10946 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10947 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10948 }
10949
10950
10952 {
10953
10954
10955
10956
10957
10958
10959
10960
10961 return 1;
10962 }
10963
10964
10965
10967 {
10969 }
10970
10971
10972
10974 {
10976 }
10977
10978
10987 {
10988 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10989
10990 if (player)
10991 {
10992 player.MessageStatus(text);
10993 }
10994 }
10995
10996
11005 {
11006 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11007
11008 if (player)
11009 {
11010 player.MessageAction(text);
11011 }
11012 }
11013
11014
11023 {
11024 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11025
11026 if (player)
11027 {
11028 player.MessageFriendly(text);
11029 }
11030 }
11031
11032
11041 {
11042 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11043
11044 if (player)
11045 {
11046 player.MessageImportant(text);
11047 }
11048 }
11049
11051 {
11052 return true;
11053 }
11054
11055
11056 override bool KindOf(
string tag)
11057 {
11058 bool found = false;
11059 string item_name = this.
GetType();
11062
11063 int array_size = item_tag_array.Count();
11064 for (int i = 0; i < array_size; i++)
11065 {
11066 if (item_tag_array.Get(i) == tag)
11067 {
11068 found = true;
11069 break;
11070 }
11071 }
11072 return found;
11073 }
11074
11075
11077 {
11078
11079 super.OnRPC(sender, rpc_type,ctx);
11080
11081
11082 switch (rpc_type)
11083 {
11084 #ifndef SERVER
11085 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11086 Param2<bool, string> p = new Param2<bool, string>(false, "");
11087
11089 return;
11090
11091 bool play = p.param1;
11092 string soundSet = p.param2;
11093
11094 if (play)
11095 {
11097 {
11099 {
11101 }
11102 }
11103 else
11104 {
11106 }
11107 }
11108 else
11109 {
11111 }
11112
11113 break;
11114 #endif
11115
11116 }
11117
11119 {
11121 }
11122 }
11123
11124
11125
11126
11128 {
11129 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11130 return plugin.GetID(
name);
11131 }
11132
11134 {
11135 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11136 return plugin.GetName(id);
11137 }
11138
11141 {
11142
11143
11144 int varFlags;
11145 if (!ctx.
Read(varFlags))
11146 return;
11147
11148 if (varFlags & ItemVariableFlags.FLOAT)
11149 {
11151 }
11152 }
11153
11155 {
11156
11157 super.SerializeNumericalVars(floats_out);
11158
11159
11160
11162 {
11164 }
11165
11167 {
11169 }
11170
11172 {
11174 }
11175
11177 {
11182 }
11183
11185 {
11187 }
11188 }
11189
11191 {
11192
11193 super.DeSerializeNumericalVars(floats);
11194
11195
11196 int index = 0;
11197 int mask = Math.Round(floats.Get(index));
11198
11199 index++;
11200
11202 {
11204 {
11206 }
11207 else
11208 {
11209 float quantity = floats.Get(index);
11210 SetQuantity(quantity,
true,
false,
false,
false);
11211 }
11212 index++;
11213 }
11214
11216 {
11217 float wet = floats.Get(index);
11219 index++;
11220 }
11221
11223 {
11224 int liquidtype = Math.Round(floats.Get(index));
11226 index++;
11227 }
11228
11230 {
11232 index++;
11234 index++;
11236 index++;
11238 index++;
11239 }
11240
11242 {
11243 int cleanness = Math.Round(floats.Get(index));
11245 index++;
11246 }
11247 }
11248
11250 {
11251 super.WriteVarsToCTX(ctx);
11252
11253
11255 {
11257 }
11258
11260 {
11262 }
11263
11265 {
11267 }
11268
11270 {
11271 int r,g,b,a;
11277 }
11278
11280 {
11282 }
11283 }
11284
11286 {
11287 if (!super.ReadVarsFromCTX(ctx,version))
11288 return false;
11289
11290 int intValue;
11291 float value;
11292
11293 if (version < 140)
11294 {
11295 if (!ctx.
Read(intValue))
11296 return false;
11297
11298 m_VariablesMask = intValue;
11299 }
11300
11302 {
11303 if (!ctx.
Read(value))
11304 return false;
11305
11307 {
11309 }
11310 else
11311 {
11313 }
11314 }
11315
11316 if (version < 140)
11317 {
11319 {
11320 if (!ctx.
Read(value))
11321 return false;
11322 SetTemperatureDirect(value);
11323 }
11324 }
11325
11327 {
11328 if (!ctx.
Read(value))
11329 return false;
11331 }
11332
11334 {
11335 if (!ctx.
Read(intValue))
11336 return false;
11338 }
11339
11341 {
11342 int r,g,b,a;
11344 return false;
11346 return false;
11348 return false;
11350 return false;
11351
11353 }
11354
11356 {
11357 if (!ctx.
Read(intValue))
11358 return false;
11360 }
11361
11362 if (version >= 138 && version < 140)
11363 {
11365 {
11366 if (!ctx.
Read(intValue))
11367 return false;
11368 SetFrozen(intValue);
11369 }
11370 }
11371
11372 return true;
11373 }
11374
11375
11377 {
11380 {
11382 }
11383
11384 if (!super.OnStoreLoad(ctx, version))
11385 {
11387 return false;
11388 }
11389
11390 if (version >= 114)
11391 {
11392 bool hasQuickBarIndexSaved;
11393
11394 if (!ctx.
Read(hasQuickBarIndexSaved))
11395 {
11397 return false;
11398 }
11399
11400 if (hasQuickBarIndexSaved)
11401 {
11402 int itmQBIndex;
11403
11404
11405 if (!ctx.
Read(itmQBIndex))
11406 {
11408 return false;
11409 }
11410
11411 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11412 if (itmQBIndex != -1 && parentPlayer)
11413 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11414 }
11415 }
11416 else
11417 {
11418
11419 PlayerBase player;
11420 int itemQBIndex;
11421 if (version ==
int.
MAX)
11422 {
11423 if (!ctx.
Read(itemQBIndex))
11424 {
11426 return false;
11427 }
11428 }
11429 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11430 {
11431
11432 if (!ctx.
Read(itemQBIndex))
11433 {
11435 return false;
11436 }
11437 if (itemQBIndex != -1 && player)
11438 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11439 }
11440 }
11441
11442 if (version < 140)
11443 {
11444
11445 if (!LoadVariables(ctx, version))
11446 {
11448 return false;
11449 }
11450 }
11451
11452
11454 {
11456 return false;
11457 }
11458 if (version >= 132)
11459 {
11461 if (raib)
11462 {
11464 {
11466 return false;
11467 }
11468 }
11469 }
11470
11472 return true;
11473 }
11474
11475
11476
11478 {
11479 super.OnStoreSave(ctx);
11480
11481 PlayerBase player;
11482 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11483 {
11485
11486 int itemQBIndex = -1;
11487 itemQBIndex = player.FindQuickBarEntityIndex(this);
11488 ctx.
Write(itemQBIndex);
11489 }
11490 else
11491 {
11493 }
11494
11496
11498 if (raib)
11499 {
11501 }
11502 }
11503
11504
11506 {
11507 super.AfterStoreLoad();
11508
11510 {
11512 }
11513
11515 {
11518 }
11519 }
11520
11522 {
11523 super.EEOnAfterLoad();
11524
11526 {
11528 }
11529
11532 }
11533
11535 {
11536 return false;
11537 }
11538
11539
11540
11542 {
11544 {
11545 #ifdef PLATFORM_CONSOLE
11546
11548 {
11550 if (menu)
11551 {
11553 }
11554 }
11555 #endif
11556 }
11557
11559 {
11562 }
11563
11565 {
11566 SetWeightDirty();
11568 }
11570 {
11573 }
11574
11576 {
11579 }
11581 {
11584 }
11585
11586 super.OnVariablesSynchronized();
11587 }
11588
11589
11590
11592 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11593 {
11594 if (!IsServerCheck(allow_client))
11595 return false;
11596
11598 return false;
11599
11602
11603 if (value <= (min + 0.001))
11604 value = min;
11605
11606 if (value == min)
11607 {
11608 if (destroy_config)
11609 {
11610 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11611 if (dstr)
11612 {
11614 this.Delete();
11615 return true;
11616 }
11617 }
11618 else if (destroy_forced)
11619 {
11621 this.Delete();
11622 return true;
11623 }
11624
11626 }
11627
11630
11632 {
11634
11635 if (delta)
11637 }
11638
11640
11641 return false;
11642 }
11643
11644
11646 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11647 {
11649 }
11650
11652 {
11655 }
11656
11658 {
11661 }
11662
11664 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11665 {
11666 float value_clamped = Math.Clamp(value, 0, 1);
11668 SetQuantity(result, destroy_config, destroy_forced);
11669 }
11670
11671
11674 {
11676 }
11677
11679 {
11681 }
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11693 {
11694 int slot = -1;
11695 if (GetInventory())
11696 {
11697 InventoryLocation il = new InventoryLocation;
11698 GetInventory().GetCurrentInventoryLocation(il);
11700 }
11701
11703 }
11704
11706 {
11707 float quantity_max = 0;
11708
11710 {
11711 if (attSlotID != -1)
11712 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11713
11714 if (quantity_max <= 0)
11716 }
11717
11718 if (quantity_max <= 0)
11720
11721 return quantity_max;
11722 }
11723
11725 {
11727 }
11728
11730 {
11732 }
11733
11734
11736 {
11738 }
11739
11741 {
11743 }
11744
11746 {
11748 }
11749
11750
11752 {
11753
11754 float weightEx = GetWeightEx();
11755 float special = GetInventoryAndCargoWeight();
11756 return weightEx - special;
11757 }
11758
11759
11761 {
11763 }
11764
11766 {
11768 {
11769 #ifdef DEVELOPER
11770 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11771 {
11772 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11774 }
11775 #endif
11776
11777 return GetQuantity() * GetConfigWeightModified();
11778 }
11779 else if (HasEnergyManager())
11780 {
11781 #ifdef DEVELOPER
11782 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11783 {
11784 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11785 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11786 }
11787 #endif
11788 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11789 }
11790 else
11791 {
11792 #ifdef DEVELOPER
11793 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11794 {
11795 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11796 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11797 }
11798 #endif
11799 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11800 }
11801 }
11802
11805 {
11806 int item_count = 0;
11808
11809 if (GetInventory().GetCargo() != NULL)
11810 {
11811 item_count = GetInventory().GetCargo().GetItemCount();
11812 }
11813
11814 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11815 {
11816 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11817 if (item)
11818 item_count += item.GetNumberOfItems();
11819 }
11820 return item_count;
11821 }
11822
11825 {
11826 float weight = 0;
11827 float wetness = 1;
11828 if (include_wetness)
11831 {
11832 weight = wetness * m_ConfigWeight;
11833 }
11835 {
11836 weight = 1;
11837 }
11838 return weight;
11839 }
11840
11841
11842
11844 {
11845 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11846 {
11847 GameInventory inv = GetInventory();
11848 array<EntityAI> items = new array<EntityAI>;
11850 for (int i = 0; i < items.Count(); i++)
11851 {
11853 if (item)
11854 {
11856 }
11857 }
11858 }
11859 }
11860
11861
11862
11863
11865 {
11866 float energy = 0;
11867 if (HasEnergyManager())
11868 {
11869 energy = GetCompEM().GetEnergy();
11870 }
11871 return energy;
11872 }
11873
11874
11876 {
11877 super.OnEnergyConsumed();
11878
11880 }
11881
11883 {
11884 super.OnEnergyAdded();
11885
11887 }
11888
11889
11891 {
11892 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11893 {
11895 {
11896 float energy_0to1 = GetCompEM().GetEnergy0To1();
11898 }
11899 }
11900 }
11901
11902
11904 {
11905 return ConfigGetFloat("heatIsolation");
11906 }
11907
11909 {
11911 }
11912
11914 {
11915 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11916 if (
GetGame().ConfigIsExisting(paramPath))
11918
11919 return 0.0;
11920 }
11921
11923 {
11924 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11925 if (
GetGame().ConfigIsExisting(paramPath))
11927
11928 return 0.0;
11929 }
11930
11931 override void SetWet(
float value,
bool allow_client =
false)
11932 {
11933 if (!IsServerCheck(allow_client))
11934 return;
11935
11938
11940
11941 m_VarWet = Math.Clamp(value, min, max);
11942
11944 {
11947 }
11948 }
11949
11950 override void AddWet(
float value)
11951 {
11953 }
11954
11956 {
11958 }
11959
11961 {
11963 }
11964
11966 {
11968 }
11969
11971 {
11973 }
11974
11976 {
11978 }
11979
11980 override void OnWetChanged(
float newVal,
float oldVal)
11981 {
11984 if (newLevel != oldLevel)
11985 {
11987 }
11988 }
11989
11991 {
11992 SetWeightDirty();
11993 }
11994
11996 {
11997 return GetWetLevelInternal(
m_VarWet);
11998 }
11999
12000
12001
12003 {
12005 }
12006
12008 {
12010 }
12011
12013 {
12015 }
12016
12018 {
12020 }
12021
12022
12023
12025 {
12026 if (ConfigIsExisting("itemModelLength"))
12027 {
12028 return ConfigGetFloat("itemModelLength");
12029 }
12030 return 0;
12031 }
12032
12034 {
12035 if (ConfigIsExisting("itemAttachOffset"))
12036 {
12037 return ConfigGetFloat("itemAttachOffset");
12038 }
12039 return 0;
12040 }
12041
12042 override void SetCleanness(
int value,
bool allow_client =
false)
12043 {
12044 if (!IsServerCheck(allow_client))
12045 return;
12046
12048
12050
12053 }
12054
12056 {
12058 }
12059
12061 {
12062 return true;
12063 }
12064
12065
12066
12067
12069 {
12071 }
12072
12074 {
12076 }
12077
12078
12079
12080
12081 override void SetColor(
int r,
int g,
int b,
int a)
12082 {
12088 }
12090 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12091 {
12096 }
12097
12099 {
12101 }
12102
12105 {
12106 int r,g,b,a;
12108 r = r/255;
12109 g = g/255;
12110 b = b/255;
12111 a = a/255;
12112 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12113 }
12114
12115
12116
12117 override void SetLiquidType(
int value,
bool allow_client =
false)
12118 {
12119 if (!IsServerCheck(allow_client))
12120 return;
12121
12126 }
12127
12129 {
12130 return ConfigGetInt("varLiquidTypeInit");
12131 }
12132
12134 {
12136 }
12137
12139 {
12141 SetFrozen(false);
12142 }
12143
12146 {
12147 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12148 }
12149
12150
12153 {
12154 PlayerBase nplayer;
12155 if (PlayerBase.CastTo(nplayer, player))
12156 {
12158
12159 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12160 }
12161 }
12162
12163
12166 {
12167 PlayerBase nplayer;
12168 if (PlayerBase.CastTo(nplayer,player))
12169 {
12170
12171 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12172
12173 }
12174
12175
12176 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12177
12178
12179 if (HasEnergyManager())
12180 {
12181 GetCompEM().UpdatePlugState();
12182 }
12183 }
12184
12185
12187 {
12188 super.OnPlacementStarted(player);
12189
12191 }
12192
12193 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12194 {
12196 {
12197 m_AdminLog.OnPlacementComplete(player,
this);
12198 }
12199
12200 super.OnPlacementComplete(player, position, orientation);
12201 }
12202
12203
12204
12205
12206
12208 {
12210 {
12211 return true;
12212 }
12213 else
12214 {
12215 return false;
12216 }
12217 }
12218
12219
12221 {
12223 {
12225 }
12226 }
12227
12228
12230 {
12232 }
12233
12235 {
12237 }
12238
12239 override void InsertAgent(
int agent,
float count = 1)
12240 {
12241 if (count < 1)
12242 return;
12243
12245 }
12246
12249 {
12251 }
12252
12253
12255 {
12257 }
12258
12259
12260
12261
12262
12263
12264
12265
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
12301 {
12303 return false;
12304 return true;
12305 }
12306
12308 {
12309
12311 }
12312
12313
12316 {
12317 super.CheckForRoofLimited(timeTresholdMS);
12318
12320 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12321 {
12322 m_PreviousRoofTestTime = time;
12323 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12324 }
12325 }
12326
12327
12329 {
12331 {
12332 return 0;
12333 }
12334
12335 if (GetInventory().GetAttachmentSlotsCount() != 0)
12336 {
12337 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12338 if (filter)
12339 return filter.GetProtectionLevel(type, false, system);
12340 else
12341 return 0;
12342 }
12343
12344 string subclassPath, entryName;
12345
12346 switch (type)
12347 {
12349 entryName = "biological";
12350 break;
12352 entryName = "chemical";
12353 break;
12354 default:
12355 entryName = "biological";
12356 break;
12357 }
12358
12359 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12360
12362 }
12363
12364
12365
12368 {
12369 if (!IsMagazine())
12371
12373 }
12374
12375
12376
12377
12378
12383 {
12384 return true;
12385 }
12386
12388 {
12390 }
12391
12392
12393
12394
12395
12397 {
12398 if (parent)
12399 {
12400 if (parent.IsInherited(DayZInfected))
12401 return true;
12402
12403 if (!parent.IsRuined())
12404 return true;
12405 }
12406
12407 return true;
12408 }
12409
12411 {
12412 if (!super.CanPutAsAttachment(parent))
12413 {
12414 return false;
12415 }
12416
12417 if (!IsRuined() && !parent.IsRuined())
12418 {
12419 return true;
12420 }
12421
12422 return false;
12423 }
12424
12426 {
12427
12428
12429
12430
12431 return super.CanReceiveItemIntoCargo(item);
12432 }
12433
12435 {
12436
12437
12438
12439
12440 GameInventory attachmentInv = attachment.GetInventory();
12442 {
12443 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12444 return false;
12445 }
12446
12447 InventoryLocation loc = new InventoryLocation();
12448 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12449 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12450 return false;
12451
12452 return super.CanReceiveAttachment(attachment, slotId);
12453 }
12454
12456 {
12457 if (!super.CanReleaseAttachment(attachment))
12458 return false;
12459
12460 return GetInventory().AreChildrenAccessible();
12461 }
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12484 {
12485 int id = muzzle_owner.GetMuzzleID();
12486 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12487
12488 if (WPOF_array)
12489 {
12490 for (int i = 0; i < WPOF_array.Count(); i++)
12491 {
12492 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12493
12494 if (WPOF)
12495 {
12496 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12497 }
12498 }
12499 }
12500 }
12501
12502
12504 {
12505 int id = muzzle_owner.GetMuzzleID();
12507
12508 if (WPOBE_array)
12509 {
12510 for (int i = 0; i < WPOBE_array.Count(); i++)
12511 {
12512 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12513
12514 if (WPOBE)
12515 {
12516 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12517 }
12518 }
12519 }
12520 }
12521
12522
12524 {
12525 int id = muzzle_owner.GetMuzzleID();
12526 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12527
12528 if (WPOOH_array)
12529 {
12530 for (int i = 0; i < WPOOH_array.Count(); i++)
12531 {
12532 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12533
12534 if (WPOOH)
12535 {
12536 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12537 }
12538 }
12539 }
12540 }
12541
12542
12544 {
12545 int id = muzzle_owner.GetMuzzleID();
12546 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12547
12548 if (WPOOH_array)
12549 {
12550 for (int i = 0; i < WPOOH_array.Count(); i++)
12551 {
12552 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12553
12554 if (WPOOH)
12555 {
12556 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12557 }
12558 }
12559 }
12560 }
12561
12562
12564 {
12565 int id = muzzle_owner.GetMuzzleID();
12566 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12567
12568 if (WPOOH_array)
12569 {
12570 for (int i = 0; i < WPOOH_array.Count(); i++)
12571 {
12572 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12573
12574 if (WPOOH)
12575 {
12576 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12577 }
12578 }
12579 }
12580 }
12581
12582
12583
12585 {
12587 {
12588 return true;
12589 }
12590
12591 return false;
12592 }
12593
12595 {
12597 {
12598 return true;
12599 }
12600
12601 return false;
12602 }
12603
12605 {
12607 {
12608 return true;
12609 }
12610
12611 return false;
12612 }
12613
12615 {
12616 return false;
12617 }
12618
12621 {
12622 return UATimeSpent.DEFAULT_DEPLOY;
12623 }
12624
12625
12626
12627
12629 {
12631 SetSynchDirty();
12632 }
12633
12635 {
12637 }
12638
12639
12641 {
12642 return false;
12643 }
12644
12647 {
12648 string att_type = "None";
12649
12650 if (ConfigIsExisting("soundAttType"))
12651 {
12652 att_type = ConfigGetString("soundAttType");
12653 }
12654
12656 }
12657
12659 {
12661 }
12662
12663
12664
12665
12666
12672
12674 {
12677
12679 }
12680
12681
12683 {
12685 return;
12686
12688
12691
12694
12695 SoundParameters params = new SoundParameters();
12699 }
12700
12701
12703 {
12705 return;
12706
12708 SetSynchDirty();
12709
12712 }
12713
12714
12716 {
12718 return;
12719
12721 SetSynchDirty();
12722
12725 }
12726
12728 {
12730 }
12731
12733 {
12735 }
12736
12739 {
12740 if (!
GetGame().IsDedicatedServer())
12741 {
12742 if (ConfigIsExisting("attachSoundSet"))
12743 {
12744 string cfg_path = "";
12745 string soundset = "";
12746 string type_name =
GetType();
12747
12750 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12751 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12752
12753 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12754 {
12755 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12756 {
12757 if (cfg_slot_array[i] == slot_type)
12758 {
12759 soundset = cfg_soundset_array[i];
12760 break;
12761 }
12762 }
12763 }
12764
12765 if (soundset != "")
12766 {
12767 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12769 }
12770 }
12771 }
12772 }
12773
12775 {
12776
12777 }
12778
12779 void OnApply(PlayerBase player);
12780
12782 {
12783 return 1.0;
12784 };
12785
12787 {
12789 }
12790
12792 {
12794 }
12795
12797
12799 {
12800 SetDynamicPhysicsLifeTime(0.01);
12802 }
12803
12805 {
12806 array<string> zone_names = new array<string>;
12807 GetDamageZones(zone_names);
12808 for (int i = 0; i < zone_names.Count(); i++)
12809 {
12810 SetHealthMax(zone_names.Get(i),"Health");
12811 }
12812 SetHealthMax("","Health");
12813 }
12814
12817 {
12818 float global_health = GetHealth01("","Health");
12819 array<string> zones = new array<string>;
12820 GetDamageZones(zones);
12821
12822 for (int i = 0; i < zones.Count(); i++)
12823 {
12824 SetHealth01(zones.Get(i),"Health",global_health);
12825 }
12826 }
12827
12830 {
12831 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12832 }
12833
12835 {
12836 if (!hasRootAsPlayer)
12837 {
12838 if (refParentIB)
12839 {
12840
12841 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12842 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12843
12844 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12845 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12846
12849 }
12850 else
12851 {
12852
12855 }
12856 }
12857 }
12858
12860 {
12862 {
12863 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12864 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12865 {
12866 float heatPermCoef = 1.0;
12868 while (ent)
12869 {
12870 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12871 ent = ent.GetHierarchyParent();
12872 }
12873
12874 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12875 }
12876 }
12877 }
12878
12880 {
12881
12882 EntityAI parent = GetHierarchyParent();
12883 if (!parent)
12884 {
12885 hasParent = false;
12886 hasRootAsPlayer = false;
12887 }
12888 else
12889 {
12890 hasParent = true;
12891 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12892 refParentIB =
ItemBase.Cast(parent);
12893 }
12894 }
12895
12896 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12897 {
12898
12899 }
12900
12902 {
12903
12904 return false;
12905 }
12906
12908 {
12909
12910
12911 return false;
12912 }
12913
12915 {
12916
12917 return false;
12918 }
12919
12922 {
12923 return !GetIsFrozen() &&
IsOpen();
12924 }
12925
12927 {
12928 bool hasParent = false, hasRootAsPlayer = false;
12930
12931 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12932 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12933
12934 if (wwtu || foodDecay)
12935 {
12939
12940 if (processWetness || processTemperature || processDecay)
12941 {
12943
12944 if (processWetness)
12945 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12946
12947 if (processTemperature)
12949
12950 if (processDecay)
12951 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12952 }
12953 }
12954 }
12955
12958 {
12960 }
12961
12963 {
12966
12967 return super.GetTemperatureFreezeThreshold();
12968 }
12969
12971 {
12974
12975 return super.GetTemperatureThawThreshold();
12976 }
12977
12979 {
12982
12983 return super.GetItemOverheatThreshold();
12984 }
12985
12987 {
12989 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12990
12991 return super.GetTemperatureFreezeTime();
12992 }
12993
12995 {
12997 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12998
12999 return super.GetTemperatureThawTime();
13000 }
13001
13006
13008 {
13009 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13010 }
13011
13013 {
13014 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13015 }
13016
13019 {
13021 }
13022
13024 {
13026 }
13027
13029 {
13031 }
13032
13035 {
13036 return null;
13037 }
13038
13041 {
13042 return false;
13043 }
13044
13046 {
13048 {
13051 if (!trg)
13052 {
13054 explosive = this;
13055 }
13056
13057 explosive.PairRemote(trg);
13059
13060 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13061 trg.SetPersistentPairID(persistentID);
13062 explosive.SetPersistentPairID(persistentID);
13063
13064 return true;
13065 }
13066 return false;
13067 }
13068
13071 {
13072 float ret = 1.0;
13075 ret *= GetHealth01();
13076
13077 return ret;
13078 }
13079
13080 #ifdef DEVELOPER
13081 override void SetDebugItem()
13082 {
13083 super.SetDebugItem();
13084 _itemBase = this;
13085 }
13086
13088 {
13089 string text = super.GetDebugText();
13090
13092 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13093
13094 return text;
13095 }
13096 #endif
13097
13099 {
13100 return true;
13101 }
13102
13104
13106
13108 {
13111 }
13112
13113
13121
13137}
13138
13140{
13142 if (entity)
13143 {
13144 bool is_item = entity.IsInherited(
ItemBase);
13145 if (is_item && full_quantity)
13146 {
13149 }
13150 }
13151 else
13152 {
13154 return NULL;
13155 }
13156 return entity;
13157}
13158
13160{
13161 if (item)
13162 {
13163 if (health > 0)
13164 item.SetHealth("", "", health);
13165
13166 if (item.CanHaveTemperature())
13167 {
13169 if (item.CanFreeze())
13170 item.SetFrozen(false);
13171 }
13172
13173 if (item.HasEnergyManager())
13174 {
13175 if (quantity >= 0)
13176 {
13177 item.GetCompEM().SetEnergy0To1(quantity);
13178 }
13179 else
13180 {
13182 }
13183 }
13184 else if (item.IsMagazine())
13185 {
13186 Magazine mag = Magazine.Cast(item);
13187 if (quantity >= 0)
13188 {
13189 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13190 }
13191 else
13192 {
13194 }
13195
13196 }
13197 else
13198 {
13199 if (quantity >= 0)
13200 {
13201 item.SetQuantityNormalized(quantity, false);
13202 }
13203 else
13204 {
13206 }
13207
13208 }
13209 }
13210}
13211
13212#ifdef DEVELOPER
13214#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.