Obsolete, use GetWeightEx instead.
8242{
8244 {
8245 return true;
8246 }
8247};
8248
8249
8250
8252{
8256
8258
8261
8262
8263
8264
8265
8274
8280
8285
8290
8311 protected bool m_IsResultOfSplit
8312
8314
8319
8320
8321
8323
8327
8328
8329
8331
8334
8335
8336
8342
8343
8351
8354
8355
8357
8358
8360
8361
8366
8367
8372
8373
8375
8376
8378 {
8383
8384 if (!
GetGame().IsDedicatedServer())
8385 {
8387 {
8389
8391 {
8393 }
8394 }
8395
8398 }
8399
8400 m_OldLocation = null;
8401
8403 {
8405 }
8406
8407 if (ConfigIsExisting("headSelectionsToHide"))
8408 {
8411 }
8412
8414 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8415 {
8417 }
8418
8420
8421 m_IsResultOfSplit = false;
8422
8424 }
8425
8427 {
8428 super.InitItemVariables();
8429
8435 m_Count = ConfigGetInt(
"count");
8436
8439
8444
8447
8452
8464
8468
8469
8472 if (ConfigIsExisting("canBeSplit"))
8473 {
8476 }
8477
8479 if (ConfigIsExisting("itemBehaviour"))
8481
8482
8485 RegisterNetSyncVariableInt("m_VarLiquidType");
8486 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8487
8488 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8489 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8490 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8491
8492 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8493 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8494 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8495 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8496
8497 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8498 RegisterNetSyncVariableBool("m_IsTakeable");
8499 RegisterNetSyncVariableBool("m_IsHologram");
8500
8503 {
8506 }
8507
8509
8511 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8513
8514 }
8515
8517 {
8519 }
8520
8522 {
8525 {
8530 }
8531 }
8532
8533 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8534 {
8536 {
8539 }
8540
8542 }
8543
8545 {
8551 }
8552
8554
8556 {
8558
8559 if (!action)
8560 {
8561 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8562 return;
8563 }
8564
8566 if (!ai)
8567 {
8569 return;
8570 }
8571
8573 if (!action_array)
8574 {
8575 action_array = new array<ActionBase_Basic>;
8577 }
8578 if (LogManager.IsActionLogEnable())
8579 {
8580 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8581 }
8582
8583 if (action_array.Find(action) != -1)
8584 {
8585 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8586 }
8587 else
8588 {
8589 action_array.Insert(action);
8590 }
8591 }
8592
8594 {
8596 ActionBase action = player.GetActionManager().GetAction(actionName);
8599
8600 if (action_array)
8601 {
8602 action_array.RemoveItem(action);
8603 }
8604 }
8605
8606
8607
8609 {
8610 ActionOverrideData overrideData = new ActionOverrideData();
8614
8616 if (!actionMap)
8617 {
8620 }
8621
8622 actionMap.Insert(this.
Type(), overrideData);
8623
8624 }
8625
8627
8629
8630
8632 {
8635
8638
8639 string config_to_search = "CfgVehicles";
8640 string muzzle_owner_config;
8641
8643 {
8644 if (IsInherited(Weapon))
8645 config_to_search = "CfgWeapons";
8646
8647 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8648
8649 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8650
8652
8653 if (config_OnFire_subclass_count > 0)
8654 {
8655 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8656
8657 for (int i = 0; i < config_OnFire_subclass_count; i++)
8658 {
8659 string particle_class = "";
8661 string config_OnFire_entry = config_OnFire_class + particle_class;
8662 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8663 WPOF_array.Insert(WPOF);
8664 }
8665
8666
8668 }
8669 }
8670
8672 {
8673 config_to_search = "CfgWeapons";
8674 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8675
8676 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8677
8679
8680 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8681 {
8682 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8683
8684 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8685 {
8686 string particle_class2 = "";
8688 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8689 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8690 WPOBE_array.Insert(WPOBE);
8691 }
8692
8693
8695 }
8696 }
8697 }
8698
8699
8701 {
8704
8706 {
8707 string config_to_search = "CfgVehicles";
8708
8709 if (IsInherited(Weapon))
8710 config_to_search = "CfgWeapons";
8711
8712 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8713 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8714
8715 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8716 {
8717
8719
8721 {
8723 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8725 return;
8726 }
8727
8730
8731
8732
8734 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8735
8736 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8737 {
8738 string particle_class = "";
8740 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8742
8743 if (entry_type == CT_CLASS)
8744 {
8745 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8746 WPOOH_array.Insert(WPOF);
8747 }
8748 }
8749
8750
8752 }
8753 }
8754 }
8755
8757 {
8759 }
8760
8762 {
8764 {
8766
8769
8772
8773 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8774 }
8775 }
8776
8778 {
8780 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8781
8783 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8784
8786 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8787
8789 {
8791 }
8792 }
8793
8795 {
8797 }
8798
8800 {
8803 else
8805
8807 {
8810 }
8811 else
8812 {
8815
8818 }
8819
8821 }
8822
8824 {
8826 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8827 }
8828
8830 {
8832 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8834 }
8835
8837 {
8839 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8840 }
8841
8843 {
8846
8847 OverheatingParticle OP = new OverheatingParticle();
8852
8854 }
8855
8857 {
8860
8861 return -1;
8862 }
8863
8865 {
8867 {
8870
8871 for (int i = count; i > 0; --i)
8872 {
8873 int id = i - 1;
8876
8879
8880 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8881 {
8882 if (p)
8883 {
8886 }
8887 }
8888 }
8889 }
8890 }
8891
8893 {
8895 {
8897 {
8898 int id = i - 1;
8900
8901 if (OP)
8902 {
8904
8905 if (p)
8906 {
8908 }
8909
8910 delete OP;
8911 }
8912 }
8913
8916 }
8917 }
8918
8921 {
8922 return 0.0;
8923 }
8924
8925
8927 {
8928 return 250;
8929 }
8930
8932 {
8933 return 0;
8934 }
8935
8938 {
8940 return true;
8941
8942 return false;
8943 }
8944
8947 {
8950
8952 {
8954 }
8955 else
8956 {
8957
8959 }
8960
8962 }
8963
8970 {
8971 return -1;
8972 }
8973
8974
8975
8976
8978 {
8980 {
8982 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8983
8984 if (r_index >= 0)
8985 {
8986 InventoryLocation r_il = new InventoryLocation;
8987 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8988
8989 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8992 {
8993 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8994 }
8996 {
8997 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8998 }
8999
9000 }
9001
9002 player.GetHumanInventory().ClearUserReservedLocation(this);
9003 }
9004
9007 }
9008
9009
9010
9011
9013 {
9014 return ItemBase.m_DebugActionsMask;
9015 }
9016
9018 {
9019 return ItemBase.m_DebugActionsMask & mask;
9020 }
9021
9023 {
9024 ItemBase.m_DebugActionsMask = mask;
9025 }
9026
9028 {
9029 ItemBase.m_DebugActionsMask |= mask;
9030 }
9031
9033 {
9034 ItemBase.m_DebugActionsMask &= ~mask;
9035 }
9036
9038 {
9040 {
9042 }
9043 else
9044 {
9046 }
9047 }
9048
9049
9051 {
9052 if (GetEconomyProfile())
9053 {
9054 float q_max = GetEconomyProfile().GetQuantityMax();
9055 if (q_max > 0)
9056 {
9057 float q_min = GetEconomyProfile().GetQuantityMin();
9058 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9059
9061 {
9062 ComponentEnergyManager comp = GetCompEM();
9064 {
9066 }
9067 }
9069 {
9071
9072 }
9073
9074 }
9075 }
9076 }
9077
9080 {
9081 EntityAI parent = GetHierarchyParent();
9082
9083 if (parent)
9084 {
9085 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9086 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9087 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9088 }
9089 }
9090
9093 {
9094 EntityAI parent = GetHierarchyParent();
9095
9096 if (parent)
9097 {
9098 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9099 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9100 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9101 }
9102 }
9103
9105 {
9106
9107
9108
9109
9111
9113 {
9114 if (ScriptInputUserData.CanStoreInputUserData())
9115 {
9116 ScriptInputUserData ctx = new ScriptInputUserData;
9122 ctx.
Write(use_stack_max);
9125
9127 {
9128 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9129 }
9130 }
9131 }
9132 else if (!
GetGame().IsMultiplayer())
9133 {
9135 }
9136 }
9137
9139 {
9141 }
9142
9144 {
9146 }
9147
9149 {
9151 }
9152
9154 {
9155
9156 return false;
9157 }
9158
9160 {
9161 return false;
9162 }
9163
9167 {
9168 return false;
9169 }
9170
9172 {
9173 return "";
9174 }
9175
9177
9179 {
9180 return false;
9181 }
9182
9184 {
9185 return true;
9186 }
9187
9188
9189
9191 {
9192 return true;
9193 }
9194
9196 {
9197 return true;
9198 }
9199
9201 {
9202 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9204 }
9205
9207 {
9209 }
9210
9212 {
9214 if (!is_being_placed)
9216 SetSynchDirty();
9217 }
9218
9219
9221
9223 {
9225 }
9226
9228 {
9230 }
9231
9233 {
9234 return 1;
9235 }
9236
9238 {
9239 return false;
9240 }
9241
9243 {
9245 SetSynchDirty();
9246 }
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9283 {
9284 super.OnMovedInsideCargo(container);
9285
9286 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9287 }
9288
9289 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9290 {
9291 super.EEItemLocationChanged(oldLoc,newLoc);
9292
9293 PlayerBase new_player = null;
9294 PlayerBase old_player = null;
9295
9296 if (newLoc.GetParent())
9297 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9298
9299 if (oldLoc.GetParent())
9300 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9301
9303 {
9304 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9305
9306 if (r_index >= 0)
9307 {
9308 InventoryLocation r_il = new InventoryLocation;
9309 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9310
9311 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9314 {
9315 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9316 }
9318 {
9319 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9320 }
9321
9322 }
9323 }
9324
9326 {
9327 if (new_player)
9328 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9329
9330 if (new_player == old_player)
9331 {
9332
9333 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9334 {
9336 {
9337 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9338 {
9339 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9340 }
9341 }
9342 else
9343 {
9344 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9345 }
9346 }
9347
9348 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9349 {
9350 int type = oldLoc.GetType();
9352 {
9353 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9354 }
9356 {
9357 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9358 }
9359 }
9360 if (!m_OldLocation)
9361 {
9362 m_OldLocation = new InventoryLocation;
9363 }
9364 m_OldLocation.Copy(oldLoc);
9365 }
9366 else
9367 {
9368 if (m_OldLocation)
9369 {
9370 m_OldLocation.Reset();
9371 }
9372 }
9373
9375 }
9376 else
9377 {
9378 if (new_player)
9379 {
9380 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9381 if (res_index >= 0)
9382 {
9383 InventoryLocation il = new InventoryLocation;
9384 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9386 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9389 {
9390 il.
GetParent().GetOnReleaseLock().Invoke(it);
9391 }
9393 {
9395 }
9396
9397 }
9398 }
9400 {
9401
9403 }
9404
9405 if (m_OldLocation)
9406 {
9407 m_OldLocation.Reset();
9408 }
9409 }
9410 }
9411
9412 override void EOnContact(IEntity other, Contact extra)
9413 {
9415 {
9416 int liquidType = -1;
9418 if (impactSpeed > 0.0)
9419 {
9421 #ifndef SERVER
9423 #else
9425 SetSynchDirty();
9426 #endif
9428 }
9429 }
9430
9431 #ifdef SERVER
9432 if (GetCompEM() && GetCompEM().IsPlugged())
9433 {
9434 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9435 GetCompEM().UnplugThis();
9436 }
9437 #endif
9438 }
9439
9441
9443 {
9445 }
9446
9448 {
9449
9450 }
9451
9453 {
9454 super.OnItemLocationChanged(old_owner, new_owner);
9455
9456 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9457 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9458
9459 if (!relatedPlayer && playerNew)
9460 relatedPlayer = playerNew;
9461
9462 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9463 {
9465 if (actionMgr)
9466 {
9467 ActionBase currentAction = actionMgr.GetRunningAction();
9468 if (currentAction)
9470 }
9471 }
9472
9473 Man ownerPlayerOld = null;
9474 Man ownerPlayerNew = null;
9475
9476 if (old_owner)
9477 {
9478 if (old_owner.
IsMan())
9479 {
9480 ownerPlayerOld = Man.Cast(old_owner);
9481 }
9482 else
9483 {
9484 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9485 }
9486 }
9487 else
9488 {
9490 {
9492
9493 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9494 {
9495 GetCompEM().UnplugThis();
9496 }
9497 }
9498 }
9499
9500 if (new_owner)
9501 {
9502 if (new_owner.
IsMan())
9503 {
9504 ownerPlayerNew = Man.Cast(new_owner);
9505 }
9506 else
9507 {
9508 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9509 }
9510 }
9511
9512 if (ownerPlayerOld != ownerPlayerNew)
9513 {
9514 if (ownerPlayerOld)
9515 {
9516 array<EntityAI> subItemsExit = new array<EntityAI>;
9518 for (int i = 0; i < subItemsExit.Count(); i++)
9519 {
9522 }
9523 }
9524
9525 if (ownerPlayerNew)
9526 {
9527 array<EntityAI> subItemsEnter = new array<EntityAI>;
9529 for (int j = 0; j < subItemsEnter.Count(); j++)
9530 {
9533 }
9534 }
9535 }
9536 else if (ownerPlayerNew != null)
9537 {
9538 PlayerBase nplayer;
9539 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9540 {
9541 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9543 for (int k = 0; k < subItemsUpdate.Count(); k++)
9544 {
9546 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9547 }
9548 }
9549 }
9550
9551 if (old_owner)
9552 old_owner.OnChildItemRemoved(this);
9553 if (new_owner)
9554 new_owner.OnChildItemReceived(this);
9555 }
9556
9557
9559 {
9560 super.EEDelete(parent);
9561 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9562 if (player)
9563 {
9565
9566 if (player.IsAlive())
9567 {
9568 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9569 if (r_index >= 0)
9570 {
9571 InventoryLocation r_il = new InventoryLocation;
9572 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9573
9574 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9577 {
9578 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9579 }
9581 {
9582 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9583 }
9584
9585 }
9586
9587 player.RemoveQuickBarEntityShortcut(this);
9588 }
9589 }
9590 }
9591
9593 {
9594 super.EEKilled(killer);
9595
9598 {
9599 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9600 {
9601 if (IsMagazine())
9602 {
9603 if (Magazine.Cast(this).GetAmmoCount() > 0)
9604 {
9606 }
9607 }
9608 else
9609 {
9611 }
9612 }
9613 }
9614 }
9615
9617 {
9618 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9619
9620 super.OnWasAttached(parent, slot_id);
9621
9624
9626 }
9627
9629 {
9630 super.OnWasDetached(parent, slot_id);
9631
9634 }
9635
9637 {
9638 int idx;
9641
9642 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9643 if (inventory_slots.Count() < 1)
9644 {
9645 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9646 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9647 }
9648 else
9649 {
9650 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9651 }
9652
9653 idx = inventory_slots.Find(slot);
9654 if (idx < 0)
9655 return "";
9656
9657 return attach_types.Get(idx);
9658 }
9659
9661 {
9662 int idx = -1;
9663 string slot;
9664
9667
9668 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9669 if (inventory_slots.Count() < 1)
9670 {
9671 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9672 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9673 }
9674 else
9675 {
9676 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9677 if (detach_types.Count() < 1)
9678 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9679 }
9680
9681 for (int i = 0; i < inventory_slots.Count(); i++)
9682 {
9683 slot = inventory_slots.Get(i);
9684 }
9685
9686 if (slot != "")
9687 {
9688 if (detach_types.Count() == 1)
9689 idx = 0;
9690 else
9691 idx = inventory_slots.Find(slot);
9692 }
9693 if (idx < 0)
9694 return "";
9695
9696 return detach_types.Get(idx);
9697 }
9698
9700 {
9701
9703
9704
9705 float min_time = 1;
9706 float max_time = 3;
9707 float delay = Math.RandomFloat(min_time, max_time);
9708
9709 explode_timer.Run(delay, this, "DoAmmoExplosion");
9710 }
9711
9713 {
9714 Magazine magazine = Magazine.Cast(this);
9715 int pop_sounds_count = 6;
9716 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9717
9718
9719 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9720 string sound_name = pop_sounds[ sound_idx ];
9722
9723
9724 magazine.ServerAddAmmoCount(-1);
9725
9726
9727 float min_temp_to_explode = 100;
9728
9729 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9730 {
9732 }
9733 }
9734
9735
9736 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9737 {
9738 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9739
9740 const int CHANCE_DAMAGE_CARGO = 4;
9741 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9742 const int CHANCE_DAMAGE_NOTHING = 2;
9743
9745 {
9746 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9747 int chances;
9748 int rnd;
9749
9750 if (GetInventory().GetCargo())
9751 {
9752 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9753 rnd = Math.RandomInt(0,chances);
9754
9755 if (rnd < CHANCE_DAMAGE_CARGO)
9756 {
9758 }
9759 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9760 {
9762 }
9763 }
9764 else
9765 {
9766 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9767 rnd = Math.RandomInt(0,chances);
9768
9769 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9770 {
9772 }
9773 }
9774 }
9775 }
9776
9778 {
9779 if (GetInventory().GetCargo())
9780 {
9781 int item_count = GetInventory().GetCargo().GetItemCount();
9782 if (item_count > 0)
9783 {
9784 int random_pick = Math.RandomInt(0, item_count);
9786 if (!item.IsExplosive())
9787 {
9788 item.AddHealth("","",damage);
9789 return true;
9790 }
9791 }
9792 }
9793 return false;
9794 }
9795
9797 {
9798 int attachment_count = GetInventory().AttachmentCount();
9799 if (attachment_count > 0)
9800 {
9801 int random_pick = Math.RandomInt(0, attachment_count);
9802 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9803 if (!attachment.IsExplosive())
9804 {
9805 attachment.AddHealth("","",damage);
9806 return true;
9807 }
9808 }
9809 return false;
9810 }
9811
9813 {
9815 }
9816
9818 {
9820 return GetInventory().CanRemoveEntity();
9821
9822 return false;
9823 }
9824
9826 {
9828 return;
9829
9831 {
9832 if (ScriptInputUserData.CanStoreInputUserData())
9833 {
9834 ScriptInputUserData ctx = new ScriptInputUserData;
9839 ctx.
Write(destination_entity);
9843 }
9844 }
9845 else if (!
GetGame().IsMultiplayer())
9846 {
9848 }
9849 }
9850
9852 {
9854 return;
9855
9856 float split_quantity_new;
9860 InventoryLocation loc = new InventoryLocation;
9861
9862 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9863 {
9865 split_quantity_new = stack_max;
9866 else
9868
9869 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9870 if (new_item)
9871 {
9872 new_item.SetResultOfSplit(true);
9873 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9875 new_item.SetQuantity(split_quantity_new);
9876 }
9877 }
9878 else if (destination_entity && slot_id == -1)
9879 {
9880 if (quantity > stack_max)
9881 split_quantity_new = stack_max;
9882 else
9883 split_quantity_new = quantity;
9884
9886 {
9889 }
9890
9891 if (new_item)
9892 {
9893 new_item.SetResultOfSplit(true);
9894 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9896 new_item.SetQuantity(split_quantity_new);
9897 }
9898 }
9899 else
9900 {
9901 if (stack_max != 0)
9902 {
9904 {
9906 }
9907
9908 if (split_quantity_new == 0)
9909 {
9910 if (!
GetGame().IsMultiplayer())
9911 player.PhysicalPredictiveDropItem(this);
9912 else
9913 player.ServerDropEntity(this);
9914 return;
9915 }
9916
9918
9919 if (new_item)
9920 {
9921 new_item.SetResultOfSplit(true);
9922 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9924 new_item.SetQuantity(stack_max);
9925 new_item.PlaceOnSurface();
9926 }
9927 }
9928 }
9929 }
9930
9932 {
9934 return;
9935
9936 float split_quantity_new;
9940 InventoryLocation loc = new InventoryLocation;
9941
9942 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9943 {
9945 split_quantity_new = stack_max;
9946 else
9948
9949 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9950 if (new_item)
9951 {
9952 new_item.SetResultOfSplit(true);
9953 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9955 new_item.SetQuantity(split_quantity_new);
9956 }
9957 }
9958 else if (destination_entity && slot_id == -1)
9959 {
9960 if (quantity > stack_max)
9961 split_quantity_new = stack_max;
9962 else
9963 split_quantity_new = quantity;
9964
9966 {
9969 }
9970
9971 if (new_item)
9972 {
9973 new_item.SetResultOfSplit(true);
9974 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9976 new_item.SetQuantity(split_quantity_new);
9977 }
9978 }
9979 else
9980 {
9981 if (stack_max != 0)
9982 {
9984 {
9986 }
9987
9989
9990 if (new_item)
9991 {
9992 new_item.SetResultOfSplit(true);
9993 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9995 new_item.SetQuantity(stack_max);
9996 new_item.PlaceOnSurface();
9997 }
9998 }
9999 }
10000 }
10001
10003 {
10005 return;
10006
10008 {
10009 if (ScriptInputUserData.CanStoreInputUserData())
10010 {
10011 ScriptInputUserData ctx = new ScriptInputUserData;
10016 dst.WriteToContext(ctx);
10018 }
10019 }
10020 else if (!
GetGame().IsMultiplayer())
10021 {
10023 }
10024 }
10025
10027 {
10029 return;
10030
10032 {
10033 if (ScriptInputUserData.CanStoreInputUserData())
10034 {
10035 ScriptInputUserData ctx = new ScriptInputUserData;
10040 ctx.
Write(destination_entity);
10046 }
10047 }
10048 else if (!
GetGame().IsMultiplayer())
10049 {
10051 }
10052 }
10053
10055 {
10057 }
10058
10060 {
10062 return this;
10063
10065 float split_quantity_new;
10067 if (dst.IsValid())
10068 {
10069 int slot_id = dst.GetSlot();
10071
10072 if (quantity > stack_max)
10073 split_quantity_new = stack_max;
10074 else
10075 split_quantity_new = quantity;
10076
10078
10079 if (new_item)
10080 {
10081 new_item.SetResultOfSplit(true);
10082 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10085 }
10086
10087 return new_item;
10088 }
10089
10090 return null;
10091 }
10092
10094 {
10096 return;
10097
10099 float split_quantity_new;
10101 if (destination_entity)
10102 {
10104 if (quantity > stackable)
10105 split_quantity_new = stackable;
10106 else
10107 split_quantity_new = quantity;
10108
10109 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10110 if (new_item)
10111 {
10112 new_item.SetResultOfSplit(true);
10113 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10115 new_item.SetQuantity(split_quantity_new);
10116 }
10117 }
10118 }
10119
10121 {
10123 return;
10124
10126 {
10127 if (ScriptInputUserData.CanStoreInputUserData())
10128 {
10129 ScriptInputUserData ctx = new ScriptInputUserData;
10134 ItemBase destination_entity =
this;
10135 ctx.
Write(destination_entity);
10139 }
10140 }
10141 else if (!
GetGame().IsMultiplayer())
10142 {
10144 }
10145 }
10146
10148 {
10150 return;
10151
10153 float split_quantity_new;
10155 if (player)
10156 {
10158 if (quantity > stackable)
10159 split_quantity_new = stackable;
10160 else
10161 split_quantity_new = quantity;
10162
10163 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10164 new_item =
ItemBase.Cast(in_hands);
10165 if (new_item)
10166 {
10167 new_item.SetResultOfSplit(true);
10168 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10170 new_item.SetQuantity(split_quantity_new);
10171 }
10172 }
10173 }
10174
10176 {
10178 return;
10179
10181 float split_quantity_new = Math.Floor(quantity * 0.5);
10182
10184
10185 if (new_item)
10186 {
10187 if (new_item.GetQuantityMax() < split_quantity_new)
10188 {
10189 split_quantity_new = new_item.GetQuantityMax();
10190 }
10191
10192 new_item.SetResultOfSplit(true);
10193 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10194
10196 {
10199 }
10200 else
10201 {
10204 }
10205 }
10206 }
10207
10209 {
10211 return;
10212
10214 float split_quantity_new = Math.Floor(quantity / 2);
10215
10216 InventoryLocation invloc = new InventoryLocation;
10218
10220 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10221
10222 if (new_item)
10223 {
10224 if (new_item.GetQuantityMax() < split_quantity_new)
10225 {
10226 split_quantity_new = new_item.GetQuantityMax();
10227 }
10229 {
10232 }
10233 else
10234 {
10237 }
10238 }
10239 }
10240
10243 {
10244 SetWeightDirty();
10246
10247 if (parent)
10248 parent.OnAttachmentQuantityChangedEx(this, delta);
10249
10251 {
10253 {
10255 }
10257 {
10258 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10260 }
10261 }
10262
10263 }
10264
10267 {
10268
10269 }
10270
10273 {
10275 }
10276
10278 {
10279 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10280
10282 {
10283 if (newLevel == GameConstants.STATE_RUINED)
10284 {
10286 EntityAI parent = GetHierarchyParent();
10287 if (parent && parent.IsFireplace())
10288 {
10289 CargoBase cargo = GetInventory().GetCargo();
10290 if (cargo)
10291 {
10293 {
10295 }
10296 }
10297 }
10298 }
10299
10301 {
10302
10304 return;
10305 }
10306
10307 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10308 {
10310 }
10311 }
10312 }
10313
10314
10316 {
10317 super.OnRightClick();
10318
10320 {
10322 {
10323 if (ScriptInputUserData.CanStoreInputUserData())
10324 {
10325 vector m4[4];
10327
10328 EntityAI root = GetHierarchyRoot();
10329
10330 InventoryLocation dst = new InventoryLocation;
10332 {
10333 if (root)
10334 {
10335 root.GetTransform(m4);
10337 }
10338 else
10339 GetInventory().GetCurrentInventoryLocation(dst);
10340 }
10341 else
10342 {
10344
10345
10346 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10347 {
10348 if (root)
10349 {
10350 root.GetTransform(m4);
10352 }
10353 else
10354 GetInventory().GetCurrentInventoryLocation(dst);
10355 }
10356 else
10357 {
10358 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10359 }
10360 }
10361
10362 ScriptInputUserData ctx = new ScriptInputUserData;
10370 }
10371 }
10372 else if (!
GetGame().IsMultiplayer())
10373 {
10375 }
10376 }
10377 }
10378
10379 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10380 {
10381
10382 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10383 return false;
10384
10385 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10386 return false;
10387
10388
10390 return false;
10391
10392
10393 Magazine mag = Magazine.Cast(this);
10394 if (mag)
10395 {
10396 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10397 return false;
10398
10399 if (stack_max_limit)
10400 {
10401 Magazine other_mag = Magazine.Cast(other_item);
10402 if (other_item)
10403 {
10404 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10405 return false;
10406 }
10407
10408 }
10409 }
10410 else
10411 {
10412
10414 return false;
10415
10417 return false;
10418 }
10419
10420 PlayerBase player = null;
10421 if (CastTo(player, GetHierarchyRootPlayer()))
10422 {
10423 if (player.GetInventory().HasAttachment(this))
10424 return false;
10425
10426 if (player.IsItemsToDelete())
10427 return false;
10428 }
10429
10430 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10431 return false;
10432
10433 int slotID;
10435 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10436 return false;
10437
10438 return true;
10439 }
10440
10442 {
10444 }
10445
10447 {
10448 return m_IsResultOfSplit;
10449 }
10450
10452 {
10453 m_IsResultOfSplit = value;
10454 }
10455
10457 {
10459 }
10460
10462 {
10463 float other_item_quantity = other_item.GetQuantity();
10464 float this_free_space;
10465
10467
10469
10470 if (other_item_quantity > this_free_space)
10471 {
10472 return this_free_space;
10473 }
10474 else
10475 {
10476 return other_item_quantity;
10477 }
10478 }
10479
10481 {
10483 }
10484
10486 {
10488 return;
10489
10490 if (!IsMagazine() && other_item)
10491 {
10493 if (quantity_used != 0)
10494 {
10495 float hp1 = GetHealth01("","");
10496 float hp2 = other_item.GetHealth01("","");
10497 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10498 hpResult = hpResult / (
GetQuantity() + quantity_used);
10499
10500 hpResult *= GetMaxHealth();
10501 Math.Round(hpResult);
10502 SetHealth("", "Health", hpResult);
10503
10505 other_item.AddQuantity(-quantity_used);
10506 }
10507 }
10509 }
10510
10512 {
10513 #ifdef SERVER
10514 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10515 GetHierarchyParent().IncreaseLifetimeUp();
10516 #endif
10517 };
10518
10520 {
10521 PlayerBase p = PlayerBase.Cast(player);
10522
10523 array<int> recipesIds = p.m_Recipes;
10524 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10525 if (moduleRecipesManager)
10526 {
10527 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10528 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10529 }
10530
10531 for (int i = 0;i < recipesIds.Count(); i++)
10532 {
10533 int key = recipesIds.Get(i);
10534 string recipeName = moduleRecipesManager.GetRecipeName(key);
10536 }
10537 }
10538
10539
10540 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10541 {
10542 super.GetDebugActions(outputList);
10543
10544
10549
10550
10554
10558
10559
10562
10563
10565 {
10568 }
10569
10571
10574
10578 }
10579
10580
10581
10582
10584 {
10585 super.OnAction(action_id, player, ctx);
10586 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10587 {
10588 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10589 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10590 PlayerBase p = PlayerBase.Cast(player);
10591 if (
EActions.RECIPES_RANGE_START < 1000)
10592 {
10593 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10594 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10595 }
10596 }
10597 #ifndef SERVER
10598 else if (action_id ==
EActions.WATCH_PLAYER)
10599 {
10600 PluginDeveloper.SetDeveloperItemClientEx(player);
10601 }
10602 #endif
10604 {
10605 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10606 {
10607 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10608 OnDebugButtonPressServer(id + 1);
10609 }
10610
10611 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10612 {
10613 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10615 }
10616
10617 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10618 {
10619 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10621 }
10622
10623 else if (action_id ==
EActions.ADD_QUANTITY)
10624 {
10625 if (IsMagazine())
10626 {
10627 Magazine mag = Magazine.Cast(this);
10628 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10629 }
10630 else
10631 {
10633 }
10634
10635 if (m_EM)
10636 {
10637 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10638 }
10639
10640 }
10641
10642 else if (action_id ==
EActions.REMOVE_QUANTITY)
10643 {
10644 if (IsMagazine())
10645 {
10646 Magazine mag2 = Magazine.Cast(this);
10647 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10648 }
10649 else
10650 {
10652 }
10653 if (m_EM)
10654 {
10655 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10656 }
10657
10658 }
10659
10660 else if (action_id ==
EActions.SET_QUANTITY_0)
10661 {
10663
10664 if (m_EM)
10665 {
10666 m_EM.SetEnergy(0);
10667 }
10668 }
10669
10670 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10671 {
10673
10674 if (m_EM)
10675 {
10676 m_EM.SetEnergy(m_EM.GetEnergyMax());
10677 }
10678 }
10679
10680 else if (action_id ==
EActions.ADD_HEALTH)
10681 {
10682 AddHealth("","",GetMaxHealth("","Health")/5);
10683 }
10684 else if (action_id ==
EActions.REMOVE_HEALTH)
10685 {
10686 AddHealth("","",-GetMaxHealth("","Health")/5);
10687 }
10688 else if (action_id ==
EActions.DESTROY_HEALTH)
10689 {
10690 SetHealth01("","",0);
10691 }
10692 else if (action_id ==
EActions.WATCH_ITEM)
10693 {
10695 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10696 #ifdef DEVELOPER
10697 SetDebugDeveloper_item(this);
10698 #endif
10699 }
10700
10701 else if (action_id ==
EActions.ADD_TEMPERATURE)
10702 {
10703 AddTemperature(20);
10704
10705 }
10706
10707 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10708 {
10709 AddTemperature(-20);
10710
10711 }
10712
10713 else if (action_id ==
EActions.FLIP_FROZEN)
10714 {
10715 SetFrozen(!GetIsFrozen());
10716
10717 }
10718
10719 else if (action_id ==
EActions.ADD_WETNESS)
10720 {
10722
10723 }
10724
10725 else if (action_id ==
EActions.REMOVE_WETNESS)
10726 {
10728
10729 }
10730
10731 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10732 {
10735
10736
10737 }
10738
10739 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10740 {
10743 }
10744
10745 else if (action_id ==
EActions.MAKE_SPECIAL)
10746 {
10747 auto debugParams = DebugSpawnParams.WithPlayer(player);
10748 OnDebugSpawnEx(debugParams);
10749 }
10750
10751 else if (action_id ==
EActions.DELETE)
10752 {
10753 Delete();
10754 }
10755
10756 }
10757
10758
10759 return false;
10760 }
10761
10762
10763
10764
10768
10771
10772
10773
10775 {
10776 return false;
10777 }
10778
10779
10781 {
10782 return true;
10783 }
10784
10785
10787 {
10788 return true;
10789 }
10790
10791
10792
10794 {
10795 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10797 }
10798
10801 {
10802 return null;
10803 }
10804
10806 {
10807 return false;
10808 }
10809
10811 {
10812 return false;
10813 }
10814
10818
10819
10821 {
10822 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10823 return module_repairing.CanRepair(this, item_repair_kit);
10824 }
10825
10826
10827 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10828 {
10829 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10830 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10831 }
10832
10833
10835 {
10836
10837
10838
10839
10840
10841
10842
10843
10844 return 1;
10845 }
10846
10847
10848
10850 {
10852 }
10853
10854
10855
10857 {
10859 }
10860
10861
10870 {
10871 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10872
10873 if (player)
10874 {
10875 player.MessageStatus(text);
10876 }
10877 }
10878
10879
10888 {
10889 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10890
10891 if (player)
10892 {
10893 player.MessageAction(text);
10894 }
10895 }
10896
10897
10906 {
10907 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10908
10909 if (player)
10910 {
10911 player.MessageFriendly(text);
10912 }
10913 }
10914
10915
10924 {
10925 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10926
10927 if (player)
10928 {
10929 player.MessageImportant(text);
10930 }
10931 }
10932
10934 {
10935 return true;
10936 }
10937
10938
10939 override bool KindOf(
string tag)
10940 {
10941 bool found = false;
10942 string item_name = this.
GetType();
10945
10946 int array_size = item_tag_array.Count();
10947 for (int i = 0; i < array_size; i++)
10948 {
10949 if (item_tag_array.Get(i) == tag)
10950 {
10951 found = true;
10952 break;
10953 }
10954 }
10955 return found;
10956 }
10957
10958
10960 {
10961
10962 super.OnRPC(sender, rpc_type,ctx);
10963
10964
10965 switch (rpc_type)
10966 {
10967 #ifndef SERVER
10968 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10969 Param2<bool, string> p = new Param2<bool, string>(false, "");
10970
10972 return;
10973
10974 bool play = p.param1;
10975 string soundSet = p.param2;
10976
10977 if (play)
10978 {
10980 {
10982 {
10984 }
10985 }
10986 else
10987 {
10989 }
10990 }
10991 else
10992 {
10994 }
10995
10996 break;
10997 #endif
10998
10999 }
11000
11002 {
11004 }
11005 }
11006
11007
11008
11009
11011 {
11012 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11013 return plugin.GetID(
name);
11014 }
11015
11017 {
11018 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11019 return plugin.GetName(id);
11020 }
11021
11024 {
11025
11026
11027 int varFlags;
11028 if (!ctx.
Read(varFlags))
11029 return;
11030
11031 if (varFlags & ItemVariableFlags.FLOAT)
11032 {
11034 }
11035 }
11036
11038 {
11039
11040 super.SerializeNumericalVars(floats_out);
11041
11042
11043
11045 {
11047 }
11048
11050 {
11052 }
11053
11055 {
11057 }
11058
11060 {
11065 }
11066
11068 {
11070 }
11071 }
11072
11074 {
11075
11076 super.DeSerializeNumericalVars(floats);
11077
11078
11079 int index = 0;
11080 int mask = Math.Round(floats.Get(index));
11081
11082 index++;
11083
11085 {
11087 {
11089 }
11090 else
11091 {
11092 float quantity = floats.Get(index);
11093 SetQuantity(quantity,
true,
false,
false,
false);
11094 }
11095 index++;
11096 }
11097
11099 {
11100 float wet = floats.Get(index);
11102 index++;
11103 }
11104
11106 {
11107 int liquidtype = Math.Round(floats.Get(index));
11109 index++;
11110 }
11111
11113 {
11115 index++;
11117 index++;
11119 index++;
11121 index++;
11122 }
11123
11125 {
11126 int cleanness = Math.Round(floats.Get(index));
11128 index++;
11129 }
11130 }
11131
11133 {
11134 super.WriteVarsToCTX(ctx);
11135
11136
11138 {
11140 }
11141
11143 {
11145 }
11146
11148 {
11150 }
11151
11153 {
11154 int r,g,b,a;
11160 }
11161
11163 {
11165 }
11166 }
11167
11169 {
11170 if (!super.ReadVarsFromCTX(ctx,version))
11171 return false;
11172
11173 int intValue;
11174 float value;
11175
11176 if (version < 140)
11177 {
11178 if (!ctx.
Read(intValue))
11179 return false;
11180
11181 m_VariablesMask = intValue;
11182 }
11183
11185 {
11186 if (!ctx.
Read(value))
11187 return false;
11188
11190 {
11192 }
11193 else
11194 {
11196 }
11197 }
11198
11199 if (version < 140)
11200 {
11202 {
11203 if (!ctx.
Read(value))
11204 return false;
11205 SetTemperatureDirect(value);
11206 }
11207 }
11208
11210 {
11211 if (!ctx.
Read(value))
11212 return false;
11214 }
11215
11217 {
11218 if (!ctx.
Read(intValue))
11219 return false;
11221 }
11222
11224 {
11225 int r,g,b,a;
11227 return false;
11229 return false;
11231 return false;
11233 return false;
11234
11236 }
11237
11239 {
11240 if (!ctx.
Read(intValue))
11241 return false;
11243 }
11244
11245 if (version >= 138 && version < 140)
11246 {
11248 {
11249 if (!ctx.
Read(intValue))
11250 return false;
11251 SetFrozen(intValue);
11252 }
11253 }
11254
11255 return true;
11256 }
11257
11258
11260 {
11263 {
11265 }
11266
11267 if (!super.OnStoreLoad(ctx, version))
11268 {
11270 return false;
11271 }
11272
11273 if (version >= 114)
11274 {
11275 bool hasQuickBarIndexSaved;
11276
11277 if (!ctx.
Read(hasQuickBarIndexSaved))
11278 {
11280 return false;
11281 }
11282
11283 if (hasQuickBarIndexSaved)
11284 {
11285 int itmQBIndex;
11286
11287
11288 if (!ctx.
Read(itmQBIndex))
11289 {
11291 return false;
11292 }
11293
11294 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11295 if (itmQBIndex != -1 && parentPlayer)
11296 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11297 }
11298 }
11299 else
11300 {
11301
11302 PlayerBase player;
11303 int itemQBIndex;
11304 if (version ==
int.
MAX)
11305 {
11306 if (!ctx.
Read(itemQBIndex))
11307 {
11309 return false;
11310 }
11311 }
11312 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11313 {
11314
11315 if (!ctx.
Read(itemQBIndex))
11316 {
11318 return false;
11319 }
11320 if (itemQBIndex != -1 && player)
11321 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11322 }
11323 }
11324
11325 if (version < 140)
11326 {
11327
11328 if (!LoadVariables(ctx, version))
11329 {
11331 return false;
11332 }
11333 }
11334
11335
11337 {
11339 return false;
11340 }
11341 if (version >= 132)
11342 {
11344 if (raib)
11345 {
11347 {
11349 return false;
11350 }
11351 }
11352 }
11353
11355 return true;
11356 }
11357
11358
11359
11361 {
11362 super.OnStoreSave(ctx);
11363
11364 PlayerBase player;
11365 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11366 {
11368
11369 int itemQBIndex = -1;
11370 itemQBIndex = player.FindQuickBarEntityIndex(this);
11371 ctx.
Write(itemQBIndex);
11372 }
11373 else
11374 {
11376 }
11377
11379
11381 if (raib)
11382 {
11384 }
11385 }
11386
11387
11389 {
11390 super.AfterStoreLoad();
11391
11393 {
11395 }
11396
11398 {
11401 }
11402 }
11403
11405 {
11406 super.EEOnAfterLoad();
11407
11409 {
11411 }
11412
11415 }
11416
11418 {
11419 return false;
11420 }
11421
11422
11423
11425 {
11427 {
11428 #ifdef PLATFORM_CONSOLE
11429
11431 {
11433 if (menu)
11434 {
11436 }
11437 }
11438 #endif
11439 }
11440
11442 {
11445 }
11446
11448 {
11449 SetWeightDirty();
11451 }
11453 {
11456 }
11457
11459 {
11462 }
11464 {
11467 }
11468
11469 super.OnVariablesSynchronized();
11470 }
11471
11472
11473
11475 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11476 {
11477 if (!IsServerCheck(allow_client))
11478 return false;
11479
11481 return false;
11482
11485
11486 if (value <= (min + 0.001))
11487 value = min;
11488
11489 if (value == min)
11490 {
11491 if (destroy_config)
11492 {
11493 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11494 if (dstr)
11495 {
11497 this.Delete();
11498 return true;
11499 }
11500 }
11501 else if (destroy_forced)
11502 {
11504 this.Delete();
11505 return true;
11506 }
11507
11509 }
11510
11513
11515 {
11517
11518 if (delta)
11520 }
11521
11523
11524 return false;
11525 }
11526
11527
11529 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11530 {
11532 }
11533
11535 {
11538 }
11539
11541 {
11544 }
11545
11548 {
11549 float value_clamped = Math.Clamp(value, 0, 1);
11551 SetQuantity(result, destroy_config, destroy_forced);
11552 }
11553
11554
11557 {
11559 }
11560
11562 {
11564 }
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11576 {
11577 int slot = -1;
11578 if (GetInventory())
11579 {
11580 InventoryLocation il = new InventoryLocation;
11581 GetInventory().GetCurrentInventoryLocation(il);
11583 }
11584
11586 }
11587
11589 {
11590 float quantity_max = 0;
11591
11593 {
11594 if (attSlotID != -1)
11595 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11596
11597 if (quantity_max <= 0)
11599 }
11600
11601 if (quantity_max <= 0)
11603
11604 return quantity_max;
11605 }
11606
11608 {
11610 }
11611
11613 {
11615 }
11616
11617
11619 {
11621 }
11622
11624 {
11626 }
11627
11629 {
11631 }
11632
11633
11635 {
11636
11637 float weightEx = GetWeightEx();
11638 float special = GetInventoryAndCargoWeight();
11639 return weightEx - special;
11640 }
11641
11642
11644 {
11646 }
11647
11649 {
11651 {
11652 #ifdef DEVELOPER
11653 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11654 {
11655 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11657 }
11658 #endif
11659
11660 return GetQuantity() * GetConfigWeightModified();
11661 }
11662 else if (HasEnergyManager())
11663 {
11664 #ifdef DEVELOPER
11665 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11666 {
11667 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11668 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11669 }
11670 #endif
11671 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11672 }
11673 else
11674 {
11675 #ifdef DEVELOPER
11676 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11677 {
11678 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11679 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11680 }
11681 #endif
11682 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11683 }
11684 }
11685
11688 {
11689 int item_count = 0;
11691
11692 if (GetInventory().GetCargo() != NULL)
11693 {
11694 item_count = GetInventory().GetCargo().GetItemCount();
11695 }
11696
11697 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11698 {
11699 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11700 if (item)
11701 item_count += item.GetNumberOfItems();
11702 }
11703 return item_count;
11704 }
11705
11708 {
11709 float weight = 0;
11710 float wetness = 1;
11711 if (include_wetness)
11714 {
11715 weight = wetness * m_ConfigWeight;
11716 }
11718 {
11719 weight = 1;
11720 }
11721 return weight;
11722 }
11723
11724
11725
11727 {
11728 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11729 {
11730 GameInventory inv = GetInventory();
11731 array<EntityAI> items = new array<EntityAI>;
11733 for (int i = 0; i < items.Count(); i++)
11734 {
11736 if (item)
11737 {
11739 }
11740 }
11741 }
11742 }
11743
11744
11745
11746
11748 {
11749 float energy = 0;
11750 if (HasEnergyManager())
11751 {
11752 energy = GetCompEM().GetEnergy();
11753 }
11754 return energy;
11755 }
11756
11757
11759 {
11760 super.OnEnergyConsumed();
11761
11763 }
11764
11766 {
11767 super.OnEnergyAdded();
11768
11770 }
11771
11772
11774 {
11775 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11776 {
11778 {
11779 float energy_0to1 = GetCompEM().GetEnergy0To1();
11781 }
11782 }
11783 }
11784
11785
11787 {
11788 return ConfigGetFloat("heatIsolation");
11789 }
11790
11792 {
11794 }
11795
11797 {
11798 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11799 if (
GetGame().ConfigIsExisting(paramPath))
11801
11802 return 0.0;
11803 }
11804
11806 {
11807 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11808 if (
GetGame().ConfigIsExisting(paramPath))
11810
11811 return 0.0;
11812 }
11813
11814 override void SetWet(
float value,
bool allow_client =
false)
11815 {
11816 if (!IsServerCheck(allow_client))
11817 return;
11818
11821
11823
11824 m_VarWet = Math.Clamp(value, min, max);
11825
11827 {
11830 }
11831 }
11832
11833 override void AddWet(
float value)
11834 {
11836 }
11837
11839 {
11841 }
11842
11844 {
11846 }
11847
11849 {
11851 }
11852
11854 {
11856 }
11857
11859 {
11861 }
11862
11863 override void OnWetChanged(
float newVal,
float oldVal)
11864 {
11867 if (newLevel != oldLevel)
11868 {
11870 }
11871 }
11872
11874 {
11875 SetWeightDirty();
11876 }
11877
11879 {
11880 return GetWetLevelInternal(
m_VarWet);
11881 }
11882
11883
11884
11886 {
11888 }
11889
11891 {
11893 }
11894
11896 {
11898 }
11899
11901 {
11903 }
11904
11905
11906
11908 {
11909 if (ConfigIsExisting("itemModelLength"))
11910 {
11911 return ConfigGetFloat("itemModelLength");
11912 }
11913 return 0;
11914 }
11915
11917 {
11918 if (ConfigIsExisting("itemAttachOffset"))
11919 {
11920 return ConfigGetFloat("itemAttachOffset");
11921 }
11922 return 0;
11923 }
11924
11925 override void SetCleanness(
int value,
bool allow_client =
false)
11926 {
11927 if (!IsServerCheck(allow_client))
11928 return;
11929
11931
11933
11936 }
11937
11939 {
11941 }
11942
11944 {
11945 return true;
11946 }
11947
11948
11949
11950
11952 {
11954 }
11955
11957 {
11959 }
11960
11961
11962
11963
11964 override void SetColor(
int r,
int g,
int b,
int a)
11965 {
11971 }
11973 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11974 {
11979 }
11980
11982 {
11984 }
11985
11988 {
11989 int r,g,b,a;
11991 r = r/255;
11992 g = g/255;
11993 b = b/255;
11994 a = a/255;
11995 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11996 }
11997
11998
11999
12000 override void SetLiquidType(
int value,
bool allow_client =
false)
12001 {
12002 if (!IsServerCheck(allow_client))
12003 return;
12004
12009 }
12010
12012 {
12013 return ConfigGetInt("varLiquidTypeInit");
12014 }
12015
12017 {
12019 }
12020
12022 {
12024 SetFrozen(false);
12025 }
12026
12029 {
12030 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12031 }
12032
12033
12036 {
12037 PlayerBase nplayer;
12038 if (PlayerBase.CastTo(nplayer, player))
12039 {
12041
12042 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12043 }
12044 }
12045
12046
12049 {
12050 PlayerBase nplayer;
12051 if (PlayerBase.CastTo(nplayer,player))
12052 {
12053
12054 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12055
12056 }
12057
12058
12059 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12060
12061
12062 if (HasEnergyManager())
12063 {
12064 GetCompEM().UpdatePlugState();
12065 }
12066 }
12067
12068
12070 {
12071 super.OnPlacementStarted(player);
12072
12074 }
12075
12076 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12077 {
12079 {
12080 m_AdminLog.OnPlacementComplete(player,
this);
12081 }
12082
12083 super.OnPlacementComplete(player, position, orientation);
12084 }
12085
12086
12087
12088
12089
12091 {
12093 {
12094 return true;
12095 }
12096 else
12097 {
12098 return false;
12099 }
12100 }
12101
12102
12104 {
12106 {
12108 }
12109 }
12110
12111
12113 {
12115 }
12116
12118 {
12120 }
12121
12122 override void InsertAgent(
int agent,
float count = 1)
12123 {
12124 if (count < 1)
12125 return;
12126
12128 }
12129
12132 {
12134 }
12135
12136
12138 {
12140 }
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12184 {
12186 return false;
12187 return true;
12188 }
12189
12191 {
12192
12194 }
12195
12196
12199 {
12200 super.CheckForRoofLimited(timeTresholdMS);
12201
12203 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12204 {
12205 m_PreviousRoofTestTime = time;
12206 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12207 }
12208 }
12209
12210
12212 {
12214 {
12215 return 0;
12216 }
12217
12218 if (GetInventory().GetAttachmentSlotsCount() != 0)
12219 {
12220 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12221 if (filter)
12222 return filter.GetProtectionLevel(type, false, system);
12223 else
12224 return 0;
12225 }
12226
12227 string subclassPath, entryName;
12228
12229 switch (type)
12230 {
12232 entryName = "biological";
12233 break;
12235 entryName = "chemical";
12236 break;
12237 default:
12238 entryName = "biological";
12239 break;
12240 }
12241
12242 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12243
12245 }
12246
12247
12248
12251 {
12252 if (!IsMagazine())
12254
12256 }
12257
12258
12259
12260
12261
12266 {
12267 return true;
12268 }
12269
12271 {
12273 }
12274
12275
12276
12277
12278
12280 {
12281 if (parent)
12282 {
12283 if (parent.IsInherited(DayZInfected))
12284 return true;
12285
12286 if (!parent.IsRuined())
12287 return true;
12288 }
12289
12290 return true;
12291 }
12292
12294 {
12295 if (!super.CanPutAsAttachment(parent))
12296 {
12297 return false;
12298 }
12299
12300 if (!IsRuined() && !parent.IsRuined())
12301 {
12302 return true;
12303 }
12304
12305 return false;
12306 }
12307
12309 {
12310
12311
12312
12313
12314 return super.CanReceiveItemIntoCargo(item);
12315 }
12316
12318 {
12319
12320
12321
12322
12323 GameInventory attachmentInv = attachment.GetInventory();
12325 {
12326 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12327 return false;
12328 }
12329
12330 InventoryLocation loc = new InventoryLocation();
12331 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12332 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12333 return false;
12334
12335 return super.CanReceiveAttachment(attachment, slotId);
12336 }
12337
12339 {
12340 if (!super.CanReleaseAttachment(attachment))
12341 return false;
12342
12343 return GetInventory().AreChildrenAccessible();
12344 }
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12367 {
12368 int id = muzzle_owner.GetMuzzleID();
12369 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12370
12371 if (WPOF_array)
12372 {
12373 for (int i = 0; i < WPOF_array.Count(); i++)
12374 {
12375 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12376
12377 if (WPOF)
12378 {
12379 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12380 }
12381 }
12382 }
12383 }
12384
12385
12387 {
12388 int id = muzzle_owner.GetMuzzleID();
12390
12391 if (WPOBE_array)
12392 {
12393 for (int i = 0; i < WPOBE_array.Count(); i++)
12394 {
12395 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12396
12397 if (WPOBE)
12398 {
12399 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12400 }
12401 }
12402 }
12403 }
12404
12405
12407 {
12408 int id = muzzle_owner.GetMuzzleID();
12409 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12410
12411 if (WPOOH_array)
12412 {
12413 for (int i = 0; i < WPOOH_array.Count(); i++)
12414 {
12415 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12416
12417 if (WPOOH)
12418 {
12419 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12420 }
12421 }
12422 }
12423 }
12424
12425
12427 {
12428 int id = muzzle_owner.GetMuzzleID();
12429 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12430
12431 if (WPOOH_array)
12432 {
12433 for (int i = 0; i < WPOOH_array.Count(); i++)
12434 {
12435 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12436
12437 if (WPOOH)
12438 {
12439 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12440 }
12441 }
12442 }
12443 }
12444
12445
12447 {
12448 int id = muzzle_owner.GetMuzzleID();
12449 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12450
12451 if (WPOOH_array)
12452 {
12453 for (int i = 0; i < WPOOH_array.Count(); i++)
12454 {
12455 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12456
12457 if (WPOOH)
12458 {
12459 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12460 }
12461 }
12462 }
12463 }
12464
12465
12466
12468 {
12470 {
12471 return true;
12472 }
12473
12474 return false;
12475 }
12476
12478 {
12480 {
12481 return true;
12482 }
12483
12484 return false;
12485 }
12486
12488 {
12490 {
12491 return true;
12492 }
12493
12494 return false;
12495 }
12496
12498 {
12499 return false;
12500 }
12501
12504 {
12505 return UATimeSpent.DEFAULT_DEPLOY;
12506 }
12507
12508
12509
12510
12512 {
12514 SetSynchDirty();
12515 }
12516
12518 {
12520 }
12521
12522
12524 {
12525 return false;
12526 }
12527
12530 {
12531 string att_type = "None";
12532
12533 if (ConfigIsExisting("soundAttType"))
12534 {
12535 att_type = ConfigGetString("soundAttType");
12536 }
12537
12539 }
12540
12542 {
12544 }
12545
12546
12547
12548
12549
12553
12555 {
12558
12560 }
12561
12562
12564 {
12566 return;
12567
12569
12572
12575
12576 SoundParameters params = new SoundParameters();
12580 }
12581
12582
12584 {
12586 return;
12587
12589 SetSynchDirty();
12590
12593 }
12594
12595
12597 {
12599 return;
12600
12602 SetSynchDirty();
12603
12606 }
12607
12609 {
12611 }
12612
12614 {
12616 }
12617
12620 {
12621 if (!
GetGame().IsDedicatedServer())
12622 {
12623 if (ConfigIsExisting("attachSoundSet"))
12624 {
12625 string cfg_path = "";
12626 string soundset = "";
12627 string type_name =
GetType();
12628
12631 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12632 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12633
12634 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12635 {
12636 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12637 {
12638 if (cfg_slot_array[i] == slot_type)
12639 {
12640 soundset = cfg_soundset_array[i];
12641 break;
12642 }
12643 }
12644 }
12645
12646 if (soundset != "")
12647 {
12648 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12650 }
12651 }
12652 }
12653 }
12654
12656 {
12657
12658 }
12659
12660 void OnApply(PlayerBase player);
12661
12663 {
12664 return 1.0;
12665 };
12666
12668 {
12670 }
12671
12673 {
12675 }
12676
12678
12680 {
12681 SetDynamicPhysicsLifeTime(0.01);
12683 }
12684
12686 {
12687 array<string> zone_names = new array<string>;
12688 GetDamageZones(zone_names);
12689 for (int i = 0; i < zone_names.Count(); i++)
12690 {
12691 SetHealthMax(zone_names.Get(i),"Health");
12692 }
12693 SetHealthMax("","Health");
12694 }
12695
12698 {
12699 float global_health = GetHealth01("","Health");
12700 array<string> zones = new array<string>;
12701 GetDamageZones(zones);
12702
12703 for (int i = 0; i < zones.Count(); i++)
12704 {
12705 SetHealth01(zones.Get(i),"Health",global_health);
12706 }
12707 }
12708
12711 {
12712 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12713 }
12714
12716 {
12717 if (!hasRootAsPlayer)
12718 {
12719 if (refParentIB)
12720 {
12721
12722 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12723 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12724
12725 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12726 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12727
12730 }
12731 else
12732 {
12733
12736 }
12737 }
12738 }
12739
12741 {
12743 {
12744 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12745 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12746 {
12747 float heatPermCoef = 1.0;
12749 while (ent)
12750 {
12751 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12752 ent = ent.GetHierarchyParent();
12753 }
12754
12755 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12756 }
12757 }
12758 }
12759
12761 {
12762
12763 EntityAI parent = GetHierarchyParent();
12764 if (!parent)
12765 {
12766 hasParent = false;
12767 hasRootAsPlayer = false;
12768 }
12769 else
12770 {
12771 hasParent = true;
12772 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12773 refParentIB =
ItemBase.Cast(parent);
12774 }
12775 }
12776
12777 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12778 {
12779
12780 }
12781
12783 {
12784
12785 return false;
12786 }
12787
12789 {
12790
12791
12792 return false;
12793 }
12794
12796 {
12797
12798 return false;
12799 }
12800
12803 {
12804 return !GetIsFrozen() &&
IsOpen();
12805 }
12806
12808 {
12809 bool hasParent = false, hasRootAsPlayer = false;
12811
12812 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12813 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12814
12815 if (wwtu || foodDecay)
12816 {
12820
12821 if (processWetness || processTemperature || processDecay)
12822 {
12824
12825 if (processWetness)
12826 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12827
12828 if (processTemperature)
12830
12831 if (processDecay)
12832 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12833 }
12834 }
12835 }
12836
12839 {
12841 }
12842
12844 {
12847
12848 return super.GetTemperatureFreezeThreshold();
12849 }
12850
12852 {
12855
12856 return super.GetTemperatureThawThreshold();
12857 }
12858
12860 {
12863
12864 return super.GetItemOverheatThreshold();
12865 }
12866
12868 {
12870 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12871
12872 return super.GetTemperatureFreezeTime();
12873 }
12874
12876 {
12878 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12879
12880 return super.GetTemperatureThawTime();
12881 }
12882
12887
12889 {
12890 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12891 }
12892
12894 {
12895 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12896 }
12897
12900 {
12902 }
12903
12905 {
12907 }
12908
12910 {
12912 }
12913
12916 {
12917 return null;
12918 }
12919
12922 {
12923 return false;
12924 }
12925
12927 {
12929 {
12932 if (!trg)
12933 {
12935 explosive = this;
12936 }
12937
12938 explosive.PairRemote(trg);
12940
12941 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12942 trg.SetPersistentPairID(persistentID);
12943 explosive.SetPersistentPairID(persistentID);
12944
12945 return true;
12946 }
12947 return false;
12948 }
12949
12952 {
12953 float ret = 1.0;
12956 ret *= GetHealth01();
12957
12958 return ret;
12959 }
12960
12961 #ifdef DEVELOPER
12962 override void SetDebugItem()
12963 {
12964 super.SetDebugItem();
12965 _itemBase = this;
12966 }
12967
12969 {
12970 string text = super.GetDebugText();
12971
12973 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12974
12975 return text;
12976 }
12977 #endif
12978
12980 {
12981 return true;
12982 }
12983
12985
12987
12989 {
12992 }
12993
12994
13002
13018}
13019
13021{
13023 if (entity)
13024 {
13025 bool is_item = entity.IsInherited(
ItemBase);
13026 if (is_item && full_quantity)
13027 {
13030 }
13031 }
13032 else
13033 {
13035 return NULL;
13036 }
13037 return entity;
13038}
13039
13041{
13042 if (item)
13043 {
13044 if (health > 0)
13045 item.SetHealth("", "", health);
13046
13047 if (item.CanHaveTemperature())
13048 {
13050 if (item.CanFreeze())
13051 item.SetFrozen(false);
13052 }
13053
13054 if (item.HasEnergyManager())
13055 {
13056 if (quantity >= 0)
13057 {
13058 item.GetCompEM().SetEnergy0To1(quantity);
13059 }
13060 else
13061 {
13063 }
13064 }
13065 else if (item.IsMagazine())
13066 {
13067 Magazine mag = Magazine.Cast(item);
13068 if (quantity >= 0)
13069 {
13070 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13071 }
13072 else
13073 {
13075 }
13076
13077 }
13078 else
13079 {
13080 if (quantity >= 0)
13081 {
13082 item.SetQuantityNormalized(quantity, false);
13083 }
13084 else
13085 {
13087 }
13088
13089 }
13090 }
13091}
13092
13093#ifdef DEVELOPER
13095#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.