8284{
8286 {
8287 return true;
8288 }
8289};
8290
8291
8292
8294{
8298
8300
8303
8304
8305
8306
8307
8316
8322
8327
8332
8353 protected bool m_IsResultOfSplit
8354
8356
8361
8362
8363
8365
8369
8370
8371
8373
8376
8377
8378
8384
8385
8393
8396
8397
8399
8400
8402
8403
8408
8409
8414
8415
8417
8418
8420 {
8425
8426 if (!
GetGame().IsDedicatedServer())
8427 {
8429 {
8431
8433 {
8435 }
8436 }
8437
8440 }
8441
8442 m_OldLocation = null;
8443
8445 {
8447 }
8448
8449 if (ConfigIsExisting("headSelectionsToHide"))
8450 {
8453 }
8454
8456 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8457 {
8459 }
8460
8462
8463 m_IsResultOfSplit = false;
8464
8466 }
8467
8469 {
8470 super.InitItemVariables();
8471
8477 m_Count = ConfigGetInt(
"count");
8478
8481
8486
8489
8494
8506
8510
8511
8514 if (ConfigIsExisting("canBeSplit"))
8515 {
8518 }
8519
8521 if (ConfigIsExisting("itemBehaviour"))
8523
8524
8527 RegisterNetSyncVariableInt("m_VarLiquidType");
8528 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8529
8530 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8531 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8532 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8533
8534 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8535 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8536 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8537 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8538
8539 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8540 RegisterNetSyncVariableBool("m_IsTakeable");
8541 RegisterNetSyncVariableBool("m_IsHologram");
8542
8545 {
8548 }
8549
8551
8553 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8555
8556 }
8557
8559 {
8561 }
8562
8564 {
8567 {
8572 }
8573 }
8574
8575 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8576 {
8578 {
8581 }
8582
8584 }
8585
8587 {
8593 }
8594
8596
8598 {
8600
8601 if (!action)
8602 {
8603 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8604 return;
8605 }
8606
8608 if (!ai)
8609 {
8611 return;
8612 }
8613
8615 if (!action_array)
8616 {
8617 action_array = new array<ActionBase_Basic>;
8619 }
8620 if (LogManager.IsActionLogEnable())
8621 {
8622 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8623 }
8624
8625 if (action_array.Find(action) != -1)
8626 {
8627 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8628 }
8629 else
8630 {
8631 action_array.Insert(action);
8632 }
8633 }
8634
8636 {
8638 ActionBase action = player.GetActionManager().GetAction(actionName);
8641
8642 if (action_array)
8643 {
8644 action_array.RemoveItem(action);
8645 }
8646 }
8647
8648
8649
8651 {
8652 ActionOverrideData overrideData = new ActionOverrideData();
8656
8658 if (!actionMap)
8659 {
8662 }
8663
8664 actionMap.Insert(this.
Type(), overrideData);
8665
8666 }
8667
8669
8671
8672
8674 {
8677
8680
8681 string config_to_search = "CfgVehicles";
8682 string muzzle_owner_config;
8683
8685 {
8686 if (IsInherited(Weapon))
8687 config_to_search = "CfgWeapons";
8688
8689 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8690
8691 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8692
8694
8695 if (config_OnFire_subclass_count > 0)
8696 {
8697 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8698
8699 for (int i = 0; i < config_OnFire_subclass_count; i++)
8700 {
8701 string particle_class = "";
8703 string config_OnFire_entry = config_OnFire_class + particle_class;
8704 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8705 WPOF_array.Insert(WPOF);
8706 }
8707
8708
8710 }
8711 }
8712
8714 {
8715 config_to_search = "CfgWeapons";
8716 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8717
8718 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8719
8721
8722 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8723 {
8724 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8725
8726 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8727 {
8728 string particle_class2 = "";
8730 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8731 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8732 WPOBE_array.Insert(WPOBE);
8733 }
8734
8735
8737 }
8738 }
8739 }
8740
8741
8743 {
8746
8748 {
8749 string config_to_search = "CfgVehicles";
8750
8751 if (IsInherited(Weapon))
8752 config_to_search = "CfgWeapons";
8753
8754 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8755 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8756
8757 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8758 {
8759
8761
8763 {
8765 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8767 return;
8768 }
8769
8772
8773
8774
8776 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8777
8778 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8779 {
8780 string particle_class = "";
8782 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8784
8785 if (entry_type == CT_CLASS)
8786 {
8787 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8788 WPOOH_array.Insert(WPOF);
8789 }
8790 }
8791
8792
8794 }
8795 }
8796 }
8797
8799 {
8801 }
8802
8804 {
8806 {
8808
8811
8814
8815 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8816 }
8817 }
8818
8820 {
8822 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8823
8825 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8826
8828 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8829
8831 {
8833 }
8834 }
8835
8837 {
8839 }
8840
8842 {
8845 else
8847
8849 {
8852 }
8853 else
8854 {
8857
8860 }
8861
8863 }
8864
8866 {
8868 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8869 }
8870
8872 {
8874 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8876 }
8877
8879 {
8881 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8882 }
8883
8885 {
8888
8889 OverheatingParticle OP = new OverheatingParticle();
8894
8896 }
8897
8899 {
8902
8903 return -1;
8904 }
8905
8907 {
8909 {
8912
8913 for (int i = count; i > 0; --i)
8914 {
8915 int id = i - 1;
8918
8921
8922 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8923 {
8924 if (p)
8925 {
8928 }
8929 }
8930 }
8931 }
8932 }
8933
8935 {
8937 {
8939 {
8940 int id = i - 1;
8942
8943 if (OP)
8944 {
8946
8947 if (p)
8948 {
8950 }
8951
8952 delete OP;
8953 }
8954 }
8955
8958 }
8959 }
8960
8963 {
8964 return 0.0;
8965 }
8966
8967
8969 {
8970 return 250;
8971 }
8972
8974 {
8975 return 0;
8976 }
8977
8980 {
8982 return true;
8983
8984 return false;
8985 }
8986
8989 {
8992
8994 {
8996 }
8997 else
8998 {
8999
9001 }
9002
9004 }
9005
9012 {
9013 return -1;
9014 }
9015
9016
9017
9018
9020 {
9022 {
9024 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9025
9026 if (r_index >= 0)
9027 {
9028 InventoryLocation r_il = new InventoryLocation;
9029 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9030
9031 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9034 {
9035 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9036 }
9038 {
9039 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9040 }
9041
9042 }
9043
9044 player.GetHumanInventory().ClearUserReservedLocation(this);
9045 }
9046
9049 }
9050
9051
9052
9053
9055 {
9056 return ItemBase.m_DebugActionsMask;
9057 }
9058
9060 {
9061 return ItemBase.m_DebugActionsMask & mask;
9062 }
9063
9065 {
9066 ItemBase.m_DebugActionsMask = mask;
9067 }
9068
9070 {
9071 ItemBase.m_DebugActionsMask |= mask;
9072 }
9073
9075 {
9076 ItemBase.m_DebugActionsMask &= ~mask;
9077 }
9078
9080 {
9082 {
9084 }
9085 else
9086 {
9088 }
9089 }
9090
9091
9093 {
9094 if (GetEconomyProfile())
9095 {
9096 float q_max = GetEconomyProfile().GetQuantityMax();
9097 if (q_max > 0)
9098 {
9099 float q_min = GetEconomyProfile().GetQuantityMin();
9100 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9101
9103 {
9104 ComponentEnergyManager comp = GetCompEM();
9106 {
9108 }
9109 }
9111 {
9113
9114 }
9115
9116 }
9117 }
9118 }
9119
9122 {
9123 EntityAI parent = GetHierarchyParent();
9124
9125 if (parent)
9126 {
9127 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9128 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9129 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9130 }
9131 }
9132
9135 {
9136 EntityAI parent = GetHierarchyParent();
9137
9138 if (parent)
9139 {
9140 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9141 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9142 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9143 }
9144 }
9145
9147 {
9148
9149
9150
9151
9153
9155 {
9156 if (ScriptInputUserData.CanStoreInputUserData())
9157 {
9158 ScriptInputUserData ctx = new ScriptInputUserData;
9164 ctx.
Write(use_stack_max);
9167
9169 {
9170 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9171 }
9172 }
9173 }
9174 else if (!
GetGame().IsMultiplayer())
9175 {
9177 }
9178 }
9179
9181 {
9183 }
9184
9186 {
9188 }
9189
9191 {
9193 }
9194
9196 {
9197
9198 return false;
9199 }
9200
9202 {
9203 return false;
9204 }
9205
9209 {
9210 return false;
9211 }
9212
9214 {
9215 return "";
9216 }
9217
9219
9221 {
9222 return false;
9223 }
9224
9226 {
9227 return true;
9228 }
9229
9230
9231
9233 {
9234 return true;
9235 }
9236
9238 {
9239 return true;
9240 }
9241
9243 {
9244 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9246 }
9247
9249 {
9251 }
9252
9254 {
9256 if (!is_being_placed)
9258 SetSynchDirty();
9259 }
9260
9261
9263
9265 {
9267 }
9268
9270 {
9272 }
9273
9275 {
9276 return 1;
9277 }
9278
9280 {
9281 return false;
9282 }
9283
9285 {
9287 SetSynchDirty();
9288 }
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9325 {
9326 super.OnMovedInsideCargo(container);
9327
9328 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9329 }
9330
9331 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9332 {
9333 super.EEItemLocationChanged(oldLoc,newLoc);
9334
9335 PlayerBase new_player = null;
9336 PlayerBase old_player = null;
9337
9338 if (newLoc.GetParent())
9339 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9340
9341 if (oldLoc.GetParent())
9342 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9343
9345 {
9346 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9347
9348 if (r_index >= 0)
9349 {
9350 InventoryLocation r_il = new InventoryLocation;
9351 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9352
9353 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9356 {
9357 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9358 }
9360 {
9361 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9362 }
9363
9364 }
9365 }
9366
9368 {
9369 if (new_player)
9370 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9371
9372 if (new_player == old_player)
9373 {
9374
9375 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9376 {
9378 {
9379 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9380 {
9381 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9382 }
9383 }
9384 else
9385 {
9386 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9387 }
9388 }
9389
9390 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9391 {
9392 int type = oldLoc.GetType();
9394 {
9395 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9396 }
9398 {
9399 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9400 }
9401 }
9402 if (!m_OldLocation)
9403 {
9404 m_OldLocation = new InventoryLocation;
9405 }
9406 m_OldLocation.Copy(oldLoc);
9407 }
9408 else
9409 {
9410 if (m_OldLocation)
9411 {
9412 m_OldLocation.Reset();
9413 }
9414 }
9415
9417 }
9418 else
9419 {
9420 if (new_player)
9421 {
9422 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9423 if (res_index >= 0)
9424 {
9425 InventoryLocation il = new InventoryLocation;
9426 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9428 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9431 {
9432 il.
GetParent().GetOnReleaseLock().Invoke(it);
9433 }
9435 {
9437 }
9438
9439 }
9440 }
9442 {
9443
9445 }
9446
9447 if (m_OldLocation)
9448 {
9449 m_OldLocation.Reset();
9450 }
9451 }
9452 }
9453
9454 override void EOnContact(IEntity other, Contact extra)
9455 {
9457 {
9458 int liquidType = -1;
9460 if (impactSpeed > 0.0)
9461 {
9463 #ifndef SERVER
9465 #else
9467 SetSynchDirty();
9468 #endif
9470 }
9471 }
9472
9473 #ifdef SERVER
9474 if (GetCompEM() && GetCompEM().IsPlugged())
9475 {
9476 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9477 GetCompEM().UnplugThis();
9478 }
9479 #endif
9480 }
9481
9483
9485 {
9487 }
9488
9490 {
9491
9492 }
9493
9495 {
9496 super.OnItemLocationChanged(old_owner, new_owner);
9497
9498 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9499 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9500
9501 if (!relatedPlayer && playerNew)
9502 relatedPlayer = playerNew;
9503
9504 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9505 {
9507 if (actionMgr)
9508 {
9509 ActionBase currentAction = actionMgr.GetRunningAction();
9510 if (currentAction)
9512 }
9513 }
9514
9515 Man ownerPlayerOld = null;
9516 Man ownerPlayerNew = null;
9517
9518 if (old_owner)
9519 {
9520 if (old_owner.
IsMan())
9521 {
9522 ownerPlayerOld = Man.Cast(old_owner);
9523 }
9524 else
9525 {
9526 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9527 }
9528 }
9529 else
9530 {
9532 {
9534
9535 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9536 {
9537 GetCompEM().UnplugThis();
9538 }
9539 }
9540 }
9541
9542 if (new_owner)
9543 {
9544 if (new_owner.
IsMan())
9545 {
9546 ownerPlayerNew = Man.Cast(new_owner);
9547 }
9548 else
9549 {
9550 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9551 }
9552 }
9553
9554 if (ownerPlayerOld != ownerPlayerNew)
9555 {
9556 if (ownerPlayerOld)
9557 {
9558 array<EntityAI> subItemsExit = new array<EntityAI>;
9560 for (int i = 0; i < subItemsExit.Count(); i++)
9561 {
9564 }
9565 }
9566
9567 if (ownerPlayerNew)
9568 {
9569 array<EntityAI> subItemsEnter = new array<EntityAI>;
9571 for (int j = 0; j < subItemsEnter.Count(); j++)
9572 {
9575 }
9576 }
9577 }
9578 else if (ownerPlayerNew != null)
9579 {
9580 PlayerBase nplayer;
9581 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9582 {
9583 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9585 for (int k = 0; k < subItemsUpdate.Count(); k++)
9586 {
9588 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9589 }
9590 }
9591 }
9592
9593 if (old_owner)
9594 old_owner.OnChildItemRemoved(this);
9595 if (new_owner)
9596 new_owner.OnChildItemReceived(this);
9597 }
9598
9599
9601 {
9602 super.EEDelete(parent);
9603 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9604 if (player)
9605 {
9607
9608 if (player.IsAlive())
9609 {
9610 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9611 if (r_index >= 0)
9612 {
9613 InventoryLocation r_il = new InventoryLocation;
9614 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9615
9616 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9619 {
9620 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9621 }
9623 {
9624 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9625 }
9626
9627 }
9628
9629 player.RemoveQuickBarEntityShortcut(this);
9630 }
9631 }
9632 }
9633
9635 {
9636 super.EEKilled(killer);
9637
9640 {
9641 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9642 {
9643 if (IsMagazine())
9644 {
9645 if (Magazine.Cast(this).GetAmmoCount() > 0)
9646 {
9648 }
9649 }
9650 else
9651 {
9653 }
9654 }
9655 }
9656 }
9657
9659 {
9660 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9661
9662 super.OnWasAttached(parent, slot_id);
9663
9666
9668 }
9669
9671 {
9672 super.OnWasDetached(parent, slot_id);
9673
9676 }
9677
9679 {
9680 int idx;
9683
9684 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9685 if (inventory_slots.Count() < 1)
9686 {
9687 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9688 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9689 }
9690 else
9691 {
9692 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9693 }
9694
9695 idx = inventory_slots.Find(slot);
9696 if (idx < 0)
9697 return "";
9698
9699 return attach_types.Get(idx);
9700 }
9701
9703 {
9704 int idx = -1;
9705 string slot;
9706
9709
9710 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9711 if (inventory_slots.Count() < 1)
9712 {
9713 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9714 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9715 }
9716 else
9717 {
9718 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9719 if (detach_types.Count() < 1)
9720 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9721 }
9722
9723 for (int i = 0; i < inventory_slots.Count(); i++)
9724 {
9725 slot = inventory_slots.Get(i);
9726 }
9727
9728 if (slot != "")
9729 {
9730 if (detach_types.Count() == 1)
9731 idx = 0;
9732 else
9733 idx = inventory_slots.Find(slot);
9734 }
9735 if (idx < 0)
9736 return "";
9737
9738 return detach_types.Get(idx);
9739 }
9740
9742 {
9743
9745
9746
9747 float min_time = 1;
9748 float max_time = 3;
9749 float delay = Math.RandomFloat(min_time, max_time);
9750
9751 explode_timer.Run(delay, this, "DoAmmoExplosion");
9752 }
9753
9755 {
9756 Magazine magazine = Magazine.Cast(this);
9757 int pop_sounds_count = 6;
9758 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9759
9760
9761 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9762 string sound_name = pop_sounds[ sound_idx ];
9764
9765
9766 magazine.ServerAddAmmoCount(-1);
9767
9768
9769 float min_temp_to_explode = 100;
9770
9771 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9772 {
9774 }
9775 }
9776
9777
9778 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9779 {
9780 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9781
9782 const int CHANCE_DAMAGE_CARGO = 4;
9783 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9784 const int CHANCE_DAMAGE_NOTHING = 2;
9785
9787 {
9788 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9789 int chances;
9790 int rnd;
9791
9792 if (GetInventory().GetCargo())
9793 {
9794 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9795 rnd = Math.RandomInt(0,chances);
9796
9797 if (rnd < CHANCE_DAMAGE_CARGO)
9798 {
9800 }
9801 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9802 {
9804 }
9805 }
9806 else
9807 {
9808 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9809 rnd = Math.RandomInt(0,chances);
9810
9811 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9812 {
9814 }
9815 }
9816 }
9817 }
9818
9820 {
9821 if (GetInventory().GetCargo())
9822 {
9823 int item_count = GetInventory().GetCargo().GetItemCount();
9824 if (item_count > 0)
9825 {
9826 int random_pick = Math.RandomInt(0, item_count);
9828 if (!item.IsExplosive())
9829 {
9830 item.AddHealth("","",damage);
9831 return true;
9832 }
9833 }
9834 }
9835 return false;
9836 }
9837
9839 {
9840 int attachment_count = GetInventory().AttachmentCount();
9841 if (attachment_count > 0)
9842 {
9843 int random_pick = Math.RandomInt(0, attachment_count);
9844 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9845 if (!attachment.IsExplosive())
9846 {
9847 attachment.AddHealth("","",damage);
9848 return true;
9849 }
9850 }
9851 return false;
9852 }
9853
9855 {
9857 }
9858
9860 {
9862 return GetInventory().CanRemoveEntity();
9863
9864 return false;
9865 }
9866
9868 {
9869
9871 return false;
9872
9873
9875 return false;
9876
9877
9878
9880 if (delta == 0)
9881 return false;
9882
9883
9884 return true;
9885 }
9886
9888 {
9890 {
9891 if (ScriptInputUserData.CanStoreInputUserData())
9892 {
9893 ScriptInputUserData ctx = new ScriptInputUserData;
9898 ctx.
Write(destination_entity);
9902 }
9903 }
9904 else if (!
GetGame().IsMultiplayer())
9905 {
9907 }
9908 }
9909
9911 {
9912 float split_quantity_new;
9916 InventoryLocation loc = new InventoryLocation;
9917
9918 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9919 {
9921 split_quantity_new = stack_max;
9922 else
9924
9926 {
9927 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9928 if (new_item)
9929 {
9930 new_item.SetResultOfSplit(true);
9931 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9933 new_item.
SetQuantity(split_quantity_new,
false,
true);
9934 }
9935 }
9936 }
9937 else if (destination_entity && slot_id == -1)
9938 {
9939 if (quantity > stack_max)
9940 split_quantity_new = stack_max;
9941 else
9942 split_quantity_new = quantity;
9943
9945 {
9947 {
9950 }
9951
9952 if (new_item)
9953 {
9954 new_item.SetResultOfSplit(true);
9955 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9957 new_item.
SetQuantity(split_quantity_new,
false,
true);
9958 }
9959 }
9960 }
9961 else
9962 {
9963 if (stack_max != 0)
9964 {
9966 {
9968 }
9969
9970 if (split_quantity_new == 0)
9971 {
9972 if (!
GetGame().IsMultiplayer())
9973 player.PhysicalPredictiveDropItem(this);
9974 else
9975 player.ServerDropEntity(this);
9976 return;
9977 }
9978
9980 {
9982
9983 if (new_item)
9984 {
9985 new_item.SetResultOfSplit(true);
9986 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9989 new_item.PlaceOnSurface();
9990 }
9991 }
9992 }
9993 }
9994 }
9995
9997 {
9998 float split_quantity_new;
10002 InventoryLocation loc = new InventoryLocation;
10003
10004 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10005 {
10007 split_quantity_new = stack_max;
10008 else
10010
10012 {
10013 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10014 if (new_item)
10015 {
10016 new_item.SetResultOfSplit(true);
10017 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10019 new_item.
SetQuantity(split_quantity_new,
false,
true);
10020 }
10021 }
10022 }
10023 else if (destination_entity && slot_id == -1)
10024 {
10025 if (quantity > stack_max)
10026 split_quantity_new = stack_max;
10027 else
10028 split_quantity_new = quantity;
10029
10031 {
10033 {
10036 }
10037
10038 if (new_item)
10039 {
10040 new_item.SetResultOfSplit(true);
10041 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10043 new_item.
SetQuantity(split_quantity_new,
false,
true);
10044 }
10045 }
10046 }
10047 else
10048 {
10049 if (stack_max != 0)
10050 {
10052 {
10054 }
10055
10057 {
10059
10060 if (new_item)
10061 {
10062 new_item.SetResultOfSplit(true);
10063 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10066 new_item.PlaceOnSurface();
10067 }
10068 }
10069 }
10070 }
10071 }
10072
10074 {
10076 {
10077 if (ScriptInputUserData.CanStoreInputUserData())
10078 {
10079 ScriptInputUserData ctx = new ScriptInputUserData;
10084 dst.WriteToContext(ctx);
10086 }
10087 }
10088 else if (!
GetGame().IsMultiplayer())
10089 {
10091 }
10092 }
10093
10095 {
10097 {
10098 if (ScriptInputUserData.CanStoreInputUserData())
10099 {
10100 ScriptInputUserData ctx = new ScriptInputUserData;
10105 ctx.
Write(destination_entity);
10111 }
10112 }
10113 else if (!
GetGame().IsMultiplayer())
10114 {
10116 }
10117 }
10118
10120 {
10122 }
10123
10125 {
10127 float split_quantity_new;
10129 if (dst.IsValid())
10130 {
10131 int slot_id = dst.GetSlot();
10133
10134 if (quantity > stack_max)
10135 split_quantity_new = stack_max;
10136 else
10137 split_quantity_new = quantity;
10138
10140 {
10142
10143 if (new_item)
10144 {
10145 new_item.SetResultOfSplit(true);
10146 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10148 new_item.
SetQuantity(split_quantity_new,
false,
true);
10149 }
10150
10151 return new_item;
10152 }
10153 }
10154
10155 return null;
10156 }
10157
10159 {
10161 float split_quantity_new;
10163 if (destination_entity)
10164 {
10166 if (quantity > stackable)
10167 split_quantity_new = stackable;
10168 else
10169 split_quantity_new = quantity;
10170
10172 {
10173 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10174 if (new_item)
10175 {
10176 new_item.SetResultOfSplit(true);
10177 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10179 new_item.
SetQuantity(split_quantity_new,
false,
true);
10180 }
10181 }
10182 }
10183 }
10184
10186 {
10188 {
10189 if (ScriptInputUserData.CanStoreInputUserData())
10190 {
10191 ScriptInputUserData ctx = new ScriptInputUserData;
10196 ItemBase destination_entity =
this;
10197 ctx.
Write(destination_entity);
10201 }
10202 }
10203 else if (!
GetGame().IsMultiplayer())
10204 {
10206 }
10207 }
10208
10210 {
10212 float split_quantity_new;
10214 if (player)
10215 {
10217 if (quantity > stackable)
10218 split_quantity_new = stackable;
10219 else
10220 split_quantity_new = quantity;
10221
10223 {
10224 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10225 new_item =
ItemBase.Cast(in_hands);
10226 if (new_item)
10227 {
10228 new_item.SetResultOfSplit(true);
10229 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10231 new_item.SetQuantity(split_quantity_new, false, true);
10232 }
10233 }
10234 }
10235 }
10236
10238 {
10240 float split_quantity_new = Math.Floor(quantity * 0.5);
10241
10243 return;
10244
10246
10247 if (new_item)
10248 {
10249 if (new_item.GetQuantityMax() < split_quantity_new)
10250 {
10251 split_quantity_new = new_item.GetQuantityMax();
10252 }
10253
10254 new_item.SetResultOfSplit(true);
10255 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10256
10258 {
10261 }
10262 else
10263 {
10265 new_item.
SetQuantity(split_quantity_new,
false,
true);
10266 }
10267 }
10268 }
10269
10271 {
10273 float split_quantity_new = Math.Floor(quantity / 2);
10274
10276 return;
10277
10278 InventoryLocation invloc = new InventoryLocation;
10280
10282 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10283
10284 if (new_item)
10285 {
10286 if (new_item.GetQuantityMax() < split_quantity_new)
10287 {
10288 split_quantity_new = new_item.GetQuantityMax();
10289 }
10291 {
10294 }
10295 else if (split_quantity_new > 1)
10296 {
10298 new_item.
SetQuantity(split_quantity_new,
false,
true);
10299 }
10300 }
10301 }
10302
10305 {
10306 SetWeightDirty();
10308
10309 if (parent)
10310 parent.OnAttachmentQuantityChangedEx(this, delta);
10311
10313 {
10315 {
10317 }
10319 {
10320 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10322 }
10323 }
10324
10325 }
10326
10329 {
10330
10331 }
10332
10335 {
10337 }
10338
10340 {
10341 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10342
10344 {
10345 if (newLevel == GameConstants.STATE_RUINED)
10346 {
10348 EntityAI parent = GetHierarchyParent();
10349 if (parent && parent.IsFireplace())
10350 {
10351 CargoBase cargo = GetInventory().GetCargo();
10352 if (cargo)
10353 {
10355 {
10357 }
10358 }
10359 }
10360 }
10361
10363 {
10364
10366 return;
10367 }
10368
10369 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10370 {
10372 }
10373 }
10374 }
10375
10376
10378 {
10379 super.OnRightClick();
10380
10382 {
10384 {
10385 if (ScriptInputUserData.CanStoreInputUserData())
10386 {
10387 EntityAI root = GetHierarchyRoot();
10388 Man playerOwner = GetHierarchyRootPlayer();
10389 InventoryLocation dst = new InventoryLocation;
10390
10391
10392 if (!playerOwner && root && root == this)
10393 {
10395 }
10396 else
10397 {
10398
10399 GetInventory().GetCurrentInventoryLocation(dst);
10401 {
10404 {
10406 }
10407 else
10408 {
10410
10411
10412 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10413 {
10415 }
10416 else
10417 {
10418 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10419 }
10420 }
10421 }
10422 }
10423
10424 ScriptInputUserData ctx = new ScriptInputUserData;
10432 }
10433 }
10434 else if (!
GetGame().IsMultiplayer())
10435 {
10437 }
10438 }
10439 }
10440
10442 {
10443 if (root)
10444 {
10445 vector m4[4];
10446 root.GetTransform(m4);
10447 dst.SetGround(this, m4);
10448 }
10449 else
10450 {
10451 GetInventory().GetCurrentInventoryLocation(dst);
10452 }
10453 }
10454
10455 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10456 {
10457
10458 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10459 return false;
10460
10461 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10462 return false;
10463
10464
10466 return false;
10467
10468
10469 Magazine mag = Magazine.Cast(this);
10470 if (mag)
10471 {
10472 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10473 return false;
10474
10475 if (stack_max_limit)
10476 {
10477 Magazine other_mag = Magazine.Cast(other_item);
10478 if (other_item)
10479 {
10480 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10481 return false;
10482 }
10483
10484 }
10485 }
10486 else
10487 {
10488
10490 return false;
10491
10493 return false;
10494 }
10495
10496 PlayerBase player = null;
10497 if (CastTo(player, GetHierarchyRootPlayer()))
10498 {
10499 if (player.GetInventory().HasAttachment(this))
10500 return false;
10501
10502 if (player.IsItemsToDelete())
10503 return false;
10504 }
10505
10506 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10507 return false;
10508
10509 int slotID;
10511 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10512 return false;
10513
10514 return true;
10515 }
10516
10518 {
10520 }
10521
10523 {
10524 return m_IsResultOfSplit;
10525 }
10526
10528 {
10529 m_IsResultOfSplit = value;
10530 }
10531
10533 {
10535 }
10536
10538 {
10539 float other_item_quantity = other_item.GetQuantity();
10540 float this_free_space;
10541
10543
10545
10546 if (other_item_quantity > this_free_space)
10547 {
10548 return this_free_space;
10549 }
10550 else
10551 {
10552 return other_item_quantity;
10553 }
10554 }
10555
10557 {
10559 }
10560
10562 {
10564 return;
10565
10566 if (!IsMagazine() && other_item)
10567 {
10569 if (quantity_used != 0)
10570 {
10571 float hp1 = GetHealth01("","");
10572 float hp2 = other_item.GetHealth01("","");
10573 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10574 hpResult = hpResult / (
GetQuantity() + quantity_used);
10575
10576 hpResult *= GetMaxHealth();
10577 Math.Round(hpResult);
10578 SetHealth("", "Health", hpResult);
10579
10581 other_item.AddQuantity(-quantity_used);
10582 }
10583 }
10585 }
10586
10588 {
10589 #ifdef SERVER
10590 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10591 GetHierarchyParent().IncreaseLifetimeUp();
10592 #endif
10593 };
10594
10596 {
10597 PlayerBase p = PlayerBase.Cast(player);
10598
10599 array<int> recipesIds = p.m_Recipes;
10600 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10601 if (moduleRecipesManager)
10602 {
10603 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10604 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10605 }
10606
10607 for (int i = 0;i < recipesIds.Count(); i++)
10608 {
10609 int key = recipesIds.Get(i);
10610 string recipeName = moduleRecipesManager.GetRecipeName(key);
10612 }
10613 }
10614
10615
10616 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10617 {
10618 super.GetDebugActions(outputList);
10619
10620
10626
10627
10632
10637
10638
10642
10643
10645 {
10649 }
10650
10653
10654
10658
10660
10661 InventoryLocation loc = new InventoryLocation();
10662 GetInventory().GetCurrentInventoryLocation(loc);
10664 {
10665 if (Gizmo_IsSupported())
10668 }
10669
10671 }
10672
10673
10674
10675
10677 {
10678 super.OnAction(action_id, player, ctx);
10679
10681 {
10682 switch (action_id)
10683 {
10686 return true;
10689 return true;
10690 }
10691 }
10692
10694 {
10695 switch (action_id)
10696 {
10698 Delete();
10699 return true;
10700 }
10701 }
10702
10703 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10704 {
10705 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10706 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10707 PlayerBase p = PlayerBase.Cast(player);
10708 if (
EActions.RECIPES_RANGE_START < 1000)
10709 {
10710 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10711 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10712 }
10713 }
10714 #ifndef SERVER
10715 else if (action_id ==
EActions.WATCH_PLAYER)
10716 {
10717 PluginDeveloper.SetDeveloperItemClientEx(player);
10718 }
10719 #endif
10721 {
10722 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10723 {
10724 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10725 OnDebugButtonPressServer(id + 1);
10726 }
10727
10728 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10729 {
10730 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10732 }
10733
10734 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10735 {
10736 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10738 }
10739
10740 else if (action_id ==
EActions.ADD_QUANTITY)
10741 {
10742 if (IsMagazine())
10743 {
10744 Magazine mag = Magazine.Cast(this);
10745 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10746 }
10747 else
10748 {
10750 }
10751
10752 if (m_EM)
10753 {
10754 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10755 }
10756
10757 }
10758
10759 else if (action_id ==
EActions.REMOVE_QUANTITY)
10760 {
10761 if (IsMagazine())
10762 {
10763 Magazine mag2 = Magazine.Cast(this);
10764 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10765 }
10766 else
10767 {
10769 }
10770 if (m_EM)
10771 {
10772 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10773 }
10774
10775 }
10776
10777 else if (action_id ==
EActions.SET_QUANTITY_0)
10778 {
10780
10781 if (m_EM)
10782 {
10783 m_EM.SetEnergy(0);
10784 }
10785 }
10786
10787 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10788 {
10790
10791 if (m_EM)
10792 {
10793 m_EM.SetEnergy(m_EM.GetEnergyMax());
10794 }
10795 }
10796
10797 else if (action_id ==
EActions.ADD_HEALTH)
10798 {
10799 AddHealth("","",GetMaxHealth("","Health")/5);
10800 }
10801 else if (action_id ==
EActions.REMOVE_HEALTH)
10802 {
10803 AddHealth("","",-GetMaxHealth("","Health")/5);
10804 }
10805 else if (action_id ==
EActions.DESTROY_HEALTH)
10806 {
10807 SetHealth01("","",0);
10808 }
10809 else if (action_id ==
EActions.WATCH_ITEM)
10810 {
10812 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10813 #ifdef DEVELOPER
10814 SetDebugDeveloper_item(this);
10815 #endif
10816 }
10817
10818 else if (action_id ==
EActions.ADD_TEMPERATURE)
10819 {
10820 AddTemperature(20);
10821
10822 }
10823
10824 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10825 {
10826 AddTemperature(-20);
10827
10828 }
10829
10830 else if (action_id ==
EActions.FLIP_FROZEN)
10831 {
10832 SetFrozen(!GetIsFrozen());
10833
10834 }
10835
10836 else if (action_id ==
EActions.ADD_WETNESS)
10837 {
10839
10840 }
10841
10842 else if (action_id ==
EActions.REMOVE_WETNESS)
10843 {
10845
10846 }
10847
10848 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10849 {
10852
10853
10854 }
10855
10856 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10857 {
10860 }
10861
10862 else if (action_id ==
EActions.MAKE_SPECIAL)
10863 {
10864 auto debugParams = DebugSpawnParams.WithPlayer(player);
10865 OnDebugSpawnEx(debugParams);
10866 }
10867
10868 }
10869
10870
10871 return false;
10872 }
10873
10874
10875
10876
10880
10883
10884
10885
10887 {
10888 return false;
10889 }
10890
10891
10893 {
10894 return true;
10895 }
10896
10897
10899 {
10900 return true;
10901 }
10902
10903
10904
10906 {
10907 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10909 }
10910
10913 {
10914 return null;
10915 }
10916
10918 {
10919 return false;
10920 }
10921
10923 {
10924 return false;
10925 }
10926
10930
10931
10933 {
10934 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10935 return module_repairing.CanRepair(this, item_repair_kit);
10936 }
10937
10938
10939 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10940 {
10941 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10942 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10943 }
10944
10945
10947 {
10948
10949
10950
10951
10952
10953
10954
10955
10956 return 1;
10957 }
10958
10959
10960
10962 {
10964 }
10965
10966
10967
10969 {
10971 }
10972
10973
10982 {
10983 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10984
10985 if (player)
10986 {
10987 player.MessageStatus(text);
10988 }
10989 }
10990
10991
11000 {
11001 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11002
11003 if (player)
11004 {
11005 player.MessageAction(text);
11006 }
11007 }
11008
11009
11018 {
11019 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11020
11021 if (player)
11022 {
11023 player.MessageFriendly(text);
11024 }
11025 }
11026
11027
11036 {
11037 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11038
11039 if (player)
11040 {
11041 player.MessageImportant(text);
11042 }
11043 }
11044
11046 {
11047 return true;
11048 }
11049
11050
11051 override bool KindOf(
string tag)
11052 {
11053 bool found = false;
11054 string item_name = this.
GetType();
11057
11058 int array_size = item_tag_array.Count();
11059 for (int i = 0; i < array_size; i++)
11060 {
11061 if (item_tag_array.Get(i) == tag)
11062 {
11063 found = true;
11064 break;
11065 }
11066 }
11067 return found;
11068 }
11069
11070
11072 {
11073
11074 super.OnRPC(sender, rpc_type,ctx);
11075
11076
11077 switch (rpc_type)
11078 {
11079 #ifndef SERVER
11080 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11081 Param2<bool, string> p = new Param2<bool, string>(false, "");
11082
11084 return;
11085
11086 bool play = p.param1;
11087 string soundSet = p.param2;
11088
11089 if (play)
11090 {
11092 {
11094 {
11096 }
11097 }
11098 else
11099 {
11101 }
11102 }
11103 else
11104 {
11106 }
11107
11108 break;
11109 #endif
11110
11111 }
11112
11114 {
11116 }
11117 }
11118
11119
11120
11121
11123 {
11124 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11125 return plugin.GetID(
name);
11126 }
11127
11129 {
11130 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11131 return plugin.GetName(id);
11132 }
11133
11136 {
11137
11138
11139 int varFlags;
11140 if (!ctx.
Read(varFlags))
11141 return;
11142
11143 if (varFlags & ItemVariableFlags.FLOAT)
11144 {
11146 }
11147 }
11148
11150 {
11151
11152 super.SerializeNumericalVars(floats_out);
11153
11154
11155
11157 {
11159 }
11160
11162 {
11164 }
11165
11167 {
11169 }
11170
11172 {
11177 }
11178
11180 {
11182 }
11183 }
11184
11186 {
11187
11188 super.DeSerializeNumericalVars(floats);
11189
11190
11191 int index = 0;
11192 int mask = Math.Round(floats.Get(index));
11193
11194 index++;
11195
11197 {
11199 {
11201 }
11202 else
11203 {
11204 float quantity = floats.Get(index);
11205 SetQuantity(quantity,
true,
false,
false,
false);
11206 }
11207 index++;
11208 }
11209
11211 {
11212 float wet = floats.Get(index);
11214 index++;
11215 }
11216
11218 {
11219 int liquidtype = Math.Round(floats.Get(index));
11221 index++;
11222 }
11223
11225 {
11227 index++;
11229 index++;
11231 index++;
11233 index++;
11234 }
11235
11237 {
11238 int cleanness = Math.Round(floats.Get(index));
11240 index++;
11241 }
11242 }
11243
11245 {
11246 super.WriteVarsToCTX(ctx);
11247
11248
11250 {
11252 }
11253
11255 {
11257 }
11258
11260 {
11262 }
11263
11265 {
11266 int r,g,b,a;
11272 }
11273
11275 {
11277 }
11278 }
11279
11281 {
11282 if (!super.ReadVarsFromCTX(ctx,version))
11283 return false;
11284
11285 int intValue;
11286 float value;
11287
11288 if (version < 140)
11289 {
11290 if (!ctx.
Read(intValue))
11291 return false;
11292
11293 m_VariablesMask = intValue;
11294 }
11295
11297 {
11298 if (!ctx.
Read(value))
11299 return false;
11300
11302 {
11304 }
11305 else
11306 {
11308 }
11309 }
11310
11311 if (version < 140)
11312 {
11314 {
11315 if (!ctx.
Read(value))
11316 return false;
11317 SetTemperatureDirect(value);
11318 }
11319 }
11320
11322 {
11323 if (!ctx.
Read(value))
11324 return false;
11326 }
11327
11329 {
11330 if (!ctx.
Read(intValue))
11331 return false;
11333 }
11334
11336 {
11337 int r,g,b,a;
11339 return false;
11341 return false;
11343 return false;
11345 return false;
11346
11348 }
11349
11351 {
11352 if (!ctx.
Read(intValue))
11353 return false;
11355 }
11356
11357 if (version >= 138 && version < 140)
11358 {
11360 {
11361 if (!ctx.
Read(intValue))
11362 return false;
11363 SetFrozen(intValue);
11364 }
11365 }
11366
11367 return true;
11368 }
11369
11370
11372 {
11375 {
11377 }
11378
11379 if (!super.OnStoreLoad(ctx, version))
11380 {
11382 return false;
11383 }
11384
11385 if (version >= 114)
11386 {
11387 bool hasQuickBarIndexSaved;
11388
11389 if (!ctx.
Read(hasQuickBarIndexSaved))
11390 {
11392 return false;
11393 }
11394
11395 if (hasQuickBarIndexSaved)
11396 {
11397 int itmQBIndex;
11398
11399
11400 if (!ctx.
Read(itmQBIndex))
11401 {
11403 return false;
11404 }
11405
11406 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11407 if (itmQBIndex != -1 && parentPlayer)
11408 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11409 }
11410 }
11411 else
11412 {
11413
11414 PlayerBase player;
11415 int itemQBIndex;
11416 if (version ==
int.
MAX)
11417 {
11418 if (!ctx.
Read(itemQBIndex))
11419 {
11421 return false;
11422 }
11423 }
11424 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11425 {
11426
11427 if (!ctx.
Read(itemQBIndex))
11428 {
11430 return false;
11431 }
11432 if (itemQBIndex != -1 && player)
11433 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11434 }
11435 }
11436
11437 if (version < 140)
11438 {
11439
11440 if (!LoadVariables(ctx, version))
11441 {
11443 return false;
11444 }
11445 }
11446
11447
11449 {
11451 return false;
11452 }
11453 if (version >= 132)
11454 {
11456 if (raib)
11457 {
11459 {
11461 return false;
11462 }
11463 }
11464 }
11465
11467 return true;
11468 }
11469
11470
11471
11473 {
11474 super.OnStoreSave(ctx);
11475
11476 PlayerBase player;
11477 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11478 {
11480
11481 int itemQBIndex = -1;
11482 itemQBIndex = player.FindQuickBarEntityIndex(this);
11483 ctx.
Write(itemQBIndex);
11484 }
11485 else
11486 {
11488 }
11489
11491
11493 if (raib)
11494 {
11496 }
11497 }
11498
11499
11501 {
11502 super.AfterStoreLoad();
11503
11505 {
11507 }
11508
11510 {
11513 }
11514 }
11515
11517 {
11518 super.EEOnAfterLoad();
11519
11521 {
11523 }
11524
11527 }
11528
11530 {
11531 return false;
11532 }
11533
11534
11535
11537 {
11539 {
11540 #ifdef PLATFORM_CONSOLE
11541
11543 {
11545 if (menu)
11546 {
11548 }
11549 }
11550 #endif
11551 }
11552
11554 {
11557 }
11558
11560 {
11561 SetWeightDirty();
11563 }
11565 {
11568 }
11569
11571 {
11574 }
11576 {
11579 }
11580
11581 super.OnVariablesSynchronized();
11582 }
11583
11584
11585
11587 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11588 {
11589 if (!IsServerCheck(allow_client))
11590 return false;
11591
11593 return false;
11594
11597
11598 if (value <= (min + 0.001))
11599 value = min;
11600
11601 if (value == min)
11602 {
11603 if (destroy_config)
11604 {
11605 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11606 if (dstr)
11607 {
11609 this.Delete();
11610 return true;
11611 }
11612 }
11613 else if (destroy_forced)
11614 {
11616 this.Delete();
11617 return true;
11618 }
11619
11621 }
11622
11625
11627 {
11629
11630 if (delta)
11632 }
11633
11635
11636 return false;
11637 }
11638
11639
11641 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11642 {
11644 }
11645
11647 {
11650 }
11651
11653 {
11656 }
11657
11659 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11660 {
11661 float value_clamped = Math.Clamp(value, 0, 1);
11663 SetQuantity(result, destroy_config, destroy_forced);
11664 }
11665
11666
11669 {
11671 }
11672
11674 {
11676 }
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11688 {
11689 int slot = -1;
11690 if (GetInventory())
11691 {
11692 InventoryLocation il = new InventoryLocation;
11693 GetInventory().GetCurrentInventoryLocation(il);
11695 }
11696
11698 }
11699
11701 {
11702 float quantity_max = 0;
11703
11705 {
11706 if (attSlotID != -1)
11707 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11708
11709 if (quantity_max <= 0)
11711 }
11712
11713 if (quantity_max <= 0)
11715
11716 return quantity_max;
11717 }
11718
11720 {
11722 }
11723
11725 {
11727 }
11728
11729
11731 {
11733 }
11734
11736 {
11738 }
11739
11741 {
11743 }
11744
11745
11747 {
11748
11749 float weightEx = GetWeightEx();
11750 float special = GetInventoryAndCargoWeight();
11751 return weightEx - special;
11752 }
11753
11754
11756 {
11758 }
11759
11761 {
11763 {
11764 #ifdef DEVELOPER
11765 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11766 {
11767 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11769 }
11770 #endif
11771
11772 return GetQuantity() * GetConfigWeightModified();
11773 }
11774 else if (HasEnergyManager())
11775 {
11776 #ifdef DEVELOPER
11777 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11778 {
11779 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11780 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11781 }
11782 #endif
11783 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11784 }
11785 else
11786 {
11787 #ifdef DEVELOPER
11788 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11789 {
11790 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11791 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11792 }
11793 #endif
11794 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11795 }
11796 }
11797
11800 {
11801 int item_count = 0;
11803
11804 if (GetInventory().GetCargo() != NULL)
11805 {
11806 item_count = GetInventory().GetCargo().GetItemCount();
11807 }
11808
11809 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11810 {
11811 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11812 if (item)
11813 item_count += item.GetNumberOfItems();
11814 }
11815 return item_count;
11816 }
11817
11820 {
11821 float weight = 0;
11822 float wetness = 1;
11823 if (include_wetness)
11826 {
11827 weight = wetness * m_ConfigWeight;
11828 }
11830 {
11831 weight = 1;
11832 }
11833 return weight;
11834 }
11835
11836
11837
11839 {
11840 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11841 {
11842 GameInventory inv = GetInventory();
11843 array<EntityAI> items = new array<EntityAI>;
11845 for (int i = 0; i < items.Count(); i++)
11846 {
11848 if (item)
11849 {
11851 }
11852 }
11853 }
11854 }
11855
11856
11857
11858
11860 {
11861 float energy = 0;
11862 if (HasEnergyManager())
11863 {
11864 energy = GetCompEM().GetEnergy();
11865 }
11866 return energy;
11867 }
11868
11869
11871 {
11872 super.OnEnergyConsumed();
11873
11875 }
11876
11878 {
11879 super.OnEnergyAdded();
11880
11882 }
11883
11884
11886 {
11887 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11888 {
11890 {
11891 float energy_0to1 = GetCompEM().GetEnergy0To1();
11893 }
11894 }
11895 }
11896
11897
11899 {
11900 return ConfigGetFloat("heatIsolation");
11901 }
11902
11904 {
11906 }
11907
11909 {
11910 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11911 if (
GetGame().ConfigIsExisting(paramPath))
11913
11914 return 0.0;
11915 }
11916
11918 {
11919 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11920 if (
GetGame().ConfigIsExisting(paramPath))
11922
11923 return 0.0;
11924 }
11925
11926 override void SetWet(
float value,
bool allow_client =
false)
11927 {
11928 if (!IsServerCheck(allow_client))
11929 return;
11930
11933
11935
11936 m_VarWet = Math.Clamp(value, min, max);
11937
11939 {
11942 }
11943 }
11944
11945 override void AddWet(
float value)
11946 {
11948 }
11949
11951 {
11953 }
11954
11956 {
11958 }
11959
11961 {
11963 }
11964
11966 {
11968 }
11969
11971 {
11973 }
11974
11975 override void OnWetChanged(
float newVal,
float oldVal)
11976 {
11979 if (newLevel != oldLevel)
11980 {
11982 }
11983 }
11984
11986 {
11987 SetWeightDirty();
11988 }
11989
11991 {
11992 return GetWetLevelInternal(
m_VarWet);
11993 }
11994
11995
11996
11998 {
12000 }
12001
12003 {
12005 }
12006
12008 {
12010 }
12011
12013 {
12015 }
12016
12017
12018
12020 {
12021 if (ConfigIsExisting("itemModelLength"))
12022 {
12023 return ConfigGetFloat("itemModelLength");
12024 }
12025 return 0;
12026 }
12027
12029 {
12030 if (ConfigIsExisting("itemAttachOffset"))
12031 {
12032 return ConfigGetFloat("itemAttachOffset");
12033 }
12034 return 0;
12035 }
12036
12037 override void SetCleanness(
int value,
bool allow_client =
false)
12038 {
12039 if (!IsServerCheck(allow_client))
12040 return;
12041
12043
12045
12048 }
12049
12051 {
12053 }
12054
12056 {
12057 return true;
12058 }
12059
12060
12061
12062
12064 {
12066 }
12067
12069 {
12071 }
12072
12073
12074
12075
12076 override void SetColor(
int r,
int g,
int b,
int a)
12077 {
12083 }
12085 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12086 {
12091 }
12092
12094 {
12096 }
12097
12100 {
12101 int r,g,b,a;
12103 r = r/255;
12104 g = g/255;
12105 b = b/255;
12106 a = a/255;
12107 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12108 }
12109
12110
12111
12112 override void SetLiquidType(
int value,
bool allow_client =
false)
12113 {
12114 if (!IsServerCheck(allow_client))
12115 return;
12116
12121 }
12122
12124 {
12125 return ConfigGetInt("varLiquidTypeInit");
12126 }
12127
12129 {
12131 }
12132
12134 {
12136 SetFrozen(false);
12137 }
12138
12141 {
12142 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12143 }
12144
12145
12148 {
12149 PlayerBase nplayer;
12150 if (PlayerBase.CastTo(nplayer, player))
12151 {
12153
12154 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12155 }
12156 }
12157
12158
12161 {
12162 PlayerBase nplayer;
12163 if (PlayerBase.CastTo(nplayer,player))
12164 {
12165
12166 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12167
12168 }
12169
12170
12171 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12172
12173
12174 if (HasEnergyManager())
12175 {
12176 GetCompEM().UpdatePlugState();
12177 }
12178 }
12179
12180
12182 {
12183 super.OnPlacementStarted(player);
12184
12186 }
12187
12188 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12189 {
12191 {
12192 m_AdminLog.OnPlacementComplete(player,
this);
12193 }
12194
12195 super.OnPlacementComplete(player, position, orientation);
12196 }
12197
12198
12199
12200
12201
12203 {
12205 {
12206 return true;
12207 }
12208 else
12209 {
12210 return false;
12211 }
12212 }
12213
12214
12216 {
12218 {
12220 }
12221 }
12222
12223
12225 {
12227 }
12228
12230 {
12232 }
12233
12234 override void InsertAgent(
int agent,
float count = 1)
12235 {
12236 if (count < 1)
12237 return;
12238
12240 }
12241
12244 {
12246 }
12247
12248
12250 {
12252 }
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12296 {
12298 return false;
12299 return true;
12300 }
12301
12303 {
12304
12306 }
12307
12308
12311 {
12312 super.CheckForRoofLimited(timeTresholdMS);
12313
12315 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12316 {
12317 m_PreviousRoofTestTime = time;
12318 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12319 }
12320 }
12321
12322
12324 {
12326 {
12327 return 0;
12328 }
12329
12330 if (GetInventory().GetAttachmentSlotsCount() != 0)
12331 {
12332 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12333 if (filter)
12334 return filter.GetProtectionLevel(type, false, system);
12335 else
12336 return 0;
12337 }
12338
12339 string subclassPath, entryName;
12340
12341 switch (type)
12342 {
12344 entryName = "biological";
12345 break;
12347 entryName = "chemical";
12348 break;
12349 default:
12350 entryName = "biological";
12351 break;
12352 }
12353
12354 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12355
12357 }
12358
12359
12360
12363 {
12364 if (!IsMagazine())
12366
12368 }
12369
12370
12371
12372
12373
12378 {
12379 return true;
12380 }
12381
12383 {
12385 }
12386
12387
12388
12389
12390
12392 {
12393 if (parent)
12394 {
12395 if (parent.IsInherited(DayZInfected))
12396 return true;
12397
12398 if (!parent.IsRuined())
12399 return true;
12400 }
12401
12402 return true;
12403 }
12404
12406 {
12407 if (!super.CanPutAsAttachment(parent))
12408 {
12409 return false;
12410 }
12411
12412 if (!IsRuined() && !parent.IsRuined())
12413 {
12414 return true;
12415 }
12416
12417 return false;
12418 }
12419
12421 {
12422
12423
12424
12425
12426 return super.CanReceiveItemIntoCargo(item);
12427 }
12428
12430 {
12431
12432
12433
12434
12435 GameInventory attachmentInv = attachment.GetInventory();
12437 {
12438 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12439 return false;
12440 }
12441
12442 InventoryLocation loc = new InventoryLocation();
12443 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12444 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12445 return false;
12446
12447 return super.CanReceiveAttachment(attachment, slotId);
12448 }
12449
12451 {
12452 if (!super.CanReleaseAttachment(attachment))
12453 return false;
12454
12455 return GetInventory().AreChildrenAccessible();
12456 }
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12479 {
12480 int id = muzzle_owner.GetMuzzleID();
12481 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12482
12483 if (WPOF_array)
12484 {
12485 for (int i = 0; i < WPOF_array.Count(); i++)
12486 {
12487 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12488
12489 if (WPOF)
12490 {
12491 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12492 }
12493 }
12494 }
12495 }
12496
12497
12499 {
12500 int id = muzzle_owner.GetMuzzleID();
12502
12503 if (WPOBE_array)
12504 {
12505 for (int i = 0; i < WPOBE_array.Count(); i++)
12506 {
12507 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12508
12509 if (WPOBE)
12510 {
12511 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12512 }
12513 }
12514 }
12515 }
12516
12517
12519 {
12520 int id = muzzle_owner.GetMuzzleID();
12521 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12522
12523 if (WPOOH_array)
12524 {
12525 for (int i = 0; i < WPOOH_array.Count(); i++)
12526 {
12527 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12528
12529 if (WPOOH)
12530 {
12531 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12532 }
12533 }
12534 }
12535 }
12536
12537
12539 {
12540 int id = muzzle_owner.GetMuzzleID();
12541 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12542
12543 if (WPOOH_array)
12544 {
12545 for (int i = 0; i < WPOOH_array.Count(); i++)
12546 {
12547 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12548
12549 if (WPOOH)
12550 {
12551 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12552 }
12553 }
12554 }
12555 }
12556
12557
12559 {
12560 int id = muzzle_owner.GetMuzzleID();
12561 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12562
12563 if (WPOOH_array)
12564 {
12565 for (int i = 0; i < WPOOH_array.Count(); i++)
12566 {
12567 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12568
12569 if (WPOOH)
12570 {
12571 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12572 }
12573 }
12574 }
12575 }
12576
12577
12578
12580 {
12582 {
12583 return true;
12584 }
12585
12586 return false;
12587 }
12588
12590 {
12592 {
12593 return true;
12594 }
12595
12596 return false;
12597 }
12598
12600 {
12602 {
12603 return true;
12604 }
12605
12606 return false;
12607 }
12608
12610 {
12611 return false;
12612 }
12613
12616 {
12617 return UATimeSpent.DEFAULT_DEPLOY;
12618 }
12619
12620
12621
12622
12624 {
12626 SetSynchDirty();
12627 }
12628
12630 {
12632 }
12633
12634
12636 {
12637 return false;
12638 }
12639
12642 {
12643 string att_type = "None";
12644
12645 if (ConfigIsExisting("soundAttType"))
12646 {
12647 att_type = ConfigGetString("soundAttType");
12648 }
12649
12651 }
12652
12654 {
12656 }
12657
12658
12659
12660
12661
12667
12669 {
12672
12674 }
12675
12676
12678 {
12680 return;
12681
12683
12686
12689
12690 SoundParameters params = new SoundParameters();
12694 }
12695
12696
12698 {
12700 return;
12701
12703 SetSynchDirty();
12704
12707 }
12708
12709
12711 {
12713 return;
12714
12716 SetSynchDirty();
12717
12720 }
12721
12723 {
12725 }
12726
12728 {
12730 }
12731
12734 {
12735 if (!
GetGame().IsDedicatedServer())
12736 {
12737 if (ConfigIsExisting("attachSoundSet"))
12738 {
12739 string cfg_path = "";
12740 string soundset = "";
12741 string type_name =
GetType();
12742
12745 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12746 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12747
12748 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12749 {
12750 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12751 {
12752 if (cfg_slot_array[i] == slot_type)
12753 {
12754 soundset = cfg_soundset_array[i];
12755 break;
12756 }
12757 }
12758 }
12759
12760 if (soundset != "")
12761 {
12762 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12764 }
12765 }
12766 }
12767 }
12768
12770 {
12771
12772 }
12773
12774 void OnApply(PlayerBase player);
12775
12777 {
12778 return 1.0;
12779 };
12780
12782 {
12784 }
12785
12787 {
12789 }
12790
12792
12794 {
12795 SetDynamicPhysicsLifeTime(0.01);
12797 }
12798
12800 {
12801 array<string> zone_names = new array<string>;
12802 GetDamageZones(zone_names);
12803 for (int i = 0; i < zone_names.Count(); i++)
12804 {
12805 SetHealthMax(zone_names.Get(i),"Health");
12806 }
12807 SetHealthMax("","Health");
12808 }
12809
12812 {
12813 float global_health = GetHealth01("","Health");
12814 array<string> zones = new array<string>;
12815 GetDamageZones(zones);
12816
12817 for (int i = 0; i < zones.Count(); i++)
12818 {
12819 SetHealth01(zones.Get(i),"Health",global_health);
12820 }
12821 }
12822
12825 {
12826 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12827 }
12828
12830 {
12831 if (!hasRootAsPlayer)
12832 {
12833 if (refParentIB)
12834 {
12835
12836 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12837 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12838
12839 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12840 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12841
12844 }
12845 else
12846 {
12847
12850 }
12851 }
12852 }
12853
12855 {
12857 {
12858 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12859 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12860 {
12861 float heatPermCoef = 1.0;
12863 while (ent)
12864 {
12865 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12866 ent = ent.GetHierarchyParent();
12867 }
12868
12869 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12870 }
12871 }
12872 }
12873
12875 {
12876
12877 EntityAI parent = GetHierarchyParent();
12878 if (!parent)
12879 {
12880 hasParent = false;
12881 hasRootAsPlayer = false;
12882 }
12883 else
12884 {
12885 hasParent = true;
12886 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12887 refParentIB =
ItemBase.Cast(parent);
12888 }
12889 }
12890
12891 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12892 {
12893
12894 }
12895
12897 {
12898
12899 return false;
12900 }
12901
12903 {
12904
12905
12906 return false;
12907 }
12908
12910 {
12911
12912 return false;
12913 }
12914
12917 {
12918 return !GetIsFrozen() &&
IsOpen();
12919 }
12920
12922 {
12923 bool hasParent = false, hasRootAsPlayer = false;
12925
12926 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12927 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12928
12929 if (wwtu || foodDecay)
12930 {
12934
12935 if (processWetness || processTemperature || processDecay)
12936 {
12938
12939 if (processWetness)
12940 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12941
12942 if (processTemperature)
12944
12945 if (processDecay)
12946 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12947 }
12948 }
12949 }
12950
12953 {
12955 }
12956
12958 {
12961
12962 return super.GetTemperatureFreezeThreshold();
12963 }
12964
12966 {
12969
12970 return super.GetTemperatureThawThreshold();
12971 }
12972
12974 {
12977
12978 return super.GetItemOverheatThreshold();
12979 }
12980
12982 {
12984 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12985
12986 return super.GetTemperatureFreezeTime();
12987 }
12988
12990 {
12992 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12993
12994 return super.GetTemperatureThawTime();
12995 }
12996
13001
13003 {
13004 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13005 }
13006
13008 {
13009 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13010 }
13011
13014 {
13016 }
13017
13019 {
13021 }
13022
13024 {
13026 }
13027
13030 {
13031 return null;
13032 }
13033
13036 {
13037 return false;
13038 }
13039
13041 {
13043 {
13046 if (!trg)
13047 {
13049 explosive = this;
13050 }
13051
13052 explosive.PairRemote(trg);
13054
13055 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13056 trg.SetPersistentPairID(persistentID);
13057 explosive.SetPersistentPairID(persistentID);
13058
13059 return true;
13060 }
13061 return false;
13062 }
13063
13066 {
13067 float ret = 1.0;
13070 ret *= GetHealth01();
13071
13072 return ret;
13073 }
13074
13075 #ifdef DEVELOPER
13076 override void SetDebugItem()
13077 {
13078 super.SetDebugItem();
13079 _itemBase = this;
13080 }
13081
13083 {
13084 string text = super.GetDebugText();
13085
13087 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13088
13089 return text;
13090 }
13091 #endif
13092
13094 {
13095 return true;
13096 }
13097
13099
13101
13103 {
13106 }
13107
13108
13116
13132}
13133
13135{
13137 if (entity)
13138 {
13139 bool is_item = entity.IsInherited(
ItemBase);
13140 if (is_item && full_quantity)
13141 {
13144 }
13145 }
13146 else
13147 {
13149 return NULL;
13150 }
13151 return entity;
13152}
13153
13155{
13156 if (item)
13157 {
13158 if (health > 0)
13159 item.SetHealth("", "", health);
13160
13161 if (item.CanHaveTemperature())
13162 {
13164 if (item.CanFreeze())
13165 item.SetFrozen(false);
13166 }
13167
13168 if (item.HasEnergyManager())
13169 {
13170 if (quantity >= 0)
13171 {
13172 item.GetCompEM().SetEnergy0To1(quantity);
13173 }
13174 else
13175 {
13177 }
13178 }
13179 else if (item.IsMagazine())
13180 {
13181 Magazine mag = Magazine.Cast(item);
13182 if (quantity >= 0)
13183 {
13184 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13185 }
13186 else
13187 {
13189 }
13190
13191 }
13192 else
13193 {
13194 if (quantity >= 0)
13195 {
13196 item.SetQuantityNormalized(quantity, false);
13197 }
13198 else
13199 {
13201 }
13202
13203 }
13204 }
13205}
13206
13207#ifdef DEVELOPER
13209#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.