8261{
8263 {
8264 return true;
8265 }
8266};
8267
8268
8269
8271{
8275
8277
8280
8281
8282
8283
8284
8293
8299
8304
8309
8330 protected bool m_IsResultOfSplit
8331
8333
8338
8339
8340
8342
8346
8347
8348
8350
8353
8354
8355
8361
8362
8370
8373
8374
8376
8377
8379
8380
8385
8386
8391
8392
8394
8395
8397 {
8402
8403 if (!
GetGame().IsDedicatedServer())
8404 {
8406 {
8408
8410 {
8412 }
8413 }
8414
8417 }
8418
8419 m_OldLocation = null;
8420
8422 {
8424 }
8425
8426 if (ConfigIsExisting("headSelectionsToHide"))
8427 {
8430 }
8431
8433 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8434 {
8436 }
8437
8439
8440 m_IsResultOfSplit = false;
8441
8443 }
8444
8446 {
8447 super.InitItemVariables();
8448
8454 m_Count = ConfigGetInt(
"count");
8455
8458
8463
8466
8471
8483
8487
8488
8491 if (ConfigIsExisting("canBeSplit"))
8492 {
8495 }
8496
8498 if (ConfigIsExisting("itemBehaviour"))
8500
8501
8504 RegisterNetSyncVariableInt("m_VarLiquidType");
8505 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8506
8507 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8508 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8509 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8510
8511 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8512 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8513 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8514 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8515
8516 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8517 RegisterNetSyncVariableBool("m_IsTakeable");
8518 RegisterNetSyncVariableBool("m_IsHologram");
8519
8522 {
8525 }
8526
8528
8530 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8532
8533 }
8534
8536 {
8538 }
8539
8541 {
8544 {
8549 }
8550 }
8551
8552 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8553 {
8555 {
8558 }
8559
8561 }
8562
8564 {
8570 }
8571
8573
8575 {
8577
8578 if (!action)
8579 {
8580 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8581 return;
8582 }
8583
8585 if (!ai)
8586 {
8588 return;
8589 }
8590
8592 if (!action_array)
8593 {
8594 action_array = new array<ActionBase_Basic>;
8596 }
8597 if (LogManager.IsActionLogEnable())
8598 {
8599 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8600 }
8601
8602 if (action_array.Find(action) != -1)
8603 {
8604 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8605 }
8606 else
8607 {
8608 action_array.Insert(action);
8609 }
8610 }
8611
8613 {
8615 ActionBase action = player.GetActionManager().GetAction(actionName);
8618
8619 if (action_array)
8620 {
8621 action_array.RemoveItem(action);
8622 }
8623 }
8624
8625
8626
8628 {
8629 ActionOverrideData overrideData = new ActionOverrideData();
8633
8635 if (!actionMap)
8636 {
8639 }
8640
8641 actionMap.Insert(this.
Type(), overrideData);
8642
8643 }
8644
8646
8648
8649
8651 {
8654
8657
8658 string config_to_search = "CfgVehicles";
8659 string muzzle_owner_config;
8660
8662 {
8663 if (IsInherited(Weapon))
8664 config_to_search = "CfgWeapons";
8665
8666 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8667
8668 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8669
8671
8672 if (config_OnFire_subclass_count > 0)
8673 {
8674 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8675
8676 for (int i = 0; i < config_OnFire_subclass_count; i++)
8677 {
8678 string particle_class = "";
8680 string config_OnFire_entry = config_OnFire_class + particle_class;
8681 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8682 WPOF_array.Insert(WPOF);
8683 }
8684
8685
8687 }
8688 }
8689
8691 {
8692 config_to_search = "CfgWeapons";
8693 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8694
8695 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8696
8698
8699 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8700 {
8701 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8702
8703 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8704 {
8705 string particle_class2 = "";
8707 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8708 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8709 WPOBE_array.Insert(WPOBE);
8710 }
8711
8712
8714 }
8715 }
8716 }
8717
8718
8720 {
8723
8725 {
8726 string config_to_search = "CfgVehicles";
8727
8728 if (IsInherited(Weapon))
8729 config_to_search = "CfgWeapons";
8730
8731 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8732 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8733
8734 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8735 {
8736
8738
8740 {
8742 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8744 return;
8745 }
8746
8749
8750
8751
8753 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8754
8755 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8756 {
8757 string particle_class = "";
8759 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8761
8762 if (entry_type == CT_CLASS)
8763 {
8764 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8765 WPOOH_array.Insert(WPOF);
8766 }
8767 }
8768
8769
8771 }
8772 }
8773 }
8774
8776 {
8778 }
8779
8781 {
8783 {
8785
8788
8791
8792 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8793 }
8794 }
8795
8797 {
8799 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8800
8802 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8803
8805 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8806
8808 {
8810 }
8811 }
8812
8814 {
8816 }
8817
8819 {
8822 else
8824
8826 {
8829 }
8830 else
8831 {
8834
8837 }
8838
8840 }
8841
8843 {
8845 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8846 }
8847
8849 {
8851 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8853 }
8854
8856 {
8858 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8859 }
8860
8862 {
8865
8866 OverheatingParticle OP = new OverheatingParticle();
8871
8873 }
8874
8876 {
8879
8880 return -1;
8881 }
8882
8884 {
8886 {
8889
8890 for (int i = count; i > 0; --i)
8891 {
8892 int id = i - 1;
8895
8898
8899 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8900 {
8901 if (p)
8902 {
8905 }
8906 }
8907 }
8908 }
8909 }
8910
8912 {
8914 {
8916 {
8917 int id = i - 1;
8919
8920 if (OP)
8921 {
8923
8924 if (p)
8925 {
8927 }
8928
8929 delete OP;
8930 }
8931 }
8932
8935 }
8936 }
8937
8940 {
8941 return 0.0;
8942 }
8943
8944
8946 {
8947 return 250;
8948 }
8949
8951 {
8952 return 0;
8953 }
8954
8957 {
8959 return true;
8960
8961 return false;
8962 }
8963
8966 {
8969
8971 {
8973 }
8974 else
8975 {
8976
8978 }
8979
8981 }
8982
8989 {
8990 return -1;
8991 }
8992
8993
8994
8995
8997 {
8999 {
9001 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9002
9003 if (r_index >= 0)
9004 {
9005 InventoryLocation r_il = new InventoryLocation;
9006 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9007
9008 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9011 {
9012 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9013 }
9015 {
9016 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9017 }
9018
9019 }
9020
9021 player.GetHumanInventory().ClearUserReservedLocation(this);
9022 }
9023
9026 }
9027
9028
9029
9030
9032 {
9033 return ItemBase.m_DebugActionsMask;
9034 }
9035
9037 {
9038 return ItemBase.m_DebugActionsMask & mask;
9039 }
9040
9042 {
9043 ItemBase.m_DebugActionsMask = mask;
9044 }
9045
9047 {
9048 ItemBase.m_DebugActionsMask |= mask;
9049 }
9050
9052 {
9053 ItemBase.m_DebugActionsMask &= ~mask;
9054 }
9055
9057 {
9059 {
9061 }
9062 else
9063 {
9065 }
9066 }
9067
9068
9070 {
9071 if (GetEconomyProfile())
9072 {
9073 float q_max = GetEconomyProfile().GetQuantityMax();
9074 if (q_max > 0)
9075 {
9076 float q_min = GetEconomyProfile().GetQuantityMin();
9077 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9078
9080 {
9081 ComponentEnergyManager comp = GetCompEM();
9083 {
9085 }
9086 }
9088 {
9090
9091 }
9092
9093 }
9094 }
9095 }
9096
9099 {
9100 EntityAI parent = GetHierarchyParent();
9101
9102 if (parent)
9103 {
9104 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9105 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9106 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9107 }
9108 }
9109
9112 {
9113 EntityAI parent = GetHierarchyParent();
9114
9115 if (parent)
9116 {
9117 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9118 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9119 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9120 }
9121 }
9122
9124 {
9125
9126
9127
9128
9130
9132 {
9133 if (ScriptInputUserData.CanStoreInputUserData())
9134 {
9135 ScriptInputUserData ctx = new ScriptInputUserData;
9141 ctx.
Write(use_stack_max);
9144
9146 {
9147 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9148 }
9149 }
9150 }
9151 else if (!
GetGame().IsMultiplayer())
9152 {
9154 }
9155 }
9156
9158 {
9160 }
9161
9163 {
9165 }
9166
9168 {
9170 }
9171
9173 {
9174
9175 return false;
9176 }
9177
9179 {
9180 return false;
9181 }
9182
9186 {
9187 return false;
9188 }
9189
9191 {
9192 return "";
9193 }
9194
9196
9198 {
9199 return false;
9200 }
9201
9203 {
9204 return true;
9205 }
9206
9207
9208
9210 {
9211 return true;
9212 }
9213
9215 {
9216 return true;
9217 }
9218
9220 {
9221 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9223 }
9224
9226 {
9228 }
9229
9231 {
9233 if (!is_being_placed)
9235 SetSynchDirty();
9236 }
9237
9238
9240
9242 {
9244 }
9245
9247 {
9249 }
9250
9252 {
9253 return 1;
9254 }
9255
9257 {
9258 return false;
9259 }
9260
9262 {
9264 SetSynchDirty();
9265 }
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9302 {
9303 super.OnMovedInsideCargo(container);
9304
9305 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9306 }
9307
9308 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9309 {
9310 super.EEItemLocationChanged(oldLoc,newLoc);
9311
9312 PlayerBase new_player = null;
9313 PlayerBase old_player = null;
9314
9315 if (newLoc.GetParent())
9316 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9317
9318 if (oldLoc.GetParent())
9319 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9320
9322 {
9323 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9324
9325 if (r_index >= 0)
9326 {
9327 InventoryLocation r_il = new InventoryLocation;
9328 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9329
9330 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9333 {
9334 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9335 }
9337 {
9338 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9339 }
9340
9341 }
9342 }
9343
9345 {
9346 if (new_player)
9347 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9348
9349 if (new_player == old_player)
9350 {
9351
9352 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9353 {
9355 {
9356 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9357 {
9358 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9359 }
9360 }
9361 else
9362 {
9363 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9364 }
9365 }
9366
9367 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9368 {
9369 int type = oldLoc.GetType();
9371 {
9372 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9373 }
9375 {
9376 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9377 }
9378 }
9379 if (!m_OldLocation)
9380 {
9381 m_OldLocation = new InventoryLocation;
9382 }
9383 m_OldLocation.Copy(oldLoc);
9384 }
9385 else
9386 {
9387 if (m_OldLocation)
9388 {
9389 m_OldLocation.Reset();
9390 }
9391 }
9392
9394 }
9395 else
9396 {
9397 if (new_player)
9398 {
9399 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9400 if (res_index >= 0)
9401 {
9402 InventoryLocation il = new InventoryLocation;
9403 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9405 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9408 {
9409 il.
GetParent().GetOnReleaseLock().Invoke(it);
9410 }
9412 {
9414 }
9415
9416 }
9417 }
9419 {
9420
9422 }
9423
9424 if (m_OldLocation)
9425 {
9426 m_OldLocation.Reset();
9427 }
9428 }
9429 }
9430
9431 override void EOnContact(IEntity other, Contact extra)
9432 {
9434 {
9435 int liquidType = -1;
9437 if (impactSpeed > 0.0)
9438 {
9440 #ifndef SERVER
9442 #else
9444 SetSynchDirty();
9445 #endif
9447 }
9448 }
9449
9450 #ifdef SERVER
9451 if (GetCompEM() && GetCompEM().IsPlugged())
9452 {
9453 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9454 GetCompEM().UnplugThis();
9455 }
9456 #endif
9457 }
9458
9460
9462 {
9464 }
9465
9467 {
9468
9469 }
9470
9472 {
9473 super.OnItemLocationChanged(old_owner, new_owner);
9474
9475 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9476 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9477
9478 if (!relatedPlayer && playerNew)
9479 relatedPlayer = playerNew;
9480
9481 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9482 {
9484 if (actionMgr)
9485 {
9486 ActionBase currentAction = actionMgr.GetRunningAction();
9487 if (currentAction)
9489 }
9490 }
9491
9492 Man ownerPlayerOld = null;
9493 Man ownerPlayerNew = null;
9494
9495 if (old_owner)
9496 {
9497 if (old_owner.
IsMan())
9498 {
9499 ownerPlayerOld = Man.Cast(old_owner);
9500 }
9501 else
9502 {
9503 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9504 }
9505 }
9506 else
9507 {
9509 {
9511
9512 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9513 {
9514 GetCompEM().UnplugThis();
9515 }
9516 }
9517 }
9518
9519 if (new_owner)
9520 {
9521 if (new_owner.
IsMan())
9522 {
9523 ownerPlayerNew = Man.Cast(new_owner);
9524 }
9525 else
9526 {
9527 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9528 }
9529 }
9530
9531 if (ownerPlayerOld != ownerPlayerNew)
9532 {
9533 if (ownerPlayerOld)
9534 {
9535 array<EntityAI> subItemsExit = new array<EntityAI>;
9537 for (int i = 0; i < subItemsExit.Count(); i++)
9538 {
9541 }
9542 }
9543
9544 if (ownerPlayerNew)
9545 {
9546 array<EntityAI> subItemsEnter = new array<EntityAI>;
9548 for (int j = 0; j < subItemsEnter.Count(); j++)
9549 {
9552 }
9553 }
9554 }
9555 else if (ownerPlayerNew != null)
9556 {
9557 PlayerBase nplayer;
9558 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9559 {
9560 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9562 for (int k = 0; k < subItemsUpdate.Count(); k++)
9563 {
9565 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9566 }
9567 }
9568 }
9569
9570 if (old_owner)
9571 old_owner.OnChildItemRemoved(this);
9572 if (new_owner)
9573 new_owner.OnChildItemReceived(this);
9574 }
9575
9576
9578 {
9579 super.EEDelete(parent);
9580 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9581 if (player)
9582 {
9584
9585 if (player.IsAlive())
9586 {
9587 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9588 if (r_index >= 0)
9589 {
9590 InventoryLocation r_il = new InventoryLocation;
9591 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9592
9593 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9596 {
9597 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9598 }
9600 {
9601 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9602 }
9603
9604 }
9605
9606 player.RemoveQuickBarEntityShortcut(this);
9607 }
9608 }
9609 }
9610
9612 {
9613 super.EEKilled(killer);
9614
9617 {
9618 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9619 {
9620 if (IsMagazine())
9621 {
9622 if (Magazine.Cast(this).GetAmmoCount() > 0)
9623 {
9625 }
9626 }
9627 else
9628 {
9630 }
9631 }
9632 }
9633 }
9634
9636 {
9637 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9638
9639 super.OnWasAttached(parent, slot_id);
9640
9643
9645 }
9646
9648 {
9649 super.OnWasDetached(parent, slot_id);
9650
9653 }
9654
9656 {
9657 int idx;
9660
9661 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9662 if (inventory_slots.Count() < 1)
9663 {
9664 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9665 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9666 }
9667 else
9668 {
9669 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9670 }
9671
9672 idx = inventory_slots.Find(slot);
9673 if (idx < 0)
9674 return "";
9675
9676 return attach_types.Get(idx);
9677 }
9678
9680 {
9681 int idx = -1;
9682 string slot;
9683
9686
9687 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9688 if (inventory_slots.Count() < 1)
9689 {
9690 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9691 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9692 }
9693 else
9694 {
9695 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9696 if (detach_types.Count() < 1)
9697 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9698 }
9699
9700 for (int i = 0; i < inventory_slots.Count(); i++)
9701 {
9702 slot = inventory_slots.Get(i);
9703 }
9704
9705 if (slot != "")
9706 {
9707 if (detach_types.Count() == 1)
9708 idx = 0;
9709 else
9710 idx = inventory_slots.Find(slot);
9711 }
9712 if (idx < 0)
9713 return "";
9714
9715 return detach_types.Get(idx);
9716 }
9717
9719 {
9720
9722
9723
9724 float min_time = 1;
9725 float max_time = 3;
9726 float delay = Math.RandomFloat(min_time, max_time);
9727
9728 explode_timer.Run(delay, this, "DoAmmoExplosion");
9729 }
9730
9732 {
9733 Magazine magazine = Magazine.Cast(this);
9734 int pop_sounds_count = 6;
9735 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9736
9737
9738 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9739 string sound_name = pop_sounds[ sound_idx ];
9741
9742
9743 magazine.ServerAddAmmoCount(-1);
9744
9745
9746 float min_temp_to_explode = 100;
9747
9748 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9749 {
9751 }
9752 }
9753
9754
9755 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9756 {
9757 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9758
9759 const int CHANCE_DAMAGE_CARGO = 4;
9760 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9761 const int CHANCE_DAMAGE_NOTHING = 2;
9762
9764 {
9765 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9766 int chances;
9767 int rnd;
9768
9769 if (GetInventory().GetCargo())
9770 {
9771 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9772 rnd = Math.RandomInt(0,chances);
9773
9774 if (rnd < CHANCE_DAMAGE_CARGO)
9775 {
9777 }
9778 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9779 {
9781 }
9782 }
9783 else
9784 {
9785 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9786 rnd = Math.RandomInt(0,chances);
9787
9788 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9789 {
9791 }
9792 }
9793 }
9794 }
9795
9797 {
9798 if (GetInventory().GetCargo())
9799 {
9800 int item_count = GetInventory().GetCargo().GetItemCount();
9801 if (item_count > 0)
9802 {
9803 int random_pick = Math.RandomInt(0, item_count);
9805 if (!item.IsExplosive())
9806 {
9807 item.AddHealth("","",damage);
9808 return true;
9809 }
9810 }
9811 }
9812 return false;
9813 }
9814
9816 {
9817 int attachment_count = GetInventory().AttachmentCount();
9818 if (attachment_count > 0)
9819 {
9820 int random_pick = Math.RandomInt(0, attachment_count);
9821 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9822 if (!attachment.IsExplosive())
9823 {
9824 attachment.AddHealth("","",damage);
9825 return true;
9826 }
9827 }
9828 return false;
9829 }
9830
9832 {
9834 }
9835
9837 {
9839 return GetInventory().CanRemoveEntity();
9840
9841 return false;
9842 }
9843
9845 {
9847 return;
9848
9850 {
9851 if (ScriptInputUserData.CanStoreInputUserData())
9852 {
9853 ScriptInputUserData ctx = new ScriptInputUserData;
9858 ctx.
Write(destination_entity);
9862 }
9863 }
9864 else if (!
GetGame().IsMultiplayer())
9865 {
9867 }
9868 }
9869
9871 {
9873 return;
9874
9875 float split_quantity_new;
9879 InventoryLocation loc = new InventoryLocation;
9880
9881 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9882 {
9884 split_quantity_new = stack_max;
9885 else
9887
9888 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9889 if (new_item)
9890 {
9891 new_item.SetResultOfSplit(true);
9892 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9894 new_item.SetQuantity(split_quantity_new);
9895 }
9896 }
9897 else if (destination_entity && slot_id == -1)
9898 {
9899 if (quantity > stack_max)
9900 split_quantity_new = stack_max;
9901 else
9902 split_quantity_new = quantity;
9903
9905 {
9908 }
9909
9910 if (new_item)
9911 {
9912 new_item.SetResultOfSplit(true);
9913 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9915 new_item.SetQuantity(split_quantity_new);
9916 }
9917 }
9918 else
9919 {
9920 if (stack_max != 0)
9921 {
9923 {
9925 }
9926
9927 if (split_quantity_new == 0)
9928 {
9929 if (!
GetGame().IsMultiplayer())
9930 player.PhysicalPredictiveDropItem(this);
9931 else
9932 player.ServerDropEntity(this);
9933 return;
9934 }
9935
9937
9938 if (new_item)
9939 {
9940 new_item.SetResultOfSplit(true);
9941 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9943 new_item.SetQuantity(stack_max);
9944 new_item.PlaceOnSurface();
9945 }
9946 }
9947 }
9948 }
9949
9951 {
9953 return;
9954
9955 float split_quantity_new;
9959 InventoryLocation loc = new InventoryLocation;
9960
9961 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9962 {
9964 split_quantity_new = stack_max;
9965 else
9967
9968 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9969 if (new_item)
9970 {
9971 new_item.SetResultOfSplit(true);
9972 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9974 new_item.SetQuantity(split_quantity_new);
9975 }
9976 }
9977 else if (destination_entity && slot_id == -1)
9978 {
9979 if (quantity > stack_max)
9980 split_quantity_new = stack_max;
9981 else
9982 split_quantity_new = quantity;
9983
9985 {
9988 }
9989
9990 if (new_item)
9991 {
9992 new_item.SetResultOfSplit(true);
9993 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9995 new_item.SetQuantity(split_quantity_new);
9996 }
9997 }
9998 else
9999 {
10000 if (stack_max != 0)
10001 {
10003 {
10005 }
10006
10008
10009 if (new_item)
10010 {
10011 new_item.SetResultOfSplit(true);
10012 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10014 new_item.SetQuantity(stack_max);
10015 new_item.PlaceOnSurface();
10016 }
10017 }
10018 }
10019 }
10020
10022 {
10024 return;
10025
10027 {
10028 if (ScriptInputUserData.CanStoreInputUserData())
10029 {
10030 ScriptInputUserData ctx = new ScriptInputUserData;
10035 dst.WriteToContext(ctx);
10037 }
10038 }
10039 else if (!
GetGame().IsMultiplayer())
10040 {
10042 }
10043 }
10044
10046 {
10048 return;
10049
10051 {
10052 if (ScriptInputUserData.CanStoreInputUserData())
10053 {
10054 ScriptInputUserData ctx = new ScriptInputUserData;
10059 ctx.
Write(destination_entity);
10065 }
10066 }
10067 else if (!
GetGame().IsMultiplayer())
10068 {
10070 }
10071 }
10072
10074 {
10076 }
10077
10079 {
10081 return this;
10082
10084 float split_quantity_new;
10086 if (dst.IsValid())
10087 {
10088 int slot_id = dst.GetSlot();
10090
10091 if (quantity > stack_max)
10092 split_quantity_new = stack_max;
10093 else
10094 split_quantity_new = quantity;
10095
10097
10098 if (new_item)
10099 {
10100 new_item.SetResultOfSplit(true);
10101 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10104 }
10105
10106 return new_item;
10107 }
10108
10109 return null;
10110 }
10111
10113 {
10115 return;
10116
10118 float split_quantity_new;
10120 if (destination_entity)
10121 {
10123 if (quantity > stackable)
10124 split_quantity_new = stackable;
10125 else
10126 split_quantity_new = quantity;
10127
10128 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10129 if (new_item)
10130 {
10131 new_item.SetResultOfSplit(true);
10132 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10134 new_item.SetQuantity(split_quantity_new);
10135 }
10136 }
10137 }
10138
10140 {
10142 return;
10143
10145 {
10146 if (ScriptInputUserData.CanStoreInputUserData())
10147 {
10148 ScriptInputUserData ctx = new ScriptInputUserData;
10153 ItemBase destination_entity =
this;
10154 ctx.
Write(destination_entity);
10158 }
10159 }
10160 else if (!
GetGame().IsMultiplayer())
10161 {
10163 }
10164 }
10165
10167 {
10169 return;
10170
10172 float split_quantity_new;
10174 if (player)
10175 {
10177 if (quantity > stackable)
10178 split_quantity_new = stackable;
10179 else
10180 split_quantity_new = quantity;
10181
10182 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10183 new_item =
ItemBase.Cast(in_hands);
10184 if (new_item)
10185 {
10186 new_item.SetResultOfSplit(true);
10187 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10189 new_item.SetQuantity(split_quantity_new);
10190 }
10191 }
10192 }
10193
10195 {
10197 return;
10198
10200 float split_quantity_new = Math.Floor(quantity * 0.5);
10201
10203
10204 if (new_item)
10205 {
10206 if (new_item.GetQuantityMax() < split_quantity_new)
10207 {
10208 split_quantity_new = new_item.GetQuantityMax();
10209 }
10210
10211 new_item.SetResultOfSplit(true);
10212 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10213
10215 {
10218 }
10219 else
10220 {
10223 }
10224 }
10225 }
10226
10228 {
10230 return;
10231
10233 float split_quantity_new = Math.Floor(quantity / 2);
10234
10235 InventoryLocation invloc = new InventoryLocation;
10237
10239 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10240
10241 if (new_item)
10242 {
10243 if (new_item.GetQuantityMax() < split_quantity_new)
10244 {
10245 split_quantity_new = new_item.GetQuantityMax();
10246 }
10248 {
10251 }
10252 else
10253 {
10256 }
10257 }
10258 }
10259
10262 {
10263 SetWeightDirty();
10265
10266 if (parent)
10267 parent.OnAttachmentQuantityChangedEx(this, delta);
10268
10270 {
10272 {
10274 }
10276 {
10277 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10279 }
10280 }
10281
10282 }
10283
10286 {
10287
10288 }
10289
10292 {
10294 }
10295
10297 {
10298 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10299
10301 {
10302 if (newLevel == GameConstants.STATE_RUINED)
10303 {
10305 EntityAI parent = GetHierarchyParent();
10306 if (parent && parent.IsFireplace())
10307 {
10308 CargoBase cargo = GetInventory().GetCargo();
10309 if (cargo)
10310 {
10312 {
10314 }
10315 }
10316 }
10317 }
10318
10320 {
10321
10323 return;
10324 }
10325
10326 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10327 {
10329 }
10330 }
10331 }
10332
10333
10335 {
10336 super.OnRightClick();
10337
10339 {
10341 {
10342 if (ScriptInputUserData.CanStoreInputUserData())
10343 {
10344 vector m4[4];
10346
10347 EntityAI root = GetHierarchyRoot();
10348
10349 InventoryLocation dst = new InventoryLocation;
10351 {
10352 if (root)
10353 {
10354 root.GetTransform(m4);
10356 }
10357 else
10358 GetInventory().GetCurrentInventoryLocation(dst);
10359 }
10360 else
10361 {
10363
10364
10365 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10366 {
10367 if (root)
10368 {
10369 root.GetTransform(m4);
10371 }
10372 else
10373 GetInventory().GetCurrentInventoryLocation(dst);
10374 }
10375 else
10376 {
10377 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10378 }
10379 }
10380
10381 ScriptInputUserData ctx = new ScriptInputUserData;
10389 }
10390 }
10391 else if (!
GetGame().IsMultiplayer())
10392 {
10394 }
10395 }
10396 }
10397
10398 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10399 {
10400
10401 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10402 return false;
10403
10404 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10405 return false;
10406
10407
10409 return false;
10410
10411
10412 Magazine mag = Magazine.Cast(this);
10413 if (mag)
10414 {
10415 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10416 return false;
10417
10418 if (stack_max_limit)
10419 {
10420 Magazine other_mag = Magazine.Cast(other_item);
10421 if (other_item)
10422 {
10423 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10424 return false;
10425 }
10426
10427 }
10428 }
10429 else
10430 {
10431
10433 return false;
10434
10436 return false;
10437 }
10438
10439 PlayerBase player = null;
10440 if (CastTo(player, GetHierarchyRootPlayer()))
10441 {
10442 if (player.GetInventory().HasAttachment(this))
10443 return false;
10444
10445 if (player.IsItemsToDelete())
10446 return false;
10447 }
10448
10449 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10450 return false;
10451
10452 int slotID;
10454 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10455 return false;
10456
10457 return true;
10458 }
10459
10461 {
10463 }
10464
10466 {
10467 return m_IsResultOfSplit;
10468 }
10469
10471 {
10472 m_IsResultOfSplit = value;
10473 }
10474
10476 {
10478 }
10479
10481 {
10482 float other_item_quantity = other_item.GetQuantity();
10483 float this_free_space;
10484
10486
10488
10489 if (other_item_quantity > this_free_space)
10490 {
10491 return this_free_space;
10492 }
10493 else
10494 {
10495 return other_item_quantity;
10496 }
10497 }
10498
10500 {
10502 }
10503
10505 {
10507 return;
10508
10509 if (!IsMagazine() && other_item)
10510 {
10512 if (quantity_used != 0)
10513 {
10514 float hp1 = GetHealth01("","");
10515 float hp2 = other_item.GetHealth01("","");
10516 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10517 hpResult = hpResult / (
GetQuantity() + quantity_used);
10518
10519 hpResult *= GetMaxHealth();
10520 Math.Round(hpResult);
10521 SetHealth("", "Health", hpResult);
10522
10524 other_item.AddQuantity(-quantity_used);
10525 }
10526 }
10528 }
10529
10531 {
10532 #ifdef SERVER
10533 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10534 GetHierarchyParent().IncreaseLifetimeUp();
10535 #endif
10536 };
10537
10539 {
10540 PlayerBase p = PlayerBase.Cast(player);
10541
10542 array<int> recipesIds = p.m_Recipes;
10543 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10544 if (moduleRecipesManager)
10545 {
10546 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10547 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10548 }
10549
10550 for (int i = 0;i < recipesIds.Count(); i++)
10551 {
10552 int key = recipesIds.Get(i);
10553 string recipeName = moduleRecipesManager.GetRecipeName(key);
10555 }
10556 }
10557
10558
10559 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10560 {
10561 super.GetDebugActions(outputList);
10562
10563
10568
10569
10573
10577
10578
10581
10582
10584 {
10587 }
10588
10590
10593
10597 }
10598
10599
10600
10601
10603 {
10604 super.OnAction(action_id, player, ctx);
10605 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10606 {
10607 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10608 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10609 PlayerBase p = PlayerBase.Cast(player);
10610 if (
EActions.RECIPES_RANGE_START < 1000)
10611 {
10612 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10613 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10614 }
10615 }
10616 #ifndef SERVER
10617 else if (action_id ==
EActions.WATCH_PLAYER)
10618 {
10619 PluginDeveloper.SetDeveloperItemClientEx(player);
10620 }
10621 #endif
10623 {
10624 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10625 {
10626 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10627 OnDebugButtonPressServer(id + 1);
10628 }
10629
10630 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10631 {
10632 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10634 }
10635
10636 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10637 {
10638 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10640 }
10641
10642 else if (action_id ==
EActions.ADD_QUANTITY)
10643 {
10644 if (IsMagazine())
10645 {
10646 Magazine mag = Magazine.Cast(this);
10647 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10648 }
10649 else
10650 {
10652 }
10653
10654 if (m_EM)
10655 {
10656 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10657 }
10658
10659 }
10660
10661 else if (action_id ==
EActions.REMOVE_QUANTITY)
10662 {
10663 if (IsMagazine())
10664 {
10665 Magazine mag2 = Magazine.Cast(this);
10666 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10667 }
10668 else
10669 {
10671 }
10672 if (m_EM)
10673 {
10674 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10675 }
10676
10677 }
10678
10679 else if (action_id ==
EActions.SET_QUANTITY_0)
10680 {
10682
10683 if (m_EM)
10684 {
10685 m_EM.SetEnergy(0);
10686 }
10687 }
10688
10689 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10690 {
10692
10693 if (m_EM)
10694 {
10695 m_EM.SetEnergy(m_EM.GetEnergyMax());
10696 }
10697 }
10698
10699 else if (action_id ==
EActions.ADD_HEALTH)
10700 {
10701 AddHealth("","",GetMaxHealth("","Health")/5);
10702 }
10703 else if (action_id ==
EActions.REMOVE_HEALTH)
10704 {
10705 AddHealth("","",-GetMaxHealth("","Health")/5);
10706 }
10707 else if (action_id ==
EActions.DESTROY_HEALTH)
10708 {
10709 SetHealth01("","",0);
10710 }
10711 else if (action_id ==
EActions.WATCH_ITEM)
10712 {
10714 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10715 #ifdef DEVELOPER
10716 SetDebugDeveloper_item(this);
10717 #endif
10718 }
10719
10720 else if (action_id ==
EActions.ADD_TEMPERATURE)
10721 {
10722 AddTemperature(20);
10723
10724 }
10725
10726 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10727 {
10728 AddTemperature(-20);
10729
10730 }
10731
10732 else if (action_id ==
EActions.FLIP_FROZEN)
10733 {
10734 SetFrozen(!GetIsFrozen());
10735
10736 }
10737
10738 else if (action_id ==
EActions.ADD_WETNESS)
10739 {
10741
10742 }
10743
10744 else if (action_id ==
EActions.REMOVE_WETNESS)
10745 {
10747
10748 }
10749
10750 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10751 {
10754
10755
10756 }
10757
10758 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10759 {
10762 }
10763
10764 else if (action_id ==
EActions.MAKE_SPECIAL)
10765 {
10766 auto debugParams = DebugSpawnParams.WithPlayer(player);
10767 OnDebugSpawnEx(debugParams);
10768 }
10769
10770 else if (action_id ==
EActions.DELETE)
10771 {
10772 Delete();
10773 }
10774
10775 }
10776
10777
10778 return false;
10779 }
10780
10781
10782
10783
10787
10790
10791
10792
10794 {
10795 return false;
10796 }
10797
10798
10800 {
10801 return true;
10802 }
10803
10804
10806 {
10807 return true;
10808 }
10809
10810
10811
10813 {
10814 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10816 }
10817
10820 {
10821 return null;
10822 }
10823
10825 {
10826 return false;
10827 }
10828
10830 {
10831 return false;
10832 }
10833
10837
10838
10840 {
10841 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10842 return module_repairing.CanRepair(this, item_repair_kit);
10843 }
10844
10845
10846 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10847 {
10848 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10849 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10850 }
10851
10852
10854 {
10855
10856
10857
10858
10859
10860
10861
10862
10863 return 1;
10864 }
10865
10866
10867
10869 {
10871 }
10872
10873
10874
10876 {
10878 }
10879
10880
10889 {
10890 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10891
10892 if (player)
10893 {
10894 player.MessageStatus(text);
10895 }
10896 }
10897
10898
10907 {
10908 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10909
10910 if (player)
10911 {
10912 player.MessageAction(text);
10913 }
10914 }
10915
10916
10925 {
10926 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10927
10928 if (player)
10929 {
10930 player.MessageFriendly(text);
10931 }
10932 }
10933
10934
10943 {
10944 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10945
10946 if (player)
10947 {
10948 player.MessageImportant(text);
10949 }
10950 }
10951
10953 {
10954 return true;
10955 }
10956
10957
10958 override bool KindOf(
string tag)
10959 {
10960 bool found = false;
10961 string item_name = this.
GetType();
10964
10965 int array_size = item_tag_array.Count();
10966 for (int i = 0; i < array_size; i++)
10967 {
10968 if (item_tag_array.Get(i) == tag)
10969 {
10970 found = true;
10971 break;
10972 }
10973 }
10974 return found;
10975 }
10976
10977
10979 {
10980
10981 super.OnRPC(sender, rpc_type,ctx);
10982
10983
10984 switch (rpc_type)
10985 {
10986 #ifndef SERVER
10987 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10988 Param2<bool, string> p = new Param2<bool, string>(false, "");
10989
10991 return;
10992
10993 bool play = p.param1;
10994 string soundSet = p.param2;
10995
10996 if (play)
10997 {
10999 {
11001 {
11003 }
11004 }
11005 else
11006 {
11008 }
11009 }
11010 else
11011 {
11013 }
11014
11015 break;
11016 #endif
11017
11018 }
11019
11021 {
11023 }
11024 }
11025
11026
11027
11028
11030 {
11031 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11032 return plugin.GetID(
name);
11033 }
11034
11036 {
11037 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11038 return plugin.GetName(id);
11039 }
11040
11043 {
11044
11045
11046 int varFlags;
11047 if (!ctx.
Read(varFlags))
11048 return;
11049
11050 if (varFlags & ItemVariableFlags.FLOAT)
11051 {
11053 }
11054 }
11055
11057 {
11058
11059 super.SerializeNumericalVars(floats_out);
11060
11061
11062
11064 {
11066 }
11067
11069 {
11071 }
11072
11074 {
11076 }
11077
11079 {
11084 }
11085
11087 {
11089 }
11090 }
11091
11093 {
11094
11095 super.DeSerializeNumericalVars(floats);
11096
11097
11098 int index = 0;
11099 int mask = Math.Round(floats.Get(index));
11100
11101 index++;
11102
11104 {
11106 {
11108 }
11109 else
11110 {
11111 float quantity = floats.Get(index);
11112 SetQuantity(quantity,
true,
false,
false,
false);
11113 }
11114 index++;
11115 }
11116
11118 {
11119 float wet = floats.Get(index);
11121 index++;
11122 }
11123
11125 {
11126 int liquidtype = Math.Round(floats.Get(index));
11128 index++;
11129 }
11130
11132 {
11134 index++;
11136 index++;
11138 index++;
11140 index++;
11141 }
11142
11144 {
11145 int cleanness = Math.Round(floats.Get(index));
11147 index++;
11148 }
11149 }
11150
11152 {
11153 super.WriteVarsToCTX(ctx);
11154
11155
11157 {
11159 }
11160
11162 {
11164 }
11165
11167 {
11169 }
11170
11172 {
11173 int r,g,b,a;
11179 }
11180
11182 {
11184 }
11185 }
11186
11188 {
11189 if (!super.ReadVarsFromCTX(ctx,version))
11190 return false;
11191
11192 int intValue;
11193 float value;
11194
11195 if (version < 140)
11196 {
11197 if (!ctx.
Read(intValue))
11198 return false;
11199
11200 m_VariablesMask = intValue;
11201 }
11202
11204 {
11205 if (!ctx.
Read(value))
11206 return false;
11207
11209 {
11211 }
11212 else
11213 {
11215 }
11216 }
11217
11218 if (version < 140)
11219 {
11221 {
11222 if (!ctx.
Read(value))
11223 return false;
11224 SetTemperatureDirect(value);
11225 }
11226 }
11227
11229 {
11230 if (!ctx.
Read(value))
11231 return false;
11233 }
11234
11236 {
11237 if (!ctx.
Read(intValue))
11238 return false;
11240 }
11241
11243 {
11244 int r,g,b,a;
11246 return false;
11248 return false;
11250 return false;
11252 return false;
11253
11255 }
11256
11258 {
11259 if (!ctx.
Read(intValue))
11260 return false;
11262 }
11263
11264 if (version >= 138 && version < 140)
11265 {
11267 {
11268 if (!ctx.
Read(intValue))
11269 return false;
11270 SetFrozen(intValue);
11271 }
11272 }
11273
11274 return true;
11275 }
11276
11277
11279 {
11282 {
11284 }
11285
11286 if (!super.OnStoreLoad(ctx, version))
11287 {
11289 return false;
11290 }
11291
11292 if (version >= 114)
11293 {
11294 bool hasQuickBarIndexSaved;
11295
11296 if (!ctx.
Read(hasQuickBarIndexSaved))
11297 {
11299 return false;
11300 }
11301
11302 if (hasQuickBarIndexSaved)
11303 {
11304 int itmQBIndex;
11305
11306
11307 if (!ctx.
Read(itmQBIndex))
11308 {
11310 return false;
11311 }
11312
11313 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11314 if (itmQBIndex != -1 && parentPlayer)
11315 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11316 }
11317 }
11318 else
11319 {
11320
11321 PlayerBase player;
11322 int itemQBIndex;
11323 if (version ==
int.
MAX)
11324 {
11325 if (!ctx.
Read(itemQBIndex))
11326 {
11328 return false;
11329 }
11330 }
11331 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11332 {
11333
11334 if (!ctx.
Read(itemQBIndex))
11335 {
11337 return false;
11338 }
11339 if (itemQBIndex != -1 && player)
11340 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11341 }
11342 }
11343
11344 if (version < 140)
11345 {
11346
11347 if (!LoadVariables(ctx, version))
11348 {
11350 return false;
11351 }
11352 }
11353
11354
11356 {
11358 return false;
11359 }
11360 if (version >= 132)
11361 {
11363 if (raib)
11364 {
11366 {
11368 return false;
11369 }
11370 }
11371 }
11372
11374 return true;
11375 }
11376
11377
11378
11380 {
11381 super.OnStoreSave(ctx);
11382
11383 PlayerBase player;
11384 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11385 {
11387
11388 int itemQBIndex = -1;
11389 itemQBIndex = player.FindQuickBarEntityIndex(this);
11390 ctx.
Write(itemQBIndex);
11391 }
11392 else
11393 {
11395 }
11396
11398
11400 if (raib)
11401 {
11403 }
11404 }
11405
11406
11408 {
11409 super.AfterStoreLoad();
11410
11412 {
11414 }
11415
11417 {
11420 }
11421 }
11422
11424 {
11425 super.EEOnAfterLoad();
11426
11428 {
11430 }
11431
11434 }
11435
11437 {
11438 return false;
11439 }
11440
11441
11442
11444 {
11446 {
11447 #ifdef PLATFORM_CONSOLE
11448
11450 {
11452 if (menu)
11453 {
11455 }
11456 }
11457 #endif
11458 }
11459
11461 {
11464 }
11465
11467 {
11468 SetWeightDirty();
11470 }
11472 {
11475 }
11476
11478 {
11481 }
11483 {
11486 }
11487
11488 super.OnVariablesSynchronized();
11489 }
11490
11491
11492
11494 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11495 {
11496 if (!IsServerCheck(allow_client))
11497 return false;
11498
11500 return false;
11501
11504
11505 if (value <= (min + 0.001))
11506 value = min;
11507
11508 if (value == min)
11509 {
11510 if (destroy_config)
11511 {
11512 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11513 if (dstr)
11514 {
11516 this.Delete();
11517 return true;
11518 }
11519 }
11520 else if (destroy_forced)
11521 {
11523 this.Delete();
11524 return true;
11525 }
11526
11528 }
11529
11532
11534 {
11536
11537 if (delta)
11539 }
11540
11542
11543 return false;
11544 }
11545
11546
11548 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11549 {
11551 }
11552
11554 {
11557 }
11558
11560 {
11563 }
11564
11567 {
11568 float value_clamped = Math.Clamp(value, 0, 1);
11570 SetQuantity(result, destroy_config, destroy_forced);
11571 }
11572
11573
11576 {
11578 }
11579
11581 {
11583 }
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11595 {
11596 int slot = -1;
11597 if (GetInventory())
11598 {
11599 InventoryLocation il = new InventoryLocation;
11600 GetInventory().GetCurrentInventoryLocation(il);
11602 }
11603
11605 }
11606
11608 {
11609 float quantity_max = 0;
11610
11612 {
11613 if (attSlotID != -1)
11614 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11615
11616 if (quantity_max <= 0)
11618 }
11619
11620 if (quantity_max <= 0)
11622
11623 return quantity_max;
11624 }
11625
11627 {
11629 }
11630
11632 {
11634 }
11635
11636
11638 {
11640 }
11641
11643 {
11645 }
11646
11648 {
11650 }
11651
11652
11654 {
11655
11656 float weightEx = GetWeightEx();
11657 float special = GetInventoryAndCargoWeight();
11658 return weightEx - special;
11659 }
11660
11661
11663 {
11665 }
11666
11668 {
11670 {
11671 #ifdef DEVELOPER
11672 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11673 {
11674 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11676 }
11677 #endif
11678
11679 return GetQuantity() * GetConfigWeightModified();
11680 }
11681 else if (HasEnergyManager())
11682 {
11683 #ifdef DEVELOPER
11684 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11685 {
11686 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11687 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11688 }
11689 #endif
11690 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11691 }
11692 else
11693 {
11694 #ifdef DEVELOPER
11695 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11696 {
11697 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11698 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11699 }
11700 #endif
11701 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11702 }
11703 }
11704
11707 {
11708 int item_count = 0;
11710
11711 if (GetInventory().GetCargo() != NULL)
11712 {
11713 item_count = GetInventory().GetCargo().GetItemCount();
11714 }
11715
11716 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11717 {
11718 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11719 if (item)
11720 item_count += item.GetNumberOfItems();
11721 }
11722 return item_count;
11723 }
11724
11727 {
11728 float weight = 0;
11729 float wetness = 1;
11730 if (include_wetness)
11733 {
11734 weight = wetness * m_ConfigWeight;
11735 }
11737 {
11738 weight = 1;
11739 }
11740 return weight;
11741 }
11742
11743
11744
11746 {
11747 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11748 {
11749 GameInventory inv = GetInventory();
11750 array<EntityAI> items = new array<EntityAI>;
11752 for (int i = 0; i < items.Count(); i++)
11753 {
11755 if (item)
11756 {
11758 }
11759 }
11760 }
11761 }
11762
11763
11764
11765
11767 {
11768 float energy = 0;
11769 if (HasEnergyManager())
11770 {
11771 energy = GetCompEM().GetEnergy();
11772 }
11773 return energy;
11774 }
11775
11776
11778 {
11779 super.OnEnergyConsumed();
11780
11782 }
11783
11785 {
11786 super.OnEnergyAdded();
11787
11789 }
11790
11791
11793 {
11794 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11795 {
11797 {
11798 float energy_0to1 = GetCompEM().GetEnergy0To1();
11800 }
11801 }
11802 }
11803
11804
11806 {
11807 return ConfigGetFloat("heatIsolation");
11808 }
11809
11811 {
11813 }
11814
11816 {
11817 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11818 if (
GetGame().ConfigIsExisting(paramPath))
11820
11821 return 0.0;
11822 }
11823
11825 {
11826 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11827 if (
GetGame().ConfigIsExisting(paramPath))
11829
11830 return 0.0;
11831 }
11832
11833 override void SetWet(
float value,
bool allow_client =
false)
11834 {
11835 if (!IsServerCheck(allow_client))
11836 return;
11837
11840
11842
11843 m_VarWet = Math.Clamp(value, min, max);
11844
11846 {
11849 }
11850 }
11851
11852 override void AddWet(
float value)
11853 {
11855 }
11856
11858 {
11860 }
11861
11863 {
11865 }
11866
11868 {
11870 }
11871
11873 {
11875 }
11876
11878 {
11880 }
11881
11882 override void OnWetChanged(
float newVal,
float oldVal)
11883 {
11886 if (newLevel != oldLevel)
11887 {
11889 }
11890 }
11891
11893 {
11894 SetWeightDirty();
11895 }
11896
11898 {
11899 return GetWetLevelInternal(
m_VarWet);
11900 }
11901
11902
11903
11905 {
11907 }
11908
11910 {
11912 }
11913
11915 {
11917 }
11918
11920 {
11922 }
11923
11924
11925
11927 {
11928 if (ConfigIsExisting("itemModelLength"))
11929 {
11930 return ConfigGetFloat("itemModelLength");
11931 }
11932 return 0;
11933 }
11934
11936 {
11937 if (ConfigIsExisting("itemAttachOffset"))
11938 {
11939 return ConfigGetFloat("itemAttachOffset");
11940 }
11941 return 0;
11942 }
11943
11944 override void SetCleanness(
int value,
bool allow_client =
false)
11945 {
11946 if (!IsServerCheck(allow_client))
11947 return;
11948
11950
11952
11955 }
11956
11958 {
11960 }
11961
11963 {
11964 return true;
11965 }
11966
11967
11968
11969
11971 {
11973 }
11974
11976 {
11978 }
11979
11980
11981
11982
11983 override void SetColor(
int r,
int g,
int b,
int a)
11984 {
11990 }
11992 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11993 {
11998 }
11999
12001 {
12003 }
12004
12007 {
12008 int r,g,b,a;
12010 r = r/255;
12011 g = g/255;
12012 b = b/255;
12013 a = a/255;
12014 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12015 }
12016
12017
12018
12019 override void SetLiquidType(
int value,
bool allow_client =
false)
12020 {
12021 if (!IsServerCheck(allow_client))
12022 return;
12023
12028 }
12029
12031 {
12032 return ConfigGetInt("varLiquidTypeInit");
12033 }
12034
12036 {
12038 }
12039
12041 {
12043 SetFrozen(false);
12044 }
12045
12048 {
12049 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12050 }
12051
12052
12055 {
12056 PlayerBase nplayer;
12057 if (PlayerBase.CastTo(nplayer, player))
12058 {
12060
12061 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12062 }
12063 }
12064
12065
12068 {
12069 PlayerBase nplayer;
12070 if (PlayerBase.CastTo(nplayer,player))
12071 {
12072
12073 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12074
12075 }
12076
12077
12078 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12079
12080
12081 if (HasEnergyManager())
12082 {
12083 GetCompEM().UpdatePlugState();
12084 }
12085 }
12086
12087
12089 {
12090 super.OnPlacementStarted(player);
12091
12093 }
12094
12095 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12096 {
12098 {
12099 m_AdminLog.OnPlacementComplete(player,
this);
12100 }
12101
12102 super.OnPlacementComplete(player, position, orientation);
12103 }
12104
12105
12106
12107
12108
12110 {
12112 {
12113 return true;
12114 }
12115 else
12116 {
12117 return false;
12118 }
12119 }
12120
12121
12123 {
12125 {
12127 }
12128 }
12129
12130
12132 {
12134 }
12135
12137 {
12139 }
12140
12141 override void InsertAgent(
int agent,
float count = 1)
12142 {
12143 if (count < 1)
12144 return;
12145
12147 }
12148
12151 {
12153 }
12154
12155
12157 {
12159 }
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12203 {
12205 return false;
12206 return true;
12207 }
12208
12210 {
12211
12213 }
12214
12215
12218 {
12219 super.CheckForRoofLimited(timeTresholdMS);
12220
12222 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12223 {
12224 m_PreviousRoofTestTime = time;
12225 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12226 }
12227 }
12228
12229
12231 {
12233 {
12234 return 0;
12235 }
12236
12237 if (GetInventory().GetAttachmentSlotsCount() != 0)
12238 {
12239 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12240 if (filter)
12241 return filter.GetProtectionLevel(type, false, system);
12242 else
12243 return 0;
12244 }
12245
12246 string subclassPath, entryName;
12247
12248 switch (type)
12249 {
12251 entryName = "biological";
12252 break;
12254 entryName = "chemical";
12255 break;
12256 default:
12257 entryName = "biological";
12258 break;
12259 }
12260
12261 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12262
12264 }
12265
12266
12267
12270 {
12271 if (!IsMagazine())
12273
12275 }
12276
12277
12278
12279
12280
12285 {
12286 return true;
12287 }
12288
12290 {
12292 }
12293
12294
12295
12296
12297
12299 {
12300 if (parent)
12301 {
12302 if (parent.IsInherited(DayZInfected))
12303 return true;
12304
12305 if (!parent.IsRuined())
12306 return true;
12307 }
12308
12309 return true;
12310 }
12311
12313 {
12314 if (!super.CanPutAsAttachment(parent))
12315 {
12316 return false;
12317 }
12318
12319 if (!IsRuined() && !parent.IsRuined())
12320 {
12321 return true;
12322 }
12323
12324 return false;
12325 }
12326
12328 {
12329
12330
12331
12332
12333 return super.CanReceiveItemIntoCargo(item);
12334 }
12335
12337 {
12338
12339
12340
12341
12342 GameInventory attachmentInv = attachment.GetInventory();
12344 {
12345 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12346 return false;
12347 }
12348
12349 InventoryLocation loc = new InventoryLocation();
12350 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12351 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12352 return false;
12353
12354 return super.CanReceiveAttachment(attachment, slotId);
12355 }
12356
12358 {
12359 if (!super.CanReleaseAttachment(attachment))
12360 return false;
12361
12362 return GetInventory().AreChildrenAccessible();
12363 }
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12386 {
12387 int id = muzzle_owner.GetMuzzleID();
12388 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12389
12390 if (WPOF_array)
12391 {
12392 for (int i = 0; i < WPOF_array.Count(); i++)
12393 {
12394 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12395
12396 if (WPOF)
12397 {
12398 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12399 }
12400 }
12401 }
12402 }
12403
12404
12406 {
12407 int id = muzzle_owner.GetMuzzleID();
12409
12410 if (WPOBE_array)
12411 {
12412 for (int i = 0; i < WPOBE_array.Count(); i++)
12413 {
12414 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12415
12416 if (WPOBE)
12417 {
12418 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12419 }
12420 }
12421 }
12422 }
12423
12424
12426 {
12427 int id = muzzle_owner.GetMuzzleID();
12428 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12429
12430 if (WPOOH_array)
12431 {
12432 for (int i = 0; i < WPOOH_array.Count(); i++)
12433 {
12434 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12435
12436 if (WPOOH)
12437 {
12438 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12439 }
12440 }
12441 }
12442 }
12443
12444
12446 {
12447 int id = muzzle_owner.GetMuzzleID();
12448 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12449
12450 if (WPOOH_array)
12451 {
12452 for (int i = 0; i < WPOOH_array.Count(); i++)
12453 {
12454 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12455
12456 if (WPOOH)
12457 {
12458 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12459 }
12460 }
12461 }
12462 }
12463
12464
12466 {
12467 int id = muzzle_owner.GetMuzzleID();
12468 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12469
12470 if (WPOOH_array)
12471 {
12472 for (int i = 0; i < WPOOH_array.Count(); i++)
12473 {
12474 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12475
12476 if (WPOOH)
12477 {
12478 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12479 }
12480 }
12481 }
12482 }
12483
12484
12485
12487 {
12489 {
12490 return true;
12491 }
12492
12493 return false;
12494 }
12495
12497 {
12499 {
12500 return true;
12501 }
12502
12503 return false;
12504 }
12505
12507 {
12509 {
12510 return true;
12511 }
12512
12513 return false;
12514 }
12515
12517 {
12518 return false;
12519 }
12520
12523 {
12524 return UATimeSpent.DEFAULT_DEPLOY;
12525 }
12526
12527
12528
12529
12531 {
12533 SetSynchDirty();
12534 }
12535
12537 {
12539 }
12540
12541
12543 {
12544 return false;
12545 }
12546
12549 {
12550 string att_type = "None";
12551
12552 if (ConfigIsExisting("soundAttType"))
12553 {
12554 att_type = ConfigGetString("soundAttType");
12555 }
12556
12558 }
12559
12561 {
12563 }
12564
12565
12566
12567
12568
12572
12574 {
12577
12579 }
12580
12581
12583 {
12585 return;
12586
12588
12591
12594
12595 SoundParameters params = new SoundParameters();
12599 }
12600
12601
12603 {
12605 return;
12606
12608 SetSynchDirty();
12609
12612 }
12613
12614
12616 {
12618 return;
12619
12621 SetSynchDirty();
12622
12625 }
12626
12628 {
12630 }
12631
12633 {
12635 }
12636
12639 {
12640 if (!
GetGame().IsDedicatedServer())
12641 {
12642 if (ConfigIsExisting("attachSoundSet"))
12643 {
12644 string cfg_path = "";
12645 string soundset = "";
12646 string type_name =
GetType();
12647
12650 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12651 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12652
12653 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12654 {
12655 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12656 {
12657 if (cfg_slot_array[i] == slot_type)
12658 {
12659 soundset = cfg_soundset_array[i];
12660 break;
12661 }
12662 }
12663 }
12664
12665 if (soundset != "")
12666 {
12667 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12669 }
12670 }
12671 }
12672 }
12673
12675 {
12676
12677 }
12678
12679 void OnApply(PlayerBase player);
12680
12682 {
12683 return 1.0;
12684 };
12685
12687 {
12689 }
12690
12692 {
12694 }
12695
12697
12699 {
12700 SetDynamicPhysicsLifeTime(0.01);
12702 }
12703
12705 {
12706 array<string> zone_names = new array<string>;
12707 GetDamageZones(zone_names);
12708 for (int i = 0; i < zone_names.Count(); i++)
12709 {
12710 SetHealthMax(zone_names.Get(i),"Health");
12711 }
12712 SetHealthMax("","Health");
12713 }
12714
12717 {
12718 float global_health = GetHealth01("","Health");
12719 array<string> zones = new array<string>;
12720 GetDamageZones(zones);
12721
12722 for (int i = 0; i < zones.Count(); i++)
12723 {
12724 SetHealth01(zones.Get(i),"Health",global_health);
12725 }
12726 }
12727
12730 {
12731 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12732 }
12733
12735 {
12736 if (!hasRootAsPlayer)
12737 {
12738 if (refParentIB)
12739 {
12740
12741 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12742 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12743
12744 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12745 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12746
12749 }
12750 else
12751 {
12752
12755 }
12756 }
12757 }
12758
12760 {
12762 {
12763 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12764 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12765 {
12766 float heatPermCoef = 1.0;
12768 while (ent)
12769 {
12770 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12771 ent = ent.GetHierarchyParent();
12772 }
12773
12774 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12775 }
12776 }
12777 }
12778
12780 {
12781
12782 EntityAI parent = GetHierarchyParent();
12783 if (!parent)
12784 {
12785 hasParent = false;
12786 hasRootAsPlayer = false;
12787 }
12788 else
12789 {
12790 hasParent = true;
12791 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12792 refParentIB =
ItemBase.Cast(parent);
12793 }
12794 }
12795
12796 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12797 {
12798
12799 }
12800
12802 {
12803
12804 return false;
12805 }
12806
12808 {
12809
12810
12811 return false;
12812 }
12813
12815 {
12816
12817 return false;
12818 }
12819
12822 {
12823 return !GetIsFrozen() &&
IsOpen();
12824 }
12825
12827 {
12828 bool hasParent = false, hasRootAsPlayer = false;
12830
12831 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12832 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12833
12834 if (wwtu || foodDecay)
12835 {
12839
12840 if (processWetness || processTemperature || processDecay)
12841 {
12843
12844 if (processWetness)
12845 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12846
12847 if (processTemperature)
12849
12850 if (processDecay)
12851 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12852 }
12853 }
12854 }
12855
12858 {
12860 }
12861
12863 {
12866
12867 return super.GetTemperatureFreezeThreshold();
12868 }
12869
12871 {
12874
12875 return super.GetTemperatureThawThreshold();
12876 }
12877
12879 {
12882
12883 return super.GetItemOverheatThreshold();
12884 }
12885
12887 {
12889 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12890
12891 return super.GetTemperatureFreezeTime();
12892 }
12893
12895 {
12897 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12898
12899 return super.GetTemperatureThawTime();
12900 }
12901
12906
12908 {
12909 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12910 }
12911
12913 {
12914 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12915 }
12916
12919 {
12921 }
12922
12924 {
12926 }
12927
12929 {
12931 }
12932
12935 {
12936 return null;
12937 }
12938
12941 {
12942 return false;
12943 }
12944
12946 {
12948 {
12951 if (!trg)
12952 {
12954 explosive = this;
12955 }
12956
12957 explosive.PairRemote(trg);
12959
12960 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12961 trg.SetPersistentPairID(persistentID);
12962 explosive.SetPersistentPairID(persistentID);
12963
12964 return true;
12965 }
12966 return false;
12967 }
12968
12971 {
12972 float ret = 1.0;
12975 ret *= GetHealth01();
12976
12977 return ret;
12978 }
12979
12980 #ifdef DEVELOPER
12981 override void SetDebugItem()
12982 {
12983 super.SetDebugItem();
12984 _itemBase = this;
12985 }
12986
12988 {
12989 string text = super.GetDebugText();
12990
12992 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12993
12994 return text;
12995 }
12996 #endif
12997
12999 {
13000 return true;
13001 }
13002
13004
13006
13008 {
13011 }
13012
13013
13021
13037}
13038
13040{
13042 if (entity)
13043 {
13044 bool is_item = entity.IsInherited(
ItemBase);
13045 if (is_item && full_quantity)
13046 {
13049 }
13050 }
13051 else
13052 {
13054 return NULL;
13055 }
13056 return entity;
13057}
13058
13060{
13061 if (item)
13062 {
13063 if (health > 0)
13064 item.SetHealth("", "", health);
13065
13066 if (item.CanHaveTemperature())
13067 {
13069 if (item.CanFreeze())
13070 item.SetFrozen(false);
13071 }
13072
13073 if (item.HasEnergyManager())
13074 {
13075 if (quantity >= 0)
13076 {
13077 item.GetCompEM().SetEnergy0To1(quantity);
13078 }
13079 else
13080 {
13082 }
13083 }
13084 else if (item.IsMagazine())
13085 {
13086 Magazine mag = Magazine.Cast(item);
13087 if (quantity >= 0)
13088 {
13089 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13090 }
13091 else
13092 {
13094 }
13095
13096 }
13097 else
13098 {
13099 if (quantity >= 0)
13100 {
13101 item.SetQuantityNormalized(quantity, false);
13102 }
13103 else
13104 {
13106 }
13107
13108 }
13109 }
13110}
13111
13112#ifdef DEVELOPER
13114#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.