8308{
8310 {
8311 return true;
8312 }
8313};
8314
8315
8316
8318{
8322
8324
8327
8328
8329
8330
8331
8340
8346
8351
8356
8377 protected bool m_IsResultOfSplit
8378
8380
8385
8386
8387
8389
8393
8394
8395
8397
8400
8401
8402
8408
8409
8417
8420
8421
8423
8424
8426
8427
8432
8433
8438
8439
8441
8442
8444 {
8449
8450 if (!
GetGame().IsDedicatedServer())
8451 {
8453 {
8455
8457 {
8459 }
8460 }
8461
8464 }
8465
8466 m_OldLocation = null;
8467
8469 {
8471 }
8472
8473 if (ConfigIsExisting("headSelectionsToHide"))
8474 {
8477 }
8478
8480 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8481 {
8483 }
8484
8486
8487 m_IsResultOfSplit = false;
8488
8490 }
8491
8493 {
8494 super.InitItemVariables();
8495
8501 m_Count = ConfigGetInt(
"count");
8502
8505
8510
8513
8518
8530
8534
8535
8538 if (ConfigIsExisting("canBeSplit"))
8539 {
8542 }
8543
8545 if (ConfigIsExisting("itemBehaviour"))
8547
8548
8551 RegisterNetSyncVariableInt("m_VarLiquidType");
8552 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8553
8554 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8555 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8556 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8557
8558 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8559 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8560 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8561 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8562
8563 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8564 RegisterNetSyncVariableBool("m_IsTakeable");
8565 RegisterNetSyncVariableBool("m_IsHologram");
8566
8569 {
8572 }
8573
8575
8577 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8579
8580 }
8581
8583 {
8585 }
8586
8588 {
8591 {
8596 }
8597 }
8598
8599 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8600 {
8602 {
8605 }
8606
8608 }
8609
8611 {
8617 }
8618
8620
8622 {
8624
8625 if (!action)
8626 {
8627 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8628 return;
8629 }
8630
8632 if (!ai)
8633 {
8635 return;
8636 }
8637
8639 if (!action_array)
8640 {
8641 action_array = new array<ActionBase_Basic>;
8643 }
8644 if (LogManager.IsActionLogEnable())
8645 {
8646 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8647 }
8648
8649 if (action_array.Find(action) != -1)
8650 {
8651 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8652 }
8653 else
8654 {
8655 action_array.Insert(action);
8656 }
8657 }
8658
8660 {
8662 ActionBase action = player.GetActionManager().GetAction(actionName);
8665
8666 if (action_array)
8667 {
8668 action_array.RemoveItem(action);
8669 }
8670 }
8671
8672
8673
8675 {
8676 ActionOverrideData overrideData = new ActionOverrideData();
8680
8682 if (!actionMap)
8683 {
8686 }
8687
8688 actionMap.Insert(this.
Type(), overrideData);
8689
8690 }
8691
8693
8695
8696
8698 {
8701
8704
8705 string config_to_search = "CfgVehicles";
8706 string muzzle_owner_config;
8707
8709 {
8710 if (IsInherited(Weapon))
8711 config_to_search = "CfgWeapons";
8712
8713 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8714
8715 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8716
8718
8719 if (config_OnFire_subclass_count > 0)
8720 {
8721 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8722
8723 for (int i = 0; i < config_OnFire_subclass_count; i++)
8724 {
8725 string particle_class = "";
8727 string config_OnFire_entry = config_OnFire_class + particle_class;
8728 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8729 WPOF_array.Insert(WPOF);
8730 }
8731
8732
8734 }
8735 }
8736
8738 {
8739 config_to_search = "CfgWeapons";
8740 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8741
8742 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8743
8745
8746 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8747 {
8748 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8749
8750 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8751 {
8752 string particle_class2 = "";
8754 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8755 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8756 WPOBE_array.Insert(WPOBE);
8757 }
8758
8759
8761 }
8762 }
8763 }
8764
8765
8767 {
8770
8772 {
8773 string config_to_search = "CfgVehicles";
8774
8775 if (IsInherited(Weapon))
8776 config_to_search = "CfgWeapons";
8777
8778 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8779 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8780
8781 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8782 {
8783
8785
8787 {
8789 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8791 return;
8792 }
8793
8796
8797
8798
8800 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8801
8802 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8803 {
8804 string particle_class = "";
8806 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8808
8809 if (entry_type == CT_CLASS)
8810 {
8811 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8812 WPOOH_array.Insert(WPOF);
8813 }
8814 }
8815
8816
8818 }
8819 }
8820 }
8821
8823 {
8825 }
8826
8828 {
8830 {
8832
8835
8838
8839 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8840 }
8841 }
8842
8844 {
8846 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8847
8849 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8850
8852 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8853
8855 {
8857 }
8858 }
8859
8861 {
8863 }
8864
8866 {
8869 else
8871
8873 {
8876 }
8877 else
8878 {
8881
8884 }
8885
8887 }
8888
8890 {
8892 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8893 }
8894
8896 {
8898 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8900 }
8901
8903 {
8905 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8906 }
8907
8909 {
8912
8913 OverheatingParticle OP = new OverheatingParticle();
8918
8920 }
8921
8923 {
8926
8927 return -1;
8928 }
8929
8931 {
8933 {
8936
8937 for (int i = count; i > 0; --i)
8938 {
8939 int id = i - 1;
8942
8945
8946 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8947 {
8948 if (p)
8949 {
8952 }
8953 }
8954 }
8955 }
8956 }
8957
8959 {
8961 {
8963 {
8964 int id = i - 1;
8966
8967 if (OP)
8968 {
8970
8971 if (p)
8972 {
8974 }
8975
8976 delete OP;
8977 }
8978 }
8979
8982 }
8983 }
8984
8987 {
8988 return 0.0;
8989 }
8990
8991
8993 {
8994 return 250;
8995 }
8996
8998 {
8999 return 0;
9000 }
9001
9004 {
9006 return true;
9007
9008 return false;
9009 }
9010
9013 {
9016
9018 {
9020 }
9021 else
9022 {
9023
9025 }
9026
9028 }
9029
9036 {
9037 return -1;
9038 }
9039
9040
9041
9042
9044 {
9046 {
9048 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9049
9050 if (r_index >= 0)
9051 {
9052 InventoryLocation r_il = new InventoryLocation;
9053 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9054
9055 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9058 {
9059 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9060 }
9062 {
9063 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9064 }
9065
9066 }
9067
9068 player.GetHumanInventory().ClearUserReservedLocation(this);
9069 }
9070
9073 }
9074
9075
9076
9077
9079 {
9080 return ItemBase.m_DebugActionsMask;
9081 }
9082
9084 {
9085 return ItemBase.m_DebugActionsMask & mask;
9086 }
9087
9089 {
9090 ItemBase.m_DebugActionsMask = mask;
9091 }
9092
9094 {
9095 ItemBase.m_DebugActionsMask |= mask;
9096 }
9097
9099 {
9100 ItemBase.m_DebugActionsMask &= ~mask;
9101 }
9102
9104 {
9106 {
9108 }
9109 else
9110 {
9112 }
9113 }
9114
9115
9117 {
9118 if (GetEconomyProfile())
9119 {
9120 float q_max = GetEconomyProfile().GetQuantityMax();
9121 if (q_max > 0)
9122 {
9123 float q_min = GetEconomyProfile().GetQuantityMin();
9124 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9125
9127 {
9128 ComponentEnergyManager comp = GetCompEM();
9130 {
9132 }
9133 }
9135 {
9137
9138 }
9139
9140 }
9141 }
9142 }
9143
9146 {
9147 EntityAI parent = GetHierarchyParent();
9148
9149 if (parent)
9150 {
9151 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9152 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9153 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9154 }
9155 }
9156
9159 {
9160 EntityAI parent = GetHierarchyParent();
9161
9162 if (parent)
9163 {
9164 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9165 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9166 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9167 }
9168 }
9169
9171 {
9172
9173
9174
9175
9177
9179 {
9180 if (ScriptInputUserData.CanStoreInputUserData())
9181 {
9182 ScriptInputUserData ctx = new ScriptInputUserData;
9188 ctx.
Write(use_stack_max);
9191
9193 {
9194 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9195 }
9196 }
9197 }
9198 else if (!
GetGame().IsMultiplayer())
9199 {
9201 }
9202 }
9203
9205 {
9207 }
9208
9210 {
9212 }
9213
9215 {
9217 }
9218
9220 {
9221
9222 return false;
9223 }
9224
9226 {
9227 return false;
9228 }
9229
9233 {
9234 return false;
9235 }
9236
9238 {
9239 return "";
9240 }
9241
9243
9245 {
9246 return false;
9247 }
9248
9250 {
9251 return true;
9252 }
9253
9254
9255
9257 {
9258 return true;
9259 }
9260
9262 {
9263 return true;
9264 }
9265
9267 {
9268 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9270 }
9271
9273 {
9275 }
9276
9278 {
9280 if (!is_being_placed)
9282 SetSynchDirty();
9283 }
9284
9285
9287
9289 {
9291 }
9292
9294 {
9296 }
9297
9299 {
9300 return 1;
9301 }
9302
9304 {
9305 return false;
9306 }
9307
9309 {
9311 SetSynchDirty();
9312 }
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9349 {
9350 super.OnMovedInsideCargo(container);
9351
9352 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9353 }
9354
9355 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9356 {
9357 super.EEItemLocationChanged(oldLoc,newLoc);
9358
9359 PlayerBase new_player = null;
9360 PlayerBase old_player = null;
9361
9362 if (newLoc.GetParent())
9363 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9364
9365 if (oldLoc.GetParent())
9366 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9367
9369 {
9370 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9371
9372 if (r_index >= 0)
9373 {
9374 InventoryLocation r_il = new InventoryLocation;
9375 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9376
9377 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9380 {
9381 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9382 }
9384 {
9385 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9386 }
9387
9388 }
9389 }
9390
9392 {
9393 if (new_player)
9394 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9395
9396 if (new_player == old_player)
9397 {
9398
9399 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9400 {
9402 {
9403 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9404 {
9405 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9406 }
9407 }
9408 else
9409 {
9410 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9411 }
9412 }
9413
9414 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9415 {
9416 int type = oldLoc.GetType();
9418 {
9419 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9420 }
9422 {
9423 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9424 }
9425 }
9426 if (!m_OldLocation)
9427 {
9428 m_OldLocation = new InventoryLocation;
9429 }
9430 m_OldLocation.Copy(oldLoc);
9431 }
9432 else
9433 {
9434 if (m_OldLocation)
9435 {
9436 m_OldLocation.Reset();
9437 }
9438 }
9439
9441 }
9442 else
9443 {
9444 if (new_player)
9445 {
9446 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9447 if (res_index >= 0)
9448 {
9449 InventoryLocation il = new InventoryLocation;
9450 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9452 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9455 {
9456 il.
GetParent().GetOnReleaseLock().Invoke(it);
9457 }
9459 {
9461 }
9462
9463 }
9464 }
9466 {
9467
9469 }
9470
9471 if (m_OldLocation)
9472 {
9473 m_OldLocation.Reset();
9474 }
9475 }
9476 }
9477
9478 override void EOnContact(IEntity other, Contact extra)
9479 {
9481 {
9482 int liquidType = -1;
9484 if (impactSpeed > 0.0)
9485 {
9487 #ifndef SERVER
9489 #else
9491 SetSynchDirty();
9492 #endif
9494 }
9495 }
9496
9497 #ifdef SERVER
9498 if (GetCompEM() && GetCompEM().IsPlugged())
9499 {
9500 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9501 GetCompEM().UnplugThis();
9502 }
9503 #endif
9504 }
9505
9507
9509 {
9511 }
9512
9514 {
9515
9516 }
9517
9519 {
9520 super.OnItemLocationChanged(old_owner, new_owner);
9521
9522 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9523 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9524
9525 if (!relatedPlayer && playerNew)
9526 relatedPlayer = playerNew;
9527
9528 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9529 {
9531 if (actionMgr)
9532 {
9533 ActionBase currentAction = actionMgr.GetRunningAction();
9534 if (currentAction)
9536 }
9537 }
9538
9539 Man ownerPlayerOld = null;
9540 Man ownerPlayerNew = null;
9541
9542 if (old_owner)
9543 {
9544 if (old_owner.
IsMan())
9545 {
9546 ownerPlayerOld = Man.Cast(old_owner);
9547 }
9548 else
9549 {
9550 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9551 }
9552 }
9553 else
9554 {
9556 {
9558
9559 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9560 {
9561 GetCompEM().UnplugThis();
9562 }
9563 }
9564 }
9565
9566 if (new_owner)
9567 {
9568 if (new_owner.
IsMan())
9569 {
9570 ownerPlayerNew = Man.Cast(new_owner);
9571 }
9572 else
9573 {
9574 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9575 }
9576 }
9577
9578 if (ownerPlayerOld != ownerPlayerNew)
9579 {
9580 if (ownerPlayerOld)
9581 {
9582 array<EntityAI> subItemsExit = new array<EntityAI>;
9584 for (int i = 0; i < subItemsExit.Count(); i++)
9585 {
9588 }
9589 }
9590
9591 if (ownerPlayerNew)
9592 {
9593 array<EntityAI> subItemsEnter = new array<EntityAI>;
9595 for (int j = 0; j < subItemsEnter.Count(); j++)
9596 {
9599 }
9600 }
9601 }
9602 else if (ownerPlayerNew != null)
9603 {
9604 PlayerBase nplayer;
9605 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9606 {
9607 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9609 for (int k = 0; k < subItemsUpdate.Count(); k++)
9610 {
9612 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9613 }
9614 }
9615 }
9616
9617 if (old_owner)
9618 old_owner.OnChildItemRemoved(this);
9619 if (new_owner)
9620 new_owner.OnChildItemReceived(this);
9621 }
9622
9623
9625 {
9626 super.EEDelete(parent);
9627 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9628 if (player)
9629 {
9631
9632 if (player.IsAlive())
9633 {
9634 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9635 if (r_index >= 0)
9636 {
9637 InventoryLocation r_il = new InventoryLocation;
9638 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9639
9640 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9643 {
9644 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9645 }
9647 {
9648 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9649 }
9650
9651 }
9652
9653 player.RemoveQuickBarEntityShortcut(this);
9654 }
9655 }
9656 }
9657
9659 {
9660 super.EEKilled(killer);
9661
9664 {
9665 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9666 {
9667 if (IsMagazine())
9668 {
9669 if (Magazine.Cast(this).GetAmmoCount() > 0)
9670 {
9672 }
9673 }
9674 else
9675 {
9677 }
9678 }
9679 }
9680 }
9681
9683 {
9684 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9685
9686 super.OnWasAttached(parent, slot_id);
9687
9690
9692 }
9693
9695 {
9696 super.OnWasDetached(parent, slot_id);
9697
9700 }
9701
9703 {
9704 int idx;
9707
9708 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9709 if (inventory_slots.Count() < 1)
9710 {
9711 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9712 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9713 }
9714 else
9715 {
9716 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9717 }
9718
9719 idx = inventory_slots.Find(slot);
9720 if (idx < 0)
9721 return "";
9722
9723 return attach_types.Get(idx);
9724 }
9725
9727 {
9728 int idx = -1;
9729 string slot;
9730
9733
9734 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9735 if (inventory_slots.Count() < 1)
9736 {
9737 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9738 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9739 }
9740 else
9741 {
9742 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9743 if (detach_types.Count() < 1)
9744 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9745 }
9746
9747 for (int i = 0; i < inventory_slots.Count(); i++)
9748 {
9749 slot = inventory_slots.Get(i);
9750 }
9751
9752 if (slot != "")
9753 {
9754 if (detach_types.Count() == 1)
9755 idx = 0;
9756 else
9757 idx = inventory_slots.Find(slot);
9758 }
9759 if (idx < 0)
9760 return "";
9761
9762 return detach_types.Get(idx);
9763 }
9764
9766 {
9767
9769
9770
9771 float min_time = 1;
9772 float max_time = 3;
9773 float delay = Math.RandomFloat(min_time, max_time);
9774
9775 explode_timer.Run(delay, this, "DoAmmoExplosion");
9776 }
9777
9779 {
9780 Magazine magazine = Magazine.Cast(this);
9781 int pop_sounds_count = 6;
9782 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9783
9784
9785 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9786 string sound_name = pop_sounds[ sound_idx ];
9788
9789
9790 magazine.ServerAddAmmoCount(-1);
9791
9792
9793 float min_temp_to_explode = 100;
9794
9795 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9796 {
9798 }
9799 }
9800
9801
9802 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9803 {
9804 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9805
9806 const int CHANCE_DAMAGE_CARGO = 4;
9807 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9808 const int CHANCE_DAMAGE_NOTHING = 2;
9809
9811 {
9812 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9813 int chances;
9814 int rnd;
9815
9816 if (GetInventory().GetCargo())
9817 {
9818 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9819 rnd = Math.RandomInt(0,chances);
9820
9821 if (rnd < CHANCE_DAMAGE_CARGO)
9822 {
9824 }
9825 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9826 {
9828 }
9829 }
9830 else
9831 {
9832 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9833 rnd = Math.RandomInt(0,chances);
9834
9835 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9836 {
9838 }
9839 }
9840 }
9841 }
9842
9844 {
9845 if (GetInventory().GetCargo())
9846 {
9847 int item_count = GetInventory().GetCargo().GetItemCount();
9848 if (item_count > 0)
9849 {
9850 int random_pick = Math.RandomInt(0, item_count);
9852 if (!item.IsExplosive())
9853 {
9854 item.AddHealth("","",damage);
9855 return true;
9856 }
9857 }
9858 }
9859 return false;
9860 }
9861
9863 {
9864 int attachment_count = GetInventory().AttachmentCount();
9865 if (attachment_count > 0)
9866 {
9867 int random_pick = Math.RandomInt(0, attachment_count);
9868 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9869 if (!attachment.IsExplosive())
9870 {
9871 attachment.AddHealth("","",damage);
9872 return true;
9873 }
9874 }
9875 return false;
9876 }
9877
9879 {
9881 }
9882
9884 {
9886 return GetInventory().CanRemoveEntity();
9887
9888 return false;
9889 }
9890
9892 {
9894 return;
9895
9897 {
9898 if (ScriptInputUserData.CanStoreInputUserData())
9899 {
9900 ScriptInputUserData ctx = new ScriptInputUserData;
9905 ctx.
Write(destination_entity);
9909 }
9910 }
9911 else if (!
GetGame().IsMultiplayer())
9912 {
9914 }
9915 }
9916
9918 {
9920 return;
9921
9922 float split_quantity_new;
9926 InventoryLocation loc = new InventoryLocation;
9927
9928 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9929 {
9931 split_quantity_new = stack_max;
9932 else
9934
9935 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9936 if (new_item)
9937 {
9938 new_item.SetResultOfSplit(true);
9939 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9941 new_item.SetQuantity(split_quantity_new);
9942 }
9943 }
9944 else if (destination_entity && slot_id == -1)
9945 {
9946 if (quantity > stack_max)
9947 split_quantity_new = stack_max;
9948 else
9949 split_quantity_new = quantity;
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);
9963 }
9964 }
9965 else
9966 {
9967 if (stack_max != 0)
9968 {
9970 {
9972 }
9973
9974 if (split_quantity_new == 0)
9975 {
9976 if (!
GetGame().IsMultiplayer())
9977 player.PhysicalPredictiveDropItem(this);
9978 else
9979 player.ServerDropEntity(this);
9980 return;
9981 }
9982
9984
9985 if (new_item)
9986 {
9987 new_item.SetResultOfSplit(true);
9988 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9990 new_item.SetQuantity(stack_max);
9991 new_item.PlaceOnSurface();
9992 }
9993 }
9994 }
9995 }
9996
9998 {
10000 return;
10001
10002 float split_quantity_new;
10006 InventoryLocation loc = new InventoryLocation;
10007
10008 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10009 {
10011 split_quantity_new = stack_max;
10012 else
10014
10015 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10016 if (new_item)
10017 {
10018 new_item.SetResultOfSplit(true);
10019 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10021 new_item.SetQuantity(split_quantity_new);
10022 }
10023 }
10024 else if (destination_entity && slot_id == -1)
10025 {
10026 if (quantity > stack_max)
10027 split_quantity_new = stack_max;
10028 else
10029 split_quantity_new = quantity;
10030
10032 {
10035 }
10036
10037 if (new_item)
10038 {
10039 new_item.SetResultOfSplit(true);
10040 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10042 new_item.SetQuantity(split_quantity_new);
10043 }
10044 }
10045 else
10046 {
10047 if (stack_max != 0)
10048 {
10050 {
10052 }
10053
10055
10056 if (new_item)
10057 {
10058 new_item.SetResultOfSplit(true);
10059 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10061 new_item.SetQuantity(stack_max);
10062 new_item.PlaceOnSurface();
10063 }
10064 }
10065 }
10066 }
10067
10069 {
10071 return;
10072
10074 {
10075 if (ScriptInputUserData.CanStoreInputUserData())
10076 {
10077 ScriptInputUserData ctx = new ScriptInputUserData;
10082 dst.WriteToContext(ctx);
10084 }
10085 }
10086 else if (!
GetGame().IsMultiplayer())
10087 {
10089 }
10090 }
10091
10093 {
10095 return;
10096
10098 {
10099 if (ScriptInputUserData.CanStoreInputUserData())
10100 {
10101 ScriptInputUserData ctx = new ScriptInputUserData;
10106 ctx.
Write(destination_entity);
10112 }
10113 }
10114 else if (!
GetGame().IsMultiplayer())
10115 {
10117 }
10118 }
10119
10121 {
10123 }
10124
10126 {
10128 return this;
10129
10131 float split_quantity_new;
10133 if (dst.IsValid())
10134 {
10135 int slot_id = dst.GetSlot();
10137
10138 if (quantity > stack_max)
10139 split_quantity_new = stack_max;
10140 else
10141 split_quantity_new = quantity;
10142
10144
10145 if (new_item)
10146 {
10147 new_item.SetResultOfSplit(true);
10148 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10151 }
10152
10153 return new_item;
10154 }
10155
10156 return null;
10157 }
10158
10160 {
10162 return;
10163
10165 float split_quantity_new;
10167 if (destination_entity)
10168 {
10170 if (quantity > stackable)
10171 split_quantity_new = stackable;
10172 else
10173 split_quantity_new = quantity;
10174
10175 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10176 if (new_item)
10177 {
10178 new_item.SetResultOfSplit(true);
10179 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10181 new_item.SetQuantity(split_quantity_new);
10182 }
10183 }
10184 }
10185
10187 {
10189 return;
10190
10192 {
10193 if (ScriptInputUserData.CanStoreInputUserData())
10194 {
10195 ScriptInputUserData ctx = new ScriptInputUserData;
10200 ItemBase destination_entity =
this;
10201 ctx.
Write(destination_entity);
10205 }
10206 }
10207 else if (!
GetGame().IsMultiplayer())
10208 {
10210 }
10211 }
10212
10214 {
10216 return;
10217
10219 float split_quantity_new;
10221 if (player)
10222 {
10224 if (quantity > stackable)
10225 split_quantity_new = stackable;
10226 else
10227 split_quantity_new = quantity;
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);
10237 }
10238 }
10239 }
10240
10242 {
10244 return;
10245
10247 float split_quantity_new = Math.Floor(quantity * 0.5);
10248
10250
10251 if (new_item)
10252 {
10253 if (new_item.GetQuantityMax() < split_quantity_new)
10254 {
10255 split_quantity_new = new_item.GetQuantityMax();
10256 }
10257
10258 new_item.SetResultOfSplit(true);
10259 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10260
10262 {
10265 }
10266 else
10267 {
10270 }
10271 }
10272 }
10273
10275 {
10277 return;
10278
10280 float split_quantity_new = Math.Floor(quantity / 2);
10281
10282 InventoryLocation invloc = new InventoryLocation;
10284
10286 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10287
10288 if (new_item)
10289 {
10290 if (new_item.GetQuantityMax() < split_quantity_new)
10291 {
10292 split_quantity_new = new_item.GetQuantityMax();
10293 }
10295 {
10298 }
10299 else
10300 {
10303 }
10304 }
10305 }
10306
10309 {
10310 SetWeightDirty();
10312
10313 if (parent)
10314 parent.OnAttachmentQuantityChangedEx(this, delta);
10315
10317 {
10319 {
10321 }
10323 {
10324 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10326 }
10327 }
10328
10329 }
10330
10333 {
10334
10335 }
10336
10339 {
10341 }
10342
10344 {
10345 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10346
10348 {
10349 if (newLevel == GameConstants.STATE_RUINED)
10350 {
10352 EntityAI parent = GetHierarchyParent();
10353 if (parent && parent.IsFireplace())
10354 {
10355 CargoBase cargo = GetInventory().GetCargo();
10356 if (cargo)
10357 {
10359 {
10361 }
10362 }
10363 }
10364 }
10365
10367 {
10368
10370 return;
10371 }
10372
10373 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10374 {
10376 }
10377 }
10378 }
10379
10380
10382 {
10383 super.OnRightClick();
10384
10386 {
10388 {
10389 if (ScriptInputUserData.CanStoreInputUserData())
10390 {
10391 vector m4[4];
10393
10394 EntityAI root = GetHierarchyRoot();
10395
10396 InventoryLocation dst = new InventoryLocation;
10398 {
10399 if (root)
10400 {
10401 root.GetTransform(m4);
10403 }
10404 else
10405 GetInventory().GetCurrentInventoryLocation(dst);
10406 }
10407 else
10408 {
10410
10411
10412 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10413 {
10414 if (root)
10415 {
10416 root.GetTransform(m4);
10418 }
10419 else
10420 GetInventory().GetCurrentInventoryLocation(dst);
10421 }
10422 else
10423 {
10424 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10425 }
10426 }
10427
10428 ScriptInputUserData ctx = new ScriptInputUserData;
10436 }
10437 }
10438 else if (!
GetGame().IsMultiplayer())
10439 {
10441 }
10442 }
10443 }
10444
10445 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10446 {
10447
10448 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10449 return false;
10450
10451 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10452 return false;
10453
10454
10456 return false;
10457
10458
10459 Magazine mag = Magazine.Cast(this);
10460 if (mag)
10461 {
10462 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10463 return false;
10464
10465 if (stack_max_limit)
10466 {
10467 Magazine other_mag = Magazine.Cast(other_item);
10468 if (other_item)
10469 {
10470 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10471 return false;
10472 }
10473
10474 }
10475 }
10476 else
10477 {
10478
10480 return false;
10481
10483 return false;
10484 }
10485
10486 PlayerBase player = null;
10487 if (CastTo(player, GetHierarchyRootPlayer()))
10488 {
10489 if (player.GetInventory().HasAttachment(this))
10490 return false;
10491
10492 if (player.IsItemsToDelete())
10493 return false;
10494 }
10495
10496 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10497 return false;
10498
10499 int slotID;
10501 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10502 return false;
10503
10504 return true;
10505 }
10506
10508 {
10510 }
10511
10513 {
10514 return m_IsResultOfSplit;
10515 }
10516
10518 {
10519 m_IsResultOfSplit = value;
10520 }
10521
10523 {
10525 }
10526
10528 {
10529 float other_item_quantity = other_item.GetQuantity();
10530 float this_free_space;
10531
10533
10535
10536 if (other_item_quantity > this_free_space)
10537 {
10538 return this_free_space;
10539 }
10540 else
10541 {
10542 return other_item_quantity;
10543 }
10544 }
10545
10547 {
10549 }
10550
10552 {
10554 return;
10555
10556 if (!IsMagazine() && other_item)
10557 {
10559 if (quantity_used != 0)
10560 {
10561 float hp1 = GetHealth01("","");
10562 float hp2 = other_item.GetHealth01("","");
10563 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10564 hpResult = hpResult / (
GetQuantity() + quantity_used);
10565
10566 hpResult *= GetMaxHealth();
10567 Math.Round(hpResult);
10568 SetHealth("", "Health", hpResult);
10569
10571 other_item.AddQuantity(-quantity_used);
10572 }
10573 }
10575 }
10576
10578 {
10579 #ifdef SERVER
10580 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10581 GetHierarchyParent().IncreaseLifetimeUp();
10582 #endif
10583 };
10584
10586 {
10587 PlayerBase p = PlayerBase.Cast(player);
10588
10589 array<int> recipesIds = p.m_Recipes;
10590 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10591 if (moduleRecipesManager)
10592 {
10593 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10594 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10595 }
10596
10597 for (int i = 0;i < recipesIds.Count(); i++)
10598 {
10599 int key = recipesIds.Get(i);
10600 string recipeName = moduleRecipesManager.GetRecipeName(key);
10602 }
10603 }
10604
10605
10606 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10607 {
10608 super.GetDebugActions(outputList);
10609
10610
10615
10616
10620
10624
10625
10628
10629
10631 {
10634 }
10635
10637
10640
10644 }
10645
10646
10647
10648
10650 {
10651 super.OnAction(action_id, player, ctx);
10652 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10653 {
10654 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10655 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10656 PlayerBase p = PlayerBase.Cast(player);
10657 if (
EActions.RECIPES_RANGE_START < 1000)
10658 {
10659 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10660 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10661 }
10662 }
10663 #ifndef SERVER
10664 else if (action_id ==
EActions.WATCH_PLAYER)
10665 {
10666 PluginDeveloper.SetDeveloperItemClientEx(player);
10667 }
10668 #endif
10670 {
10671 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10672 {
10673 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10674 OnDebugButtonPressServer(id + 1);
10675 }
10676
10677 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10678 {
10679 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10681 }
10682
10683 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10684 {
10685 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10687 }
10688
10689 else if (action_id ==
EActions.ADD_QUANTITY)
10690 {
10691 if (IsMagazine())
10692 {
10693 Magazine mag = Magazine.Cast(this);
10694 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10695 }
10696 else
10697 {
10699 }
10700
10701 if (m_EM)
10702 {
10703 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10704 }
10705
10706 }
10707
10708 else if (action_id ==
EActions.REMOVE_QUANTITY)
10709 {
10710 if (IsMagazine())
10711 {
10712 Magazine mag2 = Magazine.Cast(this);
10713 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10714 }
10715 else
10716 {
10718 }
10719 if (m_EM)
10720 {
10721 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10722 }
10723
10724 }
10725
10726 else if (action_id ==
EActions.SET_QUANTITY_0)
10727 {
10729
10730 if (m_EM)
10731 {
10732 m_EM.SetEnergy(0);
10733 }
10734 }
10735
10736 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10737 {
10739
10740 if (m_EM)
10741 {
10742 m_EM.SetEnergy(m_EM.GetEnergyMax());
10743 }
10744 }
10745
10746 else if (action_id ==
EActions.ADD_HEALTH)
10747 {
10748 AddHealth("","",GetMaxHealth("","Health")/5);
10749 }
10750 else if (action_id ==
EActions.REMOVE_HEALTH)
10751 {
10752 AddHealth("","",-GetMaxHealth("","Health")/5);
10753 }
10754 else if (action_id ==
EActions.DESTROY_HEALTH)
10755 {
10756 SetHealth01("","",0);
10757 }
10758 else if (action_id ==
EActions.WATCH_ITEM)
10759 {
10761 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10762 #ifdef DEVELOPER
10763 SetDebugDeveloper_item(this);
10764 #endif
10765 }
10766
10767 else if (action_id ==
EActions.ADD_TEMPERATURE)
10768 {
10769 AddTemperature(20);
10770
10771 }
10772
10773 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10774 {
10775 AddTemperature(-20);
10776
10777 }
10778
10779 else if (action_id ==
EActions.FLIP_FROZEN)
10780 {
10781 SetFrozen(!GetIsFrozen());
10782
10783 }
10784
10785 else if (action_id ==
EActions.ADD_WETNESS)
10786 {
10788
10789 }
10790
10791 else if (action_id ==
EActions.REMOVE_WETNESS)
10792 {
10794
10795 }
10796
10797 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10798 {
10801
10802
10803 }
10804
10805 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10806 {
10809 }
10810
10811 else if (action_id ==
EActions.MAKE_SPECIAL)
10812 {
10813 auto debugParams = DebugSpawnParams.WithPlayer(player);
10814 OnDebugSpawnEx(debugParams);
10815 }
10816
10817 else if (action_id ==
EActions.DELETE)
10818 {
10819 Delete();
10820 }
10821
10822 }
10823
10824
10825 return false;
10826 }
10827
10828
10829
10830
10834
10837
10838
10839
10841 {
10842 return false;
10843 }
10844
10845
10847 {
10848 return true;
10849 }
10850
10851
10853 {
10854 return true;
10855 }
10856
10857
10858
10860 {
10861 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10863 }
10864
10867 {
10868 return null;
10869 }
10870
10872 {
10873 return false;
10874 }
10875
10877 {
10878 return false;
10879 }
10880
10884
10885
10887 {
10888 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10889 return module_repairing.CanRepair(this, item_repair_kit);
10890 }
10891
10892
10893 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10894 {
10895 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10896 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10897 }
10898
10899
10901 {
10902
10903
10904
10905
10906
10907
10908
10909
10910 return 1;
10911 }
10912
10913
10914
10916 {
10918 }
10919
10920
10921
10923 {
10925 }
10926
10927
10936 {
10937 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10938
10939 if (player)
10940 {
10941 player.MessageStatus(text);
10942 }
10943 }
10944
10945
10954 {
10955 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10956
10957 if (player)
10958 {
10959 player.MessageAction(text);
10960 }
10961 }
10962
10963
10972 {
10973 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10974
10975 if (player)
10976 {
10977 player.MessageFriendly(text);
10978 }
10979 }
10980
10981
10990 {
10991 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10992
10993 if (player)
10994 {
10995 player.MessageImportant(text);
10996 }
10997 }
10998
11000 {
11001 return true;
11002 }
11003
11004
11005 override bool KindOf(
string tag)
11006 {
11007 bool found = false;
11008 string item_name = this.
GetType();
11011
11012 int array_size = item_tag_array.Count();
11013 for (int i = 0; i < array_size; i++)
11014 {
11015 if (item_tag_array.Get(i) == tag)
11016 {
11017 found = true;
11018 break;
11019 }
11020 }
11021 return found;
11022 }
11023
11024
11026 {
11027
11028 super.OnRPC(sender, rpc_type,ctx);
11029
11030
11031 switch (rpc_type)
11032 {
11033 #ifndef SERVER
11034 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11035 Param2<bool, string> p = new Param2<bool, string>(false, "");
11036
11038 return;
11039
11040 bool play = p.param1;
11041 string soundSet = p.param2;
11042
11043 if (play)
11044 {
11046 {
11048 {
11050 }
11051 }
11052 else
11053 {
11055 }
11056 }
11057 else
11058 {
11060 }
11061
11062 break;
11063 #endif
11064
11065 }
11066
11068 {
11070 }
11071 }
11072
11073
11074
11075
11077 {
11078 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11079 return plugin.GetID(
name);
11080 }
11081
11083 {
11084 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11085 return plugin.GetName(id);
11086 }
11087
11090 {
11091
11092
11093 int varFlags;
11094 if (!ctx.
Read(varFlags))
11095 return;
11096
11097 if (varFlags & ItemVariableFlags.FLOAT)
11098 {
11100 }
11101 }
11102
11104 {
11105
11106 super.SerializeNumericalVars(floats_out);
11107
11108
11109
11111 {
11113 }
11114
11116 {
11118 }
11119
11121 {
11123 }
11124
11126 {
11131 }
11132
11134 {
11136 }
11137 }
11138
11140 {
11141
11142 super.DeSerializeNumericalVars(floats);
11143
11144
11145 int index = 0;
11146 int mask = Math.Round(floats.Get(index));
11147
11148 index++;
11149
11151 {
11153 {
11155 }
11156 else
11157 {
11158 float quantity = floats.Get(index);
11159 SetQuantity(quantity,
true,
false,
false,
false);
11160 }
11161 index++;
11162 }
11163
11165 {
11166 float wet = floats.Get(index);
11168 index++;
11169 }
11170
11172 {
11173 int liquidtype = Math.Round(floats.Get(index));
11175 index++;
11176 }
11177
11179 {
11181 index++;
11183 index++;
11185 index++;
11187 index++;
11188 }
11189
11191 {
11192 int cleanness = Math.Round(floats.Get(index));
11194 index++;
11195 }
11196 }
11197
11199 {
11200 super.WriteVarsToCTX(ctx);
11201
11202
11204 {
11206 }
11207
11209 {
11211 }
11212
11214 {
11216 }
11217
11219 {
11220 int r,g,b,a;
11226 }
11227
11229 {
11231 }
11232 }
11233
11235 {
11236 if (!super.ReadVarsFromCTX(ctx,version))
11237 return false;
11238
11239 int intValue;
11240 float value;
11241
11242 if (version < 140)
11243 {
11244 if (!ctx.
Read(intValue))
11245 return false;
11246
11247 m_VariablesMask = intValue;
11248 }
11249
11251 {
11252 if (!ctx.
Read(value))
11253 return false;
11254
11256 {
11258 }
11259 else
11260 {
11262 }
11263 }
11264
11265 if (version < 140)
11266 {
11268 {
11269 if (!ctx.
Read(value))
11270 return false;
11271 SetTemperatureDirect(value);
11272 }
11273 }
11274
11276 {
11277 if (!ctx.
Read(value))
11278 return false;
11280 }
11281
11283 {
11284 if (!ctx.
Read(intValue))
11285 return false;
11287 }
11288
11290 {
11291 int r,g,b,a;
11293 return false;
11295 return false;
11297 return false;
11299 return false;
11300
11302 }
11303
11305 {
11306 if (!ctx.
Read(intValue))
11307 return false;
11309 }
11310
11311 if (version >= 138 && version < 140)
11312 {
11314 {
11315 if (!ctx.
Read(intValue))
11316 return false;
11317 SetFrozen(intValue);
11318 }
11319 }
11320
11321 return true;
11322 }
11323
11324
11326 {
11329 {
11331 }
11332
11333 if (!super.OnStoreLoad(ctx, version))
11334 {
11336 return false;
11337 }
11338
11339 if (version >= 114)
11340 {
11341 bool hasQuickBarIndexSaved;
11342
11343 if (!ctx.
Read(hasQuickBarIndexSaved))
11344 {
11346 return false;
11347 }
11348
11349 if (hasQuickBarIndexSaved)
11350 {
11351 int itmQBIndex;
11352
11353
11354 if (!ctx.
Read(itmQBIndex))
11355 {
11357 return false;
11358 }
11359
11360 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11361 if (itmQBIndex != -1 && parentPlayer)
11362 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11363 }
11364 }
11365 else
11366 {
11367
11368 PlayerBase player;
11369 int itemQBIndex;
11370 if (version ==
int.
MAX)
11371 {
11372 if (!ctx.
Read(itemQBIndex))
11373 {
11375 return false;
11376 }
11377 }
11378 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11379 {
11380
11381 if (!ctx.
Read(itemQBIndex))
11382 {
11384 return false;
11385 }
11386 if (itemQBIndex != -1 && player)
11387 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11388 }
11389 }
11390
11391 if (version < 140)
11392 {
11393
11394 if (!LoadVariables(ctx, version))
11395 {
11397 return false;
11398 }
11399 }
11400
11401
11403 {
11405 return false;
11406 }
11407 if (version >= 132)
11408 {
11410 if (raib)
11411 {
11413 {
11415 return false;
11416 }
11417 }
11418 }
11419
11421 return true;
11422 }
11423
11424
11425
11427 {
11428 super.OnStoreSave(ctx);
11429
11430 PlayerBase player;
11431 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11432 {
11434
11435 int itemQBIndex = -1;
11436 itemQBIndex = player.FindQuickBarEntityIndex(this);
11437 ctx.
Write(itemQBIndex);
11438 }
11439 else
11440 {
11442 }
11443
11445
11447 if (raib)
11448 {
11450 }
11451 }
11452
11453
11455 {
11456 super.AfterStoreLoad();
11457
11459 {
11461 }
11462
11464 {
11467 }
11468 }
11469
11471 {
11472 super.EEOnAfterLoad();
11473
11475 {
11477 }
11478
11481 }
11482
11484 {
11485 return false;
11486 }
11487
11488
11489
11491 {
11493 {
11494 #ifdef PLATFORM_CONSOLE
11495
11497 {
11499 if (menu)
11500 {
11502 }
11503 }
11504 #endif
11505 }
11506
11508 {
11511 }
11512
11514 {
11515 SetWeightDirty();
11517 }
11519 {
11522 }
11523
11525 {
11528 }
11530 {
11533 }
11534
11535 super.OnVariablesSynchronized();
11536 }
11537
11538
11539
11541 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11542 {
11543 if (!IsServerCheck(allow_client))
11544 return false;
11545
11547 return false;
11548
11551
11552 if (value <= (min + 0.001))
11553 value = min;
11554
11555 if (value == min)
11556 {
11557 if (destroy_config)
11558 {
11559 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11560 if (dstr)
11561 {
11563 this.Delete();
11564 return true;
11565 }
11566 }
11567 else if (destroy_forced)
11568 {
11570 this.Delete();
11571 return true;
11572 }
11573
11575 }
11576
11579
11581 {
11583
11584 if (delta)
11586 }
11587
11589
11590 return false;
11591 }
11592
11593
11595 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11596 {
11598 }
11599
11601 {
11604 }
11605
11607 {
11610 }
11611
11614 {
11615 float value_clamped = Math.Clamp(value, 0, 1);
11617 SetQuantity(result, destroy_config, destroy_forced);
11618 }
11619
11620
11623 {
11625 }
11626
11628 {
11630 }
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11642 {
11643 int slot = -1;
11644 if (GetInventory())
11645 {
11646 InventoryLocation il = new InventoryLocation;
11647 GetInventory().GetCurrentInventoryLocation(il);
11649 }
11650
11652 }
11653
11655 {
11656 float quantity_max = 0;
11657
11659 {
11660 if (attSlotID != -1)
11661 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11662
11663 if (quantity_max <= 0)
11665 }
11666
11667 if (quantity_max <= 0)
11669
11670 return quantity_max;
11671 }
11672
11674 {
11676 }
11677
11679 {
11681 }
11682
11683
11685 {
11687 }
11688
11690 {
11692 }
11693
11695 {
11697 }
11698
11699
11701 {
11702
11703 float weightEx = GetWeightEx();
11704 float special = GetInventoryAndCargoWeight();
11705 return weightEx - special;
11706 }
11707
11708
11710 {
11712 }
11713
11715 {
11717 {
11718 #ifdef DEVELOPER
11719 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11720 {
11721 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11723 }
11724 #endif
11725
11726 return GetQuantity() * GetConfigWeightModified();
11727 }
11728 else if (HasEnergyManager())
11729 {
11730 #ifdef DEVELOPER
11731 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11732 {
11733 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11734 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11735 }
11736 #endif
11737 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11738 }
11739 else
11740 {
11741 #ifdef DEVELOPER
11742 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11743 {
11744 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11745 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11746 }
11747 #endif
11748 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11749 }
11750 }
11751
11754 {
11755 int item_count = 0;
11757
11758 if (GetInventory().GetCargo() != NULL)
11759 {
11760 item_count = GetInventory().GetCargo().GetItemCount();
11761 }
11762
11763 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11764 {
11765 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11766 if (item)
11767 item_count += item.GetNumberOfItems();
11768 }
11769 return item_count;
11770 }
11771
11774 {
11775 float weight = 0;
11776 float wetness = 1;
11777 if (include_wetness)
11780 {
11781 weight = wetness * m_ConfigWeight;
11782 }
11784 {
11785 weight = 1;
11786 }
11787 return weight;
11788 }
11789
11790
11791
11793 {
11794 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11795 {
11796 GameInventory inv = GetInventory();
11797 array<EntityAI> items = new array<EntityAI>;
11799 for (int i = 0; i < items.Count(); i++)
11800 {
11802 if (item)
11803 {
11805 }
11806 }
11807 }
11808 }
11809
11810
11811
11812
11814 {
11815 float energy = 0;
11816 if (HasEnergyManager())
11817 {
11818 energy = GetCompEM().GetEnergy();
11819 }
11820 return energy;
11821 }
11822
11823
11825 {
11826 super.OnEnergyConsumed();
11827
11829 }
11830
11832 {
11833 super.OnEnergyAdded();
11834
11836 }
11837
11838
11840 {
11841 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11842 {
11844 {
11845 float energy_0to1 = GetCompEM().GetEnergy0To1();
11847 }
11848 }
11849 }
11850
11851
11853 {
11854 return ConfigGetFloat("heatIsolation");
11855 }
11856
11858 {
11860 }
11861
11863 {
11864 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11865 if (
GetGame().ConfigIsExisting(paramPath))
11867
11868 return 0.0;
11869 }
11870
11872 {
11873 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11874 if (
GetGame().ConfigIsExisting(paramPath))
11876
11877 return 0.0;
11878 }
11879
11880 override void SetWet(
float value,
bool allow_client =
false)
11881 {
11882 if (!IsServerCheck(allow_client))
11883 return;
11884
11887
11889
11890 m_VarWet = Math.Clamp(value, min, max);
11891
11893 {
11896 }
11897 }
11898
11899 override void AddWet(
float value)
11900 {
11902 }
11903
11905 {
11907 }
11908
11910 {
11912 }
11913
11915 {
11917 }
11918
11920 {
11922 }
11923
11925 {
11927 }
11928
11929 override void OnWetChanged(
float newVal,
float oldVal)
11930 {
11933 if (newLevel != oldLevel)
11934 {
11936 }
11937 }
11938
11940 {
11941 SetWeightDirty();
11942 }
11943
11945 {
11946 return GetWetLevelInternal(
m_VarWet);
11947 }
11948
11949
11950
11952 {
11954 }
11955
11957 {
11959 }
11960
11962 {
11964 }
11965
11967 {
11969 }
11970
11971
11972
11974 {
11975 if (ConfigIsExisting("itemModelLength"))
11976 {
11977 return ConfigGetFloat("itemModelLength");
11978 }
11979 return 0;
11980 }
11981
11983 {
11984 if (ConfigIsExisting("itemAttachOffset"))
11985 {
11986 return ConfigGetFloat("itemAttachOffset");
11987 }
11988 return 0;
11989 }
11990
11991 override void SetCleanness(
int value,
bool allow_client =
false)
11992 {
11993 if (!IsServerCheck(allow_client))
11994 return;
11995
11997
11999
12002 }
12003
12005 {
12007 }
12008
12010 {
12011 return true;
12012 }
12013
12014
12015
12016
12018 {
12020 }
12021
12023 {
12025 }
12026
12027
12028
12029
12030 override void SetColor(
int r,
int g,
int b,
int a)
12031 {
12037 }
12039 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12040 {
12045 }
12046
12048 {
12050 }
12051
12054 {
12055 int r,g,b,a;
12057 r = r/255;
12058 g = g/255;
12059 b = b/255;
12060 a = a/255;
12061 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12062 }
12063
12064
12065
12066 override void SetLiquidType(
int value,
bool allow_client =
false)
12067 {
12068 if (!IsServerCheck(allow_client))
12069 return;
12070
12075 }
12076
12078 {
12079 return ConfigGetInt("varLiquidTypeInit");
12080 }
12081
12083 {
12085 }
12086
12088 {
12090 SetFrozen(false);
12091 }
12092
12095 {
12096 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12097 }
12098
12099
12102 {
12103 PlayerBase nplayer;
12104 if (PlayerBase.CastTo(nplayer, player))
12105 {
12107
12108 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12109 }
12110 }
12111
12112
12115 {
12116 PlayerBase nplayer;
12117 if (PlayerBase.CastTo(nplayer,player))
12118 {
12119
12120 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12121
12122 }
12123
12124
12125 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12126
12127
12128 if (HasEnergyManager())
12129 {
12130 GetCompEM().UpdatePlugState();
12131 }
12132 }
12133
12134
12136 {
12137 super.OnPlacementStarted(player);
12138
12140 }
12141
12142 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12143 {
12145 {
12146 m_AdminLog.OnPlacementComplete(player,
this);
12147 }
12148
12149 super.OnPlacementComplete(player, position, orientation);
12150 }
12151
12152
12153
12154
12155
12157 {
12159 {
12160 return true;
12161 }
12162 else
12163 {
12164 return false;
12165 }
12166 }
12167
12168
12170 {
12172 {
12174 }
12175 }
12176
12177
12179 {
12181 }
12182
12184 {
12186 }
12187
12188 override void InsertAgent(
int agent,
float count = 1)
12189 {
12190 if (count < 1)
12191 return;
12192
12194 }
12195
12198 {
12200 }
12201
12202
12204 {
12206 }
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12250 {
12252 return false;
12253 return true;
12254 }
12255
12257 {
12258
12260 }
12261
12262
12265 {
12266 super.CheckForRoofLimited(timeTresholdMS);
12267
12269 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12270 {
12271 m_PreviousRoofTestTime = time;
12272 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12273 }
12274 }
12275
12276
12278 {
12280 {
12281 return 0;
12282 }
12283
12284 if (GetInventory().GetAttachmentSlotsCount() != 0)
12285 {
12286 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12287 if (filter)
12288 return filter.GetProtectionLevel(type, false, system);
12289 else
12290 return 0;
12291 }
12292
12293 string subclassPath, entryName;
12294
12295 switch (type)
12296 {
12298 entryName = "biological";
12299 break;
12301 entryName = "chemical";
12302 break;
12303 default:
12304 entryName = "biological";
12305 break;
12306 }
12307
12308 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12309
12311 }
12312
12313
12314
12317 {
12318 if (!IsMagazine())
12320
12322 }
12323
12324
12325
12326
12327
12332 {
12333 return true;
12334 }
12335
12337 {
12339 }
12340
12341
12342
12343
12344
12346 {
12347 if (parent)
12348 {
12349 if (parent.IsInherited(DayZInfected))
12350 return true;
12351
12352 if (!parent.IsRuined())
12353 return true;
12354 }
12355
12356 return true;
12357 }
12358
12360 {
12361 if (!super.CanPutAsAttachment(parent))
12362 {
12363 return false;
12364 }
12365
12366 if (!IsRuined() && !parent.IsRuined())
12367 {
12368 return true;
12369 }
12370
12371 return false;
12372 }
12373
12375 {
12376
12377
12378
12379
12380 return super.CanReceiveItemIntoCargo(item);
12381 }
12382
12384 {
12385
12386
12387
12388
12389 GameInventory attachmentInv = attachment.GetInventory();
12391 {
12392 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12393 return false;
12394 }
12395
12396 InventoryLocation loc = new InventoryLocation();
12397 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12398 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12399 return false;
12400
12401 return super.CanReceiveAttachment(attachment, slotId);
12402 }
12403
12405 {
12406 if (!super.CanReleaseAttachment(attachment))
12407 return false;
12408
12409 return GetInventory().AreChildrenAccessible();
12410 }
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12433 {
12434 int id = muzzle_owner.GetMuzzleID();
12435 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12436
12437 if (WPOF_array)
12438 {
12439 for (int i = 0; i < WPOF_array.Count(); i++)
12440 {
12441 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12442
12443 if (WPOF)
12444 {
12445 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12446 }
12447 }
12448 }
12449 }
12450
12451
12453 {
12454 int id = muzzle_owner.GetMuzzleID();
12456
12457 if (WPOBE_array)
12458 {
12459 for (int i = 0; i < WPOBE_array.Count(); i++)
12460 {
12461 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12462
12463 if (WPOBE)
12464 {
12465 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12466 }
12467 }
12468 }
12469 }
12470
12471
12473 {
12474 int id = muzzle_owner.GetMuzzleID();
12475 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12476
12477 if (WPOOH_array)
12478 {
12479 for (int i = 0; i < WPOOH_array.Count(); i++)
12480 {
12481 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12482
12483 if (WPOOH)
12484 {
12485 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12486 }
12487 }
12488 }
12489 }
12490
12491
12493 {
12494 int id = muzzle_owner.GetMuzzleID();
12495 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12496
12497 if (WPOOH_array)
12498 {
12499 for (int i = 0; i < WPOOH_array.Count(); i++)
12500 {
12501 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12502
12503 if (WPOOH)
12504 {
12505 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12506 }
12507 }
12508 }
12509 }
12510
12511
12513 {
12514 int id = muzzle_owner.GetMuzzleID();
12515 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12516
12517 if (WPOOH_array)
12518 {
12519 for (int i = 0; i < WPOOH_array.Count(); i++)
12520 {
12521 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12522
12523 if (WPOOH)
12524 {
12525 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12526 }
12527 }
12528 }
12529 }
12530
12531
12532
12534 {
12536 {
12537 return true;
12538 }
12539
12540 return false;
12541 }
12542
12544 {
12546 {
12547 return true;
12548 }
12549
12550 return false;
12551 }
12552
12554 {
12556 {
12557 return true;
12558 }
12559
12560 return false;
12561 }
12562
12564 {
12565 return false;
12566 }
12567
12570 {
12571 return UATimeSpent.DEFAULT_DEPLOY;
12572 }
12573
12574
12575
12576
12578 {
12580 SetSynchDirty();
12581 }
12582
12584 {
12586 }
12587
12588
12590 {
12591 return false;
12592 }
12593
12596 {
12597 string att_type = "None";
12598
12599 if (ConfigIsExisting("soundAttType"))
12600 {
12601 att_type = ConfigGetString("soundAttType");
12602 }
12603
12605 }
12606
12608 {
12610 }
12611
12612
12613
12614
12615
12619
12621 {
12624
12626 }
12627
12628
12630 {
12632 return;
12633
12635
12638
12641
12642 SoundParameters params = new SoundParameters();
12646 }
12647
12648
12650 {
12652 return;
12653
12655 SetSynchDirty();
12656
12659 }
12660
12661
12663 {
12665 return;
12666
12668 SetSynchDirty();
12669
12672 }
12673
12675 {
12677 }
12678
12680 {
12682 }
12683
12686 {
12687 if (!
GetGame().IsDedicatedServer())
12688 {
12689 if (ConfigIsExisting("attachSoundSet"))
12690 {
12691 string cfg_path = "";
12692 string soundset = "";
12693 string type_name =
GetType();
12694
12697 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12698 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12699
12700 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12701 {
12702 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12703 {
12704 if (cfg_slot_array[i] == slot_type)
12705 {
12706 soundset = cfg_soundset_array[i];
12707 break;
12708 }
12709 }
12710 }
12711
12712 if (soundset != "")
12713 {
12714 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12716 }
12717 }
12718 }
12719 }
12720
12722 {
12723
12724 }
12725
12726 void OnApply(PlayerBase player);
12727
12729 {
12730 return 1.0;
12731 };
12732
12734 {
12736 }
12737
12739 {
12741 }
12742
12744
12746 {
12747 SetDynamicPhysicsLifeTime(0.01);
12749 }
12750
12752 {
12753 array<string> zone_names = new array<string>;
12754 GetDamageZones(zone_names);
12755 for (int i = 0; i < zone_names.Count(); i++)
12756 {
12757 SetHealthMax(zone_names.Get(i),"Health");
12758 }
12759 SetHealthMax("","Health");
12760 }
12761
12764 {
12765 float global_health = GetHealth01("","Health");
12766 array<string> zones = new array<string>;
12767 GetDamageZones(zones);
12768
12769 for (int i = 0; i < zones.Count(); i++)
12770 {
12771 SetHealth01(zones.Get(i),"Health",global_health);
12772 }
12773 }
12774
12777 {
12778 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12779 }
12780
12782 {
12783 if (!hasRootAsPlayer)
12784 {
12785 if (refParentIB)
12786 {
12787
12788 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12789 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12790
12791 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12792 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12793
12796 }
12797 else
12798 {
12799
12802 }
12803 }
12804 }
12805
12807 {
12809 {
12810 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12811 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12812 {
12813 float heatPermCoef = 1.0;
12815 while (ent)
12816 {
12817 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12818 ent = ent.GetHierarchyParent();
12819 }
12820
12821 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12822 }
12823 }
12824 }
12825
12827 {
12828
12829 EntityAI parent = GetHierarchyParent();
12830 if (!parent)
12831 {
12832 hasParent = false;
12833 hasRootAsPlayer = false;
12834 }
12835 else
12836 {
12837 hasParent = true;
12838 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12839 refParentIB =
ItemBase.Cast(parent);
12840 }
12841 }
12842
12843 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12844 {
12845
12846 }
12847
12849 {
12850
12851 return false;
12852 }
12853
12855 {
12856
12857
12858 return false;
12859 }
12860
12862 {
12863
12864 return false;
12865 }
12866
12869 {
12870 return !GetIsFrozen() &&
IsOpen();
12871 }
12872
12874 {
12875 bool hasParent = false, hasRootAsPlayer = false;
12877
12878 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12879 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12880
12881 if (wwtu || foodDecay)
12882 {
12886
12887 if (processWetness || processTemperature || processDecay)
12888 {
12890
12891 if (processWetness)
12892 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12893
12894 if (processTemperature)
12896
12897 if (processDecay)
12898 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12899 }
12900 }
12901 }
12902
12905 {
12907 }
12908
12910 {
12913
12914 return super.GetTemperatureFreezeThreshold();
12915 }
12916
12918 {
12921
12922 return super.GetTemperatureThawThreshold();
12923 }
12924
12926 {
12929
12930 return super.GetItemOverheatThreshold();
12931 }
12932
12934 {
12936 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12937
12938 return super.GetTemperatureFreezeTime();
12939 }
12940
12942 {
12944 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12945
12946 return super.GetTemperatureThawTime();
12947 }
12948
12953
12955 {
12956 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12957 }
12958
12960 {
12961 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12962 }
12963
12966 {
12968 }
12969
12971 {
12973 }
12974
12976 {
12978 }
12979
12982 {
12983 return null;
12984 }
12985
12988 {
12989 return false;
12990 }
12991
12993 {
12995 {
12998 if (!trg)
12999 {
13001 explosive = this;
13002 }
13003
13004 explosive.PairRemote(trg);
13006
13007 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13008 trg.SetPersistentPairID(persistentID);
13009 explosive.SetPersistentPairID(persistentID);
13010
13011 return true;
13012 }
13013 return false;
13014 }
13015
13018 {
13019 float ret = 1.0;
13022 ret *= GetHealth01();
13023
13024 return ret;
13025 }
13026
13027 #ifdef DEVELOPER
13028 override void SetDebugItem()
13029 {
13030 super.SetDebugItem();
13031 _itemBase = this;
13032 }
13033
13035 {
13036 string text = super.GetDebugText();
13037
13039 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13040
13041 return text;
13042 }
13043 #endif
13044
13046 {
13047 return true;
13048 }
13049
13051
13053
13055 {
13058 }
13059
13060
13068
13084}
13085
13087{
13089 if (entity)
13090 {
13091 bool is_item = entity.IsInherited(
ItemBase);
13092 if (is_item && full_quantity)
13093 {
13096 }
13097 }
13098 else
13099 {
13101 return NULL;
13102 }
13103 return entity;
13104}
13105
13107{
13108 if (item)
13109 {
13110 if (health > 0)
13111 item.SetHealth("", "", health);
13112
13113 if (item.CanHaveTemperature())
13114 {
13116 if (item.CanFreeze())
13117 item.SetFrozen(false);
13118 }
13119
13120 if (item.HasEnergyManager())
13121 {
13122 if (quantity >= 0)
13123 {
13124 item.GetCompEM().SetEnergy0To1(quantity);
13125 }
13126 else
13127 {
13129 }
13130 }
13131 else if (item.IsMagazine())
13132 {
13133 Magazine mag = Magazine.Cast(item);
13134 if (quantity >= 0)
13135 {
13136 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13137 }
13138 else
13139 {
13141 }
13142
13143 }
13144 else
13145 {
13146 if (quantity >= 0)
13147 {
13148 item.SetQuantityNormalized(quantity, false);
13149 }
13150 else
13151 {
13153 }
13154
13155 }
13156 }
13157}
13158
13159#ifdef DEVELOPER
13161#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.